/* otto — portfolio
 * A field map, not a template. Colours come from topographic and aeronautical charts:
 * map paper, print ink, contour brown, water blue, and the magenta charts use for routes.
 * Type is one family in three widths (Barlow), on a perfect-fourth scale from 18px.
 */

:root {
  --paper: #f3f5f1;
  --paper-2: #e8ece6;
  --ink: #1e2326;
  --ink-2: #545d5a;
  --rule: #c9d0ca;
  --route: #a3195b;          /* aeronautical magenta */
  --route-deep: #7d1145;
  --water: #2f6daa;
  --contour: #8a6f52;

  --sans: "Barlow", system-ui, sans-serif;
  --semi: "Barlow Semi Condensed", "Barlow", system-ui, sans-serif;
  --cond: "Barlow Condensed", "Barlow", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", "Cascadia Mono", Menlo, Consolas, monospace;

  --s-1: 0.8125rem;   /* 13 */
  --s0: 1.125rem;     /* 18 */
  --s1: 1.5rem;       /* 24 */
  --s2: 2rem;         /* 32 */
  --s3: 2.666rem;     /* 43 */
  --s4: 3.553rem;     /* 57 */
  --s5: 4.736rem;     /* 76 */
  --s6: 6.313rem;     /* 101 */

  --gutter: clamp(1rem, 4vw, 3rem);
  --measure: 38rem;
  --wide: 76rem;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 400 var(--s0)/1.55 var(--sans);
  font-feature-settings: "kern", "liga", "tnum" 0;
  text-rendering: optimizeLegibility;
}

h1, h2, h3 { margin: 0; font-family: var(--semi); font-weight: 600; line-height: 1.05; letter-spacing: -0.01em; }
h2 { font-size: clamp(var(--s3), 6vw, var(--s5)); }
h3 { font-size: var(--s1); line-height: 1.2; letter-spacing: 0; }
p { margin: 0; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--route); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
a:hover { color: var(--route-deep); text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--route); outline-offset: 3px; border-radius: 2px; }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: absolute; left: 1rem; top: -4rem; background: var(--ink); color: var(--paper); padding: 0.5rem 0.9rem; z-index: 10; }
.skip:focus { top: 1rem; }

.wrap { max-width: var(--wide); margin: 0 auto; padding: 0 var(--gutter); }
.lead { font-size: var(--s1); line-height: 1.4; max-width: 34em; color: var(--ink); }
.fineprint { font-size: var(--s0); color: var(--ink-2); max-width: var(--measure); }
.prose p + p { margin-top: 1em; }
.prose h3 + p { margin-top: 0.6em; }
.prose { max-width: var(--measure); }

.button {
  display: inline-flex; align-items: center; min-height: 2.75rem;
  padding: 0 1.15rem; border-radius: 3px;
  background: var(--route); color: #fff;
  font: 500 var(--s0)/1 var(--sans); text-decoration: none;
  border: 1px solid var(--route);
}
.button:hover { background: var(--route-deep); border-color: var(--route-deep); color: #fff; }
.button--quiet { background: transparent; color: var(--ink); border-color: var(--rule); }
.button--quiet:hover { background: var(--paper-2); color: var(--ink); border-color: var(--ink-2); }
.actions, .hero__actions { display: flex; flex-wrap: wrap; gap: 0.75rem; align-items: center; margin-top: 1.75rem; }

/* ---------------------------------------------------------------- top bar */
.top {
  display: flex; align-items: baseline; justify-content: space-between; gap: 1rem;
  padding: 1.1rem var(--gutter);
}
.top__name { font: 600 var(--s1)/1 var(--semi); color: var(--ink); text-decoration: none; }
.top nav { display: flex; gap: clamp(1rem, 3vw, 2rem); }
.top nav a { color: var(--ink); text-decoration: none; font-weight: 500; }
.top nav a:hover { color: var(--route); }

/* ---------------------------------------------------------------- hero map */
.hero { position: relative; }
.hero__intro { padding: clamp(1.5rem, 5vw, 3rem) var(--gutter) 1.5rem; }
.hero h1 { font-size: clamp(var(--s5), 16vw, 7rem); line-height: 0.85; letter-spacing: -0.035em; margin-left: -0.04em; }
.hero__lede { font-size: var(--s1); line-height: 1.38; margin-top: 1rem; max-width: 26em; }

.map { margin: 0; position: relative; }
.map__svg { display: block; width: 100%; height: auto; aspect-ratio: 728 / 495; background: #dfe6dc; }
.map figcaption { padding: 0.75rem var(--gutter) 0; font-size: var(--s-1); color: var(--ink-2); max-width: 60rem; }

.map__legend {
  margin: 0.9rem var(--gutter) 0; padding: 0.8rem 1rem 0.7rem;
  background: var(--paper); border: 1px solid var(--ink);
  font: 500 0.9375rem/1.3 var(--cond); letter-spacing: 0.01em;
  display: inline-grid; gap: 0.35rem;
}
.legend__row { display: flex; align-items: center; gap: 0.6rem; }
.legend__row svg { width: 2.5rem; height: 0.75rem; flex: none; overflow: visible; }
.scale { display: flex; align-items: center; gap: 0.5rem; margin-top: 0.35rem; }
.scale__bar { display: block; height: 6px; width: var(--scale-px, 4rem); border: 1px solid var(--ink); border-top: 0;
  background: linear-gradient(90deg, var(--ink) 0 50%, transparent 50% 100%) bottom / 100% 3px no-repeat; }

/* symbols, shared by legend and map */
.sym-truck-case { stroke: var(--paper); stroke-width: 6; fill: none; stroke-linecap: round; }
.sym-truck { stroke: var(--route); stroke-width: 3.2; fill: none; stroke-linecap: round; }
.sym-drone { stroke: var(--route); stroke-width: 2.2; stroke-dasharray: 5 3.5; fill: none; }
.sym-air { stroke: var(--route); stroke-width: 1.4; stroke-dasharray: 9 3 2 3; fill: none; }
.sym-zone { stroke: var(--route); stroke-width: 1.6; fill: rgb(163 25 91 / 0.16); }

/* map overlay; sizes are screen pixels divided by the map's current scale (--k, set by site.js) */
.map__overlay { --k: 1; }
.map__overlay .case { stroke: var(--paper); stroke-width: calc(7px / var(--k)); fill: none; stroke-linecap: round; stroke-linejoin: round; opacity: 0.9; }
.map__overlay .truck { stroke: var(--route); stroke-width: calc(3.5px / var(--k)); fill: none; stroke-linecap: round; stroke-linejoin: round; }
.map__overlay .drone { stroke: var(--route); stroke-width: calc(2.4px / var(--k)); fill: none; stroke-dasharray: calc(7px / var(--k)) calc(5px / var(--k)); }
.map__overlay .air { stroke: var(--route); stroke-width: calc(1.6px / var(--k)); fill: none; stroke-dasharray: calc(12px / var(--k)) calc(4px / var(--k)) calc(2px / var(--k)) calc(4px / var(--k)); }
.map__overlay .fall { stroke: var(--route); stroke-width: calc(1.4px / var(--k)); fill: none; stroke-dasharray: calc(1.5px / var(--k)) calc(3.5px / var(--k)); stroke-linecap: round; }
.map__overlay .zone { stroke: var(--route); stroke-width: calc(1.8px / var(--k)); fill: rgb(163 25 91 / 0.18); }
.map__overlay .release { stroke: var(--route); stroke-width: calc(2px / var(--k)); fill: none; }
.map__overlay .depot { fill: var(--ink); stroke: var(--paper); stroke-width: calc(2px / var(--k)); }
.map__overlay .stop { fill: var(--paper); stroke: var(--ink); stroke-width: calc(1.8px / var(--k)); }
.map__overlay .dot { fill: var(--ink); }
.map__overlay text {
  font-family: var(--cond); font-weight: 500; font-size: calc(14px / var(--k)); fill: var(--ink);
  paint-order: stroke; stroke: var(--paper); stroke-width: calc(3.5px / var(--k)); stroke-linejoin: round;
}
.map__overlay text.town { font-weight: 600; font-size: calc(19px / var(--k)); letter-spacing: 0.04em; }
.map__overlay text.minor { fill: var(--ink-2); font-size: calc(13px / var(--k)); }
.map__overlay text.note { fill: var(--route); font-family: var(--sans); font-style: italic; font-weight: 400; font-size: calc(13px / var(--k)); }

/* the one orchestrated moment: routes draw in once, in delivery order */
@media (prefers-reduced-motion: no-preference) {
  .js .map__svg .draw { stroke-dashoffset: var(--len); stroke-dasharray: var(--len) var(--len); }
  .js .map__svg .draw.go { animation: draw var(--dur, 1.6s) cubic-bezier(.45, 0, .2, 1) var(--delay, 0s) forwards; }
  .js .map__overlay .later { opacity: 0; }
  .js .map__overlay.is-live .later { animation: appear 0.5s ease-out var(--delay, 0s) forwards; }
}
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes appear { to { opacity: 1; } }

@media (min-width: 900px) {
  .hero { display: grid; }
  .hero__intro, .map { grid-area: 1 / 1; }
  .map__svg { aspect-ratio: auto; height: clamp(560px, calc(100vh - 4.5rem), 920px); }
  .hero__intro {
    z-index: 1; align-self: start; justify-self: start;
    margin: clamp(1.25rem, 2.5vw, 2rem) 0 0 var(--gutter);
    padding: 1.4rem 1.6rem 1.6rem; max-width: 28.5rem;
    background: rgb(243 245 241 / 0.94); border: 1px solid var(--ink);
  }
  .hero__lede { font-size: 1.25rem; }
  .map__legend { position: absolute; right: var(--gutter); bottom: 3.6rem; margin: 0; }
}

/* ---------------------------------------------------------------- Lifeline */
.lifeline { padding: clamp(4rem, 10vw, 8rem) 0 0; }
.lifeline__head { display: grid; grid-template-columns: auto 1fr; gap: clamp(1rem, 3vw, 2rem); align-items: start; }
.lifeline__head h2 { margin-bottom: 1rem; }
.lifeline__head .fineprint { margin-top: 1rem; }
.lifeline__icon { width: clamp(3rem, 7vw, 4.5rem); height: auto; margin-top: 0.4rem; }

.shot { margin: 0; }
.shot img { width: 100%; border: 1px solid var(--rule); background: var(--paper-2); }
.shot figcaption { margin-top: 0.6rem; font-size: var(--s-1); line-height: 1.45; color: var(--ink-2); max-width: 40rem; }
.shot--wide { max-width: calc(var(--wide) + 10rem); margin: clamp(2.5rem, 6vw, 4.5rem) auto; padding: 0 var(--gutter); }

.split { display: grid; gap: 2rem; margin: clamp(3rem, 7vw, 5.5rem) 0; }
@media (min-width: 900px) {
  .split { grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(2.5rem, 5vw, 5rem); align-items: start; }
}

table { border-collapse: collapse; width: 100%; font-size: 1rem; line-height: 1.35; }
th, td { text-align: left; vertical-align: top; padding: 0.7rem 0.75rem 0.7rem 0; border-bottom: 1px solid var(--rule); }
thead th { font-weight: 500; color: var(--ink-2); font-size: var(--s-1); border-bottom-color: var(--ink); }
tbody th { font-family: var(--semi); font-weight: 600; font-size: 1.125rem; white-space: nowrap; padding-right: 1.25rem; }
.modes { margin-top: 0.35rem; }
.scores caption { caption-side: bottom; text-align: left; margin-top: 0.6rem; font-size: var(--s-1); color: var(--ink-2); }
.scores td { font-variant-numeric: tabular-nums; font-size: 1.125rem; }
.scores .is-best th, .scores .is-best td { color: var(--water); font-weight: 600; }

.gallery { display: grid; gap: clamp(1.5rem, 3vw, 2.25rem) clamp(1rem, 2.5vw, 2rem); }
@media (min-width: 700px) { .gallery { grid-template-columns: 1fr 1fr; } }

.terminal-block { display: grid; gap: 1.5rem; padding-bottom: clamp(4rem, 10vw, 7rem); }
.terminal {
  margin: 0; overflow-x: auto; padding: 1.25rem 1.4rem;
  background: #20272b; color: #dfe6e3; border-radius: 4px;
  font: 400 0.8125rem/1.6 var(--mono);
}
.terminal .t-prompt { color: #e57aa9; }

/* ---------------------------------------------------------------- side projects */
.side { background: var(--paper-2); padding: clamp(4rem, 10vw, 7rem) 0; }
.side .lead { margin-top: 1rem; }
.side__grid { display: grid; gap: 2.5rem clamp(2rem, 5vw, 4rem); margin-top: clamp(2.5rem, 5vw, 3.5rem); }
@media (min-width: 700px) { .side__grid { grid-template-columns: 1fr 1fr; } }
.side article { border-top: 2px solid var(--ink); padding-top: 1rem; max-width: 32rem; }
.side article p { margin-top: 0.5rem; }
.side .with { color: var(--ink-2); font-size: var(--s-1); margin-top: 0.75rem; }

/* ---------------------------------------------------------------- year */
.year { padding: clamp(4rem, 10vw, 7rem) 0 0; }
.year .lead { margin-top: 1rem; }
.profile { margin: 2rem 0 0; }
.profile__svg { display: block; width: 100%; height: clamp(160px, 22vw, 260px); overflow: visible; }
.profile__svg .ground { fill: #dde6d8; }
.profile__svg .line { fill: none; stroke: var(--contour); stroke-width: 1.5; }
.profile__svg .grid { stroke: var(--rule); stroke-width: 1; }
.profile__svg text { font: 500 12px var(--cond); fill: var(--ink-2); }
.profile__svg .peak { fill: var(--ink); font-weight: 600; font-size: 13px; }
.profile figcaption { margin-top: 0.6rem; font-size: var(--s-1); color: var(--ink-2); }

/* ---------------------------------------------------------------- contact */
.contact { padding: clamp(4rem, 10vw, 7rem) 0; }
.contact .lead { margin-top: 1rem; }
.contact__mail { margin-top: 2rem; font: 600 clamp(var(--s2), 6vw, var(--s4))/1.1 var(--semi); letter-spacing: -0.01em; overflow-wrap: anywhere; }
.contact__mail a { text-decoration-thickness: 2px; text-underline-offset: 0.12em; }
.contact__more { margin-top: 0.75rem; }

.foot { border-top: 1px solid var(--rule); padding: 1.5rem 0 2.5rem; color: var(--ink-2); font-size: var(--s-1); }

@media (max-width: 899px) {
  .map__overlay text.minor { display: none; }
}
@media (max-width: 599px) {
  .map__overlay text.note { display: none; }
}
@media (max-width: 520px) {
  .lifeline__head { grid-template-columns: 1fr; }
  .top nav a:first-child { display: none; }
}
