/* jamesisaackay.com: "Bridge & Chart"
   Day: a paper nautical chart. Night: a ship's bridge console.
   Mobile first. Breakpoints: 480 / 768 / 900 / 1100. */

@font-face {
  font-family: "Archivo";
  src: url("../fonts/archivo-var.woff2") format("woff2");
  font-weight: 400 750;
  font-stretch: 100% 125%;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/ibm-plex-sans-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Sans";
  src: url("../fonts/ibm-plex-sans-600.woff2") format("woff2");
  font-weight: 600;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-400.woff2") format("woff2");
  font-weight: 400;
  font-display: swap;
}
@font-face {
  font-family: "IBM Plex Mono";
  src: url("../fonts/ibm-plex-mono-500.woff2") format("woff2");
  font-weight: 500;
  font-display: swap;
}

/* ---------- tokens ---------- */
:root {
  color-scheme: light;
  --bg: #f3efe4;
  --surface: #fbf8f1;
  --raised: #e9e3d4;
  --line: #d9d1bf;
  --ink: #14212a;
  --text: #4c5b64;
  --faint: #6d7a80;      /* non-text only in day mode */
  --meta: #4c5b64;       /* small meta text */
  --signal: #a83c0c;     /* International Orange, darkened for AA on paper */
  --status: #8a5a00;
  --sounding: #0b5f8a;
  --signal-tint: #a83c0c14;
  --on-signal: #ffffff;
  --port: #c8501a;
  --starboard: #1f8a70;
  --grid: #14212a;

  --display: "Archivo", "Arial Narrow", Arial, sans-serif;
  --sans: "IBM Plex Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --header-h: 60px;
  --pad-section: 56px;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    color-scheme: dark;
    --bg: #0b1215;
    --surface: #121c21;
    --raised: #18262d;
    --line: #22333c;
    --ink: #e6ece9;
    --text: #9fb0b5;
    --faint: #6f8288;
    --meta: #7f9399;
    --signal: #ff7a3d;
    --status: #ffb547;
    --sounding: #7cc0e3;
    --signal-tint: #ff7a3d1a;
    --on-signal: #0b1215;
    --port: #ff7a3d;
    --starboard: #3fb59a;
    --grid: #7cc0e3;
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg: #0b1215;
  --surface: #121c21;
  --raised: #18262d;
  --line: #22333c;
  --ink: #e6ece9;
  --text: #9fb0b5;
  --faint: #6f8288;
  --meta: #7f9399;
  --signal: #ff7a3d;
  --status: #ffb547;
  --sounding: #7cc0e3;
  --signal-tint: #ff7a3d1a;
  --on-signal: #0b1215;
  --port: #ff7a3d;
  --starboard: #3fb59a;
  --grid: #7cc0e3;
}

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--header-h) + 16px); }
@media (prefers-reduced-motion: no-preference) { html { scroll-behavior: smooth; } }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.65 var(--sans);
  overflow-x: hidden;
}
@media (prefers-reduced-motion: no-preference) {
  body.theme-fade, body.theme-fade * { transition: background-color .2s, color .2s, border-color .2s, fill .2s, stroke .2s !important; }
}
img, svg, canvas { display: block; max-width: 100%; }
img { height: auto; }
a { color: var(--sounding); text-underline-offset: 3px; text-decoration-thickness: 1px; }
a:hover { text-decoration-thickness: 2px; }
strong, b { color: var(--ink); font-weight: 600; }
h1, h2, h3, h4 { color: var(--ink); margin: 0; font-family: var(--display); font-weight: 600; line-height: 1.15; }
p { margin: 0 0 1em; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--sounding); outline-offset: 3px; border-radius: 2px; }
[hidden] { display: none !important; }
li:has(> a[hidden]) { display: none; }

.sr-only {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.wrap {
  width: 100%;
  max-width: 1040px;
  margin-inline: auto;
  padding-left: max(16px, env(safe-area-inset-left));
  padding-right: max(16px, env(safe-area-inset-right));
}
.skip {
  position: absolute; left: 16px; top: -60px; z-index: 100;
  background: var(--signal); color: var(--on-signal); padding: 10px 16px; border-radius: 6px;
  font-weight: 600; text-decoration: none;
}
.skip:focus { top: 12px; }

/* ---------- detection-box corner brackets (hover + focus) ---------- */
@property --bl { syntax: "<length>"; inherits: false; initial-value: 0px; }
.bk { position: relative; }
.bk::after {
  --c: var(--signal); --t: 2px;
  content: ""; position: absolute; inset: -5px; pointer-events: none;
  background:
    linear-gradient(var(--c), var(--c)) left top / var(--bl) var(--t),
    linear-gradient(var(--c), var(--c)) left top / var(--t) var(--bl),
    linear-gradient(var(--c), var(--c)) right top / var(--bl) var(--t),
    linear-gradient(var(--c), var(--c)) right top / var(--t) var(--bl),
    linear-gradient(var(--c), var(--c)) left bottom / var(--bl) var(--t),
    linear-gradient(var(--c), var(--c)) left bottom / var(--t) var(--bl),
    linear-gradient(var(--c), var(--c)) right bottom / var(--bl) var(--t),
    linear-gradient(var(--c), var(--c)) right bottom / var(--t) var(--bl);
  background-repeat: no-repeat;
  opacity: 0; --bl: 0px;
}
.bk:hover::after, .bk:focus-visible::after { opacity: 1; --bl: 10px; }
@media (prefers-reduced-motion: no-preference) {
  .bk::after { transition: opacity .18s var(--ease-out), --bl .18s var(--ease-out); }
}
@media (prefers-reduced-motion: reduce) {
  .bk:hover::after, .bk:focus-visible::after { --bl: 10px; }
}

/* ---------- header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 50; height: var(--header-h);
  background: color-mix(in srgb, var(--bg) 85%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--line);
}
@media (prefers-reduced-motion: no-preference) {
  .site-header { transition: transform .3s var(--ease-out); }
}
.site-header.is-tucked { transform: translateY(-100%); }
.nav { height: 100%; display: flex; align-items: center; gap: 8px; }
.brand {
  font-family: var(--display); font-weight: 650; font-size: 18px; color: var(--ink);
  text-decoration: none; margin-right: auto; white-space: nowrap;
}
.nav-links { display: none; }
.nav-contact { display: none; }
.icon-btn {
  display: inline-grid; place-items: center; width: 44px; height: 44px;
  border: 0; background: transparent; color: var(--ink); border-radius: 6px; cursor: pointer;
}
.icon-btn:hover { background: var(--raised); }
.icon-btn svg, .icon-link svg {
  width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7;
  stroke-linecap: round; stroke-linejoin: round;
}
.theme-toggle .i-sun { display: none; }
.theme-toggle[aria-pressed="true"] .i-sun { display: block; }
.theme-toggle[aria-pressed="true"] .i-moon { display: none; }
/* Both buttons need js/main.js; without it they would do nothing, so hide them. */
html:not(.js) .menu-btn, html:not(.js) .theme-toggle { display: none; }

@media (min-width: 900px) {
  .menu-btn { display: none; }
  .nav { gap: 4px; }
  .nav-links { display: flex; gap: 2px; margin-right: 8px; }
  .nav-links a {
    position: relative; display: block; padding: 8px 7px; white-space: nowrap;
    font: 500 13px/1 var(--mono); text-transform: uppercase; letter-spacing: .08em;
    color: var(--text); text-decoration: none;
  }
  .nav-links a:hover { color: var(--ink); }
  .nav-links a::after {
    content: ""; position: absolute; left: 50%; bottom: 0; width: 2px; height: 7px;
    background: var(--signal); transform: translateX(-50%) scaleY(0); transform-origin: bottom;
  }
  .nav-links a.is-active { color: var(--ink); }
  .nav-links a.is-active::after { transform: translateX(-50%) scaleY(1); }
  .nav-contact { display: flex; align-items: center; gap: 2px; padding-left: 8px; border-left: 1px solid var(--line); }
  .icon-link {
    display: inline-flex; align-items: center; gap: 6px; min-width: 40px; min-height: 40px;
    justify-content: center; padding: 0 6px; border-radius: 6px;
    color: var(--ink); text-decoration: none; font: 500 13px/1 var(--mono);
  }
  .icon-link:hover { background: var(--raised); }
  .icon-link .lbl {
    position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap;
  }
}
/* Email, LinkedIn and Instagram stay icon-only (their names are in .lbl for assistive tech);
   with four contact links, only the resume label fits beside the section links. */
@media (min-width: 1100px) {
  .icon-link.has-label .lbl { position: static; width: auto; height: auto; overflow: visible; clip: auto; }
}

/* mobile sheet */
.sheet {
  position: fixed; inset: 0; z-index: 70; background: var(--bg);
  display: flex; flex-direction: column; padding: 0 16px 32px; overflow-y: auto;
}
.sheet-top { height: var(--header-h); display: flex; align-items: center; justify-content: space-between; }
.sheet-links { margin-top: 24px; }
.sheet-links a {
  display: block; padding: 12px 0; font: 600 28px/1.2 var(--display); font-stretch: 112%;
  color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line);
}
.sheet-contact { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 8px 20px; }
.sheet-contact a { font: 500 15px/2.4 var(--mono); }
body.no-scroll { overflow: hidden; }

/* ---------- section heads ---------- */
.section { padding-block: var(--pad-section); }
.sec-head { display: flex; align-items: center; gap: 16px; margin-bottom: 32px; }
.sec-head h2 {
  font-family: var(--display); font-weight: 650; font-stretch: 118%;
  font-size: 30px; letter-spacing: .02em; text-transform: uppercase; white-space: nowrap;
}
.prefix { font: 500 .62em/1 var(--mono); color: var(--signal); margin-right: .3em; vertical-align: .18em; letter-spacing: 0; }
.rule { display: none; }
.sec-link { margin-left: auto; font: 500 14px/1.4 var(--mono); white-space: nowrap; }
@media (min-width: 768px) {
  .rule {
    display: block; flex: 1 1 auto; height: 9px; min-width: 40px; position: relative;
    background:
      linear-gradient(var(--line), var(--line)) left bottom / 100% 1px no-repeat,
      repeating-linear-gradient(to right, var(--line) 0 1px, transparent 1px 24px) left bottom / calc(100% - 14px) 6px no-repeat;
  }
  .rule::after {
    content: ""; position: absolute; right: -2px; bottom: -4px; width: 9px; height: 9px;
    border: 1px solid var(--signal); border-radius: 50%;
    box-shadow: inset 0 0 0 2px var(--bg), inset 0 0 0 3px var(--signal);
  }
}

/* buoy bullets: port and starboard */
.buoys li { position: relative; padding-left: 20px; margin-bottom: 10px; }
.buoys li::before {
  content: ""; position: absolute; left: 2px; top: .62em; width: 7px; height: 7px; border-radius: 50%;
  background: var(--port);
}
.buoys li:nth-child(even)::before { background: var(--starboard); }

/* REC */
.rec { display: flex; align-items: baseline; gap: 8px; font-size: 15px; }
.rec-dot {
  flex: none; width: 8px; height: 8px; border-radius: 50%; background: var(--status);
  transform: translateY(-1px);
}
.rec-tag { font: 500 12px/1 var(--mono); color: var(--status); letter-spacing: .06em; }
@media (prefers-reduced-motion: no-preference) {
  .rec-dot { animation: rec 1.1s ease-in-out 3; }
}
@keyframes rec { 50% { opacity: .25; } }

/* buttons */
.btn {
  display: inline-flex; align-items: center; gap: 10px; padding: 12px 28px; border-radius: 6px;
  font: 600 16px/1.2 var(--sans); text-decoration: none; cursor: pointer;
}
.btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.btn-fill { background: var(--signal); color: var(--on-signal); border: 1px solid var(--signal); }
.btn-line { color: var(--signal); border: 1px solid var(--signal); background: transparent; }
.btn-line:hover { background: var(--signal-tint); }
@media (prefers-reduced-motion: no-preference) {
  .btn { transition: transform .18s var(--ease-out), background-color .18s; }
  .btn:hover { transform: translateY(-2px); }
}

/* ---------- hero ---------- */
.hero {
  position: relative; padding: calc(var(--header-h) + 32px) 0 56px; min-height: 82svh;
  display: flex; align-items: center; isolation: isolate;
}
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: -1; opacity: .06; pointer-events: none;
  background:
    linear-gradient(var(--grid) 1px, transparent 1px) 0 0 / 48px 48px,
    linear-gradient(90deg, var(--grid) 1px, transparent 1px) 0 0 / 48px 48px;
  -webkit-mask-image: radial-gradient(ellipse at 60% 45%, #000 20%, transparent 72%);
  mask-image: radial-gradient(ellipse at 60% 45%, #000 20%, transparent 72%);
}
.hero-grid { display: grid; gap: 32px; }
/* Below 1024px the figure shows above the text while the DOM keeps the h1 first, so its
   Rescan button is reached after the CTAs. Accepted on purpose: one low-impact control
   (WCAG 2.4.3), and the h1 stays first for screen readers. */
.hero-text { order: 2; }
.scan { order: 1; margin: 0 auto; width: 100%; max-width: 320px; }

#hero-title { font-family: var(--display); font-weight: 700; font-size: clamp(38px, 11.5vw, 44px); line-height: 1.05; letter-spacing: -.01em; }
/* The name may wrap between words, never inside one; the caret stays with the last word. */
.h1-vis .nw, .plate .w { white-space: nowrap; }
/* While the read head passes, each letter keeps its measured width, so nothing reflows. */
.plate .l { display: inline-block; }
.plate .l.g { color: var(--signal); }
.caret {
  display: inline-block; width: .42em; height: .78em; margin-left: .08em; background: var(--signal);
  vertical-align: -.04em;
}
@media (prefers-reduced-motion: no-preference) {
  .js .caret { animation: blink 1s steps(1) 3; }
}
@keyframes blink { 50% { opacity: 0; } }
/* The readout is visible at rest. When the name decode locks, it flashes the signal color
   and settles back; it never hides. */
.readout {
  height: 1.4em; margin: 8px 0 18px; font: 500 13px/1.4 var(--mono); color: var(--meta);
  letter-spacing: .06em;
}
@media (prefers-reduced-motion: no-preference) {
  .readout.show { animation: readout 1.6s ease-in-out; }
}
@keyframes readout { 15%, 60% { color: var(--signal); } }
.bio { font-size: 17px; max-width: 560px; }
.meta-line {
  margin: 0 0 28px; padding-left: 14px; border-left: 2px solid var(--line);
  font: 400 13px/1.85 var(--mono); color: var(--meta);
}
.cta { display: flex; flex-wrap: wrap; gap: 14px; }

.scan-stage { position: relative; aspect-ratio: 4 / 3; }
.scan-canvas, .scan-fallback { width: 100%; height: 100%; touch-action: pan-y; }
/* The settled-frame image sits under the canvas and is visible at rest. It is hidden only
   after the canvas has drawn the full cloud over it. */
.scan-fallback { position: absolute; inset: 0; }
.scan-canvas { position: relative; display: block; }
.scan.drawn .scan-fallback { visibility: hidden; }
/* Without JavaScript the image stays in the canvas's place, and controls that need
   JavaScript are not shown. */
html:not(.js) .scan-canvas, html:not(.js) .rescan, html:not(.js) .ap-pill { display: none; }
.hud { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; }
/* The detection box and label are visible at rest; a sweep only dims them for its duration. */
.hud-box { fill: none; stroke: var(--signal); stroke-width: 1.5; vector-effect: non-scaling-stroke; }
.hud-label {
  position: absolute; font: 500 12px/1 var(--mono); color: var(--on-signal); background: var(--signal);
  padding: 3px 6px; pointer-events: none; transform: translateY(-100%);
}
.scan figcaption {
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px;
  margin-top: 10px; font: 400 12px/1.5 var(--mono); color: var(--meta);
}
.rescan {
  border: 1px solid var(--line); background: transparent; color: var(--ink); border-radius: 6px;
  padding: 6px 12px; font: 500 12px/1 var(--mono); cursor: pointer; min-height: 32px;
}
.rescan:hover { border-color: var(--signal); }

@media (min-width: 480px) {
  .scan { max-width: 360px; }
}
@media (min-width: 768px) {
  #hero-title { font-size: 60px; }
  .bio { font-size: 18px; }
}
@media (min-width: 1024px) {
  .hero-grid { grid-template-columns: minmax(0, 560px) 420px; justify-content: space-between; align-items: center; gap: 4vw; }
  .hero-text { order: 1; }
  .scan { order: 2; max-width: 420px; }
  #hero-title { font-size: 76px; }
}
@media (max-width: 767px) {
  .hero-text { text-align: left; }
}

/* ---------- about ---------- */
.about-grid { display: grid; gap: 40px; }
.about-text { max-width: 640px; }
.about-text > p { font-size: 17px; }
.tools-intro { margin-top: 1.4em; }
.tools { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 24px; margin-bottom: 28px; font: 400 14px/1.5 var(--mono); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips li {
  display: inline-flex; align-items: baseline; gap: 8px; padding: 6px 12px; border-radius: 999px;
  background: var(--raised); color: var(--ink); font: 400 13px/1.45 var(--mono);
}
.chips li::before { content: ""; flex: none; width: 6px; height: 6px; border-radius: 50%; background: var(--status); transform: translateY(-1px); }
.about-photo { display: none; margin: 0; }
.about-photo .frame { border: 1px solid var(--line); border-radius: 8px; padding: 6px; background: var(--surface); }
.about-photo img { border-radius: 4px; }
.about-photo figcaption { margin-top: 8px; font: 400 12px/1.5 var(--mono); color: var(--meta); }
@media (min-width: 601px) {
  .about-photo { display: block; max-width: 280px; }
}
@media (min-width: 900px) {
  .about-grid { grid-template-columns: minmax(0, 1fr) 280px; gap: 56px; align-items: start; }
  .about-text > p { font-size: 18px; }
}

/* ---------- experience tabs ---------- */
.tabs { display: grid; gap: 24px; }
/* Without JavaScript the tabs cannot switch, so the tablist is hidden and every panel shows,
   stacked. js/main.js adds .is-tabbed when it collapses the panels into working tabs. */
html:not(.js) .tablist { display: none; }
.tabs:not(.is-tabbed) .panel + .panel { padding-top: 32px; border-top: 1px solid var(--line); }
.tablist {
  position: relative; display: flex; overflow-x: auto; scrollbar-width: thin;
  border-bottom: 1px solid var(--line); padding: 4px 4px 0;
}
.tab {
  flex: none; padding: 12px 16px; border: 0; background: transparent; cursor: pointer;
  font: 500 13px/1.2 var(--mono); color: var(--text); text-align: left; white-space: nowrap;
}
.tab:hover { background: var(--signal-tint); color: var(--signal); }
.tab[aria-selected="true"] { color: var(--signal); }
.tab:focus-visible { outline-offset: -2px; }
.tab-indicator {
  position: absolute; left: 0; bottom: 0; height: 2px; width: 0; background: var(--signal);
}
@media (prefers-reduced-motion: no-preference) {
  .tab-indicator { transition: transform .25s var(--ease-out), width .25s var(--ease-out), height .25s var(--ease-out); }
}
.panel h3 { font-size: 22px; font-weight: 600; line-height: 1.25; }
.panel .at { color: var(--signal); }
.panel .dates { margin: 6px 0 4px; font: 500 13px/1.4 var(--mono); text-transform: uppercase; letter-spacing: .06em; color: var(--meta); }
.panel .sub { font-size: 15px; color: var(--meta); margin-bottom: 18px; }
.panel .dates + .buoys { margin-top: 18px; }
.panel .buoys { max-width: 680px; }
.panel:focus-visible { outline-offset: 6px; }
.pub-title { margin: 24px 0 10px; font: 500 13px/1.2 var(--mono); color: var(--ink); letter-spacing: .04em; }
.pubs li { font-size: 14px; margin-bottom: 10px; max-width: 680px; padding-left: 14px; border-left: 2px solid var(--line); }
@media (min-width: 900px) {
  .tabs { grid-template-columns: 180px minmax(0, 1fr); gap: 40px; }
  .tabs .panel { grid-column: 2; }
  html:not(.js) .tabs { grid-template-columns: minmax(0, 1fr); }
  html:not(.js) .tabs .panel { grid-column: auto; }
  .tablist { flex-direction: column; overflow: visible; border-bottom: 0; border-left: 1px solid var(--line); padding: 0; align-self: start; }
  .tab { padding: 12px 18px; }
  .tab-indicator { left: -1px; top: 0; bottom: auto; width: 2px; height: 0; }
  .panel h3 { font-size: 26px; }
}

/* ---------- systems ---------- */
.feature { display: grid; gap: 20px; margin-bottom: 64px; }
.feature-media { margin: 0; }
.feature-media img, .feature-media .diagram {
  width: 100%; border-radius: 8px; border: 1px solid var(--line); background: var(--surface);
}
.feature-media img { aspect-ratio: auto; }
.feature-media figcaption { margin-top: 8px; font: 400 12px/1.5 var(--mono); color: var(--meta); }
.feature-body h3 { font-size: 22px; line-height: 1.25; margin-bottom: 8px; }
.feature-body .meta { font: 400 13px/1.5 var(--mono); color: var(--meta); margin-bottom: 14px; }
.feature-body > p { font-size: 16px; }
.status { padding: 12px 14px; border-left: 3px solid var(--status); background: var(--surface); border-radius: 0 6px 6px 0; font-size: 15px !important; }
.metrics { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.metrics li {
  padding: 5px 10px; border-radius: 999px; background: var(--raised); color: var(--text);
  font: 400 13px/1.4 var(--mono);
}
.metrics b { color: var(--signal); font-weight: 500; }
.feature-body .stack { font: 400 13px/1.6 var(--mono); color: var(--meta); }
.commitments { margin-top: 8px; border-top: 1px solid var(--line); padding-top: 12px; }
.commitments summary {
  cursor: pointer; font-weight: 600; color: var(--ink); padding: 6px 0; list-style-position: outside;
}
.commitments summary:hover { color: var(--signal); }
.commitments .buoys { margin: 12px 0 8px; font-size: 15px; }
.commitments p { font-size: 15px; }

.diagram text { font-family: var(--mono); }
.d-cap { font-size: 12px; fill: var(--meta); }
.d-box { fill: var(--raised); stroke: var(--line); }
.d-hot { fill: var(--signal-tint); stroke: var(--signal); }
.d-txt { font-size: 13px; fill: var(--ink); }
.d-note { font-size: 14px; fill: var(--meta); }
.d-note-hot { fill: var(--signal); }
.d-flow path { stroke: var(--faint); stroke-width: 1.5; fill: none; stroke-dasharray: 3 3; }
.u-curve path { stroke: var(--faint); fill: none; stroke-width: 1; opacity: .7; }
.u-grid path { stroke: var(--sounding); fill: none; stroke-width: 1.6; }

@media (min-width: 900px) {
  .feature { grid-template-columns: 46fr 54fr; gap: 40px; align-items: center; margin-bottom: 88px; }
  .feature-flip .feature-media { order: 2; }
  .feature-body h3 { font-size: 24px; }
}

.archive-title { font-size: 22px; font-stretch: 112%; margin-bottom: 20px; }
.archive { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(280px, 100%), 1fr)); gap: 12px; }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px; padding: 20px;
}
.card h4 { font-size: 18px; font-weight: 600; margin-bottom: 8px; }
.card p { font-size: 15px; margin-bottom: 12px; }
.card .tags { font: 400 12.5px/1.6 var(--mono); color: var(--meta); margin: 0; }
.ring-icon { width: 30px; height: 30px; margin-bottom: 16px; fill: none; stroke: var(--signal); stroke-width: 1.2; }
@media (min-width: 768px) { .card { padding: 24px 28px; } }

/* ---------- hardware ---------- */
.hw-grid { display: grid; gap: 16px; }
@media (min-width: 768px) {
  .hw-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .hw-media { aspect-ratio: 16 / 10; }
}
.card.hw { padding: 0; overflow: hidden; display: flex; flex-direction: column; }
.card.hw > :not(.hw-media) { margin-inline: 20px; }
.card.hw h3 { font-size: 19px; margin-top: 16px; margin-bottom: 8px; }
.card.hw .badge + h3 { margin-top: 8px; }
.card.hw .tags { margin-top: auto; padding-bottom: 20px; }
.hw-media { aspect-ratio: 4 / 3; overflow: hidden; background: var(--raised); border-bottom: 1px solid var(--line); }
.hw-media img { width: 100%; height: 100%; object-fit: cover; }
.hw-media.ph {
  aspect-ratio: auto; height: 72px; display: flex; align-items: center; padding-left: 20px;
  background:
    linear-gradient(color-mix(in srgb, var(--grid) 10%, transparent) 1px, transparent 1px) 0 0 / 24px 24px,
    linear-gradient(90deg, color-mix(in srgb, var(--grid) 10%, transparent) 1px, transparent 1px) 0 0 / 24px 24px,
    var(--raised);
}
.hw-media.ph svg { width: 40px; height: 40px; fill: none; stroke: var(--faint); stroke-width: .8; }
.badge {
  align-self: flex-start; margin: 16px 0 0; padding: 3px 9px; border-radius: 999px;
  border: 1px solid var(--status); color: var(--status); font: 500 12px/1.4 var(--mono);
}

/* ---------- field log ---------- */
.lede { font-size: 17px; margin-bottom: 24px; }
.masonry { columns: 1; column-gap: 16px; }
.masonry li { break-inside: avoid; margin-bottom: 16px; }
.shot {
  display: block; width: 100%; padding: 0; border: 1px solid var(--line); border-radius: 8px;
  background: var(--surface); cursor: zoom-in;
}
.shot img { border-radius: 7px; width: 100%; }
@media (min-width: 768px) { .masonry { columns: 2; } }

.lightbox {
  width: min(1100px, calc(100vw - 32px)); max-height: calc(100vh - 32px); padding: 16px;
  background: var(--surface); color: var(--text); border: 1px solid var(--line); border-radius: 12px;
}
.lightbox::backdrop { background: rgb(5 10 12 / .82); }
.lightbox figure { margin: 0; }
.lightbox img { max-height: calc(100vh - 170px); width: auto; margin-inline: auto; border-radius: 6px; }
.lightbox figcaption { margin-top: 10px; font: 400 13px/1.5 var(--mono); color: var(--meta); }
.lb-controls { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; justify-content: flex-end; }
.lb-controls button {
  min-height: 40px; padding: 8px 14px; border: 1px solid var(--line); border-radius: 6px;
  background: var(--raised); color: var(--ink); font: 500 13px/1 var(--mono); cursor: pointer;
}
.lb-controls button:hover { border-color: var(--signal); }

/* ---------- footer ---------- */
.site-footer { border-top: 1px solid var(--line); padding: 40px 0 72px; font-size: 14px; }
.foot-links { display: flex; flex-wrap: wrap; gap: 4px 24px; margin-bottom: 16px; font: 500 14px/2 var(--mono); }
.site-footer p { margin-bottom: 4px; color: var(--meta); }
.credit { font-size: 13px; }

/* ---------- autonomy mode ---------- */
.ap-pill, .ap-hud { display: none; }
@media (min-width: 900px) {
  /* keep focused elements clear of the fixed pill (WCAG 2.4.11) */
  html { scroll-padding-bottom: 72px; }
  .ap-pill {
    position: fixed; left: 16px; bottom: 16px; z-index: 60; display: inline-flex; align-items: center; gap: 8px;
    padding: 8px 14px; min-height: 36px; border-radius: 999px; cursor: pointer;
    border: 1px solid var(--line); background: var(--surface); color: var(--ink);
    font: 500 13px/1 var(--mono);
  }
  .ap-pill:hover { border-color: var(--signal); }
  .ap-dot { width: 8px; height: 8px; border-radius: 50%; border: 1px solid var(--faint); }
  .ap-pill[aria-pressed="true"] .ap-dot { background: var(--status); border-color: var(--status); }
  .ap-hud {
    position: fixed; right: 16px; bottom: 16px; z-index: 60; display: flex; flex-direction: column; align-items: flex-end; gap: 6px;
    font: 500 13px/1.3 var(--mono); color: var(--ink);
  }
  .ap-hud span { background: var(--surface); border: 1px solid var(--line); border-radius: 999px; padding: 7px 12px; }
  .ap-hud .ap-keys { color: var(--meta); font-weight: 400; font-size: 12px; }
  .ap-hud[hidden] { display: none !important; }
}
.ap-canvas { position: fixed; inset: 0; z-index: 45; pointer-events: none; }
.ap-dialog {
  max-width: 360px; padding: 24px; border-radius: 12px; border: 1px solid var(--line);
  background: var(--surface); color: var(--text); text-align: center;
}
.ap-dialog::backdrop { background: rgb(5 10 12 / .5); }
.ap-dialog p { font: 500 15px/1.5 var(--mono); color: var(--ink); }
.ap-dialog .btns { display: flex; justify-content: center; gap: 10px; }
.ap-dialog button {
  min-height: 40px; padding: 8px 16px; border-radius: 6px; cursor: pointer; font: 600 14px/1 var(--sans);
  border: 1px solid var(--signal); background: var(--signal); color: var(--on-signal);
}
.ap-dialog button.alt { background: transparent; color: var(--signal); }
