:root {
  --bg: #03121b;
  --bg-2: #020a10;
  --panel: rgba(2, 13, 20, .88);
  --panel-2: rgba(10, 30, 41, .9);
  --text: #efe9dc;
  --text-2: rgba(239, 233, 220, .70);
  --text-3: rgba(239, 233, 220, .45);
  --line: rgba(239, 233, 220, .10);
  --line-2: rgba(239, 233, 220, .22);
  --accent: #ff7a59;
  --accent-soft: rgba(255, 122, 89, .16);
  --foam: #a9c6cb;
  --foam-soft: rgba(169, 198, 203, .14);
  --radius: 6px;
  --gutter: clamp(16px, 4.5vw, 64px);
  --serif: "Young Serif", Georgia, "Times New Roman", serif;
  --sans: system-ui, -apple-system, "Segoe UI", sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { overflow-x: clip; }
html {
  scroll-behavior: smooth;
  background: linear-gradient(180deg, #072431 0, var(--bg) 60vh, var(--bg-2) 100%) var(--bg-2);
}
body {
  margin: 0;
  background: transparent;
  color: var(--text);
  font: 400 16px/1.55 var(--sans);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
h1, h2 { margin: 0; font-family: var(--serif); font-weight: 400; }

/* the 3D layer; CSS water underneath when WebGL is off */
#bg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: -1; opacity: 0; transition: opacity 1.2s ease-out; pointer-events: none; }
#bg.ready { opacity: 1; }
html.no-webgl body, html:not(.js) body {
  background:
    radial-gradient(1200px 520px at 70% -10%, rgba(120, 190, 205, .16), transparent 70%),
    linear-gradient(180deg, #082736 0, var(--bg) 70vh, var(--bg-2) 160vh);
}
.pings { position: fixed; inset: 0; z-index: 5; pointer-events: none; overflow: hidden; }
.ping-tag {
  position: absolute; left: 0; top: 0; padding: 6px 9px 5px; border-radius: 4px; white-space: nowrap;
  font: 400 13px/1 var(--serif); color: var(--text); background: rgba(2, 12, 18, .82);
  border: 1px solid var(--accent); will-change: transform, opacity;
}
.ping-tag b { font-weight: 400; color: var(--accent); }
.ping-tag.sell { border-color: var(--foam); }
.ping-tag.sell b { color: var(--foam); }
.ping-tag small { font: 400 10px/1 var(--sans); color: var(--text-3); margin-left: 6px; }

/* header */
.top {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 28px;
  height: 60px; padding: 0 var(--gutter);
  background: rgba(3, 18, 27, .96); border-bottom: 1px solid var(--line);
}
.mark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font: 400 18px/1 var(--serif); }
.nav { display: flex; gap: 26px; margin-left: auto; }
.nav a { text-decoration: none; color: var(--text-2); font: 400 14px/1 var(--serif); transition: color .18s ease-out; }
.nav a:hover { color: var(--text); }
.top-actions { display: flex; gap: 8px; }

/* buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  min-height: 48px; padding: 0 18px; border-radius: var(--radius);
  font: 400 15px/1 var(--serif); text-decoration: none; white-space: nowrap; cursor: pointer;
  transition: opacity .18s ease-out, border-color .18s ease-out, color .18s ease-out;
}
.btn-primary { background: var(--text); color: #04121a; border: 1px solid var(--text); }
.btn-primary:hover { opacity: .88; }
.btn-secondary { border: 1px solid var(--line-2); color: var(--text); }
.btn-secondary:hover { border-color: var(--text); }
.btn-icon { min-width: 48px; padding: 0; }
.btn-small { min-height: 38px; padding: 0 14px; font-size: 14px; }
.top-actions .btn-icon { min-height: 38px; min-width: 38px; }
.btn[aria-disabled="true"] { background: transparent; border: 1px solid var(--line-2); color: var(--text-2); cursor: default; opacity: 1; }
.link { color: var(--text-2); font: 13px var(--serif); align-self: center; padding: 0 4px; }

/* hero: words on the left, the whale up on the right, its log under it */
.hero {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 470px); grid-template-rows: 1fr auto;
  gap: 20px 64px;
  min-height: calc(100vh - 60px); min-height: calc(100svh - 60px);
  padding: clamp(32px, 6vh, 72px) var(--gutter) clamp(20px, 3.4vh, 36px);
}
.hero-copy { grid-column: 1; grid-row: 1 / span 2; align-self: center; max-width: 600px; }
.stage { grid-column: 2; grid-row: 1; position: relative; min-height: 180px; }
.status { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; margin: 0 0 22px; font: 400 12px/1 var(--sans); color: var(--text); }
.status .dim { color: var(--text-3); }
.led { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); flex: none; transition: background .3s ease-out; }
.led.on { background: var(--foam); box-shadow: 0 0 0 3px var(--foam-soft); }
.js .led.on { animation: breathe 2.6s ease-in-out infinite; }
.led.warn { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
@keyframes breathe { 50% { opacity: .35; } }
h1 { font-size: clamp(40px, 5.3vw, 80px); line-height: 1.02; letter-spacing: -.012em; text-wrap: balance; }
.ticker { margin: 22px 0 10px; font: 400 15px/1 var(--serif); color: var(--accent); }
.lede { margin: 0 0 24px; font-size: 17px; color: var(--text-2); max-width: 32em; }

.token { display: flex; gap: 8px; align-items: stretch; max-width: 540px; }
.ca {
  display: flex; align-items: center; gap: 10px; flex: 1; min-width: 0;
  min-height: 48px; padding: 0 14px; border: 1px solid var(--line-2); border-radius: var(--radius);
  background: rgba(2, 13, 20, .9); color: var(--text); font: inherit; cursor: pointer; text-align: left;
}
.ca:not(.is-set) { cursor: default; }
.ca-label { font: 12px var(--serif); color: var(--text-3); }
.ca-value { flex: 1; min-width: 0; font: 13px/1 var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ca-copy { font: 13px var(--serif); color: var(--text-2); }
.ca:not(.is-set) .ca-copy { display: none; }
.ca.is-copied .ca-copy { color: var(--accent); }

/* the sonar console: the live whale log */
.whale-still { display: none; position: absolute; right: 0; top: 50%; width: min(100%, 560px); transform: translateY(-50%); }
html.no-webgl .whale-still, html:not(.js) .whale-still { display: block; }
.sonar {
  grid-column: 2; grid-row: 2; align-self: end; min-width: 0;
  background: var(--panel); border: 1px solid var(--line-2); border-radius: 10px;
  box-shadow: 0 30px 70px -40px rgba(0, 0, 0, .9);
  scroll-margin-top: 80px;
}
.sonar-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 16px 12px; border-bottom: 1px solid var(--line); }
.sonar-title { margin: 0; font: 400 17px/1 var(--serif); }
.sonar-status { display: flex; align-items: center; gap: 8px; margin: 0; min-width: 0; font: 400 12px/1.2 var(--sans); color: var(--text-2); }
.sonar-status .st-text { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.threshold { display: flex; align-items: center; gap: 4px; padding: 10px 12px 10px 16px; border-bottom: 1px solid var(--line); }
.th-label { margin-right: auto; font: 400 14px/1 var(--serif); color: var(--text-2); }
.threshold button {
  min-height: 34px; min-width: 62px; padding: 0 12px; border-radius: var(--radius);
  border: 1px solid transparent; background: none; color: var(--text-2);
  font: 400 14px/1 var(--serif); cursor: pointer; transition: color .18s ease-out, border-color .18s ease-out;
}
.threshold button:hover { color: var(--text); }
.threshold button[aria-pressed="true"] { border-color: var(--line-2); background: var(--panel-2); color: var(--text); }

.log { list-style: none; margin: 0; padding: 6px 8px; height: 214px; overflow: hidden; }
.log-empty { padding: 14px 8px; font-size: 14px; color: var(--text-3); }
.log-empty::after {   /* a dim skeleton of rows while the first big orders come in */
  content: ""; display: block; height: 118px; margin-top: 16px;
  background:
    linear-gradient(90deg, rgba(239, 233, 220, .055) 0 52px, transparent 52px 66px, rgba(239, 233, 220, .055) 66px 96px, transparent 96px 112px, rgba(239, 233, 220, .075) 112px 176px, transparent 176px) 0 0 / 100% 40px repeat-y;
  -webkit-mask: linear-gradient(180deg, #000 0 14px, transparent 14px 40px) 0 0 / 100% 40px repeat-y;
          mask: linear-gradient(180deg, #000 0 14px, transparent 14px 40px) 0 0 / 100% 40px repeat-y;
  opacity: .9;
}
.row { border-radius: 5px; transition: background 1.2s ease-out; }
.row.fresh { background: var(--accent-soft); transition: none; }
.row.sell.fresh { background: var(--foam-soft); }
.row-btn {
  display: grid; grid-template-columns: 60px 38px 86px minmax(0, 1fr) minmax(0, 92px) 10px; align-items: center; gap: 8px;
  width: 100%; min-height: 40px; padding: 0 8px; border: 0; border-radius: 5px; background: none; color: var(--text);
  font: 400 13px/1 var(--sans); font-variant-numeric: tabular-nums; text-align: left; cursor: pointer;
}
.row-btn:hover { background: rgba(239, 233, 220, .04); }
.r-time { color: var(--text-3); font-size: 12px; }
.r-side { font: 400 13px/1 var(--serif); color: var(--accent); }
.row.sell .r-side { color: var(--foam); }
.r-usd { font: 400 17px/1 var(--serif); white-space: nowrap; }
.r-coin { font: 400 14px/1 var(--serif); color: var(--text-2); }
.r-px { color: var(--text-3); font-size: 12px; text-align: right; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.r-sim { margin-left: 6px; font: 400 10px/1 var(--sans); color: var(--text-3); border: 1px solid var(--line-2); border-radius: 3px; padding: 2px 4px; vertical-align: 2px; }
.r-more { width: 7px; height: 7px; border-right: 1px solid var(--text-3); border-bottom: 1px solid var(--text-3); transform: rotate(-45deg); }
.row-btn[aria-expanded="true"] .r-more { transform: rotate(45deg); }
.log-divider { padding: 9px 8px 5px; font: 400 12px/1.3 var(--sans); color: var(--text-3); }
.row.under .r-side, .row.under .r-coin, .row.under .r-usd { color: var(--text-3); }
.row.under .r-usd { font-size: 15px; }
.r-detail { margin: 0 8px 8px; padding: 9px 10px; border-left: 1px solid var(--line-2); font: 400 12.5px/1.5 var(--sans); color: var(--text-2); font-variant-numeric: tabular-nums; }
.r-detail .addr { font-family: var(--mono); font-size: 12px; color: var(--text); }
.sonar-foot { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin: 0; padding: 10px 16px; border-top: 1px solid var(--line); font: 400 12px/1.3 var(--sans); color: var(--text-3); font-variant-numeric: tabular-nums; }
.sonar-foot b { font-weight: 500; color: var(--text); }
.sonar-foot .last { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; text-align: right; }
.sonar-note { margin: 0; padding: 0 16px 12px; font-size: 12px; color: var(--text-3); }

/* scroll beats over the dive */
.dive { padding: 6vh var(--gutter) 0; }
.beat { min-height: 100vh; min-height: 100svh; display: flex; flex-direction: column; justify-content: center; max-width: min(44%, 600px); }
.kicker { margin: 0 0 14px; font: 400 14px/1 var(--serif); color: var(--accent); }
.beat-line { margin: 0; font: 400 clamp(30px, 4.4vw, 62px)/1.06 var(--serif); letter-spacing: -.012em; text-wrap: balance; text-shadow: 0 2px 24px rgba(2, 10, 16, .8); }

/* sections */
.tools, .connect { position: relative; padding: clamp(72px, 10vw, 128px) var(--gutter) 0; scroll-margin-top: 60px; }
.section-head { max-width: 580px; }
h2 { font-size: clamp(30px, 3.6vw, 50px); line-height: 1.04; letter-spacing: -.012em; margin-bottom: 16px; }
.section-head > p:not(.kicker) { margin: 0; color: var(--text-2); font-size: 16px; }

/* one continuous scrim behind the whole table, header included */
.table-wrap { margin-top: 36px; padding: 18px 22px 6px; background: rgba(2, 10, 16, .86); border: 1px solid var(--line); border-radius: 10px; }
table { width: 100%; border-collapse: collapse; }
th { text-align: left; font: 400 12px/1 var(--serif); color: var(--text-3); padding: 0 16px 12px 0; }
td { padding: 16px 16px 16px 0; border-top: 1px solid var(--line); vertical-align: top; font-size: 15px; }
td.n { font: 400 12px/1.9 var(--serif); color: var(--text-3); width: 48px; padding-left: 4px; }
td.t { font: 400 13px/1.75 var(--mono); white-space: nowrap; }
td.s { font: 400 13px/1.75 var(--serif); white-space: nowrap; color: var(--text); }
/* status marks as sonar contacts: a live contact pings, a buildable one is an empty ring */
td.s::before { content: ""; display: inline-block; width: 7px; height: 7px; border-radius: 50%; margin-right: 11px; vertical-align: 1px; background: var(--foam); box-shadow: 0 0 0 3px rgba(169, 198, 203, .18); }
.js td.s.now::before { animation: contact 2.8s ease-out infinite; }
td.s.wait { color: var(--text-3); }
td.s.wait::before { background: none; box-shadow: inset 0 0 0 1px var(--text-3), 0 0 0 3px rgba(239, 233, 220, .05); }
@keyframes contact { 0% { box-shadow: 0 0 0 0 rgba(169, 198, 203, .6); } 70%, 100% { box-shadow: 0 0 0 9px rgba(169, 198, 203, 0); } }
.kicker .depth { display: inline-flex; align-items: center; gap: 7px; margin-right: 12px; padding-right: 12px; border-right: 1px solid var(--line-2); color: var(--text-3); font-variant-numeric: tabular-nums; }
.kicker .depth::before { content: ""; width: 1px; height: 12px; background: linear-gradient(var(--text-3) 0 2px, transparent 2px 5px) 0 0 / 1px 5px; }

.connect { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 32px 56px; align-items: start; }
.rules { margin: 28px 0 0; padding: 0; list-style: none; }
.rules li { display: flex; gap: 14px; padding: 13px 0; border-top: 1px solid var(--line); font-size: 15px; }
.rules .ix { font: 400 12px var(--serif); color: var(--text-3); padding-top: 3px; }
.code-wrap { min-width: 0; background: var(--panel); border: 1px solid var(--line-2); border-radius: 8px; overflow: hidden; }
.code-head { display: flex; align-items: center; justify-content: space-between; padding: 8px 8px 8px 16px; border-bottom: 1px solid var(--line); font: 400 13px var(--serif); color: var(--text-3); }
.copy-code { min-height: 34px; padding: 0 12px; border: 1px solid var(--line-2); border-radius: var(--radius); background: none; color: var(--text); font: 400 13px var(--serif); cursor: pointer; }
.copy-code:hover { border-color: var(--text); }
.code { margin: 0; padding: 18px 20px; font: 400 12.5px/1.75 var(--mono); color: var(--text-3); overflow-x: auto; }
.code .k { color: var(--text); }
.code .v { color: var(--accent); }

.foot { padding: clamp(80px, 12vw, 140px) var(--gutter) 40px; }
.foot-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding-top: 20px; border-top: 1px solid var(--line); }
.mark-small { display: inline-flex; align-items: center; gap: 9px; font: 400 15px var(--serif); }
.foot-links { display: flex; gap: 6px; }
.foot-links a { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; min-width: 44px; padding: 0 8px; font: 400 14px var(--serif); color: var(--text-2); text-decoration: none; }
.foot-links a:hover { color: var(--text); }
.foot p { margin: 16px 0 0; font: 400 12px/1.6 var(--sans); color: var(--text-3); }

/* reveals */
.js .hero-copy > *, .js .sonar { animation: rise .8s cubic-bezier(.2, .7, .2, 1) backwards; }
.js .hero-copy > :nth-child(2) { animation-delay: .07s; }
.js .hero-copy > :nth-child(3) { animation-delay: .14s; }
.js .hero-copy > :nth-child(4) { animation-delay: .21s; }
.js .hero-copy > :nth-child(5) { animation-delay: .28s; }
.js .sonar { animation-delay: .35s; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }
.js .reveal { transform: translateY(16px); transition: transform .7s cubic-bezier(.2, .7, .2, 1); }
.js .reveal.in { transform: none; }

/* tablet */
@media (max-width: 1100px) {
  .hero { grid-template-columns: minmax(0, 1fr) minmax(0, 420px); gap: 20px 32px; }
  .connect { grid-template-columns: minmax(0, 1fr); }
}

/* phone: words, then the whale, then its log; token row becomes a dock */
@media (max-width: 760px) {
  .top { gap: 12px; height: 56px; padding-right: 10px; }
  .nav { display: none; }
  .top-actions { margin-left: auto; }
  .top-actions .btn-icon { min-height: 44px; min-width: 44px; }
  .hide-phone { display: none; }
  .hero { grid-template-columns: minmax(0, 1fr); grid-template-rows: none; min-height: 0; padding-top: 26px; gap: 0; }
  .hero-copy, .stage, .sonar { grid-column: 1; grid-row: auto; }
  .hero-copy { align-self: start; }
  .status { margin-bottom: 16px; font-size: 11px; }
  h1 { font-size: clamp(36px, 10.4vw, 48px); }
  .ticker { margin-top: 16px; }
  .lede { font-size: 15px; margin-bottom: 0; }
  .stage { height: 27vh; height: clamp(200px, 27svh, 300px); min-height: 0; }   /* the log head and first row land above the dock */
  .whale-still { top: 40%; }
  .token {
    position: fixed; z-index: 20; left: 10px; right: 10px; bottom: calc(10px + env(safe-area-inset-bottom));
    padding: 6px; gap: 6px; background: rgba(2, 12, 18, .96); border: 1px solid var(--line-2); border-radius: 10px; max-width: none;
  }
  .token .ca, .token .btn { min-height: 46px; }
  .token .btn { padding: 0 14px; }
  .token .chart { display: none; }
  body { padding-bottom: calc(78px + env(safe-area-inset-bottom)); }
  .sonar { margin-top: 0; }
  .sonar-head { flex-wrap: wrap; }
  .threshold { padding-left: 12px; }
  .th-label { font-size: 13px; }
  .threshold button { min-width: 54px; min-height: 40px; padding: 0 8px; }
  .log { height: 236px; padding: 4px 4px; }
  .row-btn { grid-template-columns: 56px 34px 78px minmax(0, 1fr) 10px; gap: 6px; min-height: 44px; }
  .r-px { display: none; }
  .r-usd { font-size: 16px; }
  .sonar-foot { flex-direction: column; align-items: flex-start; gap: 4px; }
  .sonar-foot .last { text-align: left; max-width: 100%; }
  .beat { max-width: none; justify-content: flex-start; padding-top: 14svh; }
  table, thead, tbody, tr, td, th { display: block; }
  thead { display: none; }
  .table-wrap { padding: 4px 14px; }
  tr { border-top: 1px solid var(--line); padding: 14px 0; display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 6px 12px; }
  td { border: 0; padding: 0; }
  td.n { width: auto; grid-column: 1; grid-row: 1; padding-left: 0; }
  td.t { grid-column: 2; grid-row: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
  td.s { grid-column: 3; grid-row: 1; }
  td:nth-child(3) { grid-column: 1 / -1; color: var(--text-2); font-size: 14px; }
  .code { font-size: 11px; padding: 16px; }
  .foot-row { flex-wrap: wrap; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .js .reveal { transform: none; }
}
.js tbody tr:nth-child(2) td.s::before { animation-delay: .9s; }
.js tbody tr:nth-child(3) td.s::before { animation-delay: 1.8s; }
