/* ============================================================
   Shippington — site.css
   Light editorial system over Oat (oat.min.css).
   Palette: harbor paper / ink navy / deep teal accent.
   Type: Lora (display) · Source Sans 3 (body) · IBM Plex Mono (labels).
   Oat's tokens live in @layer, so these unlayered overrides win.
   ============================================================ */

/* Gilroy-ExtraBold: retained for the wordmark only (licensed via MyFonts). */
@font-face {
  font-family: 'Gilroy-ExtraBold';
  src: url('../webfonts/39D6E3_1_0.woff2') format('woff2');
  font-display: swap;
}

/* Self-hosted variable fonts, latin subset. One file per family. */
@font-face {
  font-family: 'Lora';
  src: url('../webfonts/Lora.woff2') format('woff2-variations');
  font-weight: 400 700;
  font-display: swap;
}
@font-face {
  font-family: 'Source Sans 3';
  src: url('../webfonts/SourceSans3.woff2') format('woff2-variations');
  font-weight: 200 900;
  font-display: swap;
}
@font-face {
  font-family: 'IBM Plex Mono';
  src: url('../webfonts/IBMPlexMono.woff2') format('woff2');
  font-weight: 400;
  font-display: swap;
}

:root {
  /* Oat's whole theme resolves off color-scheme via light-dark().
     Freeing this to "light dark" lets its untouched tokens follow the OS. */
  color-scheme: light dark;

  /* Brand tokens — light (the base definition) */
  --paper:  #FBFAF7;   /* warm-neutral white, not cream */
  --ink:    #17242F;   /* deep harbor navy */
  --slate:  #55636E;   /* secondary text */
  --signal: #0F7268;   /* the one accent: deep harbor teal, CTA + emphasis */
  --wash:   #F2F1EB;   /* quiet section wash */
  --line:   #E1DFD5;   /* hairline */

  /* Theme-dependent effects, overridden in dark below */
  --header-alpha: 88%;
  --wheel-opacity: 0.05;
  --select-bg: var(--ink);
  --select-fg: var(--paper);

  /* Map onto Oat's theme */
  --background: var(--paper);
  --foreground: var(--ink);
  --card: var(--paper);
  --card-foreground: var(--ink);
  --primary: var(--signal);
  --primary-foreground: #fff;
  --secondary: var(--wash);
  --secondary-foreground: var(--ink);
  --muted: var(--wash);
  --muted-foreground: var(--slate);
  --faint: var(--wash);
  --accent: var(--wash);
  --border: var(--line);
  --input: var(--line);
  --ring: var(--signal);

  --font-sans: 'Source Sans 3', system-ui, -apple-system, sans-serif;
  --font-display: 'Lora', Georgia, serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, Menlo, monospace;

  --radius-medium: 4px;
  --radius-large: 6px;

  --wrap: 68rem;
}

/* ---------- dark theme ----------
   Harbor at night. Only the brand tokens change; everything downstream
   (including the currentColor logo) follows. Declared twice so an explicit
   toggle wins in both directions:
     · OS dark, unless the visitor chose light
     · explicit data-theme="dark"
*/
:root[data-theme="dark"]  { color-scheme: dark; }
:root[data-theme="light"] { color-scheme: light; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper:  #12181D;
    --ink:    #F2F0EA;
    --slate:  #9AA7B2;
    --signal: #35BFA8;   /* sea teal; the deep teal is unreadable on dark */
    --wash:   #1A2229;
    --line:   #2A343D;

    --primary-foreground: #12181D;  /* dark text on the lighter signal button */
    --header-alpha: 78%;            /* 88% + blur reads muddy on dark */
    --wheel-opacity: 0.07;          /* watermark would vanish otherwise */
    --select-bg: var(--signal);
    --select-fg: #12181D;
  }
}

:root[data-theme="dark"] {
  --paper:  #12181D;
  --ink:    #F2F0EA;
  --slate:  #9AA7B2;
  --signal: #35BFA8;
  --wash:   #1A2229;
  --line:   #2A343D;

  --primary-foreground: #12181D;
  --header-alpha: 78%;
  --wheel-opacity: 0.07;
  --select-bg: var(--signal);
  --select-fg: #12181D;
}

body {
  background: var(--paper);
  color: var(--ink);
  font-size: 1.075rem;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}

/* Serif headings; inline strong stays in the body sans. */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: -0.005em;
}
strong, b { font-weight: 600; }

::selection { background: var(--select-bg); color: var(--select-fg); }

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

/* ---------- manifest labels (the utility voice) ---------- */

/* Sentence case, not caps. Mono face + tracking carries the utility voice. */
.manifest {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--slate);
}

/* ---------- header ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) var(--header-alpha), transparent);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 1rem;
  padding: 1rem 2.5rem;
}
.logo {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  color: var(--ink);
  text-decoration: none;
}
.logo svg { display: block; width: 2.6rem; height: 2.6rem; }
.logo .wordmark {
  font-family: 'Gilroy-ExtraBold', var(--font-display);
  font-weight: normal;
  font-size: 1.1rem;
  letter-spacing: 0.02em;
}
.site-header .cta { margin-left: 0; }

/* Theme toggle: quiet, icon-only, pushed to the right of the bar. */
.theme-toggle {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  background: transparent;
  color: var(--slate);
  border: 1px solid var(--line);
  border-radius: var(--radius-full, 9999px);
  cursor: pointer;
}
.theme-toggle:hover { background: transparent; color: var(--ink); border-color: var(--ink); }
.theme-toggle svg { width: 1.05rem; height: 1.05rem; display: block; }
.theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: block; }
  :root[data-theme="light"] .theme-toggle .icon-sun { display: block; }
  :root[data-theme="light"] .theme-toggle .icon-moon { display: none; }
}

/* Rotating wheel: wordmark ring clockwise, rudder counter-clockwise, 20s. */
.logo svg .text   { transform-origin: center center; animation: logo-rotate 20s linear infinite; }
.logo svg .rudder { transform-origin: center center; animation: logo-reverse 20s linear infinite; }
@keyframes logo-rotate  { from { transform: rotate(0deg); }  to { transform: rotate(360deg); } }
@keyframes logo-reverse { from { transform: rotate(0deg); }  to { transform: rotate(-360deg); } }

/* ---------- buttons ---------- */

a.button, button {
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 0.95rem;
  letter-spacing: 0.01em;
  padding: 0rem 1rem;
  text-decoration: none;
  height: 2.5rem;
}
a.button.quiet {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
a.button.quiet:hover { border-color: var(--ink); background: transparent; }

/* ---------- hero ---------- */

main { padding-block-start: 0; }

.hero {
  border-top: none;
  position: relative;
  overflow: clip;
  padding-block: clamp(4.5rem, 11vw, 8.5rem) clamp(4rem, 9vw, 7rem);
  padding-top: 3rem;
}
.hero .manifest { margin-bottom: 1.75rem; }
.hero h1 {
  font-size: clamp(2.5rem, 6.4vw, 4.6rem);
  line-height: 1.04;
  letter-spacing: -0.02em;
  max-width: 20ch;
  margin-bottom: 1.75rem;
  text-wrap: balance;
}
.hero h1 .lt { font-weight: 400; }
.hero h1 .hl { color: var(--signal); }
.hero .lede {
  font-size: clamp(1.1rem, 1.8vw, 1.3rem);
  line-height: 1.55;
  color: var(--slate);
  max-width: 52ch;
  margin-bottom: 1rem;
}
.hero .customline {
  font-size: clamp(1.05rem, 1.6vw, 1.2rem);
  max-width: 52ch;
  margin-bottom: 1rem;
  padding-left: 1rem;
  border-left: 3px solid var(--signal);
}
.hero .customline:empty { display: none; }
.hero .actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.9rem;
  margin-block: 2.25rem 1.1rem;
}
.hero .assurance { color: var(--slate); font-size: 0.9rem; max-width: 52ch; }

/* Ambient wheel: oversized, faint, very slow — the quiet signature. */
.ambient-wheel {
  position: absolute;
  top: 50%;
  right: -12rem;
  width: 44rem;
  height: 44rem;
  translate: 0 -50%;
  color: var(--ink);
  opacity: var(--wheel-opacity);
  pointer-events: none;
  user-select: none;
}
.ambient-wheel svg { width: 100%; height: 100%; }
.ambient-wheel svg .text   { transform-origin: center center; animation: logo-rotate 90s linear infinite; }
.ambient-wheel svg .rudder { transform-origin: center center; animation: logo-reverse 90s linear infinite; }
@media (max-width: 900px) { .ambient-wheel { display: none; } }

/* ---------- sections ---------- */

section { border-top: 1px solid var(--line); padding-block: clamp(3.5rem, 8vw, 6.5rem); }
section.washed { background: var(--wash); }

.section-head { margin-bottom: clamp(2rem, 5vw, 3.5rem); max-width: 46rem; }
.section-head .manifest { margin-bottom: 1rem; }
.section-head h2 {
  font-size: clamp(1.8rem, 3.6vw, 2.7rem);
  line-height: 1.12;
  letter-spacing: -0.015em;
  text-wrap: balance;
  margin-bottom: 1rem;
}
.section-head p { color: var(--slate); font-size: 1.1rem; max-width: 54ch; }

/* problem list */
.slips {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: clamp(1.5rem, 3vw, 3rem);
}
.slips article h3 { font-size: 1.15rem; margin-bottom: 0.5rem; }
.slips article p { color: var(--slate); font-size: 0.98rem; margin: 0; }
@media (max-width: 760px) { .slips { grid-template-columns: 1fr; } }

/* plain-english definition */
.definition {
  font-size: clamp(1.3rem, 2.6vw, 1.9rem);
  line-height: 1.4;
  max-width: 36ch;
  font-family: var(--font-display);
  font-weight: 400;
}
.definition strong { color: var(--signal); }

/* how it works */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(1.5rem, 3vw, 3rem); counter-reset: step; }
.steps article { border-top: 2px solid var(--ink); padding-top: 1.25rem; }
.steps article::before {
  counter-increment: step;
  content: "Step " counter(step);
  display: block;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.06em;
  color: var(--slate);
  margin-bottom: 0.9rem;
}
.steps h3 { font-size: 1.2rem; margin-bottom: 0.6rem; }
.steps p { color: var(--slate); font-size: 0.98rem; margin: 0; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* ---------- worked examples (case studies) ---------- */

.case {
  border-top: 1px solid var(--line);
  padding-block: clamp(2.25rem, 5vw, 3.5rem);
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(1.5rem, 4vw, 4rem);
}
.case:first-of-type { border-top: none; padding-top: 0; }
.case .manifest-row {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem 2rem;
  margin-bottom: 0.75rem;
}
.case h3 { font-size: clamp(1.35rem, 2.4vw, 1.8rem); line-height: 1.2; margin-bottom: 0.9rem; text-wrap: balance; }
.case .story p { color: var(--slate); margin-bottom: 0.9rem; }
.case .story p strong { color: var(--ink); }
.case .outcomes { display: grid; gap: 1.4rem; align-content: start; }
.case .outcomes div { border-left: 2px solid var(--signal); padding-left: 1rem; background: #35bfa824; padding: 0.5rem 1rem; }
.case .num {
  display: block;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 3.2vw, 2.5rem);
  line-height: 1.05;
  letter-spacing: -0.01em;
}
.case .outcomes small { color: var(--slate); font-size: 0.88rem; line-height: 1.4; display: block; margin-top: 0.3rem; }
.case.featured h3 { color: var(--signal); }
@media (max-width: 820px) {
  .case { grid-template-columns: 1fr; }
  .case .outcomes { grid-template-columns: repeat(3, 1fr); gap: 1rem; }
}
@media (max-width: 560px) { .case .outcomes { grid-template-columns: 1fr; } }

.illustrative-note {
  margin-top: clamp(2rem, 5vw, 3rem);
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
  color: var(--slate);
  font-size: 0.9rem;
  max-width: 62ch;
}

/* ---------- what we build ---------- */

.build-cols { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(1.5rem, 4vw, 4rem); }
.build-cols h3 { font-size: 1.2rem; margin-bottom: 1rem; }
.build-cols ul { list-style: none; padding: 0; margin: 0; }
.build-cols li { padding-block: 0.65rem; border-top: 1px solid var(--line); color: var(--slate); }
.build-cols li strong { color: var(--ink); display: block; margin-bottom: 0.1rem; }
@media (max-width: 760px) { .build-cols { grid-template-columns: 1fr; } }

/* ---------- straight talk / founder note ---------- */

.straight { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: clamp(1.5rem, 4vw, 3rem); align-items: start; }
/* Until the founder photo exists, the note spans the full width. */
.straight:not(:has(.founder-photo)) { grid-template-columns: minmax(0, 1fr); }
.straight p { font-size: clamp(1.05rem, 1.8vw, 1.25rem); line-height: 1.6; max-width: 54ch; margin-bottom: 1.1rem; }
.straight p strong { color: var(--ink); }
.founder-photo {
  width: 120px;
  height: 120px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
  background: var(--wash);
}
.signature {
  margin-top: 1.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  max-width: 54ch;
}
.signature .name { font-family: var(--font-display); font-weight: 600; font-size: 1.1rem; display: block; }
.signature .role { color: var(--slate); font-size: 0.92rem; }
@media (max-width: 700px) {
  .straight { grid-template-columns: 1fr; }
  .founder-photo { width: 88px; height: 88px; }
}

/* ---------- how-it-works flow diagram ---------- */

.flow {
  margin-top: clamp(2.5rem, 5vw, 3.5rem);
  padding-top: clamp(2rem, 4vw, 2.5rem);
  border-top: 1px solid var(--line);
}
.flow-caption { color: var(--slate); font-size: 0.95rem; margin-bottom: 1.75rem; }
.flow-grid {
  display: grid;
  grid-template-columns: minmax(0,1fr) auto minmax(0,1.1fr) auto minmax(0,1fr);
  gap: clamp(0.75rem, 2vw, 1.5rem);
  align-items: stretch;
}
.flow-node { border: 1px solid var(--line); border-radius: var(--radius-medium); padding: 1.1rem 1.15rem; }
.flow-node.is-agent { border-color: var(--signal); border-width: 2px; }
.flow-node h4 {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  font-weight: normal;
  color: var(--slate);
  margin-bottom: 0.6rem;
}
.flow-node.is-agent h4 { color: var(--signal); }
.flow-node ul { list-style: none; margin: 0; padding: 0; }
.flow-node li { font-size: 0.95rem; line-height: 1.45; padding-block: 0.15rem; }
.flow-node .lead-line { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; line-height: 1.3; }
.flow-arrow {
  align-self: center;
  color: var(--signal);
  font-family: var(--font-mono);
  font-size: 1.1rem;
  line-height: 1;
}
.flow-foot {
  margin-top: 1rem;
  border: 1px dashed var(--line);
  border-radius: var(--radius-medium);
  padding: 0.85rem 1.15rem;
  color: var(--slate);
  font-size: 0.95rem;
}
.flow-foot strong { color: var(--ink); }
@media (max-width: 820px) {
  .flow-grid { grid-template-columns: 1fr; }
  .flow-arrow { justify-self: start; rotate: 90deg; padding-left: 1rem; }
}

/* ---------- what happens on the call ---------- */

.call-detail { margin-top: 2.25rem; display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem; max-width: 52rem; }
.call-detail div { border-top: 1px solid var(--line); padding-top: 0.85rem; }
.call-detail dt { font-family: var(--font-display); font-weight: 600; font-size: 1.02rem; margin-bottom: 0.3rem; }
.call-detail dd { margin: 0; color: var(--slate); font-size: 0.92rem; line-height: 1.45; }
@media (max-width: 700px) { .call-detail { grid-template-columns: 1fr; gap: 1rem; } }

/* ---------- FAQ ---------- */

/* Neutralize Oat's boxed accordion; hairline editorial rows instead. */
.faq details {
  border: none;
  border-top: 1px solid var(--line);
  border-radius: 0;
  overflow: visible;
  background: transparent;
  max-width: 46rem;
}
.faq details + details { margin-top: 0; }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary {
  font-family: var(--font-display);
  font-size: 1.05rem;
  color: var(--ink);
  background: transparent;
  padding: 1.1rem 0;
  cursor: pointer;
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1rem;
}
.faq summary:hover { background: transparent; color: var(--signal); }
.faq summary::-webkit-details-marker, .faq summary::marker { display: none; }
.faq summary::after {
  content: "+";
  transform: none;
  font-family: var(--font-mono);
  font-size: 1rem;
  color: var(--slate);
  flex-shrink: 0;
  background: none;
  width: auto; height: auto;
}
.faq details[open] summary::after { content: "−"; transform: none; color: var(--signal); }
.faq details > *:not(summary) {
  margin: 0;
  color: var(--slate);
  padding: 0 0 1.25rem;
  max-width: 60ch;
}

/* ---------- final CTA ---------- */

.book h2 {
  font-size: clamp(2rem, 4.8vw, 3.4rem);
  line-height: 1.08;
  letter-spacing: -0.02em;
  max-width: 22ch;
  margin-bottom: 1.25rem;
  text-wrap: balance;
}
.book .lede { color: var(--slate); font-size: 1.15rem; max-width: 50ch; margin-bottom: 2rem; }

/* ---------- footer ---------- */

.site-footer { border-top: 1px solid var(--line); padding-block: 2.5rem; }
.site-footer .wrap { display: flex; flex-wrap: wrap; gap: 1rem 3rem; align-items: baseline; }
.site-footer p { margin: 0; color: var(--slate); font-size: 0.9rem; }
.site-footer a { color: var(--ink); }

/* ---------- motion & focus ---------- */

:focus-visible { outline: 2px solid var(--signal); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  .logo svg .text, .logo svg .rudder,
  .ambient-wheel svg .text, .ambient-wheel svg .rudder { animation: none; }
}

/* ---------- small screens ----------
   The header was overflowing at 390px: full-size logo + wordmark + toggle +
   CTA exceeded the container, clipping the button. Scale the bar down and
   let the hero statements fit one line each.
*/
@media (max-width: 640px) {
  .site-header .wrap { gap: 0.55rem; padding: 1.5rem 1.25rem 1.5rem; }
  .logo { gap: 0.5rem; }
  .logo svg { width: 2rem; height: 2rem; }
  .logo .wordmark { font-size: 1rem; }
  .theme-toggle { width: 2rem; height: 2rem; }
  .theme-toggle svg { width: 0.95rem; height: 0.95rem; }
  .site-header a.button { padding: 0.6rem 0.85rem; font-size: 0.85rem; }

  .hero { padding-top: 2.25rem; }
  .hero h1 { font-size: clamp(2rem, 8.6vw, 2.6rem); }
  .hero h1 .hl { white-space: nowrap; }  /* keep the payoff phrase intact */
  .hero .manifest { margin-bottom: 1.25rem; }
  .hero .lede { font-size: 1.05rem; }
  .hero .actions { margin-block: 1.75rem 1rem; }
  .hero .actions a.button { width: 100%; text-align: center; }

  section { padding-block: clamp(2.75rem, 9vw, 3.5rem); }
  .section-head { margin-bottom: 1.75rem; }
  .section-head h2 { font-size: clamp(1.6rem, 7.2vw, 2rem); }
  .definition { font-size: clamp(1.2rem, 5.6vw, 1.5rem); }
  .case h3 { font-size: clamp(1.25rem, 5.6vw, 1.5rem); }
  .case .num { font-size: clamp(1.5rem, 7vw, 1.9rem); }
  .book h2 { font-size: clamp(1.8rem, 8vw, 2.4rem); }
  .book .actions a.button { width: 100%; text-align: center; }
}

/* Wordmark is the first thing to go on very narrow screens; the rotating
   mark alone still identifies us. */
@media (max-width: 380px) {
  /* .logo .wordmark { display: none; } */
}
