/* ============================================================
   GLODY FIGUEIREDO — personal knowledge landscape
   palette: water / earth / sand / leaf / sun / charcoal / paper
   ============================================================ */

:root {
  --deep:     #123C43;
  --water:    #287A79;
  --sand:     #DED0AC;
  --earth:    #A85335;
  --charcoal: #25251F;
  --leaf:     #53684B;
  --sun:      #E0A43B;
  --paper:    #F1ECD9;
  --paper-2:  #EAE3CB;
  --ink:      #25251F;
  --ink-soft: #4c4a40;

  --f-body:  'Archivo', 'Helvetica Neue', Arial, sans-serif;
  --f-mono:  'IBM Plex Mono', 'SFMono-Regular', Consolas, monospace;
  --f-serif: 'Newsreader', Georgia, serif;
  --f-hand:  'Caveat', 'Segoe Script', cursive;

  --col: min(1040px, calc(100vw - 3rem));
  --wobble: 255px 18px 225px 18px / 18px 225px 18px 255px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--f-body);
  font-size: 16.5px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
/* mineral paper grain */
body::before {
  content: "";
  position: fixed; inset: 0;
  pointer-events: none; z-index: 40;
  opacity: .05;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='140' height='140'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='140' height='140' filter='url(%23n)'/%3E%3C/svg%3E");
}

a { color: var(--deep); text-decoration-color: var(--water); text-underline-offset: 3px; }
a:hover { color: var(--earth); }
::selection { background: var(--sun); color: var(--charcoal); }

.sym { width: 1.1em; height: 1.1em; vertical-align: -0.18em; }
.sym .sk, .sym use { stroke: currentColor; }
#symbol-defs .sk { fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
#symbol-defs .sf { fill: currentColor; stroke: none; }

/* ---------------- typographic voices ---------------- */
.mono-note, .kicker, .tl-tags {
  font-family: var(--f-mono);
  font-size: .72rem;
  letter-spacing: .14em;
  color: var(--ink-soft);
}
.kicker { text-transform: uppercase; margin: 0 0 .8rem; }
.kicker .pt { color: var(--earth); }
.hand {
  font-family: var(--f-hand);
  font-size: 1.35rem;
  line-height: 1.25;
  color: var(--ink-soft);
  transform: rotate(-1.2deg);
  display: inline-block;
}
.voice {
  font-family: var(--f-serif);
  font-style: italic;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  line-height: 1.5;
  color: var(--deep);
  margin: 2.2rem 0 0;
  padding-left: 1.2rem;
  border-left: 3px solid var(--sun);
  max-width: 42ch;
}
.voice.on-deep { color: var(--sand); border-left-color: var(--sun); }

/* constructed letterforms */
.bigword { margin: .2rem 0 1.4rem; }
.bigword svg { display: block; max-width: 100%; overflow: visible; }
.bigword[data-word-size="lg"] svg { height: clamp(64px, 11vw, 120px); }
.bigword[data-word-size="md"] svg { height: clamp(44px, 7vw, 78px); }
.bigword[data-word-size="sm"] svg { height: clamp(34px, 5vw, 56px); }
.lf-stroke {
  fill: none; stroke: var(--charcoal);
  stroke-width: 9; stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 1; stroke-dashoffset: 1;
}
.lf-dot { fill: var(--earth); }
.drawn .lf-stroke { stroke-dashoffset: 0; transition: stroke-dashoffset 1.1s cubic-bezier(.6,.05,.3,1); }
.band-deep .lf-stroke, .on-deep .lf-stroke { stroke: var(--sand); }

/* ---------------- layout ---------------- */
#topbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 30;
  display: flex; justify-content: space-between; align-items: center;
  padding: .7rem 1.2rem;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid color-mix(in srgb, var(--charcoal) 12%, transparent);
}
#topbar .mark {
  font-family: var(--f-mono); font-size: .8rem; letter-spacing: .2em;
  text-decoration: none; color: var(--charcoal);
  display: inline-flex; gap: .5rem; align-items: center;
}
#topbar .mark .logo { width: 26px; height: 26px; display: block; }
.mode-toggle {
  display: inline-flex; border: 1.5px solid var(--charcoal); border-radius: 999px; overflow: hidden;
}
.mode-toggle button {
  font-family: var(--f-mono); font-size: .68rem; letter-spacing: .16em;
  background: none; border: 0; color: var(--charcoal);
  padding: .42rem .9rem; cursor: pointer;
}
.mode-toggle button[aria-pressed="true"] { background: var(--charcoal); color: var(--paper); }
.mode-toggle a, .mode-toggle span {
  font-family: var(--f-mono); font-size: .68rem; letter-spacing: .16em;
  color: var(--charcoal); text-decoration: none; padding: .42rem .9rem;
}
.mode-toggle a:hover { color: var(--earth); }
.mode-toggle .on { background: var(--charcoal); color: var(--paper); }
.mode-toggle a, .mode-toggle span { white-space: nowrap; }
@media (max-width: 560px) {
  #topbar { padding: .6rem .9rem; gap: .6rem; }
  .mode-toggle a, .mode-toggle span { padding: .4rem .55rem; letter-spacing: .06em; }
}
/* the big name sits right below; on a phone the topbar keeps only the mark */
@media (max-width: 520px) { #topbar .mark span { display: none; } }

#atlas { position: relative; z-index: 2; }
.reach, .band {
  width: var(--col);
  margin: 0 auto;
  padding: clamp(4.5rem, 10vh, 8rem) 0;
  position: relative;
}
main { padding-top: 5.5rem; }
.reach .prose, .section-lede { max-width: 58ch; }
.section-lede { font-size: 1.05rem; color: var(--ink-soft); }

/* alternate sides in atlas mode, leaving room for the river */
html[data-mode="atlas"] .reach[data-side="left"],
html[data-mode="atlas"] .band[data-side="left"] { padding-right: clamp(0px, 16vw, 220px); }
html[data-mode="atlas"] .reach[data-side="right"],
html[data-mode="atlas"] .band[data-side="right"] { padding-left: clamp(0px, 16vw, 220px); }

.band-note { max-width: 48ch; color: var(--ink-soft); }
.band-deep {
  width: 100%; max-width: none;
  background: var(--deep); color: var(--sand);
  padding-left: calc((100vw - var(--col)) / 2);
  padding-right: calc((100vw - var(--col)) / 2);
}
.band-deep .kicker { color: var(--sand); opacity: .8; }
.band-deep .kicker .pt { color: var(--sun); }

/* identity block — who this is, answered immediately */
.identity { margin-bottom: 3.2rem; }
.identity-role {
  margin: .4rem 0 0; font-family: var(--f-mono); font-weight: 500;
  font-size: .92rem; letter-spacing: .22em; text-transform: uppercase; color: var(--ink);
}
.identity-role .sep { color: var(--earth); }
.identity-role .identity-loc { color: var(--ink-soft); letter-spacing: .14em; }
.identity-pitch { max-width: 54ch; margin: .9rem 0 0; color: var(--ink-soft); font-size: 1.02rem; }

/* origin line figure */
.origin-line { margin: 2.4rem 0 0; }
.origin-line svg { width: 100%; max-width: 640px; height: auto; }
.ol-path { fill: none; stroke: var(--water); stroke-width: 2.4; stroke-linecap: round;
  stroke-dasharray: 1; stroke-dashoffset: 1; }
.drawn .ol-path { stroke-dashoffset: 0; transition: stroke-dashoffset 2.4s ease-out .2s; }
.ol-dot { fill: var(--earth); }
.ol-label { font-family: var(--f-mono); font-size: 11px; letter-spacing: .18em; fill: var(--ink-soft); }
.ol-note { font-family: var(--f-hand); font-size: 17px; fill: var(--ink-soft); }

.stone-hint { margin-top: 2.5rem; opacity: .85; }

/* ---------------- territories & strata ---------------- */
.territory-head { display: grid; grid-template-columns: auto 1fr; gap: .4rem 1.2rem; align-items: start; }
.territory-num {
  font-family: var(--f-mono); font-size: .78rem; letter-spacing: .14em;
  color: var(--paper); background: var(--charcoal);
  padding: .28rem .55rem; border-radius: 4px; align-self: start; margin-top: .4rem;
}
.territory-title h2 { margin: 0; font-size: clamp(1.5rem, 3vw, 2rem); font-weight: 600; letter-spacing: -.01em; }
.territory-title .years { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .14em; color: var(--ink-soft); }
.territory-title .t-sym { color: var(--earth); width: 1.3em; height: 1.3em; margin-right: .45rem; }
.territory-tagline { max-width: 56ch; color: var(--ink-soft); margin: .8rem 0 0; grid-column: 2; }
.territory-meta { grid-column: 2; }

/* entry paths (Kielis) */
.entry-paths { margin: 1.6rem 0 0; }
.entry-paths .ep-label { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .16em; color: var(--ink-soft); margin-bottom: .5rem; }
.entry-paths .ep-tabs { display: flex; flex-wrap: wrap; gap: .5rem; }
.ep-tabs button {
  font-family: var(--f-mono); font-size: .7rem; letter-spacing: .14em;
  border: 1.5px solid var(--charcoal); background: none; color: var(--charcoal);
  border-radius: 999px; padding: .35rem .85rem; cursor: pointer;
}
.ep-tabs button[aria-selected="true"] { background: var(--water); border-color: var(--water); color: var(--paper); }
.ep-panel { max-width: 58ch; margin-top: 1rem; font-family: var(--f-serif); font-size: 1.1rem; line-height: 1.6; color: var(--deep); }

/* strata = physical depth */
.strata { list-style: none; margin: 2.2rem 0 0; padding: 0;
  border-radius: 10px; overflow: hidden;
  box-shadow: 0 1px 0 color-mix(in srgb, var(--charcoal) 20%, transparent),
              0 14px 34px -22px color-mix(in srgb, var(--charcoal) 45%, transparent); }
.stratum { border-top: 1px dashed color-mix(in srgb, var(--charcoal) 25%, transparent); }
.stratum:first-child { border-top: 0; }
.stratum-toggle {
  width: 100%; display: grid; grid-template-columns: 5.2rem 1fr auto; gap: 1rem; align-items: center;
  text-align: left; background: none; border: 0; cursor: pointer;
  padding: 1rem 1.2rem; color: inherit; font: inherit;
}
.stratum-depth { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .1em; opacity: .75; }
.stratum-label { font-family: var(--f-mono); font-size: .78rem; letter-spacing: .16em; text-transform: uppercase; }
.stratum-hint { font-family: var(--f-hand); font-size: 1.1rem; opacity: 0; transition: opacity .25s; }
.stratum-toggle:hover .stratum-hint, .stratum-toggle:focus-visible .stratum-hint { opacity: .8; }
.stratum-arrow { transition: transform .3s; font-size: .8rem; opacity: .6; }
.stratum.open .stratum-arrow { transform: rotate(90deg); }
.stratum-body { display: none; padding: .2rem 1.2rem 1.8rem calc(5.2rem + 2.2rem); }
.stratum.open .stratum-body { display: block; }
.stratum-body > :first-child { margin-top: 0; }
.stratum-body ul { padding-left: 1.1rem; }
.stratum-body li { margin: .4rem 0; }

/* strata tones — deeper is darker */
.tone-paper { background: var(--paper); }
.tone-sand  { background: var(--sand); }
.tone-water { background: var(--water); color: var(--paper); }
.tone-deep  { background: var(--deep); color: var(--sand); }
.tone-char  { background: var(--charcoal); color: var(--sand); }
.tone-water a, .tone-deep a, .tone-char a { color: var(--sun); }
.tone-water .mono-note, .tone-deep .mono-note, .tone-char .mono-note,
.tone-water .stratum-depth, .tone-deep .stratum-depth, .tone-char .stratum-depth { color: inherit; opacity: .7; }
.tone-deep .hand, .tone-char .hand, .tone-water .hand { color: var(--sand); }

/* code fragments */
.code-frag { margin: 1.6rem 0; }
.code-frag figcaption { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .14em; margin-bottom: .4rem; opacity: .85; }
.code-frag pre {
  margin: 0; padding: 1rem 1.1rem; overflow-x: auto;
  background: color-mix(in srgb, var(--charcoal) 92%, black);
  color: #e9e4d2; border-radius: 8px;
  font-family: var(--f-mono); font-size: .8rem; line-height: 1.55;
  border-left: 3px solid var(--sun);
}
.code-frag .annotation { margin-top: .5rem; }
.tone-char .code-frag pre, .tone-deep .code-frag pre { background: rgba(0,0,0,.35); }

/* struck-through failures */
.strike { position: relative; opacity: .78; }
.strike::after {
  content: ""; position: absolute; left: -2%; right: -2%; top: 52%; height: 3px;
  background: var(--earth); transform: rotate(-1.6deg); border-radius: 2px;
}

/* ---------------- interactive architecture diagram ---------------- */
.arch-diagram { margin: 1.4rem 0 0; }
.arch-diagram svg { width: 100%; height: auto; display: block; }
.arch-node { cursor: pointer; }
.arch-node rect {
  fill: color-mix(in srgb, var(--paper) 10%, transparent);
  stroke: currentColor; stroke-width: 1.4; rx: 7;
}
.arch-node text { fill: currentColor; font-family: var(--f-mono); font-size: 11px; letter-spacing: .08em; }
.arch-node .sub { font-size: 8.5px; opacity: .65; letter-spacing: .06em; }
.arch-node:hover rect, .arch-node:focus-visible rect, .arch-node.active rect {
  fill: color-mix(in srgb, var(--sun) 22%, transparent); stroke: var(--sun); }
.arch-node.active rect { stroke-width: 2.2; }
.arch-edge { fill: none; stroke: currentColor; stroke-width: 1.3; opacity: .55;
  stroke-dasharray: 5 5; animation: edge-flow 1.6s linear infinite; }
@keyframes edge-flow { to { stroke-dashoffset: -10; } }
@media (prefers-reduced-motion: reduce) { .arch-edge { animation: none; } }
.arch-detail {
  margin-top: 1rem; padding: 1rem 1.1rem; border-radius: 8px;
  background: rgba(0,0,0,.28); font-size: .92rem;
}
.arch-detail h4 { margin: 0 0 .5rem; font-family: var(--f-mono); font-size: .78rem; letter-spacing: .16em; color: var(--sun); }
.arch-detail dl { margin: 0; display: grid; gap: .45rem; }
.arch-detail dt { font-family: var(--f-mono); font-size: .66rem; letter-spacing: .14em; opacity: .7; }
.arch-detail dd { margin: 0 0 .3rem; }
.arch-detail .placeholder { opacity: .7; font-family: var(--f-hand); font-size: 1.15rem; }

/* ---------------- field notes ---------------- */
.notes-grid { margin-top: 2.4rem; columns: 2; column-gap: 1.6rem; }
.note-card {
  break-inside: avoid; margin: 0 0 1.6rem; padding: 1.1rem 1.2rem 1.2rem;
  background: #fbf8ec;
  border: 1.6px solid color-mix(in srgb, var(--charcoal) 55%, transparent);
  border-radius: var(--wobble);
  position: relative;
}
.note-card:nth-child(odd)  { transform: rotate(-.7deg); }
.note-card:nth-child(even) { transform: rotate(.6deg); }
.note-card:nth-child(3n)   { border-radius: 18px 225px 18px 255px / 225px 18px 255px 18px; }
.note-card .note-meta { display: flex; justify-content: space-between; gap: 1rem; margin-bottom: .5rem; }
.note-card .note-meta .sym { color: var(--earth); }
.note-card h3 { margin: 0 0 .4rem; font-family: var(--f-serif); font-style: italic; font-weight: 500; font-size: 1.15rem; }
.note-card p { margin: .3rem 0; font-size: .92rem; color: var(--ink-soft); }
.note-card .note-sketch { margin: .6rem 0 .2rem; }
.note-card .note-sketch svg { width: 100%; height: auto; }
.note-card.abandoned { background: var(--paper-2); }
.note-card .stamp {
  position: absolute; top: .6rem; right: .8rem;
  font-family: var(--f-hand); font-size: 1rem; color: var(--earth);
  transform: rotate(4deg); border: 1.5px solid var(--earth); border-radius: 6px; padding: 0 .4rem;
}

/* sketch strokes inside notes */
.sk-line { fill: none; stroke: var(--ink-soft); stroke-width: 1.6; stroke-linecap: round; }
.sk-earth { stroke: var(--earth); }
.sk-water { stroke: var(--water); }
.sk-label { font-family: var(--f-hand); font-size: 14px; fill: var(--ink-soft); }
.sk-mono  { font-family: var(--f-mono); font-size: 9px; letter-spacing: .08em; fill: var(--ink-soft); }

/* ---------------- blog ---------------- */
.posts-list { margin-top: 2.2rem; max-width: 62ch; }
.post {
  border-top: 1.6px solid color-mix(in srgb, var(--charcoal) 30%, transparent);
  padding: 1.3rem 0 1.5rem;
}
.post:last-child { border-bottom: 1.6px solid color-mix(in srgb, var(--charcoal) 30%, transparent); }
.post-head { display: flex; flex-wrap: wrap; gap: .3rem 1rem; align-items: baseline; }
.post-head h3 { margin: 0; font-family: var(--f-serif); font-weight: 500; font-size: 1.35rem; cursor: pointer; }
.post-head h3:hover { color: var(--earth); }
.post-date { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .14em; color: var(--ink-soft); }
.post-tags { font-family: var(--f-mono); font-size: .66rem; letter-spacing: .12em; color: var(--water); }
.post-excerpt { color: var(--ink-soft); margin: .5rem 0 0; }
.post-body { display: none; margin-top: 1rem; }
.post.open .post-body { display: block; }
.post-body p { max-width: 60ch; }
.post-toggle {
  background: none; border: 0; cursor: pointer; padding: 0; margin-top: .6rem;
  font-family: var(--f-mono); font-size: .7rem; letter-spacing: .14em; color: var(--deep);
  text-decoration: underline; text-underline-offset: 3px;
}

/* ---------------- archive: everything, by year, filterable ---------------- */
.archive { margin-top: 3.4rem; max-width: 62ch; }
#archive-search {
  width: 100%; margin: .6rem 0 1.2rem; padding: .55rem .9rem;
  font-family: var(--f-mono); font-size: .8rem; letter-spacing: .06em;
  color: var(--ink); background: #fbf8ec;
  border: 1.5px solid color-mix(in srgb, var(--charcoal) 45%, transparent); border-radius: 8px;
}
#archive-search:focus { outline: none; border-color: var(--water); }
.archive-year {
  font-family: var(--f-mono); font-size: .72rem; letter-spacing: .2em; color: var(--earth);
  margin: 1.2rem 0 .3rem; border-bottom: 1px dashed color-mix(in srgb, var(--charcoal) 25%, transparent);
  padding-bottom: .25rem;
}
.archive-row {
  display: grid; grid-template-columns: 6.4rem 3.2rem 1fr; gap: .8rem; align-items: baseline;
  padding: .34rem 0; text-decoration: none; color: var(--ink);
}
.archive-row:hover .ar-title { color: var(--earth); }
.ar-date { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .08em; color: var(--ink-soft); }
.ar-kind { font-family: var(--f-mono); font-size: .6rem; letter-spacing: .12em; color: var(--water); }
.ar-title { font-family: var(--f-serif); font-size: 1.02rem; }
.posts-more { margin-top: 1rem; }

/* ---------------- river mini-map ---------------- */
#river-map {
  position: fixed; right: .6rem; top: 50%; transform: translateY(-50%); z-index: 26;
  display: block;
}
#river-map .rm-path { fill: none; stroke: color-mix(in srgb, var(--water) 55%, transparent); stroke-width: 1.6; }
#river-map .rm-dot { fill: var(--sand); stroke: var(--water); stroke-width: 1.4; cursor: pointer; }
#river-map .rm-dot:hover { fill: var(--sun); }
#river-map .rm-dot.here { fill: var(--earth); stroke: var(--earth); }
#river-map .rm-label {
  position: absolute; right: 34px; transform: translateY(-50%);
  font-family: var(--f-mono); font-size: .64rem; letter-spacing: .12em; white-space: nowrap;
  color: var(--paper); background: var(--charcoal); padding: .18rem .5rem; border-radius: 4px;
  opacity: 0; transition: opacity .15s; pointer-events: none;
}
#river-map .rm-label.show { opacity: 1; }
@media (max-width: 900px) { #river-map { display: none; } }

/* ---------------- loop figure / modo ---------------- */
.loop-figure { margin: 1.5rem 0 0; }
.loop-figure svg { width: 100%; max-width: 720px; height: auto; }
.loop-path { fill: none; stroke: var(--water); stroke-width: 2.2; stroke-dasharray: 6 7;
  animation: edge-flow 2.4s linear infinite; }
.loop-stops circle { fill: var(--sun); }
.loop-stops text { font-family: var(--f-hand); font-size: 19px; fill: var(--sand); }

/* ---------------- timeline / cv ---------------- */
.timeline { list-style: none; margin: 2rem 0 0; padding: 0; position: relative; max-width: 640px; }
.timeline::before {
  content: ""; position: absolute; left: .35rem; top: .4rem; bottom: .4rem; width: 2px;
  background: repeating-linear-gradient(var(--water) 0 7px, transparent 7px 13px);
}
.timeline li { position: relative; padding: 0 0 2rem 2.2rem; }
.timeline li::before {
  content: ""; position: absolute; left: 0; top: .35rem; width: .8rem; height: .8rem;
  border-radius: 50%; background: var(--earth); border: 2.5px solid var(--paper);
}
.tl-when { font-family: var(--f-mono); font-size: .72rem; letter-spacing: .16em; color: var(--ink-soft); }
.tl-what h3 { margin: .25rem 0 .4rem; font-size: 1.12rem; }
.tl-what p { margin: .3rem 0; max-width: 56ch; color: var(--ink-soft); }
.currents { margin-top: 2.4rem; }
.currents dl { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 1rem; margin: .8rem 0 0; }
.currents dt { font-family: var(--f-mono); font-size: .7rem; letter-spacing: .16em; color: var(--earth); }
.currents dd { margin: .3rem 0 0; font-size: .92rem; color: var(--ink-soft); }
.ghost-btn {
  margin-top: 2rem; background: none; cursor: pointer;
  border: 1.5px solid var(--charcoal); border-radius: 999px; color: var(--charcoal);
  font-family: var(--f-mono); font-size: .72rem; letter-spacing: .14em; padding: .5rem 1.1rem;
}
.ghost-btn:hover { background: var(--charcoal); color: var(--paper); }

/* ---------------- contact ---------------- */
.contact-row { display: flex; flex-wrap: wrap; gap: .8rem; margin-top: 1.6rem; }
.contact-chip {
  display: inline-flex; align-items: center; gap: .55rem;
  border: 1.6px solid var(--charcoal); border-radius: 999px;
  padding: .55rem 1.1rem; font-family: var(--f-mono); font-size: .78rem; letter-spacing: .06em;
  text-decoration: none; color: var(--charcoal); background: #fbf8ec;
}
.contact-chip:hover { background: var(--deep); color: var(--paper); }
.contact-chip .dim { opacity: .55; }
.open-to { margin-top: 1.4rem; color: var(--ink-soft); max-width: 52ch; }
.closing { margin-top: 2rem; font-size: 1.5rem; }

#colophon {
  position: relative; z-index: 2;
  width: var(--col); margin: 0 auto; padding: 2rem 0 3rem;
  border-top: 1px solid color-mix(in srgb, var(--charcoal) 18%, transparent);
}
#symbol-legend { display: flex; flex-wrap: wrap; gap: .9rem 1.4rem; margin-top: 1rem; }
#symbol-legend span {
  display: inline-flex; gap: .4rem; align-items: center;
  font-family: var(--f-mono); font-size: .62rem; letter-spacing: .12em; color: var(--ink-soft);
}
#symbol-legend .sym { color: var(--earth); }

/* ---------------- river canvas & stones ---------------- */
#river { position: fixed; inset: 0; z-index: 1; pointer-events: none; }
#stone-layer { position: absolute; inset: 0; z-index: 3; pointer-events: none; }
.stone-label {
  position: absolute; font-family: var(--f-mono); font-size: .68rem; letter-spacing: .12em;
  color: var(--deep); background: color-mix(in srgb, var(--paper) 80%, transparent);
  padding: .1rem .4rem; border-radius: 4px; white-space: nowrap;
  animation: stone-drift 2.8s ease-out forwards;
}
@keyframes stone-drift {
  0% { opacity: 0; transform: translate(0,0) scale(.85); }
  18% { opacity: 1; }
  100% { opacity: 0; transform: translate(var(--dx), var(--dy)) scale(1); }
}

/* ---------------- intro ---------------- */
#intro {
  position: fixed; inset: 0; z-index: 100;
  background: var(--paper);
  display: flex; align-items: center; justify-content: center;
  transition: opacity .9s ease, visibility .9s;
}
#intro.done { opacity: 0; visibility: hidden; }
#intro-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
#intro-stage { position: relative; text-align: center; padding: 0 1.5rem; }
#intro-name svg { height: clamp(64px, 12vw, 130px); max-width: 100%; overflow: visible; }
#intro-name .line2 { margin-top: .4rem; }
#intro-sub { font-family: var(--f-mono); font-size: .74rem; letter-spacing: .3em; color: var(--ink-soft); margin: 1.2rem 0 0; }
#intro-sub .sep { color: var(--earth); }
#intro-enter {
  margin-top: 2rem; background: none; border: 1.5px solid var(--charcoal); border-radius: 999px;
  color: var(--charcoal); font-family: var(--f-mono); font-size: .74rem; letter-spacing: .16em;
  padding: .6rem 1.4rem; cursor: pointer;
}
#intro-enter:hover { background: var(--deep); border-color: var(--deep); color: var(--paper); }
#intro-skip {
  position: absolute; bottom: 1.4rem; right: 1.6rem;
  background: none; border: 0; cursor: pointer;
  font-family: var(--f-mono); font-size: .68rem; letter-spacing: .14em; color: var(--ink-soft);
  text-decoration: underline; text-underline-offset: 3px;
}
.pre { opacity: 0; transform: translateY(8px); transition: opacity 1s ease, transform 1s ease; }
.pre.show { opacity: 1; transform: none; }

/* ---------------- responsive ---------------- */
@media (max-width: 900px) {
  html[data-mode="atlas"] .reach[data-side], html[data-mode="atlas"] .band[data-side] {
    padding-left: 0; padding-right: 0;
  }
  .notes-grid { columns: 1; }
  .stratum-toggle { grid-template-columns: 3.6rem 1fr auto; padding: .9rem .9rem; }
  .stratum-body { padding-left: .9rem; padding-right: .9rem; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .lf-stroke, .ol-path { stroke-dashoffset: 0 !important; transition: none !important; }
  .loop-path { animation: none; }
}

/* ---------------- print = clean CV ---------------- */
@media print {
  #river, #stone-layer, #intro, #topbar, #river-map, .stone-hint,
  .archive, .bigword, .origin-line, .loop-figure, #symbol-legend, .ghost-btn, body::before { display: none !important; }
  body { background: #fff; color: #000; font-size: 11pt; }
  .reach, .band { width: auto; padding: 1rem 0; margin: 0; }
  .band-deep { background: none; color: #000; padding: 1rem 0; }
  .voice.on-deep { color: #000; }
  .stratum-body { display: block !important; padding-left: 1rem; }
  .stratum-toggle { padding: .4rem 0; }
  .tone-water, .tone-deep, .tone-char { background: none; color: #000; }
  .code-frag pre { background: #f3f3f3; color: #000; border: 1px solid #ccc; }
  a { color: #000; }
}

.noscript-note { max-width: 640px; margin: 6rem auto; font-family: var(--f-mono); font-size: .85rem; padding: 0 1.5rem; }

/* ---------------- photos found along the river ----------------
   Each .ph[data-src] stays a dashed placeholder until its file exists in images/,
   then main.js fills it. Photos are toned to the river's palette; true colour on hover. */
.ph {
  position: relative; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: .2rem;
  margin: 1rem 0; border: 2px dashed var(--water); border-radius: var(--wobble);
  color: var(--water); text-align: center; overflow: hidden;
  background: repeating-linear-gradient(135deg, #f6f1e2 0 12px, #efe8d4 12px 24px);
  background-size: cover; background-position: center;
}
.ph span  { font-family: var(--f-mono); font-size: .68rem; letter-spacing: .14em; font-weight: 600; }
.ph small { font-family: var(--f-mono); font-size: .64rem; color: var(--ink-soft); }
.ph.filled {
  border: 1.6px solid color-mix(in srgb, var(--charcoal) 45%, transparent);
  filter: sepia(.35) saturate(.75) contrast(.95); transition: filter .4s ease, transform .4s ease;
}
.ph.filled:hover { filter: none; transform: rotate(0deg) scale(1.01); }
.ph.filled span, .ph.filled small { display: none; }
.river-photo { aspect-ratio: 16 / 10; max-width: 520px; transform: rotate(-.8deg); }
.ph-cap { font-family: var(--f-hand); font-size: 1.15rem; color: var(--ink-soft); margin: -.4rem 0 1rem; }
.tone-deep .ph-cap, .tone-char .ph-cap, .tone-water .ph-cap { color: var(--sand); opacity: .85; }
.postcards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; max-width: 640px; margin-top: 1.4rem; }
.postcards figure { margin: 0; }
.postcards .ph { aspect-ratio: 4 / 3; margin: 0; }
.postcards figure:nth-child(1) .ph { transform: rotate(-1.4deg); }
.postcards figure:nth-child(2) .ph { transform: rotate(.9deg); }
.postcards figure:nth-child(3) .ph { transform: rotate(-.5deg); }
.postcards figcaption { font-family: var(--f-hand); font-size: 1.05rem; color: var(--ink-soft); text-align: center; margin-top: .3rem; }
.win-photos { display: grid; grid-template-columns: repeat(3, 1fr); gap: .9rem; margin: .4rem 0 1.1rem; }
.win-photos .ph { aspect-ratio: 4 / 3; margin: 0; }
.note-card .note-photo { aspect-ratio: 4 / 3; margin: .6rem 0 .2rem; }
@media (max-width: 640px) { .postcards, .win-photos { grid-template-columns: 1fr 1fr; } }
@media print { .ph:not(.filled) { display: none !important; } }

/* ---------------- images inside blog posts ---------------- */
.post-figure { margin: 1.4rem 0; }
.post-figure img {
  display: block; width: 100%; max-width: 680px; height: auto;
  border-radius: 10px; border: 1.6px solid color-mix(in srgb, var(--charcoal) 35%, transparent);
  filter: sepia(.2) saturate(.85); transition: filter .4s ease;
}
.post-figure img:hover { filter: none; }
.post-figure figcaption { font-family: var(--f-hand); font-size: 1.1rem; color: var(--ink-soft); margin-top: .35rem; }

/* latest-writing cards link out to blog/<slug>/ */
.post-head h3 a { color: inherit; text-decoration: none; }
.post-head h3 a:hover { color: var(--earth); }
a.post-toggle, a.ghost-btn { display: inline-block; text-decoration: none; }

/* on the public site, empty photo spaces (and their captions) stay invisible until the file exists */
html:not(.show-placeholders) .ph:not(.filled),
html:not(.show-placeholders) .ph:not(.filled) + .ph-cap,
html:not(.show-placeholders) .postcards figure:has(.ph:not(.filled)),
html:not(.show-placeholders) .win-photos:not(:has(.ph.filled)) { display: none; }

/* photo credit, shown on the photo once it is filled */
.ph.filled[data-credit]::after {
  content: attr(data-credit); position: absolute; right: .4rem; bottom: .35rem;
  font-family: var(--f-mono); font-size: .6rem; letter-spacing: .06em; color: #fff;
  background: rgba(18, 60, 67, .7); padding: .1rem .4rem; border-radius: 4px;
}
