@font-face {
  font-family: "IBM Plex Sans Variable";
  src: url("/fonts/ibm-plex-sans.woff2") format("woff2-variations");
  font-weight: 100 700;
  font-display: swap;
}

/*
  Merlin's own tokens, radii and type scale, copied from the app
  (merlin services/web/frontend/src/app.css and lib/type-scale.css) so a
  screenshot sits on the page as if it were the page. Change them there
  first.
*/
:root {
  color-scheme: dark;
  --surface-0: #0f1317;
  --surface-1: #161b21;
  --surface-2: #1e252c;
  --chosen: #3a4551;
  --line: #2a323b;
  --ink-strong: #e6eaee;
  --ink: #d3d9df;
  --ink-muted: #aeb7c2;
  --signal: #f2a93b;
  --shadow-float: 0 8px 24px rgb(0 0 0 / 0.45);
  --radius-control: 4px;
  --radius-surface: 6px;
  --radius-dot: 50%;
  --text-xs: 0.875rem;
  --text-xs--line-height: 1.1875rem;
  --text-sm: 0.9375rem;
  --text-sm--line-height: 1.375rem;
  --text-base: 1rem;
  --text-base--line-height: 1.5rem;
  --text-md: 1.125rem;
  --text-md--line-height: 1.6875rem;
  --text-lg: 1.5rem;
  --text-lg--line-height: 2.3125rem;
  --text-xl: 1.875rem;
  --text-xl--line-height: 2.625rem;
  --text-2xl: 2.5rem;
  --text-2xl--line-height: 3.3125rem;
  --font-sans: "IBM Plex Sans Variable", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --gutter: clamp(16px, 5vw, 64px);
  --column: clamp(72rem, 84vw, 120rem);
  --measure: 38rem;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  background: var(--surface-0);
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--surface-0);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--text-md);
  line-height: var(--text-md--line-height);
  font-variant-numeric: tabular-nums;
  font-weight: 450;
}

h1,
h2,
h3 {
  margin: 0;
  color: var(--ink-strong);
  font-weight: 600;
  text-wrap: balance;
}

h1 {
  font-size: var(--text-2xl);
  line-height: var(--text-2xl--line-height);
}

h2 {
  font-size: var(--text-xl);
  line-height: var(--text-xl--line-height);
}

h3 {
  font-size: var(--text-lg);
  line-height: var(--text-lg--line-height);
}

p {
  margin: 0;
  text-wrap: pretty;
}

p + p {
  margin-top: 1em;
}

strong {
  font-weight: 600;
}

a {
  color: inherit;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  text-decoration-thickness: 2px;
}

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

img {
  display: block;
  max-width: 100%;
  height: auto;
}

code {
  padding: 1px 4px;
  border-radius: var(--radius-control);
  background: var(--surface-2);
  font-family: inherit;
  font-size: 0.95em;
}

.skip {
  position: absolute;
  left: var(--gutter);
  top: -100px;
  z-index: 10;
  padding: 8px 12px;
  border-radius: var(--radius-control);
  background: var(--surface-2);
  color: var(--ink-strong);
}

.skip:focus {
  top: 8px;
}

.wrap {
  width: min(var(--column), 100% - 2 * var(--gutter));
  margin-inline: auto;
}

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

/* Header and footer */

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--surface-1);
  font-size: var(--text-sm);
  line-height: var(--text-sm--line-height);
}

.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 28px;
  padding-block: 8px;
}

.wordmark {
  color: var(--ink-strong);
  font-size: var(--text-md);
  font-weight: 600;
  text-decoration: none;
}

.site-nav {
  flex: 1;
}

.site-nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav ul a {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  color: var(--ink-muted);
  text-decoration: none;
}

.site-nav ul a:hover {
  color: var(--ink-strong);
}

.site-nav ul a[aria-current="page"] {
  color: var(--ink-strong);
  text-decoration: underline;
  text-decoration-thickness: 2px;
}

.header-cta.button {
  min-height: 36px;
  padding: 0 14px;
}

/* On a phone the wordmark and the button share the top row, the links the next */
@media (max-width: 600px) {
  .header-cta {
    order: 2;
    margin-left: auto;
  }

  .site-nav {
    order: 3;
    flex-basis: 100%;
  }
}

.site-footer {
  padding-block: 32px 48px;
  border-top: 1px solid var(--line);
  background: var(--surface-1);
  color: var(--ink-muted);
  font-size: var(--text-sm);
  line-height: var(--text-sm--line-height);
}

.site-footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 40px;
}

.site-footer p + p {
  margin-top: 0;
}

.analytics-choice {
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  font: inherit;
  text-decoration: underline;
  cursor: pointer;
}

/* Actions: the one amber fill is the primary action, as in the app */

.button {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid transparent;
  border-radius: var(--radius-control);
  background: var(--signal);
  color: var(--surface-0);
  font: inherit;
  font-weight: 600;
  text-decoration: none;
  cursor: pointer;
}

.button:hover {
  text-decoration: underline;
}

/* The maker page */

.maker-page { display: grid; grid-template-columns: 1fr 1.3fr; gap: 64px; align-items: center; min-height: 100svh; padding-block: 56px; }
.maker-page h1 { font-size: clamp(2.5rem, 5vw, 4.5rem); margin-bottom: 24px; }
.maker-page .photo img { aspect-ratio: 1; object-position: 50% 65%; }

/* The opening gives the racing photograph room beside the product promise. */
.hero { padding-block: clamp(40px, 6vw, 88px); }
.hero-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 44px; align-items: center; }
.hero-intro { min-width: 0; }
.hero h1 { max-width: 9em; font-size: clamp(2.5rem, 4.2vw, 4rem); line-height: 1.04; letter-spacing: -.035em; }
.hero .lede { font-size: var(--text-lg); line-height: 1.45; }
.eyebrow { margin-bottom: 22px; color: var(--ink-muted); font-size: var(--text-xs); letter-spacing: .08em; text-transform: uppercase; }

.origin { color: var(--ink-muted); font-size: var(--text-sm); }
.lede { max-width: var(--measure); margin-top: 24px; }
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 24px; margin-top: 28px; }
.text-link { font-size: var(--text-sm); text-decoration: none; }
.text-link span { margin-left: 8px; }
.photo { margin: 0; position: relative; }
.photo img { width: 100%; object-fit: cover; border-radius: var(--radius-surface); }
.hero-photo img { aspect-ratio: 1.45; object-position: 50% 65%; }
.mantra { margin-top: 20px; color: var(--ink-muted); max-width: var(--measure); }

.section.credits-strip {
  padding-block: 24px;
}

/* Screenshots: the app's own surfaces, framed as one of its floating panels */

.shot {
  margin: 0;
}

.shot a {
  display: block;
  border-radius: var(--radius-surface);
}

.shot a:focus-visible { outline-offset: -3px; }

.shot img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--radius-surface);
  box-shadow: var(--shadow-float);
}

.shot figcaption {
  max-width: var(--measure);
  margin-top: 12px;
  color: var(--ink-muted);
  font-size: var(--text-sm);
  line-height: var(--text-sm--line-height);
}

/* Real screenshots: focus the evidence, retain the complete original. */
a[data-detail] { display: block; overflow: hidden; aspect-ratio: 1.65; background: var(--surface-0); }
a[data-detail] img { max-width: none; width: 100%; border: 0; border-radius: 0; }
a[data-detail="files"] { aspect-ratio: 2; }
a[data-detail="files"] img { width: 160%; transform: translate(-2%, -3%); }
.race-case figcaption { max-width: 64em; }


.figure-viewer {
  width: min(96vw, 1600px);
  max-height: 94svh;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--surface-1);
  color: var(--ink);
}

.figure-viewer::backdrop {
  background: rgb(0 0 0 / 0.8);
}

.figure-viewer figure {
  margin: 16px 0 0;
}

.figure-viewer img {
  max-height: 72svh;
  margin-inline: auto;
  object-fit: contain;
}

.figure-viewer figcaption {
  margin-top: 12px;
  font-size: var(--text-sm);
}



/* Sections */

.section {
  padding-block: clamp(56px, 8vw, 104px);
}

.section.raised {
  background: var(--surface-1);
}

.section-intro {
  max-width: var(--measure);
  margin-top: 16px;
}

/* A capability beside its visual. */

.feature {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: 24px 56px;
  align-items: start;
}

.feature + .feature,
.race-case + .race-case,
.race-case + .capability-table {
  margin-top: clamp(56px, 7vw, 96px);
}

.feature h2,
.feature h3 {
  margin-bottom: 12px;
}

.feature ul {
  margin: 1em 0 0;
  padding-left: 1.2em;
}

.feature li + li {
  margin-top: 0.4em;
}

.feature small {
  display: block;
  margin-top: 1em;
  color: var(--ink-muted);
  font-size: var(--text-sm);
  line-height: var(--text-sm--line-height);
}



.mode-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 32px;
  margin-bottom: 0;
}

.mode-grid > div {
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.mode-grid h2 {
  margin-bottom: 12px;
}


.workspace-story[data-enhanced] .mode-grid { display: flex; gap: 12px; margin-bottom: 28px; }
.workspace-story[data-enhanced] [data-mode] { padding: 0; border: 0; flex: 1; }
.workspace-story[data-enhanced] [data-mode] > div { display: none; }
.workspace-story[data-enhanced] .mode-grid h2 { margin: 0; }
.workspace-story button { width: 100%; padding: 14px 12px; min-height: 52px; border: 1px solid transparent; border-radius: var(--radius-control); background: var(--surface-1); color: var(--ink); font: inherit; font-size: var(--text-sm); cursor: pointer; }
.workspace-story button[aria-pressed="true"] { border-color: var(--signal); color: var(--ink-strong); background: var(--surface-2); }
.workspace-story button:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px; }
.workspace-illustration { margin: 0; }
.workspace-graph { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr); align-items: start; gap: 48px; }
.workspace-context { padding-top: 24px; }
.workspace-question { font-size: var(--text-xl); line-height: 1.18; margin: 16px 0 24px; }
.workspace-answer { color: var(--signal); font-size: var(--text-lg); line-height: 1.35; margin: 0 0 16px; }
.workspace-summary { font-size: var(--text-base); line-height: 1.6; max-width: var(--measure); }
.workspace-inputs { margin-top: 24px; }
.workspace-inputs [data-inputs] { color: var(--ink); font-size: var(--text-sm); line-height: 1.6; }
.workspace-view { min-width: 0; }
.workspace-plan img { display: block; width: 100%; max-width: 390px; height: auto; margin-inline: auto; border-radius: var(--radius-surface); }
.workspace-graph[data-stage="pre"] .workspace-comparison,
.workspace-graph:not([data-stage="pre"]) .workspace-plan,
.workspace-graph:not([data-stage="post"]) .race-learning { display: none; }
.workspace-record { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; padding: 0; margin: 20px 0 0; list-style: none; }
.workspace-record li { border-top: 2px solid var(--line); padding-top: 14px; }
.workspace-record li.is-retained { border-color: var(--signal); }
.workspace-record strong { display: block; color: var(--ink-strong); font-size: var(--text-sm); font-weight: 500; }
.workspace-record span { display: block; color: var(--ink-muted); font-size: var(--text-xs); margin-top: 6px; }
.workspace-retained-label { color: var(--ink); margin-top: 32px; font-size: var(--text-sm); }
@media (max-width: 860px) {
  .workspace-graph { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .workspace-context { padding-top: 0; }
  .workspace-question { margin-top: 8px; }
  .workspace-record { gap: 12px; }
  .workspace-story[data-enhanced] .mode-grid { gap: 8px; }
  .workspace-record strong, .workspace-record span { font-size: var(--text-xs); }
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.prose {
  max-width: var(--measure);
}

/* A prose column inside the page's column keeps the page's left edge */
.wrap.prose {
  max-width: none;
}

.wrap.prose > * {
  max-width: var(--measure);
}

.prose ul {
  margin: 1em 0 0;
  padding-left: 1.2em;
}

.prose li + li {
  margin-top: 0.5em;
}

/* Capabilities: a short in-page index, then Plan, Race and Review */

.page-index {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 28px;
  margin: 24px 0 0;
  padding: 0;
  list-style: none;
}

.page-index a {
  display: inline-block;
  padding-block: 8px;
  color: var(--ink-muted);
  font-size: var(--text-sm);
  text-decoration: underline;
  text-decoration-color: var(--line);
  text-underline-offset: 5px;
}

.page-index a:hover { color: var(--ink-strong); text-decoration-color: currentColor; }

.part-head {
  margin-bottom: clamp(40px, 5vw, 64px);
}

.part-head h2 {
  font-size: var(--text-2xl);
  line-height: var(--text-2xl--line-height);
}

/* The sign-up block */

.signup form {
  max-width: var(--measure);
  display: grid;
  gap: 16px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--surface-2);
}

.signup label {
  display: grid;
  gap: 6px;
  color: var(--ink-strong);
  font-size: var(--text-sm);
  line-height: var(--text-sm--line-height);
  font-weight: 600;
}

.signup input,
.signup select,
.signup textarea {
  min-height: 44px;
  padding: 0 12px;
  border: 1px solid var(--chosen);
  border-radius: var(--radius-control);
  background: var(--surface-0);
  color: var(--ink-strong);
  font: inherit;
  font-weight: 450;
}

.signup textarea {
  padding-block: 10px;
  resize: vertical;
}

.signup input:focus-visible,
.signup select:focus-visible,
.signup textarea:focus-visible {
  outline-offset: 1px;
}

.signup .check {
  grid-template-columns: auto minmax(0, 1fr);
  align-items: start;
  gap: 10px;
  font-weight: 450;
}

.signup .check input {
  min-height: 0;
  width: 18px;
  height: 18px;
  margin-top: 2px;
  accent-color: var(--signal);
}

.signup .form-hint {
  color: var(--ink-muted);
  font-size: var(--text-sm);
}

.signup .form-status:empty {
  display: none;
}

.race-interlude { position: relative; margin: 0; isolation: isolate; }
.race-interlude .photo img { width: 100%; height: clamp(380px, 48vw, 650px); border-radius: 0; object-position: center 62%; }
.race-interlude::after { position: absolute; content: ""; inset: 0; background: linear-gradient(90deg, rgb(15 19 23 / .88), rgb(15 19 23 / .2) 75%); pointer-events: none; }
.race-interlude > p { position: absolute; left: var(--gutter); top: 50%; transform: translateY(-50%); z-index: 1; color: var(--ink-strong); font-size: clamp(2rem, 4.5vw, 4.25rem); line-height: 1.18; letter-spacing: -.025em; }
.race-interlude > p strong { color: var(--signal); }

.page-photo { margin-bottom: 72px; }
.page-photo img { max-height: 550px; object-position: center 60%; }

/* Pages other than the landing page */

.page-head {
  padding-block: clamp(40px, 7vw, 88px) clamp(32px, 5vw, 48px);
}

.page-head h1 {
  max-width: 18em;
}

.page-head .lede {
  margin-top: 16px;
}

.credits ul {
  margin: 1em 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--text-base);
  line-height: var(--text-base--line-height);
}

.credits li {
  padding-block: 10px;
  border-bottom: 1px solid var(--line);
}

.prose .credits li + li {
  margin-top: 0;
}

/* The consent notice: one owner for both analytics tools */

.consent {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 20;
  width: min(26rem, 100% - 32px);
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-surface);
  background: var(--surface-2);
  box-shadow: var(--shadow-float);
  font-size: var(--text-sm);
  line-height: var(--text-sm--line-height);
}

.consent .actions {
  margin-top: 12px;
  gap: 8px;
}

.consent .button {
  min-height: 36px;
  padding: 0 12px;
}

@media (max-width: 860px) {
  .feature,
  .mode-grid,
  .hero-grid {
    grid-template-columns: minmax(0, 1fr);
  }


  .hero .lede {
    font-size: var(--text-md);
    line-height: var(--text-md--line-height);
  }

}

@media print {
  :root {
    --surface-0: #ffffff;
    --surface-1: #ffffff;
    --surface-2: #f2f2f2;
    --chosen: #d4d4d4;
    --ink-strong: #151515;
    --ink: #151515;
    --ink-muted: #505050;
    --line: #b0b0b0;
    --signal: #875000;
  }

  .site-nav,
  .skip,
  .consent,
  .signup form {
    display: none;
  }
}

@media (max-width: 860px) {
  .hero-grid, .maker-page { gap: 32px; }
  .maker-page { grid-template-columns: minmax(0, 1fr); }
  .hero h1 { max-width: 12em; }
  .hero-photo img { aspect-ratio: 1.65; }
}

.contact-layout { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 64px; }
.contact-layout .photo { position: sticky; top: 32px; }
.contact-layout .photo img { aspect-ratio: .9; height: auto; }
@media (max-width: 860px) {
  .contact-layout { grid-template-columns: minmax(0, 1fr); gap: 40px; }
  .contact-layout .photo { position: static; }
  .contact-layout .photo img { aspect-ratio: 1.5; }
}

/* One Farallones course carries the changing race decision. */
.race-decision { margin: 32px 0 0; padding: 24px; border-radius: var(--radius-surface); background: var(--surface-1); }
.decision-grid { display: grid; grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr); align-items: center; gap: 40px; margin-top: 24px; }
.decision-map { min-width: 0; }
.decision-key { display: flex; flex-wrap: wrap; gap: 8px 16px; margin: 16px 0 0; padding: 0; list-style: none; color: var(--ink-muted); font-size: var(--text-xs); }
.decision-key span { display: inline-block; width: 24px; margin-right: 6px; vertical-align: middle; border-top: 3px solid; }
.key-plan { color: #2563eb; }
.key-option { color: #b45309; }
.decision-key .key-fleet, .decision-key .key-option { border-top-style: dashed; }
.inside-line, .outside-line, .inside-option { fill: none; stroke-linecap: round; }
.inside-line { stroke: #8a939e; stroke-width: 3; stroke-dasharray: 5 5; }
.outside-line { stroke: #2563eb; stroke-width: 4; }
.inside-option { stroke: #b45309; stroke-width: 4; stroke-dasharray: 5 5; }
.inside-fleet { fill: #8a939e; stroke: #12171d; stroke-width: 1; }
.our-boat { fill: var(--signal); stroke: #12171d; stroke-width: 1; }
.decision-call > p:first-child { color: var(--ink-strong); font-size: var(--text-xl); line-height: 1.2; }
.decision-call > p + p { margin-top: 12px; }
.decision-evidence { list-style: none; padding: 0; margin: 24px 0 0; font-size: var(--text-sm); }
.decision-evidence li { display: grid; grid-template-columns: 82px minmax(0, 1fr); gap: 12px; padding-block: 10px; }
.decision-evidence strong { color: var(--ink-muted); font-weight: 400; }
.race-decision[data-step="0"] .decision-after,
.race-decision[data-step="1"] .decision-before { display: none; }
@media (max-width: 860px) {
  .race-decision { padding: 16px; }
  .decision-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
}

.detail-link { font-size: var(--text-sm); margin-block: 16px; }

.capability-table { overflow-x: auto; margin-top: 32px; font-size: var(--text-base); }
.capability-table h3 { margin-bottom: 20px; }
.capability-table table { width: 100%; border-collapse: collapse; text-align: left; }
.capability-table caption { text-align: left; color: var(--ink-muted); font-size: var(--text-sm); margin-bottom: 20px; }
.capability-table th, .capability-table td { vertical-align: top; padding: 24px 24px 24px 0; }
.capability-table th { color: var(--ink-strong); font-weight: 500; }
.capability-table thead th { color: var(--ink-muted); font-size: var(--text-xs); }
.capability-table tbody th { width: 30%; color: var(--ink-muted); }
.capability-table td strong { display: block; color: var(--ink-strong); font-weight: 500; margin-bottom: 8px; }
body[data-page="workspace"] .page-head { padding-block: 44px 20px; }
body[data-page="workspace"] #whole-race { padding-top: 24px; }
body[data-page="workspace"] .part-head { margin-bottom: 24px; }
@media (max-width: 600px) {
  .capability-table th, .capability-table td { padding: 16px 12px 16px 0; }
  .capability-table th:last-child, .capability-table td:last-child { padding-right: 0; }
}
.review-proof { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 56px; align-items: start; }
body[data-page="merlin"] .feature h2,
body[data-page="capabilities"] .race-case h3,
body[data-page="capabilities"] #play-by-play h3 { font-size: clamp(var(--text-xl), 3vw, var(--text-2xl)); line-height: 1.15; letter-spacing: -.025em; }
body[data-page="capabilities"] .page-head h1 { font-size: clamp(var(--text-2xl), 5vw, 4rem); line-height: 1.06; letter-spacing: -.035em; }
body[data-page="capabilities"] .page-head { padding-bottom: 24px; }
body[data-page="capabilities"] #plan { padding-top: 56px; }
body[data-page="capabilities"] .part-head { margin-bottom: 24px; }
body[data-page="capabilities"] .part-head h2 { font-size: var(--text-xs); line-height: var(--text-xs--line-height); color: var(--ink-muted); letter-spacing: .1em; text-transform: uppercase; }
body[data-page="capabilities"] .race-case h3,
body[data-page="capabilities"] #play-by-play h3 { margin-bottom: 24px; }
@media (max-width: 860px) {
  .review-proof { grid-template-columns: minmax(0, 1fr); gap: 32px; }
}
.connection-note { color: var(--ink-muted); font-size: var(--text-xs); margin-top: 24px; }

.crew-plan { margin: 32px 0 0; }
.crew-plan img { display: block; width: 100%; height: auto; border-radius: var(--radius-surface); }
.race-review { max-width: 760px; margin: 28px 0; }
.race-review figcaption { font-size: var(--text-sm); color: var(--ink-muted); margin-top: 12px; }
.capability-table .prose + table { margin-top: 24px; }
.forecast-flow { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; max-width: 900px; margin: 32px 0 0; padding: 24px; background: var(--surface-0); border-radius: var(--radius-surface); }
.forecast-flow > div { min-width: 0; text-align: center; }
.forecast-flow p { font-size: var(--text-sm); color: var(--ink-muted); }
.forecast-flow svg { display: block; width: 100%; max-width: 180px; margin: 12px auto; }
.forecast-flow strong { font-size: var(--text-md); color: var(--ink-strong); }
.flow-muted { fill: none; stroke: var(--ink-muted); stroke-width: 2; stroke-dasharray: 4 5; }
.flow-boat, .flow-sample { fill: var(--ink-strong); }
.flow-fit, .flow-route { fill: none; stroke: var(--signal); stroke-width: 4; }
.saved-plan { display: flex; flex-wrap: wrap; gap: 12px 28px; list-style: none; padding: 0; margin: 28px 0 8px; color: var(--ink-strong); }
.saved-plan li::before { content: "✓"; color: var(--signal); margin-right: 8px; }
.saved-plan-note { font-size: var(--text-sm); color: var(--ink-muted); }
body[data-page="capabilities"] #boat { margin-top: 0; }
.capability-table + .race-case { margin-top: clamp(48px, 6vw, 80px); }
@media (max-width: 600px) {
  .forecast-flow { padding: 16px; gap: 16px 12px; }
}

/* The co-pilot request, its source and the resulting course stay together. */
.race-setup { margin: 32px 0 0; }
.setup-scene { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.5fr); background: var(--surface-1); border-radius: var(--radius-surface); overflow: hidden; }
.setup-conversation { padding: 28px; display: flex; flex-direction: column; }
.setup-label { display: block; color: var(--ink-muted); font-size: var(--text-xs); letter-spacing: .05em; }
.setup-message { align-self: flex-end; width: 90%; }
.setup-message > .setup-label { margin-bottom: 8px; text-align: right; }
.setup-message blockquote { margin: 0; padding: 16px 20px; background: var(--surface-2); border-radius: var(--radius-control); color: var(--ink-strong); font-size: var(--text-md); line-height: 1.45; }
.setup-message-sent { display: block; text-align: right; margin-top: 8px; color: var(--ink-muted); font-size: var(--text-xs); }
.setup-message-sent span { color: var(--signal); margin-left: 4px; }
.setup-reply { margin-top: 28px; }
.setup-source { position: relative; padding: 12px 16px; background: var(--surface-0); border-radius: var(--radius-control); overflow: hidden; }
.setup-source p { margin: 8px 0 0; font-size: var(--text-xs); color: var(--ink-muted); }
.setup-source > .setup-label { display: flex; align-items: center; gap: 12px; color: var(--ink-strong); letter-spacing: 0; }
.setup-work { display: grid; grid-template-columns: 14px minmax(0, 1fr); align-items: center; gap: 10px; margin: 16px 0; min-height: 2.8em; color: var(--ink); font-size: var(--text-sm); line-height: 1.4; }
.setup-working { width: 14px; height: 14px; flex: 0 0 14px; border: 2px solid var(--ink-muted); border-right-color: var(--signal); border-radius: 50%; }
.setup-work > span { grid-row: 1; grid-column: 2; }
.setup-work > .setup-working { grid-column: 1; }
.setup-finding, .setup-read { display: none; }
.map-document { flex: 0 0 auto; fill: var(--surface-1); stroke: var(--ink-strong); stroke-width: 2; stroke-linejoin: round; stroke-linecap: round; }
.setup-chart-frame { position: relative; min-width: 0; background: #0b2d45; display: flex; align-items: center; }
.setup-chart-frame > .setup-label { position: absolute; z-index: 1; top: 20px; left: 24px; color: var(--ink-strong); background: var(--surface-0); padding: 6px 10px; border-radius: var(--radius-control); }
.setup-map { width: 100%; }
.race-map { position: relative; min-width: 0; }
.race-base { width: 100%; height: auto; display: block; }
.race-overlay { position: absolute; inset: 0; width: 100%; height: 100%; }
.setup-search { fill: none; stroke: #fab13a; stroke-width: 3; opacity: .65; }
.setup-route { fill: none; stroke: #2563eb; stroke-width: 4; stroke-linecap: round; }
.setup-extraction { color: var(--ink); font-size: var(--text-sm); margin: 0; padding-left: 20px; }
.setup-extraction li { padding-block: 4px; }
.course-point { position: absolute; display: flex; align-items: center; gap: 8px; transform: translate(-14px, -14px); white-space: nowrap; }
.course-terminal { left: 76.6%; top: 46.4%; }
.course-terminal .mark-name { position: absolute; top: 34px; right: 0; }
.course-farallon { left: 30.9%; top: 65.3%; }
.course-farallon .mark-name { position: absolute; bottom: 34px; left: 0; }
/* Fixed-size course badges and colors from Merlin's course-marker/map-dom owners. */
.waypoint-marker-badge { display: flex; align-items: center; justify-content: center; width: 28px; height: 28px; flex: 0 0 28px; border-radius: 50%; border: 2px solid var(--ink-strong); color: var(--ink-strong); font-family: var(--font-sans); font-size: var(--text-xs); font-weight: 600; line-height: 1; box-shadow: 0 0 0 1.5px rgb(0 0 0 / .75), var(--shadow-float); }
.mark-start { background: #1a9850; color: #0f1317; }
.mark-rounding { background: #6b7280; color: #fff; }
.mark-finish { background: #d73027; }
.mark-name { color: var(--ink-strong); font-size: var(--text-xs); font-weight: 600; background: var(--surface-0); padding: 2px 6px; border-radius: var(--radius-control); }
.setup-course { position: absolute; bottom: 40px; left: 24px; right: 24px; display: flex; justify-content: space-between; align-items: center; gap: 12px; font-size: var(--text-sm); color: var(--ink); background: var(--surface-0); padding: 10px 12px; border-radius: var(--radius-control); }
.map-credit { color: var(--ink-muted); font-size: .75rem; line-height: 1.4; }
.map-credit-inline { display: block; margin-top: 12px; text-align: right; }
.map-credit a { color: inherit; text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .15em; }
.setup-course strong { color: var(--signal); font-weight: 500; }
.setup-results { display: grid; margin-top: 12px; min-height: 238px; }
.setup-results > * { grid-area: 1 / 1; align-self: start; }
.setup-brief { font-size: var(--text-sm); color: var(--ink-muted); line-height: 1.5; }
.setup-brief strong { display: inline-block; font-size: var(--text-lg); color: var(--ink-strong); margin-bottom: 12px; }
.race-setup[data-step="0"] .setup-reply,
.race-setup[data-step="0"] .course-point,
.race-setup[data-step="1"] .course-point,
.race-setup[data-step="0"] .setup-course,
.race-setup[data-step="1"] .setup-course { visibility: hidden; }
.race-setup[data-step="3"] .setup-instructions { visibility: hidden; }
.race-setup:not([data-step="3"]) .setup-search,
.race-setup:not([data-step="3"]) .setup-route,
.race-setup:not([data-step="3"]) .setup-routed,
.race-setup[data-step="3"] .setup-unrouted { display: none; }
.race-setup[data-step="2"] .setup-working,
.race-setup[data-step="2"] .setup-reading { display: none; }
.race-setup[data-step="2"] .setup-read { display: inline; }
.race-setup[data-animate][data-step="0"] .setup-message { animation: message-sent 700ms ease both; }
.race-setup[data-animate][data-step="0"] .setup-message-sent { animation: reply-arrives 300ms 650ms ease both; }
.race-setup[data-animate][data-step="1"] .setup-reply { animation: reply-arrives 350ms ease both; }
.race-setup[data-animate][data-step="1"] .setup-source { animation: reply-arrives 350ms 900ms ease both; }
.race-setup[data-animate][data-step="1"] .setup-working { animation: working-turn 800ms linear 5; }
.race-setup[data-animate][data-step="1"] .setup-finding { display: inline; animation: finding-done 1400ms step-end both; }
.race-setup[data-animate][data-step="1"] .setup-reading { animation: reply-arrives 300ms 1400ms ease both; }
.race-setup[data-animate][data-step="1"] .setup-source::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent, rgb(242 169 59 / .18), transparent); transform: translateY(-100%); animation: document-scan 1800ms 900ms ease both; }
.race-setup[data-animate][data-step="1"] .setup-extraction li { animation: reply-arrives 400ms calc(2200ms + var(--row, 0) * 200ms) ease both; }
.setup-extraction li:nth-child(2) { --row: 1; }
.setup-extraction li:nth-child(3) { --row: 2; }
.race-setup[data-animate][data-step="2"] .course-point { animation: mark-added 500ms ease both; }
.race-setup[data-step="2"] .course-farallon { animation-delay: 300ms; }
.race-setup[data-animate][data-step="3"] .setup-search { animation: search-fronts 600ms calc(var(--front) * 350ms) ease both; }
.race-setup[data-animate][data-step="3"] .setup-route { stroke-dasharray: 1; animation: route-arrives 1400ms 2600ms ease both; }
.race-setup[data-animate][data-step="3"] .setup-brief { animation: reply-arrives 350ms 4000ms ease both; }
.race-setup[data-animate][data-step="3"] .setup-course strong { animation: reply-arrives 300ms 4000ms ease both; }
@keyframes message-sent { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: translateY(0); } }
@keyframes reply-arrives { from { opacity: 0; } to { opacity: 1; } }
@keyframes finding-done { from { visibility: visible; } to { visibility: hidden; } }
@keyframes working-turn { to { transform: rotate(360deg); } }
@keyframes document-scan { to { transform: translateY(100%); } }
@keyframes mark-added { from { opacity: 0; scale: .7; } to { opacity: 1; scale: 1; } }
@keyframes search-fronts { from { opacity: 0; } to { opacity: .65; } }
@keyframes route-arrives { from { stroke-dashoffset: 1; } to { stroke-dashoffset: 0; } }
.story-controls { list-style: none; display: flex; gap: 12px; margin: 16px 0 0; padding: 0; }
.story-controls li { flex: 1; min-width: 0; }
.story-controls button { width: 100%; height: 100%; min-height: 52px; padding: 12px 16px; border: 1px solid transparent; border-radius: var(--radius-control); background: var(--surface-1); text-align: left; font: inherit; font-size: var(--text-sm); color: var(--ink-muted); cursor: pointer; }
.story-controls button[aria-pressed="true"] { color: var(--ink-strong); border-color: var(--signal); background: var(--surface-2); }
.story-controls button:focus-visible { outline: 2px solid var(--signal); outline-offset: 4px; }
.setup-steps button { text-align: center; padding-inline: 4px; }
.setup-steps button span { display: block; margin-bottom: 4px; font-size: var(--text-xs); }
.race-setup figcaption { margin-top: 16px; min-height: 3em; font-size: var(--text-sm); color: var(--ink-muted); }
.decision-steps { margin-top: 24px; }
.decision-steps button { background: var(--surface-0); }
@media (max-width: 860px) {
  .setup-scene { grid-template-columns: minmax(0, 1fr); }
  .setup-conversation { padding: 24px; }
  .setup-message { width: 94%; }
}
@media (max-width: 600px) {
  .story-controls { gap: 8px; }
  .story-controls button { padding: 12px 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .race-setup * { transition: none !important; animation: none !important; }
  .race-setup .setup-finding { display: none; }
  .race-setup .setup-route { stroke-dashoffset: 0; }
}

.race-detail { display: block; width: 100%; height: auto; border-radius: var(--radius-surface); background: var(--surface-0); }
.chart-label rect { fill: var(--surface-0); }
.chart-label text { fill: var(--ink-strong); font-family: var(--font-sans); font-size: 18px; font-weight: 500; }
.race-learning { padding: 20px 24px; background: var(--surface-1); border-left: 2px solid var(--signal); margin-top: 20px; }
.race-learning p { margin: 0 0 8px; }
.race-learning strong { color: var(--ink-strong); font-weight: 500; }
.race-learning > span { color: var(--ink-muted); font-size: var(--text-xs); }

.chart-fleet { fill: #8a939e; stroke: #12171d; stroke-width: 1; }

@media (max-width: 600px) {
  .setup-chart-frame { display: block; }
  .setup-chart-frame > .setup-label { position: static; margin: 0; padding: 10px 14px; }
  .setup-course { position: static; margin: 0; padding: 12px 14px; font-size: var(--text-xs); }
  .setup-message blockquote { font-size: var(--text-base); padding: 12px 16px; }
  .setup-source p { display: none; }
  .setup-results { min-height: 190px; }
  .setup-extraction { font-size: var(--text-xs); }
  .setup-work { font-size: var(--text-xs); margin-block: 12px; }
}

.capability-planning { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); align-items: start; gap: 48px; margin-top: 40px; }
.capability-planning .race-case:first-child { margin-top: 0; }
.capability-planning .race-case + .race-case { margin-top: 32px; }
.capability-briefing { margin: 0; }
.capability-briefing img { display: block; width: 100%; max-width: 390px; height: auto; margin-inline: auto; border-radius: var(--radius-surface); }
@media (max-width: 860px) { .capability-planning { grid-template-columns: minmax(0, 1fr); gap: 24px; } }
@media (max-width: 600px) { .setup-steps button { padding: 10px 4px; } }
