/* Solo Operator guide — mobile-first editorial styles. All sizes in rem so the text-size selector scales everything. */

:root {
  --bg: #ffffff;
  --surface: #f1fbfa;
  --surface-2: #e3f6f4;
  --card: #ffffff;
  --ink: #0b2545;
  --ink-soft: #3a5775;
  --line: #cde8e8;
  --turquoise: #0e9aa7;
  --aqua: #3fd0d4;
  --seafoam: #9fe7d6;
  --ocean: #0f5d86;
  --link: #0a6680;
  --link-hover: #0b2545;
  --coral: #c9432c;
  --coral-bg: #fff0ec;
  --coral-line: #f6b4a6;
  --btn-bg: #0f5d86;
  --btn-ink: #ffffff;
  --focus: #0e9aa7;
  --shadow-sm: 0 0.0625rem 0.125rem rgba(11, 37, 69, 0.06);
  --shadow: 0 0.0625rem 0.125rem rgba(11, 37, 69, 0.05), 0 0.75rem 2rem rgba(15, 93, 134, 0.09);
  --hero-a: #e7faf7;
  --hero-b: #ffffff;
  --hero-glow: rgba(63, 208, 212, 0.22);
  --header-bg: rgba(255, 255, 255, 0.97);
  --header-bg-glass: rgba(255, 255, 255, 0.82);
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino, "Book Antiqua", Georgia, "Times New Roman", serif;
  --sans: "Figtree", system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans", sans-serif;
  --pad-x: clamp(1rem, 4vw, 4.5rem);
  --radius: 0.875rem;
  color-scheme: light;
}

html[data-theme="dark"] {
  --bg: #071a2c;
  --surface: #0b2339;
  --surface-2: #0f2d49;
  --card: #0d2740;
  --ink: #e6f5f6;
  --ink-soft: #a6c4d4;
  --line: #1c4263;
  --turquoise: #3fd0d4;
  --aqua: #6fe3e6;
  --seafoam: #9fe7d6;
  --ocean: #5cb8e6;
  --link: #7fe3e7;
  --link-hover: #ffffff;
  --coral: #ff9a85;
  --coral-bg: rgba(255, 138, 115, 0.12);
  --coral-line: rgba(255, 154, 133, 0.45);
  --btn-bg: #3fd0d4;
  --btn-ink: #06243a;
  --focus: #6fe3e6;
  --shadow-sm: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.3);
  --shadow: 0 0.0625rem 0.125rem rgba(0, 0, 0, 0.3), 0 0.75rem 2rem rgba(0, 0, 0, 0.35);
  --hero-a: #0c2b45;
  --hero-b: #071a2c;
  --hero-glow: rgba(63, 208, 212, 0.16);
  --header-bg: rgba(7, 26, 44, 0.97);
  --header-bg-glass: rgba(7, 26, 44, 0.8);
  color-scheme: dark;
}

html { font-size: 100%; -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }
html[data-font-size="sm"] { font-size: 87.5%; }
html[data-font-size="md"] { font-size: 100%; }
html[data-font-size="lg"] { font-size: 115%; }
html[data-font-size="xl"] { font-size: 130%; }

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-align: center;
  overflow-wrap: break-word;
  padding-bottom: env(safe-area-inset-bottom, 0px);
}

h1, h2, h3 { font-family: var(--serif); font-weight: 600; line-height: 1.15; margin: 0; color: var(--ink); letter-spacing: -0.01em; }
p { margin: 0; }
ul, ol { text-align: left; }

a { color: var(--link); text-decoration-thickness: 0.08em; text-underline-offset: 0.18em; }
a:hover { color: var(--link-hover); }
:focus-visible { outline: 0.1875rem solid var(--focus); outline-offset: 0.1875rem; border-radius: 0.25rem; }

.skip-link { position: absolute; left: 0.5rem; top: -3rem; background: var(--btn-bg); color: var(--btn-ink); padding: 0.5rem 1rem; border-radius: 0.5rem; z-index: 50; }
.skip-link:focus { top: calc(0.5rem + env(safe-area-inset-top, 0px)); }

/* Header */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: var(--header-bg);
  border-bottom: 0.0625rem solid var(--line);
  padding-top: env(safe-area-inset-top, 0px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
}
@supports ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .site-header {
    background: var(--header-bg-glass);
    -webkit-backdrop-filter: saturate(1.4) blur(0.75rem);
    backdrop-filter: saturate(1.4) blur(0.75rem);
  }
}
.site-header__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 0.5rem 1.25rem;
  padding: 0.625rem var(--pad-x);
}
.brand { display: inline-flex; align-items: center; gap: 0.5rem; text-decoration: none; color: var(--ink); font-family: var(--serif); font-weight: 700; font-size: 1.25rem; }
.brand img { width: 1.75rem; height: 1.75rem; }
.site-nav { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.25rem 1rem; }
.site-nav a { text-decoration: none; font-weight: 600; color: var(--ink-soft); padding: 0.375rem 0.25rem; border-bottom: 0.125rem solid transparent; }
.site-nav a[aria-current="page"], .site-nav a:hover { color: var(--ink); border-bottom-color: var(--turquoise); }

.prefs { display: flex; flex-wrap: wrap; align-items: center; justify-content: center; gap: 0.5rem; }
.size-group { display: inline-flex; border: 0.0625rem solid var(--line); border-radius: 999rem; padding: 0.125rem; background: var(--surface); }
.size-btn {
  font: inherit; font-family: var(--serif); font-weight: 600; color: var(--ink-soft);
  background: transparent; border: 0; border-radius: 999rem; min-width: 2.25rem; min-height: 2.25rem; padding: 0 0.5rem; cursor: pointer; line-height: 1;
}
.size-btn--sm { font-size: 0.8125rem; }
.size-btn--md { font-size: 0.9375rem; }
.size-btn--lg { font-size: 1.0625rem; }
.size-btn--xl { font-size: 1.25rem; }
.size-btn[aria-pressed="true"] { background: var(--btn-bg); color: var(--btn-ink); }
.theme-btn {
  font: inherit; font-weight: 600; font-size: 0.9375rem; color: var(--ink);
  display: inline-flex; align-items: center; gap: 0.375rem;
  min-height: 2.5rem; padding: 0 0.875rem; border-radius: 999rem; cursor: pointer;
  background: var(--surface); border: 0.0625rem solid var(--line);
}
.theme-btn svg { width: 1.125rem; height: 1.125rem; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.theme-btn__moon { fill: currentColor; stroke: none; }
.theme-btn__sun { display: none; }
html[data-theme="dark"] .theme-btn__moon { display: none; }
html[data-theme="dark"] .theme-btn__sun { display: inline; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; text-align: center;
  min-height: 3rem; padding: 0.75rem 1.375rem; border-radius: 999rem; font-weight: 700; text-decoration: none;
  border: 0.125rem solid transparent; max-width: 100%;
}
.btn--primary { background: var(--btn-bg); color: var(--btn-ink); box-shadow: var(--shadow-sm); }
.btn--primary:hover { color: var(--btn-ink); filter: brightness(1.08); }
.btn--ghost { border-color: var(--ocean); color: var(--ink); background: transparent; }
.btn--ghost:hover { background: var(--surface-2); color: var(--ink); }

/* Hero */
.hero {
  background: radial-gradient(60rem 30rem at 85% -10%, var(--hero-glow), transparent 60%), linear-gradient(170deg, var(--hero-a) 0%, var(--hero-b) 70%);
  border-bottom: 0.0625rem solid var(--line);
}
.hero__inner { display: grid; gap: 2.5rem; padding: 3rem var(--pad-x) 3.5rem; }
.hero__inner > * { min-width: 0; }
.hero__kicker { color: var(--ink-soft); font-weight: 600; margin-bottom: 0.75rem; }
.hero h1 { font-size: clamp(2.375rem, 7vw, 5rem); font-weight: 600; line-height: 1.02; letter-spacing: -0.02em; }
.hero__lead { font-size: 1.1875rem; color: var(--ink-soft); margin: 1.25rem auto 0; max-width: 42rem; }
.hero__actions { display: flex; flex-wrap: wrap; justify-content: center; gap: 0.75rem; margin-top: 1.75rem; }

.route { background: var(--card); border: 0.0625rem solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow); padding: 1.5rem 1.25rem; }
.route__title { font-size: 1.5rem; margin-bottom: 1rem; }
.route__list { list-style: none; margin: 0; padding: 0; counter-reset: route; }
.route__item { position: relative; counter-increment: route; padding: 0 0 1.125rem 3rem; }
.route__item:last-child { padding-bottom: 0; }
.route__item::before {
  content: counter(route); position: absolute; left: 0; top: 0;
  width: 2.125rem; height: 2.125rem; border-radius: 50%; display: grid; place-items: center;
  background: var(--surface-2); color: var(--ink); font-family: var(--serif); font-weight: 700; border: 0.125rem solid var(--turquoise);
}
.route__item::after { content: ""; position: absolute; left: 1.0625rem; top: 2.25rem; bottom: 0.125rem; width: 0.125rem; background: linear-gradient(var(--turquoise), var(--seafoam)); }
.route__item:last-child::after { display: none; }
.route__item a { font-family: var(--serif); font-size: 1.1875rem; font-weight: 600; text-decoration: none; color: var(--ink); }
.route__item a:hover { color: var(--link); text-decoration: underline; }
.route__meta { display: block; color: var(--ink-soft); font-size: 0.9375rem; }
.route__loading { color: var(--ink-soft); }

/* Corrections */
.checked { background: var(--bg); }
.checked__inner { padding: 3rem var(--pad-x); }
.checked h2 { font-size: clamp(1.625rem, 4vw, 2.25rem); margin-bottom: 1.5rem; }
.checked__grid { display: grid; gap: 1rem; }
.checked__grid > * { min-width: 0; }
.note { background: var(--surface); border: 0.0625rem solid var(--line); border-radius: var(--radius); padding: 1.25rem; }
.note h3 { font-size: 1.25rem; margin-bottom: 0.5rem; }
.note p { color: var(--ink-soft); }
.note--warn { background: var(--coral-bg); border-color: var(--coral-line); }
.note--warn h3 { color: var(--coral); }

/* Finder */
.finder { background: var(--surface); border-top: 0.0625rem solid var(--line); border-bottom: 0.0625rem solid var(--line); }
.finder__inner { padding: 2rem var(--pad-x); display: grid; gap: 0.5rem; justify-items: center; }
.finder h2 { font-size: 1.5rem; }
.finder__label { color: var(--ink-soft); font-size: 0.9375rem; }
.finder__input {
  width: 100%; max-width: 40rem; font: inherit; color: var(--ink); background: var(--card);
  border: 0.125rem solid var(--line); border-radius: 999rem; padding: 0.75rem 1.25rem; min-height: 3rem;
}
.finder__input:focus { border-color: var(--turquoise); outline: none; box-shadow: 0 0 0 0.25rem var(--hero-glow); }
.finder__count { color: var(--ink-soft); font-size: 0.9375rem; min-height: 1.5em; }

/* Parts */
.part { padding: 3rem var(--pad-x); border-bottom: 0.0625rem solid var(--line); }
.part:nth-child(even) { background: var(--surface); }
.part__head { margin-bottom: 1.75rem; }
.part__num { color: var(--turquoise); font-weight: 700; font-size: 0.9375rem; margin-bottom: 0.25rem; }
html[data-theme="light"] .part__num { color: var(--ocean); }
.part h2 { font-size: clamp(1.75rem, 4.5vw, 2.75rem); }
.part__intro { color: var(--ink-soft); margin-top: 0.5rem; max-width: 44rem; margin-left: auto; margin-right: auto; }
.cards { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr); }
.card {
  background: var(--card); border: 0.0625rem solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-sm);
  padding: 1.25rem; display: flex; flex-direction: column; gap: 0.5rem; min-width: 0;
}
.card h3 { font-size: 1.3125rem; }
.card h3 a { color: var(--ink); text-decoration: none; }
.card h3 a:hover { color: var(--link); text-decoration: underline; }
.card p { color: var(--ink-soft); }
.card__flag { color: var(--coral); font-weight: 600; font-size: 0.9375rem; }
.card[hidden], .part[hidden] { display: none; }
.parts .notice, .entry .notice { padding: 2rem var(--pad-x); color: var(--ink-soft); }

/* Engine call to action */
.engine-cta { background: linear-gradient(160deg, var(--surface-2), var(--bg)); }
.engine-cta__inner { padding: 3.5rem var(--pad-x); display: grid; gap: 1rem; justify-items: center; }
.engine-cta h2 { font-size: clamp(1.75rem, 4.5vw, 2.5rem); }
.engine-cta p { color: var(--ink-soft); max-width: 40rem; }

/* Entry page */
.entry__head { padding: 2.5rem var(--pad-x) 2rem; background: linear-gradient(170deg, var(--hero-a), var(--hero-b)); border-bottom: 0.0625rem solid var(--line); }
.crumbs { font-size: 0.9375rem; color: var(--ink-soft); margin-bottom: 1rem; }
.crumbs a { color: var(--link); }
.entry h1 { font-size: clamp(2.125rem, 6vw, 4rem); line-height: 1.05; letter-spacing: -0.02em; }
.entry__summary { font-size: 1.1875rem; color: var(--ink-soft); margin-top: 1rem; max-width: 46rem; margin-left: auto; margin-right: auto; }
.entry__layout { display: grid; gap: 2rem; padding: 2.5rem var(--pad-x) 3rem; }
.entry__layout > * { min-width: 0; }
.entry__body { display: grid; gap: 1.125rem; }
.entry__body p { font-size: 1.125rem; line-height: 1.7; }
.entry__body h2 { font-size: 1.5rem; margin-top: 0.75rem; }
.steps { margin: 0; padding-left: 1.5rem; display: grid; gap: 0.75rem; }
.steps li { padding-left: 0.375rem; font-size: 1.0625rem; }
.steps li::marker { color: var(--ocean); font-family: var(--serif); font-weight: 700; }
.warn { background: var(--coral-bg); border: 0.0625rem solid var(--coral-line); border-left-width: 0.3125rem; border-left-color: var(--coral); border-radius: 0.625rem; padding: 1rem 1.125rem; }
.warn strong { color: var(--coral); display: block; margin-bottom: 0.25rem; }

.glance { background: var(--surface); border: 0.0625rem solid var(--line); border-radius: var(--radius); padding: 1.25rem; box-shadow: var(--shadow-sm); }
.glance h2 { font-size: 1.375rem; margin-bottom: 0.75rem; }
.glance dl { margin: 0; display: grid; gap: 0.75rem; }
.glance__row { display: grid; gap: 0.125rem; padding-bottom: 0.75rem; border-bottom: 0.0625rem solid var(--line); }
.glance__row:last-child { border-bottom: 0; padding-bottom: 0; }
.glance dt { font-weight: 700; font-size: 0.9375rem; color: var(--ink-soft); }
.glance dd { margin: 0; }
.tags { list-style: none; margin: 1rem 0 0; padding: 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 0.375rem; }
.tags li { background: var(--card); border: 0.0625rem solid var(--line); border-radius: 999rem; padding: 0.125rem 0.625rem; font-size: 0.875rem; color: var(--ink-soft); }
.source { font-size: 0.9375rem; color: var(--ink-soft); margin-top: 1rem; }
.ask { margin-top: 1.25rem; display: grid; gap: 0.5rem; justify-items: center; }
.pager { display: grid; gap: 0.75rem; padding: 0 var(--pad-x) 3rem; }
.pager a { display: block; border: 0.0625rem solid var(--line); border-radius: var(--radius); padding: 1rem 1.25rem; text-decoration: none; background: var(--card); min-width: 0; }
.pager a:hover { border-color: var(--turquoise); }
.pager__dir { display: block; font-size: 0.875rem; color: var(--ink-soft); font-weight: 600; }
.pager__title { display: block; font-family: var(--serif); font-size: 1.1875rem; font-weight: 600; color: var(--ink); }

/* Footer */
.site-footer { background: var(--surface); border-top: 0.0625rem solid var(--line); }
.site-footer__inner { padding: 2rem var(--pad-x) calc(2rem + env(safe-area-inset-bottom, 0px)); display: grid; gap: 0.5rem; color: var(--ink-soft); font-size: 0.9375rem; }

/* Tablet */
@media (min-width: 48em) {
  body { text-align: left; }
  .site-header__inner { justify-content: space-between; }
  .site-nav { margin-right: auto; }
  .hero__actions, .tags { justify-content: flex-start; }
  .hero__lead, .part__intro, .entry__summary { margin-left: 0; margin-right: 0; }
  .finder__inner, .engine-cta__inner, .ask { justify-items: start; }
  .checked__grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pager { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .pager a.pager__next { text-align: right; grid-column: 2; }
  .glance__row { grid-template-columns: minmax(0, 10rem) minmax(0, 1fr); gap: 1rem; }
}

/* Desktop */
@media (min-width: 64em) {
  .hero__inner { grid-template-columns: minmax(0, 1.5fr) minmax(0, 1fr); align-items: center; padding-top: 4.5rem; padding-bottom: 5rem; }
  .cards { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .entry__layout { grid-template-columns: minmax(0, 1.8fr) minmax(0, 1fr); align-items: start; }
  .entry__side { position: sticky; top: calc(5rem + env(safe-area-inset-top, 0px)); }
  .glance__row { grid-template-columns: minmax(0, 1fr); gap: 0.125rem; }
}

@media (min-width: 90em) {
  .cards { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .entry__layout { grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 4rem; }
}

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