/* ============================================================
   MAGRATHEA — We craft worlds
   Cool porcelain + gunmetal · brass-gold accent · steampunk
   ============================================================ */

:root {
  /* surfaces — cool porcelain / steel */
  --bg:        #EFF1F3;
  --bg-pure:   #FAFBFC;
  --bg-warm:   #E4E8EC;
  --bg-deep:   #DCE1E6;

  /* ink — cool near-black */
  --ink:       #181B1F;
  --ink-soft:  #434952;
  --muted:     #7C838D;
  --faint:     #AAB1BA;

  --line:      rgba(24, 27, 31, 0.11);
  --line-soft: rgba(24, 27, 31, 0.05);

  /* gold / brass accent system (tweakable) */
  --gold-h:    80;
  --gold:        oklch(0.80 0.145 var(--gold-h));
  --gold-bright: oklch(0.88 0.155 calc(var(--gold-h) + 8));
  --gold-deep:   oklch(0.64 0.135 calc(var(--gold-h) - 8));
  --gold-tint:   oklch(0.80 0.145 var(--gold-h) / 0.10);
  --gold-glow:   oklch(0.84 0.16 var(--gold-h) / 0.30);

  /* brass material for the artifact */
  --brass-1: #F7DE9B;
  --brass-2: #D8A953;
  --brass-3: #9A6B28;
  --brass-4: #5E3F16;
  --steel:   #23272C;
  --steel-2: #34393F;

  /* type */
  --font-display: 'Newsreader', 'Times New Roman', serif;
  --font-sans: 'Hanken Grotesk', system-ui, sans-serif;

  --grain-opacity: 0.3;

  --maxw: 1240px;
  --gut: clamp(20px, 5vw, 64px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
::selection { background: oklch(0.80 0.145 var(--gold-h) / 0.32); }
.btn:focus-visible, a:focus-visible, button:focus-visible { outline: 2px solid var(--gold-deep); outline-offset: 3px; border-radius: 4px; }
.btn:focus-visible { border-radius: 100px; }
body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  overflow-x: hidden;
  font-weight: 400;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* ---- grain overlay ---- */
.grain {
  position: fixed; inset: 0; z-index: 9000;
  pointer-events: none;
  opacity: var(--grain-opacity);
  mix-blend-mode: multiply;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.42'/%3E%3C/svg%3E");
}

/* ---- shared layout ---- */
.wrap { max-width: var(--maxw); margin: 0 auto; padding-inline: var(--gut); }
section { position: relative; }

.eyebrow {
  font-size: 0.72rem; font-weight: 700; letter-spacing: 0.32em;
  text-transform: uppercase; color: var(--gold-deep);
  display: inline-flex; align-items: center; gap: 0.7em;
}
.eyebrow::before {
  content: ""; width: 26px; height: 1px; background: var(--gold-deep); opacity: 0.6;
}
.eyebrow.center::after {
  content: ""; width: 26px; height: 1px; background: var(--gold-deep); opacity: 0.6;
}

h1, h2, h3 { font-family: var(--font-display); font-weight: 600; line-height: 1.02; letter-spacing: -0.01em; }

.section-title {
  font-size: clamp(2.4rem, 5.2vw, 4.4rem);
  font-weight: 600;
  line-height: 1.0;
  letter-spacing: -0.015em;
}
.section-title em { font-style: italic; }

.lead { font-size: clamp(1.05rem, 1.6vw, 1.3rem); color: var(--ink-soft); max-width: 46ch; }

/* ---- buttons ---- */
.btn {
  display: inline-flex; align-items: center; gap: 0.6em; white-space: nowrap;
  font-family: var(--font-sans); font-weight: 600; font-size: 0.95rem; letter-spacing: 0.01em;
  border: none; cursor: pointer; text-decoration: none;
  padding: 1em 1.8em; border-radius: 100px;
  transition: transform .35s cubic-bezier(.2,.8,.2,1), box-shadow .35s, background .3s;
  will-change: transform;
}
.btn-gold {
  background: var(--ink);
  color: #F7F4EC;
  box-shadow: 0 1px 2px rgba(24,27,31,.18), 0 8px 22px rgba(24,27,31,.12);
}
.btn-gold .arr { color: var(--gold-bright); }
.btn-gold:hover { transform: translateY(-2px); background: var(--steel-2); box-shadow: 0 12px 28px rgba(24,27,31,.18); }
.btn-ghost {
  background: transparent; color: var(--ink); border: 1px solid var(--line);
  padding: 0.97em 1.6em;
}
.btn-ghost:hover { border-color: var(--ink); background: var(--bg-pure); transform: translateY(-2px); }
.btn .arr { transition: transform .35s cubic-bezier(.2,.8,.2,1); }
.btn:hover .arr { transform: translateX(4px); }

/* ============================================================
   NAV
   ============================================================ */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px var(--gut);
  transition: background .4s, backdrop-filter .4s, padding .4s, box-shadow .4s;
}
.nav.scrolled {
  background: rgba(239,241,243,0.82);
  backdrop-filter: blur(18px) saturate(1.2);
  padding: 14px var(--gut);
  box-shadow: 0 1px 0 var(--line-soft);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand-mark {
  width: 30px; height: 30px; border-radius: 50%; position: relative; flex-shrink: 0;
  background: repeating-conic-gradient(from 0deg, var(--brass-3) 0 7deg, transparent 7deg 14deg);
  animation: spin 36s linear infinite;
}
.brand-mark::after {
  content: ""; position: absolute; inset: 5px; border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, var(--brass-1), var(--brass-2) 55%, var(--brass-3));
  box-shadow: inset 0 0 0 1.5px rgba(50,30,4,.4), inset -2px -2px 4px rgba(40,24,4,.5), 0 0 10px var(--gold-glow);
}
html.no-motion .brand-mark { animation: none; }
.brand-name { font-family: var(--font-display); font-size: 1.35rem; font-weight: 600; letter-spacing: 0.02em; }
.nav-links { display: flex; align-items: center; gap: 38px; }
.nav-links a {
  text-decoration: none; color: var(--ink-soft); font-size: 0.94rem; font-weight: 500;
  position: relative; transition: color .25s;
}
.nav-links a::after {
  content: ""; position: absolute; left: 0; bottom: -6px; height: 1.5px; width: 0;
  background: var(--gold-deep); transition: width .3s ease;
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { width: 100%; }
.nav-cta { display: flex; align-items: center; gap: 18px; }
.nav-toggle { display: none; background: none; border: none; cursor: pointer; flex-direction: column; gap: 5px; padding: 6px; }
.nav-toggle span { width: 24px; height: 2px; background: var(--ink); border-radius: 2px; transition: .3s; }

/* ============================================================
   HERO
   ============================================================ */
.hero {
  min-height: 100svh; position: relative; overflow: hidden;
  display: flex; align-items: center;
  background:
    radial-gradient(120% 90% at 70% 18%, var(--gold-tint), transparent 55%),
    radial-gradient(90% 70% at 50% 120%, oklch(0.86 0.05 var(--gold-h) / .18), transparent 60%),
    var(--bg);
}
.starfield { position: absolute; inset: 0; z-index: 0; pointer-events: none; }
.star { position: absolute; border-radius: 50%; background: var(--gold-deep); opacity: .5; }

.hero-inner {
  position: relative; z-index: 3; width: 100%;
  display: grid; grid-template-columns: 1.05fr 0.95fr; align-items: center; gap: 40px;
  padding-top: 80px;
}
.hero-copy { max-width: 620px; }
.hero h1 {
  font-size: clamp(3.2rem, 8.2vw, 7.2rem);
  line-height: 0.96; letter-spacing: -0.02em; margin: 26px 0 0;
}
.hero h1 .line { display: block; overflow: hidden; }
.hero h1 em { font-style: italic; color: oklch(0.50 0.13 calc(var(--gold-h) - 12)); }
.hero-sub {
  font-size: clamp(1.05rem, 1.5vw, 1.28rem); color: var(--ink-soft);
  margin-top: 28px; max-width: 40ch; line-height: 1.5;
}
.hero-actions { display: flex; align-items: center; gap: 18px; margin-top: 40px; flex-wrap: wrap; }
.hero-meta {
  margin-top: 54px; display: flex; gap: 40px; align-items: flex-start;
}
.hero-meta .stat .n { font-family: var(--font-display); font-size: 1.9rem; font-weight: 600; display: block; line-height: 1; }
.hero-meta .stat .l { font-size: 0.78rem; color: var(--muted); letter-spacing: .04em; margin-top: 6px; text-transform: uppercase; }
.hero-meta .div { width: 1px; align-self: stretch; background: var(--line); }

/* ===== steampunk artifact (interactive armillary / orrery) ===== */
.hero-visual { position: relative; height: 100%; display: flex; align-items: center; justify-content: center; }
.artifact-stage {
  position: relative; width: min(44vw, 520px); aspect-ratio: 1;
  perspective: 1200px; touch-action: none;
}
.artifact {
  position: absolute; inset: 0; transform-style: preserve-3d;
  cursor: grab; display: grid; place-items: center;
  transform: rotateX(8deg) rotateZ(0deg);
}
.artifact.dragging { cursor: grabbing; }
.artifact-glow {
  position: absolute; inset: 8%; border-radius: 50%; z-index: -2;
  background: radial-gradient(circle, var(--gold-glow) 0%, oklch(0.84 0.16 var(--gold-h) / 0.15) 42%, transparent 66%);
  filter: blur(10px);
}

/* outer brass bezel + engraved ticks */
.bezel {
  position: absolute; inset: 1%; border-radius: 50%;
  border: 9px solid var(--brass-2);
  background: radial-gradient(circle at 50% 50%, transparent 70%, oklch(0.84 0.16 var(--gold-h)/0.06) 100%);
  box-shadow:
    inset 0 0 0 1px rgba(50,30,4,.45),
    inset 0 3px 4px rgba(255,240,200,.55), inset 0 -4px 6px rgba(40,24,4,.5),
    0 16px 44px rgba(0,0,0,.15), 0 0 20px var(--gold-glow);
}
.bezel-ticks {
  position: absolute; inset: 5%; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, var(--brass-4) 0 0.7deg, transparent 0.7deg 6deg);
  -webkit-mask: radial-gradient(circle, transparent 0 45%, #000 45.5% 50%, transparent 51%);
  mask: radial-gradient(circle, transparent 0 45%, #000 45.5% 50%, transparent 51%);
  opacity: .8;
}
.bezel-ticks.major {
  background: repeating-conic-gradient(from 0deg, var(--brass-3) 0 1.4deg, transparent 1.4deg 30deg);
  -webkit-mask: radial-gradient(circle, transparent 0 42%, #000 42.5% 50%, transparent 51%);
  mask: radial-gradient(circle, transparent 0 42%, #000 42.5% 50%, transparent 51%);
  opacity: 1;
}

/* armillary rings (tilted, spinning) */
.ring {
  position: absolute; border-radius: 50%; border: 3px solid var(--brass-2);
  box-shadow: inset 0 0 7px rgba(40,24,4,.5), inset 0 2px 2px rgba(255,240,200,.55), 0 0 8px rgba(0,0,0,.12);
}
.ring .bead {
  position: absolute; top: -5px; left: 50%; margin-left: -4px; width: 8px; height: 8px; border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, var(--brass-1), var(--brass-3));
  box-shadow: 0 0 8px var(--gold-glow);
}
.ring-a { inset: 15%; animation: spinA 26s linear infinite; }
.ring-b { inset: 22%; border-width: 2px; animation: spinB 19s linear infinite; }
.ring-c { inset: 18%; border-style: dashed; opacity: .85; animation: spinC 34s linear infinite; }
@keyframes spinA { from { transform: rotateX(72deg) rotateZ(0); } to { transform: rotateX(72deg) rotateZ(360deg); } }
@keyframes spinB { from { transform: rotateY(70deg) rotateZ(0); } to { transform: rotateY(70deg) rotateZ(-360deg); } }
@keyframes spinC { from { transform: rotateX(28deg) rotateY(40deg) rotateZ(0); } to { transform: rotateX(28deg) rotateY(40deg) rotateZ(360deg); } }

/* astrolabe rule / needle */
.needle {
  position: absolute; width: 64%; height: 3px; border-radius: 3px;
  background: linear-gradient(90deg, transparent, var(--brass-1), var(--brass-3), var(--brass-1), transparent);
  box-shadow: 0 0 6px var(--gold-glow); animation: needleSweep 16s ease-in-out infinite;
}
@keyframes needleSweep { 0%,100% { transform: rotate(-18deg); } 50% { transform: rotate(22deg); } }

/* glowing core */
.core {
  position: absolute; width: 17%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, #FFF6D8 0%, var(--gold-bright) 30%, var(--gold) 62%, var(--gold-deep) 100%);
  box-shadow: 0 0 26px var(--gold-glow), inset -4px -4px 10px rgba(70,40,4,.5), inset 3px 3px 8px rgba(255,248,220,.6);
}
.core-glow { position: absolute; inset: -120%; border-radius: 50%;
  background: radial-gradient(circle, var(--gold-glow), transparent 60%); animation: corePulse 4.5s ease-in-out infinite; }
@keyframes corePulse { 0%,100% { opacity: .35; transform: scale(.9); } 50% { opacity: .65; transform: scale(1.08); } }

/* meshing gears */
.gear { position: absolute; border-radius: 50%;
  background: repeating-conic-gradient(from 0deg, var(--brass-3) 0 6.5deg, rgba(0,0,0,0) 6.5deg 13deg); }
.gear .gear-body {
  position: absolute; inset: 16%; border-radius: 50%;
  background: radial-gradient(circle at 38% 34%, var(--brass-1), var(--brass-2) 52%, var(--brass-3) 88%, var(--brass-4));
  box-shadow: inset -4px -4px 10px rgba(50,30,4,.5), inset 4px 4px 8px rgba(255,240,200,.45), 0 4px 10px rgba(0,0,0,.3);
}
.gear .gear-body::after { content: ""; position: absolute; inset: 34%; border-radius: 50%;
  background: radial-gradient(circle at 40% 36%, var(--brass-1), var(--brass-3));
  box-shadow: inset 0 0 0 2px rgba(50,30,4,.4); }
.gear-1 { width: 24%; aspect-ratio: 1; left: 4%; bottom: 8%; animation: spin 11s linear infinite; }
.gear-2 { width: 16%; aspect-ratio: 1; left: 22%; bottom: 2%; animation: spin 7.5s linear infinite reverse; }
.gear-3 { width: 13%; aspect-ratio: 1; right: 9%; top: 14%; animation: spin 9s linear infinite; }
.artifact-hint {
  position: absolute; bottom: -2%; left: 50%; transform: translateX(-50%);
  font-size: .68rem; letter-spacing: .22em; text-transform: uppercase; color: var(--muted);
  display: inline-flex; align-items: center; gap: 7px; white-space: nowrap;
  transition: opacity .5s; pointer-events: none;
}
.artifact-hint::before { content: ""; width: 14px; height: 14px; border-radius: 50%;
  border: 1.5px solid var(--brass-2); box-shadow: inset 0 0 0 2px var(--bg); }
.artifact-hint.gone { opacity: 0; }
.hero-scroll {
  position: absolute; bottom: 30px; left: 50%; transform: translateX(-50%); z-index: 4;
  display: flex; flex-direction: column; align-items: center; gap: 10px;
  font-size: .7rem; letter-spacing: .28em; text-transform: uppercase; color: var(--muted);
}
.hero-scroll .mouse { width: 22px; height: 34px; border: 1.5px solid var(--faint); border-radius: 12px; position: relative; }
.hero-scroll .mouse::after {
  content: ""; position: absolute; top: 6px; left: 50%; margin-left: -2px; width: 4px; height: 6px;
  border-radius: 2px; background: var(--gold-deep); animation: scrolldot 1.8s infinite;
}
@keyframes scrolldot { 0%{opacity:0;transform:translateY(0)} 30%{opacity:1} 100%{opacity:0;transform:translateY(10px)} }

/* ============================================================
   reveal
   ============================================================ */
/* ============================================================
   reveal — visible by default. Opacity is NOT transitioned (so it
   snaps to visible instantly and can never strand at 0 if the
   compositor throttles transitions); only transform eases in.
   ============================================================ */
.reveal { transition: transform .85s cubic-bezier(.2,.7,.2,1); }
html.preload .reveal:not(.in) { opacity: 0; transform: translateY(26px); }
.reveal.d1 { transition-delay: .08s; } .reveal.d2 { transition-delay: .16s; }
.reveal.d3 { transition-delay: .24s; } .reveal.d4 { transition-delay: .32s; }
@media (prefers-reduced-motion: reduce) { html.preload .reveal:not(.in) { opacity: 1; transform: none; } }

/* motion off (tweak) */
html.no-motion .star { animation: none !important; }
html.no-motion .hero-particles { display: none; }
html.no-motion .hero-scroll .mouse::after { animation: none !important; }
html.no-motion .ring, html.no-motion .gear, html.no-motion .needle,
html.no-motion .core-glow { animation: none !important; }
@media (prefers-reduced-motion: reduce) {
  .ring, .gear, .needle, .core-glow, .brand-mark, .star { animation: none !important; }
}

/* ============================================================
   GAMES
   ============================================================ */
.games { padding: clamp(90px, 12vh, 150px) 0; background: var(--bg-pure); }
.section-head { display: flex; justify-content: space-between; align-items: flex-end; gap: 30px; margin-bottom: 48px; flex-wrap: wrap; }
.section-head .lead { margin-top: 18px; }
.filter { display: flex; gap: 8px; background: var(--bg-warm); padding: 5px; border-radius: 100px; }
.filter button {
  border: none; background: transparent; cursor: pointer; font-family: var(--font-sans);
  font-size: .86rem; font-weight: 600; color: var(--ink-soft); padding: .6em 1.2em; border-radius: 100px;
  transition: color .25s, background .25s; letter-spacing: .01em;
}
.filter button.active { background: var(--ink); color: var(--bg-pure); }

.games-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: 22px; }
.game-card {
  position: relative; border-radius: 16px; overflow: hidden; cursor: pointer;
  background: var(--bg-warm); border: 1px solid var(--line-soft);
  transition: transform .5s cubic-bezier(.2,.8,.2,1), box-shadow .5s, opacity .4s;
  transform-style: preserve-3d; min-height: 340px; display: flex;
}
.game-card.feat { grid-column: span 7; min-height: 460px; }
.game-card.half { grid-column: span 5; }
.game-card.third { grid-column: span 4; }
.game-card.hide { display: none; }
.game-card:hover { transform: translateY(-4px); box-shadow: 0 24px 48px rgba(24,27,31,.13); }

.game-art { position: absolute; inset: 0; }
.game-art .ph {
  position: absolute; inset: 0;
  background:
    repeating-linear-gradient(135deg, rgba(255,255,255,.04) 0 14px, rgba(0,0,0,.04) 14px 28px);
}
.game-card .game-art { background: linear-gradient(160deg, var(--c1), var(--c2)); }
.game-art::after {
  content: ""; position: absolute; inset: 0; z-index: 1;
  background: linear-gradient(to top, rgba(8,10,14,.84) 0%, rgba(8,10,14,.22) 48%, transparent 76%);
}
.game-art .ph-label {
  position: absolute; top: 18px; left: 18px; z-index: 3; font-family: ui-monospace, monospace;
  font-size: .6rem; letter-spacing: .2em; text-transform: uppercase; color: rgba(255,255,255,.6);
}

/* ===== minimalist film posters (geometric, themed per world) ===== */
.poster { position: absolute; inset: 0; overflow: hidden; }
.poster .frame { position: absolute; inset: 14px; border: 1px solid rgba(255,255,255,.16); border-radius: 5px; pointer-events: none; z-index: 2; }
.game-card.feat .poster .frame { inset: 22px; }
.poster .sun, .poster .moon { position: absolute; border-radius: 50%; }

/* 1 · Aethelgard — twilight kingdom */
.pa { background: linear-gradient(180deg, #22203f 0%, #33274b 60%, #3e2a47 100%); }
.pa .sun { top: 14%; left: 50%; width: 40%; aspect-ratio: 1; transform: translateX(-50%);
  border: 2px solid var(--gold-bright); box-shadow: 0 0 30px var(--gold-glow);
  background: radial-gradient(circle, rgba(255,220,130,.14), transparent 68%); }
.pa .mtns { position: absolute; left: 0; right: 0; bottom: 0; height: 52%; }
.pa .mtns i { position: absolute; bottom: 0; background: linear-gradient(180deg, #181530, #221d3c);
  clip-path: polygon(50% 0, 100% 100%, 0 100%); }
.pa .mtns i:nth-child(1) { left: 1%;  width: 47%; height: 76%; }
.pa .mtns i:nth-child(2) { left: 29%; width: 58%; height: 100%; }
.pa .mtns i:nth-child(3) { left: 62%; width: 45%; height: 64%; opacity: .92; }

/* 2 · Solstice Drift — sun + speed */
.ps { background: linear-gradient(180deg, #ec9433 0%, #d06a1f 54%, #7d3c11 100%); }
.ps .sun { bottom: 36%; left: 50%; width: 46%; aspect-ratio: 1; transform: translateX(-50%);
  background: radial-gradient(circle, #fff0c4, #f4bc4a 72%); box-shadow: 0 0 48px rgba(255,210,110,.6); }
.ps .horizon { position: absolute; left: 0; right: 0; bottom: 36%; height: 1px; background: rgba(60,25,5,.45); z-index: 1; }
.ps .speed { position: absolute; right: 13%; bottom: 44%; display: flex; flex-direction: column; gap: 8px; align-items: flex-end; z-index: 1; }
.ps .speed i { height: 2px; background: rgba(255,246,228,.65); border-radius: 2px; }
.ps .speed i:nth-child(1) { width: 44px; } .ps .speed i:nth-child(2) { width: 26px; } .ps .speed i:nth-child(3) { width: 58px; }

/* 3 · The Tidemark — moon + tide ripples */
.pt { background: linear-gradient(180deg, #143f49 0%, #1c5664 56%, #0c2c34 100%); }
.pt .moon { top: 15%; left: 50%; width: 32%; aspect-ratio: 1; transform: translateX(-50%);
  background: radial-gradient(circle at 40% 38%, #e6f3f0, #9cc7bf); box-shadow: 0 0 28px rgba(200,235,228,.4); }
.pt .ripple { position: absolute; left: 50%; transform: translateX(-50%); border: 1px solid rgba(210,240,235,.32); border-radius: 50%; }
.pt .ripple.r1 { width: 52%; aspect-ratio: 1; bottom: -32%; }
.pt .ripple.r2 { width: 80%; aspect-ratio: 1; bottom: -46%; opacity: .68; }
.pt .ripple.r3 { width: 112%; aspect-ratio: 1; bottom: -62%; opacity: .42; }

/* 4 · Pale Garden — a single sprout */
.pg { background: linear-gradient(180deg, #52803f 0%, #366436 58%, #21451d 100%); }
.pg .sun { top: 15%; right: 22%; width: 20%; aspect-ratio: 1; background: radial-gradient(circle, #f4ecae, #d6c95f); box-shadow: 0 0 24px rgba(225,215,120,.5); }
.pg .stem { position: absolute; bottom: 0; left: 50%; width: 2px; height: 48%; transform: translateX(-50%); background: rgba(235,245,210,.78); }
.pg .leaf { position: absolute; width: 12%; aspect-ratio: 1; background: rgba(235,245,210,.82); transform: rotate(45deg); border-radius: 0 62% 0 62%; }
.pg .leaf.lf1 { bottom: 36%; left: 50%; margin-left: -12%; }
.pg .leaf.lf2 { bottom: 26%; left: 50%; }

/* 5 · Nova Halls — concentric corridor */
.pn { background: linear-gradient(180deg, #3a2150 0%, #4f2a63 56%, #281540 100%); }
.pn .sq { position: absolute; top: 46%; left: 50%; transform: translate(-50%,-50%); border: 1px solid var(--gold-bright); }
.pn .sq.q1 { width: 76%; aspect-ratio: 1; opacity: .32; }
.pn .sq.q2 { width: 55%; aspect-ratio: 1; opacity: .52; }
.pn .sq.q3 { width: 37%; aspect-ratio: 1; opacity: .78; }
.pn .sq.q4 { width: 21%; aspect-ratio: 1; opacity: 1; }
.pn .core { position: absolute; top: 46%; left: 50%; width: 7%; aspect-ratio: 1; transform: translate(-50%,-50%);
  border-radius: 50%; background: radial-gradient(circle, #fff0c0, var(--gold)); box-shadow: 0 0 22px var(--gold-glow); }
.game-body {
  position: relative; z-index: 2; margin-top: auto; padding: 28px; color: #fff; width: 100%;
}
.game-badges { display: flex; gap: 7px; margin-bottom: 14px; }
.badge {
  display: inline-flex; align-items: center; gap: 5px; font-size: .68rem; font-weight: 600;
  letter-spacing: .04em; padding: 5px 10px; border-radius: 100px;
  background: rgba(255,255,255,.16); color: #fff; backdrop-filter: blur(6px);
  border: 1px solid rgba(255,255,255,.18);
}
.badge svg { width: 11px; height: 11px; fill: currentColor; }
.game-genre { font-size: .76rem; color: rgba(255,255,255,.66); letter-spacing: .16em; text-transform: uppercase; }
.game-title { font-family: var(--font-display); font-weight: 600; line-height: 1; margin: 8px 0 6px; }
.game-card.feat .game-title { font-size: clamp(2rem, 3.5vw, 3rem); }
.game-card .game-title { font-size: clamp(1.5rem, 2.4vw, 2rem); }
.game-desc { font-size: .95rem; color: rgba(255,255,255,.78); max-width: 42ch; line-height: 1.45;
  max-height: 0; opacity: 0; overflow: hidden; transition: max-height .5s, opacity .4s, margin .4s; }
.game-card:hover .game-desc { max-height: 80px; opacity: 1; margin-top: 8px; }
.game-status {
  position: absolute; top: 16px; right: 16px; z-index: 3; font-size: .68rem; font-weight: 700;
  letter-spacing: .12em; text-transform: uppercase; color: var(--gold-bright); white-space: nowrap;
  background: rgba(0,0,0,.32); padding: 5px 11px; border-radius: 100px; backdrop-filter: blur(4px);
}

/* diagonal corner ribbon — Coming Soon */
.game-ribbon {
  position: absolute; top: 0; right: 0; width: 150px; height: 150px; overflow: hidden; z-index: 4; pointer-events: none;
}
.game-ribbon span {
  position: absolute; top: 26px; right: -42px; width: 180px; transform: rotate(45deg);
  text-align: center; padding: 7px 0;
  font-family: var(--font-sans); font-size: .66rem; font-weight: 700; letter-spacing: .16em; text-transform: uppercase;
  color: #2a1c05;
  background: linear-gradient(135deg, var(--gold-bright), var(--gold));
  box-shadow: 0 4px 14px rgba(24,27,31,.28), inset 0 1px 0 rgba(255,255,255,.4);
}

/* ============================================================
   STUDIO
   ============================================================ */
.studio { padding: clamp(100px, 14vh, 180px) 0; background: var(--bg-warm); overflow: hidden; }
.studio-grid { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 96px); align-items: center; }
.studio h2 { font-size: clamp(2.6rem, 5vw, 4.6rem); margin: 22px 0 28px; }
.studio h2 em { font-style: italic; color: var(--gold-deep); }
.studio p { color: var(--ink-soft); font-size: 1.08rem; max-width: 48ch; margin-bottom: 18px; }
.studio .pull {
  font-family: var(--font-display); font-style: italic; font-size: clamp(1.4rem, 2.4vw, 2rem);
  line-height: 1.25; color: var(--ink); margin: 34px 0; padding-left: 26px;
  border-left: 2px solid var(--gold); max-width: none;
}
.studio-visual { position: relative; aspect-ratio: 4/5; border-radius: 18px; overflow: hidden;
  background: linear-gradient(165deg, var(--steel) 0%, var(--ink) 100%); box-shadow: 0 30px 70px -30px rgba(24,18,12,.55); }
.studio-visual .team-scene { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.studio-visual .glow { position: absolute; inset: 0; background: radial-gradient(circle at 50% 18%, rgba(255,240,210,.28), transparent 55%); opacity: .6; mix-blend-mode: soft-light; pointer-events: none; }

/* team — hover to wave + greet */
.team-person { cursor: pointer; }
.team-person .hit { fill: transparent; pointer-events: all; }
.team-person .arm-down { transition: opacity .18s ease; }
.team-person .arm-up, .team-person .bubble { opacity: 0; pointer-events: none; }
.team-person .arm-up { transform-box: fill-box; transform-origin: 50% 100%; transition: opacity .18s ease; }
.team-person .bubble { transform-box: fill-box; transform-origin: 50% 100%; transform: translateY(7px) scale(.82);
  transition: opacity .2s ease, transform .28s cubic-bezier(.34,1.56,.64,1); }
.team-person:hover .arm-down, .team-person:focus-within .arm-down { opacity: 0; }
.team-person:hover .arm-up, .team-person:focus-within .arm-up { opacity: 1; animation: teamWave .62s ease-in-out infinite alternate; }
.team-person:hover .bubble, .team-person:focus-within .bubble { opacity: 1; transform: translateY(0) scale(1); }
.team-bubble-box { fill: #fffaf2; stroke: rgba(40,28,18,.14); stroke-width: 1.5; }
.team-bubble-text { fill: #2a1c12; font-family: 'Hanken Grotesk', system-ui, sans-serif; font-weight: 600; font-size: 21px; }
@keyframes teamWave { from { transform: rotate(-10deg); } to { transform: rotate(12deg); } }
@media (prefers-reduced-motion: reduce) { .team-person:hover .arm-up, .team-person:focus-within .arm-up { animation: none; } }

/* ============================================================
   CRAFT
   ============================================================ */
.craft { padding: clamp(100px, 14vh, 180px) 0; background: var(--ink); color: #F4ECDC; position: relative; overflow: hidden; }
.craft::before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(80% 60% at 80% 0%, var(--gold-tint), transparent 60%);
}
.craft .wrap { position: relative; z-index: 2; }
.craft .eyebrow { color: var(--gold-bright); }
.craft .eyebrow::before { background: var(--gold-bright); }
.craft .section-title { color: #FFFBEF; }
.craft .section-title em { color: var(--gold-bright); }
.craft .lead { color: rgba(244,236,220,.7); }
.craft-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 28px; margin-top: 60px; }
.craft-card {
  padding: 38px 32px 42px; border-radius: 18px; border: 1px solid rgba(244,236,220,.10);
  background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,.01));
  transition: transform .5s cubic-bezier(.2,.8,.2,1), border-color .4s, background .4s;
}
.craft-card:hover { transform: translateY(-4px); border-color: oklch(0.80 0.145 var(--gold-h) / 0.45); background: linear-gradient(180deg, rgba(240,169,28,.06), rgba(255,255,255,.01)); }
.craft-num { font-family: var(--font-display); font-size: 1rem; color: var(--gold-bright); letter-spacing: .1em; }
.craft-card h3 { font-size: 1.6rem; margin: 20px 0 12px; color: #FFFBEF; font-weight: 600; }
.craft-card p { color: rgba(244,236,220,.68); font-size: .98rem; line-height: 1.55; }
.craft-icon { width: 46px; height: 46px; border-radius: 12px; display: grid; place-items: center; margin-bottom: 4px;
  background: var(--gold-tint); border: 1px solid rgba(240,169,28,.3); }
.craft-icon span { width: 16px; height: 16px; background: var(--gold-bright); border-radius: 4px; }
.craft-strip { display: flex; flex-wrap: wrap; gap: 14px 48px; margin-top: 64px; padding-top: 40px; border-top: 1px solid rgba(244,236,220,.12); }
.craft-strip .item { display: flex; flex-direction: column; gap: 4px; }
.craft-strip .item .n { font-family: var(--font-display); font-size: 2.2rem; color: var(--gold-bright); line-height: 1; }
.craft-strip .item .l { font-size: .8rem; color: rgba(244,236,220,.6); letter-spacing: .04em; }

/* ============================================================
   CAREERS
   ============================================================ */
.careers { padding: clamp(100px, 14vh, 180px) 0; background: var(--bg-pure); }
.careers-head { max-width: 760px; margin-bottom: 56px; }
.careers h2 { font-size: clamp(2.6rem, 5.5vw, 5rem); margin: 22px 0 24px; }
.careers h2 em { font-style: italic; color: var(--gold-deep); }
.roles { display: flex; flex-direction: column; border-top: 1px solid var(--line); }
.role {
  display: grid; grid-template-columns: 1.6fr 1fr 0.9fr auto; align-items: center; gap: 24px;
  padding: 28px 8px; border-bottom: 1px solid var(--line); cursor: pointer; text-decoration: none; color: var(--ink);
  transition: background .35s, padding .35s; position: relative;
}
.role::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 0; background: var(--gold); transition: width .35s; }
.role:hover { background: var(--bg); padding-left: 24px; }
.role:hover::before { width: 3px; }
.role-title { font-family: var(--font-display); font-size: clamp(1.3rem, 2.2vw, 1.85rem); font-weight: 600; }
.role-meta { color: var(--muted); font-size: .92rem; }
.role-tag { font-size: .74rem; font-weight: 600; letter-spacing: .04em; color: var(--gold-deep); background: var(--gold-tint); padding: 5px 12px; border-radius: 100px; justify-self: start; }
.role-arrow { width: 42px; height: 42px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; transition: .35s; }
.role:hover .role-arrow { background: var(--ink); border-color: var(--ink); color: #fff; transform: rotate(-45deg); }
.role-arrow svg { width: 16px; height: 16px; }
.careers-cta { margin-top: 56px; display: flex; align-items: center; gap: 24px; flex-wrap: wrap;
  padding: 40px; border-radius: 18px; background: var(--bg-warm); }
.careers-cta .t { flex: 1; min-width: 260px; }
.careers-cta h3 { font-size: 1.7rem; font-weight: 600; }
.careers-cta p { color: var(--ink-soft); margin-top: 6px; }

/* ============================================================
   FOOTER
   ============================================================ */
.footer { background: var(--bg-deep); padding: clamp(80px, 10vh, 130px) 0 40px; position: relative; overflow: hidden; }
.footer-glow { position: absolute; bottom: -40%; left: 50%; transform: translateX(-50%); width: 80%; height: 60%;
  background: radial-gradient(circle, var(--gold-glow), transparent 60%); opacity: .3; pointer-events: none; }
.footer-top { display: grid; grid-template-columns: 1.4fr 1fr; gap: 60px; position: relative; z-index: 2; }
.footer-cta h2 { font-size: clamp(2.2rem, 4.5vw, 3.6rem); line-height: 1.0; }
.footer-cta h2 em { font-style: italic; color: var(--gold-deep); }
.footer-cta p { color: var(--ink-soft); margin: 18px 0 28px; max-width: 36ch; }
.news-form { display: flex; gap: 10px; max-width: 440px; flex-wrap: wrap; }
.news-form .field { flex: 1; min-width: 200px; position: relative; }
.news-form input {
  width: 100%; padding: 1.05em 1.3em; border-radius: 100px; border: 1px solid var(--line);
  background: var(--bg-pure); font-family: var(--font-sans); font-size: .98rem; color: var(--ink);
  transition: border-color .3s, box-shadow .3s;
}
.news-form input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 3px var(--gold-tint); }
.news-form input.err { border-color: #d4543a; box-shadow: 0 0 0 3px rgba(212,84,58,.12); }
.news-msg { font-size: .84rem; margin-top: 10px; min-height: 18px; color: var(--ink-soft); }
.news-msg.ok { color: var(--gold-deep); font-weight: 600; }
.news-msg.bad { color: #c0432a; }

.footer-links { display: grid; grid-template-columns: repeat(3, 1fr); gap: 32px; }
.footer-col h4 { font-family: var(--font-sans); font-size: .76rem; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); margin-bottom: 16px; font-weight: 700; }
.footer-col a { display: block; text-decoration: none; color: var(--ink-soft); font-size: .96rem; padding: 6px 0; transition: color .25s, transform .25s; }
.footer-col a:hover { color: var(--gold-deep); transform: translateX(3px); }

.store-badges { display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.store-badge {
  display: inline-flex; align-items: center; gap: 10px; text-decoration: none;
  padding: 10px 18px 10px 16px; border-radius: 12px; background: var(--ink); color: #fff;
  transition: transform .3s, box-shadow .3s;
}
.store-badge:hover { transform: translateY(-3px); box-shadow: 0 12px 28px rgba(27,23,16,.25); }
.store-badge svg { width: 22px; height: 22px; fill: #fff; flex-shrink: 0; }
.store-badge .sb-t { display: flex; flex-direction: column; justify-content: center; gap: 2px; line-height: 1; }
.store-badge .sb-t small { display: block; font-size: .62rem; opacity: .75; letter-spacing: .02em; line-height: 1; }
.store-badge .sb-t b { display: block; font-size: .98rem; font-weight: 600; font-family: var(--font-display); line-height: 1; }

.footer-bottom {
  display: flex; justify-content: space-between; align-items: center; gap: 20px; flex-wrap: wrap;
  margin-top: 80px; padding-top: 28px; border-top: 1px solid var(--line); position: relative; z-index: 2;
}
.footer-bottom .copy { color: var(--muted); font-size: .86rem; }
.socials { display: flex; gap: 10px; }
.socials a { width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line); display: grid; place-items: center; color: var(--ink-soft); transition: .3s; }
.socials a:hover { background: var(--ink); color: #fff; border-color: var(--ink); transform: translateY(-3px); }
.socials svg { width: 17px; height: 17px; fill: currentColor; }

/* made in Mexico */
.made-in {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  margin-top: 22px; font-size: .84rem; color: var(--muted); letter-spacing: .01em;
}
.made-in .heart { color: #ce1126; font-size: .92em; }
.hero-made { justify-content: flex-start; margin-top: 20px; font-size: .9rem; }
.made-in .flag-mx {
  font-size: 1.15em; line-height: 1; vertical-align: middle;
  font-family: "Apple Color Emoji", "Segoe UI Emoji", "Noto Color Emoji", sans-serif;
}

/* ===== arcade pixels — game icons that pop in on scroll ===== */
.arcade-layer { position: fixed; inset: 0; z-index: 800; pointer-events: none; overflow: hidden; }
.arcade-bit { position: absolute; opacity: 0; will-change: transform, opacity; }
.arcade-bit.emoji {
  font-size: 32px; line-height: 1;
  filter: drop-shadow(0 5px 12px rgba(24,27,31,.20));
}
.arcade-bit.pixel-heart { width: 3px; height: 3px; background: transparent; transform-origin: 13px 12px; }

/* peek-a-boo: poke in from the nearest side edge, hold, then duck back out */
.arcade-bit.from-left  { left: 0;  transform-origin: left center; }
.arcade-bit.from-right { right: 0; transform-origin: right center; }
@keyframes peekLeft {
  0%   { opacity: 0; transform: translateX(-115%) scale(.9) rotate(var(--r0,0deg)); }
  10%  { opacity: var(--op,.85); transform: translateX(14%) scale(1.08) rotate(var(--r1,0deg)); }
  18%  { transform: translateX(0) scale(1) rotate(var(--r1,0deg)); }
  78%  { opacity: var(--op,.85); transform: translateX(0) scale(1) rotate(var(--r1,0deg)); }
  100% { opacity: 0; transform: translateX(-115%) scale(.9) rotate(var(--r2,0deg)); }
}
@keyframes peekRight {
  0%   { opacity: 0; transform: translateX(115%) scale(.9) rotate(var(--r0,0deg)); }
  10%  { opacity: var(--op,.85); transform: translateX(-14%) scale(1.08) rotate(var(--r1,0deg)); }
  18%  { transform: translateX(0) scale(1) rotate(var(--r1,0deg)); }
  78%  { opacity: var(--op,.85); transform: translateX(0) scale(1) rotate(var(--r1,0deg)); }
  100% { opacity: 0; transform: translateX(115%) scale(.9) rotate(var(--r2,0deg)); }
}
html.no-motion .arcade-layer, html.no-arcade .arcade-layer { display: none; }
@media (prefers-reduced-motion: reduce) { .arcade-layer { display: none; } }

/* ============================================================
   RESPONSIVE
   ============================================================ */
@media (max-width: 860px) {
  .hero-inner { grid-template-columns: 1fr; gap: 0; }
  .hero-visual { position: absolute; inset: 0; opacity: .42; z-index: 1; justify-content: flex-end; align-items: center; pointer-events: none; }
  .artifact-stage { width: 86vw; transform: translateX(26%); }
  .hero-copy { position: relative; z-index: 3; }
  .studio-grid, .footer-top { grid-template-columns: 1fr; }
  .footer-top { gap: 50px; }
  .craft-grid { grid-template-columns: 1fr; }
  .game-card.feat, .game-card.half, .game-card.third { grid-column: span 12; min-height: 360px; }
}
@media (max-width: 720px) {
  .nav-links, .nav-cta .btn { display: none; }
  .nav-toggle { display: flex; }
  .nav.open .nav-links {
    display: flex; position: absolute; top: 100%; left: 0; right: 0; flex-direction: column;
    align-items: flex-start; gap: 4px; background: rgba(251,248,241,.97); backdrop-filter: blur(18px);
    padding: 20px var(--gut); box-shadow: 0 20px 40px rgba(27,23,16,.12);
  }
  .nav.open .nav-links a { padding: 10px 0; font-size: 1.1rem; }
  .role { grid-template-columns: 1fr auto; gap: 8px 16px; }
  .role-meta, .role-tag { grid-column: 1; }
  .role-tag { margin-top: 4px; }
  .footer-links { grid-template-columns: 1fr 1fr; }
  .hero-meta { gap: 24px; }
  .careers-cta { padding: 28px; }
}
