/* Spikeward marketing site
   Palette: instrument paper, navy ink, raspberry for the spike, teal for the ward. */
:root {
  --paper: #F3F6F8;
  --panel: #FFFFFF;
  --ink: #13233A;
  --muted: #56677A;
  --grid: #DCE3EA;
  --rule: #C9D3DD;
  --spike: #C9305A;
  --ward: #0F7A73;
  --ward-soft: #DCEFEC;
  --spike-soft: #F8E2E8;
  --amber: #9A5B00;
  --amber-soft: #FBEBD2;

  --font: "Schibsted Grotesk", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;

  --step--1: 0.875rem;
  --step-0: 1.0625rem;
  --step-1: 1.3125rem;
  --step-2: 1.75rem;
  --step-3: clamp(2rem, 3.2vw + 1rem, 2.75rem);
  --step-4: clamp(2.4rem, 4.6vw + 1rem, 4.25rem);

  --gutter: clamp(16px, 4vw, 40px);
  --max: 1160px;
  --radius-s: 4px;
  --radius-m: 10px;
}

@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0D1624;
    --panel: #142034;
    --ink: #E4EBF2;
    --muted: #9AAABB;
    --grid: #1D2B40;
    --rule: #2A3B54;
    --spike: #FF6F92;
    --ward: #3DC4B7;
    --ward-soft: #133A3A;
    --spike-soft: #3A1A27;
    --amber: #F2B55C;
    --amber-soft: #3A2A12;
  }
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font);
  font-size: var(--step-0);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--ward); }
:focus-visible { outline: 3px solid var(--ward); outline-offset: 3px; border-radius: 2px; }
code { font-family: var(--mono); font-size: 0.9em; }

h1, h2, h3 { margin: 0; line-height: 1.12; letter-spacing: -0.015em; }
h1 { font-size: var(--step-4); font-weight: 800; letter-spacing: -0.03em; max-width: 18ch; }
h2 { font-size: var(--step-3); font-weight: 700; max-width: 22ch; }
h3 { font-size: var(--step-1); font-weight: 600; }
p { margin: 0 0 1em; max-width: 64ch; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.skip { position: absolute; left: -999px; top: 8px; background: var(--ink); color: var(--paper); padding: 8px 12px; z-index: 10; }
.skip:focus { left: 8px; }

/* Header */
.top { border-bottom: 1px solid var(--rule); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.top-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; font-size: 1.2rem; text-decoration: none; letter-spacing: -0.02em; }
.brand-mark { width: 30px; height: 30px; color: var(--spike); }
.nav { display: flex; gap: 22px; font-size: var(--step--1); font-weight: 500; }
.nav a { text-decoration: none; color: var(--muted); }
.nav a:hover { color: var(--ink); }
.nav .nav-gh { color: var(--ink); }
@media (max-width: 760px) {
  .nav a:not(.nav-gh) { display: none; }
}

/* Hero */
.hero { padding: clamp(48px, 8vw, 96px) 0 0; }
.status { display: inline-flex; align-items: center; gap: 8px; font-size: var(--step--1); color: var(--muted); margin-bottom: 28px; }
.status-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--amber); }
.lede { font-size: var(--step-1); line-height: 1.5; color: var(--muted); margin-top: 24px; max-width: 56ch; }
.cta-row { display: flex; flex-wrap: wrap; align-items: center; gap: 14px 22px; margin-top: 32px; }
.deploy { display: inline-block; border-radius: var(--radius-s); }
.deploy img { height: 40px; width: auto; }
.btn-secondary {
  display: inline-flex; align-items: center; min-height: 40px; padding: 0 16px;
  border: 1.5px solid var(--ink); border-radius: var(--radius-s);
  font-weight: 600; font-size: var(--step--1); text-decoration: none;
}
.btn-secondary:hover { background: var(--ink); color: var(--paper); }

/* The spike chart: the one bold thing on the page */
.spike { margin: clamp(40px, 6vw, 72px) 0 0; }
.chart { position: relative; }
.spike-svg {
  width: 100%; height: clamp(220px, 30vw, 360px);
  border-top: 1px solid var(--rule); border-bottom: 2px solid var(--ink);
}
.trace { fill: none; stroke: var(--spike); stroke-width: 2.5; vector-effect: non-scaling-stroke; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: 0; }
.trace-fill { fill: url(#spikeFill); }
.trigger { stroke: var(--muted); stroke-width: 1; stroke-dasharray: 6 6; vector-effect: non-scaling-stroke; }
.judge-band { fill: var(--spike-soft); }
.ward { stroke: var(--ward); stroke-width: 3; vector-effect: non-scaling-stroke; }
.peak { fill: var(--paper); stroke: var(--spike); stroke-width: 2.5; vector-effect: non-scaling-stroke; }

.spike-notes { list-style: none; margin: 0; padding: 0; }
.note { position: absolute; top: 14px; font-size: var(--step--1); font-weight: 600; line-height: 1.3; max-width: 22ch; }
.note-trigger { right: calc(100% - var(--x)); text-align: right; color: var(--spike); padding-right: 14px; }
.note-ward { left: calc(var(--x) + 1.5%); color: var(--ward); }
.spike-cap { font-size: var(--step--1); color: var(--muted); margin-top: 14px; max-width: 72ch; }

@media (max-width: 700px) {
  .note { position: static; max-width: none; padding: 0; text-align: left; }
  .spike-notes { display: grid; gap: 4px; margin-top: 14px; }
}

/* Load sequence: draw the trace, then drop the ward */
@media (prefers-reduced-motion: no-preference) {
  .js .trace { animation: draw 2.4s cubic-bezier(.45,.05,.3,1) .2s both; }
  .js .trace-fill { animation: fade .8s ease 2.2s both; }
  .js .judge-band { animation: fade .5s ease 1.3s both; }
  .js .ward { animation: drop .45s cubic-bezier(.2,.8,.2,1) 1.5s both; transform-origin: 660px 0; }
  .js .peak { animation: fade .3s ease 1.4s both; }
  .js .note-trigger { animation: fade .4s ease 1.2s both; }
  .js .note-ward { animation: fade .4s ease 1.8s both; }
}
@keyframes draw { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes drop { from { transform: scaleY(0); } to { transform: scaleY(1); } }

/* Sections */
.section { padding: clamp(64px, 9vw, 120px) 0 0; }
.section h2 + p, .section h2 + .section-lede { margin-top: 20px; }
.section-lede { color: var(--muted); font-size: var(--step-1); line-height: 1.5; max-width: 60ch; }

.idea-grid, .decision-grid, .cost-grid, .two-col {
  display: grid; gap: clamp(32px, 5vw, 72px); align-items: start;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
}
.two-col h2 { font-size: var(--step-2); }
@media (max-width: 860px) {
  .idea-grid, .decision-grid, .cost-grid, .two-col { grid-template-columns: 1fr; }
}

/* Funnel */
.funnel { padding-top: 8px; }
.funnel-row {
  width: var(--w); min-width: 190px; border-left: 3px solid var(--spike);
  background: var(--spike-soft); padding: 10px 14px; margin-bottom: 6px;
  display: flex; flex-direction: column;
}
.funnel-row strong { font-size: var(--step-1); }
.funnel-row span { font-size: var(--step--1); color: var(--muted); }
.funnel-last { border-left-color: var(--ward); background: var(--ward-soft); }
.funnel-foot { margin-top: 16px; font-weight: 600; color: var(--ward); }

/* Pipeline */
.pipeline {
  list-style: none; counter-reset: step; margin: 48px 0 0; padding: 0;
  display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  border-top: 2px solid var(--ink);
}
.pipeline li { counter-increment: step; padding: 20px 20px 28px 0; border-bottom: 1px solid var(--rule); }
.pipeline li::before {
  content: counter(step); display: block; font-size: var(--step-2); font-weight: 800;
  color: var(--rule); margin-bottom: 8px; font-variant-numeric: tabular-nums;
}
.pipeline li:nth-child(6)::before { color: var(--spike); }
.pipeline li:nth-child(7)::before { color: var(--ward); }
.pipeline h3 { margin-bottom: 8px; }
.pipeline p { font-size: var(--step--1); color: var(--muted); margin: 0; max-width: 36ch; }

/* Decision card */
.decision {
  background: var(--panel); border: 1px solid var(--rule); border-radius: var(--radius-m);
  padding: 22px 24px; box-shadow: 0 1px 0 var(--rule), 0 18px 40px -28px rgba(19,35,58,.45);
}
.decision-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; flex-wrap: wrap; padding-bottom: 16px; border-bottom: 1px solid var(--rule); }
.decision-key { font-family: var(--mono); font-weight: 500; margin: 0; }
.decision-meta { font-size: var(--step--1); color: var(--muted); margin: 2px 0 0; }
.answers { margin: 16px 0; display: grid; gap: 10px; }
.answers div { display: grid; grid-template-columns: 90px 1fr; align-items: center; gap: 12px; }
.answers dt { font-size: var(--step--1); color: var(--muted); }
.answers dd { margin: 0; display: flex; align-items: center; gap: 10px; font-weight: 600; font-variant-numeric: tabular-nums; }
.bar { flex: 1; height: 8px; border-radius: 4px; background: var(--grid); position: relative; overflow: hidden; }
.bar::after { content: ""; position: absolute; inset: 0 auto 0 0; width: calc(var(--v) * 100%); background: var(--spike); border-radius: 4px; }
.decision-why { font-size: var(--step--1); color: var(--muted); margin: 0 0 16px; }
.decision-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: var(--step--1); padding-top: 14px; border-top: 1px solid var(--rule); color: var(--muted); }
.decision-actions { display: flex; gap: 16px; }
.linkish { background: none; border: 0; padding: 4px 0; font: inherit; font-weight: 600; color: var(--ward); cursor: pointer; text-decoration: underline; text-underline-offset: 3px; }
.decision-toast { margin: 12px 0 0; font-size: var(--step--1); font-weight: 600; color: var(--ward); min-height: 1.5em; }

.pill { display: inline-block; font-size: 0.8125rem; font-weight: 600; padding: 3px 9px; border-radius: 999px; white-space: nowrap; }
.pill-block { background: var(--spike-soft); color: var(--spike); }
.pill-challenge { background: var(--amber-soft); color: var(--amber); }
.pill-rate { background: var(--ward-soft); color: var(--ward); }

/* Tables */
.table-scroll { overflow-x: auto; margin-top: 40px; }
table { width: 100%; border-collapse: collapse; font-size: var(--step--1); min-width: 560px; }
thead th { text-align: left; font-weight: 600; color: var(--muted); padding: 0 16px 10px 0; border-bottom: 2px solid var(--ink); }
tbody th { text-align: left; font-weight: 600; }
tbody th, tbody td { padding: 14px 16px 14px 0; border-bottom: 1px solid var(--rule); vertical-align: top; }
.plans .yes { color: var(--ward); font-weight: 600; }
.plans .no { color: var(--muted); }
.fine { font-size: var(--step--1); color: var(--muted); margin-top: 16px; }

/* Rails */
.rails-title { margin-top: 64px; }
.rails { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 0 48px; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.rails li { padding: 14px 0 14px 18px; border-left: 3px solid var(--ward); margin-bottom: 14px; font-size: var(--step--1); color: var(--muted); }
.rails strong { color: var(--ink); display: block; font-size: var(--step-0); }

/* Setup steps */
.steps { margin: 36px 0 0; padding: 0 0 0 1.4em; display: grid; gap: 12px; max-width: 70ch; }
.steps li { padding-left: 6px; }
.steps li::marker { font-weight: 800; color: var(--ward); }

/* Cost */
.costs { margin: 0; border-top: 2px solid var(--ink); }
.costs div { display: flex; justify-content: space-between; gap: 16px; padding: 14px 0; border-bottom: 1px solid var(--rule); }
.costs dt { color: var(--muted); }
.costs dd { margin: 0; font-weight: 700; }

/* FAQ */
.faq-wrap > * { max-width: 820px; }
.faq-wrap h2 { margin-bottom: 28px; }
details { border-top: 1px solid var(--rule); }
details:last-of-type { border-bottom: 1px solid var(--rule); }
summary { cursor: pointer; padding: 18px 32px 18px 0; font-weight: 600; list-style: none; position: relative; }
summary::-webkit-details-marker { display: none; }
summary::after { content: "+"; position: absolute; right: 4px; top: 14px; font-size: 1.4rem; font-weight: 400; color: var(--muted); }
details[open] summary::after { content: "\2212"; }
details p { color: var(--muted); padding-bottom: 8px; }

/* Closing and footer */
.closing { padding-bottom: clamp(64px, 9vw, 120px); }
.closing .wrap { border-top: 2px solid var(--ink); padding-top: 48px; }
.foot { border-top: 1px solid var(--rule); padding: 28px 0 40px; font-size: var(--step--1); color: var(--muted); }
.foot-inner { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; }
.foot-inner p { margin: 0; }
.foot-inner a { margin-left: 16px; }
.foot-inner a:first-child { margin-left: 0; }
