/* Hoookd, minimal design. Calm, spacious, one accent colour. */

@font-face {
  font-family: "Newsreader";
  src: url("fonts/newsreader-latin-wght-normal.woff2") format("woff2");
  font-weight: 200 800;
  font-display: swap;
}

/* Design tokens */
:root {
  --color-bg: #ffffff;
  --color-surface: #f1eee7;
  --color-text: #1a1a18;
  --color-muted: #5c5b55;
  --color-line: #d9d5ca;
  --color-accent: #0f5c4a;

  --font-display: "Newsreader", "Iowan Old Style", Georgia, serif;
  --font-body: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono: ui-monospace, "Cascadia Mono", Consolas, Menlo, monospace;

  --text-sm: 0.875rem;
  --text-base: 1.0625rem;
  --text-lg: 1.25rem;
  --text-h3: 1.25rem;
  --text-h2: clamp(1.75rem, 1.3rem + 1.8vw, 2.5rem);
  --text-h1: clamp(2.75rem, 1.6rem + 5.6vw, 5.5rem);

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 1rem;
  --space-4: 1.5rem;
  --space-5: 2.5rem;
  --space-6: 4rem;
  --space-7: 7rem;

  --measure: 38rem;
  --page: 68rem;
  --gutter: clamp(1.25rem, 5vw, 3rem);
  --radius: 2px;
}

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

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.65;
}

h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

a { color: var(--color-accent); text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--color-accent); outline-offset: 3px; }

.skip {
  position: absolute; left: var(--space-3); top: -4rem;
  background: var(--color-text); color: var(--color-bg);
  padding: var(--space-2) var(--space-3);
}
.skip:focus { top: var(--space-3); }

/* Header */
.site-header {
  max-width: var(--page); margin: 0 auto;
  padding: var(--space-4) var(--gutter);
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between; gap: var(--space-3) var(--space-5);
}
.wordmark {
  font-family: var(--font-display); font-size: 1.625rem; font-weight: 500;
  color: var(--color-text); text-decoration: none; letter-spacing: -0.01em;
}
/* Each "o" in the wordmark is shown as a black ring image. The letters
   stay in the HTML, so the name still reads "Hoookd" as text. */
.wordmark .ring { position: relative; color: transparent; padding: 0 0.015em; }
.wordmark .ring::before {
  content: ""; position: absolute; left: 50%; top: 0.245em; width: 0.5em; aspect-ratio: 1;
  transform: translateX(-50%); background: url("ring.webp") center / 100% 100% no-repeat;
}
.site-header ul { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.site-header nav a { color: var(--color-muted); text-decoration: none; font-size: var(--text-sm); padding: var(--space-2) 0; display: inline-block; }
/* The hook's rope passes behind the navigation on wide screens: keep the
   header, and its links, above it. */
.site-header { position: relative; z-index: 2; }
.site-header nav a:hover { color: var(--color-text); text-decoration: underline; }

/* Hero */
.hero {
  max-width: var(--page); margin: 0 auto;
  padding: var(--space-7) var(--gutter) var(--space-6);
}
.hero h1 {
  font-family: var(--font-display); font-weight: 400;
  font-size: var(--text-h1); line-height: 1.02; letter-spacing: -0.025em;
  max-width: 12ch;
}
.lede { margin-top: var(--space-5); max-width: var(--measure); font-size: var(--text-lg); line-height: 1.55; color: var(--color-muted); }

/* The hook hangs from above the top of the page. It starts as a still
   image; enhance.js swaps in the 3D model on larger screens. */
.hero { position: relative; }
.hero > :not(.hero-hook) { position: relative; z-index: 1; }
.hero-hook {
  position: absolute; z-index: 0; pointer-events: none;
  top: -18.6rem; right: -0.4rem;
  width: 25rem; aspect-ratio: 5 / 11;
}
.hero-hook img, .hero-hook canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-hook canvas { opacity: 0; transition: opacity 400ms ease; }
.hero-hook.is-live canvas { opacity: 1; }
.hero-hook.is-live img { visibility: hidden; }

/* The main button is an image of the words. The words themselves stay in
   the HTML as the link text, hidden behind the image. */
.cta {
  display: inline-block; margin-top: var(--space-5);
  width: 13rem; max-width: 100%; aspect-ratio: 560 / 171;
  background: url("cta.webp") center / contain no-repeat;
  color: transparent; font-size: 1rem; white-space: nowrap; overflow: hidden; user-select: none;
  border-radius: 0.6rem; transition: transform 150ms ease, filter 150ms ease;
}
.cta:hover { transform: translateY(-1px); filter: brightness(1.25); }
.cta:active { transform: translateY(1px); }

/* Section rows: label on the left, content on the right */
.row {
  max-width: var(--page); margin: 0 auto;
  padding: var(--space-6) var(--gutter);
  display: grid; grid-template-columns: 11rem minmax(0, 1fr); gap: var(--space-5);
  border-top: 1px solid var(--color-line);
}
.row-label { font-size: var(--text-sm); letter-spacing: 0.08em; text-transform: uppercase; color: var(--color-muted); padding-top: 0.6rem; }
.row-body > * { max-width: var(--measure); }
.row-body > * + * { margin-top: var(--space-4); }
.row h2 { font-family: var(--font-display); font-weight: 400; font-size: var(--text-h2); line-height: 1.12; letter-spacing: -0.015em; }
.row h3 { font-size: var(--text-h3); font-family: var(--font-display); font-weight: 500; line-height: 1.3; }

/* Checks: a quiet numbered list */
.row-body > .checks { max-width: none; margin-top: var(--space-5); counter-reset: check; }
.checks li {
  counter-increment: check;
  display: grid; grid-template-columns: 2.5rem 10rem minmax(0, 1fr); gap: var(--space-3);
  padding: var(--space-4) 0; border-top: 1px solid var(--color-line); align-items: baseline;
}
/* The numbers are images; the lists are still ordered lists in the HTML. */
.checks li::before, .steps li::before { content: ""; background: left center / contain no-repeat; }
.checks li::before { height: 1.6rem; align-self: start; }
.checks li:nth-child(1)::before, .steps li:nth-child(1)::before { background-image: url("num-1.webp"); }
.checks li:nth-child(2)::before, .steps li:nth-child(2)::before { background-image: url("num-2.webp"); }
.checks li:nth-child(3)::before, .steps li:nth-child(3)::before { background-image: url("num-3.webp"); }
.checks li:nth-child(4)::before, .steps li:nth-child(4)::before { background-image: url("num-4.webp"); }
.checks li:nth-child(5)::before { background-image: url("num-5.webp"); }
.checks li:nth-child(6)::before { background-image: url("num-6.webp"); }
.checks p { color: var(--color-muted); max-width: var(--measure); }

/* Steps */
.row-body > .steps { max-width: none; margin-top: var(--space-5); counter-reset: step; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: var(--space-4); }
.steps li { counter-increment: step; border-top: 1px solid var(--color-text); padding-top: var(--space-3); }
.steps li::before { display: block; height: 3rem; margin-bottom: var(--space-3); }
.steps p { color: var(--color-muted); margin-top: var(--space-2); font-size: 1rem; }

/* Findings */
.note { border-left: 2px solid var(--color-accent); padding-left: var(--space-3); color: var(--color-muted); }
.note strong { color: var(--color-text); }
.finding { border: 1px solid var(--color-line); background: #fff; padding: var(--space-4); border-radius: var(--radius); }
.finding > * + * { margin-top: var(--space-3); }
.finding-meta, .finding-label { font-size: var(--text-sm); letter-spacing: 0.06em; text-transform: uppercase; color: var(--color-muted); }
.finding-label { margin-top: var(--space-4); }
pre {
  margin: 0; padding: var(--space-3); overflow-x: auto;
  background: var(--color-surface); border-radius: var(--radius);
  font-family: var(--font-mono); font-size: 0.9375rem; line-height: 1.6;
}
code { font-family: var(--font-mono); }
.copy-btn {
  margin-top: var(--space-2); font: inherit; font-size: var(--text-sm);
  background: none; color: var(--color-accent); border: 1px solid currentColor; border-radius: var(--radius);
  padding: 0.5rem 0.9rem; cursor: pointer;
}
.copy-btn:hover { background: var(--color-surface); }

/* Principles */
.principles li { padding: var(--space-3) 0; border-top: 1px solid var(--color-line); }
.principles li:last-child { border-bottom: 1px solid var(--color-line); }

.tag {
  display: inline-block; margin-right: var(--space-2);
  font-size: 0.75rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--color-accent); border: 1px solid currentColor; border-radius: var(--radius); padding: 0.1rem 0.5rem; vertical-align: 0.1em;
}

/* FAQ */
.faq h3 { margin-top: var(--space-5); }
.faq h3:first-child { margin-top: 0; }
.faq p { margin-top: var(--space-2); color: var(--color-muted); }

/* Footer */
.site-footer {
  max-width: var(--page); margin: 0 auto;
  padding: var(--space-5) var(--gutter) var(--space-6);
  border-top: 1px solid var(--color-line);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--space-3) var(--space-5);
  font-size: var(--text-sm); color: var(--color-muted);
}
.site-footer ul { display: flex; flex-wrap: wrap; gap: var(--space-2) var(--space-4); }
.site-footer a { display: inline-block; padding: var(--space-1) 0; }
.site-footer .wordmark { font-size: 1.375rem; line-height: 1.2; }

/* Legal pages */
.legal { max-width: calc(var(--measure) + 2 * var(--gutter)); margin: 0 auto; padding: var(--space-6) var(--gutter); }
.legal > * + * { margin-top: var(--space-3); }
.legal h1 { font-family: var(--font-display); font-weight: 400; font-size: var(--text-h2); line-height: 1.1; margin-top: var(--space-5); }
.legal h2 { font-family: var(--font-display); font-weight: 500; font-size: var(--text-h3); margin-top: var(--space-5); }
.legal ul { list-style: disc; padding-left: 1.25rem; }
.legal li + li { margin-top: var(--space-2); }
.legal-date { color: var(--color-muted); font-size: var(--text-sm); }
.legal a { overflow-wrap: anywhere; padding-block: 0.15em; }
.draft-banner { border: 1px solid var(--color-accent); padding: var(--space-3); border-radius: var(--radius); }

@media (max-width: 74rem) {
  .hero-hook { width: 21rem; top: -15.5rem; }
}
@media (max-width: 64rem) {
  /* No room beside the headline: the hook sits under the text instead,
     with the cut end of the rope faded out. */
  .hero-hook {
    position: relative; top: auto; right: auto; margin: var(--space-5) auto 0;
    width: 11rem;
    }
  .hero-hook img { -webkit-mask-image: linear-gradient(transparent, #000 22%); mask-image: linear-gradient(transparent, #000 22%); }
}
@media (max-width: 52rem) {
  .row { grid-template-columns: minmax(0, 1fr); gap: var(--space-2); padding: var(--space-6) var(--gutter) var(--space-5); }
  .row-label { padding-top: 0; }
  .checks li { grid-template-columns: 2rem minmax(0, 1fr); }
  .checks p { grid-column: 2; }
  .row-body > .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hero { padding-top: var(--space-6); }
}
@media (max-width: 26rem) {
  .row-body > .steps { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
