/* ==========================================================================
   shiplog.css — the Ship Log design system for haploapp.com
   Haplo reads like a changelog: paper, ink, blueprint blue, stamp red.
   Every color flows through custom properties; both themes ship from here.
   Load AFTER bootstrap + styles.css so equal-specificity rules win.
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. Tokens
   -------------------------------------------------------------------------- */
:root {
  /* paper + ink (light, default) */
  --paper: #faf8f5;
  --paper-raised: #ffffff;
  --paper-flat: #fffdf9;
  --ink: #14213d;
  --ink-soft: #4a5568;
  --line: rgba(20, 33, 61, .12);
  --line-strong: rgba(20, 33, 61, .24);

  /* accents */
  --blue: #2563eb;
  --blue-hover: #1d4fc4;
  --blue-tint: rgba(37, 99, 235, .08);
  --red: #d62828;
  --green: #1e7d4f;

  /* component tokens */
  --header-bg: rgba(250, 248, 245, .92);
  --btn-primary-bg: #2563eb;
  --btn-primary-ink: #ffffff;
  --btn-primary-hover: #1d4fc4;
  --focus-ring: rgba(37, 99, 235, .2);
  --row-hover: rgba(20, 33, 61, .035);
  --icon-tile-a: #e9edf6;
  --icon-tile-b: #cdd6e8;
  --shimmer: rgba(255, 255, 255, .6);
  --shadow-card: 0 1px 2px rgba(20, 33, 61, .05), 0 14px 30px -20px rgba(20, 33, 61, .28);
  --shadow-pop: 0 6px 16px -8px rgba(20, 33, 61, .18), 0 24px 48px -24px rgba(20, 33, 61, .3);

  /* footer is navy-on-paper in light, near-black in dark */
  --footer-bg: #14213d;
  --footer-ink-strong: #faf8f5;
  --footer-ink: rgba(250, 248, 245, .82);
  --footer-ink-soft: rgba(250, 248, 245, .6);
  --footer-line: rgba(250, 248, 245, .16);

  /* type */
  --font-display: "Space Grotesk", system-ui, sans-serif;
  --font-mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;

  /* rhythm */
  --s1: 4px; --s2: 8px; --s3: 16px; --s4: 24px; --s5: 40px; --s6: 64px; --s7: 104px;
  --container: 1080px;
  --narrow: 820px;
  --rail-x: 34px;
  --radius: 10px;
  --radius-sm: 6px;
  --header-h: 58px;
}

[data-theme="dark"] {
  /* night blueprint */
  --paper: #10141f;
  --paper-raised: #171c2b;
  --paper-flat: #141927;
  --ink: #e6e9f2;
  --ink-soft: #98a2b8;
  --line: rgba(230, 233, 242, .14);
  --line-strong: rgba(230, 233, 242, .28);

  --blue: #5b8bff;
  --blue-hover: #82a7ff;
  --blue-tint: rgba(91, 139, 255, .14);
  --red: #ff6b6b;
  --green: #5ecf96;

  --header-bg: rgba(16, 20, 31, .88);
  --btn-primary-bg: #5b8bff;
  --btn-primary-ink: #0e1322;
  --btn-primary-hover: #82a7ff;
  --focus-ring: rgba(91, 139, 255, .3);
  --row-hover: rgba(230, 233, 242, .05);
  --icon-tile-a: #232a3d;
  --icon-tile-b: #161c2c;
  --shimmer: rgba(255, 255, 255, .07);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, .35), 0 14px 30px -18px rgba(0, 0, 0, .6);
  --shadow-pop: 0 10px 24px -10px rgba(0, 0, 0, .55), 0 30px 60px -30px rgba(0, 0, 0, .7);

  --footer-bg: #0c101a;
  --footer-ink-strong: #e6e9f2;
  --footer-ink: rgba(230, 233, 242, .82);
  --footer-ink-soft: rgba(230, 233, 242, .58);
  --footer-line: rgba(230, 233, 242, .14);
}

/* --------------------------------------------------------------------------
   2. Base
   -------------------------------------------------------------------------- */
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.12;
  color: var(--ink);
}

a { color: var(--blue); }
a:hover { color: var(--blue-hover); }

::selection { background: var(--blue); color: #fff; }

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

[id] { scroll-margin-top: calc(var(--header-h) + 18px); }

hr { border: 0; border-top: 1px solid var(--line); opacity: 1; }

code, kbd, pre { font-family: var(--font-mono); }

/* legacy styles.css compensations — new header is sticky (in flow) */
.page-content { padding-top: 0; }

.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 2000;
  background: var(--ink); color: var(--paper);
  font-family: var(--font-mono); font-size: 14px;
  padding: 10px 16px; border-radius: 0 0 var(--radius) 0;
  text-decoration: none;
}
.skip-link:focus-visible { left: 0; }

/* layout containers */
.wrap { max-width: var(--container); margin: 0 auto; padding: 0 var(--s4); }
.wrap-narrow { max-width: var(--narrow); margin: 0 auto; padding: 0 var(--s4); }
.section { padding: var(--s6) 0; }

/* --------------------------------------------------------------------------
   3. Section headers — mono eyebrow + display title
   -------------------------------------------------------------------------- */
.section-head { margin-bottom: var(--s5); }
.eyebrow {
  font-family: var(--font-mono); font-size: 13px; font-weight: 500;
  color: var(--ink-soft); letter-spacing: .04em;
  display: block; margin-bottom: var(--s2);
}
.section-head h1,
.section-head h2 {
  font-size: clamp(1.7rem, 4vw, 2.4rem);
  font-weight: 700; letter-spacing: -0.01em; margin: 0;
}
.section-lede { color: var(--ink-soft); max-width: 56ch; margin: var(--s3) 0 0; }

/* blinking terminal cursor — use sparingly */
.cursor {
  display: inline-block; width: .55em; height: 1.05em;
  background: var(--blue);
  margin-left: .35em; vertical-align: text-bottom;
  animation: shiplog-blink 1.1s steps(2, start) infinite;
}
@keyframes shiplog-blink { to { visibility: hidden; } }

/* --------------------------------------------------------------------------
   4. Hero
   -------------------------------------------------------------------------- */
.hero { padding: var(--s7) 0 var(--s6); }
.hero h1 {
  font-size: clamp(2.5rem, 7.2vw, 5.25rem);
  font-weight: 700; letter-spacing: -0.02em;
  max-width: 20ch; margin: 0;
}
.hero h1 .often {
  font-family: var(--font-mono); font-weight: 500; font-size: .32em;
  color: var(--red); vertical-align: baseline;
  letter-spacing: 0; white-space: nowrap;
}
.hero-tagline {
  font-family: var(--font-mono);
  font-size: clamp(.85rem, 2.4vw, 1.05rem);
  color: var(--ink-soft);
  margin: var(--s4) 0 0; letter-spacing: .01em;
}
.hero-tagline .stat { white-space: nowrap; }
.hero-body { max-width: 56ch; color: var(--ink-soft); margin: var(--s4) 0 0; font-size: 1.06rem; }
.hero-actions { margin-top: var(--s5); display: flex; gap: var(--s3); flex-wrap: wrap; align-items: center; }

/* --------------------------------------------------------------------------
   5. Buttons — mono labels, blueprint blue
   -------------------------------------------------------------------------- */
.btn-ship {
  display: inline-flex; align-items: center; justify-content: center; gap: 9px;
  font-family: var(--font-mono); font-size: 13.5px; font-weight: 500;
  line-height: 1.4; text-decoration: none; text-align: center;
  border: 1.5px solid transparent; border-radius: var(--radius-sm);
  padding: 11px 18px; cursor: pointer;
  -webkit-appearance: none; appearance: none;
  transition: background-color .15s ease, border-color .15s ease, color .15s ease;
}
.btn-ship svg { flex: none; }
.btn-ship:disabled, .btn-ship[aria-disabled="true"] { opacity: .55; pointer-events: none; }

.btn-ship-primary { background: var(--btn-primary-bg); color: var(--btn-primary-ink); }
.btn-ship-primary:hover { background: var(--btn-primary-hover); color: var(--btn-primary-ink); }

.btn-ship-secondary { background: transparent; color: var(--blue); border-color: var(--blue); }
.btn-ship-secondary:hover { background: var(--blue-tint); color: var(--blue); }

.btn-ship-sm { padding: 7px 12px; font-size: 12.5px; }
.btn-ship-block { display: flex; width: 100%; }

/* quiet inline action */
.link-more {
  font-family: var(--font-mono); font-size: 13.5px; font-weight: 500;
  color: var(--blue); text-decoration: underline;
  text-underline-offset: 4px; text-decoration-thickness: 1.5px;
  padding: 6px 0; background: none; border: 0; cursor: pointer;
}
.link-more:hover { color: var(--blue-hover); }

/* --------------------------------------------------------------------------
   6. Paper cards
   -------------------------------------------------------------------------- */
.paper-card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  padding: var(--s4);
}
.paper-card-flat {
  background: var(--paper-flat);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s4);
}

/* --------------------------------------------------------------------------
   7. Mono chips / tags / version numbers
   -------------------------------------------------------------------------- */
.chip {
  display: inline-block;
  font-family: var(--font-mono); font-size: 11.5px; letter-spacing: .03em;
  color: var(--ink-soft);
  border: 1px solid var(--line-strong); border-radius: 4px;
  padding: 1.5px 7px; white-space: nowrap;
}
.chip-progress, .chip-blue { color: var(--blue); border-color: var(--blue); }
.chip-red { color: var(--red); border-color: var(--red); }
.vnum { font-family: var(--font-mono); font-size: 12.5px; font-weight: 600; color: var(--ink); }

/* --------------------------------------------------------------------------
   8. Ship log — rail, commit dots, release entries
   -------------------------------------------------------------------------- */
.log {
  list-style: none; margin: 0; padding: 0;
  position: relative;
  max-width: var(--narrow);
}
.log::before {
  content: ""; position: absolute; top: 8px; bottom: 8px; left: var(--rail-x);
  width: 2px; background: var(--line-strong);
}
.entry { position: relative; padding: 0 0 var(--s5) calc(var(--rail-x) + 42px); }
.entry:last-child { padding-bottom: var(--s2); }

/* commit dot: hollow until .in-view */
.node {
  position: absolute; left: var(--rail-x); top: 26px;
  width: 18px; height: 18px; transform: translateX(-8px);
  border-radius: 50%;
  background: var(--paper);
  border: 2px solid var(--line-strong);
}
.node::after {
  content: ""; position: absolute; inset: 3px; border-radius: 50%;
  background: var(--blue);
  transform: scale(0);
  transition: transform .3s cubic-bezier(.2, 1, .3, 1) .12s;
}
.entry.in-view .node { border-color: var(--blue); }
.entry.in-view .node::after { transform: scale(1); }

.entry-card {
  position: relative;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: var(--s4) 28px;
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: var(--s3) var(--s4);
}
.log > .entry:nth-child(odd) .entry-card { background: var(--paper-raised); box-shadow: var(--shadow-card); }
.log > .entry:nth-child(even) .entry-card { background: var(--paper-flat); }

.entry-head {
  grid-column: 1 / -1;
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-soft);
}
.leader { flex: 1; min-width: 24px; border-bottom: 2px dotted var(--line-strong); transform: translateY(-4px); }
.ship-date { white-space: nowrap; }

.app-icon {
  position: relative; width: 72px; height: 72px;
  border-radius: 22%; overflow: hidden;
  background: linear-gradient(145deg, var(--icon-tile-a), var(--icon-tile-b));
  border: 1px solid var(--line);
}
.app-icon::after {
  content: attr(data-initial);
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono); font-weight: 600; font-size: 30px;
  color: var(--ink); opacity: .75;
}
.app-icon img {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; z-index: 1;
  transition: opacity .25s ease;
}
.app-icon img.pending { opacity: 0; }

.entry-body { min-width: 0; }
.entry-body h3 { font-size: 1.35rem; font-weight: 600; letter-spacing: -0.01em; margin: 0; }
.pitch { color: var(--ink-soft); margin: 6px 0 0; max-width: 52ch; }
.proof {
  font-family: var(--font-mono); font-size: 13px; line-height: 1.55;
  color: var(--ink);
  border-left: 3px solid var(--blue);
  padding: 2px 0 2px 14px;
  margin: var(--s3) 0 0;
  max-width: 58ch;
}
.proof::before { content: "+ "; color: var(--blue); font-weight: 600; }
.entry-actions { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s3); }

/* "in progress" entry: dashed card, pulsing dot */
.entry-next .node { border-color: var(--line-strong); }
.entry-next .node::after { background: var(--blue); transform: scale(1); animation: shiplog-pulse 1.6s ease-in-out infinite; }
@keyframes shiplog-pulse { 0%, 100% { opacity: 1; } 50% { opacity: .25; } }
.entry-next .entry-card { grid-template-columns: 1fr; border-style: dashed; border-color: var(--line-strong); }
.log > .entry-next:nth-child(odd) .entry-card,
.log > .entry-next:nth-child(even) .entry-card { background: transparent; box-shadow: none; }

/* --------------------------------------------------------------------------
   9. The SHIPPED stamp — signature element
   Static by default. With JS, add .stamp-in (e.g. from an
   IntersectionObserver) to thunk it in. html gets .js from base.html.
   -------------------------------------------------------------------------- */
.stamp {
  position: absolute; top: -13px; right: 20px; z-index: 2;
  font-family: var(--font-mono); font-weight: 600;
  font-size: 15px; letter-spacing: .16em;
  color: var(--red);
  border: 3px solid var(--red);
  border-radius: 5px;
  padding: 4px 12px 3px 14px;
  background: var(--paper);
  box-shadow: inset 0 0 0 1.5px var(--paper), inset 0 0 0 2.5px rgba(214, 40, 40, .55);
  transform: rotate(-8deg);
  opacity: .92;
  -webkit-mask-image: radial-gradient(ellipse at 32% 38%, #000 55%, rgba(0, 0, 0, .72) 100%);
  mask-image: radial-gradient(ellipse at 32% 38%, #000 55%, rgba(0, 0, 0, .72) 100%);
  pointer-events: none;
  user-select: none;
}
html.js .stamp:not(.stamp-in) { opacity: 0; transform: rotate(-8deg) scale(1.6); }
.stamp.stamp-in { animation: shiplog-thunk .38s cubic-bezier(.25, 1.3, .35, 1) forwards; }
@keyframes shiplog-thunk {
  0% { opacity: 0; transform: rotate(-8deg) scale(1.6); }
  62% { opacity: 1; transform: rotate(-8deg) scale(.94); }
  100% { opacity: .92; transform: rotate(-8deg) scale(1); }
}

/* --------------------------------------------------------------------------
   10. Manifest checklist + pull-quote reviews
   -------------------------------------------------------------------------- */
.manifest {
  list-style: none; margin: var(--s4) 0 0; padding: 0;
  font-family: var(--font-mono); font-size: 14px;
  display: grid; gap: 10px;
}
.manifest li::before { content: "[x] "; color: var(--blue); font-weight: 600; }

.review {
  background: var(--paper-raised);
  border: 1px solid var(--line); border-radius: var(--radius);
  padding: var(--s3) var(--s4);
  margin: 0;
}
.review blockquote { margin: 0; font-size: .98rem; color: var(--ink); border: 0; padding: 0; }
.review figcaption { font-family: var(--font-mono); font-size: 12.5px; color: var(--ink-soft); margin-top: var(--s2); }
.review figcaption::before { content: "— "; }
.review .via { color: var(--ink-soft); }

/* --------------------------------------------------------------------------
   11. Forms — auth pages, contact, feature requests
   Ship-log classes (.field-*) also restyle Bootstrap form classes so
   legacy pages inherit the look until they're rewritten.
   -------------------------------------------------------------------------- */
.field { margin-bottom: var(--s4); }
.field-label, .form-label {
  display: block;
  font-family: var(--font-mono); font-size: 12.5px; font-weight: 500;
  letter-spacing: .04em; color: var(--ink);
  margin-bottom: 8px;
}
.field-input, .field-select, .form-control, .form-select {
  display: block; width: 100%;
  font-family: var(--font-body); font-size: 15px; line-height: 1.45;
  color: var(--ink);
  background-color: var(--paper-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-sm);
  padding: 10px 12px;
  transition: border-color .15s ease, box-shadow .15s ease;
}
.field-input::placeholder, .form-control::placeholder { color: var(--ink-soft); opacity: .75; }
.field-input:focus, .field-select:focus, .form-control:focus, .form-select:focus {
  outline: none;
  color: var(--ink);
  background-color: var(--paper-raised);
  border-color: var(--blue);
  box-shadow: 0 0 0 3px var(--focus-ring);
}
textarea.field-input, textarea.form-control { min-height: 120px; resize: vertical; }

.field-select, .form-select {
  -webkit-appearance: none; appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%2314213d' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
[data-theme="dark"] .field-select, [data-theme="dark"] .form-select {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23e6e9f2' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'/%3E%3C/svg%3E");
}

input[type="checkbox"], input[type="radio"] { accent-color: var(--blue); }
.field-check {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14.5px; color: var(--ink-soft);
}
.field-check input { flex: none; width: 16px; height: 16px; margin-top: 3px; }
.field-check a { color: var(--blue); }

.field-help { font-family: var(--font-mono); font-size: 12px; color: var(--ink-soft); margin-top: 6px; }
.field-error { font-family: var(--font-mono); font-size: 12.5px; color: var(--red); margin-top: 6px; }
.field-input.is-invalid, .form-control.is-invalid { border-color: var(--red); }
.field-input.is-invalid:focus, .form-control.is-invalid:focus { box-shadow: 0 0 0 3px rgba(214, 40, 40, .15); }

.form-actions { display: flex; align-items: center; gap: var(--s3); flex-wrap: wrap; margin-top: var(--s4); }

/* --------------------------------------------------------------------------
   12. Tables
   -------------------------------------------------------------------------- */
.table-wrap { overflow-x: auto; }
.table-ship { width: 100%; border-collapse: collapse; font-size: 14.5px; color: var(--ink); }
.table-ship th {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  text-transform: uppercase; letter-spacing: .08em;
  color: var(--ink-soft); text-align: left;
  padding: 10px 14px;
  border-bottom: 2px solid var(--line-strong);
}
.table-ship td { padding: 12px 14px; border-bottom: 1px solid var(--line); }
.table-ship tbody tr:hover { background: var(--row-hover); }

/* --------------------------------------------------------------------------
   13. Alerts / flash messages
   -------------------------------------------------------------------------- */
.flash {
  display: flex; align-items: flex-start; gap: 10px;
  font-size: 14.5px; color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--line-strong); border-left-width: 3px;
  border-radius: var(--radius-sm);
  padding: 12px 16px;
  margin: 0 0 var(--s3);
}
.flash::before {
  content: "i";
  font-family: var(--font-mono); font-weight: 600; font-size: 13px;
  line-height: 1.6; color: var(--ink-soft); flex: none;
}
.flash-info { border-left-color: var(--blue); }
.flash-info::before { content: "i"; color: var(--blue); }
.flash-success { border-left-color: var(--green); }
.flash-success::before { content: "\2713"; color: var(--green); }
.flash-error, .flash-danger { border-left-color: var(--red); }
.flash-error::before, .flash-danger::before { content: "\00d7"; color: var(--red); }
.flash-warning { border-left-color: var(--red); }
.flash-warning::before { content: "!"; color: var(--red); }

/* --------------------------------------------------------------------------
   14. Skeleton / loading shimmer
   -------------------------------------------------------------------------- */
.skeleton {
  position: relative; overflow: hidden;
  background: var(--line);
  border-radius: var(--radius-sm);
  color: transparent !important;
  user-select: none;
}
.skeleton::after {
  content: ""; position: absolute; inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--shimmer), transparent);
  animation: shiplog-shimmer 1.4s ease-in-out infinite;
}
@keyframes shiplog-shimmer { to { transform: translateX(100%); } }
.skeleton-text { height: 14px; margin: 8px 0; }
.skeleton-title { height: 24px; width: 40%; }
.skeleton-icon { width: 56px; height: 56px; border-radius: 22%; }

/* --------------------------------------------------------------------------
   15. Nav — slim sticky bar, mono wordmark, self-contained dropdowns
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 1000;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.nav { display: flex; align-items: center; gap: var(--s4); min-height: var(--header-h); }

.wordmark {
  display: inline-flex; align-items: center; gap: 10px;
  text-decoration: none; color: var(--ink);
  font-family: var(--font-mono); font-size: 15px; font-weight: 500;
  margin-right: auto; white-space: nowrap;
}
.wordmark:hover { color: var(--ink); text-decoration: none; }
.wordmark img { display: block; width: 26px; height: 26px; border-radius: 22%; }
.wordmark .path-dim { color: var(--ink-soft); }

.nav-menu { display: flex; align-items: center; gap: var(--s4); }

.nav-link {
  font-family: var(--font-mono); font-size: 14px;
  color: var(--ink-soft); text-decoration: none;
  padding: 6px 2px;
  background: none; border: 0; cursor: pointer;
  white-space: nowrap;
}
.nav-link:hover { color: var(--blue); text-decoration: underline; text-underline-offset: 4px; }

.nav-cta {
  display: inline-block;
  font-family: var(--font-mono); font-size: 13.5px; font-weight: 500;
  color: var(--blue); text-decoration: none; text-align: center;
  border: 1.5px solid var(--blue); border-radius: var(--radius-sm);
  padding: 7px 14px; white-space: nowrap;
  transition: background-color .15s ease, color .15s ease;
}
.nav-cta:hover { background: var(--btn-primary-bg); color: var(--btn-primary-ink); text-decoration: none; }

.nav-actions { display: flex; align-items: center; gap: var(--s3); }

/* dropdowns */
.nav-drop { position: relative; }
.nav-drop-btn { display: inline-flex; align-items: center; gap: 6px; }
.nav-drop-btn .caret { flex: none; transition: transform .15s ease; }
.nav-drop.open .nav-drop-btn { color: var(--blue); }
.nav-drop.open .nav-drop-btn .caret { transform: rotate(180deg); }
.nav-drop-menu {
  position: absolute; top: calc(100% + 10px); left: 50%; transform: translateX(-50%);
  min-width: 260px;
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-pop);
  padding: 8px;
  display: none;
  z-index: 1001;
}
.nav-drop.open .nav-drop-menu { display: block; }
.drop-item {
  display: block; padding: 9px 12px;
  border-radius: var(--radius-sm);
  text-decoration: none;
}
.drop-item:hover, .drop-item:focus-visible { background: var(--blue-tint); text-decoration: none; }
.drop-item-title { display: block; font-family: var(--font-mono); font-size: 13.5px; font-weight: 500; color: var(--ink); }
.drop-item-desc { display: block; font-size: 12.5px; color: var(--ink-soft); margin-top: 1px; }

/* theme toggle */
.theme-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; flex: none;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: transparent; color: var(--ink-soft);
  cursor: pointer; padding: 0;
  transition: color .15s ease, border-color .15s ease;
}
.theme-toggle:hover { color: var(--blue); border-color: var(--blue); }
.theme-toggle svg { display: block; }
.theme-toggle .sun-icon { display: none; }
[data-theme="dark"] .theme-toggle .sun-icon { display: block; }
[data-theme="dark"] .theme-toggle .moon-icon { display: none; }

/* hamburger */
.nav-mobile-actions { display: none; align-items: center; gap: 10px; }
.nav-burger {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  width: 40px; height: 36px; flex: none;
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  background: transparent; cursor: pointer; padding: 0;
}
.nav-burger-bar {
  display: block; width: 16px; height: 2px; border-radius: 1px;
  background: var(--ink);
  transition: transform .18s ease, opacity .18s ease;
}
.nav-open .nav-burger-bar:nth-child(1) { transform: translateY(6px) rotate(45deg); }
.nav-open .nav-burger-bar:nth-child(2) { opacity: 0; }
.nav-open .nav-burger-bar:nth-child(3) { transform: translateY(-6px) rotate(-45deg); }

@media (max-width: 940px) {
  .nav-mobile-actions { display: flex; }
  .nav-menu {
    display: none;
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-pop);
    padding: var(--s2) var(--s4) var(--s4);
    max-height: calc(100vh - var(--header-h));
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
  }
  .site-header.nav-open .nav-menu { display: flex; }
  .nav-menu > .nav-link, .nav-drop-btn { width: 100%; text-align: left; padding: 13px 2px; font-size: 15px; }
  .nav-menu > .nav-link, .nav-drop { border-bottom: 1px solid var(--line); }
  .nav-drop-btn { display: flex; justify-content: space-between; }
  .nav-drop-menu {
    position: static; transform: none;
    min-width: 0; box-shadow: none; border: 0; border-radius: 0;
    border-left: 2px solid var(--line-strong);
    background: transparent;
    padding: 0 0 10px 12px; margin-left: 2px;
  }
  .nav-actions { margin-top: var(--s3); }
  .nav-actions .theme-toggle { display: none; } /* the bar toggle is visible instead */
  .nav-cta { flex: 1; padding: 11px 14px; }
}

/* --------------------------------------------------------------------------
   16. Footer — mono column headers, ship-log voice
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--footer-bg); color: var(--footer-ink);
  padding: var(--s6) 0 var(--s4);
  margin-top: var(--s6);
}
.site-footer a { color: var(--footer-ink); }
.site-footer a:hover { color: var(--footer-ink-strong); }
.site-footer a:focus-visible { outline-color: var(--footer-ink-strong); }
.site-footer .wordmark { color: var(--footer-ink-strong); margin-right: 0; }
.site-footer .wordmark:hover { color: var(--footer-ink-strong); }
.site-footer .wordmark .path-dim { color: var(--footer-ink-soft); }

.footer-top {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr) minmax(0, 1fr) minmax(0, 1fr);
  gap: var(--s5);
}
.footer-brand p {
  font-family: var(--font-mono); font-size: 13px;
  color: var(--footer-ink-soft);
  margin: var(--s3) 0 0; max-width: 30ch;
}
.footer-col h3 {
  font-family: var(--font-mono); font-size: 12px; font-weight: 500;
  letter-spacing: .1em; text-transform: uppercase;
  color: var(--footer-ink-soft);
  margin: 0 0 var(--s3);
}
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.footer-col a { font-size: 14px; text-decoration: none; }
.footer-col a:hover { text-decoration: underline; text-underline-offset: 4px; }

.footer-bottom {
  display: flex; align-items: center; gap: var(--s3) var(--s4); flex-wrap: wrap;
  border-top: 1px solid var(--footer-line);
  margin-top: var(--s5); padding-top: var(--s4);
  font-family: var(--font-mono); font-size: 12.5px;
  color: var(--footer-ink-soft);
}
.footer-bottom a { color: var(--footer-ink-soft); text-decoration: underline; text-underline-offset: 3px; }
.footer-bottom a:hover { color: var(--footer-ink-strong); }
.footer-bottom .spacer { flex: 1; }

@media (max-width: 860px) {
  .footer-top { grid-template-columns: 1fr 1fr; }
  .footer-brand { grid-column: 1 / -1; }
}
@media (max-width: 420px) {
  .footer-top { grid-template-columns: 1fr; }
}

/* --------------------------------------------------------------------------
   17. Utilities — spacing on the --s scale, small helpers
   -------------------------------------------------------------------------- */
.u-mt-0 { margin-top: 0 !important; }
.u-mt-1 { margin-top: var(--s1) !important; }
.u-mt-2 { margin-top: var(--s2) !important; }
.u-mt-3 { margin-top: var(--s3) !important; }
.u-mt-4 { margin-top: var(--s4) !important; }
.u-mt-5 { margin-top: var(--s5) !important; }
.u-mt-6 { margin-top: var(--s6) !important; }
.u-mt-7 { margin-top: var(--s7) !important; }
.u-mb-0 { margin-bottom: 0 !important; }
.u-mb-1 { margin-bottom: var(--s1) !important; }
.u-mb-2 { margin-bottom: var(--s2) !important; }
.u-mb-3 { margin-bottom: var(--s3) !important; }
.u-mb-4 { margin-bottom: var(--s4) !important; }
.u-mb-5 { margin-bottom: var(--s5) !important; }
.u-mb-6 { margin-bottom: var(--s6) !important; }
.u-mb-7 { margin-bottom: var(--s7) !important; }
.u-center { text-align: center !important; }
.mono { font-family: var(--font-mono); }
.muted { color: var(--ink-soft); }
.u-visually-hidden {
  position: absolute !important; width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

/* --------------------------------------------------------------------------
   18. Responsive tuning for the log
   -------------------------------------------------------------------------- */
@media (max-width: 640px) {
  :root { --rail-x: 12px; }
  .hero { padding: var(--s6) 0 var(--s5); }
  .entry { padding-left: calc(var(--rail-x) + 26px); }
  .entry-card { grid-template-columns: 56px 1fr; padding: var(--s3) var(--s3) var(--s4); }
  .app-icon { width: 56px; height: 56px; }
  .app-icon::after { font-size: 24px; }
  .stamp { font-size: 12.5px; right: 12px; top: -11px; padding: 3px 9px 2px 11px; border-width: 2.5px; letter-spacing: .13em; }
  .node { top: 20px; }
}
@media (max-width: 480px) {
  .leader { display: none; }
  .entry-head { row-gap: 6px; }
  .ship-date { width: 100%; order: 9; }
  .entry-actions { margin-left: calc(-56px - var(--s4)); }
  .entry-next .entry-actions { margin-left: 0; }
  .btn-ship { font-size: 13px; padding: 10px 14px; }
}

/* --------------------------------------------------------------------------
   19. Reduced motion — everything still lands, nothing moves
   -------------------------------------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .cursor { animation: none; opacity: .65; }
  html.js .stamp:not(.stamp-in) { opacity: .92; transform: rotate(-8deg); }
  .stamp.stamp-in { animation: none; opacity: .92; transform: rotate(-8deg); }
  .node::after { transition: none; }
  .entry-next .node::after { animation: none; }
  .skeleton::after { animation: none; }
  .nav-burger-bar, .nav-drop-btn .caret, .btn-ship, .nav-cta, .theme-toggle, .app-icon img { transition: none; }
}

/* --------------------------------------------------------------------------
   20. Legacy compat — internal/admin pages still using pre-Ship-Log classes
   (.btn-haplo, .card-haplo, .form-control-haplo, bootstrap .form-control)
   render in the new language without markup changes.
   -------------------------------------------------------------------------- */
.btn-haplo {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font-family: var(--font-mono); font-size: 14px; font-weight: 500;
  padding: 11px 18px; border-radius: var(--radius-sm);
  border: 1px solid transparent; cursor: pointer; text-decoration: none;
  transition: background .15s ease, color .15s ease, border-color .15s ease;
}
.btn-haplo-primary { background: var(--btn-primary-bg); color: var(--btn-primary-ink); }
.btn-haplo-primary:hover { background: var(--btn-primary-hover); color: var(--btn-primary-ink); }
.btn-haplo-secondary { background: transparent; color: var(--ink); border-color: var(--line-strong); }
.btn-haplo-secondary:hover { border-color: var(--ink); color: var(--ink); }
.btn-haplo:focus-visible { outline: 2px solid var(--focus-ring); outline-offset: 2px; }

.card-haplo {
  background: var(--paper-raised); border: 1px solid var(--line);
  border-radius: var(--radius); padding: var(--s4);
  box-shadow: var(--shadow-card); color: var(--ink);
}

.form-control-haplo, .form-control {
  display: block; width: 100%;
  background: var(--paper); color: var(--ink);
  border: 1px solid var(--line-strong); border-radius: var(--radius-sm);
  padding: 10px 12px; font-family: var(--font-body); font-size: .95rem;
}
.form-control-haplo:focus, .form-control:focus {
  outline: 2px solid var(--focus-ring); outline-offset: 1px;
  border-color: var(--blue); box-shadow: none;
  background: var(--paper); color: var(--ink);
}
.form-control-haplo::placeholder, .form-control::placeholder { color: var(--ink-soft); }
