:root {
  --bg: #070b14;
  --bg-2: #0c1322;
  --card: #0f1828;
  --card-2: #13203a;
  --line: #1d2a44;
  --text: #e7edf8;
  --muted: #8392ad;
  --accent: #3ef0c2;
  --accent-2: #7c6cff;
  --accent-ink: #04221a;
  --glow: rgba(62, 240, 194, .14);
  --glow-2: rgba(124, 108, 255, .16);
  --radius: 18px;
}
:root[data-theme="light"] {
  --bg: #f5f7fb;
  --bg-2: #ffffff;
  --card: #ffffff;
  --card-2: #eef2f9;
  --line: #dde3ee;
  --text: #0b1322;
  --muted: #5b6880;
  --accent: #0fb38c;
  --accent-2: #5b4be0;
  --accent-ink: #ffffff;
  --glow: rgba(15, 179, 140, .12);
  --glow-2: rgba(91, 75, 224, .10);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
  font-family: "Space Grotesk", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.55;
  overflow-x: hidden;
  transition: background .3s, color .3s;
}
a { color: inherit; text-decoration: none; }
.mono { font-family: "JetBrains Mono", ui-monospace, monospace; }
.muted { color: var(--muted); }
.small { font-size: .82rem; }
.wrap { width: min(1160px, 100% - 32px); margin-inline: auto; }

/* background */
.bg { position: fixed; inset: 0; z-index: -1; pointer-events: none; overflow: hidden; }
.bg > * { position: absolute; inset: 0; }

/* slow-moving coloured light */
.aurora { filter: blur(90px); opacity: .85; }
.aurora i { position: absolute; border-radius: 50%; mix-blend-mode: screen; }
.aurora i:nth-child(1) { width: 48vw; height: 48vw; left: 48%; top: -18%; background: var(--accent); opacity: .30; animation: drift1 26s ease-in-out infinite alternate; }
.aurora i:nth-child(2) { width: 42vw; height: 42vw; left: 62%; top: 18%; background: var(--accent-2); opacity: .40; animation: drift2 32s ease-in-out infinite alternate; }
.aurora i:nth-child(3) { width: 38vw; height: 38vw; left: -10%; top: 40%; background: #2b6cff; opacity: .22; animation: drift3 38s ease-in-out infinite alternate; }
@keyframes drift1 { to { transform: translate(-14vw, 10vh) scale(1.15); } }
@keyframes drift2 { to { transform: translate(-22vw, -6vh) scale(.9); } }
@keyframes drift3 { to { transform: translate(18vw, -14vh) scale(1.2); } }

/* flowing lines (drawn in app.js) */
#waves { width: 100%; height: 100%; transition: opacity .3s linear; }

.bg-grid {
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 70% 55% at 70% 15%, #000 10%, transparent 70%);
  opacity: .35;
}

/* soft dark edges keep focus in the middle */
.vignette { background: radial-gradient(ellipse 120% 90% at 50% 30%, transparent 50%, var(--bg) 100%); }

/* film grain */
.grain {
  inset: -50%;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
  opacity: .07; mix-blend-mode: overlay;
  animation: grain 1.2s steps(4) infinite;
}
@keyframes grain { 25% { transform: translate(-3%, 2%); } 50% { transform: translate(2%, -3%); } 75% { transform: translate(-2%, -1%); } }

:root[data-theme="light"] .aurora { opacity: .35; }
:root[data-theme="light"] .aurora i { mix-blend-mode: multiply; }
:root[data-theme="light"] .grain { opacity: .05; mix-blend-mode: multiply; }

/* nav */
.nav { position: sticky; top: 0; z-index: 20; backdrop-filter: blur(14px); background: color-mix(in srgb, var(--bg) 70%, transparent); border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent); }
.nav-inner { display: flex; align-items: center; gap: 28px; height: 68px; }
.logo { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.25rem; letter-spacing: -.02em; }
.logo-mark { width: 28px; height: 28px; border-radius: 8px; background: url(logo/halcyon-mark.svg) center / contain no-repeat; box-shadow: 0 0 18px var(--glow); flex: none; }
.logo-dot { color: var(--accent); }
.nav-links { display: flex; gap: 22px; font-size: .94rem; color: var(--muted); }
.nav-links a:hover { color: var(--text); }
.nav-cta { margin-left: auto; }
.btn-sm { padding: 8px 14px; font-size: .86rem; border-radius: 10px; box-shadow: none; }
.theme-btn .i-moon { display: none; }
:root[data-theme="light"] .theme-btn .i-sun { display: none; }
:root[data-theme="light"] .theme-btn .i-moon { display: block; }
.theme-btn { background: none; border: 1px solid var(--line); color: var(--text); width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; cursor: pointer; }
.theme-btn:hover { border-color: var(--accent); }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 12px 20px; border-radius: 12px; font: inherit; font-weight: 600; font-size: .95rem; cursor: pointer; border: 1px solid transparent; transition: transform .15s, box-shadow .2s, background .2s; }
.btn:active { transform: scale(.98); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 30px -8px var(--accent); }
.btn-primary:hover { box-shadow: 0 10px 40px -6px var(--accent); }
.btn-ghost { border-color: var(--line); color: var(--text); background: color-mix(in srgb, var(--card) 70%, transparent); }
.btn-ghost:hover { border-color: var(--muted); }
.btn-block { width: 100%; }

/* hero */
.hero { display: grid; grid-template-columns: 1.05fr .95fr; gap: 56px; align-items: center; padding: 88px 0 64px; }
.pill { display: inline-flex; align-items: center; gap: 8px; font-size: .8rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); background: var(--card); }
.pulse { width: 7px; height: 7px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 0 var(--accent); animation: pulse 1.8s infinite; }
@keyframes pulse { 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
h1 { font-size: clamp(2.6rem, 6vw, 4.4rem); line-height: 1.02; letter-spacing: -.035em; margin: 22px 0 20px; font-weight: 700; }
.grad { background: linear-gradient(100deg, var(--accent), var(--accent-2)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.lead { color: var(--muted); font-size: 1.08rem; max-width: 520px; }
.cta-row { display: flex; gap: 12px; margin-top: 30px; flex-wrap: wrap; }
.hero-facts { list-style: none; display: flex; gap: 32px; margin-top: 40px; }
.hero-facts li { display: flex; flex-direction: column; }
.hero-facts strong { font-family: "JetBrains Mono", monospace; font-size: 1.6rem; color: var(--accent); }
.hero-facts span { font-size: .8rem; color: var(--muted); }

/* demo */
.demo { background: linear-gradient(180deg, var(--card), var(--bg-2)); border: 1px solid var(--line); border-radius: 22px; padding: 18px; box-shadow: 0 40px 80px -30px rgba(0,0,0,.5), 0 0 0 1px color-mix(in srgb, var(--accent) 8%, transparent); }
.demo-top { display: flex; justify-content: space-between; align-items: center; margin-bottom: 14px; }
.demo-title { font-family: "JetBrains Mono", monospace; font-size: .78rem; color: var(--muted); }
.demo-tag { font-family: "JetBrains Mono", monospace; font-size: .7rem; padding: 3px 8px; border-radius: 6px; background: var(--card-2); color: var(--muted); }
.seg { position: relative; display: grid; grid-template-columns: 1fr 1fr; background: var(--card-2); border-radius: 12px; padding: 4px; margin-bottom: 12px; }
.seg-btn { position: relative; z-index: 1; background: none; border: 0; padding: 9px; font: inherit; font-size: .86rem; font-weight: 500; color: var(--muted); cursor: pointer; transition: color .25s; }
.seg-btn.active { color: var(--text); }
.seg-ind { position: absolute; top: 4px; bottom: 4px; left: 4px; width: calc(50% - 4px); border-radius: 9px; background: var(--card); border: 1px solid var(--line); transition: transform .35s cubic-bezier(.6,.1,.2,1); }
.seg[data-side="put"] .seg-ind { transform: translateX(100%); }

.asset-row { display: flex; gap: 8px; margin-bottom: 12px; overflow: hidden; }
.asset { flex: 1; min-width: 0; padding: 10px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); transition: border-color .25s, background .25s, transform .25s; }
.asset.sel { border-color: var(--accent); background: color-mix(in srgb, var(--accent) 8%, var(--card)); transform: translateY(-2px); }
.asset b { display: block; font-size: .9rem; }
.asset small { font-family: "JetBrains Mono", monospace; font-size: .7rem; color: var(--muted); }

.fields { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-bottom: 12px; }
.field { padding: 10px; border-radius: 12px; background: var(--card-2); }
.field label { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }
.field .val { font-size: .92rem; margin-top: 2px; min-height: 1.4em; }
.val.flash { animation: flash .5s; }
@keyframes flash { from { color: var(--accent); } }

.bids { border: 1px dashed var(--line); border-radius: 12px; padding: 10px; margin-bottom: 12px; min-height: 148px; }
.bids-head, .bid { display: grid; grid-template-columns: 1.3fr 1fr .7fr; gap: 8px; font-size: .8rem; }
.bids-head { color: var(--muted); font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; padding: 0 8px 6px; }
.bid { font-family: "JetBrains Mono", monospace; padding: 7px 8px; border-radius: 8px; animation: slideIn .35s both; }
.bid.best { background: color-mix(in srgb, var(--accent) 12%, transparent); color: var(--accent); }
@keyframes slideIn { from { opacity: 0; transform: translateY(6px); } }
.demo-foot { display: flex; align-items: center; gap: 8px; margin-top: 10px; font-size: .75rem; }
.demo-foot .muted { margin-left: auto; }
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); }

/* ticker */
.logos { display: flex; align-items: center; gap: 24px; padding: 18px 0 40px; border-top: 1px solid var(--line); }
.ticker { overflow: hidden; flex: 1; mask-image: linear-gradient(90deg, transparent, #000 10%, #000 90%, transparent); }
.ticker-track { display: flex; gap: 48px; width: max-content; animation: scroll 30s linear infinite; font-family: "JetBrains Mono", monospace; color: var(--muted); font-size: .95rem; }
@keyframes scroll { to { transform: translateX(-50%); } }

/* how */
.how { padding: 72px 0 40px; }
h2 { font-size: clamp(1.8rem, 3.6vw, 2.6rem); letter-spacing: -.03em; line-height: 1.1; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; margin-top: 36px; }
.step { padding: 26px; border-radius: var(--radius); background: var(--card); border: 1px solid var(--line); position: relative; overflow: hidden; }
.step::after { content: ""; position: absolute; inset: auto -40% -60% auto; width: 200px; height: 200px; border-radius: 50%; background: var(--glow); filter: blur(30px); }
.step-n { color: var(--accent); font-size: .85rem; }
.step h3 { margin: 14px 0 8px; font-size: 1.2rem; }
.step p { color: var(--muted); font-size: .94rem; }

.features { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px; background: var(--line); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; margin: 24px auto 96px; }
.feat { background: var(--bg-2); padding: 24px; }
.feat h3 { font-size: 1rem; margin-bottom: 6px; }
.feat p { color: var(--muted); font-size: .88rem; }

/* waitlist */
.waitlist { padding-bottom: 96px; }
.wl-card { position: relative; overflow: hidden; text-align: center; padding: 72px 24px; border-radius: 26px; border: 1px solid color-mix(in srgb, var(--accent) 30%, var(--line)); background: radial-gradient(ellipse at 50% 0%, var(--glow-2), transparent 60%), radial-gradient(ellipse at 50% 100%, var(--glow), transparent 60%), var(--card); }
.rings { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.rings span { position: absolute; border: 1px solid color-mix(in srgb, var(--accent) 18%, transparent); border-radius: 50%; width: 200px; height: 200px; animation: ring 6s linear infinite; }
.rings span:nth-child(2) { animation-delay: 2s; }
.rings span:nth-child(3) { animation-delay: 4s; }
@keyframes ring { from { transform: scale(.5); opacity: 1; } to { transform: scale(4); opacity: 0; } }
.wl-card > *:not(.rings) { position: relative; }
.wl-form { display: flex; gap: 8px; max-width: 440px; margin: 28px auto 10px; }
.wl-form input { flex: 1; min-width: 0; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--bg-2); color: var(--text); font: inherit; }
.wl-form input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.wl-msg { min-height: 1.4em; color: var(--accent); font-size: .9rem; margin-bottom: 8px; }
.link { display: inline-block; font-weight: 600; margin-bottom: 18px; }
.link:hover { color: var(--accent); }

/* footer */
.foot { border-top: 1px solid var(--line); padding: 28px 0; }
.foot-inner { display: flex; justify-content: space-between; align-items: center; gap: 16px; flex-wrap: wrap; }
.foot-links { display: flex; align-items: center; gap: 20px; color: var(--muted); font-size: .9rem; }
.foot-links a:hover { color: var(--text); }

/* accessibility helpers */
.skip { position: absolute; left: 16px; top: -60px; z-index: 50; background: var(--accent); color: var(--accent-ink); padding: 8px 14px; border-radius: 8px; font-weight: 600; }
.skip:focus { top: 12px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.hp { position: absolute; left: -9999px; }
a:focus-visible, button:focus-visible, summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
.btn[disabled] { opacity: .6; cursor: progress; }

/* section labels */
.eyebrow { display: inline-block; font-family: "JetBrains Mono", monospace; font-size: .75rem; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); margin-bottom: 12px; }

/* demo extras */
.demo-dots { display: flex; gap: 6px; }
.demo-dots i { width: 9px; height: 9px; border-radius: 50%; background: var(--line); }
.demo-dots i:first-child { background: #ff6b81; } .demo-dots i:nth-child(2) { background: #ffc35a; } .demo-dots i:nth-child(3) { background: var(--accent); }
.demo-top { gap: 12px; } .demo-title { margin-right: auto; }
.demo-btn { text-align: center; padding: 12px; border-radius: 12px; font-weight: 600; font-size: .92rem; background: var(--accent); color: var(--accent-ink); transition: background .3s; }
.field .lbl { display: block; font-size: .68rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted); }

/* asset badges */
.coin { flex: none; display: inline-grid; place-items: center; width: 28px; height: 28px; border-radius: 50%; background: var(--c); color: #fff; font-weight: 700; font-size: .9rem; line-height: 1; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.coin { position: relative; overflow: hidden; }
.coin img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; border-radius: 50%; opacity: 0; transition: opacity .2s; }
.coin.has-img { background: transparent; box-shadow: none; color: transparent; }
.coin.has-img img { opacity: 1; }
.asset { display: flex; align-items: center; gap: 10px; }
.asset > div { min-width: 0; }
.tk { display: inline-flex; align-items: center; gap: 10px; }
.tk .coin { width: 22px; height: 22px; font-size: .72rem; }
.tk b { color: var(--text); font-weight: 500; }
.tk em, .asset em { font-style: normal; font-size: .85em; }
.up { color: var(--accent); }
.down { color: #ff7a8a; }

/* example */
.example { padding: 32px 0 24px; }
.ex-card { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; padding: 40px; border-radius: 24px; background: linear-gradient(135deg, var(--card), var(--bg-2)); border: 1px solid var(--line); }
.ex-intro h2 { margin-bottom: 14px; }
.hl { color: var(--accent); }
.ex-outcomes { display: grid; gap: 12px; align-content: center; }
.outcome { padding: 20px; border-radius: 16px; background: var(--card-2); border: 1px solid var(--line); }
.outcome p { color: var(--muted); font-size: .94rem; margin-top: 10px; }
.outcome em { color: var(--text); font-style: normal; font-weight: 600; }
.tag { display: inline-block; font-family: "JetBrains Mono", monospace; font-size: .75rem; padding: 4px 10px; border-radius: 999px; }
.tag-ok { background: color-mix(in srgb, var(--accent) 15%, transparent); color: var(--accent); }
.tag-alt { background: color-mix(in srgb, var(--accent-2) 18%, transparent); color: var(--accent-2); }
.ex-note { grid-column: 1 / -1; }

/* feature icons */
.ico { width: 26px; height: 26px; color: var(--accent); margin-bottom: 14px; }

/* faq */
.faq { padding: 24px 0 96px; max-width: 820px; }
.faq h2 { margin-bottom: 28px; }
.faq-list { display: grid; gap: 10px; }
.faq details { border: 1px solid var(--line); border-radius: 14px; background: var(--card); transition: border-color .2s; }
.faq details[open] { border-color: color-mix(in srgb, var(--accent) 40%, var(--line)); }
.faq summary { list-style: none; cursor: pointer; padding: 18px 20px; font-weight: 600; display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-family: "JetBrains Mono", monospace; color: var(--accent); font-size: 1.2rem; transition: transform .2s; }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq details p { padding: 0 20px 18px; color: var(--muted); }

/* waitlist extras */
.wl-sub { margin-top: 12px; }
.wl-msg.err { color: #ff7a8a; }
.wl-msg.info { color: #ffc35a; }
:root[data-theme="light"] .wl-msg.info { color: #a86a00; }

/* scroll reveal */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity .6s ease-out, transform .6s ease-out; }
.js .reveal.in { opacity: 1; transform: none; }

/* light-mode tuning */
:root[data-theme="light"] .demo { box-shadow: 0 30px 60px -30px rgba(20,30,60,.25); }
:root[data-theme="light"] .bg-grid { opacity: .7; }

/* responsive */
@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; padding-top: 48px; gap: 40px; }
  .steps { grid-template-columns: 1fr; }
  .features { grid-template-columns: 1fr 1fr; }
  .ex-card { grid-template-columns: 1fr; padding: 28px; gap: 24px; }
}
@media (max-width: 560px) {
  .nav-links { display: none; }
  .nav-inner { gap: 12px; }
  .ex-card { padding: 22px; }
  .features { grid-template-columns: 1fr; }
  .wl-form { flex-direction: column; }
  .hero-facts { gap: 22px; }
  .fields { grid-template-columns: 1fr 1fr 1fr; }
  .asset small { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
