/* ---- 02 / Chronicle No. 002: Point Nemo, drawn edge to edge behind the section ---- */
#nemo.nemo-section,.journey-active #nemo.nemo-section{position:relative;background:#070b14;color:var(--night-ink);border-top:0;padding-top:34px;cursor:crosshair}
#nemo.nemo-section:before{display:none}
#nemo.nemo-section:after{content:'';position:absolute;inset:auto 0 0;height:34%;background:linear-gradient(#070b1400,#070b14 78%);z-index:-1;pointer-events:none}
.nemo-backdrop{position:absolute;inset:0;width:100%;height:100%;display:block;z-index:-1}
#nemo .comic-masthead,#nemo .comic-footer{border-color:var(--night-ink)33}
#nemo :is(.comic-masthead .eyebrow,.comic-edition,.comic-footer>span,.nemo-note){color:var(--night-muted)}
#nemo .comic-heading h2{color:var(--night-ink)}
#nemo .comic-heading h2 em{color:var(--lamp)}
#nemo .comic-deck{color:#c9cfdb;max-width:560px}
#nemo .comic-stamp,#nemo .comic-stamp:before{color:var(--ember);border-color:var(--ember)}
#nemo .comic-footer a{color:var(--night-ink);border-color:color-mix(in srgb,var(--ember) 50%,transparent);cursor:pointer}
.nemo-stage{position:relative;min-height:clamp(340px,46vh,520px)}
.nemo-label{position:absolute;bottom:14px;font:0.5625rem/1.6 var(--mono);letter-spacing:0.133em;pointer-events:none}
.nemo-hint{right:0;color:var(--ember)}
.nemo-coords{left:0;color:#b9c3d6}
.nemo-figure{margin:0}
.nemo-caption{display:grid;grid-template-columns:1.2fr 1fr;gap:48px;align-items:end;margin:0 0 40px}
.nemo-caption .nemo-note{margin:0}
.nemo-punchline{font:italic clamp(1.375rem,2.3vw,2.125rem)/1.3 Georgia,serif;letter-spacing:-0.012em;margin:0;max-width:460px;color:var(--night-ink)}
.nemo-punchline em{color:var(--lamp)}
.nemo-note{font:0.5rem/1.9 var(--mono);letter-spacing:0.1em;max-width:380px}

/* ---- 03 / Explorations: each row opens a shelf of the work behind it ---- */
.exploration-card[aria-expanded="true"] .card-arrow{transform:rotate(90deg)}
.exploration-card[aria-expanded="true"]{border-bottom-color:transparent}
.shelf{display:grid;grid-template-rows:0fr;transition:grid-template-rows .55s cubic-bezier(.2,.7,.2,1);border-bottom:1px solid #9ba2b0}
.shelf.open{grid-template-rows:1fr}
.shelf-inner{min-height:0;overflow:hidden;visibility:hidden;transition:visibility 0s .55s}
.shelf.open .shelf-inner{visibility:visible;transition-delay:0s}
.shelf-items{display:grid;grid-template-columns:repeat(auto-fill,minmax(236px,1fr));gap:26px 22px;padding:30px 0 40px}
.shelf-item{display:grid;grid-template-rows:auto 1fr;gap:12px;position:relative;color:inherit;text-align:left;background:none;border:0;padding:0;font:inherit;opacity:0;transform:translateY(10px)}
.shelf.open .shelf-item{animation:shelf-rise .55s cubic-bezier(.2,.7,.2,1) both;animation-delay:calc(.08s + var(--i,0) * 55ms)}
@keyframes shelf-rise{to{opacity:1;transform:none}}
.shelf-thumb{display:block;background:#101723;border:1px solid #1d232d;box-shadow:0 1px 0 #1d232d,0 18px 34px -22px #101723b3;transition:transform .55s cubic-bezier(.2,.7,.2,1),box-shadow .55s}
.thumb-bar{display:flex;align-items:center;gap:5px;padding:8px 10px;font:0.4375rem/1 var(--mono);letter-spacing:0.143em;color:#b9c3d6}
.thumb-bar i{width:5px;height:5px;border-radius:50%;background:#3b4559}
.thumb-bar i:first-child{background:var(--ember)}
.thumb-url{flex:1;margin-left:6px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.thumb-no{color:var(--ember)}
.thumb-view{display:block;aspect-ratio:16/10;overflow:hidden;background:#d8d2c7;border-top:1px solid #1d232d}
.thumb-view img{display:block;width:100%;height:auto;filter:saturate(.8) contrast(1.02);transition:transform 1.2s cubic-bezier(.2,.7,.2,1),filter .5s}
.shelf-item:hover .shelf-thumb,.shelf-item:focus-visible .shelf-thumb{transform:translateY(-5px) rotate(-.5deg);box-shadow:0 1px 0 #1d232d,0 30px 44px -24px #101723d9}
.shelf-item:hover .thumb-view img,.shelf-item:focus-visible .thumb-view img{transform:translateY(-53%);filter:none;transition:transform 7s linear,filter .5s}
.shelf-caption{display:grid;gap:5px;padding-right:26px}
.shelf-kind{font:0.5rem/1.6 var(--mono);letter-spacing:0.15em;color:#5b6474}
.shelf-item strong{font-size:1rem;font-weight:550;letter-spacing:-0.013em;color:#1c2029}
.shelf-note{font-size:0.8125rem;line-height:1.55;color:#4b5871}
.shelf-arrow{position:absolute;right:0;bottom:4px;font-size:1.125rem;line-height:1;color:#884133;transition:transform .3s}
.shelf-item:hover .shelf-arrow{transform:translate(2px,-2px)}
.shelf-cta{grid-template-rows:none;align-content:center;gap:8px;padding:22px 20px;border:1px dashed #9ba2b0;min-height:150px;cursor:pointer}
.shelf-cta strong span{color:#884133;margin-left:8px}
.shelf-cta:hover{border-color:#884133;background:#e8e2d6}
.journey-active .shelf-item strong{color:var(--journey-ink)}
.journey-active :is(.shelf-kind,.shelf-note){color:var(--journey-muted)}
.journey-active :is(.shelf-arrow,.shelf-cta strong span){color:var(--journey-accent)}
.journey-active :is(.shelf,.shelf-cta){border-color:var(--journey-line)}
@media(max-width:760px){
  .shelf-items{grid-template-columns:repeat(2,1fr);gap:18px 12px;padding:22px 0 30px}
  .shelf-item strong{font-size:0.875rem}
  .shelf-note{font-size:0.75rem}
  .shelf-caption{padding-right:18px}
  .shelf-cta{grid-column:1/-1;min-height:0;padding:18px}
}
@media(max-width:400px){.shelf-items{grid-template-columns:1fr}}
@media(prefers-reduced-motion:reduce){.shelf{transition:none}.shelf-item:hover .thumb-view img{transform:none}.shelf.open .shelf-item{animation:none;opacity:1;transform:none}}

/* ---- 05 / Contact: always full coral, whatever the scroll colour is doing around it ---- */
.journey-active #contact{background:var(--ember);color:var(--on-ember)}
.journey-active #contact :is(h2,.eyebrow){color:var(--on-ember)}.journey-active #contact :is(.contact-content>div>p,.contact-note,.contact-top>span){color:var(--on-ember-soft)}
.journey-active #contact h2 em{color:var(--lamp-ink)}
.journey-active #contact .status-dot{background:var(--on-ember)}

/* ---- 06 / Terminus: the last place online ---- */
.terminus{border-top:1px solid #333b4c;padding-top:70px;padding-bottom:70px}
.terminus-top{display:flex;justify-content:space-between;align-items:center;gap:20px}
.terminus-top .eyebrow{margin:0}
.terminus-depth{font:0.625rem var(--mono);letter-spacing:0.12em;color:var(--night-muted);margin:0;font-variant-numeric:tabular-nums}
.terminus-content{display:grid;grid-template-columns:1.4fr 1fr;gap:60px;align-items:end;margin-top:55px}
.terminus h2{font-size:clamp(2.5rem,5vw,4.75rem);font-weight:450;letter-spacing:-.045em;line-height:1.02;margin:0;color:var(--night-ink)}
.terminus h2 em{font-family:'Instrument Serif',Georgia,serif;font-weight:400;color:var(--lamp);letter-spacing:-.02em}
.terminus-deck{font-size:0.9375rem;line-height:1.8;color:#b2b7c2;margin:26px 0 0;max-width:480px}
.terminus-line{font:italic 1.375rem/1.45 'Instrument Serif',Georgia,serif;color:var(--night-ink);margin:0}
.terminus-line em{color:var(--lamp)}
.board{margin:56px 0 50px;background:#0a0e16;border:1px solid #2a3243;padding:22px 24px 18px;box-shadow:0 24px 60px #00000059,inset 0 1px 0 #ffffff0d}
.board-head{display:flex;justify-content:space-between;align-items:center;gap:16px;margin-bottom:18px}
.board-head .flap{color:var(--ember);font-size:0.8125rem}
.board-rows{list-style:none;margin:0;padding:0;display:grid;gap:6px}
.board-row a,.board-row>div{display:grid;grid-template-columns:auto 1fr auto;gap:18px;align-items:center;padding:4px 6px;border-radius:2px}
.board-row a:hover{background:#ffffff0a}
.board-row a:hover .cell-dest .flap{color:var(--ember)}
.cell{display:flex;gap:2px}
.flap{display:inline-grid;place-items:center;width:1.05em;height:1.5em;font:500 clamp(0.8125rem,1.45vw,1.25rem)/1 var(--mono);color:var(--night-ink);background:linear-gradient(#1c2333 0 48%,#070a10 48% 52%,#161c2a 52%);border-radius:2px;box-shadow:inset 0 -1px 0 #00000080}
.cell-time .flap{color:#b9c3d6}
.cell-status .flap{color:#b9c3d6}
.board-row.is-skipped .cell-status .flap{color:#8f97a8}
.board-last{margin-top:8px;padding-top:10px;border-top:1px dashed #2a3243}
.board-last .cell-dest .flap{color:#ffd9b8}
.board-last.arrived .cell-status .flap{color:var(--ember)}
.board-foot{margin:16px 0 0;font:0.5625rem var(--mono);letter-spacing:0.133em;color:#8f97a8}
.sr{position:absolute;width:1px;height:1px;overflow:hidden;clip:rect(0 0 0 0);white-space:nowrap}
.terminus-links{display:flex;gap:40px;align-items:center;flex-wrap:wrap;font:0.625rem var(--mono);letter-spacing:0.12em;text-transform:uppercase}
.terminus-hello{background:none;border:0;border-bottom:1px solid var(--ember);padding:10px 0;font:inherit;letter-spacing:inherit;text-transform:inherit;color:var(--night-ink)}
.terminus-hello span{margin-left:16px;color:var(--ember)}
.terminus-links>span{color:var(--night-muted)}
.journey-active :is(.terminus h2,.terminus-line,.terminus-hello){color:var(--journey-ink)}
.journey-active :is(.terminus-deck,.terminus-depth,.terminus-links>span){color:var(--journey-muted)}
.journey-active .terminus h2 em{color:var(--journey-emphasis)}
.journey-active .terminus-line em{color:var(--journey-emphasis)}

@media(max-width:760px){
  .nemo-stage{min-height:clamp(300px,52vh,440px)}
  .nemo-label{font-size:0.4375rem;letter-spacing:0.114em}
  .nemo-hint{right:auto;left:0;bottom:30px}
  .nemo-caption{grid-template-columns:1fr;gap:18px}
  .nemo-punchline{font-size:1.25rem}
  .nemo-note{font-size:0.4375rem}
  .terminus{padding-top:50px;padding-bottom:50px}
  .terminus-top{flex-direction:column;align-items:flex-start;gap:10px}
  .terminus-content{grid-template-columns:1fr;gap:26px;margin-top:35px}
  .terminus-deck{font-size:0.8125rem}
  .terminus-line{font-size:1.1875rem}
  .board{margin:40px 0;padding:14px 10px 12px}
  .board-row a,.board-row>div{grid-template-columns:1fr auto;gap:8px;padding:3px 2px}
  .cell-time{display:none}
  .flap{font-size:0.625rem}
  .board-head .flap{font-size:0.625rem}
}
@media(max-width:360px){.board{padding-inline:6px}.board-row a,.board-row>div{gap:6px}.flap,.board-head .flap{font-size:0.5625rem}}

/* ---- Hero CTA: rings that start inside the button and ripple out past its edges ---- */
.hero-intro .button{position:relative;isolation:isolate;margin-left:30px} /* room for the ripple: the hero clips its overflow */
.hero-intro .button::before,.hero-intro .button::after{content:'';position:absolute;inset:0;border:1.5px solid #fff3ee;pointer-events:none;opacity:0;animation:cta-ripple 3s cubic-bezier(.2,.6,.3,1) 4 both}
.hero-intro .button::after{animation-delay:1.5s}
.hero-intro .button:hover::before,.hero-intro .button:hover::after{animation-duration:1.8s}
@keyframes cta-ripple{0%{transform:scale(.5,.3);opacity:0;border-color:#fff3ee}18%{opacity:.85}55%{border-color:var(--ember)}100%{transform:scale(1.22,1.85);opacity:0;border-color:var(--ember)}}
@media(prefers-reduced-motion:reduce){.hero-intro .button::before,.hero-intro .button::after{animation:none;display:none}}

/* ---- Footer: privacy, accessibility, sitemap ---- */
.footer-links{display:flex;gap:18px;flex-wrap:wrap;font:0.625rem var(--mono);letter-spacing:0.12em;text-transform:uppercase}
.footer-links a{color:inherit;text-decoration:underline;text-decoration-color:transparent;text-underline-offset:3px;transition:text-decoration-color .2s}
.footer-links a:hover,.footer-links a:focus-visible{text-decoration-color:currentColor}
footer>.footer-links{color:var(--night-muted)}
.journey-active footer>.footer-links{color:var(--journey-muted)}
@media(max-width:760px){footer>.footer-links{order:4;width:100%}}

/* Contact form honeypot: bots tick it, people never see it. */
.form-trap{position:absolute;left:-9999px;width:1px;height:1px;opacity:0;pointer-events:none}
.contact-sent h2{outline:0;margin:14px 0 12px}.contact-sent>p:not(.eyebrow){color:#49566e;font-size:0.9375rem;line-height:1.7;margin:0 0 28px;max-width:420px}.contact-sent-actions{display:flex;flex-wrap:wrap;align-items:center;gap:18px}
.dialog [hidden]{display:none!important}

/* ---- Press feedback: things answer the moment they're pressed, not when the click lands ---- */
:is(.button,.header-contact,.copy-button,.dialog-close,.motion-toggle,.orbit-controls button,.comic-controls>button,.comic-position button,.comic-footer a,.footer-links a){transition-property:transform,background,color,border-color,box-shadow,opacity}
:is(.button,.header-contact,.copy-button,.dialog-close,.motion-toggle,.orbit-controls button,.comic-controls>button,.comic-position button):active{transform:scale(.96);transition-duration:.08s;transition-timing-function:ease-out}
.exploration-card:active{transform:scale(.993);transition-duration:.08s}
.shelf-item:active .shelf-thumb{transform:translateY(-2px) scale(.98);transition-duration:.08s}
.nemo-section:active .nemo-hint{opacity:.6}

/* ---- One switch for motion (motion.js). CSS animations hold their frame while it's off. ---- */
html[data-motion="paused"] *,html[data-motion="paused"] *::before,html[data-motion="paused"] *::after{animation-play-state:paused!important}
.motion-toggle{width:30px;height:30px;margin-left:auto;margin-right:18px;display:grid;place-items:center;border:1px solid currentColor;border-radius:50%;background:transparent;font-size:.6875rem;line-height:1;opacity:.6}
.motion-toggle:hover,.motion-toggle:focus-visible,.motion-toggle[aria-pressed="true"]{opacity:1}
.motion-toggle[aria-pressed="true"]{color:var(--accent)}

/* ---- Dialog materials: solid when transparency or contrast is turned down ---- */
@media(prefers-reduced-transparency:reduce){dialog::backdrop{backdrop-filter:none;background:#090d08f0}}
@media(prefers-contrast:more){dialog::backdrop{backdrop-filter:none;background:#05070cf7}.dialog{outline:2px solid #1c2029;outline-offset:-2px}.dialog input,.dialog textarea{border-color:#1c2029}.dialog .form-note,.dialog>p:not(.eyebrow){color:#1c2029}}

/* ---- Motion tokens ---- */
:root{--ease-out:cubic-bezier(0.23,1,0.32,1);--ease-in-out:cubic-bezier(0.77,0,0.175,1)}

/* ---- Contact: the sent state arrives, and a dot runs the route once ---- */
.contact-sent{transition:opacity 320ms var(--ease-out),transform 320ms var(--ease-out)}
@starting-style{.contact-sent:not([hidden]){opacity:0;transform:translateY(8px) scale(.98)}}
.sent-route{display:block;position:relative;width:48px;height:7px;margin:0 0 16px;color:#8d95a5;background:radial-gradient(circle,currentColor .7px,transparent 1.2px) 0 50%/4px 4px repeat-x}
.sent-route i{position:absolute;left:0;top:50%;width:7px;height:7px;margin-top:-3.5px;border-radius:50%;background:var(--ember);animation:sent-run 600ms var(--ease-in-out) 150ms both}
@keyframes sent-run{from{transform:translateX(0)}to{transform:translateX(41px)}}
@media(prefers-reduced-motion:reduce){.contact-sent{transition-property:opacity}.sent-route i{animation:none;transform:translateX(41px)}}

/* ---- Contact: the send button says it's working ---- */
.dialog .button[aria-busy="true"]{opacity:.75;cursor:progress}
.dialog .button[aria-busy="true"] span{animation:send-nudge 900ms var(--ease-in-out) infinite}
@keyframes send-nudge{0%,100%{transform:none}50%{transform:translate(3px,-3px)}}
@media(prefers-reduced-motion:reduce){.dialog .button[aria-busy="true"] span{animation:none}.dialog .button[aria-busy="true"]{animation:busy-pulse 1.2s ease-in-out infinite!important}}
@keyframes busy-pulse{50%{opacity:.5}}

/* ---- Comic (phones): the caption and the position dot follow the strip instead of jumping ---- */
@media(max-width:760px){
  .comic-panel-caption{transition:opacity 220ms var(--ease-out),transform 220ms var(--ease-out)}
  @starting-style{.comic-panel-caption{opacity:0;transform:translateY(4px)}}
  .comic-position button:before{transition:background-color 160ms var(--ease-out)}
}
