/* Tokens and the reasons behind them are in DESIGN.md beside this file. */

@font-face {
  font-family: "Oswald";
  src: url("assets/oswald-var.woff2") format("woff2");
  font-weight: 200 700;
  font-style: normal;
  font-display: swap;
}

:root {
  --paper: #f3eee4;
  --paper-2: #e9e2d4;
  --ink: #1b1a17;
  --ink-2: #5a564e;
  --accent: #8c5a14;
  --on-accent: #f3eee4;
  --line: rgba(27, 26, 23, 0.5);

  --font-display: "Oswald", "Arial Narrow", "Helvetica Neue", Helvetica, sans-serif;
  --font-text: system-ui, -apple-system, "Segoe UI", Helvetica, Arial, sans-serif;
  --step-label: clamp(0.8125rem, 0.78rem + 0.15vw, 0.9375rem);  /* 13-15px */
  --step-body: clamp(1.0625rem, 1rem + 0.3vw, 1.1875rem);       /* 17-19px */
  --step-lead: clamp(1.3125rem, 1.1rem + 0.9vw, 1.75rem);       /* 21-28px */
  --step-head: clamp(2.75rem, 1.6rem + 4.6vw, 5.5rem);          /* 44-88px */
  --step-display: clamp(3.5rem, 1.5rem + 7vw, 7rem);            /* 56-112px */
  --track-label: 0.12em;
  --track-caps: 0.01em;
  --track-display: -0.005em;

  --s1: 4px;
  --s2: 8px;
  --s3: 16px;
  --s4: 24px;
  --s5: 40px;
  --s6: 64px;
  --s7: clamp(96px, 6vw + 48px, 160px);
  --gutter: clamp(24px, 4vw, 48px);
  --max: 1200px;
  --measure: 62ch;

  --hair: 1px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --dur: 240ms;
}

@media (min-resolution: 2dppx) {
  :root { --hair: 0.75px; }
}

*,
*::before,
*::after { box-sizing: border-box; }

html {
  background: var(--paper);
  color: var(--ink);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-text);
  font-size: var(--step-body);
  line-height: 1.55;
  font-kerning: normal;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}

::selection { background: var(--accent); color: var(--on-accent); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

img { display: block; max-width: 100%; height: auto; }

h1, h2, h3, p, figure { margin: 0; }

a {
  color: var(--accent);
  text-decoration-thickness: 0.07em;
  text-underline-offset: 0.18em;
}
a:hover { text-decoration-thickness: 0.12em; }

h1, h2, h3, .eyebrow, .button, .close {
  font-family: var(--font-display);
  text-transform: uppercase;
  font-kerning: normal;
  hyphens: none;
}

h1 {
  font-size: var(--step-head);
  font-weight: 300;
  line-height: 0.95;
  letter-spacing: var(--track-display);
  text-wrap: balance;
  margin-left: -0.03em;
  max-width: 14ch;
}

.band-label {
  font-size: var(--step-label);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: var(--track-label);
  color: var(--ink-2);
}

.eyebrow {
  font-size: var(--step-label);
  font-weight: 500;
  line-height: 1.3;
  letter-spacing: var(--track-label);
}

.headline {
  font-size: var(--step-head);
  font-weight: 300;
  line-height: 0.92;
  letter-spacing: var(--track-display);
  text-wrap: balance;
  margin-left: -0.03em;
}
.headline-display { font-size: var(--step-display); }

p { max-width: var(--measure); text-wrap: pretty; }

.lead {
  font-size: var(--step-lead);
  line-height: 1.35;
  max-width: 34ch;
}

.support {
  font-size: var(--step-body);
  max-width: 38ch;
}

.note { max-width: 52ch; }

.wrap {
  width: min(100%, var(--max));
  margin-inline: auto;
}

.top, .band, footer { padding-inline: var(--gutter); }

.top { padding-top: var(--s5); }
.top .wrap { display: grid; gap: var(--s4); }

.band { padding-block: var(--s7); }
.band-accent { background: var(--paper-2); }
.band .wrap { display: grid; gap: var(--s5); }

.hero { display: grid; gap: var(--s3); align-content: start; }
.hero-text { display: grid; gap: var(--s3); align-content: start; }
.hero .headline, .hero-text .headline { margin-top: var(--s1); }
.hero .support, .hero-text .support { margin-top: var(--s2); }
.hero .button, .hero-text .button { margin-top: var(--s3); }

.button {
  display: inline-flex;
  align-items: center;
  min-height: 48px;
  padding: 0 var(--s4);
  background: var(--accent);
  color: var(--on-accent);
  text-decoration: none;
  font-weight: 500;
  font-size: var(--step-body);
  letter-spacing: var(--track-caps);
  justify-self: start;
  transition: background-color var(--dur) var(--ease-out), transform var(--dur) var(--ease-out);
}
.button:hover { background: var(--ink); }
.button:active { transform: translateY(1px); }

.seal {
  display: block;
  fill: none;
  stroke: var(--ink);
  stroke-width: var(--hair);
  opacity: 0.85;
}
.seal .dot { fill: var(--ink); stroke: none; }

.rule {
  position: relative;
  height: 32px;
  margin-top: var(--s5);
}
.rule::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 50%;
  height: var(--hair); /* taste-skill-ignore: the construction hairline from the David reference, STANDARD 2.1 */
  background: var(--line);
}
.rule::after {
  content: "";
  position: absolute;
  left: 50%; top: 50%;
  width: 32px; height: 32px;
  transform: translate(-50%, -50%);
  border: var(--hair) solid var(--ink); /* taste-skill-ignore: the halo circle from the David reference, STANDARD 2.1 */
  border-radius: 50%;
  background: var(--paper);
}
.rule span {
  position: absolute;
  left: 50%; top: 50%;
  width: 6px; height: 6px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--ink);
}

.construct {
  position: relative;
  width: min(100%, 420px);
  aspect-ratio: 4 / 5;
  overflow: hidden;
}
.construct img {
  position: absolute;
  left: 50%; top: 0;
  height: 100%;
  width: auto;
  max-width: none;
  transform: translateX(-50%);
  mix-blend-mode: multiply;
}
.geometry {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  fill: none;
  stroke: var(--line);
  stroke-width: var(--hair);
  overflow: visible;
}
.geometry .dot { fill: var(--ink); stroke: none; }

.etching {
  position: relative;
  width: min(100%, 480px);
  aspect-ratio: 560 / 790;
}
.etching img { width: 100%; height: 100%; mix-blend-mode: multiply; }
.etching .layer {
  position: absolute;
  inset: 0;
  display: none;
  pointer-events: none;
}

footer { margin-top: var(--s7); padding-block: var(--s6); background: var(--paper-2); }
footer .wrap { display: grid; gap: var(--s4); }
footer .close { margin-bottom: var(--s3); }
.close {
  font-size: var(--step-head);
  font-weight: 300;
  line-height: 0.92;
  letter-spacing: var(--track-display);
  margin-left: -0.03em;
  max-width: 14ch;
  text-wrap: balance;
}

/* Lenis 1.3.27, lenis.css, MIT. Inlined per design-standard/motion.md. */
html.lenis, html.lenis body { height: auto; }
.lenis:not(.lenis-autoToggle).lenis-stopped { overflow: clip; }
.lenis.lenis-smooth [data-lenis-prevent] { overscroll-behavior: contain; }
.lenis.lenis-smooth iframe { pointer-events: none; }
.lenis.lenis-autoToggle { transition-property: overflow; transition-duration: 1ms; transition-behavior: allow-discrete; }

@media (min-width: 700px) {
  .band { padding-block: clamp(64px, 9vh, 112px); }
  .band .wrap { gap: var(--s5); }

  .band-hint .hero {
    justify-items: center;
    text-align: center;
    margin-inline: auto;
    width: min(100%, 48rem);
  }
  .band-hint .hero .rule { width: 100%; }
  .band-hint .hero .button { justify-self: center; }

  .band-accent .hero {
    grid-template-columns: 7fr 5fr;
    gap: var(--s6);
    align-items: center;
  }
  .band-accent .construct { justify-self: end; }

  .band-full .hero {
    grid-template-columns: 5fr 7fr;
    gap: var(--s6);
    align-items: center;
  }
  .band-full .hero-text { grid-column: 2; grid-row: 1; }
  .band-full .etching { grid-column: 1; grid-row: 1; width: min(100%, 480px); }
}

@media (min-width: 900px) {
  .top { padding-top: var(--s6); }
  .top .wrap { grid-template-columns: 7fr 5fr; align-items: end; gap: var(--s6); }
  .top .lead { padding-bottom: var(--s2); }

  footer .wrap { grid-template-columns: 7fr 5fr; gap: var(--s6); align-items: end; }
  footer .close { grid-row: 1 / span 2; margin-bottom: 0; }
}
