html, body { margin: 0; }
/* Layout: a single sheet of blueprint paper. Sections are drafted panels on one grid,
   with the factory line as the hero drawing and a working price dial as the one interactive moment. */
:root {
  --paper: #173E6B;      /* blueprint paper, from the game's Brand.paper */
  --deep: #0F2A49;       /* panel ground, Brand.deep */
  --ink: #F3EBD8;        /* cream ink, Brand.ink */
  --ink-dim: #B9C3CF;
  --line: rgba(243,235,216,.16);
  --accent: #F2A541;     /* amber, Brand.accent */
  --stamp: #E8553E;      /* red stamp, Brand.stamp */
  --teal: #3FA7A0;       /* Brand.teal */
  --display: "Barlow Condensed", "DIN Condensed", "Arial Narrow", sans-serif-condensed, sans-serif;
  --body: "Nunito", ui-rounded, "SF Pro Rounded", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { animation: none !important; transition: none !important; } }
body {
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px),
    linear-gradient(rgba(243,235,216,.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(243,235,216,.05) 1px, transparent 1px);
  background-size: 120px 120px, 120px 120px, 24px 24px, 24px 24px;
  color: var(--ink);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.6;
}
.wrap { max-width: 1120px; margin: 0 auto; padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }
h1, h2, h3 { font-family: var(--display); font-weight: 700; line-height: 1.02; margin: 0; text-wrap: balance; letter-spacing: .01em; }
h1 { font-size: clamp(48px, 9vw, 104px); text-transform: uppercase; }
h2 { font-size: clamp(36px, 5.5vw, 60px); text-transform: uppercase; }
h3 { font-size: 26px; text-transform: uppercase; letter-spacing: .02em; }
p { margin: 0; max-width: 62ch; }
.label { font-family: var(--mono); font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); }
/* Apple product names are never set in all caps (Apple's marketing guidelines), so they keep their own case inside uppercased labels and headings. */
.pn { text-transform: none; }
.dim { color: var(--ink-dim); }
a { color: var(--accent); }
a:focus-visible, button:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }

/* nav */
nav { padding-block: 18px; }
nav .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; }
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; color: var(--ink); }
.brand img { width: 40px; height: 40px; border-radius: 10px; }
.brand span { font-family: var(--display); font-size: 28px; font-weight: 700; text-transform: uppercase; letter-spacing: .04em; }
.navlinks { display: flex; gap: 18px; align-items: center; font-weight: 600; font-size: 15px; }
.navlinks a { color: var(--ink); text-decoration: none; }
.navlinks a:hover { color: var(--accent); }
@media (max-width: 720px) { .navlinks a:not(.btn):not(.lang) { display: none; } }
@media (max-width: 520px) { .navlinks .nav-play { display: none; } }

.btn { display: inline-flex; align-items: center; gap: 8px; background: var(--accent); color: #1B1406 !important; font-weight: 800; text-decoration: none; padding: 12px 20px; border-radius: 999px; border: 0; font-family: var(--body); font-size: 16px; cursor: pointer; }
.btn:hover { filter: brightness(1.08); }
.store-badge { display: inline-flex; align-items: center; }
.store-badge img { display: block; height: 48px; width: auto; }
.btn.ghost { background: transparent; color: var(--ink) !important; box-shadow: inset 0 0 0 1.5px var(--line); }

/* hero */
.hero { padding-block: 40px 72px; }
.hero .wrap { display: grid; grid-template-columns: 1fr 340px; gap: 56px; align-items: center; }
/* The hero picture: a real late-game floor from the game, tilted like a phone set down on the drawing. */
.hero-shot { max-width: 340px; justify-self: center; border-radius: 40px; transform: rotate(1.6deg); box-shadow: 0 28px 60px rgba(0,0,0,.45); }
.hero-copy { display: grid; gap: 22px; min-width: 0; }
.hero h1 em { font-style: normal; color: var(--accent); }
.hero .lede { font-size: 20px; }
.ctas { display: flex; flex-wrap: wrap; gap: 12px; }
.preview { font-weight: 600; font-size: 15px; justify-self: start; }
.facts { display: flex; flex-wrap: wrap; gap: 8px 20px; font-family: var(--mono); font-size: 13px; color: var(--ink-dim); }
@media (max-width: 900px) { .hero .wrap { grid-template-columns: 1fr; } .hero-shot { max-width: 300px; border-radius: 34px; } }
/* The bottleneck demo under the hero, with the crew rising from behind it. */
.demo { display: grid; grid-template-columns: 1fr 1.1fr; gap: 48px; align-items: center; }
.demo .hero-art { margin-top: 150px; }
@media (max-width: 900px) { .demo { grid-template-columns: 1fr; gap: 0; } }

/* the factory drawing */
.sheet { background: var(--deep); border: 1.5px solid var(--line); border-radius: 6px; padding: 20px; position: relative; min-width: 0; }
.line { display: grid; gap: 12px; margin-top: 14px; }
.station { display: grid; grid-template-columns: 88px 1fr 92px; align-items: center; gap: 12px; }
.station .nm { font-family: var(--display); font-size: 20px; text-transform: uppercase; letter-spacing: .03em; }
.station .bar { height: 26px; border-radius: 4px; background: rgba(243,235,216,.08); position: relative; overflow: hidden; }
.station .fill { position: absolute; inset: 0 auto 0 0; background: var(--teal); border-radius: 4px; transition: width .4s ease, background .3s; }
.station.slow .fill { background: var(--stamp); }
.station .rate { font-family: var(--mono); font-size: 13px; text-align: right; font-variant-numeric: tabular-nums; }
.station .tag { position: absolute; left: 8px; top: 50%; transform: translateY(-50%); font-family: var(--mono); font-size: 11px; letter-spacing: .1em; color: #fff; text-transform: uppercase; }
.readout { margin-top: 18px; padding-top: 14px; border-top: 1.5px dashed var(--line); display: flex; flex-wrap: wrap; gap: 12px 20px; justify-content: space-between; align-items: center; padding-bottom: 22px; }
.readout .big { font-family: var(--display); font-size: 40px; font-variant-numeric: tabular-nums; }
.readout .small { font-size: 14px; color: var(--ink-dim); max-width: 34ch; }
.machines { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; }
.machines button { font: 600 14px var(--body); color: var(--ink); background: transparent; border: 1.5px solid var(--line); border-radius: 999px; padding: 6px 12px; cursor: pointer; }
.machines button:hover { border-color: var(--accent); color: var(--accent); }
@media (max-width: 460px) { .station { grid-template-columns: 70px 1fr 74px; gap: 8px; } .station .nm { font-size: 17px; } }

section { padding-block: 72px; }
/* The open iPhone Duo screenshot in a plain folding frame of our own: two panels and a hinge line, no Apple product art. */
.fold { position: relative; max-width: 920px; margin: 0 auto; padding: 12px; border-radius: 34px; background: #0A1B30; border: 1.5px solid var(--line); box-shadow: 0 18px 40px rgba(0,0,0,.3); }
.fold img { display: block; width: 100%; height: auto; border-radius: 22px; }
.fold::after { content: ""; position: absolute; top: 0; bottom: 0; left: 50%; width: 2px; margin-left: -1px; background: linear-gradient(rgba(243,235,216,.05), rgba(243,235,216,.22) 50%, rgba(243,235,216,.05)); pointer-events: none; }
@media (max-width: 600px) { .fold { padding: 7px; border-radius: 22px; } .fold img { border-radius: 15px; } }
.section-head { display: grid; gap: 14px; margin-bottom: 36px; }

/* three acts */
.acts { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border-top: 1.5px solid var(--line); }
.act { padding: 28px 28px 28px 0; display: grid; gap: 12px; align-content: start; min-width: 0; }
.act + .act { padding-left: 28px; border-left: 1.5px solid var(--line); }
.act .chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 4px; }
.chip { font-family: var(--mono); font-size: 12px; padding: 3px 9px; border-radius: 999px; background: rgba(242,165,65,.14); color: var(--accent); white-space: nowrap; }
@media (max-width: 860px) { .acts { grid-template-columns: 1fr; } .act, .act + .act { padding: 24px 0; border-left: 0; border-top: 1.5px solid var(--line); } .act:first-child { border-top: 0; } }

/* lesson loop */
.loop { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: center; }
.loop-steps { display: grid; gap: 0; counter-reset: s; }
.loop-steps li { list-style: none; display: grid; grid-template-columns: 44px 1fr; gap: 14px; padding: 16px 0; border-bottom: 1.5px solid var(--line); }
.loop-steps li::before { counter-increment: s; content: counter(s); font-family: var(--display); font-size: 34px; line-height: 1; color: var(--accent); }
.loop-steps { padding: 0; margin: 0; }
.loop-steps b { display: block; font-family: var(--display); font-size: 22px; text-transform: uppercase; letter-spacing: .02em; font-weight: 700; }
@media (max-width: 860px) { .loop { grid-template-columns: 1fr; } }

/* screenshots from the game */
.shot { display: block; width: 100%; height: auto; border-radius: 30px; border: 1.5px solid var(--line); background: var(--deep); box-shadow: 0 18px 40px rgba(0,0,0,.3); }
.act .shot { max-width: 260px; margin-top: 12px; }
/* Columns with a screenshot: the picture sits at the bottom of its column, so the phones line up whatever the text above does. */
.acts.shots .act { grid-template-rows: auto auto auto auto 1fr; align-content: stretch; }
.acts.shots .act > .shot, .acts.shots .act > .peek { align-self: end; }
figure { margin: 0; }
figcaption { font-family: var(--mono); font-size: 12px; letter-spacing: .08em; text-transform: uppercase; color: var(--ink-dim); margin-top: 12px; }
.loop figure { max-width: 300px; justify-self: center; transform: rotate(-1.2deg); }
.teach figure { max-width: 280px; margin-top: 32px; }
@media (max-width: 860px) { .act .shot, .peek { max-width: 300px; } }

/* price dial */
.dial { display: grid; grid-template-columns: 1.1fr 1fr; gap: 36px; align-items: center; }
.dial svg { width: 100%; height: auto; display: block; max-width: 100%; }
.dial-controls { display: grid; gap: 18px; min-width: 0; }
.dial input[type=range] { width: 100%; accent-color: var(--accent); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0; border: 1.5px solid var(--line); border-radius: 6px; }
.stats div { padding: 12px 14px; display: grid; gap: 2px; }
.stats div + div { border-left: 1.5px solid var(--line); }
.stats .v { font-family: var(--display); font-size: 30px; font-variant-numeric: tabular-nums; }
.stats .k { font-family: var(--mono); font-size: 11px; letter-spacing: .1em; text-transform: uppercase; color: var(--ink-dim); }
.verdict { font-weight: 600; min-height: 3.2em; }
.verdict.best { color: var(--accent); }
@media (max-width: 860px) { .dial { grid-template-columns: 1fr; } }

/* businesses */
.biz { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 0; border-top: 1.5px solid var(--line); border-left: 1.5px solid var(--line); }
.biz div { padding: 16px 18px; border-right: 1.5px solid var(--line); border-bottom: 1.5px solid var(--line); display: grid; gap: 4px; min-width: 0; position: relative; overflow: hidden; align-content: center; min-height: 108px; }
.biz div.has-worker { padding-right: 116px; }
.biz b { font-family: var(--display); font-size: 22px; text-transform: uppercase; letter-spacing: .02em; font-weight: 700; }
.biz span { font-family: var(--mono); font-size: 12px; color: var(--teal); letter-spacing: .06em; text-transform: uppercase; }

/* Workers: the game's crew, popping up from behind the edge of a card or screenshot. The art already has its own
   cream outline and flat shoulders, so they are cropped by the thing in front of them, never floating. */
.worker { position: absolute; height: auto; pointer-events: none; user-select: none; }
.biz .worker { right: 16px; bottom: -8px; width: 88px; }
.hero-art { position: relative; min-width: 0; }
.hero-art .sheet { position: relative; z-index: 1; }
/* The crew over the hero card, at the game's large intro size: they rise from behind it one after another, all blink now and then,
   and the barista waves (the game's own clips, 12 fps; landing.js). */
.crew { position: absolute; left: 50%; margin-left: -200px; top: -150px; width: 400px; height: 157px; z-index: 0; pointer-events: none; }
.crew .wks { position: absolute; inset: 0; display: flex; justify-content: center; }
.crew .wks .wk + .wk { margin-left: -14px; }
/* A launch pad and a transformer stand behind the crew, their tops showing either side. */
.crew .mach { position: absolute; width: 150px; height: auto; bottom: -62px; filter: saturate(.85) brightness(.9); animation: wk-rise .5s ease-out both; }
.crew .m-launchpad { left: -52px; } .crew .m-transformer { right: -52px; }
.crew .wk { position: relative; width: 120px; aspect-ratio: 220 / 287; animation: wk-rise .5s cubic-bezier(.2,.9,.3,1.15) both; }
.crew .wk:nth-child(1) { animation-delay: .15s; } .crew .wk:nth-child(2) { animation-delay: .3s; } .crew .wk:nth-child(3) { animation-delay: .45s; }
.crew img { display: block; width: 100%; height: auto; user-select: none; }
.crew .wk-strip { position: absolute; inset: 0; overflow: hidden; visibility: hidden; }
.crew .wk-strip img { width: calc(var(--poses) * 100%); max-width: none; height: 100%; }
.crew .wk-blink[data-f="1"], .crew .wk-blink[data-f="2"] { visibility: visible; }
.crew .wk.waving .wk-still, .crew .wk.waving .wk-blink { visibility: hidden; }
.crew .wk.waving .wk-wave { visibility: visible; }
@keyframes wk-rise { from { transform: translateY(80px); } }
@media (prefers-reduced-motion: reduce) { .crew .wk { animation: none; } }
.peek { position: relative; margin-top: 84px; max-width: 260px; }
.peek .shot { position: relative; z-index: 1; margin-top: 0; }
.peek .worker { right: 28px; top: -80px; width: 84px; z-index: 0; }
@media (max-width: 480px) { .crew { transform: scale(.7); transform-origin: bottom center; } .demo .hero-art { margin-top: 110px; } }

/* teachers */
.teach { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; }
.teach ul { margin: 0; padding: 0; display: grid; gap: 14px; }
.teach li { list-style: none; padding-left: 22px; position: relative; }
.teach li::before { content: ""; position: absolute; left: 0; top: .62em; width: 10px; height: 10px; border: 2px solid var(--accent); transform: rotate(45deg); }
.topics { columns: 2; column-gap: 28px; font-size: 15px; }
.topics h3 { font-size: 18px; color: var(--accent); margin-bottom: 6px; break-after: avoid; }
.topics p { margin-bottom: 14px; break-inside: avoid; color: var(--ink-dim); }
@media (max-width: 860px) { .teach { grid-template-columns: 1fr; } }
@media (max-width: 460px) { .topics { columns: 1; } }

/* closing */
.closer { text-align: left; }
.closer .sheet { display: grid; grid-template-columns: 1fr auto; gap: 24px; align-items: center; padding: 36px; }
@media (max-width: 720px) { .closer .sheet { grid-template-columns: 1fr; padding: 24px; } }
footer { padding-block: 32px 48px; font-size: 14px; color: var(--ink-dim); }
footer .wrap { display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; border-top: 1.5px solid var(--line); padding-top: 20px; }

/* A full nav (tablet widths, longer Spanish) wraps onto a second row rather than overflowing. */
.navlinks { flex-wrap: wrap; justify-content: flex-end; row-gap: 8px; }
/* The language switch (lang.js): its name in full, or its two-letter code on a phone, where the nav also tightens to fit. */
@media (max-width: 520px) {
  .navlinks { gap: 12px; }
  .navlinks .btn { white-space: nowrap; padding: 9px 14px; }
  .brand { gap: 10px; }
  .brand span { font-size: 24px; }
  .navlinks a.lang { font-size: 0; }
  .navlinks a.lang::before { font-size: 14px; letter-spacing: .06em; }
  .navlinks a.lang[lang="es"]::before { content: "ES"; content: "ES" / ""; }
  .navlinks a.lang[lang="en"]::before { content: "EN"; content: "EN" / ""; }
}

.brand img.wordmark { display: block; width: auto; height: 36px; border-radius: 0; }
