/* =========================================================
   SLUICE · "the lock flight" landing
   Default = plain stacked page (no JS / no WebGL).
   html.gl = immersive scroll journey up a canal at night (js/canal.js).
   ========================================================= */
:root {
  --night: #07141a;
  --deep: #0b1f27;
  --panel: rgba(9, 27, 34, .74);
  --panel-b: rgba(155, 214, 208, .16);
  --fg: #f1ede2;
  --txt: #c9d3cf;
  --mute: #86a09f;
  --line: rgba(241, 237, 226, .1);
  --water: #45d6c9;
  --water-d: #23a79b;
  --brass: #e8a74a;
  --brass-d: #b97a24;
  --red: #ff6a55;
  --sans: "Bricolage Grotesque", system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; overflow-x: clip; }
body {
  min-height: 100vh;
  background: var(--night) radial-gradient(120% 70% at 50% 0%, #12323c 0%, #0a1c23 45%, #061116 100%) fixed;
  color: var(--txt);
  font: 15px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
code, .mono { font-family: var(--mono); }
button, input { font: inherit; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--water); outline-offset: 3px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip { position: fixed; left: 12px; top: -60px; z-index: 100; background: var(--water); color: var(--night); padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 600; }
.skip:focus { top: 12px; }

/* ---------- buttons ---------- */
.ghost {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 40px; padding: 0 15px; border-radius: 999px;
  border: 1px solid var(--panel-b); background: rgba(9, 27, 34, .55);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  color: var(--fg); font-size: 13px; font-weight: 500; cursor: pointer; white-space: nowrap;
  transition: background .2s, border-color .2s;
}
.ghost:hover { background: rgba(20, 52, 60, .8); border-color: rgba(69, 214, 201, .35); }
.ghost--icon { width: 40px; padding: 0; justify-content: center; }
.ghost svg { flex: none; }

.cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 40px; padding: 0 5px 0 17px; border: none; border-radius: 999px;
  background: linear-gradient(180deg, #f2bb66 0%, var(--brass) 55%, #cf8a2c 100%);
  color: #1d1306; font-size: 13px; font-weight: 700; letter-spacing: .01em; cursor: pointer; white-space: nowrap;
  box-shadow: 0 8px 24px rgba(232, 167, 74, .25), inset 0 1px 0 rgba(255, 255, 255, .45), inset 0 -1px 0 rgba(90, 50, 0, .25);
  transition: box-shadow .2s, transform .2s, filter .2s;
}
.cta:hover { filter: brightness(1.06); box-shadow: 0 10px 30px rgba(232, 167, 74, .35), inset 0 1px 0 rgba(255, 255, 255, .45); }
.cta:active { transform: translateY(1px); }
.arr { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: rgba(29, 19, 6, .14); transition: transform .25s; }
.arr svg { width: 14px; height: 14px; }
.cta:hover .arr, .go:hover .arr { transform: translateX(2px); }
.cta--sm { min-height: 34px; padding: 0 14px; font-size: 12px; }
.go {
  display: inline-flex; align-items: center; gap: 10px; margin-top: 14px; padding: 4px 4px 4px 14px;
  border: 1px solid rgba(69, 214, 201, .35); border-radius: 999px; color: var(--water); font-size: 13.5px; font-weight: 600;
  transition: background .2s, border-color .2s;
}
.go .arr { width: 26px; height: 26px; background: var(--water); color: var(--night); }
.go:hover { background: rgba(69, 214, 201, .08); border-color: rgba(69, 214, 201, .6); }

/* ---------- announcement ---------- */
.announce { position: relative; z-index: 25; padding: 8px 16px; text-align: center; font-size: 13px; background: var(--brass); color: #1d1306; font-weight: 600; }
.announce a { text-decoration: underline; margin-left: 6px; }

/* ---------- header ---------- */
.hdr {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px clamp(14px, 3vw, 32px);
}
.brand { display: flex; align-items: center; gap: 10px; color: var(--fg); }
.brand img { width: 32px; height: 32px; border-radius: 9px; box-shadow: 0 6px 18px rgba(0, 0, 0, .35); }
.brand span { font-weight: 800; font-size: 21px; letter-spacing: .14em; text-transform: uppercase; line-height: 1; }
.tabs { display: flex; gap: 2px; padding: 4px; border-radius: 999px; background: rgba(9, 27, 34, .55); border: 1px solid var(--panel-b); -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px); }
.tabs a { position: relative; padding: 8px 14px; border-radius: 999px; font-size: 13px; font-weight: 500; color: var(--txt); transition: background .2s, color .2s; }
.tabs a:hover { background: rgba(241, 237, 226, .07); color: var(--fg); }
.tabs a.on { background: rgba(69, 214, 201, .14); color: var(--fg); }
.tabs a.on::after { content: ""; position: absolute; left: 50%; bottom: 3px; width: 10px; height: 2px; margin-left: -5px; border-radius: 2px; background: var(--water); }
.right { display: flex; align-items: center; gap: 8px; }
.chain { cursor: default; }
.chain i { width: 8px; height: 8px; border-radius: 50%; background: var(--water); box-shadow: 0 0 0 3px rgba(69, 214, 201, .18); animation: pulse 2.4s ease-in-out infinite; }
.snd-on { display: none; }
[data-sound][aria-pressed="true"] .snd-on { display: block; }
[data-sound][aria-pressed="true"] .snd-off { display: none; }
.menu-btn { display: none; }
.gl-only { display: none; }
html.gl .gl-only { display: inline-flex; }

.menu {
  position: fixed; z-index: 30; top: 66px; right: 14px; width: min(300px, calc(100vw - 28px));
  display: flex; flex-direction: column; padding: 8px; border-radius: 18px;
  background: rgba(8, 24, 30, .97); border: 1px solid var(--panel-b); box-shadow: 0 18px 44px rgba(0, 0, 0, .45);
  max-height: calc(100vh - 90px); overflow: auto;
}
.menu a { display: flex; justify-content: space-between; align-items: center; padding: 11px 12px; border-radius: 12px; color: var(--fg); font-size: 15px; }
.menu a:hover { background: rgba(69, 214, 201, .08); }
.menu small { font-family: var(--mono); font-size: 10.5px; letter-spacing: .12em; color: var(--mute); }

/* ---------- hero ---------- */
.hero {
  min-height: 86vh; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 40px 20px 60px;
}
.hero__k { margin: 0 0 14px; font-size: 11.5px; letter-spacing: .2em; text-transform: uppercase; color: var(--mute); }
[data-project-status] .live { display: none; color: var(--water); }
[data-project-status] .pre { color: var(--brass); }
[data-project-status][data-state="live"] .live { display: inline; }
[data-project-status][data-state="live"] .pre { display: none; }
.hero h1 {
  margin: 0; font-weight: 800; font-size: clamp(76px, 17vw, 220px); line-height: .82; letter-spacing: -.035em;
  text-transform: uppercase; color: var(--fg);
  background: linear-gradient(180deg, #fbf7ec 0%, #f1ede2 52%, #8fe7de 100%); -webkit-background-clip: text; background-clip: text; -webkit-text-fill-color: transparent;
  filter: drop-shadow(0 18px 40px rgba(0, 0, 0, .45));
}
.hero__line { margin: 22px 0 0; font-size: clamp(11px, 1.4vw, 13px); letter-spacing: .34em; padding-left: .34em; text-transform: uppercase; color: var(--brass); }
.hero__sub { display: block; margin-top: 12px; max-width: 460px; font-size: 15.5px; color: var(--txt); }
.hero__chips { display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 26px; }

.ca-pill {
  display: inline-flex; align-items: center; gap: 10px; max-width: 100%;
  padding: 6px 6px 6px 14px; border-radius: 999px; background: rgba(9, 27, 34, .7); border: 1px solid var(--panel-b);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
}
.ca-pill b { font: 500 10.5px/1 var(--mono); letter-spacing: .14em; color: var(--mute); text-transform: uppercase; white-space: nowrap; }
.ca-pill code { font-size: 12.5px; color: var(--fg); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }
.ca-pill code.is-empty { color: var(--brass); }
.ca-pill .cp { border: 0; border-radius: 999px; padding: 6px 12px; background: var(--water); color: var(--night); font-size: 12px; font-weight: 700; cursor: pointer; }
.ca-pill .cp.is-done { background: var(--brass); }
.ca-pill--wide { display: flex; margin-top: 14px; }
.ca-pill--wide code { flex: 1; }
.status { display: inline-flex; align-items: center; gap: 8px; padding: 8px 14px; border-radius: 999px; background: rgba(9, 27, 34, .55); border: 1px solid var(--panel-b); font-size: 12px; color: var(--txt); }
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--water); animation: pulse 2s ease-in-out infinite; }
.status b { font-weight: 500; color: var(--mute); text-transform: uppercase; letter-spacing: .12em; font-size: 10.5px; }
.status span { color: var(--fg); margin-right: 6px; }

.hint { display: none; flex-direction: column; align-items: center; gap: 10px; font-size: 10.5px; letter-spacing: .3em; color: var(--mute); }
.hint i { display: block; width: 1px; height: 40px; background: linear-gradient(var(--water), transparent); animation: drop 2.2s ease-in-out infinite; }

/* ---------- cards ---------- */
#cards { max-width: 760px; margin: 0 auto; padding: 0 16px 80px; display: grid; gap: 16px; }
.card {
  position: relative; padding: 22px 22px 20px; border-radius: 22px;
  background: var(--panel); border: 1px solid var(--panel-b);
  -webkit-backdrop-filter: blur(16px) saturate(1.2); backdrop-filter: blur(16px) saturate(1.2);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35);
}
.card::before { content: ""; position: absolute; left: 22px; right: 22px; top: 0; height: 1px; background: linear-gradient(90deg, transparent, rgba(69, 214, 201, .55), transparent); }
.card .k { display: flex; justify-content: space-between; gap: 12px; font: 500 10.5px/1.3 var(--mono); letter-spacing: .16em; text-transform: uppercase; color: var(--brass); margin-bottom: 12px; }
.card .k > span { display: inline-flex; align-items: center; gap: 9px; }
.card .k > span::before { content: ""; width: 10px; height: 2px; border-radius: 2px; background: var(--water); }
.card .k b { font-weight: 500; color: var(--mute); text-align: right; }
.card h2 { margin: 0 0 10px; color: var(--fg); font-weight: 700; font-size: clamp(25px, 3vw, 32px); line-height: 1.04; letter-spacing: -.02em; }
.card p { margin: 0; font-size: 14.5px; line-height: 1.55; color: var(--txt); }
.card p + p, .paras p + p { margin-top: 9px; }
.card .note { margin-top: 10px; font-size: 12.5px; color: var(--mute); }
.card .note:empty { display: none; }
.card .fine { margin-top: 16px; font-size: 11.5px; line-height: 1.45; color: var(--mute); }

.rows { display: grid; grid-template-columns: 1fr auto; gap: 0; margin-top: 14px; font-size: 12.5px; border-top: 1px solid var(--line); }
.rows > * { padding: 9px 0; border-bottom: 1px solid var(--line); min-width: 0; }
.rows > span { color: var(--mute); }
.rows > code { color: var(--fg); text-align: right; overflow-wrap: anywhere; padding-left: 14px; }
.rows > code:nth-child(odd) { padding-left: 0; padding-right: 14px; }
.rows > code:first-child, .rows > code:nth-child(odd) { text-align: left; }
.rows .live, .rows .soon { justify-self: end; align-self: center; padding: 2px 9px !important; border: 0 !important; border-radius: 999px; font-size: 10.5px; letter-spacing: .08em; text-transform: uppercase; }
.rows .live { color: var(--water); background: rgba(69, 214, 201, .12); }
.rows .is-tbd { color: var(--brass); }

.gates { list-style: none; display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 16px 0 0; padding: 0; font-size: 11.5px; text-transform: uppercase; letter-spacing: .08em; color: var(--fg); }
.gates li { padding: 10px 10px 9px; border-radius: 12px; background: rgba(241, 237, 226, .05); border: 1px solid var(--line); }
.gates b { display: block; color: var(--brass); font-weight: 500; margin-bottom: 2px; }

.probe { display: flex; gap: 8px; margin-top: 14px; }
.probe input { flex: 1; min-width: 0; height: 36px; padding: 0 14px; border-radius: 999px; border: 1px solid var(--panel-b); background: rgba(3, 12, 16, .6); color: var(--fg); font-size: 12.5px; }
.probe input:focus { outline: none; border-color: var(--water); }
.probe__out { margin-top: 8px !important; font-size: 12px !important; min-height: 1.4em; color: var(--txt) !important; overflow-wrap: anywhere; }
.probe__out.is-bad { color: var(--red) !important; }

.dist { list-style: none; margin: 14px 0 0; padding: 0; display: grid; gap: 7px; font-size: 12px; }
.dist li { display: grid; grid-template-columns: 1fr 120px 44px; align-items: center; gap: 10px; }
.dist b { height: 6px; border-radius: 6px; background: rgba(241, 237, 226, .08); overflow: hidden; }
.dist i { display: block; height: 100%; width: var(--pct, 0%); background: linear-gradient(90deg, var(--water-d), var(--water)); }
.dist em { font-style: normal; text-align: right; color: var(--fg); }
.dist em::after { content: "%"; }

.market { margin-top: 14px; padding: 12px 14px; border-radius: 14px; background: rgba(3, 12, 16, .45); border: 1px solid var(--line); font-size: 12px; }
.market dl { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin: 0; }
.market dt { color: var(--mute); font-size: 10px; letter-spacing: .12em; text-transform: uppercase; }
.market dd { margin: 2px 0 0; color: var(--fg); }
.market [data-dir="up"] { color: var(--water); } .market [data-dir="down"] { color: var(--red); }
.market__msg { margin: 0 0 8px !important; font-size: 12px !important; color: var(--mute) !important; }
.market[data-state="ok"] .market__msg { display: none; }
.market:not([data-state="ok"]) dl { display: none; }
.market__upd { margin-top: 8px !important; font-size: 10.5px !important; color: var(--mute) !important; }
.market__upd a { color: var(--water); }
.btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 16px; }

.road { list-style: none; margin: 6px 0 0; padding: 0; display: grid; gap: 10px; }
.road li { padding: 12px 14px; border-radius: 14px; background: rgba(241, 237, 226, .04); border: 1px solid var(--line); }
.road li[data-status="now"] { border-color: rgba(69, 214, 201, .4); background: rgba(69, 214, 201, .07); }
.road__h { display: flex; align-items: center; gap: 10px; margin: 0 0 6px !important; font-size: 12px !important; color: var(--fg) !important; text-transform: uppercase; letter-spacing: .1em; }
.road__h b { color: var(--brass); font-weight: 500; }
.road__st { margin-left: auto; font-style: normal; font-size: 10px; padding: 2px 8px; border-radius: 999px; color: var(--mute); border: 1px solid var(--line); }
.road__st::after { content: "Next"; }
.road li[data-status="now"] .road__st { color: var(--water); border-color: rgba(69, 214, 201, .4); }
.road li[data-status="now"] .road__st::after { content: "Now"; }
.road li[data-status="done"] .road__st::after { content: "Done"; }
.road ul { margin: 0; padding-left: 18px; font-size: 13.5px; color: var(--txt); }
.road ul li { padding: 0; border: 0; background: none; border-radius: 0; }

.faq { display: grid; gap: 6px; margin-top: 4px; }
.faq details { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; list-style: none; padding: 10px 26px 10px 0; position: relative; color: var(--fg); font-weight: 600; font-size: 14.5px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 2px; top: 8px; font: 400 18px/1 var(--mono); color: var(--water); transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 0 12px; font-size: 13.5px; }

/* rail */
.rail { display: none; }
.rail button { display: flex; align-items: center; gap: 12px; padding: 6px 0; background: none; border: 0; cursor: pointer; }
.rail .n { font: 500 11px/1 var(--mono); letter-spacing: .14em; text-transform: uppercase; color: var(--mute); opacity: 0; transform: translateX(6px); transition: .25s; white-space: nowrap; }
.rail .t { width: 9px; height: 9px; border-radius: 2px; border: 1px solid rgba(241, 237, 226, .35); transition: .25s; }
.rail .tick { width: 1px; height: 10px; margin-right: 4px; background: rgba(241, 237, 226, .15); }
.rail button.on .t { background: var(--water); border-color: var(--water); box-shadow: 0 0 0 4px rgba(69, 214, 201, .18); }
.rail button.on .n, .rail:hover .n { opacity: 1; transform: none; color: var(--fg); }
.rail button.is-gate .t { border-radius: 50%; }

#gl, #load, #track { display: none; }

/* =========================================================
   Immersive layout
   ========================================================= */
html.gl body { background: var(--night); }
html.gl #gl { display: block; position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
html.gl #track { display: block; position: relative; z-index: 1; height: 1300vh; pointer-events: none; }
html.gl .hdr { position: fixed; left: 0; right: 0; }
html.gl.has-announce .hdr { top: 36px; }
html.gl .announce { position: fixed; top: 0; left: 0; right: 0; }
html.gl .hero { position: fixed; z-index: 5; inset: 0 0 auto 0; height: 100vh; min-height: 0; padding: 0 20px; pointer-events: none; transition: opacity .2s linear; }
html.gl .hero__chips { pointer-events: auto; }
html.gl .hint { display: flex; position: fixed; z-index: 5; left: 50%; bottom: 26px; transform: translateX(-50%); pointer-events: none; transition: opacity .2s linear; }
html.gl #cards { display: block; padding: 0; margin: 0; max-width: none; }
html.gl .card {
  position: fixed; z-index: 6; left: clamp(14px, 3vw, 40px); bottom: clamp(14px, 4vh, 40px);
  width: min(440px, calc(100vw - 28px)); max-height: calc(100vh - 110px); overflow: auto; overscroll-behavior: contain;
  opacity: 0; transform: translateY(18px) scale(.985); transform-origin: left bottom;
  transition: opacity .4s ease, transform .4s cubic-bezier(.2, .8, .2, 1); pointer-events: none;
  scrollbar-width: thin; scrollbar-color: rgba(69, 214, 201, .3) transparent;
}
html.gl .card.show { opacity: 1; transform: none; pointer-events: auto; }
html.gl .rail { display: flex; flex-direction: column; align-items: flex-end; position: fixed; z-index: 10; right: clamp(12px, 2vw, 28px); top: 50%; transform: translateY(-50%); }

html.gl #load {
  display: flex; position: fixed; inset: 0; z-index: 50; flex-direction: column; align-items: center; justify-content: center; gap: 16px;
  background: radial-gradient(90% 70% at 50% 40%, #12323c 0%, #07141a 70%); transition: opacity .8s ease, visibility .8s;
}
html.gl.ready #load { opacity: 0; visibility: hidden; pointer-events: none; }
.load__mark { border-radius: 20px; animation: breathe 1.8s ease-in-out infinite; box-shadow: 0 14px 40px rgba(69, 214, 201, .18); }
.load__txt { font-family: var(--mono); font-size: 11px; letter-spacing: .3em; color: var(--mute); }
.load__bar { width: 130px; height: 2px; border-radius: 2px; background: rgba(241, 237, 226, .1); overflow: hidden; }
.load__bar i { display: block; height: 100%; width: 40%; background: var(--water); animation: load 1.2s ease-in-out infinite; }

/* ---------- responsive ---------- */
@media (max-width: 1080px) { .tabs { display: none; } .menu-btn { display: inline-flex; } }
@media (max-width: 760px) {
  .hide-m { display: none !important; }
  .brand span { font-size: 18px; }
  html.gl .card { left: 10px; right: 10px; bottom: 10px; width: auto; max-height: 58vh; padding: 18px; }
  html.gl .rail { display: none; }
  html.gl .hero { justify-content: flex-start; padding-top: 18vh; }
  .gates { grid-template-columns: repeat(2, 1fr); }
  .dist li { grid-template-columns: 1fr 70px 40px; }
  .market dl { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 520px) { .hide-s { display: none !important; } .cta .arr { display: none; } .cta { padding: 0 15px; } }

@keyframes pulse { 50% { opacity: .45; } }
@keyframes drop { 0% { transform: scaleY(0); transform-origin: top; } 50% { transform: scaleY(1); transform-origin: top; } 51% { transform-origin: bottom; } 100% { transform: scaleY(0); transform-origin: bottom; } }
@keyframes breathe { 50% { transform: scale(1.06); } }
@keyframes load { 0% { transform: translateX(-100%); } 100% { transform: translateX(260%); } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }
