:root {
  --bg: #ffffff;
  --surface: #fcfcfc;
  --ink: #111111;
  --ink-2: #2a2a2a;
  --ink-muted: #6a6a6a;
  --rule: #e2e2e2;
  --accent: #111111;
  --accent-hover: #2a2a2a;
  --accent-ink: #ffffff;
  --shadow-soft: 0 1px 2px rgba(17,17,17,0.04);
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: 17px;
  line-height: 1.65;
  font-feature-settings: "cv11", "ss01";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: "Inter", system-ui, sans-serif;
  color: var(--ink);
  margin: 0 0 0.55em;
  line-height: 1.15;
  letter-spacing: -0.02em;
}
h1 { font-size: clamp(2.4rem, 5.4vw, 4.25rem); font-weight: 700; letter-spacing: -0.03em; }
h2 { font-size: clamp(1.75rem, 3.2vw, 2.6rem); font-weight: 600; letter-spacing: -0.025em; }
h3 { font-size: 1.3rem; font-weight: 600; letter-spacing: -0.015em; }
h4 { font-size: 1.05rem; font-weight: 600; }

p { margin: 0 0 1.2em; }
p:last-child { margin-bottom: 0; }

a {
  color: var(--ink);
  text-decoration: underline;
  text-underline-offset: 4px;
  text-decoration-thickness: 1px;
  text-decoration-color: var(--rule);
  transition: text-decoration-color 0.18s, color 0.15s;
}
a:hover { text-decoration-color: var(--ink); }

strong { font-weight: 600; }

.wrap-prose  { max-width: 64rem; margin: 0 auto; padding: 0 1.5rem; }
.wrap-grid   { max-width: 80rem; margin: 0 auto; padding: 0 1.5rem; }
.wrap-narrow { max-width: 48rem; margin: 0 auto; padding: 0 1.5rem; }

/* ---------- Scroll progress bar ---------- */
.scroll-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 0;
  background: var(--ink);
  z-index: 100;
  will-change: width;
  transition: width 0.05s linear;
}

/* ---------- Nav ---------- */
.nav {
  position: sticky;
  top: 0;
  background: rgba(255,255,255,0.85);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid transparent;
  z-index: 50;
  transition: border-color 0.2s, background-color 0.2s;
}
.nav.is-scrolled {
  border-bottom-color: var(--rule);
  background: rgba(255,255,255,0.94);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.5rem;
  max-width: 80rem;
  margin: 0 auto;
}

/* Logo lockup (mark + wordmark) */
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
}
.brand:hover { color: var(--accent-hover); text-decoration: none; }
.brand .mark {
  display: inline-block;
  width: 28px;
  height: 28px;
  flex: 0 0 auto;
}
.brand .mark svg { display: block; width: 100%; height: 100%; }
.brand .wordmark {
  font-family: "Inter", system-ui, sans-serif;
  font-weight: 500;
  font-size: 1.15rem;
  letter-spacing: -0.015em;
  line-height: 1;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  position: relative;
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 0.25rem 0;
}
.nav-links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0;
  bottom: -2px;
  height: 1px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}
.nav-links a:hover::after, .nav-links a.is-active::after {
  transform: scaleX(1);
}
.nav-toggle {
  display: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 0.5rem;
  color: var(--ink);
}

@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0; right: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--rule);
    flex-direction: column;
    gap: 0;
    padding: 0.5rem 1.5rem 1.5rem;
  }
  .nav-links.is-open { display: flex; }
  .nav-links a {
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--rule);
  }
  .nav-links a:last-child { border-bottom: 0; }
  .nav-links a::after { display: none; }
}

/* ---------- Sections ---------- */
section { padding: 6rem 0; }
@media (max-width: 760px) { section { padding: 3.5rem 0; } }

.bg-surface { background: var(--surface); }
.bg-ink {
  background: var(--ink);
  color: var(--accent-ink);
}
.bg-ink h1, .bg-ink h2, .bg-ink h3 { color: var(--accent-ink); }
.bg-ink .muted { color: rgba(255,255,255,0.7); }
.bg-ink a { color: var(--accent-ink); text-decoration-color: rgba(255,255,255,0.3); }
.bg-ink a:hover { text-decoration-color: var(--accent-ink); }
.bg-ink .btn-primary { background: var(--accent-ink); color: var(--ink); }
.bg-ink .btn-primary:hover { background: rgba(255,255,255,0.9); color: var(--ink); }

.eyebrow {
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--ink-muted);
  margin: 0 0 1rem;
}
.bg-ink .eyebrow { color: rgba(255,255,255,0.6); }

.lede {
  font-size: clamp(1.1rem, 1.55vw, 1.3rem);
  line-height: 1.55;
  color: var(--ink-2);
  max-width: 44rem;
  margin: 0 0 2rem;
  letter-spacing: -0.005em;
}
.bg-ink .lede { color: rgba(255,255,255,0.88); }

.muted { color: var(--ink-muted); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  padding: 0.85rem 1.4rem;
  font-family: "Inter", sans-serif;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
  letter-spacing: -0.005em;
  transition: background-color 0.18s, color 0.18s, border-color 0.18s, transform 0.15s;
}
.btn:hover { text-decoration: none; }
.btn-primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn-primary:hover {
  background: var(--accent-hover);
  color: var(--accent-ink);
}
.btn-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}
.btn-secondary:hover {
  background: var(--ink);
  color: var(--bg);
}
.btn .arrow { transition: transform 0.18s; }
.btn:hover .arrow { transform: translateX(3px); }

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

/* ---------- Hero ---------- */
.hero {
  padding: 7rem 0 5rem;
  min-height: 58vh;
  display: flex;
  align-items: center;
}
@media (max-width: 760px) {
  .hero { padding: 4rem 0 3rem; min-height: auto; }
}

/* ---------- Pillars ---------- */
.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1rem;
  margin-top: 3rem;
}
.pillar {
  background: var(--bg);
  border: 1px solid var(--rule);
  padding: 2.25rem 2rem;
  display: flex;
  flex-direction: column;
  transition: border-color 0.2s, transform 0.25s ease, box-shadow 0.25s ease;
  text-decoration: none;
  color: inherit;
}
.pillar:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
  box-shadow: var(--shadow-soft);
  text-decoration: none;
}
.pillar h3 {
  font-weight: 600;
  font-size: 1.4rem;
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
  color: var(--ink);
}
.pillar p { color: var(--ink-muted); flex: 1; }
.pillar .pillar-link {
  font-weight: 500;
  text-decoration: none;
  color: var(--ink);
  margin-top: 1.25rem;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
}
.pillar .pillar-link .arrow { transition: transform 0.18s; }
.pillar:hover .pillar-link .arrow { transform: translateX(3px); }

/* ---------- Page head ---------- */
.page-head {
  padding: 6rem 0 3rem;
}
@media (max-width: 760px) {
  .page-head { padding: 3.5rem 0 1.5rem; }
}

/* ---------- Prose ---------- */
.prose ul, .prose ol {
  padding-left: 0;
  list-style: none;
  margin: 1.5rem 0 2rem;
}
.prose ul li, .prose ol li {
  position: relative;
  padding-left: 1.65rem;
  margin-bottom: 0.85rem;
  color: var(--ink);
}
.prose ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.75em;
  width: 0.65rem;
  height: 1.5px;
  background: var(--ink);
}
.prose ol { counter-reset: list; }
.prose ol li { counter-increment: list; padding-left: 2.2rem; }
.prose ol li::before {
  content: counter(list, decimal-leading-zero);
  position: absolute;
  left: 0; top: 0;
  font-size: 0.85rem;
  color: var(--ink-muted);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
}

/* ---------- Two col ---------- */
.two-col {
  display: grid;
  grid-template-columns: 1fr 1.5fr;
  gap: 4rem;
  align-items: start;
}
@media (max-width: 880px) {
  .two-col { grid-template-columns: 1fr; gap: 1.5rem; }
}

/* ---------- Cards ---------- */
.cards {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 1rem;
  margin-top: 2.5rem;
}
.card {
  background: var(--surface);
  border: 1px solid var(--rule);
  padding: 1.75rem 1.5rem;
  transition: border-color 0.2s, transform 0.25s ease;
}
.card:hover { border-color: var(--ink); transform: translateY(-2px); }
.card h3 {
  font-size: 1rem;
  font-weight: 600;
  margin-bottom: 0.5rem;
  color: var(--ink);
}
.card p { color: var(--ink-muted); font-size: 0.95rem; margin-bottom: 0; }

.rule {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 4rem 0;
}

/* ---------- Footer ---------- */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--rule);
  padding: 4rem 0 2rem;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 3rem;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1.5rem;
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
}
.footer .brand { margin-bottom: 0.75rem; }
.footer p { color: var(--ink-muted); font-size: 0.95rem; }
.footer h4 {
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  font-weight: 500;
  color: var(--ink-muted);
  margin: 0 0 1rem;
}
.footer ul { list-style: none; padding: 0; margin: 0; }
.footer ul li { margin-bottom: 0.55rem; }
.footer ul a {
  color: var(--ink);
  text-decoration: none;
  font-size: 0.95rem;
}
.footer ul a:hover { color: var(--ink-muted); }
.footer-meta {
  max-width: 80rem;
  margin: 2.5rem auto 0;
  padding: 1.75rem 1.5rem 0;
  border-top: 1px solid var(--rule);
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 1rem;
  font-size: 0.85rem;
  color: var(--ink-muted);
}
.footer-meta a { color: var(--ink-muted); text-decoration: none; }
.footer-meta a:hover { color: var(--ink); }

/* ---------- Form ---------- */
.form {
  display: grid;
  gap: 1rem;
  max-width: 40rem;
  margin-top: 2rem;
}
.form .row-2 {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1rem;
}
@media (max-width: 560px) {
  .form .row-2 { grid-template-columns: 1fr; }
}
.form label {
  display: block;
  font-size: 0.85rem;
  font-weight: 500;
  margin-bottom: 0.35rem;
  color: var(--ink);
}
.form input,
.form textarea {
  width: 100%;
  padding: 0.78rem 0.9rem;
  border: 1px solid var(--rule);
  background: var(--bg);
  font-family: inherit;
  font-size: 1rem;
  color: var(--ink);
  transition: border-color 0.15s;
}
.form input:focus,
.form textarea:focus {
  outline: 2px solid var(--ink);
  outline-offset: -1px;
  border-color: var(--ink);
}
.form textarea { resize: vertical; min-height: 9rem; }
.form .submit-row { margin-top: 0.5rem; }
.form .hint { font-size: 0.85rem; color: var(--ink-muted); }
.form-notice { font-size: 0.9rem; color: #b91c1c; margin: 0; }

/* External link arrow */
a.ext::after {
  content: " ↗";
  display: inline-block;
  margin-left: 0.05rem;
}

/* Utility */
.center { text-align: center; }
.stack-lg > * + * { margin-top: 2rem; }

/* Skip link */
.skip-link {
  position: absolute;
  left: -10000px;
  top: auto;
  background: var(--ink);
  color: var(--accent-ink);
  padding: 0.5rem 1rem;
  text-decoration: none;
  z-index: 100;
}
.skip-link:focus { left: 1rem; top: 1rem; }

/* ============================================
   SCROLL REVEALS
   ============================================ */
@media (prefers-reduced-motion: no-preference) {
  /* Section fade-up */
  .reveal {
    opacity: 0;
    transform: translateY(16px);
    transition: opacity 0.7s cubic-bezier(0.2, 0.65, 0.3, 1), transform 0.7s cubic-bezier(0.2, 0.65, 0.3, 1);
    will-change: opacity, transform;
  }
  .reveal.is-revealed {
    opacity: 1;
    transform: translateY(0);
  }

  /* Heading word reveal */
  .reveal-words .word {
    display: inline-block;
    opacity: 0;
    transform: translateY(0.4em);
    transition: opacity 0.6s cubic-bezier(0.2, 0.65, 0.3, 1), transform 0.6s cubic-bezier(0.2, 0.65, 0.3, 1);
    transition-delay: calc(var(--word-i, 0) * 40ms);
    will-change: opacity, transform;
  }
  .reveal-words.is-revealed .word {
    opacity: 1;
    transform: translateY(0);
  }

  /* Stagger children (used on .pillars, .cards) */
  .stagger > * {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.6s cubic-bezier(0.2, 0.65, 0.3, 1), transform 0.6s cubic-bezier(0.2, 0.65, 0.3, 1);
  }
  .stagger.is-revealed > * { opacity: 1; transform: translateY(0); }
  .stagger.is-revealed > *:nth-child(1) { transition-delay: 0ms; }
  .stagger.is-revealed > *:nth-child(2) { transition-delay: 80ms; }
  .stagger.is-revealed > *:nth-child(3) { transition-delay: 160ms; }
  .stagger.is-revealed > *:nth-child(4) { transition-delay: 240ms; }
  .stagger.is-revealed > *:nth-child(5) { transition-delay: 320ms; }
  .stagger.is-revealed > *:nth-child(6) { transition-delay: 400ms; }
}

/* ensure motion-reduced users see content immediately */
@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal-words .word, .stagger > * { opacity: 1; transform: none; }
  .scroll-progress { display: none; }
  html { scroll-behavior: auto; }
}
