/* CRABIN — scroll-driven "film" landing page.
   A fixed full-screen stage of illustrated scenes; the tall .track gives scroll length and the scroll
   position P (0..1) drives camera moves, crossfades, copy lines and the content panels (js/main.js).
   html.static (reduced motion) turns the same content into a plain stacked page. */
:root {
  --red: #DC1408; --hot: #F41A08; --black: #110E08; --bone: #EDE6DA; --pink: #FBE7E2; --neon: #CCFF00; --muted: #B5A99B; --amber: #F2B93B;
  --glass: rgba(17, 14, 8, .8); --line: rgba(237, 230, 218, .14);
  --f-display: 'Unbounded', 'Arial Black', system-ui, sans-serif;
  --f-body: 'Instrument Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --f-mono: 'Martian Mono', ui-monospace, Menlo, monospace;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--black); color: var(--bone); }
body { font-family: var(--f-body); font-size: 16px; line-height: 1.55; overscroll-behavior: none; -webkit-font-smoothing: antialiased; }
img { max-width: 100%; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--neon); outline-offset: 3px; }

/* ---------- stage ---------- */
#stage { position: fixed; inset: 0; z-index: 0; overflow: hidden; background: var(--black); }
.scene { position: absolute; inset: 0; opacity: 0; will-change: opacity, transform; transform-origin: 50% 50%; }
.scene > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; user-select: none; -webkit-user-drag: none; }
#sc0 { opacity: 1; }
#sc1 > img { object-position: 50% 0%; }
#sc4 > img { object-position: 30% 50%; }
#sc5 > img { object-position: 70% 50%; }
/* scenes with a dark lower band get blended into night */
#sc1::after, #sc2::after { content: ""; position: absolute; inset: 0; background: linear-gradient(transparent 55%, rgba(5,4,3,.6) 80%, #050403); }
.waver { position: absolute !important; inset: auto auto 40vh 50% !important; width: min(460px, 60vw) !important; height: auto !important; object-fit: contain !important; transform: translate(-50%, 40vh); filter: drop-shadow(0 18px 40px rgba(0,0,0,.6)); }
#fx { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }
.vignette { position: absolute; inset: 0; pointer-events: none; background: radial-gradient(ellipse at 50% 45%, transparent 55%, rgba(0,0,0,.55) 100%); }
#redout { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 55%, #ff3b1f 0%, #c40f05 45%, #3a0503 100%); }
#flash { position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0; background: radial-gradient(circle at 50% 50%, #fff6ec 0%, #ffd9b0 30%, #ff6a3d 60%, #110E08 100%); }
.track { position: relative; z-index: 2; height: 1400vh; pointer-events: none; }
.bar { position: fixed; z-index: 6; left: 0; top: 0; height: 3px; width: 100%; transform-origin: 0 50%; transform: scaleX(0); background: linear-gradient(90deg, var(--red), var(--hot)); }

/* ---------- loader ---------- */
#loader { position: fixed; inset: 0; z-index: 9; background: var(--black); display: grid; place-items: center; transition: opacity .7s ease, visibility 0s linear .7s; }
#loader.gone { opacity: 0; visibility: hidden; }
#loader .snap { display: grid; justify-items: center; gap: 20px; }
#loader .body { position: relative; width: 96px; height: 96px; animation: ldbob 1.2s ease-in-out infinite; }
#loader svg { width: 100%; height: 100%; overflow: visible; }
#loader .dac { transform-box: view-box; transform-origin: 24px 33px; animation: ldsnap 1.2s infinite; }
#loader .sparks { position: absolute; left: 66%; top: -14%; width: 28px; height: 28px; }
#loader .sparks i { position: absolute; left: 50%; top: 50%; width: 2px; height: 9px; background: var(--bone); border-radius: 2px; transform-origin: 50% 0; opacity: 0; animation: ldfx 1.2s infinite; }
#loader .sparks i:nth-child(1) { --r: -60deg; } #loader .sparks i:nth-child(2) { --r: 0deg; } #loader .sparks i:nth-child(3) { --r: 60deg; }
#loader .shadow { width: 66px; height: 8px; border-radius: 50%; background: radial-gradient(closest-side, rgba(0,0,0,.8), transparent); margin-top: -10px; animation: ldsh 1.2s ease-in-out infinite; }
#loader .cap { font-family: var(--f-mono); font-size: 11px; letter-spacing: .14em; text-transform: uppercase; color: var(--muted); }
#loader .dots i { font-style: normal; animation: lddot 1.2s infinite; } #loader .dots i:nth-child(2) { animation-delay: .15s; } #loader .dots i:nth-child(3) { animation-delay: .3s; }
@keyframes ldsnap { 0%, 18% { transform: rotate(-6deg); animation-timing-function: cubic-bezier(.16,1,.3,1); } 46% { transform: rotate(-30deg); animation-timing-function: cubic-bezier(.6,0,.8,.2); } 56% { transform: rotate(3deg); animation-timing-function: ease-out; } 70%, 100% { transform: rotate(-6deg); } }
@keyframes ldbob { 0%, 18% { transform: translateY(0); } 46% { transform: translateY(-7px); } 58% { transform: translateY(1px) scaleY(.96); } 70%, 100% { transform: translateY(0); } }
@keyframes ldsh { 0%, 18% { transform: scaleX(1); opacity: 1; } 46% { transform: scaleX(.78); opacity: .6; } 58%, 100% { transform: scaleX(1); opacity: 1; } }
@keyframes ldfx { 0%, 56% { opacity: 0; transform: rotate(var(--r)) translateY(4px) scaleY(.4); } 60% { opacity: 1; transform: rotate(var(--r)) translateY(8px) scaleY(1); } 74%, 100% { opacity: 0; transform: rotate(var(--r)) translateY(16px) scaleY(.3); } }
@keyframes lddot { 0%, 100% { opacity: .25; } 40% { opacity: 1; } }

/* ---------- nav ---------- */
nav.top { position: fixed; z-index: 7; left: 0; right: 0; top: 0; padding: calc(12px + env(safe-area-inset-top, 0px)) max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px)); display: flex; align-items: center; gap: 22px; background: linear-gradient(rgba(17,14,8,.75), rgba(17,14,8,0)); }
nav.top .home { display: flex; align-items: center; gap: 9px; text-decoration: none; font: 900 18px/1 var(--f-display); letter-spacing: -.02em; color: var(--red); text-transform: lowercase; }
nav.top .home img { width: 30px; height: 30px; border-radius: 50%; border: 2px solid var(--neon); display: block; }
nav.top .links { display: flex; gap: 18px; }
nav.top .lk { color: var(--bone); font: 600 13px/1 var(--f-body); letter-spacing: .02em; text-decoration: none; padding: 6px 0; opacity: .72; transition: opacity .2s; }
nav.top .lk:hover, nav.top .lk[aria-current="true"] { opacity: 1; }
nav.top .lk[aria-current="true"] { box-shadow: inset 0 -2px 0 var(--neon); }
nav.top .sp { flex: 1; }
.pill { font: 700 12px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; border-radius: 999px; padding: 9px 14px; text-decoration: none; white-space: nowrap; transition: filter .2s, background .2s, color .2s; }
.pill.ghost { color: var(--bone); background: rgba(17,14,8,.5); border: 1px solid rgba(237,230,218,.4); padding: 8px 13px; }
.pill.ghost:hover { background: var(--bone); color: var(--black); }
.pill.go { color: var(--black); background: var(--neon); }
.pill.go:hover, .btn.go:hover { filter: brightness(1.08); }
@media (max-width: 760px) { nav.top { gap: 10px; } nav.top .links { display: none; } nav.top .home span { font-size: 16px; } }

/* ---------- film overlays ---------- */
.ov { position: fixed; z-index: 3; pointer-events: none; opacity: 0; will-change: opacity, transform; }
.wordmark { margin: 0; font: 900 clamp(64px, 11vw, 150px)/.9 var(--f-display); letter-spacing: -.045em; text-transform: lowercase; color: var(--red);
  text-shadow: 0 2px 0 #7A0904, 0 5px 0 #5a0603, 0 10px 34px rgba(0,0,0,.6); -webkit-text-stroke: 1px rgba(0,0,0,.25); }
.hero { left: 0; right: 0; top: calc(9vh + env(safe-area-inset-top, 0px)); display: flex; flex-direction: column; align-items: center; gap: 1.6vh; padding: 0 16px; text-align: center; }
.hero p { margin: 0; font: 600 clamp(15px, 2vw, 24px)/1.3 var(--f-display); color: var(--bone); text-shadow: 0 2px 16px rgba(0,0,0,.8); }
.line { left: 0; right: 0; bottom: calc(13vh + env(safe-area-inset-bottom, 0px)); text-align: center; padding: 0 16px; }
.line p { margin: 0 auto; max-width: 18ch; font: 800 clamp(28px, 5vw, 66px)/1.03 var(--f-display); letter-spacing: -.01em; color: var(--bone); text-shadow: 0 4px 30px rgba(0,0,0,.85); text-wrap: balance; }
.line p em { font-style: normal; color: var(--neon); }
.cue { left: 50%; bottom: calc(3vh + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); display: grid; justify-items: center; gap: 2px; }
.cue .pool { position: relative; width: 130px; height: 70px; }
.cue .tip { position: absolute; left: 50%; top: 0; width: 56px; height: 53px; margin-left: -28px; overflow: hidden; }
.cue .tip svg { display: block; width: 56px; height: 56px; animation: cubob 2.4s ease-in-out infinite; }
.cue .dac2 { transform-box: view-box; transform-origin: 24px 33px; animation: cusnap 2.4s infinite; }
.cue .water { position: absolute; left: 50%; top: 53px; width: 76px; height: 2px; margin-left: -38px; background: var(--bone); opacity: .5; border-radius: 2px; }
.cue .rip { position: absolute; left: 50%; top: 54px; width: 40px; height: 10px; margin: -5px -20px; border-radius: 50%; border: 1.5px solid var(--bone); opacity: 0; animation: curip 2.4s infinite; }
.cue .rip:nth-of-type(4) { animation-delay: .8s; } .cue .rip:nth-of-type(5) { animation-delay: 1.6s; }
.cue .lbl { font: 10.5px/1 var(--f-mono); letter-spacing: .2em; text-transform: uppercase; color: var(--bone); }
.cue .chev { display: grid; justify-items: center; height: 24px; }
.cue .chev i { width: 9px; height: 9px; border-right: 1.5px solid var(--bone); border-bottom: 1.5px solid var(--bone); transform: rotate(45deg); margin-top: -3px; opacity: 0; animation: cuchev 1.6s infinite; }
.cue .chev i:nth-child(2) { animation-delay: .2s; }
@keyframes cubob { 0%, 100% { transform: translateY(15px); } 50% { transform: translateY(4px); } }
@keyframes cusnap { 0%, 14% { transform: rotate(0); } 40%, 47% { transform: rotate(-26deg); } 51% { transform: rotate(3deg); } 55%, 100% { transform: rotate(0); } }
@keyframes curip { 0% { opacity: .7; transform: scale(.5); } 100% { opacity: 0; transform: scale(2.4); } }
@keyframes cuchev { 0% { opacity: 0; transform: translateY(-4px) rotate(45deg); } 50% { opacity: 1; } 100% { opacity: 0; transform: translateY(6px) rotate(45deg); } }

/* ---------- content panels ---------- */
.sec { position: fixed; z-index: 4; left: max(4vw, env(safe-area-inset-left, 0px)); top: 50%; transform: translateY(-50%); width: min(470px, 42vw); max-height: calc(100vh - 140px); overflow: auto; opacity: 0; pointer-events: none; background: var(--glass); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border: 1px solid var(--line); border-radius: 18px; padding: 26px 26px 24px; display: flex; flex-direction: column; gap: 14px; scrollbar-width: none; }
.sec.on { pointer-events: auto; }
.sec.right { left: auto; right: max(4vw, env(safe-area-inset-right, 0px)); }
.sec .k { font: 11px/1.3 var(--f-mono); letter-spacing: .16em; text-transform: uppercase; color: var(--neon); }
.sec h2 { margin: 0; font: 800 clamp(24px, 2.6vw, 36px)/1.08 var(--f-display); letter-spacing: -.01em; color: var(--pink); text-wrap: balance; }
.sec p { margin: 0; color: var(--bone); opacity: .88; font-size: 15.5px; }
.sec ul, .sec ol { list-style: none; margin: 4px 0 0; padding: 0; display: grid; gap: 10px; }
.sec li { display: grid; grid-template-columns: 26px minmax(0, 1fr); gap: 2px 10px; align-items: start; }
.sec li i { grid-row: span 2; width: 22px; height: 22px; border-radius: 6px; background: var(--red); display: grid; place-items: center; font: 700 11px/1 var(--f-mono); font-style: normal; color: var(--pink); margin-top: 1px; }
.sec li b { font: 700 15px/1.3 var(--f-display); color: var(--pink); grid-column: 2; }
.sec li span { grid-column: 2; font-size: 14px; color: var(--muted); }
.sec li b span { font: inherit; color: inherit; }
.sec .torch { display: inline-flex; align-items: center; gap: 9px; margin: 4px 0 2px; padding: 8px 14px 8px 12px; border: 1px solid rgba(110,231,135,.45); border-radius: 999px; color: var(--bone); text-decoration: none; font: 600 12px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; background: rgba(11,20,17,.55); width: max-content; }
.sec .torch img { width: 12px; height: auto; display: block; }
.sec .torch b { color: #6ee787; font-weight: 700; text-transform: none; font-family: var(--f-display); letter-spacing: 0; font-size: 14px; }
.sec .torch:hover { border-color: #6ee787; }
.sec li i.pin svg { width: 15px; height: 15px; display: block; }
.sec .facts li i { background: transparent; border: 1px solid var(--line); font: 600 12px/1 var(--f-body); }
.sec .nos li i { background: transparent; border: 2px solid var(--red); color: #ff4a2e; font: 800 12px/1 var(--f-display); transform: rotate(-6deg); }
.who { display: flex; align-items: center; gap: 14px; }
.who img { width: 64px; height: 64px; border-radius: 50%; border: 2px solid var(--neon); flex: none; }
.sec .call { font: 700 17px/1.25 var(--f-display); color: var(--bone); opacity: 1; border-left: 3px solid var(--red); padding-left: 12px; }
.token { display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 8px 16px; font-size: 14px; border-top: 1px solid var(--line); padding-top: 12px; margin: 0; }
.token dt { color: var(--muted); font: 11px/1.4 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; padding-top: 2px; }
.token dd { margin: 0; color: var(--bone); }
.token [hidden] { display: none !important; }
.token .ca { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.token .ca code { font: 500 12.5px/1.35 var(--f-mono); color: var(--neon); word-break: break-all; min-width: 0; flex: 1 1 160px; }
.copy { font: 700 11px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; color: var(--bone); background: rgba(237,230,218,.08); border: 1px solid rgba(237,230,218,.3); border-radius: 999px; padding: 7px 11px; cursor: pointer; flex: none; transition: background .2s, color .2s; }
.copy:hover { border-color: var(--bone); }
.copy.done { color: var(--black); background: var(--neon); border-color: var(--neon); }
.btns { display: flex; gap: 10px; flex-wrap: wrap; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; font: 700 13px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; border-radius: 999px; padding: 13px 18px; text-decoration: none; }
.btn.go { background: var(--neon); color: var(--black); flex: 1 1 auto; }
.btn.ghost { border: 1px solid rgba(237,230,218,.4); color: var(--bone); }
.btn.ghost:hover { background: var(--bone); color: var(--black); }
.small { font-size: 12px !important; color: var(--muted) !important; opacity: 1 !important; }
.soon { opacity: .55; cursor: default; }
.soon::after { content: " · soon"; font-size: .85em; }

/* ---------- footer ---------- */
.foot { position: fixed; z-index: 4; left: 0; right: 0; bottom: 0; opacity: 0; pointer-events: none; padding: 30px max(16px, env(safe-area-inset-right, 0px)) calc(24px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); background: linear-gradient(rgba(17,14,8,0), rgba(17,14,8,.92) 40%); display: flex; flex-direction: column; align-items: center; gap: 14px; text-align: center; }
.foot.on { pointer-events: auto; }
.foot .join { margin: 0; font: 800 clamp(24px, 3vw, 40px)/1.1 var(--f-display); letter-spacing: -.01em; color: var(--bone); }
.foot .joinp { margin: 0; max-width: 54ch; color: var(--bone); opacity: .85; font-size: clamp(13px, 1.3vw, 15.5px); }
.foot .joinp a { color: var(--neon); }
.foot .social { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }
.foot .social.big a { font: 700 14px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; padding: 13px 22px; border-radius: 999px; background: var(--neon); color: var(--black); }
.foot .social.big a:hover { filter: brightness(1.08); }
.foot .social a.kit { font: 600 12px/1 var(--f-mono); letter-spacing: .06em; text-transform: uppercase; text-decoration: none; border: 1px solid rgba(237,230,218,.45); border-radius: 999px; padding: 10px 14px; color: var(--bone); }
.foot .social a.kit:hover { background: var(--bone); color: var(--black); }
.foot .social a.kit.pfpk { color: var(--neon); border-color: rgba(204,255,0,.6); }
.foot .social a.kit.pfpk:hover { background: var(--neon); color: var(--black); }
.foot .fine { font-size: 11.5px; color: var(--muted); }
.fig { display: none; }

.toast { position: fixed; z-index: 10; left: 50%; bottom: 28px; transform: translate(-50%, 20px); opacity: 0; pointer-events: none; background: var(--neon); color: var(--black); font: 700 12px/1 var(--f-mono); letter-spacing: .08em; text-transform: uppercase; padding: 12px 16px; border-radius: 999px; transition: opacity .25s, transform .25s; }
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------- phones: panels become a bottom sheet ---------- */
@media (max-width: 760px) {
  .sec, .sec.right { left: max(10px, env(safe-area-inset-left, 0px)); right: max(10px, env(safe-area-inset-right, 0px)); top: auto; bottom: calc(10px + env(safe-area-inset-bottom, 0px)); transform: none; width: auto; max-height: calc(100svh - 76px - env(safe-area-inset-bottom, 0px)); padding: 16px 16px 14px; gap: 9px; border-radius: 16px; background: rgba(17,14,8,.93); }
  .sec .k { font-size: 10.5px; }
  .sec h2 { font-size: 21px; line-height: 1.1; }
  .sec p { font-size: 14px; line-height: 1.45; opacity: .95; }
  .sec li { gap: 1px 10px; }
  .sec li b { font-size: 14px; }
  .sec li span { font-size: 13px; line-height: 1.4; color: var(--bone); opacity: .78; }
  .sec li i { width: 20px; height: 20px; }
  .sec .call { font-size: 15px; }
  .who img { width: 46px; height: 46px; }
  .sec ul, .sec ol { gap: 7px; }
  .foot { padding-top: 56px; gap: 10px; background: linear-gradient(rgba(17,14,8,0), rgba(17,14,8,.95) 56px); }
  .foot .join { font-size: 24px; }
  .foot .joinp { font-size: 13.5px; opacity: .92; }
  .line { bottom: calc(16vh + env(safe-area-inset-bottom, 0px)); }
  .hero { top: calc(12vh + env(safe-area-inset-top, 0px)); }

}
@media (max-width: 760px) and (max-height: 640px) { .sec li span { display: none; } }

/* ---------- reduced motion: same content as a plain page ---------- */
.st-hero { display: none; }
html.static #stage, html.static #loader, html.static .track, html.static .ov, html.static #flash, html.static #redout, html.static .bar { display: none !important; }
html.static nav.top { position: sticky; background: var(--black); border-bottom: 1px solid var(--line); }
html.static .st-hero { display: block; position: relative; }
html.static .st-hero img.bg { display: block; width: 100%; height: auto; max-height: 82vh; object-fit: cover; }
html.static .st-hero .over { position: absolute; left: 0; right: 0; top: 8%; display: flex; flex-direction: column; align-items: center; gap: 10px; padding: 0 16px; }
html.static .st-hero .over p { margin: 0; font: 600 clamp(15px, 2vw, 24px)/1.3 var(--f-display); text-shadow: 0 2px 16px rgba(0,0,0,.8); text-align: center; }
html.static main.content { max-width: 1100px; margin: 0 auto; padding: 40px 16px 0; display: grid; gap: 40px; }
html.static .sec, html.static .foot { position: static; transform: none; opacity: 1 !important; pointer-events: auto; width: auto; max-height: none; backdrop-filter: none; overflow: visible; }
html.static .sec { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 14px 28px; align-items: start; }
html.static .sec > * { grid-column: 1; }
html.static .sec .fig { display: block; grid-column: 2; grid-row: 1 / span 6; width: 100%; height: auto; border-radius: 12px; }
html.static .foot { background: none; padding-block: 40px 60px; }
@media (max-width: 760px) { html.static .sec { grid-template-columns: 1fr; } html.static .sec .fig { grid-column: 1; grid-row: auto; } }
@media (prefers-reduced-motion: reduce) { .cue *, #loader * { animation: none !important; } }
nav .pill.soon::after { content: none; }
@media (max-width: 420px) { nav.top .pill.ghost { display: none; } }
@media (max-width: 760px) { .waver { width: 74vw !important; bottom: 46vh !important; } }
/* 3D crab canvas (js/crab3d.js); the flat exterior scenes become a fallback only */
#gl { position: absolute; inset: 0; }
#gl canvas { display: block; width: 100%; height: 100%; }
html.has3d .scene { display: none; }
