@font-face { font-family: "Stack Sans Headline"; src: url(fonts/headline.woff2) format("woff2"); font-weight: 200 700; font-display: swap; }
@font-face { font-family: "Stack Sans Text"; src: url(fonts/text.woff2) format("woff2"); font-weight: 200 700; font-display: swap; }

:root {
  --bg: #18191b;
  --surface: #222427;
  --ink: #eff0f1;
  --muted: #a3a5aa;
  --accent: #ff4a1f;
  --accent-ink: #18191b;
  --field: #eff0f1;
  --field-ink: #18191b;
  --field-muted: #55585e;
  --field-tone: #e2e3e5;

  --display: "Stack Sans Headline", system-ui, sans-serif;
  --text: "Stack Sans Text", system-ui, sans-serif;

  /* five sizes, no more */
  --step-small: clamp(0.875rem, 0.85rem + 0.1vw, 0.9375rem);
  --step-body: clamp(1.0625rem, 1rem + 0.25vw, 1.1875rem);
  --step-head: clamp(1.5rem, 1.3rem + 0.6vw, 1.75rem);
  --step-lead: clamp(1.5rem, 1.1rem + 1.4vw, 2.25rem);
  --step-display: clamp(2.25rem, 1.2rem + 3.6vw, 4.25rem);

  --m: clamp(20px, 2.4vw, 32px);
  --col: 560px;
  --start: calc(22vw - var(--m));
  --gap: clamp(120px, 12vw, 180px);
  --ease: cubic-bezier(0.2, 0.7, 0.2, 1);
}

* { box-sizing: border-box; margin: 0; }
html { background: var(--bg); color: var(--ink); scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font: 400 var(--step-body)/1.55 var(--text);
  border-top: 6px solid var(--accent);
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-underline-offset: 0.18em; text-decoration-thickness: 1px; transition: color 180ms var(--ease); }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: var(--accent-ink); }
.num { font-variant-numeric: tabular-nums; }
.accent { color: var(--accent); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip { position: absolute; left: var(--m); top: -100px; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; z-index: 9; }
.skip:focus { top: 12px; }

h1, h2, h3 { font-weight: 500; text-wrap: balance; }
h1 { font: 300 var(--step-display)/1.05 var(--display); letter-spacing: -0.022em; }
h2 { font: 500 var(--step-head)/1.2 var(--text); letter-spacing: -0.01em; margin-bottom: 32px; }
h3 { font: 500 var(--step-head)/1.25 var(--text); letter-spacing: -0.01em; margin-bottom: 16px; }
p + p { margin-top: 1em; }
.meta { color: var(--muted); font-size: var(--step-small); }
.meta a { color: var(--ink); }

/* top bar: wordmark, four links */
.top {
  display: flex; justify-content: space-between; align-items: baseline; gap: 24px;
  padding: 26px var(--m) 0; font-size: var(--step-small);
}
.wordmark { font-weight: 500; text-decoration: none; }
.top nav { display: flex; gap: 24px; }
.top nav a { text-decoration: none; color: var(--muted); }
.top nav a:hover { color: var(--ink); }

/* hero: headline, sentence, one button, two doors */
.hero { text-align: center; padding: clamp(64px, 9vh, 104px) var(--m) clamp(96px, 12vh, 150px); }
.hero__lead { max-width: 34em; margin: 32px auto 0; color: var(--ink); }
.hero__act { margin-top: 28px; }
.btn {
  display: inline-block; background: var(--accent); color: var(--accent-ink); font-weight: 500;
  padding: 12px 24px; text-decoration: none; border-radius: 0;
  transition: transform 140ms var(--ease), background-color 180ms var(--ease);
}
.btn:hover { color: var(--accent-ink); background: #ff6a45; }
.btn:active { transform: scale(0.97); }
.doors { display: flex; justify-content: center; gap: 80px; margin-top: 64px; text-align: left; }
.door { width: 280px; text-decoration: none; transition: opacity 200ms var(--ease); }
.door img { width: 280px; aspect-ratio: 3 / 4; object-fit: cover; }
.door__name { display: block; margin-top: 14px; font-size: var(--step-body); font-weight: 500; }
.door__line { display: block; color: var(--muted); font-size: var(--step-small); }
.doors:has(.door:hover) .door:not(:hover) img,
.doors:has(.door:focus-visible) .door:not(:focus-visible) img { opacity: 0.5; }
.door img { transition: opacity 200ms var(--ease), transform 600ms var(--ease); }
.door:hover img { transform: scale(1.015); }
.door:hover { color: var(--ink); }

/* the grid every section shares: a 560px column at 22%, its demonstration to the right */
.sec { padding: var(--gap) var(--m) 0; }
.split {
  display: grid; grid-template-columns: minmax(0, var(--col)) minmax(0, 1fr);
  column-gap: clamp(48px, 5vw, 80px); padding-left: max(0px, var(--start));
}
.split > :only-child { grid-column: 1; }

/* work ledger */
.ledger { list-style: none; padding: 0; }
.ledger__group { color: var(--muted); font-size: var(--step-small); padding: 28px 0 6px; }
.ledger__group:first-child { padding-top: 0; }
.ledger a {
  display: grid; grid-template-columns: 55% 1fr auto; align-items: center; min-height: 44px;
  text-decoration: none; transition: color 180ms var(--ease);
}
.ledger a span:nth-child(2) { color: var(--muted); font-size: var(--step-small); }
.ledger a span:nth-child(3) { color: var(--muted); font-size: var(--step-small); }
.ledger:has(a:hover, a:focus-visible) a:not(:hover, :focus-visible) { color: var(--muted); }
.ledger a:hover, .ledger a:focus-visible { color: var(--ink); }
.ledger a:hover span:first-child, .ledger a:focus-visible span:first-child { color: var(--accent); }
.preview { align-self: start; position: sticky; top: 40px; margin-top: 64px; transition: opacity 150ms var(--ease); }
.preview.swap { opacity: 0; }

/* case notes */
.half { padding-top: var(--gap); }
.half > .split:first-child h2 { font: 300 var(--step-display)/1.05 var(--display); letter-spacing: -0.022em; margin-bottom: 0; }
.case { margin-top: clamp(80px, 9vw, 120px); align-items: start; }
.case p { max-width: 34em; }
.demo { margin-top: 6px; }
.photo img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; }
figcaption { margin-top: 10px; color: var(--muted); font-size: var(--step-small); }

/* interface fragments, in the product's own terms */
[data-ui] { background: var(--surface); padding: 24px 28px; }
.frag { font: 400 0.9375rem/1.65 ui-monospace, "SF Mono", "Cascadia Code", Menlo, monospace; overflow-x: auto; white-space: pre; } /* taste-skill-ignore: real tool names inside a data-ui fragment */
.frag .c { color: var(--muted); }
.tools, .flow, .servers { list-style: none; padding: 0; }
.servers li { padding: 10px 0; }
.servers b { display: block; font-weight: 500; }
.servers span { color: var(--muted); font-size: var(--step-small); }
.tools li { display: flex; justify-content: space-between; gap: 16px; padding: 8px 0; flex-wrap: wrap; }
.tools code { font: 400 0.9375rem/1.5 ui-monospace, "SF Mono", Menlo, monospace; }
.tools span, .flow span { color: var(--muted); font-size: var(--step-small); }
.flow { counter-reset: none; }
.flow li { display: grid; grid-template-columns: 9em 1fr; gap: 16px; padding: 12px 0; }
.flow li + li b::before { content: "→ "; color: var(--accent); margin-left: -1.3em; }


.figs { display: flex; flex-wrap: wrap; gap: 16px 48px; margin-top: 32px; }
.figs dt { font: 300 var(--step-display)/1 var(--display); letter-spacing: -0.022em; }
.figs dd { color: var(--muted); font-size: var(--step-small); margin-top: 6px; }
.figs + .meta { margin-top: 24px; }


/* light field sections */
.field { background: var(--field); color: var(--field-ink); padding-bottom: var(--gap); margin-top: var(--gap); }
.field .meta, .field .rows__group, .field .rows li > span:last-child, .field .rows li span br + * { color: var(--field-muted); }
.field a:hover { color: #c42d0a; }

/* two-ended rows */
.rows { list-style: none; padding: 0; }
.rows li { display: flex; justify-content: space-between; align-items: baseline; gap: 24px; padding: 9px 0; }
.rows li > span:first-child { font-size: var(--step-body); }
.rows li > span:first-child b { font-weight: 500; }
.rows li > span:last-child:not(:first-child) { font-size: var(--step-small); color: var(--muted); white-space: nowrap; }
.rows__group { color: var(--muted); font-size: var(--step-small); padding-top: 32px !important; }
.rows__group:first-child { padding-top: 0 !important; }
.h-quiet { margin-bottom: 20px; }
.rows + .h-quiet { margin-top: 56px; }
.field .rows li > span:first-child { color: var(--field-ink); }
.field .rows li > span:first-child br ~ * { color: var(--field-muted); }
.tight li { padding: 7px 0; }
.tight a { text-decoration: none; }

/* codeforces */
.days { display: grid; grid-template-columns: repeat(30, 1fr); gap: 4px; margin-top: 32px; max-width: 480px; }
.days span { aspect-ratio: 1; background: var(--surface); }
.days span.on { background: var(--accent); }
.days + .meta { margin-top: 16px; }
#daily h3 { font-size: var(--step-body); margin-bottom: 12px; margin-top: 6px; }

/* the record, as a table without lines */
.wrap-in { padding-left: max(0px, var(--start)); }
.stepped { font: 300 var(--step-display)/1.02 var(--display); letter-spacing: -0.022em; margin-bottom: 72px; }
.stepped span { display: block; }
.stepped span + span { padding-left: 2.2em; }
.record { width: 100%; border-collapse: collapse; font-size: var(--step-body); }
.record td { padding: 14px 16px; vertical-align: top; }
.record td:first-child { width: 8%; padding-left: 0; }
.record td:nth-child(2) { width: 38%; font-weight: 500; }
.record td:nth-child(3) { width: 30%; color: var(--field-muted); }
.record td:last-child { text-align: right; padding-right: 0; }
.record tbody tr:nth-child(even) td { background: var(--field-tone); }

/* the letter */
.letter { padding-bottom: 0; padding-top: clamp(96px, 9vw, 140px); }
.letter__col > p:first-child { margin-top: 0; }
.letter__col { max-width: 520px; margin: 0 auto; }
.sign { margin-top: 2em; font-size: var(--step-head); font-weight: 500; line-height: 1.2; }
.sign span { display: block; margin-top: 6px; font-size: var(--step-small); font-weight: 400; color: var(--muted); }
.pair { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 64px; }
.pair img { aspect-ratio: 4 / 3; object-fit: cover; width: 100%; }

/* contact band */
.contact {
  display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: 24px; align-items: start;
  padding-top: var(--gap); padding-bottom: 120px;
}
.contact__say { grid-column: 1 / span 5; font: 300 var(--step-lead)/1.15 var(--display); letter-spacing: -0.015em; }
.contact__img { grid-column: 7 / span 2; width: 100%; max-width: 170px; aspect-ratio: 1; object-fit: cover; }
.contact__img img { width: 100%; aspect-ratio: 1; object-fit: cover; }
.contact__links { grid-column: 9 / span 4; display: flex; flex-direction: column; gap: 6px; }
.contact__links .q { font-weight: 500; margin-bottom: 14px; }
.contact__links a { font-size: var(--step-body); width: fit-content; }
.contact__links .meta { margin-top: 14px; }

/* footer: credits, then one quiet line */
.foot { padding: 120px var(--m) 30px; font-size: var(--step-small); color: var(--muted); }
.credits { max-width: 72ch; margin-bottom: 28px; }
.foot__line { display: grid; grid-template-columns: 1fr auto 1fr; gap: 24px; align-items: baseline; }
.foot__links { display: flex; gap: 24px; }
.foot__links a { color: var(--ink); text-decoration: none; }
.foot__end { text-align: right; }

/* entrance: only with script and only when motion is welcome; content is visible otherwise */
@media (prefers-reduced-motion: no-preference) {
  .js [data-r] { opacity: 0; transform: translateY(20px); transition: opacity 600ms var(--ease), transform 700ms var(--ease); transition-delay: calc(var(--i, 0) * 75ms); }
  .js [data-r].in { opacity: 1; transform: none; }
  .door img { animation: drift 18s ease-in-out infinite alternate; }
  .door:nth-child(2) img { animation-delay: -9s; }
  @keyframes drift { from { object-position: 50% 40%; } to { object-position: 50% 60%; } }
}

@media (max-width: 1100px) {
  .split { grid-template-columns: minmax(0, 1fr); padding-left: 0; max-width: 680px; }
  .split > * + * { margin-top: 48px; }
  .preview { display: none; }
  .wrap-in { padding-left: 0; }
  .case { max-width: 680px; }
  .contact { grid-template-columns: 96px 1fr; column-gap: 20px; row-gap: 32px; }
  .contact__say { grid-column: 1 / -1; }
  .contact__img { grid-column: 1; max-width: 96px; }
  .contact__links { grid-column: 2; }
}

@media (max-width: 640px) {
  .top nav { gap: 16px; }
  .top nav a:nth-child(2), .top nav a:nth-child(3) { display: none; }
  .hero { text-align: left; padding-top: 56px; }
  .hero h1 br { display: none; }
  .hero__lead { margin-left: 0; }
  .doors { gap: 14px; justify-content: flex-start; }
  .door, .door img { width: 100%; }
  .door { flex: 1; }
  .ledger a { grid-template-columns: 1fr auto; grid-template-rows: auto auto; min-height: 52px; padding: 6px 0; }
  .ledger a span:nth-child(2) { grid-row: 2; grid-column: 1; }
  .ledger a span:nth-child(3) { grid-row: 1; grid-column: 2; }
  [data-ui] { padding: 18px 16px; }
  .frag { font-size: 0.8125rem; }
  .flow li { grid-template-columns: 1fr; gap: 2px; }
  .tools li { flex-direction: column; gap: 0; }
  .flow li + li b::before { margin-left: 0; }
  .rows li { flex-direction: column; gap: 2px; }
  .rows li > span:last-child:not(:first-child) { white-space: normal; }
  .record thead { display: none; }
  .record, .record tbody, .record tr, .record td { display: block; width: auto !important; }
  .record tr { padding: 14px 12px; }
  .record td { padding: 0; text-align: left !important; background: none !important; }
  .record tbody tr:nth-child(even) { background: var(--field-tone); }
  .record td:first-child:not(:empty) { font: 300 1.375rem/1.2 var(--display); margin-bottom: 8px; }
  .record td:first-child:empty { display: none; }
  .stepped span + span { padding-left: 1.2em; }
  .letter__col { padding-inline: 4px; }
  .foot { padding-top: 80px; }
  .foot__line { grid-template-columns: 1fr; gap: 8px; }
  .foot__links { flex-wrap: wrap; gap: 8px 20px; }
  .foot__end { text-align: left; }
}
