/*
  nookmatrix landing page styles.
  Palette, type, and spacing follow docs/brand/BRANDBOOK.md.
  About 90% of the page is Paper + Charcoal. Nook Red is used for exactly
  one thing per screen: the primary action.
*/

:root {
  /* Brand palette (BRANDBOOK.md §6) */
  --paper: #f7f5ef;
  --charcoal: #1b1f24;
  --nook-red: #b7331f;
  --river-blue: #2c6e8a;
  --meadow: #5a8f5a;
  --amber: #d89826;
  --fog: #e7e3da;

  /* Derived */
  --ink: var(--charcoal);
  --ink-soft: #4a4f56;
  --bg: var(--paper);
  --surface: #ffffff;
  --surface-alt: var(--fog);
  --border: #d8d4c9;

  /* Type scale (BRANDBOOK.md §7) */
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", Menlo,
    Consolas, monospace;

  --fs-display: 2.5rem;
  --fs-h1: 2rem;
  --fs-h2: 1.5rem;
  --fs-h3: 1.25rem;
  --fs-body: 1rem;
  --fs-small: 0.875rem;

  /* Layout */
  --max-w: 1040px;
  --gutter: clamp(1.25rem, 4vw, 2.5rem);
  --radius: 12px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #161a1f;
    --ink: #e9e5dc;
    --ink-soft: #b8b2a6;
    --surface: #1e2329;
    --surface-alt: #232830;
    --border: #2f353d;
  }
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--fs-body);
  line-height: 1.6;
  font-feature-settings: "cv11", "ss01", "ss03";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--river-blue);
  text-decoration: none;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
}

code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--surface-alt);
  padding: 0.1em 0.4em;
  border-radius: 4px;
  color: var(--ink);
}

h1,
h2,
h3 {
  color: var(--ink);
  line-height: 1.2;
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}

h1 {
  font-size: var(--fs-display);
  font-weight: 600;
  line-height: 1.1;
}

h2 {
  font-size: var(--fs-h1);
  font-weight: 600;
}

h3 {
  font-size: var(--fs-h3);
  font-weight: 500;
  line-height: 1.4;
}

p {
  margin: 0 0 1em;
}

em {
  color: var(--nook-red);
  font-style: normal;
  font-weight: 500;
}

/* Layout container helper */
.section,
.site-header,
.site-footer,
.hero {
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

/* Header */
.site-header {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-top: 1.5rem;
  padding-bottom: 1rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  line-height: 0;
}

.brand img {
  height: 32px;
  width: auto;
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  font-size: var(--fs-small);
}

.site-nav a {
  color: var(--ink-soft);
}

.site-nav a:hover,
.site-nav a:focus-visible {
  color: var(--ink);
  text-decoration: none;
}

/* Hero */
.hero {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-top: clamp(3rem, 8vw, 6rem);
  padding-bottom: clamp(3rem, 7vw, 5rem);
  text-align: left;
}

.hero h1 {
  max-width: 22ch;
}

.lede {
  font-size: 1.25rem;
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 52ch;
  margin-top: 1rem;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 2rem;
}

.cta {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.25rem;
  font-size: var(--fs-body);
  font-weight: 500;
  border-radius: 8px;
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.08s ease, background 0.15s ease, color 0.15s ease,
    border-color 0.15s ease;
  text-decoration: none;
  line-height: 1.2;
}

.cta:hover {
  text-decoration: none;
}

.cta--primary {
  background: var(--nook-red);
  color: #fff;
}

.cta--primary:hover,
.cta--primary:focus-visible {
  background: #9c2a18;
}

.cta--disabled {
  cursor: not-allowed;
  opacity: 0.8;
}

.cta--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--border);
}

.cta--ghost:hover,
.cta--ghost:focus-visible {
  border-color: var(--ink);
}

.hero-meta {
  margin-top: 2rem;
  font-size: var(--fs-small);
  color: var(--ink-soft);
}

/* Sections */
.section {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-top: clamp(3rem, 6vw, 5rem);
  padding-bottom: clamp(3rem, 6vw, 5rem);
}

.section--alt {
  background: var(--surface-alt);
  max-width: none;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section--alt .section-head,
.section--alt .prose,
.section--alt .split {
  max-width: var(--max-w);
  margin-left: auto;
  margin-right: auto;
}

.section--narrow {
  max-width: 720px;
}

.section-head {
  margin-bottom: 2.5rem;
}

.eyebrow {
  display: inline-block;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--river-blue);
  margin-bottom: 0.75rem;
}

.section-head h2 {
  max-width: 24ch;
}

.section-sub {
  color: var(--ink-soft);
  max-width: 52ch;
}

/* Cards (Goals) */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.card h3 {
  font-weight: 600;
  font-size: var(--fs-h3);
  margin-bottom: 0.5rem;
}

.card p {
  color: var(--ink-soft);
  margin: 0;
}

/* Prose (Vision) */
.prose {
  max-width: 62ch;
  font-size: 1.05rem;
  color: var(--ink);
}

.prose p {
  margin-bottom: 1.25rem;
}

/* Split columns */
.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.25rem;
  margin-top: 2.5rem;
}

@media (min-width: 720px) {
  .split {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }
}

.split-col {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
}

.split-col h3 {
  font-size: var(--fs-h3);
  font-weight: 600;
  margin-bottom: 1rem;
}

.clean-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.clean-list li {
  position: relative;
  padding-left: 1.25rem;
  color: var(--ink-soft);
  margin-bottom: 0.5rem;
}

.clean-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.7em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--river-blue);
}

.pill {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 500;
  padding: 0.15rem 0.5rem;
  border-radius: 999px;
  background: var(--surface-alt);
  color: var(--ink-soft);
  margin-left: 0.5rem;
  vertical-align: middle;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* Timeline (Roadmap) */
.timeline {
  list-style: none;
  padding: 0;
  margin: 0;
  display: grid;
  gap: 1.25rem;
}

.timeline-item {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.5rem;
}

.timeline-marker {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--border);
  margin-top: 0.55rem;
}

.timeline-item[data-phase="now"] .timeline-marker {
  background: var(--nook-red);
  box-shadow: 0 0 0 4px rgba(183, 51, 31, 0.15);
}

.timeline-tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.25rem;
}

.timeline-item[data-phase="now"] .timeline-tag {
  color: var(--nook-red);
}

.timeline-body h3 {
  font-weight: 600;
  font-size: 1.125rem;
  margin-bottom: 0.25rem;
}

.timeline-body p {
  color: var(--ink-soft);
  margin: 0;
}

/* Note block */
.note {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--nook-red);
  border-radius: var(--radius);
  padding: 1.5rem 1.75rem;
}

.note h3 {
  font-weight: 600;
  font-size: var(--fs-h3);
  margin-bottom: 0.5rem;
}

.note p {
  color: var(--ink-soft);
  margin: 0;
}

/* Footer */
.site-footer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding-top: 2.5rem;
  padding-bottom: 3rem;
  border-top: 1px solid var(--border);
  margin-top: 3rem;
  color: var(--ink-soft);
  font-size: var(--fs-small);
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 0.5rem;
}

.footer-credit {
  margin-bottom: 0.25rem;
}

.footer-fine {
  margin: 0;
  opacity: 0.8;
}

/* Focus styles — keyboard visibility */
:focus-visible {
  outline: 2px solid var(--river-blue);
  outline-offset: 2px;
  border-radius: 3px;
}

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  .cta {
    transition: none;
  }
}
