/* Keephouse — keephouse.app
   Tokens are named from ../docs/design/TOKENS.md. One documented divergence: text
   this page owns uses clayDark, not clay. Clay on paper measures 4.13:1 and the
   eyebrows are 10.5-11px, so clay fails WCAG AA there; clayDark measures 6.19:1.
   Clay is still used exactly as specified for non-text accents — the callout's
   2px left border — where 4.13:1 clears the 3:1 bar for UI components. */

/* ---------------------------------------------------------------- fonts --- */

@font-face {
  font-family: 'Instrument Serif';
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url('../fonts/instrument-serif-latin-400.woff2') format('woff2');
}

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

@font-face {
  font-family: 'Newsreader';
  font-style: italic;
  font-weight: 200 800;
  font-display: swap;
  src: url('../fonts/newsreader-latin-variable-italic.woff2') format('woff2');
}

@font-face {
  font-family: 'Karla';
  font-style: normal;
  font-weight: 400 700;
  font-display: swap;
  src: url('../fonts/karla-latin-variable.woff2') format('woff2');
}

/* --------------------------------------------------------------- tokens --- */

:root {
  --paper: #FAF6F0;
  --surface: #FFFDFA;
  --tint: #F2EDE4;
  --ink: #211D19;
  --ink-body: #332D27;
  --ink-muted: #6E6459;
  --rule: #E5DDD1;
  --clay: #BE5A3C;
  --clay-dark: #97432A;

  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'Newsreader', Georgia, serif;
  --font-ui: 'Karla', system-ui, sans-serif;

  /* Device frame scale. calc() cannot divide a length by a length, so this steps
     down at narrow widths rather than tracking the viewport fluidly.

     Each step must satisfy 390px * --s + 2 * 20px <= the lower edge of its band,
     where 20px is the --gutter clamp floor. Below that the frame forces a
     horizontal scrollbar. */
  --s: 1;

  --gutter: clamp(1.25rem, 5vw, 2.5rem);
  --section-space: clamp(3.5rem, 9vw, 6.5rem);
}

@media (max-width: 439px) { :root { --s: 0.86; } }
@media (max-width: 379px) { :root { --s: 0.78; } }
@media (max-width: 344px) { :root { --s: 0.70; } }

/* ---------------------------------------------------------------- reset --- */

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

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-body);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

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

/* -------------------------------------------------------------- shell ----- */

.wrap {
  max-width: 70rem;
  margin: 0 auto;
  padding-inline: var(--gutter);
}

.wordmark {
  font-family: var(--font-ui);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--clay-dark);
}

.site-header { padding-block: clamp(1.75rem, 4vw, 2.5rem); }

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: clamp(2rem, 5vw, 3rem);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.75rem 2rem;
}

.site-footer p:not(.wordmark) {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--ink-muted);
}

/* ------------------------------------------------------------- sections --- */

.section {
  border-top: 1px solid var(--rule);
  padding-block: var(--section-space);
}

.section--hero {
  border-top: 0;
  padding-top: clamp(1rem, 3vw, 2rem);
}

.eyebrow {
  font-family: var(--font-ui);
  font-size: 0.6875rem;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--clay-dark);
}

.display-xl {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2.375rem, 6.5vw, 2.875rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
  color: var(--ink);
  text-wrap: pretty;
  margin-top: 0.75rem;
  max-width: 16ch;
}

.display-m {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: clamp(2rem, 5.5vw, 2.25rem);
  line-height: 1.06;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-wrap: pretty;
  margin-top: 0.75rem;
  max-width: 20ch;
}

.deck {
  font-size: clamp(1.0625rem, 2.4vw, 1.1875rem);
  line-height: 1.6;
  color: var(--ink-body);
  text-wrap: pretty;
  margin-top: 1.5rem;
  max-width: 38ch;
}

.prose > p:not(.eyebrow) {
  font-size: 1rem;
  line-height: 1.62;
  color: var(--ink-body);
  text-wrap: pretty;
  max-width: 42ch;
}

.display-m + p { margin-top: 1.5rem; }

.prose > p + p { margin-top: 1.125rem; }

.callout {
  background: var(--tint);
  border-left: 2px solid var(--clay);
  padding: 1rem 1.125rem;
  margin-top: 1.5rem;
  max-width: 42ch;
}

.callout p {
  font-size: 0.9375rem;
  line-height: 1.55;
  color: var(--ink-body);
}

/* -------------------------------------------------------------- buttons --- */

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 52px;
  padding: 0 1.5rem;
  border: 0;
  border-radius: 4px;
  background: var(--clay-dark);
  color: var(--paper);
  font-family: var(--font-ui);
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  text-decoration: none;
  cursor: pointer;
}

.button:hover,
.button:focus-visible { background: var(--ink); }

.button:focus-visible {
  outline: 2px solid var(--clay-dark);
  outline-offset: 2px;
}

.hero-cta { margin-top: 2rem; }

/* ----------------------------------------------------------------- link --- */

/* The site's first inline text link. Without a rule it renders default browser blue
   against a warm editorial palette, which is the one visual regression the new pages
   could plausibly ship. clayDark, not clay: clay on paper measures 4.13:1 and fails
   AA for normal text, clayDark measures 6.19:1. The underline stays — colour alone
   must not be the only thing distinguishing a link from its surrounding text. */
.text-link {
  color: var(--clay-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

.text-link:hover { color: var(--ink); }

.text-link:focus-visible {
  outline: 2px solid var(--clay-dark);
  outline-offset: 3px;
}

/* --------------------------------------------------------------- device --- */

.showcase__figure { margin-top: 2.5rem; }

.device-shell {
  width: calc(390px * var(--s));
  height: calc(844px * var(--s));
  overflow: hidden;
  border: 1px solid var(--rule);
  border-radius: 14px;
  background: var(--paper);
}

.device {
  width: 390px;
  height: 844px;
  transform: scale(var(--s));
  transform-origin: top left;
  /* The artboards are transcribed from design/screens/*.dc.html, where they render
     against a bare document. Restore those defaults so the copies look like the
     source: content-box descendants and no inherited page typography. */
  line-height: normal;
  letter-spacing: normal;
  text-align: left;
  font-weight: 400;
  font-style: normal;
}

.device *,
.device *::before,
.device *::after { box-sizing: content-box; }

.showcase__figure figcaption {
  font-family: var(--font-ui);
  font-size: 0.8125rem;
  line-height: 1.4;
  color: var(--ink-muted);
  margin-top: 0.875rem;
  max-width: calc(390px * var(--s));
}

@media (min-width: 900px) {
  .showcase {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 390px;
    gap: clamp(2.5rem, 5vw, 4.5rem);
    align-items: start;
  }

  .showcase__figure { margin-top: 0; }
}

/* ----------------------------------------------------------------- form --- */

.signup-form {
  margin-top: 2rem;
  max-width: 26rem;
}

.signup-form label {
  display: block;
  font-family: var(--font-ui);
  font-size: 0.875rem;
  font-weight: 600;
  line-height: 1.3;
  color: var(--ink-body);
}

/* The honeypot's label carries the hidden attribute, but the UA stylesheet's
   [hidden] { display: none } is a normal declaration in the user-agent origin, so the
   author rule above beats it and the honeypot would render. This restores the
   attribute's meaning; it is not redundant with it. */
.signup-form label[hidden] { display: none; }

.signup-form input {
  display: block;
  width: 100%;
  min-height: 52px;
  margin-top: 0.5rem;
  padding: 0 0.875rem;
  /* inkMuted, not the rule hairline. rule on paper is 1.25:1 — fine for a decorative
     section divider, but this border is the only thing identifying the field, and
     WCAG 1.4.11 wants 3:1 for that. inkMuted on surface is 5.70:1. */
  border: 1px solid var(--ink-muted);
  border-radius: 4px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: 1.2;
}

.signup-form input:focus-visible {
  outline: 2px solid var(--clay-dark);
  outline-offset: 2px;
  border-color: var(--clay-dark);
}

.signup-form .button {
  width: 100%;
  margin-top: 0.75rem;
}

.form-helper {
  font-size: 0.9375rem;
  line-height: 1.5;
  color: var(--ink-muted);
  margin-top: 1rem;
  max-width: 34ch;
}

@media (min-width: 540px) {
  .signup-form .button { width: auto; }
}
