/* ---------- Tokens ---------- */
:root {
  --bg: #f4f4f1;
  --ink: #111110;
  --muted: #84847f;
  --line: rgba(17, 17, 16, 0.1);
  --panel: #ebebe7;
  --live: #1f9d55;
  --sans: "Geist", ui-sans-serif, system-ui, -apple-system, sans-serif;
  --mono: "Geist Mono", ui-monospace, "SF Mono", Menlo, monospace;
  --pad: clamp(20px, 4vw, 56px);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  color-scheme: light;
}
:root[data-theme="dark"] {
  --bg: #0b0b0b; --ink: #ecece8; --muted: #7d7d78; --line: rgba(236,236,232,.12); --panel: #151514; --live: #3ccf7c;
  color-scheme: dark;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #0b0b0b; --ink: #ecece8; --muted: #7d7d78; --line: rgba(236,236,232,.12); --panel: #151514; --live: #3ccf7c;
    color-scheme: dark;
  }
}
/* Hidden: blueprint mode */
:root[data-blueprint="1"] {
  --bg: #0f3a63; --ink: #e6f0fb; --muted: #8fb2d6; --line: rgba(230,240,251,.22); --panel: #12436f; --live: #e6f0fb;
  --sans: var(--mono);
  color-scheme: dark;
}
:root[data-blueprint="1"] body {
  background-image:
    linear-gradient(rgba(230,240,251,.07) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230,240,251,.07) 1px, transparent 1px),
    linear-gradient(rgba(230,240,251,.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(230,240,251,.035) 1px, transparent 1px);
  background-size: 100px 100px, 100px 100px, 20px 20px, 20px 20px;
}
:root[data-blueprint="1"] img { filter: grayscale(1) contrast(1.4) brightness(1.1); mix-blend-mode: screen; opacity: .85; }

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-rendering: optimizeLegibility; -webkit-font-smoothing: antialiased; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 400 16px/1.55 var(--sans); letter-spacing: -0.005em; transition: background-color .5s var(--ease), color .5s var(--ease); }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
::selection { background: var(--ink); color: var(--bg); }
:focus-visible { outline: 1px solid var(--ink); outline-offset: 4px; border-radius: 2px; }
.muted { color: var(--muted); }
.mono { font-family: var(--mono); font-size: 12px; letter-spacing: 0.02em; }
.wrap { padding-inline: var(--pad); max-width: 1680px; margin-inline: auto; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 12px; top: 12px; background: var(--ink); color: var(--bg); padding: 8px 12px; z-index: 100; }
/* One underline style for every underlined link, so they all sit on the same line */
.ext, .link { text-decoration: underline; text-decoration-thickness: 1px; text-decoration-color: var(--line); text-underline-offset: 5px; transition: text-decoration-color .3s, color .3s; }
.ext:hover, .link:hover { text-decoration-color: currentColor; }
.dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 8px; vertical-align: 2px; border: 1px solid var(--muted); }
.dot[data-s="live"] { background: var(--live); border-color: var(--live); animation: pulse 2.4s var(--ease) infinite; }
.dot[data-s="in use"], .dot[data-s="launched"] { background: var(--ink); border-color: var(--ink); }
@keyframes pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 50%, transparent); } 70%, 100% { box-shadow: 0 0 0 6px transparent; } }

/* ---------- Bar ---------- */
.bar {
  position: fixed; inset: 0 0 auto 0; z-index: 40; display: flex; align-items: center; gap: 28px;
  padding: 18px var(--pad); mix-blend-mode: difference; color: #fff;
  transition: transform .5s var(--ease-out); /* no background fade: blend mode flips instantly, so a fading bg would flash black */
}
.bar.solid { mix-blend-mode: normal; color: var(--ink); background: var(--bg); box-shadow: 0 1px 0 var(--line); }
.bar.solid .kbd-hint { border-color: var(--line); }
.bar.hide { transform: translateY(-100%); }
.mark { font-weight: 500; letter-spacing: 0.02em; font-size: 15px; }
/* Portrait sits outside the blended header (a blend would invert the photo) but moves with it */
.mark-space { width: 34px; height: 34px; }
.avatar { position: fixed; z-index: 41; top: 18px; left: var(--pad); width: 34px; height: 34px; border-radius: 50%; overflow: hidden; display: block; transition: transform .5s var(--ease-out), box-shadow .3s; box-shadow: 0 0 0 1px var(--line); }
.avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.avatar:hover { box-shadow: 0 0 0 1px var(--ink); }
.bar.hide ~ .avatar { transform: translateY(calc(-100% - 20px)); }
.nav { display: flex; gap: 24px; margin-left: auto; font-size: 14px; }
.nav a { position: relative; opacity: .85; transition: opacity .3s; }
.nav a:hover, .nav a[aria-current] { opacity: 1; }
.nav a[aria-current]::after { content: ""; position: absolute; left: 0; right: 0; bottom: -4px; height: 1px; background: currentColor; }
.kbd-hint { font-family: var(--mono); font-size: 11px; border: 1px solid rgba(255,255,255,.35); border-radius: 5px; padding: 3px 7px; opacity: .8; }
.kbd-hint .pc { display: none; }
:root.pc .kbd-hint .pc { display: inline; } :root.pc .kbd-hint .mac { display: none; }
@media (hover: none) { .kbd-hint { display: none; } }

/* ---------- Hero ---------- */
.hero { padding-top: clamp(140px, 24vh, 260px); padding-bottom: clamp(56px, 9vh, 110px); }
.hero-title { margin: 0; font-weight: 400; letter-spacing: -0.045em; line-height: 0.98; font-size: clamp(44px, 8.4vw, 148px); }
.hero-title .line { display: block; overflow: hidden; padding-bottom: .06em; }
.hero-title .line > span { display: inline-block; transform: translateY(105%); animation: rise 1.1s var(--ease-out) forwards; }
.hero-title .line:nth-child(2) > span { animation-delay: .09s; }
@keyframes rise { to { transform: none; } }
.hero-intro { max-width: 44ch; font-size: clamp(18px, 1.6vw, 22px); line-height: 1.45; margin: clamp(28px, 4vw, 48px) 0 0; }
.hero-intro + .hero-intro { margin-top: 16px; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 10px 24px; margin: 28px 0 0; font-size: 15px; color: var(--muted); }
.hero-meta a:hover { color: var(--ink); }

/* ---------- Sections + rows ---------- */
.section { padding-top: clamp(56px, 9vw, 120px); }
.section-head { display: grid; grid-template-columns: 76px 1fr auto; column-gap: 16px; align-items: baseline; border-top: 1px solid var(--line); padding-top: 18px; margin-bottom: clamp(20px, 3vw, 36px); }
.section-head h2 { margin: 0; font-size: 15px; font-weight: 500; }
.section-head > span:last-child { font-size: 14px; }
.rows { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.row {
  display: grid; grid-template-columns: 76px minmax(200px, 1.1fr) 2fr 104px; align-items: baseline; gap: 16px;
  padding: 22px 0; border-top: 1px solid var(--line); transition: padding .5s var(--ease-out), color .3s;
}
.row-title { font-size: clamp(20px, 2vw, 26px); letter-spacing: -0.02em; }
.row-tag { font-size: 15px; }
.row-year { justify-self: end; display: inline-flex; justify-content: flex-end; gap: .9ch; white-space: nowrap; font-variant-numeric: tabular-nums; }
.row-year .d-m { display: inline-block; width: 3ch; text-align: left; }
.row-year .d-y { display: inline-block; width: 4ch; text-align: right; }
.press .row { grid-template-columns: 96px minmax(240px, 1.3fr) 1.6fr 90px; }
.press .row-title { display: flex; flex-direction: column; gap: 4px; }
.press-outlet { font-size: 14px; letter-spacing: 0; }
@media (max-width: 900px) { .press .row { grid-template-columns: 1fr auto; } .press .row-n { grid-column: 1; grid-row: 1; } .press .row-year { grid-column: 2; grid-row: 1; } .press .row-title { grid-column: 1 / -1; grid-row: 2; } .press .row-tag { grid-column: 1 / -1; grid-row: 3; } }
@media (hover: hover) {
  .rows:hover .row { color: var(--muted); }
  .rows:hover .row:hover, .rows .row:focus-visible { color: var(--ink); padding-left: 10px; }
}
.cta { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 24px; }
.cta-lead { font-size: clamp(24px, 3vw, 40px); letter-spacing: -0.03em; margin: 0; max-width: 22ch; line-height: 1.15; }
.btn { display: inline-flex; align-items: center; height: 48px; padding: 0 24px; border-radius: 999px; background: var(--ink); color: var(--bg); font-size: 15px; font-weight: 500; transition: transform .4s var(--ease-out), opacity .3s; }
.btn:hover { transform: translateY(-1px); }
.btn:active { transform: scale(.98); }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* ---------- Project ---------- */
.p-head { padding-top: clamp(120px, 20vh, 200px); padding-bottom: clamp(40px, 6vw, 72px); }
.back { display: inline-block; margin-bottom: 28px; transition: color .3s; }
.back:hover { color: var(--ink); }
.p-title { margin: 0; font-weight: 400; letter-spacing: -0.045em; line-height: 1; font-size: clamp(44px, 8vw, 136px); }
.p-tag { font-size: clamp(18px, 1.6vw, 22px); max-width: 40ch; margin: 24px 0 0; line-height: 1.45; }
.p-meta { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px; margin: clamp(40px, 6vw, 72px) 0 0; border-top: 1px solid var(--line); padding-top: 18px; font-size: 14px; }
.p-meta dt { color: var(--muted); margin-bottom: 4px; }
.p-meta dd { margin: 0; }
.p-fig { margin-top: 0; margin-bottom: 0; }
.p-fig-inner { background: var(--panel); border-radius: 4px; padding: clamp(20px, 5vw, 80px); color: var(--ink); }
.p-fig figcaption { padding-top: 12px; }
.diagram { width: 100%; height: auto; display: block; max-width: 1100px; margin: 0 auto; }
.diagram rect, .diagram path, .diagram line, .diagram circle { vector-effect: non-scaling-stroke; }
.sec { padding-top: clamp(48px, 7vw, 96px); }
.sec + .sec { padding-top: 0; }
.sec-h { margin: 0; font-size: 15px; font-weight: 500; border-top: 1px solid var(--line); padding: 18px 0 8px; }
.spec { margin: 0; }
.spec-row { display: grid; grid-template-columns: 1fr 2fr; gap: 24px; padding: 14px 0; border-top: 1px solid var(--line); align-items: baseline; }
.sec-h + .spec .spec-row:first-child { border-top: 0; }
.spec-row dt { font-size: 14px; }
.spec-row dd { margin: 0; font-size: clamp(16px, 1.3vw, 19px); letter-spacing: -0.01em; }
.body-row { display: grid; grid-template-columns: 1fr 2fr; gap: 24px; padding: 28px 0; border-top: 1px solid var(--line); }
.body-row h2 { margin: 0; font-size: 15px; font-weight: 500; }
.bullets { list-style: none; margin: 0; padding: 0; }
.bullets li { font-size: clamp(16px, 1.3vw, 19px); line-height: 1.5; padding: 0 0 10px 22px; position: relative; max-width: 52ch; }
.bullets li::before { content: ""; position: absolute; left: 0; top: .78em; width: 10px; height: 1px; background: var(--muted); }
.tags { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.tags li { font-size: 13px; padding: 6px 12px; border: 1px solid var(--line); border-radius: 999px; color: var(--muted); }
.bom { width: 100%; max-width: 520px; border-collapse: collapse; font-size: 15px; }
.bom td { padding: 8px 0; border-bottom: 1px solid var(--line); }
.bom td:last-child { text-align: right; font-variant-numeric: tabular-nums; }
.bom .total td { border-bottom: 0; font-weight: 500; padding-top: 12px; }
.gallery { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(12px, 1.6vw, 24px); padding-top: clamp(48px, 7vw, 96px); padding-bottom: clamp(24px, 4vw, 48px); }
.g { margin: 0; overflow: hidden; background: var(--panel); border-radius: 3px; }
.g img { width: 100%; height: 100%; object-fit: cover; }
.g0 { grid-column: 1 / -1; }
.g0 img { height: auto; }
.g1 { grid-column: 1 / 7; aspect-ratio: 4 / 3.4; }
.g2 { grid-column: 7 / -1; aspect-ratio: 4 / 3.4; }
.next { padding-top: clamp(80px, 12vw, 180px); padding-bottom: 24px; }
.next a { display: flex; flex-direction: column; gap: 8px; border-top: 1px solid var(--line); padding-top: 18px; }
.next-title { font-size: clamp(40px, 7vw, 112px); letter-spacing: -0.045em; line-height: 1; transition: transform .7s var(--ease-out); }
.next a:hover .next-title { transform: translateX(14px); }

/* ---------- Software design doc ---------- */
.ticket { grid-template-columns: repeat(5, minmax(0, 1fr)); font-size: 13px; }
.ticket dd { font-family: var(--sans); font-size: 14px; }
.doc-row h2 { display: flex; gap: 14px; align-items: baseline; }
.doc-row h2 .mono { font-weight: 400; }
.doc-row.wide { grid-template-columns: 1fr; gap: 18px; }
.doc-lead { margin: 0; font-size: clamp(18px, 1.6vw, 23px); line-height: 1.5; letter-spacing: -0.015em; max-width: 46ch; }
.goals { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.goals h3 { font-weight: 400; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 12px; }
.goal-out li { color: var(--muted); }
.goal-out li::before { background: none; content: "×"; width: auto; height: auto; top: 0; font-size: 15px; line-height: 1.5; }
.steps { counter-reset: step; }
.steps li { counter-increment: step; padding-left: 30px; }
.steps li::before { content: counter(step, decimal-leading-zero); background: none; width: auto; height: auto; top: .22em; font: 11px var(--mono); color: var(--muted); }
.checks { list-style: none; margin: 0; padding: 0; }
.checks li { position: relative; padding: 10px 0 10px 34px; border-top: 1px solid var(--line); font-size: clamp(15px, 1.2vw, 17px); line-height: 1.5; }
.checks li:first-child { border-top: 0; padding-top: 0; }
.checks li::before { content: ""; position: absolute; left: 0; top: 13px; width: 16px; height: 16px; border: 1px solid var(--ink); border-radius: 3px; background: var(--ink); }
.checks li::after { content: ""; position: absolute; left: 5px; top: 15px; width: 4px; height: 8px; border: solid var(--bg); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); }
.checks li:first-child::before { top: 3px; } .checks li:first-child::after { top: 5px; }
.checks.open li::before { background: transparent; border-color: var(--muted); }
.checks.open li::after { display: none; }
.doc-table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.doc-table th { text-align: left; font-weight: 400; font-size: 11px; text-transform: uppercase; letter-spacing: .06em; color: var(--muted); padding: 0 16px 10px 0; border-bottom: 1px solid var(--line); }
.doc-table td { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--line); vertical-align: top; color: var(--muted); }
.doc-table td.lead { color: var(--ink); width: 30%; }
.doc-table tr:last-child td { border-bottom: 0; }
.spec-in-doc { margin-top: 8px; }
.sec + .p-fig, .p-fig + .sec { padding-top: 0; }
.p-fig + .sec { padding-top: 24px; }

/* ---------- Venture page ---------- */
.snapshot { grid-template-columns: repeat(6, minmax(0, 1fr)); }
.ops, .timeline { list-style: none; margin: 0; padding: 0; }
.ops-row { position: relative; display: grid; grid-template-columns: 1fr 2fr; gap: 24px; align-items: baseline; padding: 14px 0; border-top: 1px solid var(--line); font-size: clamp(16px, 1.3vw, 19px); transition: padding .5s var(--ease-out), color .3s; }
.ops-row > span:first-child { font-size: 14px; }
.ops-row > span:nth-child(3) { position: absolute; right: 0; top: 50%; transform: translateY(-50%); font-size: 12px; }
.ops li:first-child .ops-row { border-top: 0; }
@media (hover: hover) { a.ops-row:hover { padding-left: 10px; } a.ops-row:hover > span:last-child { color: var(--ink); } }
.timeline li { display: grid; grid-template-columns: 1fr 2fr; gap: 24px; align-items: baseline; padding: 14px 0; border-top: 1px solid var(--line); font-size: clamp(16px, 1.3vw, 19px); }
.timeline li:first-child { border-top: 0; }
.timeline .row-year { justify-self: start; }

/* ---------- Venture: business model + framed screens ---------- */
.model { margin: 0; display: grid; gap: 22px; }
.model dt { font-size: 12px; color: var(--muted); margin-bottom: 6px; letter-spacing: .06em; }
.model dd { margin: 0; font-size: clamp(16px, 1.3vw, 19px); line-height: 1.55; max-width: 52ch; }
.media-sec .sec-h { margin-bottom: 8px; }
.m-row { display: grid; gap: clamp(14px, 2vw, 28px); margin-top: clamp(20px, 3vw, 40px); align-items: start; }
/* browser + phone: column ratio makes both frames the same height (16:10 screen vs 390:844 phone) */
.m-row-bp { grid-template-columns: 3.3fr 1fr; }
.m-row-b { grid-template-columns: 1fr; }
.m-row-pee { grid-template-columns: repeat(3, 1fr); max-width: 980px; }
.m { margin: 0; min-width: 0; }
.m figcaption { padding-top: 10px; font-size: 11px; }
.frame { overflow: hidden; background: #fff; border: 1px solid var(--line); }
.frame img { display: block; width: 100%; }
.frame.browser { border-radius: 8px; }
.frame-bar { height: 30px; display: grid; place-items: center; border-bottom: 1px solid var(--line); background: var(--panel); font-size: 11px; color: var(--muted); }
.frame-bar span { padding: 2px 14px; border-radius: 999px; background: var(--bg); }
.frame-view { aspect-ratio: 16 / 10; overflow: hidden; }
.frame-view img { height: 100%; object-fit: cover; object-position: top; }
.frame.phone { border-radius: 26px; padding: 6px; background: var(--ink); border: 0; aspect-ratio: 390 / 844; }
.frame.phone img { height: 100%; object-fit: cover; object-position: top; border-radius: 20px; }
.frame.email { border-radius: 8px; aspect-ratio: 390 / 844; }
.frame.email img { height: 100%; object-fit: cover; object-position: top; }
@media (max-width: 700px) {
  .m-row-bp, .m-row-pee { grid-template-columns: 1fr; }
  .m-phone, .m-email { max-width: 300px; margin-inline: auto; width: 100%; }
}

/* ---------- Venture: stats band ---------- */
.stats-band { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0 24px; margin: 0; }
.stats-band > div { border-top: 1px solid var(--line); padding: 18px 0 22px; }
.stats-band dt { font-size: clamp(30px, 3.6vw, 54px); letter-spacing: -0.04em; line-height: 1; font-variant-numeric: tabular-nums; }
.stats-band dd { margin: 8px 0 0; font-size: 14px; }

/* ---------- Venture: five finishes ---------- */
.finishes { display: grid; grid-template-columns: 1.4fr 1fr; gap: clamp(24px, 5vw, 80px); align-items: center; border-top: 1px solid var(--line); padding-top: clamp(28px, 4vw, 48px); }
.finishes-h { margin: 0 0 18px; font-size: clamp(28px, 3.2vw, 46px); font-weight: 400; letter-spacing: -0.035em; line-height: 1.05; }
.finishes .bullets { margin-top: 22px; }
.finishes-img { margin: 0; border-radius: 6px; overflow: hidden; border: 1px solid var(--line); max-width: 440px; justify-self: end; }
.finishes-img img { width: 100%; display: block; }

/* ---------- Venture: sideways scroll gallery ---------- */
.scroll-hint { float: right; font-weight: 400; font-size: 11px; }
.scroller {
  display: flex; gap: clamp(12px, 1.4vw, 20px); overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x proximity;
  padding: 6px max(var(--pad), calc((100vw - 1680px) / 2 + var(--pad))) 18px; scrollbar-width: thin;
  scroll-padding-inline: max(var(--pad), calc((100vw - 1680px) / 2 + var(--pad))); /* snap to the page margin, not the window edge */ cursor: grab; -webkit-overflow-scrolling: touch;
}
.scroller.dragging { cursor: grabbing; scroll-snap-type: none; }
.scroller.dragging img { pointer-events: none; }
.s-item { margin: 0; flex: 0 0 auto; scroll-snap-align: start; }
.s-item img { height: clamp(240px, 34vw, 460px); width: auto; display: block; border-radius: 4px; background: var(--panel); user-select: none; -webkit-user-drag: none; }
.s-item figcaption { padding-top: 10px; font-size: 11px; max-width: 34ch; }

/* ---------- Venture: acquisition table ---------- */
.ads-table td.lead { width: 28%; }
.ads-table td:nth-child(3) { color: var(--ink); width: 26%; }
.ads-note { margin: 22px 0 0; max-width: 72ch; font-size: 15px; line-height: 1.6; }

/* ---------- About ---------- */
.xp { list-style: none; margin: 0; padding: 0; border-bottom: 1px solid var(--line); }
.xp-row { display: grid; grid-template-columns: 76px minmax(170px, 1fr) minmax(200px, 1.2fr) 2fr; gap: 16px; align-items: baseline; padding: 18px 0; border-top: 1px solid var(--line); font-size: 15px; }
.xp-org { font-weight: 500; }
.xp-detail { font-size: 14px; }

/* ---------- Contact ---------- */
.offers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.offer { border-top: 1px solid var(--line); padding-top: 18px; }
.offer h2 { font-size: 20px; font-weight: 400; letter-spacing: -0.02em; margin: 12px 0 6px; }
.offer p { margin: 0; font-size: 15px; max-width: 34ch; }
.form { display: grid; grid-template-columns: 1fr 1fr; gap: 28px 24px; max-width: 920px; }
.field { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-direction: column; gap: 10px; }
.field:nth-of-type(n+3) { grid-column: 1 / -1; }
.field[hidden] { display: none; }
.field label, .field legend { font-size: 14px; color: var(--muted); padding: 0; }
.field input:not([type=checkbox]):not([type=radio]), .field textarea {
  font: inherit; font-size: 18px; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--line); border-radius: 0; padding: 8px 0 10px; transition: border-color .3s; resize: vertical;
}
.field input:focus, .field textarea:focus { outline: none; border-color: var(--ink); }
.field.invalid input, .field.invalid textarea { border-color: #c0392b; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip input { position: absolute; opacity: 0; pointer-events: none; }
.chip span { display: inline-block; padding: 9px 16px; border-radius: 999px; border: 1px solid var(--line); font-size: 14px; cursor: pointer; transition: background .25s, color .25s, border-color .25s; }
.chip span:hover { border-color: var(--ink); }
.chip input:checked + span { background: var(--ink); color: var(--bg); border-color: var(--ink); }
.chip input:focus-visible + span { outline: 1px solid var(--ink); outline-offset: 3px; }
.hp { position: absolute; left: -9999px; }
.form-foot { grid-column: 1 / -1; display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.form-note { font-size: 14px; }
.form.sent { pointer-events: none; }

/* ---------- Footer ---------- */
.foot { padding: clamp(80px, 12vw, 160px) var(--pad) 28px; max-width: 1680px; margin-inline: auto; font-size: 14px; }
.foot-row { display: flex; justify-content: space-between; gap: 16px; border-top: 1px solid var(--line); padding: 14px 0; }
.foot-row + .foot-row { border-top: 0; padding-top: 0; }
.foot-links { display: flex; flex-wrap: wrap; gap: 8px 20px; }
.foot-links a, .foot-links button { transition: color .25s; text-decoration: none; }
.foot-links a:hover, .foot-links button:hover { color: var(--ink); }
.clock { font-variant-numeric: tabular-nums; }
.status { color: var(--muted); cursor: default; transition: opacity .14s var(--ease), color .25s; outline-offset: 3px; }
.status:hover, .status:focus-visible { color: var(--ink); }
.status.swap { opacity: 0; }

/* ---------- Palette ---------- */
.palette { position: fixed; inset: 0; z-index: 60; display: grid; place-items: start center; padding-top: 18vh; background: color-mix(in srgb, var(--bg) 55%, transparent); animation: fade .2s var(--ease); }
.palette[hidden] { display: none; }
.palette-box { width: min(560px, calc(100vw - 32px)); background: var(--bg); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 30px 80px -20px rgba(0,0,0,.25); overflow: hidden; animation: pop .28s var(--ease-out); }
.palette-input { width: 100%; font: inherit; font-size: 17px; color: var(--ink); background: transparent; border: 0; border-bottom: 1px solid var(--line); padding: 18px 20px; outline: none; }
.palette-list { list-style: none; margin: 0; padding: 6px; max-height: 50vh; overflow: auto; }
.palette-list li { display: flex; justify-content: space-between; padding: 10px 14px; border-radius: 6px; cursor: pointer; font-size: 15px; }
.palette-list li span:last-child { color: var(--muted); font-size: 13px; }
.palette-list li[aria-selected="true"] { background: var(--panel); }
.palette-list li.tease { margin-bottom: 6px; border-bottom: 1px dashed var(--line); border-radius: 6px 6px 0 0; color: var(--muted); font-style: italic; }
.palette-list li.tease[aria-selected="true"] { color: var(--ink); }
.palette-list li.tease span:last-child { font-style: normal; font-family: var(--mono); font-size: 12px; }
.palette-foot { display: flex; gap: 16px; padding: 10px 20px; border-top: 1px solid var(--line); font: 11px var(--mono); color: var(--muted); }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(8px) scale(.98); } }

/* ---------- Toast ---------- */
.toast { position: fixed; left: 50%; bottom: 28px; z-index: 70; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--ink); color: var(--bg); font-size: 14px; padding: 10px 16px; border-radius: 999px; transition: opacity .3s var(--ease), transform .45s var(--ease-out); }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- Hidden: terminal ---------- */
.term {
  position: fixed; z-index: 65; left: 50%; bottom: 24px; transform: translateX(-50%);
  width: min(720px, calc(100vw - 24px)); height: min(420px, 60vh); display: flex; flex-direction: column;
  background: #0c0c0c; color: #d8d8d2; border: 1px solid #262626; border-radius: 10px;
  box-shadow: 0 40px 100px -30px rgba(0,0,0,.6); font: 13px/1.6 var(--mono); animation: pop .28s var(--ease-out);
}
.term[hidden] { display: none; }
.term-bar { display: flex; justify-content: space-between; padding: 8px 14px; border-bottom: 1px solid #1f1f1f; color: #777; font-size: 11px; }
.term-bar button { font: 11px var(--mono); color: #777; }
.term-bar button:hover { color: #ddd; }
.term-out { flex: 1; overflow: auto; padding: 12px 14px 0; white-space: pre-wrap; }
.term-out a { color: #fff; text-decoration: underline; text-decoration-color: #444; }
.term-out .err { color: #ff8f7a; }
.term-out .ok { color: #6ee7a0; }
.term-ps { color: #6ee7a0; margin-right: 8px; }
.term-line { display: flex; align-items: center; padding: 8px 14px 12px; }
.term-line input { flex: 1; background: transparent; border: 0; outline: none; color: #fff; font: inherit; caret-color: #6ee7a0; }

/* ---------- Hidden: x-ray ---------- */
.xray body * { outline: 1px solid rgba(255, 50, 90, .28) !important; outline-offset: -1px; }
.xray body *:hover { outline-color: rgba(255, 50, 90, .9) !important; background-color: rgba(255, 50, 90, .04); }

/* ---------- Contact: letter with blanks ---------- */
.contact { padding-bottom: 0; }
.letter { margin-top: clamp(36px, 5vw, 64px); max-width: 30ch; font-size: clamp(26px, 3.4vw, 52px); line-height: 1.35; letter-spacing: -0.03em; }
.letter p { margin: 0 0 .25em; }
.blank {
  font: inherit; letter-spacing: inherit; color: var(--ink); background: transparent;
  border: 0; border-bottom: 1px solid var(--muted); border-radius: 0; padding: 0 1px; margin: 0 0 0 .12em;
  min-width: 2ch; max-width: 100%; outline: none; vertical-align: baseline;
  transition: border-color .3s var(--ease), color .3s;
}
.blank::placeholder { color: var(--muted); opacity: .55; }
.blank:focus { border-color: var(--ink); }
.blank:focus::placeholder { opacity: .3; }
.blank.filled { border-color: transparent; }
.blank.filled:focus { border-color: var(--ink); }
.blank-area { display: block; width: 100%; resize: none; overflow: hidden; margin: .1em 0 0; padding: 0 2px; }
.blank.nope { border-color: #d0453a; animation: nope .4s var(--ease); }
@keyframes nope { 20%, 60% { transform: translateX(-5px); } 40%, 80% { transform: translateX(5px); } }
.blank-measure { position: absolute; visibility: hidden; white-space: pre; font: inherit; letter-spacing: inherit; padding: 0; left: -9999px; top: 0; }
.letter-foot { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; margin-top: clamp(28px, 4vw, 48px); font-size: 16px; letter-spacing: 0; }
.letter-foot .btn[disabled] { opacity: .25; pointer-events: none; }
.letter-hint .pc { display: none; }
:root.pc .letter-hint .pc { display: inline; } :root.pc .letter-hint .mac { display: none; }
@media (hover: none) { .letter-hint { display: none; } }
.sent-note { margin-top: clamp(28px, 4vw, 48px); }
.sent-note[hidden], .letter[hidden] { display: none; }
.contact .hero-meta { margin-top: clamp(56px, 8vw, 96px); }
.contact .hero-meta button:hover { color: var(--ink); }

/* ---------- Coffee page ---------- */
.coffee [hidden] { display: none; }
.coffee .cup { width: clamp(72px, 8vw, 110px); height: auto; margin-bottom: clamp(24px, 3vw, 40px); }
.coffee .steam { opacity: 0; animation: steam 3.2s var(--ease) infinite; }
.coffee .s2 { animation-delay: .5s; } .coffee .s3 { animation-delay: 1s; }
@keyframes steam { 0% { opacity: 0; transform: translateY(6px); } 40% { opacity: .7; } 100% { opacity: 0; transform: translateY(-8px); } }
.found { list-style: none; margin: clamp(32px, 4vw, 48px) 0 0; padding: 0; display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 0 24px; max-width: 760px; }
.found li { padding: 10px 0; border-top: 1px solid var(--line); color: var(--muted); }
.found li::before { content: "✓"; color: var(--live); margin-right: 10px; }
.coffee-cta { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: clamp(36px, 5vw, 56px); font-size: 15px; }
.coffee .pc { display: none; } :root.pc .coffee .pc { display: inline; } :root.pc .coffee .mac { display: none; }
@media (max-width: 700px) { .found { grid-template-columns: 1fr 1fr; } }

/* ---------- Reveal ---------- */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 1s var(--ease) var(--d, 0ms), transform 1.2s var(--ease-out) var(--d, 0ms); }
.js .reveal.in { opacity: 1; transform: none; }
img.fade { opacity: 0; transition: opacity .8s var(--ease); }
img.fade.loaded { opacity: 1; }

/* ---------- View transitions ---------- */
@view-transition { navigation: auto; }
::view-transition-old(root) { animation: vt-out .35s var(--ease) both; }
::view-transition-new(root) { animation: vt-in .55s var(--ease-out) both; }
::view-transition-group(*) { animation-duration: .6s; animation-timing-function: var(--ease-out); }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; transform: translateY(10px); } }

/* ---------- Responsive ---------- */
@media (max-width: 900px) {
  .row { grid-template-columns: 56px 1fr auto; padding: 18px 0; }
  .row-tag { grid-column: 2 / -1; grid-row: 2; font-size: 14px; }
  .section-head { grid-template-columns: 56px 1fr auto; }
  .p-meta, .ticket, .snapshot { grid-template-columns: 1fr 1fr; }
  .stats-band { grid-template-columns: 1fr 1fr; }
  .finishes { grid-template-columns: 1fr; }
  .finishes-img { justify-self: start; max-width: 360px; }
  .scroll-hint { display: none; }
  .ops-row { grid-template-columns: 1fr; gap: 2px; padding-right: 60px; }
  .timeline li { grid-template-columns: 76px 1fr; gap: 16px; }
  .goals { grid-template-columns: 1fr; }
  .doc-table thead { display: none; }
  .doc-table tr { display: block; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .doc-table td { display: block; border: 0; padding: 2px 0; }
  .doc-table td.lead { width: auto; font-weight: 500; }
  .doc-table td:nth-child(2):not(:last-child)::before { content: "Alternative: "; color: var(--muted); }
  .doc-table td:last-child { color: var(--ink); opacity: .75; }
  .offers { grid-template-columns: 1fr; }
  .xp-row { grid-template-columns: 1fr auto; gap: 2px 16px; }
  .xp-when { grid-column: 2; grid-row: 1; text-align: right; }
  .xp-org { grid-column: 1; grid-row: 1; }
  .xp-role, .xp-detail { grid-column: 1 / -1; }
}
@media (max-width: 700px) {
  .nav { gap: 16px; font-size: 13px; }
  .spec-row, .body-row { grid-template-columns: 1fr; gap: 6px; }
  .g1, .g2 { grid-column: 1 / -1; }
  .form { grid-template-columns: 1fr; }
  .field:nth-of-type(n) { grid-column: auto; }
  .foot-row { flex-direction: column; gap: 6px; }
  .p-fig-inner { overflow-x: auto; -webkit-overflow-scrolling: touch; padding: 16px; }
  .p-fig-inner .diagram { min-width: 760px; }
  .p-fig figcaption::after { content: "  ·  swipe →"; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
  .hero-title .line > span { transform: none; }
  .js .reveal { opacity: 1; transform: none; }
  @view-transition { navigation: none; }
}
/* Full-width screenshots keep their own proportions (no side cropping) */
.m-row-b .frame-view { aspect-ratio: auto; }
.m-row-b .frame-view img { height: auto; }
/* Acquisition table on phones: label the cells, use full width */
@media (max-width: 900px) {
  .ads-table td { width: auto !important; }
  .ads-table td:nth-child(2):not(:last-child)::before { content: "Result: "; }
  .ads-table td:nth-child(3)::before { content: "Decision: "; color: var(--muted); }
}

/* ---------- Venture refinements ---------- */
.finishes.solo { grid-template-columns: 1fr; }
.finishes.solo .finishes-text { max-width: 760px; }
/* Website screens in the gallery get a hairline so white pages don't melt into the background */
.s-web img { border: 1px solid var(--line); }
/* Marketing strip: device frames share one height and scroll sideways */
.device-strip { margin-top: 18px; align-items: flex-start; }
.device-strip .frame { height: clamp(380px, 44vw, 560px); width: auto; }
.device-strip .frame img { height: 100%; width: 100%; object-fit: cover; object-position: top; border-radius: inherit; }
.device-strip .frame.phone img { border-radius: 20px; }
.frame.pin { border-radius: 8px; aspect-ratio: 1080 / 1350; }
.device-strip figcaption { max-width: 26ch; }
