/* ============================================================
   miris.xyz — the drowned manual
   palette: ocean-deep · type: Mulish + Asap + DM Mono + Caveat
   ============================================================ */

@font-face { font-family: "_fallback"; src: local("Helvetica"); }

:root {
  /* --- palette --- */
  --ink:        #0E2A3B;
  --surface:    #F5FBFC;
  --code-pool:  #EAF6F8;
  --cyan-92:    #5FD7E6;
  --cyan-glass: #9BE7EC;
  --shell-pink: #FFB5D2;
  --coral-ink:  #A0226A;
  --reef-gold:  #F5C36B;
  --abyss:      #08182A;
  --kelp:       #3F7C68;
  --bone-foam:  #FFF8EE;

  /* --- live environmental state (driven by JS) --- */
  --depth: 0;
  --page-bg:   #F5FBFC;
  --page-fg:   #0E2A3B;
  --raft-tilt-a: 1.6deg;   /* cols 1-4 */
  --raft-tilt-c: -2.1deg;  /* cols 9-12 */

  --type-display: "Mulish", "Helvetica", system-ui, sans-serif;
  --type-body:    "Asap", "Helvetica", system-ui, sans-serif;
  --type-mono:    "DM Mono", "JetBrains Mono", ui-monospace, monospace;
  --type-hand:    "Caveat", "lora", cursive;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: var(--type-body);
  font-size: 16.5px;
  line-height: 1.62;
  color: var(--page-fg);
  background: var(--page-bg);
  overflow-x: hidden;
  transition: background 1.1s linear, color 1.1s linear;
}

/* ---------- background flowing curves ---------- */
.seafield {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  overflow: hidden;
}
.seafield .sine {
  position: absolute;
  left: 0;
  width: 320vw;
  height: 60vh;
  fill: none;
  stroke: var(--cyan-glass);
  stroke-width: 2;
  opacity: 0.08;
}
.sine-a { top: 12vh; animation: drift-a 40s linear infinite; }
.sine-b { top: 42vh; width: 480vw; animation: drift-b 80s linear infinite; }
.sine-c { top: 70vh; width: 800vw; animation: drift-c 140s linear infinite; }

@keyframes drift-a { from { transform: translateX(0); }    to { transform: translateX(-33.33%); } }
@keyframes drift-b { from { transform: translateX(0); }    to { transform: translateX(-33.33%); } }
@keyframes drift-c { from { transform: translateX(0); }    to { transform: translateX(-33.33%); } }

/* ---------- floating reef decoration ---------- */
.reef-drift {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  overflow: hidden;
}
.reef-drift svg {
  position: absolute;
  fill: none;
  stroke-width: 1.4;
  filter: drop-shadow(0 8px 24px rgba(14,42,59,0.06));
}
.reef-drift .drift-fish, .reef-drift .drift-jelly, .reef-drift .drift-seahorse, .reef-drift .drift-shell { stroke: var(--ink); opacity: 0.32; }
.reef-drift .drift-kelp { stroke: var(--kelp); opacity: 0.40; }

.d1 { width: 140px; top: 18vh; left: 6vw; animation: bob 13s ease-in-out infinite; }
.d2 { width: 90px;  top: 64vh; left: 84vw; animation: bob 17s ease-in-out infinite reverse; }
.d3 { width: 170px; top: 130vh; left: 70vw; animation: bob 19s ease-in-out infinite; }
.j1 { width: 86px;  top: 88vh; left: 12vw; animation: bob 15s ease-in-out infinite; }
.k1 { width: 70px;  top: 30vh; left: 92vw; animation: sway 21s ease-in-out infinite; transform-origin: bottom center; }
.k2 { width: 80px;  top: 50vh; left: 2vw;  animation: sway 24s ease-in-out infinite reverse; transform-origin: bottom center; }
.s1 { width: 90px;  top: 110vh; left: 90vw; animation: bob 16s ease-in-out infinite reverse; }
.h1 { width: 80px;  top: 145vh; left: 6vw;  animation: bob 18s ease-in-out infinite; }

@keyframes bob {
  0%,100% { transform: translateY(0) rotate(0deg); }
  50%     { transform: translateY(-24px) rotate(2.5deg); }
}
@keyframes sway {
  0%,100% { transform: rotate(-3deg); }
  50%     { transform: rotate(4deg); }
}

/* ---------- depth rail (right edge) ---------- */
.depth-rail {
  position: fixed;
  top: 50%;
  right: 22px;
  transform: translateY(-50%);
  z-index: 40;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.depth-rail-track {
  position: absolute;
  top: 14px; bottom: 14px;
  width: 1.4px;
  background: var(--cyan-glass);
  opacity: 0.7;
}
.depth-rail-marker {
  position: absolute;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--cyan-92);
  border: 1.4px solid var(--surface);
  top: 0;
  transition: top 0.5s cubic-bezier(0.32,0.72,0.32,1);
  box-shadow: 0 0 0 3px rgba(95,215,230,0.25);
}
.depth-rail-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 9px;
  font-family: var(--type-mono);
  font-size: 10px;
  color: var(--ink);
  opacity: 0.55;
}
.depth-rail-list li {
  cursor: pointer;
  width: 14px;
  text-align: center;
  transition: color 0.3s, opacity 0.3s;
}
.depth-rail-list li:hover { color: var(--coral-ink); opacity: 1; }
.depth-rail-list li.active { color: var(--cyan-92); opacity: 1; font-weight: 700; }

body[data-depth="5"] .depth-rail-marker,
body[data-depth="6"] .depth-rail-marker { border-color: var(--abyss); }
body[data-depth="5"] .depth-rail-list,
body[data-depth="6"] .depth-rail-list { color: var(--code-pool); }

/* ---------- strata (full-viewport rooms) ---------- */
.stratum {
  position: relative;
  z-index: 2;
  min-height: 100vh;
  padding: 8vh clamp(1.2rem, 5vw, 6rem) 10vh;
  display: flex;
  flex-direction: column;
}

.stratum-head {
  display: flex;
  align-items: center;
  gap: 1rem;
  margin-bottom: 2.4rem;
  flex: 0 0 auto;
}
.stratum-head h2 {
  font-family: var(--type-display);
  font-weight: 500;
  font-size: clamp(2.0rem, 4.6vw, 3.8rem);
  letter-spacing: -0.005em;
  line-height: 1.08;
  color: var(--page-fg);
}
.stratum-body { flex: 1 1 auto; }

.lede {
  font-family: var(--type-body);
  font-size: clamp(1.05rem, 1.6vw, 1.3rem);
  line-height: 1.55;
  max-width: 46rem;
  margin-bottom: 1.6rem;
}
p { margin-bottom: 1rem; max-width: 42rem; }
.stratum-body p code, .lede code, .creature-card code, .step-text code, .callout p code, .pebble-txt code, .buoy-unit code, .news-form label code {
  font-family: var(--type-mono);
  font-size: 0.86em;
  background: var(--code-pool);
  color: var(--coral-ink);
  padding: 0.06em 0.34em;
  border-radius: 2px;
}

/* ---------- morph glyph ---------- */
.morph-glyph {
  display: inline-flex;
  width: clamp(34px, 4vw, 52px);
  height: clamp(34px, 4vw, 52px);
  flex: 0 0 auto;
}
.morph-glyph svg { width: 100%; height: 100%; fill: none; stroke: var(--cyan-92); stroke-width: 1.6; }
.morph-glyph .mg-geo { opacity: 1; transition: opacity 1.4s ease; }
.morph-glyph .mg-sea { opacity: 0; transition: opacity 1.4s ease; }
.morph-glyph.morphed .mg-geo { opacity: 0; }
.morph-glyph.morphed .mg-sea { opacity: 1; stroke: var(--coral-ink); }

/* ---------- broken-grid raft layout ---------- */
.raft-grid {
  display: grid;
  grid-template-columns: minmax(0,4fr) minmax(0,5fr) minmax(0,3fr);
  gap: clamp(1rem, 3vw, 3.4rem);
  align-items: start;
}
.raft { position: relative; }
.raft-left  { transform: rotate(var(--raft-tilt-a)); transform-origin: top right; }
.raft-right { transform: rotate(var(--raft-tilt-c)); transform-origin: top left; }
.raft-spine { transform: rotate(0deg) !important; } /* sacred upright spine */

.raft-left .lede { font-size: 1rem; }

/* margin notes (handwritten) */
.margin-note {
  font-family: var(--type-hand);
  font-weight: 500;
  font-size: 1.18rem;
  line-height: 1.4;
  color: var(--coral-ink);
  margin: 1.2rem 0;
  max-width: 18rem;
}
.mn-rot-a { transform: rotate(-2.2deg); }
.mn-rot-b { transform: rotate(1.8deg); }
.mn-rot-c { transform: rotate(-1.2deg); }
.margin-note code { font-family: var(--type-mono); background: var(--bone-foam); color: var(--coral-ink); }

.margin-glyph {
  width: clamp(40px, 5vw, 70px);
  height: auto;
  fill: none;
  stroke: var(--kelp);
  stroke-width: 1.4;
  opacity: 0.7;
  margin: 1.6rem 0;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(14,42,59,0.06));
}

/* ---------- surface (/0) ---------- */
.stratum-surface {
  align-items: center;
  justify-content: center;
  text-align: center;
}
.surface-inner { position: relative; }
.wordmark {
  font-family: var(--type-display);
  font-weight: 700;
  font-size: clamp(2.6rem, 9vw, 8rem);
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1;
  display: inline-flex;
  align-items: baseline;
}
.wm-fixed { display: inline-block; }
.wm-thin { font-weight: 400; }
.wm-dot { color: var(--cyan-92); }
.axis {
  display: inline-block;
  color: var(--cyan-92);
}
.axis-x { animation: drift-axis-x 14s ease-in-out infinite; }
.axis-y { color: var(--shell-pink); animation: drift-axis-y 14s ease-in-out infinite; }
.axis-z { color: var(--coral-ink);  animation: drift-axis-z 14s ease-in-out infinite; }
@keyframes drift-axis-x { 0%,100%{transform:translate(0,0) rotate(0)} 25%{transform:translate(-6px,-8px) rotate(-6deg)} 60%{transform:translate(4px,6px) rotate(4deg)} }
@keyframes drift-axis-y { 0%,100%{transform:translate(0,0) rotate(0)} 30%{transform:translate(5px,-10px) rotate(7deg)} 70%{transform:translate(-5px,5px) rotate(-5deg)} }
@keyframes drift-axis-z { 0%,100%{transform:translate(0,0) rotate(0)} 20%{transform:translate(7px,5px) rotate(5deg)} 65%{transform:translate(-7px,-7px) rotate(-7deg)} }

.surface-tag {
  font-family: var(--type-display);
  font-weight: 400;
  font-size: clamp(1.05rem, 2.2vw, 1.6rem);
  color: var(--ink);
  margin-top: 1.6rem;
  letter-spacing: 0.01em;
  max-width: none;
}
.surface-scrolltip {
  margin-top: 4rem;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  font-family: var(--type-mono);
  font-size: 0.78rem;
  letter-spacing: 0.18em;
  text-transform: lowercase;
  color: var(--kelp);
  animation: bob 4s ease-in-out infinite;
}
.kick-arrow { width: 22px; height: 36px; fill: none; stroke: var(--cyan-92); stroke-width: 1.6; }

/* ---------- depth chart (/1) ---------- */
.chart-body { display: flex; flex-direction: column; align-items: center; }
.depth-chart-wrap { width: 100%; max-width: 880px; margin: 1.4rem auto 0; }
.depth-chart {
  width: 100%;
  height: auto;
  display: block;
}
.depth-chart .reef-wall { fill: var(--cyan-glass); opacity: 0.16; stroke: var(--kelp); stroke-width: 1.4; }
.depth-chart .reef-wall-2 { fill: var(--cyan-92); opacity: 0.10; stroke: none; }
.depth-chart .thermocline { fill: none; stroke: var(--cyan-92); stroke-width: 1.2; stroke-dasharray: 5 6; opacity: 0.5; }
.depth-chart .depth-ticks line { stroke: var(--ink); stroke-width: 1; opacity: 0.4; }
.depth-chart .depth-ticks text { font-family: var(--type-mono); font-size: 11px; fill: var(--ink); opacity: 0.55; }
.depth-chart .chart-node { cursor: pointer; }
.depth-chart .chart-node circle { fill: var(--surface); stroke: var(--coral-ink); stroke-width: 1.6; transition: fill 0.3s, r 0.3s; }
.depth-chart .chart-node text { font-family: var(--type-display); font-weight: 500; font-size: 15px; fill: var(--ink); transition: fill 0.3s; }
.depth-chart .chart-node .guide { stroke: var(--coral-ink); stroke-width: 1; stroke-dasharray: 3 4; opacity: 0; transition: opacity 0.3s; }
.depth-chart .chart-node:hover circle { fill: var(--shell-pink); }
.depth-chart .chart-node:hover text { fill: var(--coral-ink); }
.depth-chart .chart-node:hover .guide { opacity: 0.8; }
.chart-caption {
  font-family: var(--type-hand);
  font-size: 1.15rem;
  color: var(--coral-ink);
  text-align: center;
  margin-top: 0.8rem;
  max-width: none;
}

/* ---------- creature cards (/2) ---------- */
.creature-card {
  margin-bottom: 2.2rem;
  padding-bottom: 1.4rem;
  border-bottom: 1.4px dashed var(--cyan-glass);
}
.creature-card:last-child { border-bottom: none; }
.creature-fish {
  width: 100%;
  max-width: 360px;
  height: auto;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.4;
  filter: drop-shadow(0 8px 24px rgba(14,42,59,0.06));
  display: block;
  margin-bottom: 0.6rem;
}
.dorsal-name {
  font-family: var(--type-display);
  font-weight: 700;
  font-size: 22px;
  fill: var(--coral-ink);
  letter-spacing: 0.04em;
}

/* ---------- step blocks ---------- */
.step {
  display: grid;
  grid-template-columns: 56px 1fr;
  gap: 1.2rem;
  margin: 2rem 0;
  align-items: start;
}
.step-num {
  position: relative;
  width: 56px; height: 56px;
  display: grid;
  place-items: center;
}
.step-num .wobble-circle {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  fill: none;
  stroke: var(--cyan-92);
  stroke-width: 1.6;
}
.step-num b {
  font-family: var(--type-display);
  font-weight: 700;
  font-size: 1.5rem;
  color: var(--ink);
  position: relative;
  z-index: 1;
}
.step-text { min-width: 0; }
.step-text p { max-width: 40rem; }

/* ---------- code blocks ---------- */
.codeblock {
  position: relative;
  background: var(--code-pool);
  border: 1.4px solid var(--cyan-glass);
  border-radius: 4px;
  padding: 24px;
  padding-top: 30px;
  margin: 1rem 0 1.4rem;
  overflow-x: auto;
  font-family: var(--type-mono);
  font-size: 14px;
  line-height: 1.55;
  color: var(--ink);
}
.codeblock code { font-family: var(--type-mono); display: block; white-space: pre; }
.codeblock .compass-rose {
  position: absolute;
  top: 7px; left: 9px;
  width: 14px; height: 14px;
}
.codeblock .compass-rose svg { width: 14px; height: 14px; fill: none; stroke: var(--kelp); stroke-width: 1.1; opacity: 0.8; }
.codeblock .copy-btn {
  position: absolute;
  top: 6px; right: 8px;
  width: 22px; height: 22px;
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 2px;
  opacity: 0.55;
  transition: opacity 0.25s, transform 0.25s;
}
.codeblock .copy-btn svg { width: 100%; height: 100%; fill: none; stroke: var(--coral-ink); stroke-width: 1.4; }
.codeblock .copy-btn:hover { opacity: 1; transform: translateY(-1px); }
.codeblock .copy-btn.copied svg { stroke: var(--kelp); }
/* bubble-string on hover */
.codeblock::after {
  content: "";
  position: absolute;
  right: 10px;
  bottom: 8px;
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--cyan-92);
  opacity: 0;
}
.codeblock:hover::after { animation: bubble-rise 1.2s ease-out infinite; }
@keyframes bubble-rise {
  0%   { opacity: 0; transform: translateY(0) scale(0.6); }
  20%  { opacity: 0.7; }
  100% { opacity: 0; transform: translateY(-90px) scale(1); }
}

/* syntax highlighting — only four colors */
.codeblock .kw  { color: var(--ink); font-weight: 500; }
.codeblock .str { color: var(--kelp); }
.codeblock .cmt { color: var(--coral-ink); font-style: italic; }
.codeblock .num { color: var(--cyan-92); }

/* ---------- callouts ---------- */
.callout {
  display: flex;
  gap: 1rem;
  align-items: flex-start;
  margin: 1.6rem 0;
  padding: 1.1rem 1.3rem;
  border-radius: 4px;
}
.callout-warn {
  background: var(--bone-foam);
  border-left: 4px solid var(--reef-gold);
}
.callout p { margin: 0; max-width: 38rem; }
.callout-glyph { width: 30px; height: 30px; flex: 0 0 auto; fill: none; stroke: var(--reef-gold); stroke-width: 1.6; margin-top: 2px; }

/* ---------- tide pool diagram (/4) ---------- */
.tidepool-diagram, .school-diagram { margin: 1.6rem 0; }
.tidepool-svg, .school-svg {
  width: 100%;
  height: auto;
  display: block;
  filter: drop-shadow(0 8px 24px rgba(14,42,59,0.06));
}
.tidepool-svg .pool { fill: var(--cyan-glass); opacity: 0.20; stroke: var(--kelp); stroke-width: 1.4; }
.tidepool-svg .pool-deep { fill: var(--cyan-92); opacity: 0.22; }
.tidepool-svg .pool-label { font-family: var(--type-display); font-weight: 500; font-size: 18px; fill: var(--ink); text-anchor: middle; }
.tidepool-svg .sandbar { stroke: var(--ink); stroke-width: 1.4; opacity: 0.7; }
.tidepool-svg .row-label { font-family: var(--type-mono); font-size: 11px; fill: var(--ink); }
.tidepool-svg .current { fill: none; stroke: var(--cyan-92); stroke-width: 1.2; opacity: 0.6; }
.tidepool-svg .channel { fill: none; stroke: var(--coral-ink); stroke-width: 1.6; stroke-dasharray: 4 4; }
.tidepool-svg .channel-label { font-family: var(--type-hand); font-size: 14px; fill: var(--coral-ink); }
.tidepool-svg .waterline { fill: none; stroke: var(--cyan-92); stroke-width: 1.4; stroke-dasharray: 6 5; opacity: 0.7; }
.caveat-anno { font-family: var(--type-hand); font-size: 15px; fill: var(--coral-ink); }

/* ---------- school diagram (/6) ---------- */
.school-svg .thermo { fill: none; stroke: var(--cyan-92); stroke-width: 1.4; stroke-dasharray: 6 5; opacity: 0.7; }
.school-svg .school-fish path { fill: none; stroke: var(--kelp); stroke-width: 1.4; }
.school-svg .school-fish { animation: school-shimmer 6s ease-in-out infinite; }
.school-svg .school-fish:nth-child(odd) { animation-delay: -2s; }
.school-svg .school-fish:nth-child(3n) { animation-delay: -4s; }
@keyframes school-shimmer { 0%,100%{transform:translateX(0)} 50%{transform:translateX(10px)} }

/* ---------- buoys (/7) ---------- */
.buoy-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1.8rem;
  margin: 1.6rem 0;
}
.buoy {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}
.buoy-svg {
  width: 64px; height: auto;
  fill: none;
  stroke: var(--ink);
  stroke-width: 1.4;
  filter: drop-shadow(0 8px 24px rgba(14,42,59,0.06));
  animation: bob 6s ease-in-out infinite;
}
.buoy:nth-child(2) .buoy-svg { animation-delay: -2s; }
.buoy:nth-child(3) .buoy-svg { animation-delay: -4s; }
.buoy-meta { margin: 0.6rem 0 0.4rem; }
.buoy-name { display: block; font-family: var(--type-mono); font-size: 13px; color: var(--coral-ink); }
.buoy-val  { display: inline-block; font-family: var(--type-display); font-weight: 700; font-size: 2rem; color: var(--cyan-92); }
.buoy-unit { display: inline; font-family: var(--type-mono); font-size: 11px; color: var(--ink); opacity: 0.7; margin-left: 0.4rem; }
.buoy-code { font-size: 12.5px; padding: 16px; padding-top: 16px; width: 100%; }
.buoy-code .compass-rose { display: none; }

/* ---------- appendix shoals (/8) ---------- */
.appendix-body { display: flex; flex-direction: column; }
.shoal {
  display: flex;
  flex-wrap: wrap;
  gap: 1.4rem 2.2rem;
  margin: 1.6rem 0 2.4rem;
}
.pebble {
  display: flex;
  align-items: flex-start;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  max-width: 19rem;
  font-size: 0.95rem;
  line-height: 1.45;
  transition: color 0.25s;
}
.pebble:hover { color: var(--coral-ink); }
.pebble:nth-child(2n) { transform: translateY(8px); }
.pebble:nth-child(3n) { transform: translateY(-6px); }
.pebble:nth-child(5n) { transform: translateY(12px); }
.pebble-no {
  flex: 0 0 auto;
  width: 26px; height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1.4px solid var(--cyan-glass);
  background: var(--surface);
  font-family: var(--type-mono);
  font-size: 12px;
  color: var(--coral-ink);
}
.pebble:hover .pebble-no { background: var(--shell-pink); }
.pebble-txt { padding-top: 2px; }
.dive-card-glyph-wrap { margin: 0.4rem 0 2rem; }
.dive-card-glyph {
  width: 200px; height: auto;
  fill: none;
  stroke: var(--kelp);
  stroke-width: 1.4;
  opacity: 0.7;
  filter: drop-shadow(0 8px 24px rgba(14,42,59,0.06));
}
.news-form { max-width: 30rem; }
.news-form label {
  display: block;
  font-family: var(--type-body);
  font-size: 0.92rem;
  color: var(--ink);
  margin-bottom: 0.5rem;
  max-width: none;
}
.news-input-row { display: flex; align-items: flex-end; gap: 0.6rem; }
.news-form input {
  flex: 1 1 auto;
  font-family: var(--type-mono);
  font-size: 14px;
  background: transparent;
  border: none;
  border-bottom: 1.4px solid var(--ink);
  color: var(--ink);
  padding: 0.4rem 0.1rem;
}
.news-form input::placeholder { color: var(--ink); opacity: 0.4; }
.news-submit {
  background: transparent;
  border: none;
  cursor: pointer;
  padding: 0;
  width: 40px; height: 24px;
}
.news-submit svg { width: 100%; height: 100%; fill: none; stroke: var(--coral-ink); stroke-width: 1.4; transition: transform 0.25s; }
.news-submit:hover svg { transform: translateX(4px); }

/* ---------- sign-off bubble (/9) ---------- */
.stratum-signoff {
  align-items: center;
  justify-content: center;
  text-align: center;
  position: relative;
}
.signoff-inner {
  position: relative;
  width: min(560px, 86vw);
  aspect-ratio: 1 / 1;
  display: grid;
  place-items: center;
}
.giant-bubble {
  position: absolute;
  inset: 0;
  width: 100%; height: 100%;
  fill: var(--cyan-glass);
  fill-opacity: 0.16;
  stroke: var(--cyan-92);
  stroke-width: 1.4;
  animation: bob 9s ease-in-out infinite;
}
.giant-bubble .bubble-shine { fill: none; stroke: var(--surface); stroke-width: 6; opacity: 0.6; stroke-linecap: round; }
.signoff-text { position: relative; z-index: 1; padding: 2rem; }
.signoff-line {
  font-family: var(--type-display);
  font-weight: 500;
  font-size: clamp(1.4rem, 3vw, 2.4rem);
  color: var(--ink);
  letter-spacing: -0.005em;
  max-width: none;
}
.signoff-sub {
  font-family: var(--type-hand);
  font-size: 1.2rem;
  color: var(--coral-ink);
  margin-top: 0.8rem;
  max-width: none;
}
.return-top {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 0.3rem;
  margin-top: 2rem;
  text-decoration: none;
  font-family: var(--type-mono);
  font-size: 0.78rem;
  letter-spacing: 0.16em;
  color: var(--kelp);
}
.swimmer-arrow { width: 40px; height: 60px; fill: none; stroke: var(--cyan-92); stroke-width: 1.6; transition: transform 0.3s; }
.return-top:hover .swimmer-arrow { transform: translateY(-6px); }

/* ---------- per-stratum depth tinting (fallback if JS off) ---------- */
.stratum-rollback { background: linear-gradient(180deg, rgba(8,24,42,0.0), rgba(8,24,42,0.92) 30%); color: var(--code-pool); }
.stratum-rollback .stratum-head h2, .stratum-rollback .lede, .stratum-rollback p { color: var(--code-pool); }
.stratum-rollback .step-num b { color: var(--code-pool); }
.stratum-rollback .codeblock { background: rgba(234,246,248,0.06); border-color: rgba(155,231,236,0.3); color: var(--code-pool); }
.stratum-rollback .codeblock .kw { color: var(--cyan-glass); }
.stratum-rollback .codeblock .str { color: #7fd9b6; }
.stratum-rollback .codeblock .num { color: var(--cyan-92); }
.stratum-rollback .stratum-body p code { background: rgba(234,246,248,0.1); color: var(--shell-pink); }
.stratum-rollback .callout-warn { background: rgba(245,195,107,0.1); }

.stratum-deploy { background: linear-gradient(180deg, rgba(63,124,104,0.10), rgba(63,124,104,0.04)); }

/* cursor wake */
.wake-layer { position: fixed; inset: 0; z-index: 90; pointer-events: none; overflow: hidden; }
.wake-dolphin {
  position: absolute;
  width: 8px; height: 8px;
  fill: none;
  stroke: var(--cyan-92);
  stroke-width: 1.2;
  opacity: 0.7;
  pointer-events: none;
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
  :root { --raft-tilt-a: 0deg; --raft-tilt-c: 0deg; }
  .raft-left, .raft-right { transform: none; }
  .axis { animation: none; }
  .wake-layer { display: none; }
}

/* ---------- responsive ---------- */
@media (max-width: 880px) {
  .raft-grid { grid-template-columns: 1fr; }
  .raft-left, .raft-right { transform: none; }
  .raft-right { order: 3; }
  .depth-rail { right: 8px; }
  .stratum { padding-left: 1.2rem; padding-right: 1.2rem; }
}
@media (max-width: 520px) {
  body { font-size: 16px; }
  .step { grid-template-columns: 44px 1fr; gap: 0.8rem; }
  .step-num { width: 44px; height: 44px; }
  .codeblock { padding: 18px; padding-top: 26px; font-size: 12.5px; }
  .depth-rail { display: none; }
}
