:root {
    --bg: #0b0f14;
    --bg-alt: #10161d;
    --surface: #151d26;
    --border: #233040;
    --text: #e6edf3;
    --muted: #93a1b0;
    --accent: #34d399;
    --accent-ink: #052e1f;
    --danger: #f87171;
    --radius: 14px;
    --font: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    --mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
    margin: 0;
    font-family: var(--font);
    font-size: 17px;
    line-height: 1.6;
    color: var(--text);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .6em; }
h1 { font-size: clamp(2.2rem, 5.5vw, 4rem); font-weight: 750; }
h2 { font-size: clamp(1.7rem, 3.6vw, 2.6rem); font-weight: 700; }
h3 { font-size: 1.1rem; font-weight: 650; }
p  { margin: 0 0 1em; }

.wrap { width: min(1120px, 100% - 32px); margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn {
    display: inline-block;
    padding: .8em 1.4em;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 650;
    border: 1px solid var(--accent);
    transition: transform .15s ease, box-shadow .15s ease;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); box-shadow: 0 6px 24px rgba(52, 211, 153, .25); }
.btn-ghost { background: transparent; color: var(--text); border-color: var(--border); }
.btn-ghost:hover { border-color: var(--accent); box-shadow: none; }
.btn-small { padding: .45em 1em; font-size: .9rem; }
.btn-large { padding: 1em 2em; font-size: 1.1rem; }

/* ---------- Nav ---------- */
.nav {
    position: sticky; top: 0; z-index: 10;
    background: rgba(11, 15, 20, .8);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.logo { display: flex; align-items: center; gap: 10px; color: var(--text); font-weight: 700; font-size: 1.2rem; }
.logo:hover { text-decoration: none; }
.logo svg { width: 30px; height: 30px; }
.logo-bg { fill: var(--surface); stroke: var(--border); }
.logo-mark { stroke: var(--accent); stroke-width: 3; fill: none; stroke-linecap: round; stroke-linejoin: round; }
.dim { color: var(--muted); font-weight: 500; }
.nav-links { display: flex; align-items: center; gap: 28px; }
.nav-links a:not(.btn) { color: var(--muted); font-size: .95rem; }
.nav-links a:not(.btn):hover { color: var(--text); text-decoration: none; }

/* ---------- Hero ---------- */
.hero {
    padding: clamp(72px, 12vw, 140px) 0 clamp(64px, 9vw, 110px);
    background:
        radial-gradient(900px 500px at 85% -10%, rgba(52, 211, 153, .14), transparent 60%),
        radial-gradient(700px 400px at -10% 110%, rgba(56, 189, 248, .08), transparent 60%);
}
.hero h1 em { font-style: normal; color: var(--accent); }
.eyebrow {
    display: inline-flex; align-items: center; gap: 10px;
    padding: 6px 14px; border: 1px solid var(--border); border-radius: 999px;
    color: var(--muted); font-size: .88rem; margin-bottom: 28px;
    background: var(--bg-alt);
}
.dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 4px rgba(52, 211, 153, .2); }
.lead { font-size: clamp(1.05rem, 1.8vw, 1.25rem); color: var(--muted); max-width: 680px; margin: 8px 0 36px; }
.cta-row { display: flex; flex-wrap: wrap; gap: 14px; }
.trust {
    list-style: none; padding: 0; margin: 56px 0 0;
    display: flex; flex-wrap: wrap; gap: 12px 32px;
    color: var(--muted); font-size: .92rem;
}
.trust li::before { content: "✓"; color: var(--accent); margin-right: 8px; font-weight: 700; }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 9vw, 112px) 0; }
.section-alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.kicker { color: var(--accent); font-weight: 650; font-size: .85rem; text-transform: uppercase; letter-spacing: .12em; margin-bottom: 14px; }
.phase-head {
    display: flex; align-items: center; gap: clamp(16px, 3vw, 28px);
    margin-bottom: 28px; padding-bottom: 24px; border-bottom: 1px solid var(--border);
}
.phase-num {
    font-size: clamp(4rem, 11vw, 7.5rem); font-weight: 800; line-height: .85; letter-spacing: -.04em;
    font-variant-numeric: tabular-nums;
    background: linear-gradient(180deg, var(--accent), rgba(52, 211, 153, .25));
    -webkit-background-clip: text; background-clip: text; color: transparent;
}
.phase-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 6px; }
.phase-label { font-weight: 700; font-size: .9rem; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); }
.phase-status { font-size: .78rem; font-weight: 650; padding: 3px 10px; border-radius: 999px; border: 1px solid var(--accent); }
.phase-status.now { background: var(--accent); color: var(--accent-ink); }
.phase-status.next { color: var(--accent); }
.phase-title { margin: 0; font-size: clamp(1.15rem, 2.2vw, 1.5rem); font-weight: 650; color: var(--text); }

.section-lead { color: var(--muted); font-size: 1.1rem; max-width: 760px; margin-bottom: 48px; }
.section-lead strong { color: var(--text); }

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

.card {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 28px;
}
.card p { color: var(--muted); margin: 0; }
.icon {
    width: 44px; height: 44px; border-radius: 10px; margin-bottom: 18px;
    display: grid; place-items: center;
    background: rgba(248, 113, 113, .1); border: 1px solid rgba(248, 113, 113, .25);
}
.icon svg { width: 22px; height: 22px; fill: none; stroke: var(--danger); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }

/* ---------- Diagram ---------- */
.diagram {
    margin: 0 0 56px; padding: 32px;
    display: grid; grid-template-columns: 1fr 60px auto 60px 1fr; align-items: center; gap: 12px;
    background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
}
.d-col { display: flex; flex-direction: column; gap: 10px; }
.d-node {
    padding: 12px 16px; border-radius: 10px; font-size: .95rem;
    background: var(--bg); border: 1px solid var(--border); text-align: center;
}
.d-node.ok { border-color: rgba(52, 211, 153, .5); color: var(--accent); }
.d-node.blocked { border-style: dashed; border-color: rgba(248, 113, 113, .5); color: var(--danger); text-decoration: line-through; opacity: .8; }
.d-node small { display: block; font-size: .75rem; text-decoration: none; }
.d-arrow span { display: block; height: 2px; background: linear-gradient(90deg, var(--border), var(--accent)); position: relative; }
.d-arrow span::after {
    content: ""; position: absolute; right: -1px; top: -4px;
    border-left: 8px solid var(--accent); border-block: 5px solid transparent;
}
.d-router {
    display: flex; flex-direction: column; align-items: center; gap: 6px;
    padding: 24px 28px; border-radius: 16px;
    background: linear-gradient(180deg, rgba(52, 211, 153, .12), rgba(52, 211, 153, .03));
    border: 1px solid var(--accent);
    box-shadow: 0 0 40px rgba(52, 211, 153, .15);
}
.d-router svg { width: 40px; height: 40px; }
.d-router small { color: var(--muted); }

/* Phase 2: enclave + denied access from the outside */
.d-enclave { border-style: dashed; text-align: center; max-width: 280px; }
.d-enclave svg { width: 34px; height: 34px; fill: none; stroke: var(--accent); stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.d-chips { list-style: none; padding: 0; margin: 8px 0 0; display: flex; flex-wrap: wrap; justify-content: center; gap: 6px; }
.d-chips li {
    font-size: .72rem; padding: 3px 9px; border-radius: 999px;
    color: var(--accent); background: rgba(52, 211, 153, .08); border: 1px solid rgba(52, 211, 153, .35);
}
.d-arrow.deny span {
    background: repeating-linear-gradient(90deg, var(--danger) 0 6px, transparent 6px 11px);
    opacity: .7;
}
.d-arrow.deny span::after { right: auto; left: -1px; border-left: 0; border-right: 8px solid var(--danger); }
.d-arrow.deny span::before {
    content: "✕"; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -55%);
    color: var(--danger); font-size: .8rem; line-height: 1; background: var(--surface); padding: 0 3px;
}

.layers { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.layers-head { padding: 12px 20px; border-bottom: 1px solid var(--border); color: var(--muted); font-size: .8rem; font-family: var(--mono); }
.layers dl { margin: 0; padding: 8px 20px; }
.layers dl div { display: grid; grid-template-columns: 9.5em 1fr; gap: 12px; padding: 12px 0; border-bottom: 1px solid var(--border); }
.layers dl div:last-child { border-bottom: 0; }
.layers dt { font-weight: 600; }
.layers dd { margin: 0; color: var(--muted); }
.layers dd::before { content: "✓ "; color: var(--accent); }

/* ---------- Features + code ---------- */
.split { display: grid; grid-template-columns: 1fr 1fr; gap: 48px; align-items: start; }
.features { list-style: none; padding: 0; margin: 0; display: grid; gap: 28px; }
.features li { padding-left: 20px; border-left: 2px solid var(--accent); }
.features p { color: var(--muted); margin: 0; }

.code { background: #070a0e; border: 1px solid var(--border); border-radius: var(--radius); overflow: hidden; }
.code-head { display: flex; align-items: center; gap: 6px; padding: 12px 16px; border-bottom: 1px solid var(--border); }
.code-head span { width: 10px; height: 10px; border-radius: 50%; background: var(--border); }
.code-head em { margin-left: auto; font-style: normal; color: var(--muted); font-size: .8rem; font-family: var(--mono); }
.code pre { margin: 0; padding: 20px; overflow-x: auto; font-family: var(--mono); font-size: .86rem; line-height: 1.7; color: var(--text); }
.code .c { color: #6b7a8a; }
.code .k { color: #c084fc; }
.code .s { color: var(--accent); }

/* ---------- Roadmap ---------- */
.timeline { display: grid; grid-template-columns: 1fr 1fr; gap: 20px; margin-top: 40px; }
.phase {
    background: var(--surface); border: 1px solid var(--border);
    border-radius: var(--radius); padding: 32px;
}
.phase.active { border-color: var(--accent); box-shadow: 0 0 0 1px var(--accent) inset; }
.phase-tag {
    display: inline-block; margin-bottom: 16px; padding: 4px 12px; border-radius: 999px;
    font-size: .8rem; font-weight: 650; color: var(--muted); border: 1px solid var(--border);
}
.phase.active .phase-tag { color: var(--accent-ink); background: var(--accent); border-color: var(--accent); }
.phase h3 { font-size: 1.4rem; }
.phase p { color: var(--muted); }
.phase ul { margin: 0; padding-left: 1.2em; color: var(--text); }
.phase li { margin: 4px 0; }
.phase li::marker { color: var(--accent); }

/* ---------- Principles ---------- */
.principle { padding: 24px 0; border-top: 1px solid var(--border); }
.principle strong { display: block; color: var(--accent); font-family: var(--mono); font-size: .85rem; margin-bottom: 12px; }
.principle p { color: var(--muted); margin: 0; }
.note { margin: 40px 0 0; color: var(--muted); font-size: .92rem; }
.note::before { content: "🔒 "; }

/* ---------- CTA ---------- */
.cta {
    text-align: center;
    background: radial-gradient(700px 360px at 50% 100%, rgba(52, 211, 153, .16), transparent 70%);
}
.cta-inner { max-width: 720px; }
.cta p { color: var(--muted); font-size: 1.1rem; margin-bottom: 32px; }
.cta .small { font-size: .92rem; margin: 20px 0 0; }

/* ---------- Footer ---------- */
.footer { border-top: 1px solid var(--border); padding: 28px 0; color: var(--muted); font-size: .9rem; }
.footer-inner { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; }
.footer nav { display: flex; gap: 24px; }
.footer a { color: var(--muted); }

/* ---------- Study ---------- */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 20px; margin-bottom: 56px; }
.stat { background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); padding: 24px; }
.stat strong {
    display: block; margin-bottom: 10px;
    font-size: clamp(2rem, 4vw, 2.6rem); font-weight: 800; line-height: 1; letter-spacing: -.03em;
    font-variant-numeric: tabular-nums; color: var(--danger);
}
.stat p { color: var(--muted); margin: 0; font-size: .95rem; }
.callout {
    background: linear-gradient(180deg, rgba(52, 211, 153, .1), rgba(52, 211, 153, .02));
    border: 1px solid var(--accent); border-radius: var(--radius); padding: 28px;
}
.callout p { color: var(--muted); }
.callout p:last-child { margin: 0; color: var(--text); }
.sources { margin: 48px 0 0; color: var(--muted); font-size: .85rem; }

/* ---------- Law ---------- */
.law .card { display: flex; flex-direction: column; }
.law .card > p { margin-bottom: 16px; }
.law .card em { font-style: normal; color: var(--text); }
.law-tag { font-family: var(--mono); font-size: .78rem; color: var(--danger) !important; margin-bottom: 12px !important; }
.law ul { margin: auto 0 0; padding: 16px 0 0 1.2em; border-top: 1px solid var(--border); color: var(--muted); font-size: .92rem; }
.law li { margin: 6px 0; }
.law li::marker { color: var(--danger); }
.quote {
    margin: 48px 0 0; padding: 32px clamp(20px, 4vw, 40px);
    border-left: 3px solid var(--danger); background: var(--surface); border-radius: 0 var(--radius) var(--radius) 0;
}
.quote blockquote { margin: 0; font-size: clamp(1.4rem, 3vw, 2rem); font-weight: 700; letter-spacing: -.02em; line-height: 1.2; }
.quote-de { color: var(--muted); font-size: 1.1rem; margin: 8px 0 20px; }
.quote figcaption { color: var(--muted); font-size: .9rem; max-width: 760px; }

/* ---------- Responsive ---------- */
@media (max-width: 860px) {
    .split, .timeline { grid-template-columns: 1fr; }
    .diagram { grid-template-columns: 1fr; padding: 24px; }
    .d-arrow { height: 32px; display: flex; justify-content: center; }
    .d-arrow span { width: 2px; height: 100%; background: linear-gradient(180deg, var(--border), var(--accent)); }
    .d-arrow span::after { right: auto; top: auto; bottom: -1px; left: -4px; border-left: 5px solid transparent; border-right: 5px solid transparent; border-top: 8px solid var(--accent); border-bottom: 0; }
    .d-router { justify-self: center; }
    .d-arrow.deny span { background: repeating-linear-gradient(180deg, var(--danger) 0 6px, transparent 6px 11px); }
    .d-arrow.deny span::after { bottom: auto; top: -1px; border-top: 0; border-bottom: 8px solid var(--danger); }
    .layers dl div { grid-template-columns: 1fr; gap: 2px; }
}
@media (max-width: 760px) {
    .nav-links a:not(.btn) { display: none; }
}

@media (prefers-reduced-motion: reduce) {
    html { scroll-behavior: auto; }
    .btn { transition: none; }
}
