/* css/base.css: tokens, type, the floating nav, footer and the shared parts every page uses.
   Look: ruled cells and mono labels, in porcelain: glaze white, cobalt, a gilt hairline, meander bands. */

@font-face { font-family: 'Newsreader'; src: url('/fonts/newsreader-latin.woff2') format('woff2'); font-weight: 200 800; font-style: normal; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('/fonts/geist-latin.woff2') format('woff2'); font-weight: 100 900; font-display: swap; }
@font-face { font-family: 'Geist'; src: url('/fonts/geist-latin-ext.woff2') format('woff2'); font-weight: 100 900; font-display: swap; unicode-range: U+0100-024F, U+1E00-1EFF, U+20A0-20CF, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'JetBrains Mono'; src: url('/fonts/jetbrains-mono-latin.woff2') format('woff2'); font-weight: 100 800; font-display: swap; }

:root {
  --glaze: #f6f3eb;
  --paper: #fbf9f4;
  --wash: #e6ecf5;
  --wash-2: #d6e1f1;
  --cobalt: #14348a;
  --cobalt-2: #2150b8;
  --cobalt-deep: #0a1d55;
  --ink: #111a37;
  --ink-2: #39466a;
  --muted: #69738f;
  --gilt: #b8955a;
  --gilt-2: #d8c094;
  --line: rgba(20, 52, 138, 0.15);
  --line-2: rgba(20, 52, 138, 0.3);
  --ok: #1b6e4a;
  --warn: #9a5f14;
  --bad: #a1322a;
  --serif: 'Newsreader', 'Iowan Old Style', Georgia, serif;
  --sans: 'Geist', ui-sans-serif, system-ui, -apple-system, 'Segoe UI', sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1280px;
  --nav-h: 54px;
  --meander: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14' viewBox='0 0 28 14'%3E%3Cpath d='M0 13h4V3h16v8h-8V7h4' fill='none' stroke='%2314348a' stroke-width='1.6' stroke-linecap='square'/%3E%3Cpath d='M4 13h24' fill='none' stroke='%2314348a' stroke-width='1.6'/%3E%3Cpath d='M0 1h28' fill='none' stroke='%2314348a' stroke-width='1.2'/%3E%3C/svg%3E");
  --meander-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='28' height='14' viewBox='0 0 28 14'%3E%3Cpath d='M0 13h4V3h16v8h-8V7h4' fill='none' stroke='%23f6f3eb' stroke-width='1.6' stroke-linecap='square'/%3E%3Cpath d='M4 13h24' fill='none' stroke='%23f6f3eb' stroke-width='1.6'/%3E%3Cpath d='M0 1h28' fill='none' stroke='%23f6f3eb' stroke-width='1.2'/%3E%3C/svg%3E");
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--nav-h) + 32px); }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}
img, svg, video { display: block; max-width: 100%; }
a { color: inherit; }
button, input, textarea, select { font: inherit; color: inherit; }
::selection { background: var(--cobalt); color: var(--glaze); }
:focus-visible { outline: 2px solid var(--cobalt-2); outline-offset: 2px; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* type */
.label {
  font: 500 11.5px/1.3 var(--mono);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--cobalt);
}
.label.muted { color: var(--muted); }
h1, h2, h3, .serif { font-family: var(--serif); font-weight: 400; letter-spacing: -0.015em; margin: 0; }
h1 { font-size: clamp(44px, 7.4vw, 104px); line-height: 0.98; }
h2 { font-size: clamp(34px, 4.6vw, 60px); line-height: 1.04; color: var(--cobalt); }
h3 { font-size: clamp(24px, 2.3vw, 30px); line-height: 1.12; }
p { margin: 0; }
.lede { font-size: clamp(17px, 1.5vw, 20px); line-height: 1.5; color: var(--ink-2); max-width: 46ch; }
code, .code { font-family: var(--mono); font-size: 0.92em; }
.cmd {
  display: inline-flex; align-items: center; gap: 0.4em;
  font: 500 13px/1 var(--mono);
  color: var(--cobalt);
  background: var(--glaze);
  border: 1px solid var(--line-2);
  padding: 7px 10px;
  white-space: nowrap;
}
.cmd b { font-weight: 600; color: var(--cobalt-deep); }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 44px; padding: 0 18px;
  font: 500 12.5px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  text-decoration: none; cursor: pointer;
  border: 1px solid var(--cobalt); background: var(--cobalt); color: var(--glaze);
  transition: background 0.15s, color 0.15s, border-color 0.15s;
}
.btn:hover { background: var(--cobalt-deep); border-color: var(--cobalt-deep); }
.btn.ghost { background: transparent; color: var(--cobalt); }
.btn.ghost:hover { background: var(--cobalt); color: var(--glaze); }
.btn.light { background: var(--glaze); color: var(--cobalt-deep); border-color: var(--glaze); }
.btn.light:hover { background: #fff; }
.btn.line-light { background: transparent; color: var(--glaze); border-color: rgba(246, 243, 235, 0.55); }
.btn.line-light:hover { background: rgba(246, 243, 235, 0.12); }
.btn[disabled] { opacity: 0.5; cursor: not-allowed; }
.arrow::after { content: '\2192'; font-family: var(--sans); letter-spacing: 0; }
.link { font: 500 12px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase; color: var(--cobalt); text-decoration: none; }
.link:hover { text-decoration: underline; text-underline-offset: 4px; }

/* meander band and gilt rule */
.meander { height: 14px; background: var(--meander) repeat-x left center; opacity: 0.9; }
.meander.light { background-image: var(--meander-light); }
.gilt-rule { height: 1px; background: linear-gradient(90deg, transparent, var(--gilt) 12%, var(--gilt) 88%, transparent); border: 0; margin: 0; }

/* grid paper */
.paper-grid {
  background-color: var(--paper);
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 48px 48px;
  background-position: -1px -1px;
}

/* ---------------------------------------------------------------- nav: floating row of cells */
.nav {
  position: fixed; z-index: 50; top: 12px; left: 12px; right: 12px;
  height: var(--nav-h);
  display: flex; align-items: stretch;
  max-width: calc(var(--max) + 24px); margin: 0 auto;
  background: rgba(251, 249, 244, 0.86);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  backdrop-filter: blur(14px) saturate(1.2);
  border: 1px solid var(--line-2);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.6) inset, 0 10px 30px -18px rgba(10, 29, 85, 0.35);
}
.nav-brand {
  display: flex; align-items: center; gap: 10px;
  padding: 0 18px 0 14px;
  text-decoration: none; color: var(--cobalt-deep);
  border-right: 1px solid var(--line);
  font: 500 15px/1 var(--sans); letter-spacing: -0.01em;
}
.nav-brand img { width: 26px; height: 26px; }
.nav-brand span b { font-weight: 600; }
.nav-fill { flex: 1; }
.nav-links { display: flex; }
.nav-links a, .nav-cell {
  display: flex; align-items: center; padding: 0 20px;
  border-left: 1px solid var(--line);
  font: 500 12px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--cobalt); text-decoration: none; white-space: nowrap;
  background: none; border-top: 0; border-right: 0; border-bottom: 0; cursor: pointer;
}
.nav-links a:hover, .nav-cell:hover { background: rgba(20, 52, 138, 0.06); }
.nav-links a[aria-current='page'] { color: var(--cobalt-deep); box-shadow: inset 0 -2px 0 var(--gilt); }
.nav-cta { background: var(--cobalt) !important; color: var(--glaze) !important; border-left-color: var(--cobalt) !important; }
.nav-cta:hover { background: var(--cobalt-deep) !important; }
.nav-menu { width: var(--nav-h); justify-content: center; padding: 0; }
.nav-menu i, .nav-menu i::before, .nav-menu i::after { display: block; width: 18px; height: 1.5px; background: var(--cobalt); position: relative; transition: transform 0.2s; }
.nav-menu i::before, .nav-menu i::after { content: ''; position: absolute; left: 0; }
.nav-menu i::before { top: -6px; }
.nav-menu i::after { top: 6px; }
.nav[data-open] .nav-menu i { background: transparent; }
.nav[data-open] .nav-menu i::before { transform: translateY(6px) rotate(45deg); }
.nav[data-open] .nav-menu i::after { transform: translateY(-6px) rotate(-45deg); }

.sheet {
  position: fixed; z-index: 49; top: calc(12px + var(--nav-h) - 1px); left: 12px; right: 12px;
  max-width: calc(var(--max) + 24px); margin: 0 auto;
  background: var(--paper); border: 1px solid var(--line-2);
  box-shadow: 0 24px 40px -24px rgba(10, 29, 85, 0.4);
  display: none;
}
.sheet[data-open] { display: block; }
.sheet a {
  display: flex; justify-content: space-between; align-items: center;
  padding: 18px 20px; border-top: 1px solid var(--line);
  font: 400 22px/1.1 var(--serif); color: var(--cobalt-deep); text-decoration: none;
}
.sheet a:first-child { border-top: 0; }
.sheet a::after { content: '\2192'; font: 400 16px var(--sans); color: var(--cobalt); }
.sheet a:hover { background: var(--wash); }
.sheet .meander { margin: 0; }

@media (max-width: 860px) {
  .nav-links { display: none; }
  .nav-cta { padding: 0 14px; }
}
@media (min-width: 861px) {
  .sheet .only-small { display: none; }
}
@media (max-width: 420px) {
  .nav { left: 8px; right: 8px; top: 8px; }
  .sheet { left: 8px; right: 8px; top: calc(8px + var(--nav-h) - 1px); }
  .nav-brand { padding: 0 12px 0 10px; font-size: 14px; }
  .nav-cta { font-size: 11px; padding: 0 12px; letter-spacing: 0.05em; }
}

/* ---------------------------------------------------------------- footer */
.foot { background: var(--cobalt-deep); color: var(--glaze); margin-top: 0; }
.foot .meander { opacity: 0.55; }
.foot-top { display: grid; grid-template-columns: 1.3fr 1fr 1fr 1fr; gap: 32px; padding: 56px 0 40px; }
.foot-top p { color: rgba(246, 243, 235, 0.72); max-width: 34ch; margin-top: 14px; font-size: 15px; }
.foot-brand { display: flex; align-items: center; gap: 10px; font: 500 16px var(--sans); }
.foot-brand img { width: 30px; height: 30px; }
.foot h4 { margin: 0 0 14px; font: 500 11.5px/1 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--gilt-2); }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.foot ul a { color: rgba(246, 243, 235, 0.86); text-decoration: none; font-size: 15px; }
.foot ul a:hover { color: #fff; text-decoration: underline; text-underline-offset: 3px; }
.foot-word { padding: 8px 0 0; }
.foot-word svg { width: 100%; height: auto; }
.foot-bottom {
  display: flex; flex-wrap: wrap; gap: 12px 24px; justify-content: space-between; align-items: center;
  padding: 22px 0 28px; border-top: 1px solid rgba(246, 243, 235, 0.16);
  font: 400 12px/1.4 var(--mono); letter-spacing: 0.04em; color: rgba(246, 243, 235, 0.66);
}
.foot-bottom a { color: rgba(246, 243, 235, 0.86); }
@media (max-width: 860px) {
  .foot-top { grid-template-columns: 1fr 1fr; }
  .foot-top > div:first-child { grid-column: 1 / -1; }
}

/* ---------------------------------------------------------------- shared parts */
.section { padding: clamp(72px, 10vw, 140px) 0; position: relative; }
.section-head { display: flex; justify-content: space-between; align-items: end; gap: 24px; margin-bottom: clamp(32px, 4vw, 56px); flex-wrap: wrap; }
.section-head .label { margin-bottom: 18px; }

.card { background: var(--paper); border: 1px solid var(--line-2); }
.pill {
  display: inline-flex; align-items: center; gap: 8px;
  font: 500 11px/1 var(--mono); letter-spacing: 0.08em; text-transform: uppercase;
  padding: 6px 9px; border: 1px solid var(--line-2); color: var(--cobalt); background: var(--glaze);
}
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--muted); flex: none; }
.dot.on { background: #2f9e6a; box-shadow: 0 0 0 3px rgba(47, 158, 106, 0.18); }
.dot.dry { background: var(--gilt); box-shadow: 0 0 0 3px rgba(184, 149, 90, 0.2); }
.dot.off { background: #9aa3b8; }

.empty {
  border: 1px dashed var(--line-2); padding: 28px; text-align: center; color: var(--ink-2);
  background: repeating-linear-gradient(135deg, transparent 0 10px, rgba(20, 52, 138, 0.025) 10px 11px);
}
.empty .label { display: block; margin-bottom: 8px; }

/* reveal on scroll (js/shell.js adds .in) */
.rv { opacity: 0; transform: translateY(14px); transition: opacity 0.6s ease, transform 0.6s ease; }
.rv.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .rv { opacity: 1; transform: none; transition: none; }
}

/* a page top for inner pages: clears the floating nav */
.page-top { padding: calc(var(--nav-h) + 72px) 0 40px; border-bottom: 1px solid var(--line); background: var(--glaze); }
.page-top h1 { font-size: clamp(42px, 6vw, 80px); color: var(--cobalt-deep); }
.page-top .lede { margin-top: 18px; }
.page-top .label { margin-bottom: 18px; }
