@font-face {
  font-family: Manufacturing Consent;
  src: url(/assets/manufacturing.woff2) format('woff2');
  font-display: swap;
}
@font-face {
  font-family: Bricolage Grotesque;
  src: url(/assets/bricolage.woff2) format('woff2');
  font-weight: 400 800;
  font-display: swap;
}
@font-face {
  font-family: Xanh Mono;
  src: url(/assets/xanh.woff2) format('woff2');
  font-display: swap;
}

:root {
  --paper: #f7f5ea;
  --ink: #171711;
  --acid: #efff56;
  --blue: #163fe0;
  --swamp: #252a11;
  --purple: #ded4ff;
  --display: 'Manufacturing Consent', Georgia, serif;
  --body: 'Bricolage Grotesque', system-ui, sans-serif;
  --mono: 'Xanh Mono', 'Courier New', monospace;
  --gutter: clamp(1.25rem, 5vw, 5rem);
  --line: 2px solid var(--ink);
  --shadow: 5px 5px 0 var(--ink);
  --speed: 180ms;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 6rem; }
body {
  margin: 0;
  background-color: var(--paper);
  background-image: radial-gradient(#2626131a .65px, transparent .65px);
  background-size: 7px 7px;
  color: var(--ink);
  font: 1rem/1.6 var(--body);
}
body, button, a { -webkit-tap-highlight-color: transparent; }
img { display: block; max-width: 100%; }
figure, h1, h2, h3, p { margin: 0; }
a { color: inherit; }
button { font: inherit; }
[hidden] { display: none !important; }
::selection { color: var(--ink); background: var(--acid); }
:focus-visible { outline: 3px dashed var(--blue); outline-offset: 4px; }

.wrap { width: min(100% - var(--gutter) * 2, 82rem); margin-inline: auto; }
.skip { position: fixed; z-index: 20; top: .7rem; left: .7rem; background: var(--acid); color: var(--ink); padding: .6rem 1rem; transform: translateY(-160%); }
.skip:focus { transform: none; }

.top { position: sticky; z-index: 5; top: 0; background: var(--acid); border-bottom: var(--line); }
.top-inner, .footer-inner { width: min(100% - var(--gutter) * 2, 82rem); margin-inline: auto; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; gap: clamp(.85rem, 3vw, 2.6rem); }
.top-inner { min-height: 4.65rem; }
.brand { display: inline-flex; align-items: center; gap: .55rem; width: max-content; text-decoration: none; font: 400 2.1rem/.9 var(--display); letter-spacing: -.025em; }
.brand img { width: 2.35rem; height: 2.35rem; border: 1px solid var(--ink); border-radius: .45rem; }
.site-nav, .ports { display: flex; align-items: center; }
.site-nav { gap: clamp(1.05rem, 2.5vw, 2.6rem); }
.site-nav a { font-weight: 750; text-decoration: none; text-underline-offset: .37em; white-space: nowrap; }
.site-nav a:hover, .site-nav a[aria-current] { text-decoration: underline 2px; }
.ports { justify-content: flex-end; gap: .4rem; }
.port-button { min-width: 2.55rem; min-height: 2.45rem; padding: .32rem .55rem; text-decoration: none; text-align: center; border: 1px solid var(--ink); border-radius: 2px; background: var(--paper); color: var(--ink); font: 400 .88rem/1.85 var(--mono); transition: color var(--speed), background var(--speed), transform var(--speed); }
.port-button:first-child { background: var(--ink); color: var(--acid); }
.port-button:hover { background: var(--blue); color: white; transform: translateY(-2px); }

.hero { position: relative; display: grid; grid-template-columns: minmax(0, .94fr) minmax(0, 1fr); align-items: center; column-gap: clamp(2rem, 5.2vw, 5.4rem); padding-block: clamp(3rem, 6.5vw, 6.5rem) clamp(3.35rem, 7vw, 6.7rem); }
.hero-copy { position: relative; z-index: 1; }
.ticker, .eyebrow { font: 400 .95rem/1.3 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.ticker { display: inline-flex; align-items: center; gap: .55rem; border: 1px solid var(--ink); padding: .4rem .8rem; background: white; box-shadow: 2px 2px 0 var(--ink); text-transform: none; }
.ticker span { width: .56rem; height: .56rem; border-radius: 50%; background: var(--blue); box-shadow: 0 0 .45rem #3b5dff80; }
.hero-title, .chapter-head h1 { font-family: var(--display); font-weight: 400; letter-spacing: -.035em; }
.hero-title { margin: .55rem 0 .45rem -.04em; font-size: clamp(4.35rem, 11vw, 10.75rem); line-height: .90; white-space: nowrap; }
.hero-title span { color: var(--blue); }
.hero-subtitle { margin-top: clamp(.75rem, 2vw, 1.65rem); font-size: clamp(2rem, 4vw, 4.25rem); font-weight: 780; line-height: .97; letter-spacing: -.075em; }
.hero-subtitle em { color: var(--blue); font-style: normal; }
.hero-description { margin-top: 1.35rem; max-width: 29rem; font-size: clamp(1.07rem, 1.6vw, 1.28rem); line-height: 1.5; }
.actions { display: flex; align-items: center; gap: .9rem; flex-wrap: wrap; margin-top: 1.65rem; }
.button { display: inline-flex; justify-content: center; align-items: center; width: fit-content; min-height: 3.05rem; padding: .68rem 1rem; border: var(--line); color: var(--ink); background: var(--paper); box-shadow: 3px 3px 0 var(--ink); text-decoration: none; text-align: center; font-weight: 780; line-height: 1.25; transition: transform var(--speed), box-shadow var(--speed), background var(--speed), color var(--speed); }
.button:hover { transform: translate(-2px, -2px); box-shadow: 5px 5px 0 var(--ink); }
.button:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.button-blue { background: var(--blue); color: white; }
.button-acid { background: var(--acid); }
.button-paper:hover { background: var(--acid); }

.pixel-frame { border: var(--line); box-shadow: var(--shadow); background: var(--paper); min-width: 0; }
.hero-figure { transform: rotate(2deg); transform-origin: center; }
.frame-top, .frame-bottom { min-height: 2rem; padding: .32rem .72rem; display: flex; justify-content: space-between; align-items: center; gap: .4rem; overflow: hidden; color: var(--ink); font: 400 .86rem/1.3 var(--mono); }
.frame-top { border-bottom: var(--line); background: var(--purple); }
.frame-bottom { border-top: var(--line); }
.frame-lights { display: flex; gap: .29rem; }
.frame-lights i { width: .54rem; height: .54rem; border: 1px solid var(--ink); border-radius: 50%; background: var(--paper); }
.frame-lights i:nth-child(2) { background: var(--acid); }
.frame-lights i:last-child { background: var(--blue); }
.hero-picture { overflow: hidden; aspect-ratio: 1.18; background: #1449ae; }
.hero-picture img { width: 100%; height: 100%; object-fit: cover; object-position: center top; transform: scale(1.04) translateY(var(--drift, 0px)); }

.signal { overflow: hidden; background: var(--blue); color: white; border-block: var(--line); }
.signal-track { display: flex; width: max-content; padding-block: .85rem; animation: signal 35s linear infinite; }
.signal-track span { white-space: nowrap; font: 400 clamp(.95rem, 1.6vw, 1.25rem)/1.2 var(--mono); text-transform: uppercase; letter-spacing: .11em; }
.signal-track b { padding-inline: 1.2rem; color: var(--acid); font-weight: 400; }
.signal:hover .signal-track { animation-play-state: paused; }
@keyframes signal { to { transform: translateX(-50%); } }

.gallery, .road-preview { padding-block: clamp(4rem, 9.5vw, 8.5rem); }
.section-heading { display: flex; justify-content: space-between; align-items: flex-end; gap: 1rem 2rem; margin-bottom: clamp(1.35rem, 2.6vw, 2.6rem); }
.eyebrow { margin-bottom: .65rem; }
h2 { font: 400 clamp(3.1rem, 7vw, 7rem)/.87 var(--display); letter-spacing: -.033em; }
.gallery-controls { display: flex; gap: .55rem; align-items: end; }
.gallery-controls button { display: grid; place-items: center; width: 2.7rem; height: 2.7rem; padding: 0 0 .15rem; background: white; color: var(--ink); border: var(--line); box-shadow: 2px 2px 0 var(--ink); cursor: pointer; font-size: 2.1rem; line-height: 1; }
.gallery-controls button:hover:not(:disabled) { background: var(--acid); }
.gallery-controls button:disabled { opacity: .42; cursor: default; }
.gallery-list { display: grid; grid-auto-columns: max(17rem, 36%); grid-auto-flow: column; align-items: start; gap: clamp(.85rem, 2vw, 1.65rem); list-style: none; overflow-x: auto; padding: .25rem .4rem 1.05rem .1rem; margin: 0; scroll-snap-type: x mandatory; scroll-padding-inline: .1rem .4rem; scrollbar-width: thin; scrollbar-color: var(--ink) #d9d5bf; }
.meme-card { scroll-snap-align: start; display: grid; border: var(--line); box-shadow: 4px 4px 0 var(--ink); overflow: hidden; background: var(--acid); }
.meme-card:nth-child(2) { background: var(--purple); }
.meme-card:nth-child(3) { background: #b6d5ff; scroll-snap-align: end; }
.meme-card img { width: 100%; height: auto; aspect-ratio: 1.5; object-fit: cover; }
.meme-caption { border-top: var(--line); padding: .75rem 1rem 1rem; min-height: 6.05rem; }
.meme-caption h3 { font-weight: 800; font-size: clamp(1.35rem, 2vw, 1.8rem); line-height: 1.1; letter-spacing: -.055em; }
.meme-caption p { margin-top: .33rem; line-height: 1.35; }
.rabbit-button { margin-top: .55rem; padding: 0 .4rem; border: 1px solid var(--ink); background: var(--paper); color: var(--ink); cursor: pointer; font: .9rem/1.9 var(--mono); }
.rabbit-button:hover { color: white; background: var(--blue); }

.lore-preview { overflow: hidden; border-block: var(--line); background: var(--blue); color: white; }
.lore-preview-inner { display: grid; grid-template-columns: minmax(16rem, .73fr) minmax(0, 1.2fr); gap: clamp(2rem, 5vw, 5.5rem); align-items: center; padding-block: clamp(3.7rem, 7vw, 7rem); }
.lore-teaser .eyebrow { color: var(--acid); }
.lore-teaser p:not(.eyebrow) { margin-top: 1.15rem; max-width: 25rem; font-size: clamp(1.05rem, 2vw, 1.35rem); line-height: 1.45; }
.lore-teaser .button { margin-top: 1.4rem; }
.lore-cut { position: relative; background: var(--acid); padding: .5rem; border: var(--line); box-shadow: 8px 8px 0 var(--ink); rotate: -3deg; }
.lore-cut img { width: 100%; min-height: 16.5rem; object-fit: cover; object-position: 55% center; }

.phase-strip { border: var(--line); box-shadow: var(--shadow); display: grid; grid-template-columns: repeat(3, 1fr); list-style: none; padding: 0; margin: 0; }
.phase-strip li:nth-child(1) { background: var(--acid); }
.phase-strip li:nth-child(2) { background: #b6d5ff; }
.phase-strip li:nth-child(3) { background: var(--purple); }
.phase-strip li + li { border-left: var(--line); }
.phase-strip a { display: grid; align-content: space-between; gap: 1.4rem; min-height: clamp(6.6rem, 13vw, 10rem); padding: clamp(.85rem, 2.4vw, 2rem); text-decoration: none; }
.phase-strip a:hover strong { text-decoration: underline 2px; text-underline-offset: .2em; }
.phase-strip span { font: .95rem/1 var(--mono); }
.phase-strip strong { font-size: clamp(1.2rem, 2.6vw, 2.3rem); line-height: 1; letter-spacing: -.05em; }

.dex-zone { background: var(--swamp); color: white; border-block: var(--line); }
.dex-wrap { padding-block: clamp(3.8rem, 7.5vw, 7rem); }
.dex-zone .eyebrow { color: var(--acid); }
.dex-zone .button, .lore-preview .button { outline-color: white; }
.terminal { border: 2px solid var(--ink); box-shadow: 5px 5px 0 #141708; background: #101113; }
.terminal-bar { display: flex; justify-content: space-between; align-items: center; gap: .6rem; border-bottom: var(--line); background: var(--purple); color: var(--ink); padding: .55rem .85rem; font: .92rem/1.3 var(--mono); }
.terminal-bar a { white-space: nowrap; text-underline-offset: .2em; }
.terminal-actions { display: flex; align-items: center; justify-content: flex-end; gap: .65rem 1rem; flex-wrap: wrap; }
.terminal-actions button { padding: .25rem .4rem; border: 1px solid var(--ink); background: var(--paper); cursor: pointer; color: var(--ink); font: inherit; }
.terminal-actions button:hover { background: var(--acid); }
.terminal-screen { min-height: 22rem; display: grid; place-items: center; }
.terminal-screen p { margin: 1.5rem; text-align: center; }
.terminal-screen iframe { display: block; width: 100%; height: clamp(26rem, 58vw, 40rem); border: 0; color-scheme: dark; }

.chapter-hero { padding-block: clamp(3.2rem, 6.5vw, 6rem) clamp(2.4rem, 4vw, 4rem); }
.chapter-head { display: flex; align-items: end; justify-content: space-between; gap: 1.5rem 2.5rem; }
.chapter-head h1 { font-size: clamp(4.6rem, 11vw, 11rem); line-height: .82; }
.chapter-head > p { max-width: 20rem; margin-bottom: .45rem; color: var(--blue); font-size: clamp(1.3rem, 2.4vw, 2rem); line-height: 1.15; font-weight: 750; letter-spacing: -.05em; }
.chapter-banner { margin-top: clamp(2rem, 4vw, 3.8rem); }
.chapter-banner img { width: 100%; height: auto; }
.story { padding-top: 1rem; padding-bottom: clamp(3.4rem, 7vw, 7rem); }
.story-row { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1fr); gap: clamp(2rem, 7vw, 6rem); align-items: center; border-top: var(--line); padding-block: clamp(2.5rem, 6vw, 5.8rem); }
.story-row h2 { font-size: clamp(2.8rem, 5.8vw, 5.45rem); }
.story-row p:not(.eyebrow), .story-outro p:not(.eyebrow), .phase-copy p { margin-top: 1rem; font-size: clamp(1.05rem, 1.85vw, 1.24rem); max-width: 37rem; }
.story-row img { width: 100%; height: auto; border: var(--line); box-shadow: var(--shadow); }
.story-flip { grid-template-columns: minmax(0, 1fr) minmax(0, .85fr); }
.story-flip img { grid-area: 1 / 1; }
.story-outro { border: var(--line); padding: clamp(1.8rem, 5vw, 4.6rem); background: var(--purple); box-shadow: var(--shadow); }
.story-outro .button { margin-top: 1.4rem; }

.roadmap-hero { display: grid; grid-template-columns: minmax(0, .9fr) minmax(0, 1fr); align-items: center; gap: clamp(2rem, 5vw, 5.6rem); }
.roadmap-hero .chapter-head { display: grid; align-items: start; }
.roadmap-hero .chapter-head h1 { font-size: clamp(4.25rem, 9.6vw, 9.5rem); }
.road-figure { rotate: 2deg; }
.road-figure img { width: 100%; height: auto; }
.timeline { padding-block: 1.5rem clamp(2.5rem, 5vw, 5rem); }
.timeline > ol { list-style: none; margin: 0; padding: 0; border-top: var(--line); }
.phase { display: grid; grid-template-columns: auto minmax(0, 1fr) minmax(12rem, .6fr); align-items: start; gap: clamp(1.25rem, 3.5vw, 3.6rem); padding-block: clamp(1.7rem, 4vw, 3.5rem); border-bottom: var(--line); }
.phase-num { display: grid; place-items: center; width: clamp(3.3rem, 8vw, 7.8rem); aspect-ratio: 1; border: var(--line); background: var(--acid); box-shadow: 3px 3px 0 var(--ink); font: clamp(1.3rem, 3vw, 2.6rem)/1 var(--mono); }
.phase:nth-child(2) .phase-num { background: #b6d5ff; }
.phase:nth-child(3) .phase-num { background: var(--purple); }
.phase h2 { font-size: clamp(2.7rem, 5.5vw, 5.4rem); }
.phase ul { padding-left: 1.3rem; margin: .15rem 0 0; line-height: 1.5; }
.phase ul li + li { margin-top: .45rem; }
.road-outro { background: var(--purple); border: var(--line); box-shadow: var(--shadow); margin-bottom: clamp(3.6rem, 8vw, 7rem); padding: clamp(1.6rem, 4.7vw, 4rem); display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.4rem; align-items: center; }

.footer { background: var(--acid); border-top: var(--line); }
.index-page .footer { border-top: 0; }
.footer-inner { min-height: 8rem; padding-block: 1.4rem; }
.footer p { margin-top: .5rem; }
.back-top { justify-self: end; text-underline-offset: .22em; }

.boot { position: fixed; z-index: 15; inset: 0; display: grid; place-items: center; pointer-events: none; background: var(--blue); color: white; transition: opacity .32s ease, visibility .32s ease; }
.boot.is-finished { opacity: 0; visibility: hidden; }
.boot-stack { display: grid; justify-items: center; gap: 1.25rem; width: min(17rem, 75vw); font-family: var(--mono); }
.boot-stack img { width: 5rem; height: 5rem; border-radius: .8rem; outline: 2px solid var(--paper); box-shadow: 0 0 2rem #a2b9ff9c; }
.boot-stack i { display: block; width: 100%; padding: 2px; border: 1px solid white; }
.boot-stack i::after { content: ''; display: block; height: .58rem; background: repeating-linear-gradient(90deg, var(--acid) 0 12px, transparent 12px 15px); transform-origin: left center; animation: boot-fill .63s cubic-bezier(.15,.55,.44,1) both; }
@keyframes boot-fill { from { transform: scaleX(.05); } to { transform: scaleX(1); } }
.first-boot .hero-copy { animation: boot-rise .65s .55s both cubic-bezier(.15,.55,.44,1); }
@keyframes boot-rise { from { opacity: 0; transform: translateY(1.05rem); } to { opacity: 1; transform: none; } }
.reveal-ready .reveal { opacity: 0; transform: translateY(1.6rem); transition: opacity .5s ease, transform .65s cubic-bezier(.2,.8,.2,1); }
.reveal-ready .reveal.is-visible, .reveal-ready .reveal:focus-within { opacity: 1; transform: none; }

@media (max-width: 62rem) {
  .top-inner, .footer-inner { gap: .8rem; }
  .hero { column-gap: 2rem; }
  .wide-only { display: none; }
  .hero-title { font-size: clamp(4.25rem, 10.75vw, 7.1rem); }
  .gallery-list { grid-auto-columns: max(16rem, 43%); }
}

@media (max-width: 45rem) {
  html { scroll-padding-top: 7rem; }
  .top-inner { grid-template-columns: minmax(0, 1fr) auto; gap: .35rem .7rem; padding-block: .55rem .44rem; }
  .top-inner .brand { font-size: 1.77rem; gap: .35rem; }
  .top-inner .brand img { width: 1.94rem; height: 1.94rem; }
  .top-inner .ports { grid-area: 1 / 2; }
  .site-nav { grid-column: 1 / -1; justify-content: space-between; justify-self: stretch; gap: 1.2rem; border-top: 1px solid #1717114a; padding-top: .38rem; }
  .site-nav a { font-size: .94rem; }
  .port-button { min-width: 2.08rem; min-height: 2.15rem; padding-inline: .33rem; font-size: .83rem; }
  .ports { gap: .27rem; }
  .hero, .lore-preview-inner, .story-row, .roadmap-hero { grid-template-columns: minmax(0, 1fr); }
  .hero { gap: 2.25rem; padding-block: 2.6rem 3.5rem; }
  .hero-title { font-size: clamp(4.25rem, 17.4vw, 9rem); }
  .hero-description { margin-top: 1rem; }
  .hero-figure { rotate: -.5deg; }
  .gallery-list { grid-auto-columns: max(min(77vw, 18rem), 76%); }
  .section-heading { align-items: end; flex-wrap: wrap; }
  .lore-cut img { min-height: 0; aspect-ratio: 2 / 1; }
  .phase-strip { grid-template-columns: 1fr; }
  .phase-strip li + li { border: 0; border-top: var(--line); }
  .phase-strip a { display: flex; align-items: center; min-height: 4.5rem; }
  .chapter-head { display: grid; align-items: start; }
  .chapter-head h1, .roadmap-hero .chapter-head h1 { font-size: clamp(4.15rem, 15vw, 7rem); }
  .chapter-banner img { aspect-ratio: 2.15; object-fit: cover; }
  .story-flip img { grid-area: auto; }
  .phase { grid-template-columns: auto 1fr; }
  .phase ul { grid-column: 2; }
  .footer-inner { grid-template-columns: 1fr auto; gap: 1.2rem .7rem; }
  .footer .ports { grid-area: 2 / 1 / 3 / -1; justify-content: start; }
}

@media (max-width: 23rem) {
  .port-button { min-width: 1.9rem; padding-inline: .26rem; }
  .top-inner { width: calc(100% - 1.45rem); gap: .35rem; }
  .top-inner .brand { font-size: 1.55rem; }
  .top-inner .brand img { width: 1.6rem; height: 1.6rem; }
  .hero-title { font-size: 17.4vw; }
  h2 { font-size: 2.75rem; }
  .terminal-bar { font-size: .81rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .signal-track { animation: none; }
  .hero-picture img { transform: none; }
}
