*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: system-ui, sans-serif;
  color: #4a4a4a;
  line-height: 1.5;
  background: #eee;
}

header {
  background: #363636;
  color: #fff;
  padding: 2.5rem 1.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
}

section {
  padding: 3rem 1.5rem;
  text-align: center;
}

#projects    { background: #f5f5f5; }
#companies   { background: #eeeeee; }
#side-quests { background: #e3e3e3; }
#websites    { background: #d8d8d8; }

h1 { font-size: 2rem; font-weight: 700; cursor: pointer; }
h2 { font-size: 1.5rem; font-weight: 700; margin-bottom: 0.75rem; }
h3 { font-size: 1.1rem; font-weight: 600; margin-top: 0.5rem; }

pre { font-size: 0.9rem; margin-top: 0.25rem; white-space: pre-wrap; }

a {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}

header a { color: lightgray; }
header a > img { filter: brightness(0) invert(0.84); }

header > div:last-child {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 0.4rem;
  margin-left: auto;
}

hr {
  border: none;
  border-top: 1px solid #ccc;
  margin: 0.5rem 0 2rem;
}

.grid {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  justify-content: center;
}

.grid > div { min-width: 150px; max-width: 250px; flex: 1; }

.grid img,
#modal-logo img {
  width: 64px;
  height: 64px;
  object-fit: contain;
  transform: scale(var(--zoom, 1));
}
.grid span { color: #888; font-size: 0.9rem; }

/* Modal */
#modal {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 100;
}

#modal[hidden] { display: none; }

#modal-window {
  background: #f0f0f0;
  border: 1px solid #888;
  box-shadow: 4px 4px 0 rgba(0,0,0,0.4);
  width: 90%;
  max-width: 400px;
  font-family: monospace;
}

#modal-bar {
  background: #363636;
  color: #fff;
  padding: 0.35rem 0.75rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.85rem;
  font-weight: bold;
  cursor: move;
  user-select: none;
}

#modal-close {
  background: none;
  border: 1px solid #777;
  color: #fff;
  cursor: pointer;
  font-size: 0.7rem;
  padding: 0.1rem 0.35rem;
  line-height: 1.4;
}

#modal-close:hover { background: #c00; border-color: #c00; }

#modal-body {
  padding: 1.25rem;
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  background: #eee;
}

#modal-logo {
  flex-shrink: 0;
  width: 64px;
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: center;
}

#modal-info {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.82rem;
  overflow: hidden;
  min-width: 0;
}

#modal-link { word-break: break-all; color: #0a0; }
#modal-link.not-found { color: #c00; }
#modal-date { color: #888; }
#modal-desc { color: #4a4a4a; margin-top: 0.25rem; }
