/* Mystic Island: shared system. Page CSS lives in /assets/css/<page>.css. */

/* ---------- 1. Tokens: day chart ---------- */
:root {
  color-scheme: light;

  /* land: rainforest fields */
  --land-950: #0A1F16;
  --land-900: #0F2A1E;
  --land-800: #153827;
  --land-700: #1C4A33;
  --land-600: #286143;
  --land-500: #3B7D55;

  /* water: pale jade reading ground */
  --water-0: #F4FAF6;
  --water-50: #EAF4EE;
  --water-100: #DFEDE5;
  --water-200: #CDE3D7;
  --water-300: #ABCDBC;

  /* ink */
  --ink: #0B2219;
  --ink-2: #33584A;
  --pale: #E8F3EC;
  --pale-2: #A8C7B5;

  /* the one hot colour: primary action and "you are here" */
  --mango: #F5A524;
  --mango-ink: #0B2219;

  /* form errors only */
  --alert: #B3261E;

  /* type */
  --serif: "Brygada 1918", "Iowan Old Style", Georgia, serif;
  --sans: "Archivo", "Helvetica Neue", Arial, sans-serif;
  --fs-display: clamp(2.5rem, 1.2rem + 4.2vw, 5rem);
  --fs-h1: clamp(2.5rem, 1.6rem + 3.2vw, 4.5rem);
  --fs-h2: clamp(2rem, 1.45rem + 2.1vw, 3.375rem);
  --fs-h3: clamp(1.375rem, 1.2rem + .55vw, 1.75rem);
  --fs-lede: clamp(1.1875rem, 1.1rem + .35vw, 1.375rem);
  --fs-body: 1.0625rem;
  --fs-small: .9375rem;
  --fs-label: .75rem;
  --fs-fig: clamp(1.75rem, 1.4rem + 1.2vw, 2.5rem);

  /* graticule module: everything sits on 8px */
  --u: .5rem;
  --s-1: .5rem;
  --s-2: 1rem;
  --s-3: 1.5rem;
  --s-4: 2rem;
  --s-6: 3rem;
  --s-8: 4rem;
  --s-12: 6rem;
  --s-16: 8rem;
  --sec: 4rem;
  --gutter: 1rem;
  --max: 82rem;
  --col-gap: 1rem;
  --header-h: 4rem;

  /* motion */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --t-press: 160ms;
  --t-hover: 200ms;
  --t-ui: 240ms;
  --t-photo: 450ms;
}

/* module steps: gutters 16/32/48, sections 64/96/128, column gap 16/24 */
@media (min-width: 768px) { :root { --gutter: 2rem; --sec: 6rem; --col-gap: 1.5rem; } }
@media (min-width: 1280px) { :root { --gutter: 3rem; --sec: 8rem; } }

/* ---------- 2. Tokens: night chart ---------- */
:root[data-theme="dark"] {
  color-scheme: dark;
  --land-950: #0B2117;
  --land-900: #12301F;
  --land-800: #173A27;
  --land-700: #1D4630;
  --land-600: #2A5E41;
  --land-500: #3A7853;
  --water-0: #0E1A16;
  --water-50: #0A1512;
  --water-100: #06100D;
  --water-200: #0B1814;
  --water-300: #22392E;
  --ink: #C6DACF;
  --ink-2: #8EA99B;
  --pale: #CBDFD3;
  --pale-2: #8CA999;
  --mango: #DB952F;
  --mango-ink: #08130F;
  --alert: #FF8A7A;
}

/* ---------- 3. Grounds: each sets the colours its children use ---------- */
:root,
.g-water { --bg: var(--water-100); --fg: var(--ink); --fg-2: var(--ink-2); --field: var(--water-0); }
.g-shoal { --bg: var(--water-200); --fg: var(--ink); --fg-2: var(--ink-2); --field: var(--water-0); }
.g-land  { --bg: var(--land-900); --fg: var(--pale); --fg-2: var(--pale-2); --field: var(--land-800); }
.g-leaf  { --bg: var(--land-700); --fg: var(--pale); --fg-2: var(--pale-2); --field: var(--land-800); }
.g-deep  { --bg: var(--land-950); --fg: var(--pale); --fg-2: var(--pale-2); --field: var(--land-800); }
:is(.g-land, .g-leaf, .g-deep) { --alert: #FFA393; }

/* derived lines are re-declared per ground so they follow its --fg */
:root, .g-water, .g-shoal, .g-land, .g-leaf, .g-deep {
  --rule: color-mix(in oklab, var(--fg) 20%, transparent);
  --neat: color-mix(in oklab, var(--fg) 62%, transparent);
  --contour: color-mix(in oklab, var(--fg) 11%, transparent);
}
:is(.g-water, .g-shoal, .g-land, .g-leaf, .g-deep) { background-color: var(--bg); color: var(--fg); }
[data-theme="dark"] :is(.g-land, .g-leaf, .g-deep) { --contour: color-mix(in oklab, var(--fg) 8%, transparent); }

/* ---------- 4. Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-padding-top: calc(var(--header-h) + var(--s-3));
  scrollbar-color: var(--land-600) var(--water-200);
}
body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font: 400 var(--fs-body)/1.6 var(--serif);
  font-kerning: normal;
  font-variant-ligatures: common-ligatures;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; }
img { height: auto; }
p, ul, ol, dl, dd, figure, blockquote { margin: 0; }
ul[role="list"], ol[role="list"] { list-style: none; padding: 0; }
p, li, dd { text-wrap: pretty; }
::selection { background: var(--land-500); color: #fff; }
[hidden] { display: none !important; }

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.08;
  letter-spacing: -0.012em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-h1); line-height: 1.04; }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); line-height: 1.2; letter-spacing: -0.006em; }
h4 { font-size: var(--fs-lede); line-height: 1.3; }

/* ---------- 5. Cartographic type law ---------- */
/* water and living things: italic serif */
.t-water, .t-life, :is(h1, h2, h3) em { font-family: var(--serif); font-style: italic; font-weight: inherit; }
/* land and places: wide tracked capitals */
.t-place, .label {
  font-family: var(--sans);
  font-stretch: 125%;
  font-style: normal;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
}
.t-place { font-size: .8em; }
:is(h1, h2, h3) .t-place { font-size: .58em; letter-spacing: .12em; vertical-align: .12em; }
.label { font-size: var(--fs-label); line-height: 1.4; font-weight: 500; color: var(--fg-2); }
/* figures: tabular sans */
.fig {
  font-family: var(--sans);
  font-stretch: 125%;
  font-weight: 500;
  font-style: normal;
  font-variant-numeric: tabular-nums lining-nums;
  letter-spacing: 0;
}
:where(p, li, dd, span, td) > .fig { font-size: max(.88em, 11px); }
.fig--lg { font-size: var(--fs-fig); line-height: 1; font-weight: 500; }

.lede { font-size: var(--fs-lede); line-height: 1.45; color: var(--fg-2); max-width: 40em; }
.muted { color: var(--fg-2); }
.small { font-size: var(--fs-small); line-height: 1.5; }
.prose { max-width: 38em; }
.prose > * + * { margin-top: 1em; }

/* ---------- 6. Layout: wrap, grid, sections ---------- */
.wrap { width: 100%; max-width: calc(var(--max) + 2 * var(--gutter)); margin-left: auto; margin-right: auto; padding-left: var(--gutter); padding-right: var(--gutter); }
.grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); }
.sec { padding-top: var(--sec); padding-bottom: var(--sec); position: relative; }
.sec-head { display: grid; gap: var(--s-2); max-width: 46rem; margin-bottom: var(--s-8); }
.sec-head > p { color: var(--fg-2); font-size: var(--fs-lede); line-height: 1.45; max-width: 36em; }
@media (min-width: 1024px) {
  .sec-head--split { max-width: none; grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); align-items: end; }
  .sec-head--split > h2 { grid-column: 1 / span 7; }
  .sec-head--split > :not(h2) { grid-column: 8 / -1; }
}
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2) var(--s-4); }

/* quiet texture: land contours and water depths, tinted by the ground */
.contours, .depths { position: relative; isolation: isolate; }
.contours::before, .depths::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--contour);
  -webkit-mask: url("/assets/img/contours.svg") center / cover no-repeat;
  mask: url("/assets/img/contours.svg") center / cover no-repeat;
}
.depths::before {
  -webkit-mask-image: url("/assets/img/depths.svg");
  mask-image: url("/assets/img/depths.svg");
}

/* ---------- 7. Links and buttons ---------- */
a { color: inherit; text-underline-offset: .2em; text-decoration-thickness: 1px; }
.link, .prose a {
  color: inherit;
  text-decoration: none;
  background:
    linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat,
    linear-gradient(var(--rule), var(--rule)) 0 100% / 100% 1px no-repeat;
  padding-bottom: 2px;
  transition: background-size var(--t-hover) var(--ease-out);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-1);
  min-height: 3rem;
  padding: 0 var(--s-3);
  border: 0;
  border-radius: 0;
  background: var(--mango);
  color: var(--mango-ink);
  font: 600 .8125rem/1 var(--sans);
  font-stretch: 125%;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--t-press) var(--ease-out), background-color var(--t-hover) var(--ease-out);
}
.btn:active { transform: scale(.97); }
.btn:disabled { opacity: .6; cursor: progress; transform: none; }
.btn--sm { min-height: 2.5rem; padding: 0 var(--s-2); font-size: .75rem; }

/* the one secondary: a wide-caps link with a drawn underline and an arrow */
.go {
  display: inline-flex;
  align-items: center;
  gap: .625rem;
  min-height: 3rem;
  color: var(--fg);
  font: 600 .8125rem/1.3 var(--sans);
  font-stretch: 125%;
  letter-spacing: .12em;
  text-transform: uppercase;
  text-decoration: none;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--t-press) var(--ease-out);
}
.go > span {
  background:
    linear-gradient(currentColor, currentColor) 0 100% / 0 1px no-repeat,
    linear-gradient(var(--neat), var(--neat)) 0 100% / 100% 1px no-repeat;
  padding-bottom: 4px;
  transition: background-size var(--t-hover) var(--ease-out);
}
.go > svg, .arr {
  flex: none;
  width: 1.125rem;
  height: 1.125rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: square;
  transition: transform var(--t-hover) var(--ease-out);
}
.go:active { transform: scale(.97); }

.icon-btn {
  display: inline-grid;
  place-items: center;
  width: 2.75rem;
  height: 2.75rem;
  padding: 0;
  border: 1px solid var(--rule);
  border-radius: 0;
  background: transparent;
  color: var(--fg);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: transform var(--t-press) var(--ease-out), border-color var(--t-hover) var(--ease-out), background-color var(--t-hover) var(--ease-out);
}
.icon-btn svg { width: 1.25rem; height: 1.25rem; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: square; stroke-linejoin: round; }
.icon-btn:active { transform: scale(.97); }
.theme-toggle[aria-pressed="true"] svg { fill: currentColor; }

/* hover only where a fine pointer exists */
@media (hover: hover) and (pointer: fine) {
  .link:hover, .prose a:hover { background-size: 100% 1px, 100% 1px; }
  .btn:hover { background-color: color-mix(in oklab, var(--mango) 86%, var(--mango-ink)); }
  .go:hover > span { background-size: 100% 1px, 100% 1px; }
  .go:hover > svg, a:hover .go > svg { transform: translateX(3px); }
  a:hover .go > span { background-size: 100% 1px, 100% 1px; }
  .icon-btn:hover { border-color: var(--neat); background-color: color-mix(in oklab, var(--fg) 6%, transparent); }
  a:hover .inset__pic img { transform: scale(1.03); }
}

/* ---------- 8. Focus, skip link, scrollbars ---------- */
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.btn:focus-visible { outline-color: var(--fg); }
a.inset:focus-visible, a:focus-visible .inset { outline: 2px solid var(--fg); outline-offset: 3px; }
.skip {
  position: absolute;
  left: var(--s-2);
  top: -4rem;
  z-index: 100;
  padding: var(--s-1) var(--s-2);
  background: var(--mango);
  color: var(--mango-ink);
  font: 600 .8125rem/1.5 var(--sans);
  text-decoration: none;
}
.skip:focus { top: var(--s-2); }
.vh {
  position: absolute !important;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0);
  white-space: nowrap; border: 0;
}

/* ---------- 9. Header and sheet index ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid transparent;
  view-transition-name: site-header;
  transition: border-color var(--t-ui) var(--ease-out), box-shadow var(--t-ui) var(--ease-out);
}
.site-header.is-stuck { border-bottom-color: var(--rule); box-shadow: 0 10px 24px -18px rgb(0 0 0 / .6); }
.site-header__bar { display: flex; align-items: center; gap: var(--s-3); min-height: var(--header-h); }

.brand {
  display: inline-flex;
  align-items: center;
  gap: .75rem;
  margin-right: auto;
  color: var(--fg);
  font: 700 .8125rem/1 var(--sans);
  font-stretch: 125%;
  letter-spacing: .2em;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
}
.brand__mark { width: 1.75rem; height: 1.75rem; flex: none; fill: none; stroke: currentColor; stroke-width: 1.15; }
.brand__mark .dock { fill: var(--mango); stroke: none; }

.lang { display: flex; align-items: center; }
.lang a {
  display: inline-grid;
  place-items: center;
  min-width: 2.25rem;
  min-height: 2.75rem;
  color: var(--fg-2);
  font: 600 .75rem/1 var(--sans);
  font-stretch: 125%;
  letter-spacing: .12em;
  text-decoration: none;
  transition: color var(--t-hover) var(--ease-out);
}
.lang a[aria-current] { color: var(--fg); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: .5em; }

.sheet-index ul { display: flex; list-style: none; margin: 0; padding: 0; }
.sheet-index a {
  position: relative;
  display: flex;
  align-items: center;
  gap: .625rem;
  color: var(--fg-2);
  font: 500 .75rem/1.2 var(--sans);
  font-stretch: 125%;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color var(--t-hover) var(--ease-out);
}
.sheet-index a[aria-current="page"] { color: var(--fg); }
/* "you are here": a mango position fix */
.sheet-index a[aria-current="page"]::before {
  content: "";
  width: .5rem;
  height: .5rem;
  flex: none;
  border-radius: 50%;
  background: var(--mango);
  box-shadow: 0 0 0 3px var(--bg), 0 0 0 4px var(--mango);
}
@media (hover: hover) and (pointer: fine) {
  .sheet-index a:hover, .lang a:hover { color: var(--fg); }
}

.menu-btn, .menu-close { border-color: var(--neat); }

/* phones and tablets: the menu is a popover sheet (works without JS) */
@media (max-width: 1279px) {
  .site-menu:popover-open {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0 var(--gutter) var(--s-4);
    border: 0;
    display: flex;
    flex-direction: column;
    overflow-y: auto;
    background-color: var(--bg);
    color: var(--fg);
    opacity: 1;
    transform: none;
    transition: opacity var(--t-ui) var(--ease-out), transform var(--t-ui) var(--ease-out);
  }
  @starting-style {
    .site-menu:popover-open { opacity: 0; transform: translateY(-.5rem); }
  }
  .site-menu::backdrop { background: transparent; }
  .site-menu__top { display: flex; justify-content: flex-end; align-items: center; min-height: var(--header-h); }
  .sheet-index { margin-top: var(--s-2); border-top: 1px solid var(--rule); }
  .sheet-index ul { flex-direction: column; }
  .sheet-index a { min-height: 4rem; font-size: 1rem; letter-spacing: .12em; border-bottom: 1px solid var(--rule); }
  .site-menu__end { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s-2); margin-top: var(--s-4); }
  .site-menu__end .btn { flex: 1 0 100%; min-height: 3.5rem; margin-top: var(--s-2); order: 3; }
}

/* desktop: the same element, laid out inline */
@media (min-width: 1280px) {
  .menu-btn, .site-menu__top { display: none; }
  .site-menu {
    position: static;
    display: flex;
    align-items: center;
    gap: var(--s-3);
    width: auto;
    height: auto;
    margin: 0;
    padding: 0;
    border: 0;
    overflow: visible;
    background: none;
    color: inherit;
  }
  .sheet-index li { border-left: 1px solid var(--rule); }
  .sheet-index li:last-child { border-right: 1px solid var(--rule); }
  .sheet-index a { min-height: var(--header-h); padding: 0 1.125rem; }
  .sheet-index a::after {
    content: "";
    position: absolute;
    left: 1.125rem;
    right: 1.125rem;
    bottom: 1.25rem;
    height: 1px;
    background: currentColor;
    transform: scaleX(0);
    transform-origin: left;
    transition: transform var(--t-hover) var(--ease-out);
  }
  .sheet-index a[aria-current="page"]::after { left: 2.25rem; }
  .site-menu__end { display: flex; align-items: center; gap: var(--s-2); }
}
@media (min-width: 1280px) and (hover: hover) and (pointer: fine) {
  .sheet-index a:hover::after { transform: scaleX(1); }
}

/* ---------- 10. Sheet title block (interior pages) ---------- */
.sheet-title { padding-top: var(--s-6); padding-bottom: var(--s-12); }
.sheet-title__grid { display: grid; gap: var(--s-3); }
.crumbs ol { display: flex; flex-wrap: wrap; align-items: center; gap: .75rem; list-style: none; margin: 0; padding: 0 0 var(--s-2); border-bottom: 1px solid var(--rule); }
.crumbs li { display: inline-flex; align-items: center; gap: .75rem; }
.crumbs li + li::before { content: ""; width: 1.5rem; height: 1px; background: var(--neat); }
.crumbs a { color: var(--fg-2); text-decoration: none; transition: color var(--t-hover) var(--ease-out); }
.crumbs [aria-current] { color: var(--fg); }
.sheet-title h1 { max-width: 16ch; margin-top: var(--s-4); view-transition-name: sheet-title; }
.sheet-title__line { font-size: var(--fs-lede); line-height: 1.45; color: var(--fg-2); max-width: 34em; }
@media (hover: hover) and (pointer: fine) { .crumbs a:hover { color: var(--fg); } }
@media (min-width: 1024px) {
  .sheet-title__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); align-items: end; }
  .sheet-title__grid > * { grid-column: 1 / -1; }
  .sheet-title__grid > .sheet-title__text { grid-column: 1 / span 7; }
  .sheet-title__grid > .sheet-title__inset { grid-column: 8 / -1; grid-row: 2 / span 3; }
}
.sheet-title__text { display: grid; gap: var(--s-3); }

/* ---------- 11. Chart insets: neatline, minute-scale band, picture ---------- */
.inset { position: relative; display: block; color: inherit; text-decoration: none; }
.inset__pic { position: relative; overflow: hidden; aspect-ratio: var(--ar, auto); background: color-mix(in oklab, var(--fg) 10%, var(--bg)); }
.inset__pic img { width: 100%; height: 100%; object-fit: cover; transition: transform var(--t-photo) var(--ease-out); }
/* the gulf chart keeps a chart's neatline: minute-scale band and inner rule (photos have no frame) */
.inset--chart {
  --band: 6px;
  --seg: 2rem;
  padding: 12px;
  border: 1px solid var(--neat);
  background:
    repeating-linear-gradient(90deg, var(--neat) 0 var(--seg), transparent 0 calc(2 * var(--seg))) 0 0 / 100% var(--band) no-repeat,
    repeating-linear-gradient(90deg, var(--neat) 0 var(--seg), transparent 0 calc(2 * var(--seg))) 0 100% / 100% var(--band) no-repeat,
    repeating-linear-gradient(180deg, var(--neat) 0 var(--seg), transparent 0 calc(2 * var(--seg))) 0 0 / var(--band) 100% no-repeat,
    repeating-linear-gradient(180deg, var(--neat) 0 var(--seg), transparent 0 calc(2 * var(--seg))) 100% 0 / var(--band) 100% no-repeat;
}
.inset--chart::before { content: ""; position: absolute; inset: var(--band); border: 1px solid var(--neat); pointer-events: none; }
.ar-1x1 { --ar: 1 / 1; }
.ar-4x5 { --ar: 4 / 5; }
.ar-3x4 { --ar: 3 / 4; }
.ar-4x3 { --ar: 4 / 3; }
.ar-3x2 { --ar: 3 / 2; }
.ar-16x9 { --ar: 16 / 9; }
.ar-2x3 { --ar: 2 / 3; }
/* a filler inset takes the height its grid row already has (desktop); phones keep its own crop */
@media (min-width: 1024px) {
  .inset.fill > .inset__pic { aspect-ratio: auto; height: 100%; }
  .inset.fill > .inset__pic img { position: absolute; inset: 0; }
}
[data-theme="dark"] .inset__pic img { filter: brightness(.9); }


/* species plate: picture plus field-guide name */
.plate { display: grid; gap: .875rem; align-content: start; color: inherit; text-decoration: none; }
.species { display: grid; gap: .125rem; font: italic 400 1.0625rem/1.3 var(--serif); }
.species i { font-size: .875rem; color: var(--fg-2); }

/* responsive photo grid */
.pgrid { --cols: 3; display: grid; grid-template-columns: repeat(var(--cols), minmax(0, 1fr)); gap: var(--s-4) var(--col-gap); list-style: none; margin: 0; padding: 0; }
.pgrid--4 { --cols: 4; }
.pgrid--2 { --cols: 2; }
.pgrid .span-2 { grid-column: span 2; }
@media (max-width: 1023px) { .pgrid--4 { --cols: 3; } }
@media (max-width: 767px) { .pgrid, .pgrid--4 { --cols: 2; gap: var(--s-3) var(--col-gap); } }
@media (max-width: 479px) { .pgrid:not(.pgrid--keep) { --cols: 1; } .pgrid .span-2 { grid-column: auto; } }

/* ---------- 12. Spec lists ---------- */
.spec { display: grid; border-top: 1px solid var(--rule); }
.spec > div { display: grid; grid-template-columns: minmax(7rem, 2fr) 3fr; gap: var(--s-2); align-items: baseline; padding: .875rem 0; border-bottom: 1px solid var(--rule); }
.spec dt { font: 500 var(--fs-label)/1.4 var(--sans); font-stretch: 125%; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-2); }
.spec dd { margin: 0; }
@media (max-width: 479px) { .spec > div { grid-template-columns: 1fr; gap: .25rem; } }

/* ---------- 13. Forms ---------- */
.field { display: grid; gap: var(--s-1); align-content: start; }
.field > label, .field > .label { font: 500 var(--fs-label)/1.4 var(--sans); font-stretch: 125%; letter-spacing: .14em; text-transform: uppercase; color: var(--fg-2); }
input:not([type="checkbox"], [type="radio"], [type="submit"]), select, textarea {
  width: 100%;
  min-height: 3rem;
  padding: .75rem .875rem;
  border: 1px solid var(--neat);
  border-radius: 0;
  background-color: var(--field);
  color: var(--fg);
  font: 400 1rem/1.4 var(--serif);
  transition: border-color var(--t-hover) var(--ease-out), box-shadow var(--t-hover) var(--ease-out);
}
textarea { resize: vertical; min-height: 7rem; }
select { appearance: none; padding-right: 2.75rem; }
/* drawn chevron for selects and a drawn calendar for dates, both in the ground's ink */
.field:has(> select) { position: relative; }
.field:has(> select)::after {
  content: "";
  position: absolute;
  right: .875rem;
  bottom: 1.5rem;
  width: .875rem;
  height: .875rem;
  translate: 0 50%;
  pointer-events: none;
  background-color: var(--fg);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2 5l5 5 5-5' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 14 14'%3E%3Cpath d='M2 5l5 5 5-5' fill='none' stroke='%23000' stroke-width='1.6'/%3E%3C/svg%3E") center / contain no-repeat;
}
::placeholder { color: var(--fg-2); opacity: 1; }
input:focus-visible, select:focus-visible, textarea:focus-visible { outline: none; border-color: var(--fg); box-shadow: 0 0 0 3px color-mix(in oklab, var(--fg) 20%, transparent); }
input[aria-invalid="true"], select[aria-invalid="true"], textarea[aria-invalid="true"] { border-color: var(--alert); }
input[type="checkbox"], input[type="radio"] { accent-color: var(--fg); width: 1.125rem; height: 1.125rem; }
::-webkit-calendar-picker-indicator {
  width: 1.125rem;
  height: 1.125rem;
  padding: 0;
  cursor: pointer;
  background: var(--fg-2);
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 18 18'%3E%3Cpath d='M2.5 4.5h13v11h-13zM2.5 8h13M6 2.5v3.5M12 2.5v3.5' fill='none' stroke='%23000' stroke-width='1.4'/%3E%3C/svg%3E") center / contain no-repeat;
}
::-webkit-calendar-picker-indicator:hover { background: var(--fg); }
/* an empty date shows its format in the secondary ink, like a placeholder (data-empty is set by the page script) */
input[type="date"][data-empty]::-webkit-datetime-edit { color: var(--fg-2); }

/* ---------- 14. Closing band ---------- */
.close { padding-top: var(--sec); padding-bottom: var(--sec); }
.close__grid { display: grid; gap: var(--s-3); }
.close__grid h2 { max-width: 14ch; }
.close__line { font-size: var(--fs-lede); line-height: 1.45; color: var(--fg-2); max-width: 32em; }
.close .actions { margin-top: var(--s-2); }
@media (min-width: 1024px) {
  .close__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); column-gap: var(--col-gap); align-items: end; }
  .close__grid h2 { grid-column: 1 / span 6; font-size: clamp(2.5rem, 1.6rem + 3vw, 4.5rem); }
  .close__grid .close__body { grid-column: 8 / -1; display: grid; gap: var(--s-3); }
}

/* ---------- 15. Footer ---------- */
.site-footer { padding-top: var(--s-12); padding-bottom: var(--s-4); }
.site-footer__grid { display: grid; gap: var(--s-6) var(--col-gap); }
.site-footer__id { display: grid; gap: var(--s-2); align-content: start; }
.site-footer__id .brand { margin-right: 0; }
.site-footer__addr { color: var(--fg-2); font-size: var(--fs-label); line-height: 1.6; }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: .25rem; align-content: start; }
.site-footer nav a, .site-footer__social a {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  color: var(--fg-2);
  font: 500 .75rem/1.2 var(--sans);
  font-stretch: 125%;
  letter-spacing: .14em;
  text-transform: uppercase;
  text-decoration: none;
  transition: color var(--t-hover) var(--ease-out);
}
.site-footer nav a[aria-current="page"] { color: var(--fg); }
.site-footer__base { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: var(--s-2); padding-top: var(--s-3); border-top: 1px solid var(--rule); }
.legal { color: var(--fg-2); font-size: var(--fs-small); }
.theme-toggle--text { width: auto; gap: .625rem; padding: 0 var(--s-2); display: inline-flex; font: 500 .75rem/1 var(--sans); font-stretch: 125%; letter-spacing: .14em; text-transform: uppercase; }
@media (hover: hover) and (pointer: fine) {
  .site-footer nav a:hover, .site-footer__social a:hover { color: var(--fg); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 4px; }
}
@media (min-width: 768px) {
  .site-footer__grid { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .site-footer__id { grid-column: 1 / span 6; }
  .site-footer__grid > nav { grid-column: 7 / span 3; }
  .site-footer__social { grid-column: 10 / -1; }
  .site-footer__base { grid-column: 1 / -1; }
}

/* ---------- 16. Sheet-to-sheet view transition ---------- */
@media (prefers-reduced-motion: no-preference) {
  @view-transition { navigation: auto; }
  ::view-transition-old(root) { animation: 280ms var(--ease-out) both vt-settle; }
  ::view-transition-new(root) { animation: 460ms var(--ease-out) both vt-iris; }
  ::view-transition-group(sheet-title) { animation-duration: 460ms; animation-timing-function: var(--ease-in-out); }
}
@keyframes vt-iris { from { clip-path: circle(6% at 50% 0); } to { clip-path: circle(150% at 50% 0); } }
@keyframes vt-settle { to { opacity: .55; } }

/* ---------- 17. Reduced motion: colour still changes, nothing travels ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .btn, .go, .icon-btn, .go > svg, .inset__pic img, .sheet-index a::after, .site-menu:popover-open {
    transition-property: color, background-color, border-color, opacity;
  }
  .btn:active, .go:active, .icon-btn:active { transform: none; }
  .go:hover > svg, a:hover .go > svg, a:hover .inset__pic img { transform: none; }
  .sheet-index a::after { transform: scaleX(1); opacity: 0; }
  .sheet-index a:hover::after { opacity: 1; }
}
