/*
  Ruji Labs "Cobalt" system for the static pages (pricing, templates, services,
  work, contact, policies, 404). The React home page mirrors these tokens in
  tailwind.config.js. Tokens are named by role, not by colour.
  Spec: docs/superpowers/specs/2026-09-28-cobalt-redesign.md
*/

:root {
  --ground: #1D3FD1;        /* cobalt page */
  --ground-2: #1A38BD;      /* a band one step deeper */
  --surface: #142C9C;       /* cards and panels */
  --text: #FFFFFF;
  --text-soft: #C3D0F8;     /* haze, AA on cobalt */
  --accent: #FACC15;        /* sun: focus, link hover, the one highlight */
  --sky: #B4C5F7;
  --sun: #FACC15;
  --on-light: #142C9C;      /* text on white or sun */
  --rule: rgba(255, 255, 255, 0.2);
  --rule-strong: rgba(255, 255, 255, 0.42);
  --on-close: #0E1E6B;      /* the closing block is sun yellow */
  --on-close-soft: rgba(14, 30, 107, 0.78);
  --on-close-rule: rgba(14, 30, 107, 0.2);

  --gutter: clamp(16px, 4vw, 48px);
  --max: 1240px;
  --max-text: 760px;
  --ease: cubic-bezier(.2, .7, .2, 1);
  --body: 'Figtree', 'Helvetica Neue', Arial, sans-serif;
  --display: 'Big Shoulders Display', Impact, 'Arial Narrow', sans-serif;
  --serif: 'Newsreader', Georgia, 'Times New Roman', serif;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--ground);
  color: var(--text);
  font-family: var(--body);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--sun); color: var(--on-light); }
h1, h2, h3, h4 { text-wrap: balance; margin: 0; }
p { margin: 0; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 12px; top: -60px; z-index: 100; padding: 10px 16px; border-radius: 999px; background: var(--text); color: var(--on-light); text-decoration: none; }
.skip:focus { top: 12px; }

/* ---------- Layout ---------- */
.wrap { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.wrap-text { max-width: var(--max-text); margin: 0 auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(64px, 10vw, 136px); }
.section + .section { padding-top: 0; }
.page-head + .section { padding-top: clamp(8px, 2vw, 24px); }
.stack { display: grid; gap: 20px; }
.split { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(24px, 6vw, 96px); align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

/* ---------- Type ---------- */
.display {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(72px, 13vw, 220px); line-height: .82; letter-spacing: -0.005em;
}
.h1 {
  font-family: var(--display); font-weight: 900;
  font-size: clamp(56px, 8.4vw, 136px); line-height: .86; letter-spacing: -0.005em;
}
.h2 {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(40px, 5.2vw, 76px); line-height: .92; letter-spacing: 0;
}
.h3 { font-family: var(--display); font-weight: 800; font-size: clamp(26px, 2.2vw, 32px); line-height: 1; letter-spacing: 0.005em; }
.lead { font-size: clamp(18px, 1.6vw, 22px); line-height: 1.5; color: var(--text-soft); max-width: 60ch; }
.muted { color: var(--text-soft); }
.small { font-size: 14px; }
.serif { font-family: var(--serif); font-style: italic; font-weight: 400; letter-spacing: 0; }
.num { font-variant-numeric: tabular-nums; }

/* ---------- Nav ---------- */
.nav {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 50;
  background: rgba(29, 63, 209, .82);
  -webkit-backdrop-filter: saturate(1.4) blur(14px); backdrop-filter: saturate(1.4) blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color .3s;
}
.nav.scrolled { border-bottom-color: var(--rule); }
.nav-inner { max-width: var(--max); margin: 0 auto; padding: 18px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: -0.01em; text-decoration: none; color: var(--text); }
.brand:hover { color: var(--text); }
.brand svg { width: 30px; height: 30px; flex: none; padding: 3px; border-radius: 9px; background: #fff; }
.nav-links { display: flex; gap: clamp(14px, 2.4vw, 32px); list-style: none; margin: 0; padding: 0; font-size: 15px; }
.nav-links a { text-decoration: none; color: var(--text-soft); }
.nav-links a:hover, .nav-links a[aria-current="page"] { color: var(--text); }
.nav-links a[aria-current="page"] { text-decoration: underline; text-decoration-color: var(--sun); text-decoration-thickness: 3px; text-underline-offset: 7px; }
.nav-menu { display: none; position: relative; }
.nav-menu summary { list-style: none; cursor: pointer; font-size: 15px; padding: 8px 14px; border: 1px solid var(--rule-strong); border-radius: 999px; }
.nav-menu summary::-webkit-details-marker { display: none; }
.nav-menu[open] summary { background: var(--text); color: var(--on-light); border-color: var(--text); }
.nav-menu ul { position: absolute; right: 0; top: calc(100% + 10px); min-width: 220px; margin: 0; padding: 8px; list-style: none; background: var(--surface); border: 1px solid var(--rule); border-radius: 16px; box-shadow: 0 24px 48px -24px rgba(15, 27, 51, .35); }
.nav-menu ul a { display: block; padding: 10px 12px; border-radius: 10px; text-decoration: none; }
.nav-menu ul a:hover { background: var(--ground); color: var(--text); }
@media (max-width: 760px) { .nav-links { display: none; } .nav-menu { display: block; } }

/* ---------- Page head ---------- */
.page-head { position: relative; overflow: hidden; display: flex; align-items: flex-end; min-height: clamp(480px, 74vh, 800px); padding-block: clamp(96px, 12vw, 160px) clamp(48px, 7vw, 96px); isolation: isolate; }
.page-head > canvas[data-terrain] { position: absolute; inset: 0; width: 100%; height: 100%; z-index: -1; display: block; }
.page-head::after { content: ''; position: absolute; inset: auto 0 0 0; height: 55%; z-index: -1; pointer-events: none; background: linear-gradient(to bottom, rgba(29, 63, 209, 0), var(--ground) 92%); }
.page-head > .wrap { width: 100%; }
.page-head.compact { min-height: clamp(360px, 50vh, 540px); }
.page-head h1 { max-width: 14ch; }
.page-head .wrap { display: grid; grid-template-columns: 1fr; gap: clamp(24px, 5vw, 72px); align-items: end; }
.page-head.no-art .wrap { grid-template-columns: 1fr; }
.page-head .copy { display: grid; gap: 24px; }
.page-head .kicker { font-family: var(--serif); font-style: italic; font-size: clamp(22px, 2vw, 30px); color: var(--text); }
.page-head .art { border-radius: 24px; overflow: hidden; aspect-ratio: 4 / 3; background: var(--ground-2); }
.page-head .art img { width: 100%; height: 100%; object-fit: cover; }
.page-head .actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 8px; }
@media (max-width: 860px) { .page-head .wrap { grid-template-columns: 1fr; } .page-head .art { max-width: 520px; } }
@media (prefers-reduced-motion: no-preference) {
  .page-head .copy > * { animation: rise .9s var(--ease) both; }
  .page-head .copy > *:nth-child(2) { animation-delay: .08s; }
  .page-head .copy > *:nth-child(3) { animation-delay: .16s; }
  .page-head .copy > *:nth-child(4) { animation-delay: .24s; }
  .page-head .art { animation: settle 1.2s var(--ease) .1s both; }
}
@keyframes rise { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
@keyframes settle { from { opacity: 0; transform: scale(.97); } to { opacity: 1; transform: none; } }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 13px 22px; border-radius: 999px; border: 1px solid var(--text);
  background: var(--text); color: var(--on-light);
  font: 600 15px/1 var(--body); text-decoration: none; cursor: pointer;
  transition: background .25s, border-color .25s, color .25s, transform .25s var(--ease);
}
.btn:hover { background: var(--sun); border-color: var(--sun); color: var(--on-light); }
.btn:active { transform: scale(.98); }
.btn.ghost { background: transparent; color: var(--text); border-color: var(--rule-strong); }
.btn.ghost:hover { border-color: var(--text); color: var(--text); background: transparent; }
.on-ink .btn { background: var(--on-close); color: #fff; border-color: var(--on-close); }
.on-ink .btn:hover { background: #fff; border-color: #fff; color: var(--on-close); }
.on-ink .btn.ghost { background: transparent; color: var(--on-close); border-color: var(--on-close-rule); }
.on-ink .btn.ghost:hover { border-color: var(--on-close); }

/* ---------- Rows (lists, steps, FAQ) ---------- */
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--rule); }
.rows > li { border-bottom: 1px solid var(--rule); }
.row { display: grid; grid-template-columns: minmax(160px, 1fr) 2fr auto; gap: 24px; align-items: baseline; padding: 24px 0; text-decoration: none; color: inherit; transition: padding .35s var(--ease); }
a.row:hover { padding-left: 16px; color: inherit; }
.row .name { font-family: var(--display); font-weight: 800; font-size: clamp(34px, 4vw, 56px); line-height: .95; }
.row .what { color: var(--text-soft); }
.row .meta { font-size: 14px; color: var(--text-soft); font-variant-numeric: tabular-nums; }
@media (max-width: 720px) { .row { grid-template-columns: 1fr auto; } .row .what { grid-column: 1 / -1; } }

/* Numbered steps: only for a real sequence. */
.steps { list-style: none; margin: 0; padding: 0; counter-reset: step; display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(20px, 3vw, 40px); }
.steps li { counter-increment: step; display: grid; gap: 10px; align-content: start; padding-top: 20px; border-top: 2px solid var(--text); }
.steps li::before { content: counter(step); font-family: var(--serif); font-style: italic; font-size: 28px; line-height: 1; color: var(--text-soft); }
@media (max-width: 860px) { .steps { grid-template-columns: 1fr; } }

/* FAQ with native <details>. */
.faq details { border-bottom: 1px solid var(--rule); }
.faq { border-top: 1px solid var(--rule); }
.faq summary { list-style: none; cursor: pointer; display: flex; justify-content: space-between; gap: 24px; align-items: baseline; padding: 22px 0; font-weight: 700; font-size: clamp(18px, 1.6vw, 22px); letter-spacing: -0.01em; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: '+'; font-weight: 400; font-size: 26px; line-height: 1; color: var(--text-soft); transition: transform .3s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details > div { padding: 0 0 24px; color: var(--text-soft); max-width: 68ch; display: grid; gap: 12px; }

/* ---------- Panels, tiers, facts ---------- */
.panel { background: var(--surface); border: 1px solid var(--rule); border-radius: 22px; padding: clamp(22px, 3vw, 36px); }
.tiers { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; align-items: stretch; }
@media (max-width: 960px) { .tiers { grid-template-columns: 1fr; } }
.tier { display: grid; grid-template-rows: auto auto auto 1fr auto; gap: 16px; }
.tier.featured { background: var(--text); color: var(--on-light); border-color: var(--text); }
.tier.featured .muted, .tier.featured li { color: rgba(20, 44, 156, .78); }
.tier.featured .btn { background: var(--on-light); color: #fff; border-color: var(--on-light); }
.tier.featured .btn:hover { background: var(--sun); color: var(--on-light); border-color: var(--sun); }
.tier .price { font-family: var(--display); font-weight: 800; font-size: clamp(52px, 5.4vw, 76px); line-height: .9; font-variant-numeric: tabular-nums; }
.tier .price .from { font-family: var(--serif); font-style: italic; font-weight: 400; font-size: .4em; letter-spacing: 0; margin-right: 6px; }
.tier ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 10px; font-size: 15px; }
.tier li { display: grid; grid-template-columns: 16px 1fr; gap: 10px; color: var(--text-soft); }
.tier li::before { content: ''; width: 7px; height: 7px; margin-top: 8px; border-radius: 50%; background: var(--sky); }
.tier.featured li::before { background: var(--on-light); }
.pill { justify-self: start; display: inline-block; padding: 4px 11px; border-radius: 999px; font-size: 13px; font-weight: 600; background: var(--sun); color: var(--on-light); }
.pill.quiet { background: var(--ground-2); color: var(--text-soft); }
.facts { display: flex; flex-wrap: wrap; gap: clamp(24px, 5vw, 64px); }
.facts > div { display: grid; gap: 4px; }
.facts b { font-family: var(--display); font-weight: 800; font-size: clamp(48px, 5vw, 72px); line-height: .9; font-variant-numeric: tabular-nums; }
.facts span { font-size: 14px; color: var(--text-soft); max-width: 22ch; }
.grid-2 { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 860px) { .grid-2, .grid-3 { grid-template-columns: 1fr; } }
.quote { font-family: var(--serif); font-style: italic; font-size: clamp(24px, 2.6vw, 34px); line-height: 1.3; max-width: 34ch; }

/* ---------- Long-form policy text ---------- */
.prose { max-width: 68ch; display: grid; gap: 16px; color: var(--text); }
.prose h2 { font-family: var(--display); font-weight: 800; font-size: clamp(28px, 2.6vw, 38px); line-height: 1; margin-top: 28px; }
.prose h3 { font-weight: 700; font-size: 18px; margin-top: 12px; }
.prose ul, .prose ol { margin: 0; padding-left: 22px; display: grid; gap: 8px; }
.prose table { width: 100%; border-collapse: collapse; font-size: 15px; }
.prose th, .prose td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--rule); vertical-align: top; }
.prose .table-scroll { overflow-x: auto; }
.prose .updated { font-size: 14px; color: var(--text-soft); }
.toc { position: sticky; top: 96px; display: grid; gap: 6px; font-size: 14px; }
.toc a { text-decoration: none; color: var(--text-soft); }
.toc a:hover { color: var(--text); }
.doc { display: grid; grid-template-columns: 220px 1fr; gap: clamp(24px, 5vw, 72px); align-items: start; }
@media (max-width: 900px) { .doc { grid-template-columns: 1fr; } .toc { position: static; } }

/* ---------- Contact close (every page) ---------- */
.close { background: var(--sun); color: var(--on-close); padding-block: clamp(72px, 11vw, 150px) 0; }
.close .wrap { display: grid; gap: 28px; }
.close .big { font-family: var(--display); font-weight: 900; font-size: clamp(72px, 13vw, 220px); line-height: .82; }
.close p { color: var(--on-close-soft); max-width: 52ch; }
.close .mail { font-family: var(--serif); font-style: italic; font-size: clamp(26px, 3vw, 40px); color: var(--on-close); text-decoration: none; justify-self: start; }
.close .mail:hover { color: #fff; }
.close .actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* ---------- Footer ---------- */
.foot { background: var(--sun); color: var(--on-close-soft); font-size: 14px; }
.foot .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 16px 32px; padding-block: 40px calc(40px + env(safe-area-inset-bottom, 0px)); }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 22px; }
.foot a { color: var(--on-close-soft); text-decoration: none; }
.foot a:hover { color: var(--on-close); }
.close + .foot .wrap { margin-top: clamp(56px, 8vw, 96px); border-top: 1px solid var(--on-close-rule); }

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

.foot { display: flow-root; }
.tier ul { align-content: start; }

/* ---------- Inline enquiry form (public/js/enquiry.js) ---------- */
.enq-form { display: flex; flex-direction: column; max-height: calc(100dvh - 32px); }
.enq-head { padding: 28px 64px 12px 28px; display: grid; gap: 6px; }
.enq-title { font-family: var(--display); font-weight: 800; font-size: 34px; line-height: 1; }
.enq-desc { color: var(--text-soft); font-size: 15px; }
.enq-body { padding: 8px 28px 16px; overflow-y: auto; display: grid; gap: 14px; min-height: 0; }
.enq-row { display: grid; gap: 6px; }
.enq-label { font-size: 14px; font-weight: 600; }
.enq-opt { font-weight: 400; color: var(--text-soft); }
.enq-body input:not([type="checkbox"]), .enq-body select, .enq-body textarea {
  width: 100%; font: 400 16px/1.4 var(--body); color: var(--text);
  background: var(--ground); border: 1px solid var(--rule-strong); border-radius: 12px; padding: 11px 13px;
}
.enq-body textarea { resize: vertical; }
.enq-body input:focus, .enq-body select:focus, .enq-body textarea:focus { outline: 2px solid var(--accent); outline-offset: 1px; border-color: transparent; }
.enq-foot { padding: 16px 28px 24px; border-top: 1px solid var(--rule); display: grid; gap: 10px; background: var(--surface); }
.enq-captcha { display: flex; justify-content: center; }
.enq-captcha:empty { display: none; }
.enq-error { color: #FFD7CF; font-size: 14px; }
.enq-error:empty { display: none; }
.enq-submit { width: 100%; }
.enq-submit:disabled { opacity: .6; cursor: progress; }
.enq-status, .enq-done { min-height: 280px; display: grid; place-content: center; gap: 8px; padding: 40px 28px; text-align: center; }
.enq-spin { width: 30px; height: 30px; border: 3px solid var(--rule); border-top-color: var(--text); border-radius: 50%; animation: enq-spin .8s linear infinite; }
@keyframes enq-spin { to { transform: rotate(360deg); } }

/* Case study deck (public/js/deck.js): horizontal stack, centred card forward. */
.deck { --cw: min(62vw, 860px, 72vh); margin-top: clamp(20px, 3vw, 32px); }
.deck-track { display: flex; overflow-x: auto; overscroll-behavior-x: contain; scroll-snap-type: x mandatory; padding-inline: calc(50% - var(--cw) / 2); padding-block: 24px 32px; scrollbar-width: none; outline: none; }
.deck-track::-webkit-scrollbar { display: none; }
.deck-card { flex: 0 0 var(--cw); margin: 0 calc(var(--cw) * -.07); scroll-snap-align: center; position: relative; border-radius: 14px; overflow: hidden; background: #eef2f4; border: 1px solid var(--rule); box-shadow: 0 30px 60px -28px rgba(8, 16, 60, .9); transform-origin: 50% 60%; cursor: pointer; will-change: transform, opacity; }
.deck-card[aria-current="true"] { box-shadow: 0 0 0 2px var(--accent), 0 36px 70px -26px rgba(8, 16, 60, .95); cursor: zoom-in; }
.deck-card img { display: block; width: 100%; aspect-ratio: 16 / 10.2; object-fit: contain; object-position: top center; background: #eef2f4; }
.deck-bar { display: flex; align-items: center; justify-content: center; gap: 18px; }
.deck-bar button { width: 46px; height: 46px; border-radius: 999px; border: 1px solid var(--rule-strong); background: transparent; color: var(--text); font: 600 18px/1 var(--body); cursor: pointer; }
.deck-bar button:hover { background: var(--accent); color: var(--on-close); border-color: var(--accent); }
.deck-bar button:focus-visible, .deck-track:focus-visible .deck-card[aria-current="true"] { outline: 2px solid var(--accent); outline-offset: 3px; }
.deck-bar button:disabled { opacity: .35; cursor: default; background: transparent; color: var(--text); border-color: var(--rule-strong); }
.deck-count { font-size: 14px; letter-spacing: .06em; color: var(--text-soft); font-variant-numeric: tabular-nums; min-width: 64px; text-align: center; }
.deck-count b { color: var(--text); font-weight: 600; }
.deck-detail { max-width: 1080px; margin: 24px auto 0; padding-inline: clamp(16px, 4vw, 48px); display: grid; gap: 16px; transition: opacity .25s ease; }
.deck-detail.out { opacity: 0; }
.deck-detail h3 { margin: 0; text-align: center; font-family: var(--display); font-weight: 800; font-size: clamp(28px, 3vw, 40px); line-height: 1; text-transform: uppercase; }
.deck-cols { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.deck-cols.one { grid-template-columns: 1fr; max-width: 640px; margin: 0 auto; text-align: center; }
.deck-cell { padding: 18px 20px; border: 1px solid var(--rule); border-radius: 16px; background: var(--surface); display: grid; gap: 8px; align-content: start; }
.deck-cell b { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-soft); font-weight: 600; }
.deck-cell.sol { border-color: var(--accent); }
.deck-cell.sol b { color: var(--accent); }
.deck-cell p { margin: 0; font-size: 15px; line-height: 1.55; color: var(--text); }
.deck-lb { border: 0; padding: 0; background: transparent; max-width: min(1400px, 96vw); max-height: 94vh; }
.deck-lb::backdrop { background: rgba(14, 30, 107, .88); }
.deck-lb img { display: block; max-width: 100%; max-height: 84vh; border-radius: 12px; }
.deck-lb p { margin: 12px 2px 0; display: flex; justify-content: space-between; align-items: center; gap: 12px; color: #fff; font-size: 14px; }
.deck-lb button { color: #fff; background: transparent; border: 1px solid rgba(255, 255, 255, .42); border-radius: 999px; padding: 9px 14px; cursor: pointer; font: inherit; }
@media (max-width: 860px) {
  .deck { --cw: 84vw; }
  .deck-card { margin: 0 calc(var(--cw) * -.04); }
  .deck-cols { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { .deck-detail { transition: none; } }
/* The deck's source list: what crawlers and no-JS readers get. deck.js hides it once the deck is built. */
.deck-list { list-style: none; margin: 0 auto; padding: 0 var(--gutter); max-width: var(--max); display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 340px), 1fr)); gap: 28px; }
.deck-item { display: grid; gap: 10px; align-content: start; }
.deck-item figure { margin: 0; border-radius: 12px; overflow: hidden; background: #eef2f4; }
.deck-item img { display: block; width: 100%; height: auto; }
.deck-item h3 { margin: 0; font-family: var(--display); font-weight: 800; font-size: 26px; line-height: 1.05; text-transform: uppercase; }
.deck-item dl { margin: 0; display: grid; gap: 8px; }
.deck-item dt { font-size: 12px; letter-spacing: .14em; text-transform: uppercase; color: var(--text-soft); }
.deck-item dd { margin: 0; font-size: 15px; line-height: 1.5; }
.js .deck-list { display: none; }
