/* ==========================================================================
   Know Your Numbers First — site base
   ==========================================================================

   WHAT THIS FILE IS
   Page chrome and layout primitives: container, header, hero, signup form,
   value grid, footer, legal pages, 404. The design system in /tokens/ is
   components-only (.kyn-* namespace) and ships no page layout, so those
   primitives live here.

   WHAT THIS FILE IS NOT
   It is not the design system entry point. Do NOT replace its contents with
   @import statements — that is what broke the site in 6cdf832. The design
   system package also ships a file named styles.css; the two collided at
   repo root. This file wins that name; the token files are linked directly.

   LOAD ORDER (all four pages)
     /assets/fonts/ibm-plex.css   self-hosted IBM Plex, no third-party tags
     /tokens/foundations.css      tokens, focus ring, reduced-motion
     /tokens/components.css       .kyn-* components
     /styles.css                  this file

   COLOR DISCIPLINE
   Every color below is a --kyn-* token. No literals. Per the system README,
   the teal ramp is functional and means "computed result" — it is used here
   only for the primary button (explicitly sanctioned by the token comment on
   --kyn-teal-300) and for links inside dark sections (set by components.css).
   The hero's <em> is emphasis, not a result, so it is NOT teal.
   ========================================================================== */

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

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

body {
  margin: 0;
  font-family: var(--kyn-font-sans);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--kyn-text-body);
  background: var(--kyn-canvas-deep);
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3 {
  color: var(--kyn-text);
  font-weight: 700;
  letter-spacing: -0.02em;
}

a { color: var(--kyn-teal-500); }
a:hover { color: var(--kyn-teal-300); }

.container {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
  padding: 0 var(--sp-4);
}

.container-narrow { max-width: 560px; }

/* --- Header --------------------------------------------------------------- */

.site-header {
  background: var(--kyn-canvas);
  border-bottom: 1px solid var(--kyn-border);
  padding: 22px 0;
}

.wordmark {
  display: inline-block;
  font-size: 1.0625rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--kyn-text);
  text-decoration: none;
}

.wordmark:hover { color: var(--kyn-text); }

/* --- Hero ----------------------------------------------------------------- */

.hero {
  background: var(--kyn-canvas);
  padding: var(--sp-6) 0 40px;
  text-align: center;
}

.hero h1 {
  margin: 0 auto;
  max-width: 18ch;
  font-size: clamp(2rem, 5vw, var(--step-4));
  line-height: 1.15;
}

/* Emphasis, not a computed result — teal is reserved for results. */
.hero h1 em {
  font-style: italic;
  color: var(--kyn-text);
}

.hero .subtitle {
  margin: var(--sp-4) auto 0;
  max-width: 56ch;
  font-size: 1.125rem;
  color: var(--kyn-text-muted);
}

.hero .kicker {
  margin: 28px 0 0;
  font-size: .9375rem;
  font-weight: 600;
  letter-spacing: .02em;
  color: var(--kyn-text-body);
}

/* --- Signup --------------------------------------------------------------- */

.signup {
  background: var(--kyn-canvas);
  padding: var(--sp-4) 0 72px;
}

.signup-form { margin: 0; }

.field { margin-bottom: var(--sp-3); }

.field label {
  display: block;
  margin-bottom: 6px;
  font-size: .9375rem;
  font-weight: 600;
  color: var(--kyn-text-body);
}

.field .optional {
  font-weight: 400;
  color: var(--kyn-text-dim);
}

/* min-height honours --target-min (44px) from foundations.css */
.field input {
  display: block;
  width: 100%;
  min-height: var(--target-min);
  padding: 12px 14px;
  font-family: inherit;
  font-size: var(--step-0);
  color: var(--kyn-text);
  background: var(--kyn-surface-alt);
  border: 1px solid var(--kyn-border);
  border-radius: var(--radius-md);
}

.field input::placeholder { color: var(--kyn-text-dim); }

/* No :focus override here on purpose. foundations.css owns the focus ring
   (3px --kyn-focus at 2px offset with a white halo). Overriding it would
   break the one accessibility primitive the system guarantees. */

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 48px;
  padding: 0 var(--sp-4);
  margin-top: var(--sp-2);
  font-family: inherit;
  font-size: var(--step-0);
  font-weight: 700;
  color: var(--kyn-canvas);
  background: var(--kyn-teal-300);
  border: 0;
  border-radius: var(--radius-md);
  cursor: pointer;
  transition: background var(--motion-fast) ease;
}

.btn:hover { background: var(--kyn-teal-500); }

.form-status {
  margin: 14px 0 0;
  font-size: .9375rem;
  color: var(--kyn-text-body);
}

/* Error state uses the disclosure rule amber, not teal — teal means result. */
.form-status.is-error { color: var(--kyn-disclosure-edge); }

.form-note {
  margin: var(--sp-3) 0 0;
  font-size: .875rem;
  line-height: 1.55;
  color: var(--kyn-text-dim);
}

/* --- Value blocks --------------------------------------------------------- */

.values {
  background: var(--kyn-canvas-deep);
  padding: 64px 0;
}

.value-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-4);
}

/* Cards: 10px radius, 1px border, no shadow. Depth is a surface step. */
.value {
  background: var(--kyn-surface);
  border: 1px solid var(--kyn-border);
  border-radius: var(--radius-lg);
  padding: var(--sp-4);
}

.value h2 {
  margin: 0 0 var(--sp-2);
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
}

.value p {
  margin: 0;
  font-size: .9375rem;
  color: var(--kyn-text-muted);
}

/* --- Footer --------------------------------------------------------------- */

.site-footer {
  background: var(--kyn-canvas-deep);
  border-top: 1px solid var(--kyn-border-soft);
  padding: var(--sp-6) 0 64px;
  font-size: .875rem;
  color: var(--kyn-text-dim);
}

.site-footer .copyright { margin: 0 0 10px; }

.footer-links { margin-bottom: var(--sp-4); }

.footer-links a {
  display: inline-block;
  margin-right: 18px;
  padding: 2px 0;
  color: var(--kyn-text-muted);
  text-decoration: none;
}

.footer-links a:hover {
  color: var(--kyn-teal-500);
  text-decoration: underline;
}

/* The independence statement uses .kyn-badge from components.css — it is the
   system's designated component for exactly this disclosure. Constrain its
   measure here rather than overriding its appearance. */
.site-footer .kyn-badge { max-width: 78ch; }

/* --- Legal pages ---------------------------------------------------------- */

.legal { padding: 64px 0 48px; }

.legal .container { max-width: 72ch; }

.legal h1 {
  margin: 0 0 var(--sp-2);
  font-size: clamp(1.75rem, 4vw, var(--step-3));
  line-height: 1.2;
}

.legal .updated {
  margin: 0 0 var(--sp-5);
  font-size: .875rem;
  color: var(--kyn-text-dim);
}

.legal h2 {
  margin: var(--sp-5) 0 var(--sp-2);
  font-size: 1.0625rem;
}

.legal p, .legal li {
  color: var(--kyn-text-muted);
  font-size: var(--step-0);
}

.legal ul { padding-left: 20px; }
.legal li { margin-bottom: var(--sp-2); }

/* --- 404 ------------------------------------------------------------------ */

.notfound {
  padding: 96px 0;
  text-align: center;
}

.notfound h1 {
  margin: 0 0 12px;
  font-size: clamp(1.75rem, 4vw, var(--step-3));
}

.notfound p { color: var(--kyn-text-muted); }

/* --- Responsive ----------------------------------------------------------- */

@media (max-width: 900px) {
  .value-grid { grid-template-columns: 1fr; gap: var(--sp-3); }
}

@media (max-width: 720px) {
  .hero { padding: 56px 0 var(--sp-5); }
}
