/* ==========================================================================
   Charlie Clyde — personal site
   Display: Fraunces. Reading: Newsreader. Metadata: IBM Plex Mono.
   ========================================================================== */

:root {
  --bg:         #f3ecdc;
  --bg-2:       #ece4d0;
  --bg-3:       #e5dcc5;
  --ink:        #191714;
  --ink-soft:   #4b463e;
  --ink-faint:  #877f6e;
  --rule:       #d7cdb5;
  --rule-fine:  #e2d9c4;
  --accent:     #27527f;
  --accent-lit: #33679b;

  --display: "Fraunces", "Iowan Old Style", Georgia, serif;
  --serif:   "Newsreader", Georgia, serif;
  --mono:    "IBM Plex Mono", ui-monospace, Menlo, monospace;
  --italic:  "Instrument Serif", "Newsreader", Georgia, serif;

  --wrap:  76rem;
  --pad:   clamp(1.25rem, 5vw, 3.5rem);
  --ease:  cubic-bezier(.2, .7, .2, 1);

  /* Every piece of mono metadata draws from one of these two, so the
     small type stays on a single scale instead of drifting per component. */
  --meta:    1.1rem;   /* dates, places, indices, section numbers ≈ 13pt */
  --meta-sm: 1rem;     /* uppercase micro-labels: tags, counts, dt ≈ 12pt */
  --meta-nav: 1.02rem; /* nav only — eight items have a width budget */

  color-scheme: light;
}

[data-theme="dark"] {
  --bg:         #131211;
  --bg-2:       #191715;
  --bg-3:       #1f1c19;
  --ink:        #ece7db;
  --ink-soft:   #b0a99a;
  --ink-faint:  #7a7468;
  --rule:       #312d27;
  --rule-fine:  #262320;
  --accent:     #d4835c;
  --accent-lit: #e59b76;
  color-scheme: dark;
}

/* No-JS fallback only; JS always stamps an explicit data-theme. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg:         #131211;
    --bg-2:       #191715;
    --bg-3:       #1f1c19;
    --ink:        #ece7db;
    --ink-soft:   #b0a99a;
    --ink-faint:  #7a7468;
    --rule:       #312d27;
    --rule-fine:  #262320;
    --accent:     #d4835c;
    --accent-lit: #e59b76;
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-optical-sizing: auto;
  font-size: 1.35rem;
  font-weight: 380;
  line-height: 1.56;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--accent); color: var(--bg); }

:focus-visible {
  outline: 1.5px solid var(--accent);
  outline-offset: 3px;
}

/* Only while the theme is actually changing, so nothing animates on load. */
.is-theming, .is-theming *, .is-theming *::before, .is-theming *::after {
  transition: background-color .5s ease, border-color .5s ease,
              color .5s ease, fill .5s ease !important;
}

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--pad);
}

.skip { position: absolute; left: -9999px; }
.skip:focus {
  left: 1rem; top: 1rem; z-index: 100;
  background: var(--bg); color: var(--ink);
  padding: .6rem .9rem; border: 1px solid var(--accent);
  font-family: var(--mono); font-size: .75rem;
}

/* ── Links ────────────────────────────────────────────────────────────── */

a { color: inherit; }

.lnk {
  color: var(--accent);
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
  padding-bottom: 1px;
  transition: background-size .35s var(--ease), color .25s ease;
}
.lnk:hover { color: var(--accent-lit); background-size: 100% 2px; }

.lnk--arrow { background-image: none; padding-bottom: 0; }
.lnk--arrow::after {
  content: "\2192";
  display: inline-block;
  margin-left: .45em;
  transition: transform .32s var(--ease);
}
.lnk--arrow:hover::after { transform: translateX(4px); }

/* ── Navigation ───────────────────────────────────────────────────────── */

.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 2rem;
  padding: clamp(1rem, 2.4vw, 1.6rem) var(--pad);
  border-bottom: 1px solid transparent;
  transition: padding .45s var(--ease), background-color .45s ease,
              border-color .45s ease;
}
.nav.is-stuck {
  padding-top: .65rem;
  padding-bottom: .65rem;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: blur(14px) saturate(1.3);
  border-bottom-color: var(--rule);
}

.nav__mark {
  display: flex;
  gap: .08em;
  font-family: var(--display);
  font-weight: 800;
  font-size: 1.45rem;
  letter-spacing: -.02em;
  text-decoration: none;
  line-height: 1;
}
.nav__mark span { transition: transform .5s var(--ease), color .3s ease; }
.nav__mark:hover span:first-child { transform: translateY(-2px); color: var(--accent); }
.nav__mark:hover span:last-child  { transform: translateY(2px); }

.nav__links { display: flex; gap: clamp(.9rem, 1.7vw, 1.5rem); }

.nav__links a {
  position: relative;
  display: inline-flex;
  align-items: baseline;
  gap: .4em;
  padding: .35rem 0;
  font-family: var(--mono);
  font-size: var(--meta-nav);
  letter-spacing: .04em;
  color: var(--ink-soft);
  text-decoration: none;
  transition: color .3s ease;
}
.nav__links a i {
  font-style: normal;
  font-size: .88em;
  color: var(--accent);
  opacity: .5;
  transition: opacity .3s ease;
}
.nav__links a em { font-style: normal; }
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: .1rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s var(--ease);
}
.nav__links a:hover { color: var(--ink); }
.nav__links a:hover::after { transform: scaleX(1); }
.nav__links a[aria-current="true"] { color: var(--accent); }
.nav__links a[aria-current="true"] i { opacity: 1; }
.nav__links a[aria-current="true"]::after { transform: scaleX(1); }

.nav__tools { display: flex; align-items: center; gap: 1rem; }

.toggle {
  position: relative;
  width: 2.6rem;
  height: 2.6rem;
  background: none;
  border: 0;
  padding: 0;
  cursor: pointer;
  color: var(--ink-soft);
  transition: color .3s ease;
}
.toggle:hover { color: var(--accent); }

.toggle svg {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 2rem;
  height: 2rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  transition: opacity .45s var(--ease), transform .55s var(--ease);
}

/* Show the icon for the theme you are switching TO. */
.toggle .icon-moon { opacity: 1; transform: none; }
.toggle .icon-sun  { opacity: 0; transform: rotate(-80deg) scale(.5); }
[data-theme="dark"] .toggle .icon-moon { opacity: 0; transform: rotate(80deg) scale(.5); }
[data-theme="dark"] .toggle .icon-sun  { opacity: 1; transform: none; }

.menubtn {
  display: none;
  align-items: center;
  gap: .5rem;
  background: none;
  border: 0;
  padding: .4rem 0;
  cursor: pointer;
  font-family: var(--mono);
  font-size: var(--meta-nav);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink);
}
.menubtn__bars { display: block; width: 1.1rem; }
.menubtn__bars i {
  display: block;
  height: 1px;
  background: currentColor;
  transition: transform .4s var(--ease);
}
.menubtn__bars i:first-child { margin-bottom: 4px; }
.menubtn[aria-expanded="true"] .menubtn__bars i:first-child { transform: translateY(2.5px) rotate(9deg); }
.menubtn[aria-expanded="true"] .menubtn__bars i:last-child  { transform: translateY(-2.5px) rotate(-9deg); }

/* ── Mobile menu ──────────────────────────────────────────────────────── */

.menu {
  position: fixed;
  inset: 0;
  z-index: 55;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 2rem;
  padding: 6rem var(--pad) 3rem;
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  transition: opacity .5s var(--ease), visibility .5s;
}
.menu.is-open { opacity: 1; visibility: visible; }
.menu[hidden] { display: none; }

.menu__links { display: flex; flex-direction: column; gap: .35rem; }
.menu__links a {
  display: flex;
  align-items: baseline;
  gap: .7rem;
  font-family: var(--display);
  font-size: clamp(1.9rem, 9vw, 3rem);
  font-weight: 700;
  letter-spacing: -.025em;
  text-decoration: none;
  opacity: 0;
  transform: translateY(14px);
  transition: opacity .5s var(--ease), transform .5s var(--ease), color .3s ease;
}
.menu.is-open .menu__links a { opacity: 1; transform: none; }
.menu__links a i {
  font-family: var(--mono);
  font-style: normal;
  font-size: var(--meta);
  color: var(--accent);
}
.menu__links a:active { color: var(--accent); }

.menu__foot {
  margin: 0;
  font-family: var(--mono);
  font-size: var(--meta-sm);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ── Hero ─────────────────────────────────────────────────────────────── */

.hero {
  position: relative;
  height: 100vh;
  height: 100svh;
  min-height: 32rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
  padding: 6rem var(--pad) 5rem;
}

.hero__canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

/* Keeps the name legible whatever the backdrop is doing behind it. */
.hero__scrim {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(58% 46% at 50% 48%,
      color-mix(in srgb, var(--bg) 88%, transparent) 0%,
      color-mix(in srgb, var(--bg) 55%, transparent) 45%,
      transparent 100%);
}

.hero__inner {
  position: relative;
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  will-change: transform;
}

.hero__name {
  margin: 0;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(3.2rem, 11.2vw, 10rem);
  font-variation-settings: "opsz" 120, "SOFT" 12;
  line-height: .86;
  letter-spacing: -.045em;
  text-indent: -.045em;
}

.hero__name .word {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  padding-bottom: .1em;
  margin-bottom: -.1em;
}
.hero__name .word > span {
  display: inline-block;
  transform: translateY(105%);
  transition: transform 1.15s var(--ease);
}
.hero__name .word:nth-child(2) > span { transition-delay: .1s; }
.is-ready .hero__name .word > span { transform: none; }

.hero__note {
  margin: clamp(1.5rem, 3vw, 2.25rem) 0 0;
  max-width: 34ch;
  font-size: clamp(1.16rem, 1.7vw, 1.44rem);
  font-style: italic;
  color: var(--ink-soft);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .9s var(--ease) .55s, transform .9s var(--ease) .55s;
}
.is-ready .hero__note { opacity: 1; transform: none; }

.hero__scroll {
  position: absolute;
  left: 50%;
  bottom: clamp(1.5rem, 4vh, 2.75rem);
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  font-family: var(--mono);
  font-size: var(--meta-sm);
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-faint);
  text-decoration: none;
  opacity: 0;
  transition: opacity .9s ease .9s, color .3s ease;
}
.is-ready .hero__scroll { opacity: 1; }
.hero__scroll:hover { color: var(--accent); }
.hero__scroll i {
  display: block;
  width: 1px;
  height: 2.5rem;
  background: linear-gradient(var(--ink-faint), transparent);
  position: relative;
  overflow: hidden;
}
.hero__scroll i::after {
  content: "";
  position: absolute;
  inset: 0 auto auto 0;
  width: 1px;
  height: 45%;
  background: var(--accent);
  animation: trickle 2.6s var(--ease) infinite;
}
@keyframes trickle {
  0%   { transform: translateY(-100%); }
  60%, 100% { transform: translateY(250%); }
}

/* ── Sections ─────────────────────────────────────────────────────────── */

.section {
  padding-block: clamp(4.5rem, 10vw, 9rem);
  border-top: 1px solid var(--rule);
  scroll-margin-top: 4.5rem;
  background: var(--bg);
}

/* Sections step through three tones so the page reads as banded paper
   rather than one flat sheet. */
.section:nth-of-type(3n + 2) { background: var(--bg-2); }
.section:nth-of-type(3n)     { background: var(--bg-3); }

/* Pinned so the map's country strokes always match the paper behind them. */
#travel { background: var(--bg); }

.section__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 2rem;
  margin-bottom: clamp(2.5rem, 5vw, 4.25rem);
  padding-bottom: clamp(1rem, 2vw, 1.5rem);
  border-bottom: 1px solid var(--rule-fine);
}

.section__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.4rem, 7.4vw, 5.5rem);
  font-variation-settings: "opsz" 90, "SOFT" 10;
  line-height: .92;
  letter-spacing: -.035em;
}

.section__num {
  margin: 0 0 .4rem;
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: var(--meta);
  letter-spacing: .12em;
  color: var(--accent);
}

/* Word-level reveal for split headings. */
.split .word { display: inline-block; overflow: hidden; padding-bottom: .08em; margin-bottom: -.08em; }
.split .word > span {
  display: inline-block;
  transform: translateY(105%);
  transition: transform .95s var(--ease) var(--d, 0ms);
}
.split.is-in .word > span { transform: none; }

/* ── About ────────────────────────────────────────────────────────────── */

.about {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.35fr);
  gap: clamp(2rem, 5.5vw, 5rem);
  align-items: start;
}

.facts { margin: 0; }
.facts__row {
  display: grid;
  gap: .25rem;
  padding: .9rem 0;
  border-top: 1px solid var(--rule-fine);
}
.facts__row:last-child { border-bottom: 1px solid var(--rule-fine); }
.facts dt {
  font-family: var(--mono);
  font-size: var(--meta-sm);
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-faint);
}
.facts dd { margin: 0; font-size: 1.25rem; text-wrap: pretty; }

.prose { max-width: 40rem; }
.prose p { margin: 0 0 1.2rem; text-wrap: pretty; }
.prose p:last-child { margin-bottom: 0; }
.prose .lead {
  font-size: clamp(1.35rem, 2.1vw, 1.6rem);
  line-height: 1.48;
  color: var(--ink);
}

.pull {
  margin: clamp(3.5rem, 8vw, 6.5rem) 0 0;
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.pull p {
  margin: 0 auto;
  max-width: var(--wrap);
  padding-inline: var(--pad);
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.55rem, 4.4vw, 3.2rem);
  font-variation-settings: "opsz" 80, "SOFT" 20;
  line-height: 1.1;
  letter-spacing: -.028em;
  text-wrap: balance;
}

/* The rotating phrase sits on its own line so the static sentence above never
   reflows as it types. Every phrase is stacked invisibly in the same grid
   cell, so the block is always as tall as the longest one wraps to. */
.type {
  position: relative;
  display: grid;
  margin-top: .08em;
  font-family: var(--italic);
  font-style: italic;
  font-weight: 400;
  font-size: 1.14em;
  font-variation-settings: normal;
  line-height: 1.05;
  letter-spacing: -.01em;
  color: var(--accent);
  text-wrap: wrap;
}
.type > span { grid-area: 1 / 1; }
.type__sizer { visibility: hidden; }
.type__sizer .type__cursor { animation: none; }
.type__sr {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.type__cursor {
  display: none;
  width: .055em;
  height: .82em;
  margin-left: .06em;
  vertical-align: -.04em;
  background: currentColor;
  animation: type-blink 1.1s steps(1, end) infinite;
}
.type.is-live .type__cursor { display: inline-block; }
.type.is-typing .type__cursor { animation: none; }

@keyframes type-blink {
  0%, 55% { opacity: 1; }
  55.01%, 100% { opacity: 0; }
}

/* ── Writing index ────────────────────────────────────────────────────── */

.index { margin: 0; padding: 0; list-style: none; }

.index__row {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1fr) auto;
  gap: 2rem;
  align-items: baseline;
  padding: 1.1rem 0;
  border-bottom: 1px solid var(--rule-fine);
  transition: padding-left .45s var(--ease);
}
.index__row:first-child { border-top: 1px solid var(--rule-fine); }
.index__row:hover { padding-left: .6rem; }

.index__meta {
  font-family: var(--mono);
  font-size: var(--meta);
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}
.index__link {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.1rem, 2vw, 1.5rem);
  letter-spacing: -.015em;
  text-decoration: none;
  transition: color .3s ease;
}
.index__row:hover .index__link { color: var(--accent); }
.index__tag {
  font-family: var(--mono);
  font-size: var(--meta-sm);
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.empty {
  margin: 0;
  max-width: 46ch;
  font-size: 1.4rem;
  font-style: italic;
  color: var(--ink-soft);
}

/* ── Entries ──────────────────────────────────────────────────────────── */

.entry {
  position: relative;
  display: grid;
  grid-template-columns: 3rem 8.5rem minmax(0, 1fr);
  gap: clamp(1.25rem, 3vw, 2.75rem);
  padding-block: clamp(2rem, 3.6vw, 3rem);
  border-top: 1px solid var(--rule-fine);
}
.entry:first-of-type { border-top: 0; padding-top: 0; }

/* Hairline that draws itself in on hover. */
.entry::before {
  content: "";
  position: absolute;
  top: -1px; left: 0; right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .6s var(--ease);
}
.entry:hover::before { transform: scaleX(1); }
.entry:first-of-type::before { display: none; }

.entry__index {
  margin: 0;
  font-family: var(--mono);
  font-size: var(--meta);
  color: var(--ink-faint);
  transition: color .35s ease, transform .5s var(--ease);
}
.entry:hover .entry__index { color: var(--accent); transform: translateY(-2px); }

.entry__meta { }
.entry__date, .entry__place {
  margin: 0;
  font-family: var(--mono);
  font-size: var(--meta);
  line-height: 1.8;
  font-variant-numeric: tabular-nums;
}
.entry__date { color: var(--ink-soft); }
.entry__place { color: var(--ink-faint); }
.entry__place:only-child { color: var(--ink-soft); }

.entry__main { max-width: 42rem; }

.entry__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.35rem, 2.5vw, 2rem);
  font-variation-settings: "opsz" 60;
  line-height: 1.1;
  letter-spacing: -.022em;
}

.entry__role {
  margin: .35rem 0 0;
  font-size: 1.32rem;
  font-style: italic;
  color: var(--ink-soft);
}

.entry__note { margin: .9rem 0 0; color: var(--ink-soft); text-wrap: pretty; }

.bullets { margin: 1rem 0 0; padding: 0; list-style: none; }
.bullets li {
  position: relative;
  padding-left: 1.3rem;
  margin-bottom: .45rem;
  text-wrap: pretty;
}
.bullets li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .72em;
  width: .7rem;
  height: 1px;
  background: var(--accent);
  opacity: .7;
}

.tags {
  margin: 1.15rem 0 0;
  font-family: var(--mono);
  font-size: var(--meta-sm);
  letter-spacing: .08em;
  color: var(--ink-faint);
}

.more {
  margin: clamp(2rem, 4vw, 3rem) 0 0;
  font-family: var(--mono);
  font-size: var(--meta);
}

/* ── Travel ───────────────────────────────────────────────────────────── */

.travel__intro {
  margin: 0 0 clamp(1.75rem, 3.5vw, 2.5rem);
  max-width: 44ch;
  color: var(--ink-soft);
}

.map {
  position: relative;
  width: 100%;
}

.map svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
}

.map__country {
  fill: var(--rule-fine);
  stroke: var(--bg);
  stroke-width: .35;
  vector-effect: non-scaling-stroke;
  transition: fill .35s ease;
}

.map__country.is-visited {
  fill: color-mix(in srgb, var(--accent) 55%, transparent);
  cursor: pointer;
}
.map__country.is-visited:hover,
.map__country.is-visited:focus-visible,
.map__country.is-active {
  fill: var(--accent);
  outline: none;
}

.map__readout {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: .6rem 1.25rem;
  margin-top: 1.5rem;
  padding-top: 1rem;
  border-top: 1px solid var(--rule-fine);
  min-height: 3.25rem;
}

.map__name {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.25rem, 2.6vw, 1.9rem);
  letter-spacing: -.02em;
  line-height: 1.1;
}
/* Not uppercased — these read as sentences ("Summers 2015, 2018 & 2026"),
   which tracked capitals would make hard work. */
.map__when {
  margin: 0;
  font-family: var(--mono);
  font-size: var(--meta);
  letter-spacing: .02em;
  color: var(--accent);
}
.map__hint {
  margin: 0;
  font-size: 1.24rem;
  font-style: italic;
  color: var(--ink-faint);
}

/* Invisible pointer targets. The stroke does not scale with the viewBox, so
   a small country keeps a usable halo at any map size. */
.map__hit {
  fill: transparent;
  stroke: transparent;
  stroke-width: 16;
  vector-effect: non-scaling-stroke;
  pointer-events: all;
  cursor: pointer;
}
/* An outline here would trace an invisible shape's bounding box. The country
   filling with the accent colour is the focus indicator instead. Both states
   are covered: SVG elements do not follow the UA's focus-visible heuristics,
   so :focus alone would still paint a box on click. */
.map__hit:focus,
.map__hit:focus-visible,
.map svg:focus { outline: none; }

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 1.75rem 4.5rem;
  margin: 2.5rem 0 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
}
.stats > div { display: flex; flex-direction: column; }
.stats dd {
  margin: 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.4rem, 5.5vw, 3.6rem);
  font-variation-settings: "opsz" 80;
  line-height: .95;
  letter-spacing: -.035em;
}
.stats dt {
  margin-top: .45rem;
  font-family: var(--mono);
  font-size: var(--meta-sm);
  letter-spacing: .13em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.map__count {
  margin: 1rem 0 0;
  font-family: var(--mono);
  font-size: var(--meta-sm);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* ── Contact ──────────────────────────────────────────────────────────── */

.contact__intro {
  margin: 0;
  max-width: 38ch;
  font-size: clamp(1.3rem, 2.1vw, 1.55rem);
  color: var(--ink-soft);
}

.contact__mail {
  display: inline-block;
  margin: clamp(2rem, 4.5vw, 3.5rem) 0 0;
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(1.45rem, 5.4vw, 3.9rem);
  font-variation-settings: "opsz" 90;
  line-height: 1.05;
  letter-spacing: -.035em;
  text-decoration: none;
  max-width: 100%;
  overflow-wrap: anywhere;
}
.contact__mail span {
  background-image: linear-gradient(var(--accent), var(--accent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 2px;
  padding-bottom: .06em;
  transition: background-size .6s var(--ease), color .35s ease;
}
.contact__mail:hover span { background-size: 100% 2px; color: var(--accent); }

.contact__rest {
  margin: clamp(2.5rem, 5vw, 4rem) 0 0;
  max-width: 32rem;
}

/* ── Article page ─────────────────────────────────────────────────────── */

.post {
  max-width: 58rem;
  margin-inline: auto;
  padding: 7rem var(--pad) 0;
}

.post__hero {
  position: relative;
  overflow: hidden;
  border-radius: 4px;
  padding: clamp(3rem, 8vw, 6rem) clamp(1.5rem, 5vw, 4rem);
  text-align: center;
  background:
    radial-gradient(120% 90% at 72% 12%,
      color-mix(in srgb, var(--accent) 72%, white) 0%,
      var(--accent) 55%,
      color-mix(in srgb, var(--accent) 88%, black) 100%);
}

.post__heroInner { max-width: 34ch; margin-inline: auto; }

.post__kicker {
  margin: 0 0 clamp(1.25rem, 3vw, 2rem);
  font-family: var(--mono);
  font-size: var(--meta-sm);
  font-weight: 500;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: color-mix(in srgb, white 78%, transparent);
}

.post__title {
  margin: 0;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(2.2rem, 6.2vw, 4.4rem);
  font-variation-settings: "opsz" 100;
  line-height: 1.04;
  letter-spacing: -.025em;
  color: #fff;
  text-wrap: balance;
}

.post__author {
  margin: clamp(1.5rem, 3.5vw, 2.5rem) 0 0;
  font-weight: 500;
  color: color-mix(in srgb, white 92%, transparent);
}

.post__meta {
  margin: .3rem 0 0;
  font-family: var(--mono);
  font-size: var(--meta-sm);
  color: color-mix(in srgb, white 66%, transparent);
}

/* ── Audio player ─────────────────────────────────────────────────────── */

.player {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem 1.5rem;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  padding: clamp(1rem, 2.2vw, 1.4rem) clamp(1.1rem, 2.5vw, 1.75rem);
  border: 1px solid var(--rule);
  border-radius: 3px;
  background: var(--bg-2);
}

.player__play {
  flex: 0 0 auto;
  position: relative;
  width: 3rem;
  height: 3rem;
  padding: 0;
  border: 1px solid var(--accent);
  border-radius: 50%;
  background: none;
  color: var(--accent);
  cursor: pointer;
  transition: background-color .3s ease, color .3s ease;
}
.player__play:hover { background: var(--accent); color: var(--bg); }
.player__play svg {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 1.25rem;
  height: 1.25rem;
  fill: currentColor;
  transition: opacity .25s ease;
}
.player__play .icon-pause { opacity: 0; }
.player.is-playing .icon-play  { opacity: 0; }
.player.is-playing .icon-pause { opacity: 1; }

.player__main { flex: 1 1 14rem; min-width: 0; }

.player__label {
  margin: 0 0 .5rem;
  font-family: var(--mono);
  font-size: var(--meta-sm);
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

/* Tracks are painted with a gradient that the script moves, so the fill and
   the thumb stay in step without a second element. */
.player__seek,
.player__level {
  -webkit-appearance: none;
  appearance: none;
  display: block;
  width: 100%;
  height: 3px;
  border-radius: 2px;
  background:
    linear-gradient(var(--accent), var(--accent)) no-repeat,
    var(--rule);
  background-size: var(--progress, 0%) 100%;
  cursor: pointer;
}
.player__seek::-webkit-slider-thumb,
.player__level::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 13px;
  height: 13px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
}
.player__seek::-moz-range-thumb,
.player__level::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border: 0;
  border-radius: 50%;
  background: var(--accent);
}

.player__time {
  margin: 0;
  flex: 0 0 auto;
  font-family: var(--mono);
  font-size: var(--meta-sm);
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
}

.player__controls {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 1.1rem;
}

/* Mono digits keep every label the same width, so cycling never nudges
   the slider beside it. */
.player__rate {
  padding: .35rem .6rem;
  border: 1px solid var(--accent);
  border-radius: 2px;
  background: none;
  font-family: var(--mono);
  font-size: var(--meta-sm);
  font-variant-numeric: tabular-nums;
  color: var(--accent);
  cursor: pointer;
  transition: color .25s ease, background-color .25s ease;
}
.player__rate:hover { background: var(--accent); color: var(--bg); }

.player__volume {
  display: flex;
  align-items: center;
  gap: .45rem;
}

.player__mute {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  padding: 0;
  border: 0;
  background: none;
  color: var(--ink-soft);
  cursor: pointer;
  transition: color .25s ease;
}
.player__mute:hover { color: var(--accent); }
.player__mute svg {
  width: 1.35rem;
  height: 1.35rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}
.player__mute .vol-speaker { fill: currentColor; stroke: none; }
.player__mute .vol-cross,
.player.is-quiet .vol-wave--far,
.player.is-muted .vol-wave { display: none; }
.player.is-muted .vol-cross { display: inline; }

.player__level { width: 5.5rem; }
.player__level[hidden] { display: none; }

@media (max-width: 34rem) {
  .player__main { flex-basis: 100%; order: 3; }
  .player__time { order: 2; margin-left: auto; }
  .player__controls { order: 4; width: 100%; justify-content: space-between; }
  .player__level { width: 7rem; }
}

/* Body sits narrower than the hero card — the card is a banner, the prose
   is for reading. */
.post__body {
  max-width: 40rem;
  margin: clamp(3rem, 7vw, 5rem) auto 0;
}

.post__body > * { margin: 0 0 1.35rem; }
.post__body > *:last-child { margin-bottom: 0; }

.post__body p { text-wrap: pretty; }

/* Drop cap on the opening letter. Done with ::first-letter rather than a
   wrapper span so it survives the prose being rewritten. */
.post__body > p:first-of-type::first-letter {
  float: left;
  font-family: var(--display);
  font-weight: 700;
  font-size: 4em;
  font-variation-settings: "opsz" 100;
  line-height: .78;
  padding: .06em .1em 0 0;
  color: var(--ink);
}

.post__lead {
  font-size: clamp(1.35rem, 2.2vw, 1.6rem);
  line-height: 1.45;
}

.post__body h2 {
  margin: clamp(2.75rem, 6vw, 4rem) 0 1.1rem;
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(1.6rem, 3.2vw, 2.2rem);
  font-variation-settings: "opsz" 60;
  line-height: 1.15;
  letter-spacing: -.022em;
}

.post__body blockquote {
  margin: clamp(2.25rem, 5vw, 3.25rem) 0;
  padding-left: clamp(1.25rem, 3vw, 2rem);
  border-left: 2px solid var(--accent);
}
.post__body blockquote p {
  margin: 0;
  font-family: var(--display);
  font-weight: 500;
  font-size: clamp(1.3rem, 2.6vw, 1.75rem);
  font-variation-settings: "opsz" 60;
  line-height: 1.25;
  letter-spacing: -.018em;
}

.post__body ul,
.post__body ol { padding-left: 0; list-style: none; }
.post__body li {
  position: relative;
  padding-left: 1.5rem;
  margin-bottom: .6rem;
}
.post__body ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .72em;
  width: .8rem;
  height: 1px;
  background: var(--accent);
  opacity: .7;
}
.post__body ol { counter-reset: item; }
.post__body ol li::before {
  counter-increment: item;
  content: counter(item) ".";
  position: absolute;
  left: 0;
  font-family: var(--mono);
  font-size: var(--meta-sm);
  color: var(--accent);
}

.post__body hr {
  margin: clamp(2.75rem, 6vw, 4rem) 0;
  border: 0;
  border-top: 1px solid var(--rule);
}

.post__note {
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule-fine);
  font-size: 1.1rem;
  font-style: italic;
  color: var(--ink-faint);
}

.post__foot {
  max-width: 40rem;
  margin: clamp(3.5rem, 8vw, 5.5rem) auto 0;
  padding-top: 1.75rem;
  border-top: 1px solid var(--rule);
  font-family: var(--mono);
  font-size: var(--meta);
}

.post + .colophon { margin-top: clamp(4rem, 9vw, 7rem); }

/* ── Colophon ─────────────────────────────────────────────────────────── */

.colophon {
  padding-block: clamp(3.5rem, 7vw, 5.5rem) clamp(1.75rem, 3.5vw, 2.5rem);
  border-top: 1px solid var(--rule);
}

.colophon__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.25fr) minmax(0, 1.1fr) minmax(0, .9fr) minmax(0, 1.35fr);
  gap: 2.5rem clamp(2rem, 4vw, 3.5rem);
}

.colophon__name {
  margin: 0 0 .9rem;
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(1.7rem, 2.6vw, 2.2rem);
  font-variation-settings: "opsz" 100;
  line-height: 1;
  letter-spacing: -.03em;
  color: var(--ink);
}
.colophon__tag {
  margin: 0;
  max-width: 28ch;
  font-size: 1.12rem;
  line-height: 1.5;
  color: var(--ink-soft);
  text-wrap: pretty;
}

.colophon__head {
  margin: 0 0 1rem;
  font-family: var(--mono);
  font-size: var(--meta-sm);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-faint);
}

.colophon__list {
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 1.12rem;
  line-height: 1.95;
}
.colophon__list--split { columns: 2; column-gap: 1.5rem; }
.colophon__list a {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color .25s ease;
}
.colophon__list a:hover { color: var(--accent); }

.colophon__note {
  margin: 0 0 .8rem;
  font-size: 1.08rem;
  line-height: 1.55;
  font-style: italic;
  color: var(--ink-soft);
  text-wrap: pretty;
}
.colophon__note:last-child { margin-bottom: 0; color: var(--ink-faint); }

.colophon__base {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: .6rem 2rem;
  margin-top: clamp(3rem, 6vw, 4.5rem);
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule-fine);
  font-family: var(--mono);
  font-size: var(--meta-sm);
  color: var(--ink-faint);
}
.colophon__base p { margin: 0; }
.colophon__top {
  color: var(--ink-soft);
  text-decoration: none;
  transition: color .25s ease;
}
.colophon__top:hover { color: var(--accent); }

/* ── Reveal ───────────────────────────────────────────────────────────── */

.js .r { opacity: 0; transform: translateY(16px); }
.js .r.is-in {
  opacity: 1;
  transform: none;
  transition: opacity .85s var(--ease) var(--d, 0ms),
              transform .85s var(--ease) var(--d, 0ms);
}

/* ── Responsive ───────────────────────────────────────────────────────── */

@media (max-width: 62rem) {
  .about { grid-template-columns: minmax(0, 1fr); gap: 2.5rem; }
  .prose { max-width: none; }
  .colophon__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .entry { grid-template-columns: 2.5rem 7rem minmax(0, 1fr); }
}

/* Eight items at the larger metadata size stop fitting well before the
   phone breakpoint, so the menu takes over earlier than the rest of the
   mobile layout does. */
@media (max-width: 82rem) {
  .nav__links { display: none; }
  .menubtn { display: inline-flex; }
}

@media (max-width: 48rem) {
  .hero { padding-top: 5rem; }
  .hero__name { font-size: 21vw; letter-spacing: -.04em; }
  .hero__name .word { display: block; }
  .hero__note { font-size: 1rem; max-width: 30ch; }

  .section__head {
    display: block;
  }
  .section__num { margin-bottom: .75rem; }

  .entry {
    grid-template-columns: minmax(0, 1fr);
    gap: .5rem;
  }
  .entry__index {
    position: absolute;
    top: clamp(2rem, 3.6vw, 3rem);
    right: 0;
  }
  .entry:first-of-type .entry__index { top: 0; }
  .entry__meta { display: flex; gap: 1.1rem; margin-bottom: .4rem; }

  .index__row {
    grid-template-columns: minmax(0, 1fr);
    gap: .3rem;
  }
  .index__row:hover { padding-left: 0; }

}

@media (max-width: 34rem) {
  .colophon__grid { grid-template-columns: minmax(0, 1fr); }
  .colophon__base { flex-direction: column; }
}

@media (max-width: 30rem) {
  .hero__name { font-size: 22vw; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .js .r { opacity: 1; transform: none; }
  .hero__name .word > span,
  .split .word > span { transform: none; }
  .hero__note, .hero__scroll { opacity: 1; transform: none; }
  .type.is-live .type__cursor { display: none; }
}

@media print {
  .nav, .menu, .hero__canvas, .hero__scroll, .skip { display: none; }
  .hero { height: auto; min-height: 0; padding: 2rem 0; }
  body { background: #fff; color: #000; font-size: 10.5pt; }
  .section { break-inside: avoid; }
  .js .r { opacity: 1; transform: none; }
}
