/* ==========================================================================
   THE ATLAS — portfolio template
   A topographic survey sheet: paper, ink, contour lines, one signal colour.
   --------------------------------------------------------------------------
   1. Tokens          5. Hero              9.  Terrain (skills)
   2. Base            6. Marquee           10. Field notes
   3. Utilities       7. About / Work      11. Contact & footer
   4. Chrome          8. Route             12. Overlays · 13. Motion prefs
   ========================================================================== */

/* 1. TOKENS ---------------------------------------------------------------- */
:root {
  /* Paper (light) */
  --paper:        #EFE9DD;
  --paper-2:      #E7E0D1;
  --paper-3:      #DDD4C2;
  --ink:          #1A1915;
  --ink-2:        #45413A;
  --muted:        #6F695E;
  --rule:         #CBC2AF;
  --rule-soft:    rgba(26, 25, 21, .09);
  --accent:       #D9481F;   /* survey orange — the one loud colour */
  --accent-ink:   #FFF8F0;
  --accent-soft:  rgba(217, 72, 31, .12);
  --teal:         #2C6A62;   /* secondary: water / links */
  --contour:        rgba(26, 25, 21, .17);
  --contour-strong: rgba(26, 25, 21, .36);
  --shadow: 0 1px 0 rgba(26,25,21,.04), 0 18px 50px -20px rgba(26,25,21,.35);

  /* Type */
  --serif: "Instrument Serif", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans:  "Geist", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono:  "Geist Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --fs-xs:   .75rem;
  --fs-sm:   .875rem;
  --fs-md:   1rem;
  --fs-lg:   clamp(1.125rem, 1rem + .4vw, 1.3rem);
  --fs-xl:   clamp(1.5rem, 1.2rem + 1.2vw, 2.25rem);
  --fs-2xl:  clamp(2.2rem, 1.4rem + 3.4vw, 4.5rem);
  --fs-3xl:  clamp(3rem, 1.6rem + 6vw, 7.5rem);
  --fs-hero: clamp(4.25rem, min(1rem + 16vw, 15.5vh), 12.5rem);

  /* Space & shape */
  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1320px;
  --section-y: clamp(96px, 12vw, 180px);
  --radius: 14px;
  --radius-sm: 8px;
  --header-h: 68px;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-in-out: cubic-bezier(.65, 0, .35, 1);

  color-scheme: light;
}

/* Night chart (dark) — applied by system preference unless the user picked light,
   and always when the user picked dark. */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --paper: #0D1014; --paper-2: #13181E; --paper-3: #1B222A;
    --ink: #ECE6D8; --ink-2: #BDB6A8; --muted: #878D95;
    --rule: #28303A; --rule-soft: rgba(236, 230, 216, .08);
    --accent: #FF7447; --accent-ink: #140B06; --accent-soft: rgba(255, 116, 71, .14);
    --teal: #72C4B7;
    --contour: rgba(236, 230, 216, .11); --contour-strong: rgba(236, 230, 216, .26);
    --shadow: 0 1px 0 rgba(0,0,0,.2), 0 24px 60px -20px rgba(0,0,0,.8);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --paper: #0D1014; --paper-2: #13181E; --paper-3: #1B222A;
  --ink: #ECE6D8; --ink-2: #BDB6A8; --muted: #878D95;
  --rule: #28303A; --rule-soft: rgba(236, 230, 216, .08);
  --accent: #FF7447; --accent-ink: #140B06; --accent-soft: rgba(255, 116, 71, .14);
  --teal: #72C4B7;
  --contour: rgba(236, 230, 216, .11); --contour-strong: rgba(236, 230, 216, .26);
  --shadow: 0 1px 0 rgba(0,0,0,.2), 0 24px 60px -20px rgba(0,0,0,.8);
  color-scheme: dark;
}

/* 2. BASE ------------------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
  background: var(--paper);
}
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-md);
  line-height: 1.6;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img, svg, canvas { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
h1, h2, h3, h4, p, ol, ul, figure, dl, dd { margin: 0; }
ol, ul { padding: 0; list-style: none; }
::selection { background: var(--accent); color: var(--accent-ink); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

/* 3. UTILITIES ------------------------------------------------------------- */
.container { width: 100%; max-width: var(--maxw); margin-inline: auto; padding-inline: var(--gutter); }
.mono { font-family: var(--mono); font-size: var(--fs-xs); letter-spacing: .04em; text-transform: uppercase; font-feature-settings: "tnum" 1; }
.serif { font-family: var(--serif); font-weight: 400; }
.sr-only { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.muted { color: var(--muted); }
kbd { font-family: var(--mono); font-size: .7rem; padding: .1em .45em; border: 1px solid var(--rule); border-bottom-width: 2px; border-radius: 5px; background: var(--paper-2); color: var(--ink-2); }

.skip-link {
  position: fixed; left: 16px; top: -60px; z-index: 200;
  background: var(--ink); color: var(--paper); padding: 10px 16px; border-radius: var(--radius-sm);
  transition: top .2s var(--ease-out);
}
.skip-link:focus { top: 16px; }

.grain {
  position: fixed; inset: -50%; z-index: 90; pointer-events: none; opacity: .09;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .9 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
}
[data-theme="dark"] .grain { mix-blend-mode: screen; opacity: .05; filter: invert(1); }

/* Buttons */
.btn {
  --bx: 0px; --by: 0px;
  position: relative; display: inline-flex; align-items: center; gap: .7em;
  height: 52px; padding: 0 24px; border-radius: 999px;
  font-size: var(--fs-sm); font-weight: 500; letter-spacing: .01em;
  border: 1px solid var(--ink);
  transform: translate(var(--bx), var(--by));
  transition: transform .5s var(--ease-out), background-color .3s, color .3s, border-color .3s;
  overflow: hidden; isolation: isolate; white-space: nowrap;
}
.btn::before {
  content: ""; position: absolute; inset: 0; z-index: -1;
  background: var(--accent); border-radius: inherit;
  transform: translateY(101%); transition: transform .5s var(--ease-out);
}
.btn:hover::before, .btn:focus-visible::before { transform: translateY(0); }
.btn:hover, .btn:focus-visible { border-color: var(--accent); color: var(--accent-ink); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-ghost { background: transparent; color: var(--ink); }
.btn .arrow { transition: transform .5s var(--ease-out); }
.btn:hover .arrow { transform: translateX(4px); }
.btn-lg { height: 64px; padding: 0 34px; font-size: var(--fs-md); }

.chip {
  display: inline-flex; align-items: center; gap: .5em;
  padding: 6px 12px; border-radius: 999px; border: 1px solid var(--rule);
  font-family: var(--mono); font-size: .7rem; letter-spacing: .05em; text-transform: uppercase; color: var(--ink-2);
  white-space: nowrap;
}

/* Section scaffolding */
.section { position: relative; padding-block: var(--section-y); }
.section + .section { border-top: 1px solid var(--rule-soft); }
.sec-head { margin-bottom: clamp(48px, 7vw, 96px); }
.sec-meta { display: flex; align-items: center; gap: 14px; color: var(--muted); margin-bottom: 22px; }
.sec-idx { color: var(--accent); }
.sec-rule { flex: 1; height: 1px; background: var(--rule); position: relative; }
.sec-rule::after { /* scale-bar ticks */
  content: ""; position: absolute; left: 0; right: 0; top: -3px; height: 7px;
  background: repeating-linear-gradient(90deg, var(--rule) 0 1px, transparent 1px 48px);
}
.sec-coord { white-space: nowrap; }
.sec-title { font-family: var(--serif); font-weight: 400; font-size: var(--fs-3xl); line-height: .92; letter-spacing: -.02em; }
.sec-title em { font-style: italic; color: var(--accent); }
.sec-intro { margin-top: 22px; max-width: 46ch; color: var(--ink-2); font-size: var(--fs-lg); }
.sec-head-row { display: grid; gap: 24px; align-items: end; }
@media (min-width: 900px) { .sec-head-row.has-intro { grid-template-columns: 1.3fr 1fr; } .sec-head-row .sec-intro { justify-self: end; margin-top: 0; } }

/* Split-text reveal */
.split .w { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: .2em; margin-bottom: -.2em; }
.split .w > span { display: inline-block; transform: translateY(105%); transition: transform 1.1s var(--ease-out); transition-delay: calc(var(--i, 0) * 60ms); }
.split.in .w > span { transform: none; }
html:not(.js) .split .w > span { transform: none; }

.reveal { opacity: 0; transform: translateY(28px); transition: opacity 1s var(--ease-out), transform 1s var(--ease-out); transition-delay: var(--d, 0ms); }
.reveal.in { opacity: 1; transform: none; }

/* 4. CHROME: header, nav, sheet index, cursor ------------------------------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 60; height: var(--header-h);
  display: flex; align-items: center; gap: 24px;
  padding-inline: var(--gutter);
  transition: transform .5s var(--ease-out), background-color .4s, border-color .4s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled {
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(1.2); backdrop-filter: blur(14px) saturate(1.2);
  border-color: var(--rule-soft);
}
.site-header.hidden { transform: translateY(-100%); }
.brand { display: flex; align-items: center; gap: 12px; font-weight: 500; font-size: var(--fs-sm); }
.brand-mark { width: 30px; height: 30px; color: var(--ink); transition: transform 1.2s var(--ease-out); }
.brand-needle { fill: var(--accent); transform-origin: 16px 16px; transition: transform 1.2s var(--ease-out); }
.brand:hover .brand-needle { transform: rotate(360deg); }
.nav { margin-left: auto; }
.nav-list { display: flex; gap: 4px; }
.nav-link {
  position: relative; display: flex; align-items: baseline; gap: 6px;
  padding: 8px 12px; border-radius: 999px; font-size: var(--fs-sm); color: var(--ink-2);
  transition: color .3s, background-color .3s;
}
.nav-link .mono { font-size: .62rem; color: var(--muted); transition: color .3s; }
.nav-link:hover { color: var(--ink); background: var(--rule-soft); }
.nav-link.active { color: var(--ink); }
.nav-link.active .mono { color: var(--accent); }
.nav-link.active::after {
  content: ""; position: absolute; left: 50%; bottom: 1px; width: 4px; height: 4px; margin-left: -2px;
  border-radius: 50%; background: var(--accent);
}
.header-tools { display: flex; align-items: center; gap: 8px; }
.clock { color: var(--muted); margin-right: 8px; white-space: nowrap; }
.tool-btn {
  display: grid; place-items: center; height: 38px; min-width: 38px; padding: 0 10px;
  border-radius: 999px; border: 1px solid var(--rule); color: var(--ink-2);
  transition: border-color .3s, color .3s, background-color .3s;
}
.tool-btn:hover { border-color: var(--ink); color: var(--ink); }
.tool-btn .mono { font-size: .68rem; }
.theme-btn svg { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; overflow: visible; }
.theme-btn .sun, .theme-btn .moon { transition: transform .7s var(--ease-out), opacity .4s; transform-origin: 12px 12px; }
.theme-btn .moon { opacity: 0; transform: rotate(-60deg) scale(.6); }
[data-theme="dark"] .theme-btn .sun { opacity: 0; transform: rotate(90deg) scale(.5); }
[data-theme="dark"] .theme-btn .moon { opacity: 1; transform: none; fill: currentColor; }
.menu-btn { display: none; gap: 5px; align-content: center; width: 42px; }
.menu-btn span { display: block; width: 16px; height: 1.5px; background: currentColor; transition: transform .4s var(--ease-out); }
.menu-btn[aria-expanded="true"] span:first-child { transform: translateY(3.25px) rotate(45deg); }
.menu-btn[aria-expanded="true"] span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

@media (max-width: 1080px) { .nav-link .label-full { display: none; } }
@media (max-width: 960px) {
  .nav, .clock, .palette-btn { display: none; }
  .header-tools { margin-left: auto; }
  .menu-btn { display: grid; }
}

.mobile-menu {
  position: fixed; inset: 0; z-index: 55; background: var(--paper);
  padding: calc(var(--header-h) + 24px) var(--gutter) 32px;
  display: flex; flex-direction: column; justify-content: space-between;
  overflow-y: auto;
}
.mobile-menu[hidden] { display: none; }
.mobile-menu-list li { border-bottom: 1px solid var(--rule); }
.mobile-menu-list a {
  display: flex; align-items: baseline; gap: 16px; padding: 14px 0;
  font-family: var(--serif); font-size: clamp(2.2rem, 9vw, 3.4rem); line-height: 1.1;
  opacity: 0; transform: translateY(20px); animation: menuIn .7s var(--ease-out) forwards;
  animation-delay: calc(var(--i) * 55ms + 60ms);
}
.mobile-menu-list .mono { color: var(--accent); }
.mobile-menu-foot a { text-transform: none; }
.mobile-menu-foot { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); margin-top: 32px; flex-wrap: wrap; }
@keyframes menuIn { to { opacity: 1; transform: none; } }

/* Scroll sheet index */
.sheet-index {
  position: fixed; right: 18px; top: 50%; z-index: 40; height: min(56vh, 460px);
  transform: translateY(-50%); width: 16px;
  opacity: 0; transition: opacity .6s;
}
.sheet-index.on { opacity: 1; }
.sheet-ruler {
  position: absolute; inset: 0 0 0 auto; width: 8px;
  background: repeating-linear-gradient(180deg, var(--rule) 0 1px, transparent 1px 10px);
}
.sheet-ruler i { /* section ticks */
  position: absolute; right: 0; width: 16px; height: 1px; background: var(--ink-2);
}
.sheet-marker {
  position: absolute; right: 0; top: 0; width: 22px; height: 2px; background: var(--accent);
  transform: translateY(var(--p, 0px)); transition: transform .15s linear;
}
.sheet-marker span { position: absolute; right: 30px; top: -8px; color: var(--accent); font-size: .62rem; }
@media (max-width: 1180px) { .sheet-index { display: none; } }

/* Custom cursor */
.cursor { display: none; }
@media (hover: hover) and (pointer: fine) {
  .has-cursor, .has-cursor * { cursor: none !important; }
  .has-cursor input, .has-cursor textarea { cursor: text !important; }
  /* Dialogs render in the top layer, above the custom cursor — give them the native one. */
  .has-cursor dialog, .has-cursor dialog * { cursor: auto !important; }
  .has-cursor dialog a, .has-cursor dialog button, .has-cursor .palette-item { cursor: pointer !important; }
  .has-cursor dialog input { cursor: text !important; }
  .has-cursor .cursor { display: block; }
  .cursor { position: fixed; inset: 0; z-index: 300; pointer-events: none; }
  .cursor-dot, .cursor-ring, .cursor-label { position: absolute; left: 0; top: 0; will-change: transform; }
  .cursor-dot { width: 6px; height: 6px; margin: -3px 0 0 -3px; border-radius: 50%; background: var(--accent); }
  .cursor-ring {
    width: 34px; height: 34px; margin: -17px 0 0 -17px; border-radius: 50%;
    border: 1px solid var(--ink); opacity: .55;
    transition: width .35s var(--ease-out), height .35s var(--ease-out), margin .35s var(--ease-out), opacity .3s, background-color .3s, border-color .3s;
  }
  .cursor-ring::before, .cursor-ring::after { /* crosshair ticks */
    content: ""; position: absolute; background: var(--ink);
  }
  .cursor-ring::before { left: 50%; top: -6px; bottom: -6px; width: 1px; margin-left: -.5px;
    -webkit-mask: linear-gradient(#000 0 6px, transparent 6px calc(100% - 6px), #000 calc(100% - 6px)); mask: linear-gradient(#000 0 6px, transparent 6px calc(100% - 6px), #000 calc(100% - 6px)); }
  .cursor-ring::after { top: 50%; left: -6px; right: -6px; height: 1px; margin-top: -.5px;
    -webkit-mask: linear-gradient(90deg, #000 0 6px, transparent 6px calc(100% - 6px), #000 calc(100% - 6px)); mask: linear-gradient(90deg, #000 0 6px, transparent 6px calc(100% - 6px), #000 calc(100% - 6px)); }
  .cursor-label { margin: 22px 0 0 22px; font-size: .6rem; color: var(--muted); white-space: nowrap; opacity: 0; transition: opacity .3s; }
  .cursor.on-map .cursor-label { opacity: 1; }
  .cursor.on-link .cursor-ring { width: 64px; height: 64px; margin: -32px 0 0 -32px; background: var(--accent-soft); border-color: var(--accent); opacity: 1; }
  .cursor.on-link .cursor-ring::before, .cursor.on-link .cursor-ring::after { opacity: 0; }
  .cursor.hidden { opacity: 0; }
}

/* 5. HERO ------------------------------------------------------------------ */
.hero {
  position: relative; min-height: 100vh; min-height: 100svh;
  display: flex; align-items: stretch; overflow: hidden;
  padding: calc(var(--header-h) + 24px) 0 28px;
}
.hero-canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.hero-vignette {
  position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(ellipse 60% 70% at 18% 55%, var(--paper) 10%, transparent 70%),
    linear-gradient(180deg, var(--paper) 0, transparent 18%, transparent 80%, var(--paper) 100%);
  opacity: .9;
}
.hero-inner { position: relative; display: grid; grid-template-rows: auto 1fr auto; gap: clamp(20px, 3vh, 32px); }
.hero-top { display: flex; justify-content: space-between; gap: 16px; color: var(--muted); flex-wrap: wrap; }
.hero-top .accent { color: var(--accent); }
.hero-main { align-self: center; }
.hero-name {
  font-family: var(--serif); font-weight: 400; font-size: var(--fs-hero);
  line-height: .84; letter-spacing: -.035em; margin-left: -.04em;
}
.hero-name .line { display: block; }
.hero-name .line:nth-child(2) { font-style: italic; padding-left: .55em; }
.hero-name .amp { color: var(--accent); }
.hero-role {
  display: flex; align-items: baseline; flex-wrap: wrap; gap: .3em;
  margin-top: clamp(18px, 3vh, 32px); font-size: var(--fs-xl); font-family: var(--serif); color: var(--ink-2);
}
/* The padding gives descenders (g, y) room inside the clip without moving the baseline. */
.rotator { position: relative; display: inline-grid; box-sizing: content-box; height: 1.15em; padding-bottom: .28em; margin-bottom: -.28em; overflow: hidden; vertical-align: bottom; color: var(--ink); font-style: italic; }
.rotator span { grid-area: 1 / 1; transform: translateY(135%); transition: transform .8s var(--ease-out); white-space: nowrap; }
.rotator span.on { transform: none; }
.rotator span.off { transform: translateY(-135%); }
.rotator::after { content: ""; position: absolute; left: 0; right: 0; bottom: .3em; height: 2px; background: var(--accent); transform-origin: left; animation: underline 3.2s var(--ease-in-out) infinite; }
@keyframes underline { 0% { transform: scaleX(0); } 30%, 80% { transform: scaleX(1); } 100% { transform: scaleX(1); opacity: 0; } }
.hero-tagline { margin-top: 20px; max-width: 44ch; color: var(--ink-2); font-size: var(--fs-lg); }
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: clamp(24px, 4vh, 36px); }

.hero-bottom { display: flex; justify-content: space-between; align-items: flex-end; gap: 24px; flex-wrap: wrap; }
.status {
  display: inline-flex; align-items: center; gap: 10px; padding: 8px 14px 8px 12px;
  border: 1px solid var(--rule); border-radius: 999px; background: color-mix(in srgb, var(--paper) 70%, transparent);
  -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
  font-size: var(--fs-sm); color: var(--ink-2);
}
.pulse { position: relative; width: 8px; height: 8px; border-radius: 50%; background: #2FA36B; }
.pulse::after { content: ""; position: absolute; inset: -4px; border-radius: 50%; border: 1px solid #2FA36B; animation: ping 2s var(--ease-out) infinite; }
.status.off .pulse { background: var(--muted); } .status.off .pulse::after { display: none; }
@keyframes ping { from { transform: scale(.5); opacity: 1; } to { transform: scale(2.2); opacity: 0; } }
.scroll-cue { display: flex; align-items: center; gap: 12px; color: var(--muted); }
.scroll-cue .line { position: relative; width: 1px; height: 44px; background: var(--rule); overflow: hidden; }
.scroll-cue .line::after { content: ""; position: absolute; left: 0; top: 0; width: 1px; height: 40%; background: var(--accent); animation: drip 2.2s var(--ease-in-out) infinite; }
@keyframes drip { from { transform: translateY(-100%); } to { transform: translateY(260%); } }

.legend {
  min-width: 240px; padding: 12px 14px; border: 1px solid var(--ink);
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
  box-shadow: 4px 4px 0 var(--ink);
}
.legend-title { display: flex; justify-content: space-between; border-bottom: 1px solid var(--rule); padding-bottom: 8px; margin-bottom: 8px; }
.legend-title b { font-weight: 500; color: var(--ink); }
.legend dl { display: grid; grid-template-columns: auto 1fr; gap: 3px 16px; color: var(--muted); }
.legend dd { text-align: right; color: var(--ink); }
.legend .scale { display: flex; margin-top: 10px; height: 6px; border: 1px solid var(--ink); }
.legend .scale i { flex: 1; } .legend .scale i:nth-child(odd) { background: var(--ink); }
.legend .scale-l { display: flex; justify-content: space-between; margin-top: 4px; color: var(--muted); font-size: .58rem; }
@media (max-width: 760px) { .legend { display: none; } .hero-name .line:nth-child(2) { padding-left: .25em; } }
@media (max-height: 780px) and (min-width: 761px) { .legend { display: none; } .hero-tagline { margin-top: 14px; } }

/* 6. MARQUEE --------------------------------------------------------------- */
.marquee { overflow: hidden; background: var(--ink); color: var(--paper); padding: 20px 0; border-block: 1px solid var(--ink); }
.marquee-track { display: flex; width: max-content; animation: marquee 40s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item { display: flex; align-items: center; gap: 36px; padding-right: 36px; font-family: var(--serif); font-size: clamp(1.6rem, 1rem + 2.4vw, 3rem); line-height: 1; white-space: nowrap; }
.marquee-item:nth-child(even) { font-style: italic; color: var(--accent); }
.marquee-item svg { width: .5em; height: .5em; fill: currentColor; opacity: .7; }
@keyframes marquee { to { transform: translateX(-50%); } }

/* 7a. ABOUT ---------------------------------------------------------------- */
.about-grid { display: grid; gap: clamp(40px, 6vw, 96px); }
@media (min-width: 960px) { .about-grid { grid-template-columns: 5fr 7fr; } }
.portrait {
  position: relative; aspect-ratio: 4 / 5; border-radius: var(--radius); overflow: hidden;
  background: var(--paper-2); border: 1px solid var(--rule);
}
.portrait canvas, .portrait img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.portrait-label {
  position: absolute; left: 14px; right: 14px; bottom: 14px; display: flex; justify-content: space-between;
  color: var(--ink); padding: 8px 10px; border-radius: 6px;
  background: color-mix(in srgb, var(--paper) 80%, transparent); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px);
}
.portrait-corner { position: absolute; width: 18px; height: 18px; border: 0 solid var(--ink); }
.portrait-corner.tl { top: 12px; left: 12px; border-width: 1.5px 0 0 1.5px; }
.portrait-corner.tr { top: 12px; right: 12px; border-width: 1.5px 1.5px 0 0; }
.about-lead { font-family: var(--serif); font-size: var(--fs-2xl); line-height: 1.05; letter-spacing: -.015em; }
.about-lead::first-letter { color: var(--accent); }
.about-body { display: grid; gap: 18px; margin-top: 36px; color: var(--ink-2); max-width: 60ch; font-size: var(--fs-lg); }
.facts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); column-gap: 24px; margin-top: 48px; border-top: 1px solid var(--rule); }
.fact { padding: 18px 16px 18px 0; border-bottom: 1px solid var(--rule); }
.fact dt { color: var(--muted); margin-bottom: 6px; display: flex; align-items: center; gap: 8px; }
.fact dt::before { content: ""; width: 8px; height: 8px; border: 1.5px solid var(--accent); transform: rotate(45deg); }
.fact dd { font-size: var(--fs-md); }
.stats { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 48px; }
.stat-value { font-family: var(--serif); font-size: var(--fs-2xl); line-height: 1; }
.stat-label { margin-top: 8px; color: var(--muted); }
@media (max-width: 520px) { .stats { grid-template-columns: 1fr 1fr; } }

/* 7b. WORK ----------------------------------------------------------------- */
.filters { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 28px; }
.filter {
  padding: 8px 16px; border-radius: 999px; border: 1px solid var(--rule); font-size: var(--fs-sm); color: var(--ink-2);
  transition: all .3s var(--ease-out);
}
.filter sup { font-family: var(--mono); font-size: .6rem; margin-left: 3px; color: var(--muted); }
.filter:hover { border-color: var(--ink); color: var(--ink); }
.filter[aria-pressed="true"] { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.filter[aria-pressed="true"] sup { color: var(--accent); }

.work-list { border-top: 1px solid var(--ink); }
.work-item { border-bottom: 1px solid var(--rule); transition: opacity .5s var(--ease-out); }
.work-item.is-hidden { display: none; }
.work-row {
  position: relative; width: 100%; text-align: left; isolation: isolate;
  display: grid; align-items: center; gap: 8px 24px;
  grid-template-columns: 64px minmax(0, 1fr) auto;
  padding: clamp(20px, 2.6vw, 34px) 0;
}
.work-row::before { /* hover wash */
  content: ""; position: absolute; inset: 0 calc(var(--gutter) * -1); z-index: -1;
  background: var(--paper-2); transform: scaleY(0); transform-origin: bottom;
  transition: transform .6s var(--ease-out);
}
.work-row:hover::before, .work-row:focus-visible::before { transform: scaleY(1); }
.work-idx { color: var(--muted); align-self: start; padding-top: .9em; }
.work-title {
  font-family: var(--serif); font-size: clamp(2rem, 1.1rem + 3.6vw, 4.6rem); line-height: .95; letter-spacing: -.02em;
  transition: transform .6s var(--ease-out), color .3s;
}
.work-row:hover .work-title { transform: translateX(14px); font-style: italic; }
.work-summary { grid-column: 2; color: var(--muted); font-size: var(--fs-sm); max-width: 56ch; }
.work-meta { display: flex; align-items: center; gap: 12px; color: var(--muted); grid-row: 1 / span 2; grid-column: 3; }
.work-arrow {
  display: grid; place-items: center; width: 48px; height: 48px; border-radius: 50%; border: 1px solid var(--rule);
  transition: all .5s var(--ease-out);
}
.work-arrow svg { width: 16px; height: 16px; stroke: currentColor; stroke-width: 1.6; fill: none; }
.work-row:hover .work-arrow { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); transform: rotate(-45deg); }
.work-thumb { display: none; }
@media (max-width: 760px) {
  .work-row { grid-template-columns: 1fr auto; }
  .work-row::before { display: none; }
  .work-row:hover .work-title { transform: none; }
  .work-thumb { display: block; grid-column: 1 / -1; grid-row: 1; aspect-ratio: 16 / 9; border-radius: var(--radius-sm); overflow: hidden; border: 1px solid var(--rule); margin-bottom: 10px; }
  .work-thumb canvas, .work-thumb img { width: 100%; height: 100%; object-fit: cover; }
  .work-idx { grid-column: 1; grid-row: 2; padding-top: 0; align-self: center; }
  .work-meta { grid-column: 2; grid-row: 2; }
  .work-title { grid-column: 1 / -1; grid-row: 3; }
  .work-summary { grid-column: 1 / -1; grid-row: 4; }
  .work-meta .chip { display: none; }
  .work-arrow { width: 40px; height: 40px; }
}

.work-preview {
  position: fixed; left: 0; top: 0; z-index: 50; width: 340px; pointer-events: none;
  opacity: 0; transform: translate3d(-9999px, 0, 0);
  transition: opacity .35s var(--ease-out);
}
.work-preview.on { opacity: 1; }
.work-preview-media {
  aspect-ratio: 340 / 212; border-radius: var(--radius-sm); overflow: hidden; box-shadow: var(--shadow);
  border: 1px solid var(--ink); background: var(--paper-2);
  transform: scale(.82); transform-origin: left center; transition: transform .6s var(--ease-out);
}
.work-preview.on .work-preview-media { transform: none; }
.work-preview-media canvas, .work-preview-media img { width: 100%; height: 100%; object-fit: cover; }
.work-preview-label { display: inline-block; margin-top: 8px; padding: 4px 8px; background: var(--ink); color: var(--paper); border-radius: 4px; }
@media (hover: none), (max-width: 760px) { .work-preview { display: none; } }

/* 8. ROUTE (experience) ------------------------------------------------------ */
.route-wrap { position: relative; }
.route-svg { position: absolute; left: 0; top: 0; width: 72px; height: 100%; overflow: visible; pointer-events: none; }
.route-svg .planned { fill: none; stroke: var(--rule); stroke-width: 1.5; stroke-dasharray: 2 6; stroke-linecap: round; }
.route-svg .walked  { fill: none; stroke: var(--accent); stroke-width: 2; stroke-linecap: round; }
.route-list { display: grid; }
.stop {
  position: relative; display: grid; gap: 8px 40px; padding: 0 0 clamp(56px, 7vw, 96px) 72px;
}
.stop:last-child { padding-bottom: 0; }
@media (min-width: 900px) { .stop { grid-template-columns: 220px minmax(0, 1fr); padding-left: 96px; } }
.waypoint {
  position: absolute; left: 36px; top: 6px; width: 18px; height: 18px; margin-left: -9px;
  border-radius: 50%; border: 1.5px solid var(--ink-2); background: var(--paper);
  transition: all .5s var(--ease-out);
}
.waypoint::after { content: ""; position: absolute; inset: 4px; border-radius: 50%; background: var(--ink-2); transform: scale(0); transition: transform .5s var(--ease-out); }
.stop.reached .waypoint { border-color: var(--accent); box-shadow: 0 0 0 6px var(--accent-soft); }
.stop.reached .waypoint::after { background: var(--accent); transform: scale(1); }
.stop-when { color: var(--muted); padding-top: 6px; }
.stop-when b { display: block; color: var(--ink); font-weight: 500; font-size: .8rem; }
.stop-role { font-family: var(--serif); font-size: var(--fs-xl); line-height: 1.1; }
.stop-org { margin-top: 4px; color: var(--ink-2); }
.stop-org .at { color: var(--accent); font-family: var(--serif); font-style: italic; font-size: 1.15em; }
.stop-summary { margin-top: 14px; color: var(--ink-2); max-width: 62ch; }
.stop-hl { display: grid; gap: 6px; margin-top: 14px; }
.stop-hl li { position: relative; padding-left: 22px; color: var(--ink-2); font-size: var(--fs-sm); }
.stop-hl li::before { content: "→"; position: absolute; left: 0; color: var(--accent); }

/* 9. TERRAIN (skills) -------------------------------------------------------- */
.tabs { display: inline-flex; gap: 4px; padding: 4px; border-radius: 999px; border: 1px solid var(--rule); background: var(--paper-2); margin-bottom: 28px; max-width: 100%; overflow-x: auto; }
.tab { padding: 8px 18px; border-radius: 999px; font-size: var(--fs-sm); color: var(--ink-2); white-space: nowrap; transition: all .35s var(--ease-out); }
.tab[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.tab:not([aria-selected="true"]):hover { color: var(--ink); }
.profile {
  position: relative; border: 1px solid var(--ink); border-radius: var(--radius);
  background:
    linear-gradient(var(--rule-soft) 1px, transparent 1px) 0 0 / 100% 20%,
    var(--paper);
  padding: 16px; overflow: hidden;
}
.profile-head { display: flex; justify-content: space-between; color: var(--muted); padding: 0 4px 8px; gap: 12px; flex-wrap: wrap; }
.profile svg { width: 100%; height: auto; overflow: visible; }
.profile .ridge { fill: none; stroke: var(--ink); stroke-width: 1.6; stroke-linejoin: round; }
.profile .ridge-echo { fill: none; stroke: var(--contour-strong); stroke-width: 1; }
.profile .ridge-fill { fill: url(#hatch); }
.profile .axis line { stroke: var(--rule); }
.profile .axis text, .profile .peak-lvl { fill: var(--muted); font-family: var(--mono); font-size: 11px; letter-spacing: .05em; }
.profile .peak-name { fill: var(--ink); font-family: var(--serif); font-size: 22px; }
.profile .peak-mark { fill: var(--accent); }
.profile .peak-stem { stroke: var(--ink); stroke-dasharray: 2 3; opacity: .45; }
.profile .peak-num { fill: var(--accent); font-family: var(--mono); font-size: 12px; }
.skill-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 0 40px; margin-top: 32px; }
.skill-row { display: flex; align-items: baseline; gap: 10px; padding: 12px 0; border-bottom: 1px solid var(--rule); }
.skill-row .n { color: var(--accent); }
.skill-row .name { font-size: var(--fs-md); }
.skill-row .dots { flex: 1; border-bottom: 1px dotted var(--rule); transform: translateY(-4px); }
.skill-row .lvl { display: flex; gap: 3px; }
.skill-row .lvl i { width: 7px; height: 7px; transform: rotate(45deg); border: 1px solid var(--ink-2); }
.skill-row .lvl i.on { background: var(--ink); border-color: var(--ink); }
.tools { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 40px; align-items: center; }
.tools-label { color: var(--muted); margin-right: 8px; }
@media (max-width: 640px) {
  .profile { padding: 12px 8px; }
  .profile .peak-name, .profile .axis text, .profile .peak-stem { display: none; }
  .profile .peak-num { font-size: 34px; }
  .profile .ridge { stroke-width: 3; }
}

/* 10. FIELD NOTES ------------------------------------------------------------ */
.notes-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr)); }
@media (min-width: 900px) { .notes-grid { grid-template-columns: repeat(3, 1fr); } .note:first-child { grid-column: span 2; grid-row: span 2; } .note.note-archive { grid-column: span var(--span, 1); } .note.note-soon { grid-column: 1 / -1; grid-row: auto; } .notes-grid.solo .note:first-child { grid-row: auto; } }
.note.note-archive { background: var(--ink); color: var(--paper); border-color: var(--ink); min-height: 200px; }
.note.note-soon .note-title { max-width: 22ch; }
.note-archive .note-top, .note-archive .note-foot { color: color-mix(in srgb, var(--paper) 60%, transparent); }
.note-archive::before { background: repeating-radial-gradient(circle, transparent 0 14px, color-mix(in srgb, var(--paper) 18%, transparent) 14px 15px); }
.note.note-archive:hover { border-color: var(--accent); }
.note {
  position: relative; display: flex; flex-direction: column; gap: 14px; min-height: 240px;
  padding: 24px; border-radius: var(--radius); border: 1px solid var(--rule); background: var(--paper-2);
  overflow: hidden; isolation: isolate;
  transition: transform .6s var(--ease-out), border-color .4s, box-shadow .6s var(--ease-out);
}
.note::before { /* contour rings in the corner */
  content: ""; position: absolute; z-index: -1; right: -120px; bottom: -120px; width: 320px; height: 320px; border-radius: 50%;
  background: repeating-radial-gradient(circle, transparent 0 14px, var(--contour) 14px 15px);
  transition: transform 1s var(--ease-out);
}
.note:hover { transform: translateY(-6px); border-color: var(--ink); box-shadow: var(--shadow); }
.note:hover::before { transform: scale(1.35) rotate(20deg); }
.note-top { display: flex; justify-content: space-between; gap: 12px; color: var(--muted); }
.note-kind { color: var(--accent); }
.note-title { font-family: var(--serif); font-size: var(--fs-xl); line-height: 1.08; letter-spacing: -.01em; }
.note:first-child .note-title { font-size: var(--fs-2xl); max-width: 16ch; }
.note-excerpt { color: var(--ink-2); font-size: var(--fs-sm); max-width: 46ch; }
.note-foot { margin-top: auto; display: flex; justify-content: space-between; align-items: center; color: var(--muted); }
.note-foot svg { width: 18px; height: 18px; stroke: currentColor; fill: none; stroke-width: 1.6; transition: transform .5s var(--ease-out); }
.note:hover .note-foot svg { transform: translate(3px, -3px); color: var(--accent); }

/* 11. CONTACT & FOOTER ------------------------------------------------------- */
.contact { overflow: hidden; }
.contact-grid { display: grid; gap: 56px; align-items: center; }
@media (min-width: 960px) { .contact-grid { grid-template-columns: 1.4fr 1fr; } }
.contact-title { font-family: var(--serif); font-weight: 400; font-size: var(--fs-3xl); line-height: .92; letter-spacing: -.025em; }
.contact-title em { color: var(--accent); }
.contact-text { margin-top: 28px; max-width: 44ch; color: var(--ink-2); font-size: var(--fs-lg); }
.contact-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 40px; }
.socials { margin-top: 56px; border-top: 1px solid var(--ink); }
.social {
  display: grid; grid-template-columns: 1fr auto 24px; align-items: center; gap: 16px;
  padding: 16px 0; border-bottom: 1px solid var(--rule);
  transition: padding .5s var(--ease-out), color .3s;
}
.social:hover { padding-left: 12px; color: var(--accent); }
.social .handle { color: var(--muted); text-transform: none; }
.social svg { width: 16px; height: 16px; stroke: currentColor; fill: none; stroke-width: 1.6; transition: transform .5s var(--ease-out); }
.social:hover svg { transform: rotate(-45deg); }
.compass { position: relative; width: min(100%, 420px); aspect-ratio: 1; margin-inline: auto; }
.compass svg { width: 100%; height: 100%; overflow: visible; }
.compass .ring { fill: none; stroke: var(--ink); }
.compass .ring-soft { fill: none; stroke: var(--rule); }
.compass .tick { stroke: var(--ink-2); }
.compass .card { fill: var(--ink); font-family: var(--serif); font-size: 26px; text-anchor: middle; dominant-baseline: central; }
.compass .card.n { fill: var(--accent); }
.compass .deg { fill: var(--muted); font-family: var(--mono); font-size: 9px; text-anchor: middle; dominant-baseline: central; }
.compass .needle { transform-origin: 200px 200px; transition: transform .9s var(--ease-out); }
.compass .needle-n { fill: var(--accent); } .compass .needle-s { fill: var(--ink); opacity: .85; }
.compass .hub { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; }
.compass .sweep { transform-origin: 200px 200px; animation: sweep 6s linear infinite; }
.compass .sweep path { fill: var(--accent-soft); }
.compass .ping circle { fill: none; stroke: var(--accent); transform-origin: 200px 200px; animation: signal 3s var(--ease-out) infinite; opacity: 0; }
.compass .ping circle:nth-child(2) { animation-delay: 1s; } .compass .ping circle:nth-child(3) { animation-delay: 2s; }
.compass-caption { text-align: center; margin-top: 16px; color: var(--muted); }
@keyframes sweep { to { transform: rotate(360deg); } }
@keyframes signal { from { transform: scale(.15); opacity: .9; } to { transform: scale(1); opacity: 0; } }

.site-footer { position: relative; padding: 56px 0 0; border-top: 1px solid var(--ink); overflow: hidden; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr)); color: var(--muted); }
.footer-grid b { display: block; color: var(--ink); font-weight: 500; margin-bottom: 6px; }
.footer-grid a { transition: color .3s; } .footer-grid a:hover { color: var(--accent); }
.to-top { display: inline-flex; align-items: center; gap: 8px; }
.footer-mark {
  margin-top: 48px; font-family: var(--serif); font-size: clamp(3rem, calc(190vw / var(--chars, 9)), 20rem); line-height: .78; letter-spacing: -.04em;
  white-space: nowrap; text-align: center; color: transparent; -webkit-text-stroke: 1px var(--contour-strong);
  -webkit-user-select: none; user-select: none; transform: translateY(12%);
}
.footer-mark em { -webkit-text-stroke: 1px var(--accent); }

/* 12. OVERLAYS: project dialog, palette, toast -------------------------------- */
dialog { padding: 0; border: 0; color: var(--ink); background: transparent; max-width: none; max-height: none; }
dialog::backdrop { background: rgba(10, 10, 8, .5); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }

.project-dialog { width: 100%; height: 100%; margin: 0; }
.project-dialog[open] { display: flex; align-items: flex-end; justify-content: center; }
.pd-sheet {
  position: relative; width: min(1180px, 100%); max-height: calc(100% - 32px); overflow-y: auto; overscroll-behavior: contain;
  background: var(--paper); border: 1px solid var(--ink); border-bottom: 0; border-radius: 20px 20px 0 0;
  animation: sheetUp .7s var(--ease-out);
}
@keyframes sheetUp { from { transform: translateY(40%); opacity: 0; } }
.pd-bar {
  position: sticky; top: 0; z-index: 2; display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 12px clamp(16px, 3vw, 32px); background: color-mix(in srgb, var(--paper) 88%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px); border-bottom: 1px solid var(--rule);
}
.pd-bar .mono { color: var(--muted); }
.pd-nav { display: flex; gap: 6px; }
.pd-cover { position: relative; aspect-ratio: 21 / 9; border-bottom: 1px solid var(--rule); background: var(--paper-2); }
.pd-cover canvas, .pd-cover img { width: 100%; height: 100%; object-fit: cover; }
.pd-cover .coords { position: absolute; left: 16px; bottom: 14px; padding: 4px 8px; border-radius: 4px; background: var(--ink); color: var(--paper); }
.pd-body { padding: clamp(24px, 4vw, 56px) clamp(16px, 4vw, 56px) 64px; display: grid; gap: 48px; }
@media (min-width: 900px) { .pd-body { grid-template-columns: 1.6fr 1fr; } }
.pd-title { font-family: var(--serif); font-weight: 400; font-size: var(--fs-3xl); line-height: .9; letter-spacing: -.025em; }
.pd-summary { margin-top: 18px; font-size: var(--fs-lg); color: var(--ink-2); max-width: 50ch; }
.pd-desc { display: grid; gap: 16px; margin-top: 32px; color: var(--ink-2); max-width: 64ch; }
.pd-desc p:first-child::first-letter { float: left; font-family: var(--serif); font-size: 3.6em; line-height: .8; padding: .08em .1em 0 0; color: var(--accent); }
.pd-outcomes { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); gap: 16px; margin-top: 40px; border-top: 1px solid var(--rule); padding-top: 24px; }
.pd-outcomes .v { font-family: var(--serif); font-size: var(--fs-2xl); line-height: 1; }
.pd-outcomes .l { margin-top: 8px; color: var(--muted); }
.pd-side { display: grid; gap: 28px; align-content: start; }
.pd-meta { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--ink); }
.pd-meta div { padding: 14px 0; border-bottom: 1px solid var(--rule); }
.pd-meta dt { color: var(--muted); margin-bottom: 4px; }
.pd-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.pd-links { display: flex; flex-direction: column; gap: 10px; align-items: flex-start; }

.palette { width: min(640px, calc(100% - 32px)); margin: 12vh auto auto; overflow: visible; }
.palette[open] { animation: paletteIn .35s var(--ease-out); }
@keyframes paletteIn { from { opacity: 0; transform: translateY(-12px) scale(.98); } }
.palette-box { background: var(--paper); border: 1px solid var(--ink); border-radius: var(--radius); box-shadow: var(--shadow), 6px 6px 0 var(--ink); overflow: hidden; }
.palette-search { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--rule); }
.palette-search svg { width: 20px; height: 20px; flex: none; stroke: var(--muted); fill: none; stroke-width: 1.8; stroke-linecap: round; }
.palette-search input { flex: 1; min-width: 0; border: 0; outline: 0; background: transparent; color: var(--ink); font: 400 var(--fs-lg) var(--sans); }
.palette-search input::placeholder { color: var(--muted); }
.palette-list { max-height: min(52vh, 420px); overflow-y: auto; padding: 8px; }
.palette-group { padding: 10px 10px 6px; color: var(--muted); }
.palette-item { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: var(--radius-sm); cursor: pointer; }
.palette-item .ico { display: grid; place-items: center; width: 28px; height: 28px; border-radius: 6px; border: 1px solid var(--rule); font-family: var(--mono); font-size: .65rem; color: var(--muted); flex: none; }
.palette-item .hint { margin-left: auto; color: var(--muted); }
.palette-item[aria-selected="true"] { background: var(--ink); color: var(--paper); }
.palette-item[aria-selected="true"] .ico { border-color: var(--accent); color: var(--accent); }
.palette-item[aria-selected="true"] .hint { color: var(--paper); opacity: .6; }
.palette-empty { padding: 28px; text-align: center; color: var(--muted); }
.palette-foot { display: flex; gap: 18px; flex-wrap: wrap; padding: 10px 18px; border-top: 1px solid var(--rule); color: var(--muted); font-size: .62rem; }
.palette-foot kbd { font-size: .6rem; margin-right: 2px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; z-index: 400; padding: 12px 18px; border-radius: 999px;
  background: var(--ink); color: var(--paper); transform: translate(-50%, calc(100% + 40px)); visibility: hidden;
  transition: transform .6s var(--ease-out), visibility 0s .6s;
  pointer-events: none;
}
.toast.on { transform: translate(-50%, 0); visibility: visible; transition: transform .6s var(--ease-out); }

/* Staging banner (injected by build.py --staging) */
.staging-banner {
  position: fixed; left: 16px; bottom: 16px; z-index: 450; padding: 7px 12px; border-radius: 999px;
  background: repeating-linear-gradient(-45deg, var(--accent) 0 8px, color-mix(in srgb, var(--accent) 82%, #000) 8px 16px);
  color: #fff; font-size: .62rem; box-shadow: var(--shadow); pointer-events: none;
}

/* Preloader */
.loader {
  position: fixed; inset: 0; z-index: 500; display: grid; place-items: center; background: var(--ink); color: var(--paper);
  transition: clip-path 1s var(--ease-in-out); clip-path: inset(0 0 0 0);
}
.loader.out { clip-path: inset(0 0 100% 0); }
.loader-inner { width: min(360px, 80vw); display: grid; gap: 12px; }
.loader-count { font-family: var(--serif); font-size: clamp(4rem, 12vw, 7rem); line-height: 1; font-feature-settings: "tnum" 1; }
.loader-bar { display: flex; height: 6px; border: 1px solid var(--paper); }
.loader-bar i { flex: 1; } .loader-bar i:nth-child(odd) { background: var(--paper); }
.loader-row { display: flex; justify-content: space-between; opacity: .6; }

.noscript { padding: 120px 24px; text-align: center; font-family: var(--serif); font-size: 1.6rem; }

/* View-transition theme swap (circular reveal from the toggle) */
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }

/* 13. MOTION PREFERENCES ------------------------------------------------------ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; transition-delay: 0ms !important; }
  .reveal { opacity: 1; transform: none; }
  .split .w > span { transform: none; }
  .marquee-track { animation: none; flex-wrap: wrap; width: auto; justify-content: center; }
  .marquee-item[data-clone] { display: none; }
  .compass .sweep, .compass .ping, .rotator::after { display: none; }
}
