/* Story System marketing site, pilot stylesheet.
   Written for the templates in site/. Token values restate the existing site's
   visual direction (palette, type pairing, radii); the rules are new. Brand
   rules kept: no cream page backgrounds, pills only for the hero's primary
   call to action, no gradient text, no italic accent words, no emoji. */

:root {
  --canvas: #F5F5F2;
  --surface: #FFFFFF;
  --surface-2: #FAFAF8;
  --warm: #FDF9F3;
  --warm-2: #FBF3E6;
  --ink: #111418;
  --ink-2: #222831;
  --slate: #4B576A;
  --slate-2: #6A7486;
  --line: #E0DFDA;
  --line-2: #EBEAE6;
  --line-strong: #C8CDD4;
  --blue: #3D6AA5;
  --blue-tint: #E3EDF7;
  --sky: #8FBDE3;
  --amber: #F5B24A;
  --amber-tint: #F8EBD6;
  --amber-text: #7A4A00;

  --serif: "Newsreader", Georgia, "Times New Roman", serif;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  --r-sm: 6px;
  --r: 10px;
  --r-lg: 16px;
  --gutter: clamp(16px, 4vw, 40px);
  --section: clamp(72px, 10vw, 136px);
  --ease: cubic-bezier(.2, .7, .2, 1);
  --shadow-panel: 0 1px 0 rgba(17, 20, 24, .04), 0 24px 60px -24px rgba(34, 40, 49, .28), 0 8px 24px -12px rgba(34, 40, 49, .12);
}

/* Base */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 400 16px/1.6 var(--sans);
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
h1, h2, h3 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  letter-spacing: -.028em;
  line-height: 1.05;
  text-wrap: balance;
}
p { margin: 0; }
:focus-visible { outline: 2px solid var(--blue); outline-offset: 2px; border-radius: 4px; }

.skip {
  position: absolute; left: 12px; top: -48px; z-index: 100;
  padding: 10px 14px; border-radius: var(--r-sm);
  background: var(--ink); color: #fff; text-decoration: none;
}
.skip:focus { top: 12px; }

.wrap { width: 100%; max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter); }
.wrap--narrow { max-width: calc(760px + 2 * var(--gutter)); }

/* Buttons: softly rounded; only the hero's primary action is a pill */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  min-height: 46px; padding: 0 20px;
  border: 1px solid transparent; border-radius: 9px;
  font: 500 15px/1 var(--sans); letter-spacing: -.005em;
  text-decoration: none;
  transition: background .2s var(--ease), border-color .2s var(--ease), transform .2s var(--ease);
}
.btn--primary { background: var(--ink); color: #fff; box-shadow: 0 6px 16px -8px rgba(17, 20, 24, .5); }
.btn--primary:hover { background: var(--ink-2); transform: translateY(-1px); }
.btn--ghost { background: transparent; border-color: var(--line-strong); color: var(--ink); }
.btn--ghost:hover { background: var(--surface); }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 16px; }
.cta-row--center { justify-content: center; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(250, 249, 246, .86);
  -webkit-backdrop-filter: saturate(1.4) blur(14px);
  backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; gap: 24px; min-height: 68px; }
.brand {
  font: 500 22px/1 var(--serif); letter-spacing: -.02em;
  text-decoration: none; white-space: nowrap;
}
.nav { margin-left: auto; overflow-x: auto; }
.nav ul { display: flex; gap: 28px; margin: 0; padding: 0; list-style: none; }
.nav a { font-size: 14.5px; color: var(--slate); text-decoration: none; white-space: nowrap; transition: color .2s; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); }
.nav a[aria-current="page"] { text-decoration: underline; text-underline-offset: 6px; text-decoration-thickness: 1px; }

/* Hero: the warm opening that the closing band answers */
.hero {
  padding: clamp(56px, 8vw, 120px) 0 clamp(64px, 8vw, 112px);
  background: linear-gradient(180deg, var(--warm) 0%, var(--warm) 46%, var(--canvas) 100%);
}
.hero-inner { display: grid; gap: clamp(40px, 6vw, 80px); align-items: center; }
.hero--media .hero-inner { grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); }
.hero-title {
  max-width: 11em;
  font-size: clamp(44px, 5.4vw, 72px); line-height: .98; letter-spacing: -.035em;
}
.hero-text {
  max-width: 30em; margin-top: clamp(16px, 2vw, 24px);
  font-size: clamp(17px, 1.45vw, 20px); line-height: 1.55; color: var(--slate);
}
.hero .cta-row { margin-top: clamp(28px, 3vw, 40px); gap: 16px 24px; }
.hero .btn--primary { min-height: 54px; padding: 0 30px; border-radius: 999px; font-size: 17px; }
.hero .btn--ghost { min-height: 54px; font-size: 16px; }

/* Images */
.figure { margin: 0; }
.figure img { width: 100%; border-radius: var(--r-lg); background: var(--surface-2); }
.figure figcaption { margin-top: 10px; font-size: 14px; color: var(--slate-2); }
.hero-image img, .page-image img, .article-image img {
  aspect-ratio: 4 / 3; object-fit: cover;
  border: 1px solid var(--line); box-shadow: var(--shadow-panel);
}
.page-image { margin-top: clamp(32px, 4vw, 48px); }
.article-image { margin-bottom: clamp(40px, 5vw, 64px); }

/* Sections. Background follows the section's job, not its position:
   surface for showing, canvas for explaining and deciding. */
.sec { padding: var(--section) 0; }
.features, .article-list { background: var(--surface); }
.steps, .faq, .prose-sec, .sec--body { background: var(--canvas); }
:is(.steps, .faq, .prose-sec, .sec--body) + :is(.steps, .faq, .prose-sec, .sec--body) { padding-top: 0; }
/* A hairline inset to the content edge separates neighbours that share a background. */
:is(.steps, .faq, .prose-sec, .sec--body) + :is(.steps, .faq, .prose-sec, .sec--body) > .wrap {
  padding-top: var(--section);
  background: linear-gradient(var(--line), var(--line)) top center / calc(100% - 2 * var(--gutter)) 1px no-repeat;
}
.sec-head { max-width: 760px; margin-bottom: clamp(40px, 5vw, 64px); }
.sec-title { font-size: clamp(34px, 4.6vw, 56px); }
.sec-head .sec-title, .prose-sec .sec-title, .article-list .sec-title { margin-bottom: 20px; }
.prose-sec .sec-title { max-width: 760px; }
.article-list .sec-title { margin-bottom: clamp(32px, 4vw, 48px); }
.sec-lede { max-width: 40em; font-size: 18px; color: var(--slate); }

/* Feature grid and article cards */
.grid {
  display: grid; gap: 16px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr));
  margin: 0; padding: 0; list-style: none;
}
.card {
  height: 100%; padding: 28px;
  background: var(--canvas); border: 1px solid var(--line-2); border-radius: var(--r-lg);
}
.card-title { font-size: 23px; letter-spacing: -.015em; line-height: 1.2; margin-bottom: 10px; }
.card p { color: var(--slate); }
.card--article { transition: border-color .2s var(--ease), transform .2s var(--ease); }
.card--article:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.card--article a { text-decoration: none; }
.card--article a:hover { color: var(--blue); }
.card .meta { margin-top: 18px; font-size: 13.5px; color: var(--slate-2); }

/* Steps: an ordered row, numbered quietly */
.steps-list {
  display: grid; gap: 0 clamp(24px, 4vw, 56px);
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  margin: 0; padding: 0; list-style: none; counter-reset: step;
}
.step { counter-increment: step; padding: 24px 0 8px; border-top: 1px solid var(--ink); }
.step::before {
  content: counter(step);
  display: block; margin-bottom: 18px;
  font: 600 13px/1 var(--sans); letter-spacing: .08em; color: var(--blue);
}
.step p { color: var(--slate); }

/* FAQ */
.faq-inner { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 7fr); gap: clamp(40px, 6vw, 96px); }
.faq-list { border-top: 1px solid var(--ink); }
.faq-list details { border-bottom: 1px solid var(--line); }
.faq-list summary {
  position: relative; padding: 22px 40px 22px 0;
  list-style: none; cursor: pointer;
  font: 500 clamp(19px, 1.8vw, 22px)/1.3 var(--serif); letter-spacing: -.01em;
}
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after {
  content: ""; position: absolute; right: 6px; top: 50%;
  width: 11px; height: 11px; margin-top: -8px;
  border-right: 1.5px solid var(--slate); border-bottom: 1.5px solid var(--slate);
  transform: rotate(45deg); transition: transform .3s var(--ease);
}
.faq-list details[open] summary::after { transform: rotate(225deg); margin-top: -2px; }
.faq-list .answer { padding: 0 40px 24px 0; font-size: 16.5px; color: var(--slate); }
.faq-list .answer p { margin-bottom: 12px; }

/* Closing band: a warm bookend that answers the hero */
.band {
  position: relative; isolation: isolate; overflow: hidden;
  padding: clamp(96px, 12vw, 168px) 0; text-align: center;
  background: linear-gradient(180deg, var(--canvas) 0%, var(--warm) 55%, var(--warm-2) 100%);
}
.band::before {
  content: ""; position: absolute; inset: auto 0 0; height: 90%; z-index: -1;
  background:
    radial-gradient(46% 60% at 50% 100%, rgba(245, 178, 74, .2), transparent 70%),
    radial-gradient(36% 46% at 72% 100%, rgba(143, 189, 227, .24), transparent 70%);
}
.band-inner { display: flex; flex-direction: column; align-items: center; }
.band-title { max-width: 12em; margin-bottom: 22px; font-size: clamp(38px, 5.6vw, 68px); }
.band-text { max-width: 34em; margin-bottom: 34px; font-size: 19px; color: var(--slate); }
.band .cta-row { margin-top: 12px; }

/* Page and article headers */
.page-head {
  padding: clamp(56px, 8vw, 112px) 0 clamp(48px, 6vw, 80px);
  background: linear-gradient(180deg, var(--warm) 0%, var(--canvas) 100%);
}
.page-title { font-size: clamp(44px, 6.4vw, 84px); letter-spacing: -.034em; line-height: 1; }
.page-cta { padding-bottom: var(--section); }

.article { padding-bottom: var(--section); }
.article-head {
  padding: clamp(56px, 8vw, 112px) 0 clamp(40px, 5vw, 64px);
  background: linear-gradient(180deg, var(--warm) 0%, var(--canvas) 100%);
}
.article-title { font-size: clamp(42px, 6vw, 76px); letter-spacing: -.034em; line-height: 1; margin-bottom: 28px; }
.standfirst {
  max-width: 40em; padding-left: 20px; border-left: 3px solid var(--amber);
  font-size: clamp(18px, 1.7vw, 21px); line-height: 1.6; color: var(--ink-2);
}
.article .meta { display: flex; flex-wrap: wrap; gap: 4px 0; margin-top: 24px; font-size: 14px; color: var(--slate-2); }
.article .meta span + span::before { content: "\00B7"; margin: 0 10px; }
.article-cta { margin-top: 48px; }

/* Prose: Markdown bodies */
.prose { max-width: 680px; font-size: 18px; line-height: 1.7; color: var(--ink-2); }
.prose > :first-child { margin-top: 0; }
.prose h2 { margin: 56px 0 18px; font-size: clamp(28px, 3vw, 38px); }
.prose h3 { margin: 32px 0 8px; font-size: 23px; letter-spacing: -.01em; }
.prose p, .prose ul, .prose ol, .prose table, .prose pre, .prose blockquote, .prose figure { margin: 0 0 20px; }
.prose ul, .prose ol { padding-left: 1.3em; }
.prose li + li { margin-top: 6px; }
.prose a { color: var(--blue); text-underline-offset: 3px; }
.prose a:hover { color: var(--ink); }
.prose strong { font-weight: 600; color: var(--ink); }
.prose img { border-radius: var(--r); }
.prose blockquote { padding-left: 20px; border-left: 3px solid var(--line-strong); color: var(--slate); }
.prose code { padding: 2px 6px; border-radius: var(--r-sm); background: var(--surface); border: 1px solid var(--line-2); font: .86em var(--mono); }
.prose pre { padding: 18px 20px; overflow-x: auto; border-radius: var(--r); background: var(--surface); border: 1px solid var(--line); line-height: 1.5; }
.prose pre code { padding: 0; border: 0; background: none; font-size: 14.5px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 16px; }
.prose th, .prose td { padding: 10px 12px 10px 0; border-bottom: 1px solid var(--line); text-align: left; }
.prose th { font-weight: 600; color: var(--ink); border-bottom-color: var(--ink); }
.prose-sec .prose { font-size: 18px; }
.sec--body .prose { color: var(--slate); }

/* 404 */
.notfound { display: flex; align-items: center; min-height: 64vh; padding: var(--section) 0; }
.notfound .page-title { margin-bottom: 20px; }
.notfound p { max-width: 32em; margin-bottom: 28px; font-size: 18px; color: var(--slate); }

/* Footer: warm, like the closing band above it */
.site-footer { padding: 48px 0 40px; background: var(--warm-2); border-top: 1px solid rgba(122, 74, 0, .1); font-size: 14.5px; }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 32px; }
.footer-name { font: 500 20px/1.2 var(--serif); letter-spacing: -.015em; }
.footer-links { display: flex; flex-wrap: wrap; gap: 8px 24px; margin: 0; padding: 0; list-style: none; }
.footer-links a { color: var(--slate); text-decoration: none; }
.footer-links a:hover { color: var(--ink); }

/* Narrow screens */
@media (max-width: 860px) {
  .hero--media .hero-inner, .faq-inner { grid-template-columns: minmax(0, 1fr); }
  .faq-inner { gap: 24px; }
  .header-inner { min-height: 60px; gap: 16px; }
  .brand { font-size: 19px; }
  .nav ul { gap: 20px; }
}

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