/* Astronomy Nav – website. Night at sea above, the chart table below. */
:root {
  --night: #0a1222;      /* sky and sea after sunset */
  --panel: #111c31;      /* raised surfaces at night */
  --line: #24324d;       /* hairlines at night */
  --ink: #e6ebf3;
  --ink-dim: #9aa7be;
  --gold: #f5c842;       /* the FIX gold from the app */
  --paper: #e8eef1;      /* plotting sheet */
  --paper-ink: #13233b;
  --paper-dim: #4a5b73;
  --grid: #b9c8d3;
  --display: "Barlow Condensed", "Arial Narrow", sans-serif;
  --body: "IBM Plex Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--night); color: var(--ink); font: 400 17px/1.6 var(--body); -webkit-text-size-adjust: 100%; }
a { color: var(--gold); text-underline-offset: 3px; }
a:hover { text-decoration-thickness: 2px; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 3px; }
img, svg, canvas { max-width: 100%; }
.wrap { width: min(1080px, 100% - 32px); margin-inline: auto; }
.skip-link { position: absolute; left: -999px; top: 8px; background: var(--gold); color: var(--night); padding: 6px 12px; border-radius: 4px; z-index: 10; }
.skip-link:focus { left: 16px; }

/* type scale (1.25) */
h1, h2, h3 { font-family: var(--display); font-weight: 600; line-height: 1.08; margin: 0; text-wrap: balance; }
h1 { font-size: clamp(44px, 7.2vw, 84px); font-weight: 700; letter-spacing: -.005em; }
h2 { font-size: clamp(32px, 4.2vw, 46px); }
h3 { font-size: 24px; }
p { margin: 0; max-width: 64ch; }
.lead { font-size: clamp(18px, 2vw, 21px); color: var(--ink-dim); }

/* header */
.top { border-bottom: 1px solid var(--line); }
.top .wrap { display: flex; align-items: center; gap: 24px; min-height: 64px; flex-wrap: wrap; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; font: 700 24px/1 var(--display); letter-spacing: .01em; }
.brand svg { width: 28px; height: 28px; }
.top nav { display: flex; gap: 22px; margin-left: auto; flex-wrap: wrap; }
.top nav a { color: var(--ink-dim); text-decoration: none; font-size: 15px; }
.top nav a:hover, .top nav a[aria-current] { color: var(--ink); }
.top .lang { border: 1px solid var(--line); border-radius: 999px; padding: 2px 12px; }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 48px; padding: 0 22px; border-radius: 6px; font: 600 17px var(--body); text-decoration: none; border: 1px solid transparent; cursor: pointer; }
.btn-gold { background: var(--gold); color: #1a1405; }
.btn-gold:hover { background: #ffd65c; }
.btn-line { color: var(--ink); border-color: #3a4b6c; background: transparent; }
.btn-line:hover { border-color: var(--ink-dim); }
.actions { display: flex; flex-wrap: wrap; gap: 12px; }

/* hero */
.hero { padding: clamp(48px, 8vw, 96px) 0 0; }
.hero .intro { display: grid; gap: 22px; }
.hero .note { color: var(--ink-dim); font-size: 15px; }
.stage { position: relative; margin-top: clamp(36px, 6vw, 64px); aspect-ratio: 16 / 9; background: #050a14; border: 1px solid var(--line); border-bottom: 0; border-radius: 10px 10px 0 0; overflow: hidden; }
.stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.stage-bar { display: flex; align-items: center; gap: 14px; padding: 10px 14px; border: 1px solid var(--line); border-radius: 0 0 10px 10px; color: var(--ink-dim); font-size: 14px; }
.stage-bar button { font: 500 14px var(--body); color: var(--ink); background: transparent; border: 1px solid var(--line); border-radius: 6px; padding: 5px 14px; cursor: pointer; }
.stage-bar button:hover { border-color: var(--ink-dim); }
/* wide screens: text beside the animation, so the whole animation is in the first screen */
@media (min-width: 960px) {
  .hero { padding-top: clamp(32px, 5vh, 56px); }
  .top .wrap, .hero .hero-grid { width: min(1320px, 100% - 48px); }
  .hero .hero-grid { display: grid; grid-template-columns: minmax(340px, 5fr) 8fr; gap: clamp(28px, 3.5vw, 56px); align-items: center; }
  .hero h1 { font-size: clamp(44px, 4.3vw, 66px); }
  .hero .lead { font-size: 18px; }
  .hero .intro { gap: 18px; }
  .hero .stage { margin-top: 0; }
  .hero .actions .btn { padding: 0 18px; }
}
@media (min-width: 960px) and (max-height: 820px) {
  .hero .stage-col { max-width: calc((100vh - 64px - 120px) * 16 / 9); justify-self: end; width: 100%; }
}

/* night sections */
.band { padding: clamp(64px, 9vw, 112px) 0; }
.band + .band { border-top: 1px solid var(--line); }
.head { display: grid; gap: 12px; margin-bottom: clamp(28px, 4vw, 44px); }
.steps { list-style: none; margin: 0; padding: 0; counter-reset: s; display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 28px 48px; }
.steps li { counter-increment: s; display: grid; grid-template-columns: 40px 1fr; gap: 4px 14px; align-items: baseline; }
.steps li::before { content: counter(s); grid-row: span 2; font: 700 34px/1 var(--display); color: var(--gold); }
.steps b { font-weight: 600; }
.steps span { color: var(--ink-dim); grid-column: 2; }

/* plotting sheet */
.sheet { background: var(--paper); color: var(--paper-ink); padding: clamp(64px, 9vw, 112px) 0; color-scheme: light; }
.sheet a { color: #1c4f9c; }
.sheet .lead { color: var(--paper-dim); }
.sheet-grid { display: grid; grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr); gap: clamp(28px, 4vw, 56px); align-items: start; }
.plot { width: 100%; height: auto; display: block; font-family: var(--body); }
.plot .paper { fill: #f4f7f9; stroke: var(--grid); }
.plot .grid { stroke: var(--grid); stroke-width: 1; }
.plot .lop { stroke-width: 2.2; }
.plot text { paint-order: stroke; stroke: #f4f7f9; stroke-width: 4px; stroke-linejoin: round; }
.plot .star { font: 600 13px var(--body); }
.plot .lab { font-size: 12px; fill: var(--paper-dim); }
.plot .dr line { stroke: var(--paper-dim); stroke-width: 1.5; }
.plot .fix circle, .plot .fix line { fill: none; stroke: var(--paper-ink); stroke-width: 2.4; }
.plot .fixlab { font: 700 16px var(--display); fill: var(--paper-ink); }
.plot .fixpos { font-size: 12.5px; fill: var(--paper-ink); }
.plot .scale line { stroke: var(--paper-dim); stroke-width: 1.5; }
.sights { width: 100%; border-collapse: collapse; font-variant-numeric: tabular-nums; font-size: 15px; }
.sights caption { text-align: left; color: var(--paper-dim); font-size: 14px; padding-bottom: 8px; }
.sights th, .sights td { text-align: left; padding: 7px 10px 7px 0; border-bottom: 1px solid var(--grid); }
.sights th { font-weight: 600; font-size: 13.5px; color: var(--paper-dim); }
.sights td.n, .sights th.n { text-align: right; }
.sights tfoot td { border-bottom: 0; font-weight: 600; padding-top: 12px; }
.swatch { display: inline-block; width: 14px; height: 3px; border-radius: 2px; vertical-align: middle; margin-right: 8px; }

/* features */
.features { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 0 48px; margin: 0; }
.features div { padding: 18px 0; border-top: 1px solid var(--line); }
.features dt { font-weight: 600; }
.features dd { margin: 4px 0 0; color: var(--ink-dim); }
.limits { margin-top: 28px; color: var(--ink-dim); font-size: 15px; }

/* accuracy */
.acc { width: 100%; max-width: 760px; border-collapse: collapse; font-variant-numeric: tabular-nums; }
.acc th, .acc td { padding: 12px 16px 12px 0; border-bottom: 1px solid var(--line); text-align: left; }
.acc th { font-weight: 500; color: var(--ink-dim); font-size: 15px; }
.acc td:first-child { font-family: var(--display); font-size: 22px; font-weight: 600; }
.acc-note { margin-top: 18px; color: var(--ink-dim); font-size: 15px; }

/* who + what you need */
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); }
.two .terms-list { margin-bottom: 0; }

/* equipment */
.kit { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 32px 28px; }
.kit li { display: grid; gap: 4px; align-content: start; }
.kit-svg { width: 100%; height: auto; margin-bottom: 10px; }
.kit b { font-family: var(--display); font-size: 24px; font-weight: 600; }
.kit span { color: var(--ink-dim); font-size: 15px; }
.who { margin-top: clamp(40px, 6vw, 64px); display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 40px; align-items: baseline; }
.who .terms-list { margin: 0; display: flex; flex-wrap: wrap; gap: 10px 32px; }

/* price + download */
.buy { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 64px); align-items: start; }
.price { font: 700 clamp(64px, 9vw, 104px)/1 var(--display); color: var(--gold); }
.price small { font-size: .32em; font-weight: 600; color: var(--ink-dim); margin-left: 8px; }
.terms-list { list-style: none; padding: 0; margin: 22px 0 28px; display: grid; gap: 10px; }
.terms-list li { padding-left: 22px; position: relative; }
.terms-list li::before { content: ""; position: absolute; left: 0; top: .72em; width: 10px; height: 2px; background: var(--gold); }
.dl { display: grid; gap: 14px; }
.dl-item { border: 1px solid var(--line); border-radius: 8px; padding: 18px 20px; display: grid; gap: 6px; background: var(--panel); }
.dl-item p { color: var(--ink-dim); font-size: 15px; }
.dl-item .btn { justify-self: start; margin-top: 8px; }
.fine { color: var(--ink-dim); font-size: 14px; }

/* about + footer */
.about p + p { margin-top: 14px; }
.foot { border-top: 1px solid var(--line); padding: 40px 0 56px; color: var(--ink-dim); font-size: 14px; }
.foot .wrap { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 24px; }
.foot nav { display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: flex-end; align-content: start; }
.foot a { color: var(--ink); }

/* legal / text pages */
.doc { padding: clamp(48px, 7vw, 88px) 0; }
.doc .wrap { max-width: 760px; }
.doc h1 { font-size: clamp(38px, 5.4vw, 60px); margin-bottom: 12px; }
.doc h2 { margin: 56px 0 8px; font-size: 34px; }
.doc h3 { margin: 30px 0 6px; font-size: 22px; }
.doc p, .doc li { color: #cfd6e2; }
.doc p + p { margin-top: 12px; }
.doc ul, .doc ol { padding-left: 22px; margin: 10px 0; }
.doc li ul { margin: 6px 0 0; }
.doc ol > li::marker { font-family: var(--display); font-weight: 700; color: var(--gold); }
.doc code { font-family: ui-monospace, Consolas, monospace; font-size: .9em; background: var(--panel); border: 1px solid var(--line); border-radius: 4px; padding: 1px 5px; color: var(--ink); white-space: nowrap; }
.doc b { color: var(--ink); font-weight: 600; }
.doc h3[id], .doc h2[id] { scroll-margin-top: 16px; }
.doc li + li { margin-top: 6px; }
.doc .meta { color: var(--ink-dim); }
.doc table { width: 100%; border-collapse: collapse; margin: 12px 0; font-size: 15px; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 9px 12px 9px 0; border-bottom: 1px solid var(--line); }
.doc th { color: var(--ink-dim); font-weight: 500; font-size: 14px; }
.doc .toc { display: flex; gap: 20px; flex-wrap: wrap; margin-top: 8px; }
.scroll-x { overflow-x: auto; }
.todo { background: #5a4510; color: #ffe7a0; padding: 0 4px; border-radius: 3px; }

@media (max-width: 820px) {
  .sheet-grid, .buy, .two { grid-template-columns: minmax(0, 1fr); }
  .foot .wrap { grid-template-columns: minmax(0, 1fr); }
  .foot nav { justify-content: flex-start; }
  .kit { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .who { grid-template-columns: minmax(0, 1fr); }
  .top nav { margin-left: 0; width: 100%; gap: 16px; padding-bottom: 12px; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .actions .btn { width: 100%; }
  .sights { font-size: 14px; }
  .sights .opt { display: none; }
}
