:root {
    --bg: #080b12;
    --surface: #0e1420;
    --text: #e8eef7;
    --muted: #7f8a9a;
    --dim: #4d5868;
    --line: rgba(255,255,255,.085);
    --primary: #7378ff;
    --primary-bright: #9a9eff;
    --cyan: #38bdf8;
    --green: #58d68d;
    --pointer-x: 50vw;
    --pointer-y: 45vh;
    --network-x: 0px;
    --network-y: 0px;
}

* { box-sizing: border-box; }
html { color-scheme: dark; background: var(--bg); }
body {
    min-width: 300px;
    min-height: 100vh;
    min-height: 100svh;
    margin: 0;
    overflow-x: hidden;
    color: var(--text);
    background: var(--bg);
    font-family: Inter, ui-sans-serif, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
    -webkit-font-smoothing: antialiased;
}
a, button { -webkit-tap-highlight-color: transparent; }
a:focus-visible { outline: 2px solid var(--primary-bright); outline-offset: 5px; }

.ambient { position: fixed; z-index: 0; inset: 0; overflow: hidden; pointer-events: none; }
.ambient::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 52% 46%, rgba(79,70,229,.11), transparent 26%),
        radial-gradient(circle at 92% 12%, rgba(56,189,248,.055), transparent 25%),
        linear-gradient(145deg, #080b12 0%, #0a0f19 52%, #080b12 100%);
}
.ambient::after {
    content: "";
    position: absolute;
    inset: 0;
    opacity: .18;
    background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 180 180' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='.18'/%3E%3C/svg%3E");
    mix-blend-mode: soft-light;
}
.pointer-glow {
    position: absolute;
    width: 640px;
    height: 640px;
    left: calc(var(--pointer-x) - 320px);
    top: calc(var(--pointer-y) - 320px);
    opacity: 0;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(115,120,255,.105), rgba(56,189,248,.035) 35%, transparent 70%);
    transition: opacity 500ms ease;
}
.pointer-active .pointer-glow { opacity: 1; }
.grid {
    position: absolute;
    inset: -25%;
    opacity: .32;
    background-image:
        linear-gradient(var(--line) 1px, transparent 1px),
        linear-gradient(90deg, var(--line) 1px, transparent 1px);
    background-size: 72px 72px;
    mask-image: radial-gradient(ellipse at center, #000 0%, rgba(0,0,0,.6) 37%, transparent 72%);
    transform: perspective(700px) rotateX(62deg) translateY(23%) scale(1.25);
    transform-origin: center center;
}
.scanline {
    position: absolute;
    left: 0;
    right: 0;
    top: -15%;
    height: 1px;
    opacity: .22;
    background: linear-gradient(90deg, transparent, var(--cyan), var(--primary), transparent);
    box-shadow: 0 0 28px rgba(115,120,255,.32);
    animation: scan 11s linear infinite;
}
@keyframes scan { to { transform: translateY(130vh); } }

.network {
    position: absolute;
    inset: -4%;
    width: 108%;
    height: 108%;
    overflow: visible;
    opacity: .42;
    transform: translate3d(var(--network-x), var(--network-y), 0);
    transition: transform 850ms cubic-bezier(.16,1,.3,1);
}
.network-lines { fill: none; stroke: rgba(143,157,185,.17); stroke-width: 1; stroke-dasharray: 3 9; }
.network-nodes { fill: #7378ff; }
.network-nodes circle { filter: drop-shadow(0 0 6px rgba(115,120,255,.72)); animation: node-flicker 6s ease-in-out infinite alternate; }
.network-nodes circle:nth-child(3n) { fill: #38bdf8; animation-delay: -2s; }
.network-nodes circle:nth-child(2n) { animation-delay: -4s; }
@keyframes node-flicker { 0%,35% { opacity: .3; } 70%,100% { opacity: .9; } }

.core { position: absolute; left: 50%; top: 49%; width: 12px; height: 12px; transform: translate(-50%,-50%); opacity: .78; }
.core-dot { position: absolute; inset: 3px; border-radius: 50%; background: #d9dcff; box-shadow: 0 0 14px 3px rgba(115,120,255,.8); }
.core-ring { position: absolute; left: 50%; top: 50%; border: 1px solid rgba(115,120,255,.42); border-radius: 50%; transform: translate(-50%,-50%); }
.core-ring-one { width: 56px; height: 56px; animation: breathe 6s ease-in-out infinite; }
.core-ring-two { width: 112px; height: 112px; border-color: rgba(56,189,248,.16); animation: breathe 6s 1s ease-in-out infinite reverse; }
@keyframes breathe { 0%,100% { opacity: .25; transform: translate(-50%,-50%) scale(.82); } 50% { opacity: .8; transform: translate(-50%,-50%) scale(1.12); } }

.page-shell { position: relative; z-index: 10; min-height: 100vh; min-height: 100svh; padding: 0 clamp(24px,5vw,78px); display: grid; grid-template-rows: 92px 1fr 72px; }
.masthead { display: flex; align-items: center; justify-content: space-between; border-bottom: 1px solid var(--line); }
.brand { display: inline-flex; align-items: center; gap: 12px; color: var(--text); text-decoration: none; }
.brand-mark { width: 38px; height: 38px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px; padding-left: .12em; border: 1px solid rgba(115,120,255,.48); background: rgba(115,120,255,.07); color: var(--text); font: 700 7px/.82 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .12em; }
.brand-mark span { color: var(--text); }
.brand-mark span:nth-child(2) { color: var(--primary-bright); }
.brand-copy { display: grid; gap: 3px; }
.brand-copy strong { font-size: 12px; letter-spacing: .17em; }
.brand-copy small { color: var(--muted); font: 500 8px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .19em; }
.node-status { display: inline-flex; align-items: center; gap: 8px; color: #9aa5b5; font: 600 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .13em; }
.status-light { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 12px rgba(88,214,141,.8); animation: status-pulse 3s ease-in-out infinite; }
@keyframes status-pulse { 50% { opacity: .55; box-shadow: 0 0 5px rgba(88,214,141,.45); } }

.hero { align-self: center; width: min(780px,83vw); padding: 54px 0 48px clamp(0px,7vw,105px); }
.terminal-line { margin-bottom: clamp(35px,6vh,72px); display: flex; align-items: center; gap: 10px; color: var(--dim); font: 500 11px/1.4 ui-monospace, SFMono-Regular, Consolas, monospace; }
.terminal-prompt { color: var(--cyan); }
.terminal-command { color: #768194; }
.terminal-cursor { width: 7px; height: 13px; background: var(--primary); animation: cursor 1.1s steps(1) infinite; }
@keyframes cursor { 50% { opacity: 0; } }
.eyebrow { margin: 0 0 18px; color: #8b96a7; font: 600 10px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .22em; }
.eyebrow span { margin-right: 12px; color: var(--primary-bright); }
.hero h1 { margin: 0; color: var(--text); font-size: clamp(64px,10.5vw,152px); font-weight: 720; line-height: .79; letter-spacing: -.075em; }
.hero h1 span { color: transparent; -webkit-text-stroke: 1px rgba(185,193,255,.7); text-shadow: 0 0 38px rgba(115,120,255,.11); }
.intro { margin: clamp(35px,5vh,58px) 0 0; max-width: 490px; color: #9ba6b6; font-size: clamp(15px,1.5vw,18px); line-height: 1.9; letter-spacing: .025em; }
.hero-actions { margin-top: 34px; display: flex; align-items: center; gap: 18px; }
.workspace-link { min-height: 44px; padding: 10px 16px; display: inline-flex; align-items: center; gap: 20px; color: #f2f3ff; background: rgba(115,120,255,.12); border: 1px solid rgba(137,142,255,.48); text-decoration: none; font: 650 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .13em; transition: color 180ms ease, background 180ms ease, border-color 180ms ease, transform 180ms ease; }
.workspace-link svg { width: 16px; height: 16px; transition: transform 180ms ease; }
.workspace-link:hover { color: #fff; background: rgba(115,120,255,.24); border-color: rgba(166,170,255,.8); transform: translateY(-1px); }
.workspace-link:hover svg { transform: translateX(3px); }
.access-note { color: var(--dim); font: 500 8px/1.3 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .14em; }
.node-metrics { margin: clamp(45px,7vh,78px) 0 0; display: flex; gap: clamp(28px,5vw,74px); }
.node-metrics div { display: grid; gap: 8px; }
.node-metrics dt { color: var(--dim); font: 500 8px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .2em; }
.node-metrics dd { margin: 0; color: #aab4c3; font: 600 10px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .12em; }

.footer { display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; border-top: 1px solid var(--line); color: var(--dim); font: 500 8px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .17em; }
.footer span:last-child { text-align: right; }
.footer-coordinates { color: #6d7888; }
.edge-label { position: fixed; z-index: 11; top: 50%; color: rgba(127,138,154,.48); font: 500 8px/1 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .21em; pointer-events: none; }
.edge-label-left { left: 15px; transform: translate(-50%,-50%) rotate(-90deg); }
.edge-label-right { right: 15px; transform: translate(50%,-50%) rotate(90deg); }

.boot-screen { display: none; }
.js .boot-screen { position: fixed; z-index: 2000; inset: 0; display: grid; place-items: center; background: var(--bg); transition: opacity 500ms ease, visibility 500ms ease; }
.js .boot-terminal { width: min(430px,calc(100vw - 42px)); display: grid; gap: 13px; }
.js .boot-line { color: #677285; font: 500 10px/1.5 ui-monospace, SFMono-Regular, Consolas, monospace; letter-spacing: .1em; opacity: 0; transform: translateY(4px); transition: opacity 240ms ease, transform 240ms ease; }
.js .boot-line span { display: inline-block; width: 34px; color: #343d4d; }
.js .boot-line strong { color: var(--green); font-weight: 600; }
.js .boot-line.active { opacity: 1; transform: none; }
.js .boot-screen.finished { opacity: 0; visibility: hidden; }
.js .page-shell, .js .edge-label { opacity: 0; }
.js .page-ready .page-shell, .js .page-ready .edge-label { opacity: 1; transition: opacity 700ms ease; }
.js .page-ready .hero > * { animation: enter 700ms both cubic-bezier(.16,1,.3,1); }
.js .page-ready .hero > :nth-child(2) { animation-delay: 70ms; }
.js .page-ready .hero > :nth-child(3) { animation-delay: 120ms; }
.js .page-ready .hero > :nth-child(4) { animation-delay: 180ms; }
.js .page-ready .hero > :nth-child(5) { animation-delay: 230ms; }
.js .page-ready .hero > :nth-child(6) { animation-delay: 280ms; }
@keyframes enter { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }

@media (max-width: 760px) {
    .page-shell { padding: 0 20px; grid-template-rows: 74px 1fr 58px; }
    .brand-copy { display: none; }
    .brand-mark { width: 34px; height: 34px; }
    .node-status { font-size: 9px; }
    .hero { width: 100%; padding: 38px 0 35px; }
    .terminal-line { margin-bottom: 52px; font-size: 10px; }
    .eyebrow { max-width: 280px; font-size: 8px; line-height: 1.7; }
    .hero h1 { font-size: clamp(60px,22vw,105px); }
    .intro { margin-top: 38px; font-size: 15px; }
    .hero-actions { align-items: flex-start; flex-direction: column; gap: 10px; }
    .workspace-link { min-height: 46px; }
    .node-metrics { margin-top: 52px; gap: 30px; }
    .footer { grid-template-columns: 1fr auto; }
    .footer-coordinates { display: none; }
    .edge-label { display: none; }
    .core { top: 44%; left: 72%; opacity: .55; }
    .network { inset: -12%; width: 124%; height: 124%; opacity: .28; }
    .grid { background-size: 54px 54px; }
}

@media (max-height: 720px) and (min-width: 761px) {
    .page-shell { grid-template-rows: 72px 1fr 54px; }
    .hero { padding-top: 28px; padding-bottom: 24px; }
    .terminal-line { margin-bottom: 35px; }
    .intro { margin-top: 30px; }
    .node-metrics { margin-top: 38px; }
}

@media (hover: none), (pointer: coarse) {
    .pointer-glow { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; }
    .js .boot-screen { display: none; }
    .js .page-shell, .js .edge-label { opacity: 1; }
    .pointer-glow { display: none; }
}
