@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600&display=swap');

:root {
  --page: #1A1A1A;
  --panel: #1A1A1A;
  --surface: #d9d9d9;
  --text: #f4f4f4;
  --muted: #a8a8a8;
  --line: #4b4b4b;
  --accent: #ffffff;
  --max-width: 1800px;
  --header-height: 86px;
  --content-scale: clamp(1, calc(0.82 + 1.8vw / 100), 1.3);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--page);
  color: var(--text);
  font-family: Inter, Arial, sans-serif;
  min-height: 100vh;
}
button, a { font: inherit; }
a { color: inherit; text-decoration: none; }

.site-shell {
  width: min(calc(100% - 48px), var(--max-width));
  margin: 0 auto 36px;
  background: var(--panel);
  padding: 0 5% 48px;
  overflow: hidden;
}

/* Fixed header: it remains available anywhere on the page. */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  padding: 0 7%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(26, 26, 26, .96);
  border-bottom: 1px solid var(--line);
  z-index: 1000;
  isolation: isolate;
  transition: box-shadow .25s ease, background .25s ease;
}

.site-header::after {
  content: "";
  position: absolute;
  z-index: -1;
  left: 0;
  right: 0;
  top: 100%;
  height: 42px;
  background: linear-gradient(to bottom, rgba(0,0,0,.42), rgba(0,0,0,0));
  opacity: 0;
  pointer-events: none;
  transition: opacity .25s ease;
}

.site-header.scrolled {
  background: rgba(26, 26, 26, .98);
  box-shadow: 0 1px 0 rgba(255,255,255,.04);
}
.site-header.scrolled::after { opacity: 1; }

.logo {
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
}
.logo img {
  display: block;
  width: auto;
  height: clamp(42px, 5vw, 72px);
  max-width: min(260px, 28vw);
  object-fit: contain;
}
.logo-fallback { display: none; font-size: 24px; letter-spacing: -.04em; }
.logo img.is-missing { display: none; }
.logo img.is-missing + .logo-fallback { display: block; }

.nav { margin-left: auto; display: flex; gap: clamp(28px, 5vw, 72px); }
.nav a { font-size: 18px; transition: opacity .2s, transform .2s; }
.nav a:hover { opacity: .6; transform: translateY(-2px); }

/* Prevent the fixed header from covering the first section. */
.portfolio { padding-top: calc(var(--header-height) + 64px); }
.portfolio {
  width: min(100%, 1800px);
  margin-inline: auto;
  display: grid;
  /* Keep the main viewer on the exact center line. The side columns absorb
     the remaining space, while the game list sits against the left side. */
  grid-template-columns: minmax(220px, 1fr) minmax(0, clamp(840px, 66vw, 1160px)) minmax(220px, 1fr);
  column-gap: clamp(10px, 1.2vw, 22px);
  justify-content: center;
  padding-bottom: 109px;
  border-bottom: 1px solid var(--line);
}

.game-list {
  min-width: 0;
  width: min(100%, 220px);
  justify-self: end;
  padding-top: var(--game-list-offset, 0px);
  min-height: 0;
}
.game-list-scroll {
  width: 100%;
  max-height: calc(100vh - var(--header-height) - 110px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 12px 20px;
  scrollbar-width: none;
  overscroll-behavior-y: contain;
}
.game-list-scroll.has-overflow {
  scrollbar-width: thin;
  scrollbar-color: #666 transparent;
}
.game-list-scroll::-webkit-scrollbar { width: 0; }
.game-list-scroll.has-overflow::-webkit-scrollbar { width: 7px; }
.game-list-scroll::-webkit-scrollbar-track { background: transparent; }
.game-list-scroll::-webkit-scrollbar-thumb {
  background: #666;
  border-radius: 999px;
  border: 2px solid var(--panel);
}
.game-list-scroll::-webkit-scrollbar-thumb:hover { background: #999; }
.game-list-track {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.game-button {
  width: 100%;
  max-width: none;
  align-self: center;
  aspect-ratio: 16 / 9;
  border: 0;
  background: var(--surface);
  cursor: pointer;
  display: block;
  padding: 0;
  position: relative;
  overflow: hidden;
  opacity: .38;
  transition: opacity .2s ease, transform .22s ease, box-shadow .22s ease;
  transform-origin: center center;
}
.game-button::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 2px solid var(--accent);
  pointer-events: none;
  opacity: 0;
  transition: opacity .28s ease;
}
.game-button.active::after { opacity: 1; }
.game-button:hover, .game-button:focus-visible, .game-button.active { opacity: 1; }
.game-button:hover, .game-button:focus-visible, .game-button.active { transform: scale(1.08); }
.game-button.active { box-shadow: 0 14px 32px rgba(0,0,0,.38); }
.game-button:hover, .game-button:focus-visible { box-shadow: 0 12px 28px rgba(0,0,0,.30); }
.game-button img { width: 100%; height: 100%; object-fit: cover; display: block; }
.game-button .game-fallback {
  width: 100%; height: 100%; display: grid; place-items: center;
  color: #666; font-size: 12px; letter-spacing: .12em; text-transform: uppercase;
  background: #d9d9d9;
}

.game-viewer { min-width: 0; width: 100%; }
.selected-game-heading { margin-bottom: clamp(20px, 1.8vw, 26px); }
.selected-game-heading .eyebrow { margin-bottom: 10px; }
.selected-game-heading h1 {
  margin: 0;
  font-size: clamp(38px, 5vw, 76px);
  font-weight: 500;
  letter-spacing: -.05em;
}

.preview {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--surface);
  overflow: hidden;
  transition: background .25s ease;
  box-shadow: 0 16px 38px rgba(0,0,0,.38);
}
.preview-placeholder {
  width: 100%; height: 100%; color: #777; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 8px; user-select: none;
}
.preview-placeholder span { font-size: 13px; letter-spacing: .16em; }
.preview-placeholder strong { font-size: clamp(30px, 5vw, 70px); font-weight: 500; letter-spacing: -.06em; }
.preview-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  display: block;
  background: transparent;
}
.preview-image.dim-preview { opacity: .5; }
.preview-overlay {
  position: absolute; left: 18px; bottom: 16px; display: flex; align-items: center; gap: 9px;
  color: #202020; font-size: 11px; letter-spacing: .12em; background: rgba(255,255,255,.7);
  padding: 8px 11px; backdrop-filter: blur(8px);
}
.status-dot { width: 7px; height: 7px; border-radius: 50%; background: #222; }

.thumbnail-strip-wrap { position: relative; margin-top: 16px; }
.thumbnail-strip-wrap::before,
.thumbnail-strip-wrap::after {
  content: ""; position: absolute; top: 0; bottom: 0; width: 34px; z-index: 2; pointer-events: none;
}
.thumbnail-strip-wrap::before { left: 0; background: linear-gradient(to right, var(--panel), transparent); opacity: 0; transition: opacity .2s ease; }
.thumbnail-strip-wrap::after { right: 0; background: linear-gradient(to left, var(--panel), transparent); opacity: 0; transition: opacity .2s ease; }
.thumbnail-strip-wrap.has-overflow::before,
.thumbnail-strip-wrap.has-overflow::after { opacity: 1; }
.thumbnail-strip {
  display: flex; gap: 12px; overflow-x: auto; padding: 2px 3px 8px;
  scrollbar-width: none;
  overscroll-behavior-inline: contain;
}
.thumbnail-strip.has-overflow {
  scrollbar-width: thin;
  scrollbar-color: #666 transparent;
}
.thumbnail-strip::-webkit-scrollbar { height: 0; }
.thumbnail-strip.has-overflow::-webkit-scrollbar { height: 7px; }
.thumbnail-strip::-webkit-scrollbar-track { background: transparent; }
.thumbnail-strip::-webkit-scrollbar-thumb {
  background: #666;
  border-radius: 999px;
  border: 2px solid var(--panel);
}
.thumbnail-strip::-webkit-scrollbar-thumb:hover { background: #999; }
.thumbnail {
  flex: 0 0 calc((100% - 72px) / 7);
  aspect-ratio: 16 / 9;
  min-width: 120px;
  border: 0;
  padding: 0;
  background: #cfcfcf;
  cursor: pointer;
  position: relative;
  overflow: hidden;
  outline: 0;
  opacity: .42;
  transition: opacity .2s ease, box-shadow .2s ease;
  box-shadow: 0 10px 24px rgba(0,0,0,.28);
}
.thumbnail::after {
  content: "";
  position: absolute;
  inset: 2px;
  border: 2px solid white;
  pointer-events: none;
  opacity: 0;
  transition: opacity .28s ease;
}
.thumbnail:hover, .thumbnail.active { opacity: 1; box-shadow: 0 12px 28px rgba(0,0,0,.34); }
.thumbnail.is-empty { cursor: default; opacity: .16; }
.thumbnail.is-empty:hover { opacity: .16; }
.thumbnail.active::after { opacity: 1; }
.thumbnail img { width: 100%; height: 100%; object-fit: cover; display: block; }
.thumbnail-fallback { width: 100%; height: 100%; display: grid; place-items: center; color: #707070; font-size: 11px; background: #d5d5d5; }

.project-description { padding-top: 10px; }
.project-description p { margin: 0; color: #c7c7c7; line-height: 1.7; font-size: clamp(16px, 1.35vw, 20px); }

.lower-section {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 32px;
  padding: 110px 0;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: calc(var(--header-height) + 24px);
}
.eyebrow { margin: 0 0 9px; color: var(--muted); font-size: 11px; letter-spacing: .16em; text-transform: uppercase; }
.section-heading h2, .contact-section h2 { margin: 0; font-weight: 500; letter-spacing: -.05em; font-size: clamp(26px, 3.7vw, 50px); }
.people-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 120px; row-gap: 80px; }
.person-card { min-width: 0; }
.portrait {
  width: 78%;
  aspect-ratio: 1 / 1; background: #d9d9d9; overflow: hidden; display: grid; place-items: center; color: #666;
  box-shadow: 0 12px 30px rgba(0,0,0,.32);
}
.portrait img { width: 100%; height: 100%; object-fit: cover; display: block; }
.portrait-fallback { font-size: 12px; letter-spacing: .1em; text-transform: uppercase; }
.person-info { padding-top: 16px; }
.person-role { margin: 0 0 8px; color: var(--muted); font-size: clamp(14px, 1.1vw, 16px); }
.person-info h3 { margin: 0; font-size: clamp(26px, 2vw, 31px); font-weight: 500; }
.person-description { margin: 18px 0 0; color: #c7c7c7; line-height: 1.7; font-size: clamp(14px, 1.15vw, 17px); }
.favorite-games { margin-top: 20px; }
.favorite-label { margin: 0 0 8px; color: var(--muted); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.favorite-list { margin: 0; color: #ddd; line-height: 1.6; font-size: clamp(14px, 1.1vw, 16px); }
.social-links { margin-top: 22px; padding-top: 14px; border-top: 1px solid var(--line); }
.social-label { margin: 0 0 9px; color: var(--muted); font-size: 10px; letter-spacing: .14em; text-transform: uppercase; }
.social-list { display: flex; flex-wrap: wrap; gap: 10px 18px; }
.social-list a { color: #e0e0e0; font-size: clamp(14px, 1.05vw, 16px); transition: opacity .2s; }
.social-list a:hover { opacity: .55; }

.contact-section { border-bottom: 0; }
.contact-link { margin: 0; color: #c7c7c7; line-height: 1.7; align-self: end; font-size: clamp(15px, 1.2vw, 18px); transition: opacity .2s; }
.contact-link:hover { opacity: .6; }
footer { display: flex; justify-content: space-between; padding-top: 28px; color: var(--muted); font-size: 11px; letter-spacing: .08em; text-transform: uppercase; }

@media (max-width: 800px) {
  :root { --header-height: 74px; }
  .site-shell { width: calc(100% - 24px); margin: 0 auto 12px; padding: 0 24px 32px; }
  .site-header { width: 100%; padding: 0 24px; }
  .logo img { height: 48px; max-width: 150px; }
  .nav { gap: 16px; }
  .nav a { font-size: 13px; }
  .portfolio { grid-template-columns: 1fr; padding-top: calc(var(--header-height) + 40px); }
  .game-list {
    display: block;
    width: 100%;
    justify-self: stretch;
    padding-top: 0;
  }
  .game-list-scroll {
    max-height: none;
    overflow: visible;
    padding: 0;
  }
  .game-list-track {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
  }
  .game-button { width: 100%; }
  .thumbnail { flex-basis: calc((100% - 30px) / 4); }
  .lower-section { grid-template-columns: 1fr; gap: 28px; padding: 70px 0; }
}

@media (max-width: 560px) {
  .site-header { padding: 0 16px; }
  .logo { position: static; transform: none; }
  .nav { margin-left: auto; }
  .nav a { font-size: 12px; }
  .people-grid { grid-template-columns: 1fr; gap: 64px; }
  .portrait { width: 68%; }
  .thumbnail { flex-basis: 120px; }
  footer { flex-direction: column; gap: 10px; }
}

/* ---------- Scroll reveal ----------
   script.js adds .reveal to each block, then .is-visible when it scrolls
   into view. Change the 24px / .7s / delay values to tune the feel. */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s ease, transform .7s ease;
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal.is-visible {
  opacity: 1;
  transform: none;
}
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}
