/* Sierra Game Studio — shared styles */
:root {
  --accent: #5CB8FF;
  --bg: #0A1220;
  --surface: #101B2E;
  --surface-2: #0D182B;
  --surface-3: #16243C;
  --border: #1F3050;
  --border-2: #2A4066;
  --text: #EAF3FF;
  --muted: #9DB2CC;
  --ink: #06101E;
  --mono: 'IBM Plex Mono', ui-monospace, monospace;
  --display: 'Unbounded', sans-serif;
  --body: 'Instrument Sans', system-ui, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: radial-gradient(900px 600px at 85% -5%, rgba(92,184,255,0.16), transparent 60%), radial-gradient(700px 500px at -10% 40%, rgba(92,184,255,0.07), transparent 60%), var(--bg);
  background-attachment: fixed;
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
  min-height: 100vh;
}
a { color: inherit; }
img { max-width: 100%; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

.wrap { max-width: 1200px; margin: 0 auto; padding-left: 32px; padding-right: 32px; }
.eyebrow { font-family: var(--mono); font-size: 14px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); }
.mono-label { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); }
.muted { color: var(--muted); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; margin: 0; }
h2.section { margin: 12px 0 40px; font-size: clamp(28px, 4vw, 44px); line-height: 1.1; letter-spacing: -0.02em; }
h2.big { margin: 12px 0 0; font-size: clamp(30px, 4vw, 48px); line-height: 1.1; letter-spacing: -0.02em; }
h2.sub { margin: 12px 0 20px; font-size: 30px; line-height: 1.15; letter-spacing: -0.015em; }

/* Buttons */
.btn { display: inline-flex; align-items: center; min-height: 52px; padding: 0 34px 0 28px; font-weight: 600; text-decoration: none; background: var(--surface-3); color: var(--text); clip-path: polygon(0 0, 100% 0, 100% 62%, calc(100% - 14px) 100%, 0 100%); }
.btn.primary { background: var(--accent); color: var(--ink); }
.btn.sm { min-height: 46px; padding: 0 26px 0 22px; clip-path: polygon(0 0, 100% 0, 100% 62%, calc(100% - 12px) 100%, 0 100%); }
.btn.alt { background: #1B2C48; }
.btn.lg { min-height: 54px; padding: 0 36px 0 30px; }
.btn:hover { filter: brightness(1.12); }
.btn-row { display: flex; flex-wrap: wrap; gap: 14px; }

/* Header / footer */
.site-header { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px; padding-top: 24px; padding-bottom: 24px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand span { font-family: var(--display); font-weight: 700; font-size: 20px; letter-spacing: 0.08em; }
.site-nav { display: flex; flex-wrap: wrap; gap: 6px 28px; font-family: var(--mono); font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; }
.site-nav a { text-decoration: none; color: var(--muted); padding: 10px 0; }
.site-nav a:hover { color: var(--text); }
.site-footer { border-top: 1px solid var(--border); }
.site-footer .wrap { padding-top: 28px; padding-bottom: 28px; display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.site-footer a { text-decoration: none; }

/* Hero */
.hero { padding-top: 48px; padding-bottom: 96px; display: flex; flex-wrap: wrap; gap: 56px; align-items: center; }
.hero-copy { flex: 1 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 28px; }
.hero-copy img { display: block; width: min(100%, 560px); height: auto; }
.hero h1 { font-weight: 500; font-size: clamp(26px, 3.2vw, 40px); line-height: 1.2; letter-spacing: -0.01em; }
.hero p { margin: 0; max-width: 540px; color: var(--muted); font-size: 19px; }

/* Games */
.games-band { background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.games-band .wrap { padding-top: 104px; padding-bottom: 104px; }
.games-intro { margin: 16px 0 48px; max-width: 620px; color: var(--muted); }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 520px), 1fr)); gap: 32px; }
.card { background: var(--surface); display: flex; flex-direction: column; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 32px), calc(100% - 32px) 100%, 0 100%); }
.card > a.cover { display: block; }
.card img { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; object-position: center 30%; }
.card-body { padding: 28px 28px 44px; display: flex; flex-direction: column; gap: 14px; flex: 1; }
.card .genre { font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--accent); }
.card h3 { font-size: 28px; line-height: 1.15; letter-spacing: -0.01em; }
.card p { margin: 0; color: var(--muted); }
.card .role { font-size: 15px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font-family: var(--mono); font-size: 12px; text-transform: uppercase; letter-spacing: 0.06em; border: 1px solid var(--border-2); border-radius: 999px; padding: 4px 12px; }
.tag.plain { font-family: var(--body); font-size: 15px; text-transform: none; letter-spacing: 0; padding: 4px 14px; }
.tag.tool { font-size: 13px; text-transform: none; padding: 5px 14px; }
.card-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: auto; padding-top: 12px; }

/* Studio + founder */
.studio { padding-top: 104px; }
.studio-row { display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.studio-row > :first-child { flex: 1 1 320px; min-width: 0; }
.studio-row > :last-child { flex: 2 1 480px; min-width: 0; display: flex; flex-direction: column; gap: 20px; font-size: 19px; }
.studio-row p { margin: 0; }
.pillars { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 300px), 1fr)); gap: 24px; margin-top: 56px; }
.pillar { background: var(--surface); padding: 32px 28px 40px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 24px), calc(100% - 24px) 100%, 0 100%); }
.pillar .num { font-family: var(--mono); font-size: 13px; color: var(--accent); letter-spacing: 0.1em; }
.pillar h3 { margin: 10px 0; font-size: 24px; }
.pillar p { margin: 0; color: var(--muted); }
.founder { padding-top: 104px; }
.founder-row { display: flex; flex-wrap: wrap; gap: 56px; }
.founder-row > :first-child { flex: 1 1 440px; min-width: 0; }
.founder-row > :last-child { flex: 1 1 400px; min-width: 0; display: flex; flex-direction: column; }
.founder-head { display: flex; align-items: center; gap: 20px; margin: 12px 0 24px; }
.founder-head img { display: block; flex: none; width: 104px; height: 104px; object-fit: cover; object-position: center 30%; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 16px), calc(100% - 16px) 100%, 0 100%); }
.founder-head h2 { font-size: clamp(30px, 4vw, 48px); line-height: 1.1; letter-spacing: -0.02em; }
.job { font-family: var(--mono); font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); margin-bottom: 20px; }
.founder p { margin: 0 0 18px; }
.founder p.lead { font-size: 19px; }
.timeline-row { display: flex; gap: 24px; padding: 22px 0; border-top: 1px solid var(--border); }
.timeline-row .years { flex: 0 0 96px; font-family: var(--mono); font-size: 14px; color: var(--accent); letter-spacing: 0.04em; }
.timeline-row .place { color: var(--muted); font-size: 16px; }
.timeline-end { border-top: 1px solid var(--border); }
.tools { margin-top: 32px; }
.tools .mono-label { font-size: 13px; margin-bottom: 14px; }

/* Contact */
.contact { padding-top: 104px; padding-bottom: 96px; }
.contact-box { background: var(--surface); padding: clamp(28px, 5vw, 64px); display: flex; flex-wrap: wrap; gap: 40px; align-items: center; justify-content: space-between; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 40px), calc(100% - 40px) 100%, 0 100%); }
.contact-box > :first-child { flex: 1 1 380px; min-width: 0; }
.contact-box > :first-child p { margin: 16px 0 0; color: var(--muted); }
.contact-links { flex: 1 1 300px; display: flex; flex-direction: column; gap: 12px; }
.contact-links a { display: flex; align-items: center; min-height: 52px; padding: 0 22px; border: 1px solid var(--border-2); text-decoration: none; }
.contact-links a:first-child { background: var(--accent); color: var(--ink); font-weight: 600; border-color: var(--accent); }

/* Game page */
.crumb { text-decoration: none; font-family: var(--mono); font-size: 14px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); padding: 10px 0; }
.game-title { padding-top: 40px; padding-bottom: 48px; }
.game-title h1 { margin-top: 16px; font-size: clamp(40px, 7vw, 96px); line-height: 1; letter-spacing: -0.03em; }
.game-title .tagline { margin: 24px 0 32px; max-width: 680px; color: var(--muted); font-size: 21px; }
.poster-credits { padding-bottom: 88px; display: flex; flex-wrap: wrap; gap: 48px; align-items: flex-start; }
.poster { flex: 1.4 1 480px; min-width: 0; margin: 0; }
.poster img { display: block; width: 100%; height: auto; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 40px), calc(100% - 40px) 100%, 0 100%); }
.poster figcaption { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px 16px; margin-top: 16px; font-family: var(--mono); font-size: 13px; text-transform: uppercase; letter-spacing: 0.08em; color: var(--muted); }
.poster figcaption span:first-child { color: var(--text); }
.credits { flex: 1 1 340px; min-width: 0; }
.credits h2 { margin: 12px 0 24px; font-size: 30px; line-height: 1.15; letter-spacing: -0.015em; }
.credit-list { border-bottom: 1px solid var(--border); }
.credit { padding: 16px 0; border-top: 1px solid var(--border); }
.credit b { display: block; font-size: 18px; }
.credit span { color: var(--muted); font-size: 15px; }
.specs { padding-bottom: 88px; }
.spec-grid { border-top: 1px solid var(--border); display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 220px), 1fr)); }
.spec { padding: 24px 24px 24px 0; border-bottom: 1px solid var(--border); }
.spec div { margin-top: 6px; font-weight: 500; }
.two-col { padding-bottom: 88px; display: flex; flex-wrap: wrap; gap: 56px; }
.two-col > div { flex: 1 1 440px; min-width: 0; }
.two-col p { margin: 0; color: var(--muted); }
.band { background: var(--surface-2); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border); }
.band .wrap { padding-top: 88px; padding-bottom: 88px; display: flex; flex-wrap: wrap; gap: 56px; }
.band .wrap > :first-child { flex: 1 1 320px; min-width: 0; }
.band .wrap > :first-child h2 { margin: 12px 0 16px; font-size: clamp(28px, 4vw, 44px); line-height: 1.1; letter-spacing: -0.02em; }
.band .wrap > :first-child p { margin: 0; color: var(--muted); }
.rows { flex: 2 1 480px; min-width: 0; border-bottom: 1px solid var(--border); }
.row { padding: 18px 0; border-top: 1px solid var(--border); }
.block { padding-top: 88px; }
.tile-grid { display: grid; gap: 20px; }
.tile { background: var(--surface); padding: 24px 24px 32px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%); }
.tile .mono-label { color: var(--accent); margin-bottom: 14px; }
.tile.loop .n { font-family: var(--mono); color: var(--accent); font-size: 14px; }
.tile.loop h3 { margin: 8px 0; font-size: 19px; }
.tile.loop p { margin: 0; color: var(--muted); font-size: 16px; }
.tile.system { padding: 28px 28px 36px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 24px), calc(100% - 24px) 100%, 0 100%); }
.tile.system h3 { margin: 0 0 4px; font-size: 21px; }
.tile.system .mono-label { color: var(--accent); margin-bottom: 14px; }
.tile.system p { margin: 0; color: var(--muted); }
.lede { margin: 0 0 40px; max-width: 720px; color: var(--muted); }
.features { display: flex; flex-wrap: wrap; gap: 56px; }
.features > :first-child { flex: 1 1 320px; min-width: 0; }
.features h2 { margin: 12px 0 0; }
.shots { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 340px), 1fr)); gap: 20px; }
.shots a { display: block; }
.shots img { display: block; width: 100%; aspect-ratio: 16/9; object-fit: cover; background: #0F1A2D; }
.watch { display: flex; flex-wrap: wrap; gap: 24px; }
.watch > div { flex: 1 1 440px; min-width: 0; background: var(--surface); padding: 28px 28px 40px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 32px), calc(100% - 32px) 100%, 0 100%); }
.watch h3 { margin: 0 0 16px; font-size: 22px; }
.video-link { aspect-ratio: 16/9; border: 1px solid var(--border-2); background: repeating-linear-gradient(135deg, #0F1A2D 0 14px, #13213A 14px 28px); display: flex; flex-direction: column; gap: 14px; align-items: center; justify-content: center; text-decoration: none; }
.video-link .play { width: 64px; height: 64px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; }
.video-link .mono-label { color: var(--text); }
.qr-row { display: flex; flex-wrap: wrap; gap: 20px; align-items: center; }
.qr-row.top { margin-top: 24px; }
.qr-row img { display: block; image-rendering: pixelated; background: #fff; }
.qr-row .info { flex: 1 1 180px; min-width: 0; }
.qr-row .info a.link, .qr-row .info .link { display: block; margin: 4px 0 20px; word-break: break-all; }
.qr-row .info a.link.accent { color: var(--accent); margin-bottom: 0; }
.watch p { margin: 0 0 24px; color: var(--muted); }
.more { padding-top: 88px; padding-bottom: 96px; }
.more h2 { margin-bottom: 32px; }
.more-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); gap: 20px; }
.more-card { display: block; text-decoration: none; background: var(--surface); clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%); }
.more-card img { display: block; width: 100%; aspect-ratio: 16/10; object-fit: cover; object-position: center 30%; }
.more-card .info { padding: 18px 20px 28px; }
.more-card .name { font-family: var(--display); font-weight: 700; font-size: 20px; margin-top: 4px; }

@media (max-width: 600px) {
  .wrap { padding-left: 16px; padding-right: 16px; }
  body { font-size: 16px; }
}

/* ===== Polish: Sierra lightning, motion, lightbox, video ===== */
.eyebrow::before { content: ''; display: inline-block; width: 11px; height: 15px; margin-right: 10px; vertical-align: -2px; background: var(--accent); clip-path: polygon(60% 0, 0 56%, 42% 56%, 30% 100%, 100% 40%, 55% 40%); filter: drop-shadow(0 0 6px var(--accent)); }

/* Hero bolt */
.hero { position: relative; }
.hero-bolt { position: absolute; right: 2%; top: 50%; width: min(46vw, 460px); height: auto; transform: translateY(-50%) rotate(4deg); opacity: 0.16; pointer-events: none; filter: drop-shadow(0 0 40px rgba(92,184,255,0.55)); animation: boltPulse 5s ease-in-out infinite; z-index: 0; }
.hero-copy { position: relative; z-index: 1; }
@keyframes boltPulse { 0%, 100% { opacity: 0.12; } 45% { opacity: 0.2; } 50% { opacity: 0.34; } 55% { opacity: 0.18; } }
.brand img { transition: filter 0.2s; }
.brand:hover img { filter: drop-shadow(0 0 8px var(--accent)); }

/* Buttons: lightning sweep + lift */
.btn { transition: transform 0.18s, filter 0.18s; }
.btn:hover { transform: translateY(-2px); }
.btn.primary { background-image: linear-gradient(110deg, transparent 38%, rgba(255,255,255,0.55) 50%, transparent 62%); background-size: 260% 100%; background-position: 130% 0; background-repeat: no-repeat; transition: background-position 0.55s, transform 0.18s, filter 0.18s; }
.btn.primary:hover { background-position: -30% 0; }

/* Proof strip */
.proof { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr)); gap: 0; padding-bottom: 72px; }
.proof-item { padding: 22px 24px 22px 20px; border-left: 2px solid var(--border-2); }
.proof-item b { display: block; font-family: var(--display); font-size: 20px; letter-spacing: -0.01em; }
.proof-item span { display: block; margin-top: 4px; color: var(--muted); font-size: 15px; line-height: 1.45; }
.proof-item:hover { border-left-color: var(--accent); }

/* Cards */
.card { position: relative; transition: transform 0.25s, background 0.25s; }
.card::before { content: ''; position: absolute; left: 0; top: 0; height: 3px; width: 100%; background: var(--accent); transform: scaleX(0); transform-origin: left; transition: transform 0.35s; z-index: 2; }
.card:hover { transform: translateY(-6px); background: #12213a; }
.card:hover::before { transform: scaleX(1); }
.card > a.cover { overflow: hidden; }
.card > a.cover img { transition: transform 0.5s; }
.card:hover > a.cover img { transform: scale(1.05); }
.more-card { transition: transform 0.25s; }
.more-card:hover { transform: translateY(-4px); }
.more-card img { transition: transform 0.5s; }
.tag { transition: border-color 0.2s, color 0.2s; }
.tag:hover { border-color: var(--accent); color: var(--accent); }
.pillar, .tile { transition: transform 0.25s; }
.pillar:hover, .tile:hover { transform: translateY(-4px); }

/* Founder portrait */
.founder-top { display: flex; flex-wrap: wrap; gap: 48px; margin: 24px 0 56px; align-items: flex-start; }
.portrait { display: block; flex: none; width: 300px; max-width: 100%; height: auto; aspect-ratio: 3/4; object-fit: cover; object-position: center 20%; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 40px), calc(100% - 40px) 100%, 0 100%); }
.founder-copy { flex: 1 1 420px; min-width: 0; }
.founder-bottom { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 380px), 1fr)); gap: 48px; align-items: start; }
.founder-bottom .tools { margin-top: 0; }

/* Scroll reveal */
.js .reveal { opacity: 0; transform: translateY(26px); transition: opacity 0.7s ease, transform 0.7s ease; }
.js .reveal.in { opacity: 1; transform: none; }

/* Lightbox */
.shots a { position: relative; cursor: zoom-in; overflow: hidden; }
.shots img { transition: transform 0.5s; }
.shots a:hover img { transform: scale(1.04); }
.lb { position: fixed; inset: 0; z-index: 100; background: rgba(5,10,18,0.94); display: none; align-items: center; justify-content: center; flex-direction: column; padding: 56px 16px 24px; }
.lb.open { display: flex; }
.lb img { max-width: min(100%, 1400px); max-height: calc(100vh - 150px); object-fit: contain; display: block; }
.lb .cap { margin-top: 14px; max-width: 900px; text-align: center; color: var(--muted); font-size: 15px; }
.lb .count { font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; color: var(--accent); margin-top: 6px; }
.lb button { position: absolute; background: var(--surface-3); border: 1px solid var(--border-2); color: var(--text); width: 48px; height: 48px; font-size: 22px; cursor: pointer; display: flex; align-items: center; justify-content: center; }
.lb button:hover { background: var(--accent); color: var(--ink); }
.lb .x { top: 12px; right: 12px; }
.lb .prev { left: 12px; top: 50%; transform: translateY(-50%); }
.lb .next { right: 12px; top: 50%; transform: translateY(-50%); }

/* Embedded demo video */
.video-embed { position: relative; display: block; width: 100%; padding: 0; border: 1px solid var(--border-2); background: #0F1A2D; aspect-ratio: 16/9; cursor: pointer; overflow: hidden; }
.video-embed img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0.85; transition: transform 0.5s, opacity 0.3s; }
.video-embed:hover img { transform: scale(1.04); opacity: 1; }
.video-embed .play { position: absolute; left: 50%; top: 50%; width: 72px; height: 72px; margin: -36px 0 0 -36px; border-radius: 50%; background: var(--accent); display: flex; align-items: center; justify-content: center; box-shadow: 0 0 0 8px rgba(92,184,255,0.25); transition: transform 0.2s; }
.video-embed:hover .play { transform: scale(1.1); }
.video-embed iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-note { margin: 12px 0 0; font-size: 14px; color: var(--muted); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { opacity: 1; transform: none; }
}
@media (max-width: 600px) {
  .hero-bolt { opacity: 0.1; right: -20%; }
  .founder-top { gap: 28px; }
  .portrait { width: 220px; }
}

/* =====================================================================
   v3 — link previews, track record, extras, view transitions
   ===================================================================== */

/* Accent is registered so it can animate (cheat mode) */
@property --accent { syntax: '<color>'; inherits: true; initial-value: #5CB8FF; }

kbd { font-family: var(--mono); font-size: 11px; line-height: 1; padding: 3px 6px; border: 1px solid var(--border-2); border-bottom-width: 2px; border-radius: 4px; color: var(--muted); background: var(--surface-2); }

/* ---------- Page transitions (#14) ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-group(*) { animation-duration: 0.5s; animation-timing-function: cubic-bezier(0.2, 0.8, 0.2, 1); }
  ::view-transition-old(root) { animation: vtOut 0.25s ease both; }
  ::view-transition-new(root) { animation: vtIn 0.35s 0.1s ease both; }
}
@keyframes vtOut { to { opacity: 0; transform: translateY(-12px); } }
@keyframes vtIn { from { opacity: 0; transform: translateY(16px); } }
.site-header { view-transition-name: site-header; }

/* ---------- Boot screen (#10) ---------- */
html.booting body { overflow: hidden; }
html.booting body::before, html.booting body::after { content: ''; position: fixed; z-index: 1000; pointer-events: none; animation: bootAuto 0.4s 2.4s forwards; }
html.booting body::before {
  inset: 0; display: flex; align-items: center; justify-content: center; padding-top: 210px;
  content: 'LOADING SIERRA'; font: 500 13px/1 var(--mono); letter-spacing: 0.3em; color: var(--muted);
  background: url('../assets/brand/icon.png') center calc(50% - 30px) / 110px auto no-repeat, var(--bg);
}
html.booting body::after { left: 50%; top: calc(50% + 140px); width: 220px; height: 3px; margin-left: -110px; background: var(--accent); box-shadow: 0 0 12px var(--accent); transform-origin: left; animation: bootBar 0.75s cubic-bezier(0.6, 0, 0.2, 1) forwards, bootAuto 0.4s 2.4s forwards; }
html.boot-out body::before, html.boot-out body::after { animation: bootFade 0.4s ease forwards; }
@keyframes bootBar { from { transform: scaleX(0); } to { transform: scaleX(1); } }
@keyframes bootFade { to { opacity: 0; } }
@keyframes bootAuto { to { opacity: 0; visibility: hidden; } }

/* ---------- Header controls ---------- */
.hud { display: flex; align-items: center; gap: 8px; }
.hud-btn { display: inline-flex; align-items: center; gap: 10px; min-height: 40px; padding: 0 12px; background: var(--surface); border: 1px solid var(--border-2); color: var(--muted); font: 500 13px var(--mono); text-transform: uppercase; letter-spacing: 0.08em; cursor: pointer; transition: color 0.2s, border-color 0.2s; }
.hud-btn:hover, .hud-btn[aria-pressed="true"] { color: var(--text); border-color: var(--accent); }
.hud-btn[aria-pressed="true"] svg { color: var(--accent); }
.hud-sound { width: 40px; justify-content: center; padding: 0; }
.foot-inspector { background: none; border: 0; color: inherit; font: inherit; text-transform: inherit; letter-spacing: inherit; cursor: pointer; padding: 0; display: inline-flex; gap: 8px; align-items: center; }
.foot-inspector:hover { color: var(--text); }
.hero { overflow-x: clip; }
@media (max-width: 760px) { .site-header .hud { margin-left: auto; } .site-nav { order: 3; width: 100%; } .hud-search span, .hud-search kbd { display: none; } .hud-search { width: 40px; justify-content: center; padding: 0; } }

/* ---------- Scrolling strip (#3) ---------- */
.strip { overflow: hidden; border-top: 1px solid var(--border); padding: 18px 0; -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent); }
.strip-track { display: flex; width: max-content; animation: marquee 38s linear infinite; }
.strip:hover .strip-track { animation-play-state: paused; }
.strip-set { display: flex; align-items: center; gap: 28px; padding-right: 28px; }
.strip-set span { font: 500 15px var(--mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); white-space: nowrap; }
.strip-set i { width: 10px; height: 14px; background: var(--accent); clip-path: polygon(60% 0, 0 56%, 42% 56%, 30% 100%, 100% 40%, 55% 40%); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* ---------- Track record (#3) ---------- */
.record { padding-top: 104px; }
.record .studio-row { margin-bottom: 48px; }
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr)); margin-bottom: 32px; border-top: 1px solid var(--border); }
.stats[hidden] { display: none; }
.stat { padding: 24px 0; border-bottom: 1px solid var(--border); }
.stat b { display: block; font: 700 clamp(32px, 4vw, 48px)/1 var(--display); color: var(--accent); }
.stat span { display: block; margin-top: 8px; color: var(--muted); font-size: 15px; }
.rec-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); gap: 20px; }
.rec { position: relative; background: var(--surface); padding: 26px 24px 28px; display: flex; flex-direction: column; gap: 10px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 22px), calc(100% - 22px) 100%, 0 100%); transition: transform 0.25s; }
.rec:hover { transform: translateY(-4px); }
.rec::before { content: ''; position: absolute; left: 0; top: 0; width: 3px; height: 100%; background: var(--accent); }
.rec-top { display: flex; justify-content: space-between; gap: 12px; }
.rec-top .mono-label { color: var(--accent); }
.rec-date { font: 500 12px var(--mono); color: var(--muted); letter-spacing: 0.06em; }
.rec h3 { font-size: 21px; line-height: 1.2; }
.rec p { margin: 0; color: var(--muted); font-size: 15px; }
.rec-result { align-self: flex-start; font: 600 12px var(--mono); text-transform: uppercase; letter-spacing: 0.08em; color: var(--ink); background: var(--accent); padding: 5px 10px; }
.rec-game { margin-top: auto; padding-top: 14px; display: flex; align-items: center; gap: 12px; text-decoration: none; border-top: 1px solid var(--border); }
.rec-game img { width: 64px; height: 40px; object-fit: cover; flex: none; }
.rec-game > span:not(.arrow) { display: flex; flex-direction: column; min-width: 0; }
.rec-game .mono-label { font-size: 11px; }
.rec-game b { font-family: var(--display); font-size: 15px; }
.rec-game .arrow { margin-left: auto; color: var(--accent); transition: transform 0.2s; }
.rec-game:hover .arrow { transform: translateX(4px); }

/* ---------- Portrait (#6) ---------- */
.portrait-wrap { position: relative; flex: none; width: 300px; max-width: 100%; cursor: pointer; outline-offset: 6px; }
.portrait-wrap .portrait { width: 100%; }
.portrait-wrap::after { content: ''; position: absolute; inset: 0; pointer-events: none; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 40px), calc(100% - 40px) 100%, 0 100%); box-shadow: inset 0 0 0 2px transparent; transition: box-shadow 0.25s; }
.portrait-wrap:hover::after, .portrait-wrap:focus-visible::after { box-shadow: inset 0 0 0 2px var(--accent); }
.dialogue { position: absolute; left: 12px; right: 12px; bottom: 46px; z-index: 3; padding: 20px 14px 12px; background: rgba(6, 12, 22, 0.88); border: 2px solid var(--accent); box-shadow: 0 0 0 2px rgba(6,12,22,0.88), 0 10px 30px rgba(0,0,0,0.4); color: var(--text); font: 500 14px/1.45 var(--mono); opacity: 0; transform: translateY(8px); pointer-events: none; transition: opacity 0.2s, transform 0.25s; }
.dialogue-name { position: absolute; left: 10px; top: -13px; padding: 3px 9px; background: var(--accent); color: var(--ink); font: 700 11px/1.2 var(--display); text-transform: uppercase; letter-spacing: 0.08em; }
.dialogue-text { display: block; min-height: 2.9em; }
.dialogue-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.dialogue-next { position: absolute; right: 10px; bottom: 6px; font-size: 10px; color: var(--muted); }
.dialogue-next:empty::after { content: '▼'; color: var(--accent); animation: blink 1s steps(2, start) infinite; }
@keyframes blink { to { visibility: hidden; } }
.portrait-wrap:hover .dialogue, .portrait-wrap:focus-visible .dialogue, .portrait-wrap.talking .dialogue { opacity: 1; transform: none; }
.portrait-wrap.glitch .portrait { animation: glitch 0.45s steps(2, end); }
@keyframes glitch {
  0% { transform: none; filter: none; }
  20% { transform: translate(-6px, 2px) skewX(-4deg); filter: drop-shadow(4px 0 0 #FF4D6D) drop-shadow(-4px 0 0 var(--accent)); }
  40% { transform: translate(5px, -3px); filter: drop-shadow(-5px 0 0 #FF4D6D) drop-shadow(5px 0 0 var(--accent)) brightness(1.3); }
  60% { transform: translate(-3px, 0) skewX(3deg); filter: hue-rotate(60deg); }
  80% { transform: translate(2px, 1px); filter: drop-shadow(2px 0 0 var(--accent)); }
  100% { transform: none; filter: none; }
}
@media (max-width: 600px) { .portrait-wrap { width: 260px; } .dialogue { font-size: 13px; } }

/* ---------- Bolts (portrait burst + cheat rain) ---------- */
.bolt-spark, .bolt-drop { position: fixed; z-index: 150; pointer-events: none; width: 14px; height: 20px; background: var(--accent); clip-path: polygon(60% 0, 0 56%, 42% 56%, 30% 100%, 100% 40%, 55% 40%); filter: drop-shadow(0 0 6px var(--accent)); }
.bolt-spark { margin: -10px 0 0 -7px; animation: spark 0.8s cubic-bezier(0.2, 0.7, 0.3, 1) forwards; }
@keyframes spark { from { transform: translate(0, 0) rotate(0) scale(1.2); opacity: 1; } to { transform: translate(var(--dx), var(--dy)) rotate(var(--r)) scale(0.4); opacity: 0; } }
.bolt-drop { top: -30px; transform: scale(var(--s)); animation: drop linear forwards; }
@keyframes drop { to { transform: translateY(calc(100vh + 60px)) scale(var(--s)) rotate(25deg); } }
html.cheat { animation: rainbow 3.5s linear infinite; }
@keyframes rainbow { 0%, 100% { --accent: #5CB8FF; } 20% { --accent: #C792EA; } 40% { --accent: #FF6B6B; } 60% { --accent: #FFC94D; } 80% { --accent: #7CFFB2; } }

/* ---------- Toasts ---------- */
.toasts { position: fixed; left: 50%; bottom: 24px; z-index: 160; transform: translateX(-50%); display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { padding: 12px 18px; background: var(--surface-3); border: 1px solid var(--accent); color: var(--text); font: 500 14px var(--mono); box-shadow: 0 10px 30px rgba(0,0,0,0.4); animation: toastIn 0.25s ease; }
.toast.out { opacity: 0; transform: translateY(8px); transition: opacity 0.3s, transform 0.3s; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Command menu (#7) ---------- */
.cmdk { position: fixed; inset: 0; z-index: 130; background: rgba(4, 8, 16, 0.72); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); display: flex; justify-content: center; align-items: flex-start; padding: 12vh 16px 16px; visibility: hidden; opacity: 0; transition: opacity 0.18s, visibility 0s 0.18s; }
.cmdk.open { visibility: visible; opacity: 1; transition: opacity 0.18s; }
.cmdk-panel { width: min(640px, 100%); max-height: 76vh; display: flex; flex-direction: column; background: var(--surface); border: 1px solid var(--border-2); box-shadow: 0 30px 80px rgba(0,0,0,0.5), 0 0 0 1px rgba(92,184,255,0.08); transform: translateY(-8px) scale(0.98); transition: transform 0.2s; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 20px), calc(100% - 20px) 100%, 0 100%); }
.cmdk.open .cmdk-panel { transform: none; }
.cmdk-input { display: flex; align-items: center; gap: 12px; padding: 0 16px; border-bottom: 1px solid var(--border); color: var(--muted); }
.cmdk-input input { flex: 1; min-width: 0; height: 58px; background: none; border: 0; outline: 0; color: var(--text); font: 500 18px var(--body); }
.cmdk-input input::placeholder { color: var(--muted); opacity: 0.7; }
.cmdk-list { list-style: none; margin: 0; padding: 8px; overflow-y: auto; }
.cmdk-group { padding: 12px 10px 6px; font: 500 11px var(--mono); text-transform: uppercase; letter-spacing: 0.12em; color: var(--accent); }
.cmdk-item { display: flex; align-items: center; gap: 12px; padding: 10px; cursor: pointer; border-left: 2px solid transparent; }
.cmdk-item[aria-selected="true"] { background: var(--surface-3); border-left-color: var(--accent); }
.cmdk-item img { width: 44px; height: 28px; object-fit: cover; flex: none; }
.cmdk-ico { width: 44px; height: 28px; flex: none; display: flex; align-items: center; justify-content: center; }
.cmdk-ico::before { content: ''; width: 9px; height: 13px; background: var(--border-2); clip-path: polygon(60% 0, 0 56%, 42% 56%, 30% 100%, 100% 40%, 55% 40%); }
.cmdk-item[aria-selected="true"] .cmdk-ico::before { background: var(--accent); }
.cmdk-label { font-weight: 600; }
.cmdk-hint { margin-left: auto; padding-left: 12px; color: var(--muted); font-size: 14px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmdk-empty { padding: 28px 12px; color: var(--muted); text-align: center; }
.cmdk-foot { display: flex; gap: 18px; padding: 10px 16px 14px; border-top: 1px solid var(--border); font: 500 12px var(--mono); color: var(--muted); }
.cmdk-foot kbd { margin-right: 4px; }
@media (max-width: 600px) { .cmdk { padding-top: 16px; } .cmdk-hint { display: none; } .cmdk-foot { display: none; } }

/* ---------- Inspector (#8) ---------- */
.inspector { position: fixed; top: 16px; right: 16px; z-index: 120; width: min(320px, calc(100vw - 32px)); max-height: calc(100vh - 32px); overflow-y: auto; background: #151E2E; border: 1px solid var(--border-2); box-shadow: 0 20px 60px rgba(0,0,0,0.5); font: 400 13px var(--body); transform: translateX(calc(100% + 32px)); visibility: hidden; transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), visibility 0s 0.3s; }
.inspector.open { transform: none; visibility: visible; transition: transform 0.3s cubic-bezier(0.2, 0.8, 0.2, 1); }
.insp-head { position: sticky; top: 0; z-index: 1; display: flex; align-items: center; justify-content: space-between; padding: 8px 10px 8px 12px; background: #0E1624; border-bottom: 1px solid var(--border); }
.insp-title { display: flex; gap: 8px; align-items: center; font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: 0.1em; color: var(--text); }
.insp-x { background: none; border: 0; color: var(--muted); width: 28px; height: 28px; cursor: pointer; font-size: 14px; }
.insp-x:hover { color: var(--text); }
.insp-obj { display: flex; align-items: center; gap: 10px; padding: 12px; border-bottom: 1px solid var(--border); }
.insp-cube { width: 16px; height: 16px; background: var(--accent); clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.insp-obj b { font-family: var(--display); font-size: 14px; }
.insp-tag { margin-left: auto; font: 500 11px var(--mono); color: var(--muted); }
.inspector details { border-bottom: 1px solid var(--border); }
.inspector summary { list-style: none; cursor: pointer; padding: 9px 12px; font-weight: 600; display: flex; align-items: center; gap: 8px; background: #19243A; }
.inspector summary::-webkit-details-marker { display: none; }
.inspector summary::before { content: ''; width: 0; height: 0; border-left: 5px solid var(--muted); border-top: 4px solid transparent; border-bottom: 4px solid transparent; transition: transform 0.15s; }
.inspector details[open] summary::before { transform: rotate(90deg); }
.insp-body { padding: 10px 12px 14px; display: flex; flex-direction: column; gap: 10px; }
.insp-field { display: grid; grid-template-columns: 68px 1fr auto; align-items: center; gap: 10px; }
.insp-field label { color: var(--muted); }
.insp-swatches { grid-column: 2 / -1; display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.insp-swatches button { width: 22px; height: 22px; padding: 0; border: 2px solid transparent; background: var(--sw); cursor: pointer; outline-offset: 1px; }
.insp-swatches button[aria-pressed="true"] { border-color: var(--text); }
.insp-swatches input[type=color] { width: 28px; height: 24px; padding: 0; border: 1px solid var(--border-2); background: none; cursor: pointer; }
.insp-field input[type=range] { width: 100%; accent-color: var(--accent); }
.insp-field output { font: 500 12px var(--mono); color: var(--text); min-width: 28px; text-align: right; }
.insp-check { display: flex; align-items: center; gap: 10px; cursor: pointer; }
.insp-check input { accent-color: var(--accent); width: 15px; height: 15px; }
.insp-note { margin: 0; color: var(--muted); font-size: 12px; line-height: 1.6; }
.insp-note kbd { margin-right: 2px; }
.insp-actions { display: flex; align-items: center; gap: 12px; padding: 12px; }
.insp-reset { background: var(--surface-3); border: 1px solid var(--border-2); color: var(--text); font: 500 12px var(--mono); text-transform: uppercase; letter-spacing: 0.08em; padding: 7px 12px; cursor: pointer; }
.insp-reset:hover { border-color: var(--accent); }

/* Gizmos */
.gizmo-grid { position: fixed; inset: 0; z-index: 90; pointer-events: none; display: none; }
html.gizmo-grid-on .gizmo-grid { display: block; }
.gizmo-grid .wrap { height: 100%; display: grid; grid-template-columns: repeat(12, 1fr); gap: 24px; }
.gizmo-grid span { background: color-mix(in srgb, var(--accent) 9%, transparent); border-left: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); border-right: 1px solid color-mix(in srgb, var(--accent) 30%, transparent); }
html.gizmo-bounds-on main *, html.gizmo-bounds-on .site-header *, html.gizmo-bounds-on .site-footer * { outline: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent); outline-offset: -1px; }
.gizmo-fps { position: fixed; left: 16px; bottom: 16px; z-index: 121; display: none; padding: 6px 10px; background: #0E1624; border: 1px solid var(--border-2); font: 500 12px var(--mono); color: #7CFFB2; pointer-events: none; }

/* Reduced motion: keep everything usable, just still */
@media (prefers-reduced-motion: reduce) {
  .strip-track { width: auto; flex-wrap: wrap; justify-content: center; }
  .strip-set { flex-wrap: wrap; justify-content: center; row-gap: 10px; }
  .strip-set[aria-hidden] { display: none; }
  .strip { -webkit-mask-image: none; mask-image: none; }
}
