/* Hosting Compass, "Seekarte" design system.
   Day chart: deep water is the paper, shallow water is blue, land is pale grey-green, magenta marks what matters
   (on real nautical charts magenta is reserved for lights, buoys and important notes).
   Night chart: the same roles in ECDIS night colours. */

@font-face { font-family: "Bricolage"; src: url("/assets/fonts/bricolage-latin.woff2") format("woff2");
  font-weight: 200 800; font-stretch: 75% 100%; font-display: swap;
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Bricolage"; src: url("/assets/fonts/bricolage-latin-ext.woff2") format("woff2");
  font-weight: 200 800; font-stretch: 75% 100%; font-display: swap;
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C4, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Newsreader"; src: url("/assets/fonts/newsreader-italic-latin.woff2") format("woff2");
  font-weight: 400 600; font-style: italic; font-display: swap; }

:root {
  --paper: #f3f8fa;
  --paper-2: #e7f1f5;
  --shoal-1: #d3e8f0;
  --shoal-2: #b6d8e6;
  --shoal-3: #96c5d9;
  --contour: #78a5b9;
  --land: #e3e8df;
  --land-edge: #9aa897;
  --ink: #0c2536;
  --ink-2: #375366;
  --ink-3: #5d7787;
  --rule: rgba(12, 37, 54, .14);
  --rule-strong: rgba(12, 37, 54, .28);
  --magenta: #b0136b;
  --magenta-deep: #8c0e55;
  --magenta-wash: rgba(176, 19, 107, .09);
  --on-magenta: #ffffff;
  --good: #19744f;
  --warn: #b23a25;
  --shadow: 0 1px 0 rgba(12, 37, 54, .06), 0 10px 30px -12px rgba(12, 52, 74, .28);
  --radius: 6px;
  --pill: 999px;
  --wrap: 1240px;
  --gutter: 16px;
  --header: 64px;
  --font: "Bricolage", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --label: "Newsreader", "Iowan Old Style", Georgia, serif;
  --ease: cubic-bezier(.16, 1, .3, 1);
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="day"]) {
    --paper: #06141e; --paper-2: #0a1d2a; --shoal-1: #0d2433; --shoal-2: #102c3c; --shoal-3: #143546;
    --contour: #2a5367; --land: #16221d; --land-edge: #34463d; --ink: #d5e4eb; --ink-2: #a0b7c3; --ink-3: #7893a1;
    --rule: rgba(213, 228, 235, .13); --rule-strong: rgba(213, 228, 235, .26);
    --magenta: #f067b6; --magenta-deep: #ff8ccb; --magenta-wash: rgba(240, 103, 182, .12); --on-magenta: #24061a;
    --good: #47c493; --warn: #f2826b; --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .7);
    color-scheme: dark;
  }
}
:root[data-theme="night"] {
  --paper: #06141e; --paper-2: #0a1d2a; --shoal-1: #0d2433; --shoal-2: #102c3c; --shoal-3: #143546;
  --contour: #2a5367; --land: #16221d; --land-edge: #34463d; --ink: #d5e4eb; --ink-2: #a0b7c3; --ink-3: #7893a1;
  --rule: rgba(213, 228, 235, .13); --rule-strong: rgba(213, 228, 235, .26);
  --magenta: #f067b6; --magenta-deep: #ff8ccb; --magenta-wash: rgba(240, 103, 182, .12); --on-magenta: #24061a;
  --good: #47c493; --warn: #f2826b; --shadow: 0 1px 0 rgba(0, 0, 0, .3), 0 12px 32px -12px rgba(0, 0, 0, .7);
  color-scheme: dark;
}

@media (min-width: 768px) { :root { --gutter: 32px; } }

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header) + 16px); }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 17px/1.6 var(--font); font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; overflow-x: clip;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; text-decoration-color: var(--rule-strong); text-underline-offset: .18em; }
a:hover { text-decoration-color: currentColor; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--magenta); outline-offset: 3px; border-radius: 4px; }
::selection { background: var(--magenta); color: var(--on-magenta); }
.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; background: var(--ink); color: var(--paper); padding: 8px 14px; border-radius: var(--pill); }
.skip:focus { top: 12px; }

/* ---------- type ---------- */
h1, h2, h3, h4 { margin: 0; font-weight: 640; font-stretch: 86%; letter-spacing: -.018em; line-height: 1.06; text-wrap: balance; }
h1 { font-size: clamp(2.3rem, 1.6rem + 3.2vw, 4.1rem); }
h2 { font-size: clamp(1.85rem, 1.4rem + 1.9vw, 2.9rem); }
h3 { font-size: clamp(1.25rem, 1.1rem + .5vw, 1.55rem); line-height: 1.15; }
h4 { font-size: 1.06rem; font-stretch: 92%; letter-spacing: -.005em; }
p { margin: 0; max-width: 64ch; text-wrap: pretty; }
.lede { font-size: clamp(1.08rem, 1rem + .35vw, 1.28rem); line-height: 1.5; color: var(--ink-2); max-width: 46ch; }
.muted { color: var(--ink-2); }
.small { font-size: .9rem; }
.chart-label { font-family: var(--label); font-style: italic; font-weight: 450; letter-spacing: .005em; }
.num { font-variant-numeric: tabular-nums; font-feature-settings: "tnum" 1; }
.prose { max-width: 68ch; }
.prose > * + * { margin-top: 1.05em; }
.prose h2 { font-size: clamp(1.5rem, 1.25rem + 1vw, 2rem); margin-top: 2.1em; }
.prose h3 { margin-top: 1.7em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li + li { margin-top: .35em; }
.prose li::marker { color: var(--magenta); }
.prose blockquote { margin-left: 0; padding-left: 1em; border-left: 3px solid var(--magenta); color: var(--ink-2); }
.prose table { border-collapse: collapse; width: 100%; font-size: .95rem; }
.prose th, .prose td { text-align: left; padding: .55em .7em; border-bottom: 1px solid var(--rule); vertical-align: top; }

/* ---------- layout ---------- */
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: var(--gutter); }
.section { padding-block: clamp(64px, 5vw + 40px, 120px); position: relative; }
.section-tight { padding-block: clamp(40px, 3vw + 28px, 72px); }
.stack > * + * { margin-top: var(--gap, 16px); }
.grid { display: grid; gap: var(--gap, 24px); }
@media (min-width: 768px) { .grid-2 { grid-template-columns: 1fr 1fr; } .grid-3 { grid-template-columns: repeat(3, 1fr); } }
.band { background: var(--paper-2); }
.band-shoal { background: var(--shoal-1); }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 40; height: var(--header);
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(140%); backdrop-filter: blur(14px) saturate(140%);
  border-bottom: 1px solid var(--rule);
}
.site-header .wrap { height: 100%; display: flex; align-items: center; gap: 24px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-weight: 680; font-stretch: 84%; font-size: 1.22rem; letter-spacing: -.02em; white-space: nowrap; }
.brand svg { width: 30px; height: 30px; flex: none; }
.brand .rose-n { fill: var(--magenta); }
.brand .rose-s { fill: var(--ink); }
.brand .rose-ring { fill: none; stroke: var(--ink); stroke-width: 1.4; }
.nav { display: none; margin-left: auto; align-items: center; gap: 4px; }
.nav a { text-decoration: none; padding: 8px 12px; border-radius: var(--pill); color: var(--ink-2); font-weight: 520; font-size: .97rem; }
.nav a:hover, .nav a[aria-current="page"] { color: var(--ink); background: var(--magenta-wash); }
.header-tools { display: flex; align-items: center; gap: 8px; margin-left: auto; }
@media (min-width: 1000px) { .nav { display: flex; } .header-tools { margin-left: 8px; } }
.icon-btn {
  display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: var(--pill);
  border: 1px solid var(--rule); background: transparent; cursor: pointer; color: var(--ink);
}
.icon-btn:hover { border-color: var(--rule-strong); }
.icon-btn svg { width: 18px; height: 18px; }
.menu-btn { display: inline-grid; }
@media (min-width: 1000px) { .menu-btn { display: none; } }
.site-header .header-cta { display: none; }
@media (min-width: 640px) { .site-header .header-cta { display: inline-flex; } }

.drawer { position: fixed; inset: var(--header) 0 0 0; z-index: 39; background: var(--paper); padding: 24px var(--gutter); display: none; overflow-y: auto; }
.drawer.open { display: block; }
.drawer a { display: block; padding: 14px 0; border-bottom: 1px solid var(--rule); text-decoration: none; font-size: 1.35rem; font-weight: 600; font-stretch: 88%; }

/* ---------- buttons ---------- */
.btn {
  --bg: var(--magenta); --fg: var(--on-magenta);
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; white-space: nowrap;
  min-height: 48px; padding: 0 24px; border-radius: var(--pill); border: 1px solid transparent;
  background: var(--bg); color: var(--fg); font-weight: 620; font-size: 1rem; text-decoration: none; cursor: pointer;
  transition: transform .18s var(--ease), background-color .18s var(--ease), box-shadow .18s var(--ease);
}
.btn:hover { background: var(--magenta-deep); box-shadow: 0 8px 22px -10px var(--magenta); }
.btn:active { transform: translateY(1px) scale(.985); }
.btn svg { width: 18px; height: 18px; }
.btn-ink { --bg: var(--ink); --fg: var(--paper); }
.btn-ink:hover { background: var(--ink-2); box-shadow: none; }
.btn-line { --bg: transparent; --fg: var(--ink); border-color: var(--rule-strong); }
.btn-line:hover { background: var(--magenta-wash); border-color: var(--magenta); box-shadow: none; }
.btn-sm { min-height: 38px; padding: 0 16px; font-size: .93rem; }
.btn[disabled] { opacity: .5; pointer-events: none; }
.link-arrow { display: inline-flex; align-items: center; gap: 6px; font-weight: 600; color: var(--magenta); text-decoration: none; }
.link-arrow:hover { text-decoration: underline; }

/* ---------- forms ---------- */
.field { display: grid; gap: 8px; }
.field label, .field .label { font-weight: 600; font-size: .95rem; }
.field .help { font-size: .88rem; color: var(--ink-2); }
.input, .select {
  width: 100%; min-height: 48px; padding: 10px 14px; border-radius: var(--radius); border: 1px solid var(--rule-strong);
  background: var(--paper); color: var(--ink);
}
.input:focus, .select:focus { outline: 2px solid var(--magenta); outline-offset: 1px; border-color: transparent; }
.input::placeholder { color: var(--ink-3); }
.choice-row { display: flex; flex-wrap: wrap; gap: 8px; }
.choice { position: relative; }
.choice input { position: absolute; opacity: 0; inset: 0; cursor: pointer; }
.choice span {
  display: inline-flex; align-items: center; min-height: 44px; padding: 0 16px; border-radius: var(--pill);
  border: 1px solid var(--rule-strong); background: var(--paper); font-weight: 520; transition: all .15s var(--ease);
}
.choice input:checked + span { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.choice input:focus-visible + span { outline: 2px solid var(--magenta); outline-offset: 2px; }
input[type="range"] { accent-color: var(--magenta); width: 100%; }

/* ---------- panels and chips ---------- */
.panel { background: var(--paper); border: 1px solid var(--rule); border-radius: var(--radius); box-shadow: var(--shadow); }
.chip {
  display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: var(--pill);
  border: 1px solid var(--rule-strong); font-size: .84rem; font-weight: 560; color: var(--ink-2); white-space: nowrap;
}
.chip-magenta { border-color: transparent; background: var(--magenta-wash); color: var(--magenta); }
.logo-tile {
  width: 44px; height: 44px; border-radius: 10px; background: #fff; display: grid; place-items: center; flex: none;
  border: 1px solid var(--rule); overflow: hidden;
}
.logo-tile img { width: 28px; height: 28px; object-fit: contain; }
.logo-tile .initial { font-weight: 700; color: #0c2536; }

/* ---------- chart ---------- */
.chart-svg { width: 100%; height: auto; display: block; }
.chart-svg .sea { fill: var(--shoal-3); }
.chart-svg .d200 { fill: var(--shoal-2); }
.chart-svg .d1000 { fill: var(--shoal-1); }
.chart-svg .d2000 { fill: color-mix(in srgb, var(--shoal-1) 45%, var(--paper)); }
.chart-svg .d4000 { fill: var(--paper); }
.chart-svg .contour { fill: none; stroke: var(--contour); stroke-width: .35; opacity: .75; vector-effect: non-scaling-stroke; }
.chart-svg .land { fill: var(--land); stroke: var(--land-edge); stroke-width: .5; vector-effect: non-scaling-stroke; }
.chart-svg .graticule { fill: none; stroke: var(--contour); stroke-width: .5; opacity: .35; stroke-dasharray: 2 3; vector-effect: non-scaling-stroke; }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--rule); padding-block: 56px 40px; background: var(--paper-2); }
.footer-grid { display: grid; gap: 32px; }
@media (min-width: 768px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }
.footer-grid h2 { font-size: 1rem; font-stretch: 92%; letter-spacing: 0; margin-bottom: 12px; }
.footer-grid ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 8px; }
.footer-grid a { text-decoration: none; color: var(--ink-2); }
.footer-grid a:hover { color: var(--ink); text-decoration: underline; }
.disclosure { margin-top: 40px; padding-top: 20px; border-top: 1px solid var(--rule); font-size: .88rem; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 8px 24px; justify-content: space-between; }

/* ---------- breadcrumbs ---------- */
.crumbs { font-size: .88rem; color: var(--ink-2); display: flex; flex-wrap: wrap; gap: 6px; padding-top: 20px; }
.crumbs a { text-decoration: none; }
.crumbs a:hover { text-decoration: underline; }
.crumbs span[aria-hidden] { opacity: .5; }

/* ---------- consent ---------- */
.consent {
  position: fixed; left: 12px; right: 12px; bottom: 12px; z-index: 60; max-width: 560px; margin-left: auto;
  background: var(--paper); border: 1px solid var(--rule-strong); border-radius: 12px; box-shadow: var(--shadow);
  padding: 16px 18px; display: none; gap: 12px;
}
.consent.show { display: grid; }
.consent p { font-size: .92rem; color: var(--ink-2); }
.consent .row { display: flex; gap: 8px; flex-wrap: wrap; }

/* ---------- motion ---------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s var(--ease), transform .7s var(--ease); }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; transform: none; }
}

/* ---------- shared bits ---------- */
.i-sun { display: none; }
.is-night .i-sun { display: block; }
.is-night .i-moon { display: none; }
.btn-lg { min-height: 56px; padding: 0 30px; font-size: 1.06rem; }
.section-head { max-width: 720px; }
.choice-links { display: flex; flex-wrap: wrap; gap: 10px; }
.choice-link {
  display: inline-flex; align-items: center; min-height: 46px; padding: 0 18px; border-radius: var(--pill);
  border: 1px solid var(--rule-strong); text-decoration: none; font-weight: 560; background: var(--paper);
  transition: background-color .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
.choice-link:hover, .choice-link:focus-visible { border-color: var(--magenta); color: var(--magenta); background: var(--magenta-wash); }
.table-wrap { overflow-x: auto; position: relative; }
.faq { max-width: 820px; }
.faq-item { border-top: 1px solid var(--rule); }
.faq-item:last-child { border-bottom: 1px solid var(--rule); }
.faq-item summary { cursor: pointer; list-style: none; padding: 18px 40px 18px 0; font-weight: 600; font-size: 1.08rem; position: relative; }
.faq-item summary::-webkit-details-marker { display: none; }
.faq-item summary::after { content: ""; position: absolute; right: 6px; top: 50%; width: 10px; height: 10px; border-right: 2px solid var(--magenta); border-bottom: 2px solid var(--magenta); transform: translateY(-70%) rotate(45deg); transition: transform .2s var(--ease); }
.faq-item[open] summary::after { transform: translateY(-30%) rotate(-135deg); }
.faq-a { padding: 0 0 20px; color: var(--ink-2); }
.d200, .d1000, .d2000, .d4000 { stroke: var(--contour); stroke-width: .4; vector-effect: non-scaling-stroke; }

/* ---------- latency chart marks ---------- */
.lat-svg { touch-action: pan-y; }
.bc-dot { fill: var(--paper); stroke: var(--magenta); stroke-width: 1.6; vector-effect: non-scaling-stroke; transition: fill .3s var(--ease); }
.bc-ring { fill: none; stroke: var(--magenta); stroke-width: 1.2; vector-effect: non-scaling-stroke; opacity: 0; transform-box: fill-box; transform-origin: center; }
.bc-label { fill: var(--ink); paint-order: stroke; stroke: var(--paper); stroke-width: 3.5px; stroke-linejoin: round; font-family: var(--label); font-style: italic; }
.bc-label .bc-city { font-weight: 500; }
.bc-label .bc-ms { font-family: var(--font); font-style: normal; font-weight: 650; fill: var(--magenta); font-variant-numeric: tabular-nums; }
.bc.is-estimate .bc-ms { fill: var(--ink-2); font-weight: 560; }
.bc.is-lit .bc-dot { fill: var(--magenta); }
.bc.is-lit .bc-ring { animation: flash 1.1s var(--ease) 1; }
.bc.is-best .bc-dot { fill: var(--magenta); }
.bc.is-best .bc-ring { opacity: .9; animation: light 2.6s ease-in-out infinite; }
.is-measuring .bc:not(.is-lit) .bc-dot { animation: wait 1.4s ease-in-out infinite; }
@keyframes flash { 0% { opacity: .9; transform: scale(.6); } 100% { opacity: 0; transform: scale(2.4); } }
/* Fl(2) like a lighthouse: two flashes, then dark */
@keyframes light { 0%, 6%, 18%, 24% { opacity: .95; transform: scale(1); } 3%, 21% { transform: scale(1.35); } 12%, 40%, 100% { opacity: .2; transform: scale(1); } }
@keyframes wait { 50% { opacity: .35; } }
.you-dot { fill: var(--ink); }
.you-ring { fill: none; stroke: var(--ink); stroke-width: 1.4; vector-effect: non-scaling-stroke; stroke-dasharray: 3 3; }
.you-label { fill: var(--ink); font-weight: 650; paint-order: stroke; stroke: var(--paper); stroke-width: 3.5px; }
.course { fill: none; stroke: var(--magenta); stroke-linecap: round; }

.lat-rows { list-style: none; margin: 0; padding: 0; display: grid; gap: 4px; }
.lat-row { display: grid; grid-template-columns: 44px minmax(0, 1fr) 70px; align-items: center; gap: 4px 14px; padding: 10px 0; border-bottom: 1px solid var(--rule); }
.lat-row:last-child { border-bottom: 0; }
.lat-row-name { display: grid; line-height: 1.25; min-width: 0; }
.lat-row-name a { font-weight: 620; text-decoration: none; }
.lat-row-name a:hover { text-decoration: underline; }
.lat-bar { grid-column: 2 / 3; height: 6px; display: block; }
.lat-bar i { display: block; height: 100%; width: var(--w); background: var(--magenta); border-radius: var(--pill); opacity: .85; }
.lat-row:first-child .lat-bar i { opacity: 1; }
.lat-row:not(:first-child) .lat-bar i { background: var(--ink-3); }
.lat-ms { grid-column: 3; grid-row: 1 / span 2; text-align: right; font-weight: 680; font-size: 1.35rem; font-stretch: 88%; }
.lat-ms small { font-size: .8rem; font-weight: 500; color: var(--ink-2); }
.lat-row .logo-tile { grid-row: 1 / span 2; }
.lat-kicker { color: var(--magenta); font-size: 1.05rem; }
.lat-answer h2 { font-size: clamp(1.45rem, 1.2rem + 1vw, 2rem); margin-block: 4px 8px; }
.lat-actions { display: flex; flex-wrap: wrap; gap: 10px; }
.lat-visitors { border: 0; padding: 0; margin: 0; }
.lat-visitors legend { font-weight: 620; margin-bottom: 10px; }
.lat-status { min-height: 1.4em; color: var(--ink-2); }
.i { width: 1.15em; height: 1.15em; flex: none; }
.icon-btn .i { width: 18px; height: 18px; }
.chart-svg { overflow: hidden; }
.lat-stage, .guide-art { overflow: hidden; contain: paint; }
