/* Shared styles for the game detail pages (neurodash/, yukon-solitaire/, sokoban/).
   The homepage keeps its own inline CSS; keep the palette tokens below in sync with
   the :root block in /index.html. */

:root {
  --night: #0d0d0d;
  --gold: #f5c542;

  --neurodash-1: #5b1830; --neurodash-2: #1a0a1f; --neurodash-3: #0a0612;   /* crimson */
  --yukon-1: #1c5a45;     --yukon-2: #0b2a22;     --yukon-3: #071a15;       /* felt green */
  --sokoban-1: #6b4b17;   --sokoban-2: #2a1f0d;   --sokoban-3: #12100a;     /* crate amber */
  --neurodash-glow: rgba(255, 77, 109, .55);
  --yukon-glow: rgba(52, 224, 160, .5);
  --sokoban-glow: rgba(255, 176, 56, .55);

  --apple-bg: #fff;       --apple-fg: #000;
  --play-bg: #1ed48a;     --play-fg: #04130d;
}

/* One class on <body> picks the game's hue. */
.theme-neurodash { --c1: var(--neurodash-1); --c2: var(--neurodash-2); --c3: var(--neurodash-3); --glow: var(--neurodash-glow); }
.theme-yukon     { --c1: var(--yukon-1);     --c2: var(--yukon-2);     --c3: var(--yukon-3);     --glow: var(--yukon-glow); }
.theme-sokoban   { --c1: var(--sokoban-1);   --c2: var(--sokoban-2);   --c3: var(--sokoban-3);   --glow: var(--sokoban-glow); }

* { box-sizing: border-box; margin: 0; }
body {
  font-family: "Archivo", system-ui, -apple-system, "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  color: #fff;
  background: var(--c3);
}
a:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }

.top {
  position: absolute; top: 0; left: 0; right: 0; z-index: 2;
  display: flex; justify-content: space-between; align-items: center;
  padding: 22px 28px 22px 7vw; font-size: 14px; font-weight: 600;
}
.top a { color: #fff; text-decoration: none; opacity: .85; transition: opacity .2s; }
.top a:hover { opacity: 1; }
/* the back link matches the homepage logo weight: bold, full white */
.top a:first-child { font-weight: 700; opacity: 1; }

.hero {
  /* clip sideways only: overflow:hidden also cut the phones' shadow at the hero's bottom edge, which showed as a hard line */
  position: relative; overflow-x: clip; overflow-y: visible; min-height: 100vh;
  display: grid; grid-template-columns: 1.1fr 1fr; align-items: center;
  padding: 0 7vw;
  /* the top layer fades the hero into the flat page colour so no hard edge shows under it */
  background:
    linear-gradient(to bottom, transparent 55%, var(--c3) 100%),
    radial-gradient(100% 90% at 80% 45%, var(--c1), var(--c2) 60%, var(--c3));
}
/* Same text-column anchor as the homepage chapters, so opening "Details" from a chapter
   keeps the icon, title and phones where they were instead of re-centering on the longer text. */
@media (min-width: 900px) {
  .hero > div:first-of-type { align-self: start; padding-top: clamp(96px, 17vh, 200px); padding-bottom: 60px; }
}
.gicon {
  display: block; width: 72px; height: 72px; border-radius: 18px; margin-bottom: 26px;
  box-shadow: 0 0 0 2px rgba(255,255,255,.55), 0 0 34px 4px var(--glow), 0 16px 36px rgba(0,0,0,.45);
}
.kicker {
  font-stretch: 75%; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; font-size: 14px; opacity: .7;
}
h1 {
  font-weight: 900; font-stretch: 125%; letter-spacing: -.045em; line-height: .88;
  font-size: clamp(54px, 8vw, 128px); margin: 16px 0 24px;
}
h1 .line { display: block; }
.lead { font-size: 18px; line-height: 1.55; max-width: min(460px, 40vw); opacity: .85; }

.btns { display: flex; gap: 12px; margin-top: 34px; flex-wrap: wrap; }
.btn {
  display: inline-flex; align-items: center; gap: 10px;
  padding: 15px 24px; border-radius: 99px;
  font-weight: 700; font-size: 15px; text-decoration: none; transition: .3s;
}
.btn svg { flex: none; }
.btn.f { background: var(--apple-bg); color: var(--apple-fg); }
.btn.p { background: var(--play-bg); color: var(--play-fg); }
.btn.f:hover, .btn.p:hover { transform: translateY(-3px); }
.btn.p:hover { filter: brightness(1.12); }
.soon {
  display: inline-block; margin-top: 34px; padding: 13px 22px; border-radius: 99px;
  border: 1.5px dashed rgba(255,255,255,.4); font-size: 14px; font-weight: 600; opacity: .85;
}
.btn.o { border: 1.5px solid rgba(255,255,255,.4); color: #fff; }
.btn.o:hover { border-color: #fff; transform: translateY(-3px); }
.legal-btns { display: flex; flex-wrap: wrap; gap: 12px; }

/* Phones in the hero */
.dev { position: relative; height: 100vh; display: flex; justify-content: center; align-items: center; }
.ph {
  width: min(300px, 28vw); height: auto; border-radius: 38px; border: 9px solid #0c0c0e;
  box-shadow: 0 0 0 2px rgba(255,255,255,.13), 0 60px 100px rgba(0,0,0,.6); position: relative;
}
.ph.a { transform: rotate(-6deg) translateX(-70px); z-index: 2; }
.ph.b { transform: rotate(7deg) translateX(40px) translateY(60px); position: absolute; opacity: .95; width: min(270px, 25vw); }

/* All screenshots, swipeable */
/* transparent (body already has --c3) so the hero's shadow can bleed into it instead of being covered */
.shots { position: relative; padding: 90px 0 40px; }
.shots h2 {
  font-stretch: 75%; font-weight: 600; letter-spacing: .14em;
  text-transform: uppercase; font-size: 14px; opacity: .7; padding: 0 7vw 26px;
}
.rail {
  display: flex; gap: 24px; overflow-x: auto; padding: 8px 7vw 40px;
  scroll-snap-type: x proximity; scroll-padding: 0 7vw; scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,.25) transparent;
}
.rail figure { flex: none; width: 240px; scroll-snap-align: start; }
.rail img {
  display: block; width: 100%; height: auto; border-radius: 28px; border: 7px solid #0c0c0e;
  box-shadow: 0 0 0 2px rgba(255,255,255,.12), 0 30px 60px rgba(0,0,0,.5);
}
.rail a { display: block; border-radius: 28px; cursor: zoom-in; }
.rail a img { transition: transform .3s cubic-bezier(.2,.7,.2,1); }
.rail a:hover img { transform: translateY(-6px); }

/* Full-screen screenshot viewer (built by /assets/lightbox.js) */
.lb {
  width: 100vw; height: 100vh; max-width: none; max-height: none; margin: 0; padding: 0;
  border: 0; background: transparent; color: #fff;
}
.lb::backdrop { background: rgba(6, 6, 10, .88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px); }
.lb[open] { display: flex; align-items: center; justify-content: center; animation: lb-in .25s ease; }
@keyframes lb-in { from { opacity: 0; } to { opacity: 1; } }
.lb-fig { display: flex; flex-direction: column; align-items: center; gap: 14px; max-width: 92vw; }
.lb-img {
  display: block; height: min(86vh, 1100px); width: auto; max-width: 92vw; object-fit: contain;
  border-radius: 28px; border: 7px solid #0c0c0e; background: #0c0c0e;
  box-shadow: 0 0 0 2px rgba(255,255,255,.14), 0 40px 100px rgba(0,0,0,.6);
}
.lb-cap { font-size: 14px; opacity: .75; text-align: center; padding: 0 16px; }
.lb-btn {
  position: absolute; width: 48px; height: 48px; border-radius: 50%; cursor: pointer;
  display: grid; place-items: center; font: inherit; font-size: 30px; line-height: 1; color: #fff;
  background: rgba(255,255,255,.12); border: 1.5px solid rgba(255,255,255,.28); transition: background .2s, transform .2s;
}
.lb-btn:hover { background: rgba(255,255,255,.24); }
.lb-close { top: 20px; right: 20px; }
.lb-prev { left: max(16px, 3vw); top: 50%; transform: translateY(-50%); }
.lb-next { right: max(16px, 3vw); top: 50%; transform: translateY(-50%); }
.lb-btn:focus-visible { outline: 2px solid #fff; outline-offset: 3px; }
.rail figcaption { margin-top: 16px; font-size: 14px; line-height: 1.4; opacity: .75; padding: 0 4px; }

/* "Let's talk." block, same as the homepage contact chapter */
.end {
  position: relative; overflow: hidden; min-height: 100vh; background: var(--night);
  display: grid; grid-template-columns: 1fr 1fr; align-items: center; align-content: center; gap: 60px;
  padding: 0 7vw;
}
.end .num {
  position: absolute; left: 5vw; bottom: -6vw;
  font-weight: 900; font-stretch: 125%; font-size: 30vw; line-height: 1;
  opacity: .07; letter-spacing: -.06em; pointer-events: none;
}
.end h2 {
  font-weight: 900; font-stretch: 125%; letter-spacing: -.045em; line-height: .88;
  font-size: clamp(46px, 6vw, 96px); margin: 16px 0 24px; padding: 0; text-transform: none; opacity: 1;
}
.reach { display: flex; flex-direction: column; align-items: flex-start; gap: 26px; position: relative; }
.mail {
  font-size: clamp(22px, 3vw, 44px); font-weight: 800; letter-spacing: -.03em; line-height: 1.12;
  color: #fff; text-decoration: none; padding-bottom: 8px; border-bottom: 3px solid rgba(255,255,255,.35);
  transition: color .25s, border-color .25s;
}
.mail:hover { color: var(--gold); border-color: var(--gold); }
.copy {
  font: inherit; font-size: 14px; font-weight: 700; color: #fff; background: none; cursor: pointer;
  padding: 12px 22px; border-radius: 99px; border: 1.5px solid rgba(255,255,255,.4); transition: .25s;
}
.copy:hover { border-color: #fff; }
.copy.done { border-color: var(--gold); color: var(--gold); }
.end small { grid-column: 1 / -1; align-self: end; padding-bottom: 30px; font-size: 12px; opacity: .45; }

/* Legal documents (privacy / terms): sticky title on the left, readable text on the right.
   Text content is the original document; only the markup around it changed. */
.doc-wrap {
  display: grid; grid-template-columns: minmax(280px, 1fr) minmax(0, 760px); gap: 6vw; align-items: start;
  padding: 150px 7vw 90px;
  background: radial-gradient(70% 55% at 12% 0%, var(--c1), transparent 72%), var(--c3);
}
.doc-head { position: sticky; top: 110px; }
.doc-head h1 { font-size: clamp(38px, 4.4vw, 68px); margin: 14px 0 18px; overflow-wrap: anywhere; }
.doc-head .updated { font-size: 14px; opacity: .7; }
.doc { font-size: 16.5px; line-height: 1.72; color: rgba(255,255,255,.84); }
.doc > p { margin: 0 0 16px; }
.doc strong { color: #fff; }
.doc h2 {
  font-size: 24px; font-weight: 800; letter-spacing: -.02em; line-height: 1.2; color: #fff;
  margin: 52px 0 14px; padding-top: 30px; border-top: 1px solid rgba(255,255,255,.12);
}
.doc h3 { font-size: 13px; font-weight: 700; letter-spacing: .12em; text-transform: uppercase; color: #fff; margin: 28px 0 8px; opacity: .8; }
.doc ul { list-style: none; padding: 0; margin: 0 0 18px; }
.doc li { position: relative; padding-left: 22px; margin: 0 0 10px; }
.doc li::before {
  content: ""; position: absolute; left: 2px; top: .72em; width: 7px; height: 7px; border-radius: 50%;
  background: var(--glow); box-shadow: 0 0 10px var(--glow);
}
.doc a { color: #fff; text-decoration: underline; text-decoration-color: rgba(255,255,255,.4); text-underline-offset: 3px; transition: text-decoration-color .2s; }
.doc a:hover { text-decoration-color: #fff; }
.doc-foot {
  background: var(--night); padding: 60px 7vw 50px;
  display: flex; flex-wrap: wrap; gap: 24px 40px; align-items: center; justify-content: space-between;
}
.doc-foot .btns { margin: 0; }

@media (prefers-reduced-motion: reduce) { * { transition: none !important; } }

@media (max-width: 899px) {
  .top { padding: 16px 24px; }
  .hero { grid-template-columns: 1fr; padding: 96px 24px 40px; align-content: start; min-height: 0; }
  h1 { font-size: 15vw; }
  .lead { font-size: 18px; max-width: 460px; }
  .gicon { width: 60px; height: 60px; border-radius: 15px; margin-bottom: 20px; }
  .dev { height: auto; padding: 44px 0 8px; align-items: flex-start; }
  .ph { width: 44vw; }
  .ph.a { transform: rotate(-5deg) translateX(-2vw); }
  .ph.b { position: relative; width: 40vw; margin-left: -8vw; transform: rotate(6deg) translateY(34px); }
  .shots { padding: 60px 0 20px; }
  .shots h2 { padding: 0 24px 20px; }
  .rail { padding: 8px 24px 30px; scroll-padding: 0 24px; gap: 18px; }
  .rail figure { width: 62vw; max-width: 260px; }
  .end { grid-template-columns: 1fr; gap: 24px; padding: 96px 24px 56px; align-content: start; min-height: 0; }
  .end h2 { font-size: 17vw; }
  .end .num { font-size: 56vw; bottom: auto; top: 40px; left: auto; right: -4vw; }
  .doc-wrap { grid-template-columns: 1fr; gap: 28px; padding: 100px 24px 56px; }
  .doc-head { position: static; }
  .doc-head h1 { font-size: 12vw; }
  .doc { font-size: 16px; }
  .doc h2 { font-size: 21px; margin-top: 40px; }
  .doc-foot { padding: 48px 24px 40px; }
}
