:root {
    --bg: #02030a;
    --text: #eef2ff;
    --text-2: #9aa4c4;
    --cyan: #4cc9ff;
    --violet: #9b6bff;
    --magenta: #ff5fd2;
    --mint: #3dffb5;
    --amber: #ffd166;
    --card: rgba(14, 18, 38, 0.55);
    --line: rgba(120, 150, 255, 0.16);
    --radius: 22px;
    --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    --mono: ui-monospace, "SF Mono", SFMono-Regular, Menlo, Consolas, monospace;
    --max: 1120px;
    --grad: linear-gradient(100deg, var(--cyan), var(--violet) 55%, var(--magenta));
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }
body {
    background: var(--bg);
    color: var(--text);
    font-family: var(--font);
    line-height: 1.55;
    -webkit-font-smoothing: antialiased;
    overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
section { scroll-margin-top: 56px; position: relative; }
main, .site-footer { position: relative; z-index: 2; }

.container { max-width: var(--max); margin: 0 auto; padding: 0 24px; }
.narrow { max-width: 760px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* Ambient layers */
#space { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; }
.scanlines {
    position: fixed; inset: 0; z-index: 1; pointer-events: none; opacity: 0.35;
    background: repeating-linear-gradient(to bottom, transparent 0 3px, rgba(120, 150, 255, 0.035) 3px 4px);
}
.cursor-glow {
    position: fixed; left: 0; top: 0; width: 520px; height: 520px; z-index: 1; pointer-events: none;
    margin: -260px 0 0 -260px; border-radius: 50%; opacity: 0;
    background: radial-gradient(closest-side, rgba(76, 201, 255, 0.14), rgba(155, 107, 255, 0.07) 50%, transparent 75%);
    transition: opacity 0.4s ease;
}
.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 30; }
.progress span { display: block; height: 100%; width: 100%; background: var(--grad); transform-origin: 0 50%; transform: scaleX(0); box-shadow: 0 0 12px var(--cyan); }

/* Nav */
.site-nav {
    position: fixed; top: 0; left: 0; right: 0; z-index: 20;
    background: rgba(2, 3, 10, 0.6);
    -webkit-backdrop-filter: saturate(160%) blur(18px);
    backdrop-filter: saturate(160%) blur(18px);
    border-bottom: 1px solid var(--line);
}
.nav-inner { max-width: var(--max); margin: 0 auto; padding: 0 24px; height: 54px; display: flex; align-items: center; justify-content: space-between; }
.nav-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: 0.02em; }
.nav-brand img { filter: drop-shadow(0 0 8px rgba(76, 201, 255, 0.6)); }
.nav-links { display: flex; align-items: center; gap: 26px; list-style: none; font-size: 13px; color: var(--text-2); font-family: var(--mono); letter-spacing: 0.04em; }
.nav-links a { transition: color 0.2s ease, text-shadow 0.2s ease; }
.nav-links a:hover { color: var(--cyan); text-shadow: 0 0 12px rgba(76, 201, 255, 0.7); }
.nav-cta { border: 1px solid rgba(76, 201, 255, 0.5); color: var(--cyan) !important; padding: 5px 14px; border-radius: 980px; }
.nav-cta:hover { background: rgba(76, 201, 255, 0.12); }

/* HUD tag */
.hud { font-family: var(--mono); font-size: 13px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--cyan); margin-bottom: 18px; display: inline-flex; align-items: center; gap: 12px; }
.hud::before { content: ""; width: 28px; height: 1px; background: var(--cyan); box-shadow: 0 0 8px var(--cyan); }

/* Hero */
.hero { min-height: 100vh; min-height: 100svh; display: grid; place-items: center; text-align: center; padding: 120px 0 90px; overflow: hidden; }
.hero-inner { position: relative; z-index: 2; }
.hero .hud { justify-content: center; }
h1 { font-size: clamp(46px, 9vw, 110px); line-height: 1.02; letter-spacing: -0.035em; font-weight: 800; }
.hero-title .line { display: block; }
.word { display: inline-block; opacity: 0; transform: translateY(40px) scale(0.96); filter: blur(14px); animation: wordIn 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) forwards; animation-delay: calc(0.25s + var(--i) * 0.12s); }
.grad { background: var(--grad); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; -webkit-text-fill-color: transparent; animation: shift 6s linear infinite; }
.word.grad { animation: wordIn 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) forwards, shift 6s linear infinite; animation-delay: calc(0.25s + var(--i) * 0.12s), 0s; }
.lede { max-width: 620px; margin: 30px auto 0; font-size: clamp(18px, 2.3vw, 22px); color: var(--text-2); }
.cta-row { display: flex; gap: 16px; align-items: center; justify-content: center; margin-top: 38px; flex-wrap: wrap; }

.portal { position: absolute; left: 50%; top: 50%; width: min(120vw, 900px); aspect-ratio: 1; transform: translate(-50%, -50%); pointer-events: none; z-index: 1; }
.ring { position: absolute; inset: 0; border-radius: 50%; border: 1px solid rgba(76, 201, 255, 0.18); }
.ring-1 { animation: spin 38s linear infinite; border-style: dashed; }
.ring-2 { inset: 12%; border-color: rgba(155, 107, 255, 0.25); animation: spin 26s linear infinite reverse; }
.ring-3 { inset: 26%; border-color: rgba(255, 95, 210, 0.22); border-style: dotted; animation: spin 18s linear infinite; }
.ring::after { content: ""; position: absolute; top: -4px; left: 50%; width: 8px; height: 8px; margin-left: -4px; border-radius: 50%; background: var(--cyan); box-shadow: 0 0 14px 3px var(--cyan); }
.ring-2::after { background: var(--violet); box-shadow: 0 0 14px 3px var(--violet); }
.ring-3::after { background: var(--magenta); box-shadow: 0 0 14px 3px var(--magenta); }
.core { position: absolute; inset: 38%; border-radius: 50%; background: radial-gradient(closest-side, rgba(76, 201, 255, 0.32), rgba(155, 107, 255, 0.14) 55%, transparent 75%); filter: blur(6px); animation: pulse 5s ease-in-out infinite; }

.scroll-cue { position: absolute; bottom: 28px; left: 50%; width: 22px; height: 36px; margin-left: -11px; border: 1.5px solid rgba(154, 164, 196, 0.6); border-radius: 12px; z-index: 2; }
.scroll-cue span { position: absolute; left: 50%; top: 7px; width: 3px; height: 7px; margin-left: -1.5px; border-radius: 2px; background: var(--cyan); animation: cue 1.8s ease-in-out infinite; }

/* Buttons */
.btn { position: relative; display: inline-block; padding: 13px 28px; border-radius: 980px; font-size: 16px; font-weight: 600; overflow: hidden; transition: transform 0.2s ease, box-shadow 0.3s ease; }
.btn:hover { transform: translateY(-2px); }
.btn-primary { background: var(--grad); background-size: 160% 100%; color: #02030a; box-shadow: 0 0 0 rgba(76, 201, 255, 0); }
.btn-primary:hover { box-shadow: 0 6px 36px rgba(76, 201, 255, 0.45); animation: shift 3s linear infinite; }
.btn-ghost { border: 1px solid rgba(155, 107, 255, 0.55); color: var(--text); }
.btn-ghost:hover { background: rgba(155, 107, 255, 0.14); box-shadow: 0 0 28px rgba(155, 107, 255, 0.3); }
.btn::after { content: ""; position: absolute; top: 0; bottom: 0; width: 40%; left: -60%; background: linear-gradient(100deg, transparent, rgba(255, 255, 255, 0.35), transparent); transform: skewX(-20deg); }
.btn:hover::after { animation: sweep 0.8s ease; }
.link-arrow { color: var(--cyan); font-size: 17px; display: inline-block; }
.link-arrow::after { content: " \203A"; display: inline-block; transition: transform 0.2s ease; }
.link-arrow:hover::after { transform: translateX(5px); }

/* Marquee */
.marquee { position: relative; z-index: 2; overflow: hidden; border-block: 1px solid var(--line); background: rgba(6, 9, 22, 0.55); -webkit-mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); mask-image: linear-gradient(90deg, transparent, #000 12%, #000 88%, transparent); }
.marquee-track { display: flex; width: max-content; animation: marquee 36s linear infinite; }
.marquee-track span { font-family: var(--mono); font-size: 13px; letter-spacing: 0.2em; text-transform: uppercase; color: var(--text-2); padding: 18px 28px; white-space: nowrap; }
.marquee-track span::after { content: "\2726"; margin-left: 56px; color: var(--violet); }

/* Sections */
.section { padding: 130px 0; }
h2 { font-size: clamp(34px, 5.4vw, 64px); line-height: 1.06; letter-spacing: -0.028em; font-weight: 800; }
.section-sub { color: var(--text-2); font-size: clamp(17px, 2vw, 21px); margin-top: 16px; max-width: 640px; }

.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); gap: 20px; margin-top: 56px; }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); }

.card {
    position: relative; overflow: hidden; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
    padding: 32px; display: flex; flex-direction: column; align-items: flex-start; gap: 12px;
    -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
}
.card::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: 0; transition: opacity 0.3s ease;
    background: radial-gradient(360px circle at var(--mx, 50%) var(--my, 50%), rgba(76, 201, 255, 0.16), transparent 60%);
}
.card:hover { border-color: rgba(76, 201, 255, 0.45); box-shadow: 0 0 40px rgba(76, 201, 255, 0.1), inset 0 0 40px rgba(155, 107, 255, 0.05); }
.card:hover::before { opacity: 1; }
.card > * { position: relative; }
.card h3 { font-size: 26px; letter-spacing: -0.01em; }
.card p { color: var(--text-2); font-size: 16.5px; }
.card-link { color: var(--cyan); margin-top: auto; padding-top: 8px; }
.card-link::after { content: " \203A"; display: inline-block; transition: transform 0.2s ease; }
.card:hover .card-link::after { transform: translateX(5px); }
.card-links { display: flex; gap: 18px; margin-top: auto; padding-top: 8px; }
.card-links a { color: var(--cyan); font-size: 15px; }
.card-links a:hover { text-decoration: underline; }

.pillar-icon { width: 64px; height: 64px; color: var(--cyan); filter: drop-shadow(0 0 10px rgba(76, 201, 255, 0.55)); }
.pillars .card:nth-child(2) .pillar-icon { color: var(--violet); filter: drop-shadow(0 0 10px rgba(155, 107, 255, 0.6)); }
.pillars .card:nth-child(3) .pillar-icon { color: var(--magenta); filter: drop-shadow(0 0 10px rgba(255, 95, 210, 0.55)); }
.pillar-icon path, .pillar-icon circle, .pillar-icon ellipse { stroke-dasharray: 1; stroke-dashoffset: 1; }
.card.in .pillar-icon path, .card.in .pillar-icon circle, .card.in .pillar-icon ellipse { animation: draw 1.6s 0.3s ease forwards; }

.app-icon { width: 72px; height: 72px; border-radius: 17px; box-shadow: 0 0 0 1px var(--line), 0 8px 30px rgba(76, 201, 255, 0.15); }
.app-glyph { width: 72px; height: 72px; border-radius: 17px; display: grid; place-items: center; font-size: 34px; font-weight: 800; font-family: var(--mono); color: var(--cyan); background: linear-gradient(135deg, rgba(76, 201, 255, 0.14), rgba(155, 107, 255, 0.14)); border: 1px solid var(--line); }

.pill { font-family: var(--mono); font-size: 11px; letter-spacing: 0.08em; text-transform: uppercase; padding: 4px 11px; border-radius: 980px; border: 1px solid var(--line); color: var(--text-2); }
.pill-live { color: var(--mint); border-color: rgba(61, 255, 181, 0.45); }
.pill-live::before { content: ""; display: inline-block; width: 6px; height: 6px; margin-right: 7px; border-radius: 50%; background: var(--mint); box-shadow: 0 0 8px var(--mint); animation: pulse 1.8s ease-in-out infinite; }
.pill-wip { color: var(--amber); border-color: rgba(255, 209, 102, 0.45); }
.pill-soon { color: var(--cyan); border-color: rgba(76, 201, 255, 0.45); }

.tags { display: flex; gap: 8px; flex-wrap: wrap; }
.tags span { font-size: 13px; color: var(--text-2); background: rgba(120, 150, 255, 0.08); padding: 4px 12px; border-radius: 980px; }

/* Flow */
.flow { list-style: none; position: relative; display: grid; grid-template-columns: repeat(4, 1fr); gap: 24px; margin-top: 64px; }
.flow::before { content: ""; position: absolute; left: 0; right: 0; top: 19px; height: 2px; background: var(--grad); transform-origin: 0 50%; transform: scaleX(0); transition: transform 1.8s cubic-bezier(0.2, 0.8, 0.2, 1); box-shadow: 0 0 14px rgba(76, 201, 255, 0.6); }
.flow.in::before { transform: scaleX(1); }
.step { position: relative; padding-top: 52px; }
.step-n { position: absolute; top: 0; left: 0; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%; font-family: var(--mono); font-size: 13px; color: var(--cyan); background: var(--bg); border: 1px solid rgba(76, 201, 255, 0.6); box-shadow: 0 0 18px rgba(76, 201, 255, 0.35); }
.step h3 { font-size: 22px; margin-bottom: 6px; }
.step p { color: var(--text-2); font-size: 16px; }

.about { font-size: clamp(20px, 2.6vw, 26px); line-height: 1.5; color: var(--text-2); margin: 30px 0; }

/* Footer */
.site-footer { text-align: center; padding: 130px 0 48px; border-top: 1px solid var(--line); background: linear-gradient(to bottom, transparent, rgba(76, 201, 255, 0.05)); }
.site-footer .hud { justify-content: center; }
.legal { margin-top: 90px; font-family: var(--mono); font-size: 12px; letter-spacing: 0.1em; color: var(--text-2); }

/* Reveal */
.reveal { opacity: 0; transform: translateY(34px); filter: blur(6px); transition: opacity 0.9s ease var(--d, 0s), transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) var(--d, 0s), filter 0.9s ease var(--d, 0s); }
.reveal.in { opacity: 1; transform: none; filter: none; }
.card.reveal { transform: translateY(34px) perspective(900px); }
.card.reveal.in { transform: perspective(900px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); transition: opacity 0.9s ease var(--d, 0s), filter 0.9s ease var(--d, 0s), transform 0.9s cubic-bezier(0.2, 0.8, 0.2, 1) var(--d, 0s), border-color 0.3s ease, box-shadow 0.3s ease; }
.card.reveal.in.tilting { transition: border-color 0.3s ease, box-shadow 0.3s ease, transform 0.08s linear; }

/* Keyframes */
@keyframes wordIn { to { opacity: 1; transform: none; filter: none; } }
@keyframes shift { to { background-position: 200% 0; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes pulse { 0%, 100% { opacity: 0.55; transform: scale(0.94); } 50% { opacity: 1; transform: scale(1.06); } }
@keyframes cue { 0% { opacity: 0; transform: translateY(0); } 30% { opacity: 1; } 100% { opacity: 0; transform: translateY(14px); } }
@keyframes marquee { to { transform: translateX(-50%); } }
@keyframes sweep { to { left: 130%; } }
@keyframes draw { to { stroke-dashoffset: 0; } }

@media (max-width: 860px) {
    .flow { grid-template-columns: 1fr; gap: 36px; padding-left: 4px; }
    .flow::before { left: 19px; right: auto; top: 0; bottom: 0; width: 2px; height: auto; transform: scaleY(0); transform-origin: 50% 0; }
    .flow.in::before { transform: scaleY(1); }
    .step { padding: 0 0 0 64px; }
    .section { padding: 90px 0; }
}
@media (max-width: 640px) {
    .nav-links { gap: 14px; }
    .nav-links li:nth-child(n+2):not(:last-child) { display: none; }
    .hero { padding: 110px 0 80px; }
    .cursor-glow { display: none; }
}
@media (hover: none) {
    .cursor-glow { display: none; }
    .card { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    *, *::before, *::after { animation-duration: 0.001s !important; animation-iteration-count: 1 !important; transition-duration: 0.001s !important; }
    .reveal, .word { opacity: 1; transform: none; filter: none; }
    .marquee-track { animation: none; }
    .pillar-icon path, .pillar-icon circle, .pillar-icon ellipse { stroke-dashoffset: 0; }
    .flow::before { transform: none; }
}
