@font-face {
    font-family: 'Amsterdam Four';
    src: url('fonts/Amsterdam Four_ttf 400.ttf') format('truetype');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

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

:root {
    --bg: #141414;
    --bg-card: #1a1a1a;
    --bg-card2: #1f1f1f;
    --teal: #077A7D;
    --teal-mid: #0a9a9e;
    --mint: #80FFDB;
    --muted: #A6A6A6;
    --muted2: #606060;
    --white: #F0F0F0;
    --border: rgba(7, 122, 125, 0.25);
    --border-h: rgba(128, 255, 219, 0.35);
}

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg);
    color: var(--white);
    font-family: 'DM Sans', sans-serif;
    font-weight: 300;
    line-height: 1.7;
    overflow-x: hidden;
}

/* ─── TYPOGRAPHY ─── */
.eyebrow {
    font-family: 'Space Mono', monospace;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--teal-mid);
}

h1,
h2,
h3 {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    line-height: 1.15;
}

h1 {
    font-size: clamp(2.4rem, 5.5vw, 4.2rem);
}

h2 {
    font-size: clamp(1.7rem, 3.5vw, 2.6rem);
}

h3 {
    font-size: 1.15rem;
    font-weight: 600;
}

p {
    font-size: 1rem;
    color: var(--muted);
    font-weight: 300;
}

a {
    color: var(--mint);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

/* ─── LAYOUT ─── */
.container {
    max-width: 1100px;
    margin: 0 auto;
    padding: 0 2rem;
}

section {
    padding: 6rem 0;
}

section+section {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
}

/* ─── NAV ─── */
nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    padding: 1.2rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: rgba(20, 20, 20, 0.85);
    backdrop-filter: blur(12px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.nav-logo {
    font-family: 'Amsterdam Four', 'Space Mono', monospace;
    font-size: 1.5rem;
    font-weight: 400;
    color: var(--white);
    letter-spacing: 0.04em;
}

.nav-logo span {
    color: var(--mint);
}

.nav-link {
    font-family: 'Amsterdam Four', 'Raleway', sans-serif;
    font-size: 1.3rem;
    font-weight: 400;
    color: var(--mint);
    letter-spacing: 0.04em;
    text-transform: none;
    transition: opacity 0.2s;
}

.nav-link:hover {
    color: var(--mint);
    opacity: 0.75;
    text-decoration: none;
}

/* ─── HERO ─── */
#hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    padding-top: 8rem;
    padding-bottom: 4rem;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 4rem;
    align-items: center;
    width: 100%;
}

.hero-left {
    display: flex;
    flex-direction: column;
    gap: 1.8rem;
}

.hero-left h1 {
    color: var(--white);
}

.hero-left h1 em {
    font-style: normal;
    color: var(--mint);
}

.hero-desc {
    font-size: 1.05rem;
    color: var(--muted);
    max-width: 440px;
    line-height: 1.75;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-top: 0.5rem;
}

.btn-primary {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.8rem;
    background: var(--teal);
    color: #fff;
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: none;
    cursor: pointer;
    transition: background 0.2s, transform 0.15s;
    text-decoration: none;
}

.btn-primary:hover {
    background: var(--teal-mid);
    transform: translateY(-1px);
    text-decoration: none;
    color: #fff;
}

.btn-ghost {
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    padding: 0.8rem 1.8rem;
    background: transparent;
    color: var(--muted);
    font-family: 'Raleway', sans-serif;
    font-weight: 600;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    border: 1px solid var(--muted2);
    cursor: pointer;
    transition: color 0.2s, border-color 0.2s;
    text-decoration: none;
}

.btn-ghost:hover {
    color: var(--white);
    border-color: var(--white);
    text-decoration: none;
}

/* ─── BRAIN DIAGRAM ─── */
.brain-diagram {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
}

.brain-layers {
    position: relative;
    /* single source of truth for the diagram size; everything scales from it */
    --d: min(420px, 88vw);
    width: var(--d);
    height: var(--d);
    margin: 0 auto;
    /* pointer-pull offsets, updated by scripts.js */
    --mx: 0;
    --my: 0;
}

.layer-ring {
    position: relative;
    border: 1px solid;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto;
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
}

.ring-semantic {
    width: var(--d);
    height: var(--d);
    aspect-ratio: 1 / 1;
    border-color: rgba(7, 122, 125, 0.35);
    background: radial-gradient(ellipse at center, rgba(7, 122, 125, 0.07) 0%, transparent 70%);
    animation: pulseOuter 4s ease-in-out infinite;
    /* outer ring follows pointer the least */
    transform: translate(calc(var(--mx) * 8px), calc(var(--my) * 8px));
}

.ring-episodic {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 66.6%;
    aspect-ratio: 1 / 1;
    height: auto;
    border-color: rgba(7, 122, 125, 0.5);
    background: radial-gradient(ellipse at center, rgba(7, 122, 125, 0.12) 0%, transparent 70%);
    animation: pulseMid 4s ease-in-out infinite 0.8s;
    /* mid ring follows pointer a bit more */
    transform: translate(-50%, -50%) translate(calc(var(--mx) * 16px), calc(var(--my) * 16px));
}

.ring-working {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 53.5%;
    aspect-ratio: 1 / 1;
    height: auto;
    border-color: rgba(128, 255, 219, 0.6);
    background: radial-gradient(ellipse at center, rgba(128, 255, 219, 0.15) 0%, transparent 70%);
    animation: pulseInner 4s ease-in-out infinite 1.6s;
    /* inner ring follows pointer the most */
    transform: translate(-50%, -50%) translate(calc(var(--mx) * 28px), calc(var(--my) * 28px));
}

.ring-center-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--mint);
    box-shadow: 0 0 16px var(--mint), 0 0 32px rgba(128, 255, 219, 0.4);
    animation: dotPulse 2s ease-in-out infinite;
}

/* Labels on rings */
.ring-label {
    position: absolute;
    font-family: 'Space Mono', monospace;
    font-size: 0.58rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    pointer-events: none;
}

.label-semantic {
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(7, 122, 125, 0.7);
}

.label-episodic {
    top: 12px;
    left: 50%;
    transform: translateX(-50%);
    color: rgba(7, 122, 125, 0.85);
}

.label-working {
    bottom: 14px;
    left: 50%;
    transform: translateX(-50%);
    color: var(--mint);
    font-size: 0.52rem;
}

/* orbit dots */
/* The .orbit wrapper handles the infinite spin with a pure rotate (no CSS
   variables), so the pointer-pull custom props on an ancestor never force the
   keyframes to re-snapshot. The dot itself is pushed out by the orbit radius. */
.orbit {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    transform-origin: 0 0;
    will-change: transform;
}

.orbit-dot {
    position: absolute;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: var(--teal-mid);
    margin: -2.5px 0 0 -2.5px;
    /* center the dot on the radius point */
}

/* radius offset lives on the static dot, scaling with the diagram size */
.orbit-mid .orbit-dot {
    transform: translateX(calc(var(--d) * 0.3286));
}

.orbit-inner .orbit-dot {
    transform: translateX(calc(var(--d) * 0.1738));
    background: rgba(128, 255, 219, 0.5);
}

.od1 {
    animation: spin 8s linear infinite;
}

.od2 {
    animation: spin 8s linear infinite -2.67s;
}

.od3 {
    animation: spin 8s linear infinite -5.33s;
}

.od4 {
    animation: spin 12s linear infinite;
}

.od5 {
    animation: spin 12s linear infinite -4s;
}

.brain-legend {
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    margin-top: 2rem;
    width: 100%;
    max-width: 420px;
}

.legend-item {
    display: flex;
    align-items: center;
    gap: 0.8rem;
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: var(--muted);
    letter-spacing: 0.06em;
}

.legend-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    flex-shrink: 0;
}

.ld-semantic {
    background: rgba(7, 122, 125, 0.6);
    border: 1px solid var(--teal);
}

.ld-episodic {
    background: var(--teal);
}

.ld-working {
    background: var(--mint);
    box-shadow: 0 0 8px rgba(128, 255, 219, 0.5);
}

@keyframes pulseOuter {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(7, 122, 125, 0);
    }

    50% {
        box-shadow: 0 0 40px 4px rgba(7, 122, 125, 0.12);
    }
}

@keyframes pulseMid {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(7, 122, 125, 0);
    }

    50% {
        box-shadow: 0 0 30px 6px rgba(7, 122, 125, 0.18);
    }
}

@keyframes pulseInner {

    0%,
    100% {
        box-shadow: 0 0 0 0 rgba(128, 255, 219, 0);
    }

    50% {
        box-shadow: 0 0 24px 8px rgba(128, 255, 219, 0.2);
    }
}

@keyframes dotPulse {

    0%,
    100% {
        transform: scale(1);
        opacity: 1;
    }

    50% {
        transform: scale(1.6);
        opacity: 0.7;
    }
}

@keyframes spin {
    from {
        transform: rotate(0deg);
    }

    to {
        transform: rotate(360deg);
    }
}

/* ─── PROBLEM SECTION ─── */
#problem {
    background: var(--bg);
}

.problem-inner {
    display: grid;
    grid-template-columns: 1fr 2fr;
    gap: 4rem;
    align-items: start;
}

.problem-quote {
    font-family: 'Raleway', sans-serif;
    font-size: clamp(1.4rem, 2.5vw, 2rem);
    font-weight: 700;
    line-height: 1.35;
    color: var(--white);
}

.problem-quote em {
    font-style: normal;
    color: var(--mint);
}

.problem-body {
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
}

.problem-body p {
    font-size: 1rem;
    line-height: 1.8;
}

/* ─── ARCHITECTURE ─── */
#architecture {
    background: var(--bg);
}

.arch-header {
    text-align: center;
    margin-bottom: 4rem;
}

.arch-header h2 {
    margin-top: 0.75rem;
}

.arch-header p {
    margin-top: 1rem;
    max-width: 560px;
    margin-left: auto;
    margin-right: auto;
}

.arch-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5px;
    background: var(--border);
    border: 1px solid var(--border);
}

.arch-card {
    background: var(--bg-card);
    padding: 2.4rem 2rem;
    display: flex;
    flex-direction: column;
    gap: 1.2rem;
    transition: background 0.25s;
    cursor: default;
}

.arch-card:hover {
    background: var(--bg-card2);
}

.arch-card-top {
    display: flex;
    align-items: flex-start;
    justify-content: space-between;
    gap: 1rem;
}

.arch-type-label {
    font-family: 'Space Mono', monospace;
    font-size: 0.6rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    padding: 0.3rem 0.6rem;
    border: 1px solid;
}

.label-sem {
    color: rgba(7, 122, 125, 0.8);
    border-color: rgba(7, 122, 125, 0.4);
}

.label-epi {
    color: var(--teal-mid);
    border-color: var(--teal);
}

.label-wrk {
    color: var(--mint);
    border-color: rgba(128, 255, 219, 0.5);
}

.arch-glyph {
    width: 36px;
    height: 36px;
    opacity: 0.6;
    flex-shrink: 0;
}

.arch-card h3 {
    color: var(--white);
    font-size: 1.1rem;
}

.arch-card p {
    font-size: 0.92rem;
    color: var(--muted);
    line-height: 1.7;
}

.arch-files {
    margin-top: 0.4rem;
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.arch-file {
    font-family: 'Space Mono', monospace;
    font-size: 0.62rem;
    color: var(--muted2);
    letter-spacing: 0.04em;
}

.arch-file span {
    color: var(--teal-mid);
}

/* ─── PIPELINE ─── */
#pipeline {
    background: var(--bg);
}

.pipeline-header {
    text-align: center;
    margin-bottom: 3.5rem;
}

.pipeline-header h2 {
    margin-top: 0.75rem;
}

.pipeline-steps {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 0;
    position: relative;
}

.pipeline-step {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    padding: 0 1.5rem 2rem;
    text-align: center;
    position: relative;
}

/* Connector segments: each step (except the last) draws a line that spans only
   the gap between its circle and the next one — it starts at this circle's right
   edge and stops at the next circle's left edge, never crossing the circles. */
.pipeline-step:not(:last-child)::after {
    content: '';
    position: absolute;
    top: 22px;
    /* vertical centre of the 44px circle */
    left: calc(50% + 26px);
    /* circle radius (22px) + 4px breathing room */
    width: calc(100% - 52px);
    /* full column minus both circle radii + gaps */
    height: 1px;
    background: linear-gradient(90deg, var(--teal) 0%, var(--mint) 100%);
    opacity: 0.35;
    pointer-events: none;
}

.step-num {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    border: 1px solid var(--teal);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Space Mono', monospace;
    font-size: 0.75rem;
    font-weight: 700;
    color: var(--teal-mid);
    background: var(--bg);
    position: relative;
    z-index: 1;
    flex-shrink: 0;
}

.pipeline-step:nth-child(4) .step-num {
    border-color: var(--mint);
    color: var(--mint);
}

.step-title {
    font-family: 'Raleway', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--white);
    letter-spacing: 0.04em;
}

.step-desc {
    font-size: 0.85rem;
    color: var(--muted);
    line-height: 1.6;
}

/* ─── WHY ─── */
#why {
    background: var(--bg);
}

.why-inner {
    display: grid;
    grid-template-columns: 1fr 1.6fr;
    gap: 5rem;
    align-items: start;
}

.why-left {
    position: sticky;
    top: 8rem;
}

.why-left h2 {
    margin-top: 0.75rem;
    line-height: 1.2;
}

.why-signature {
    margin-top: 2rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border);
    display: flex;
    align-items: center;
    gap: 1rem;
}

.sig-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--teal), var(--mint));
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 0.9rem;
    color: var(--bg);
    flex-shrink: 0;
}

.sig-name {
    font-family: 'Raleway', sans-serif;
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--white);
}

.sig-title {
    font-size: 0.78rem;
    color: var(--muted);
}

.why-right {
    display: flex;
    flex-direction: column;
    gap: 2.4rem;
}

.why-block {
    display: flex;
    flex-direction: column;
    gap: 0.7rem;
}

.why-block p {
    font-size: 1rem;
    line-height: 1.8;
}

.why-block strong {
    font-family: 'Raleway', sans-serif;
    font-weight: 700;
    font-size: 1rem;
    color: var(--white);
}

.inline-code {
    font-family: 'Space Mono', monospace;
    font-size: 0.82em;
    color: var(--mint);
    background: rgba(128, 255, 219, 0.07);
    padding: 0.1em 0.4em;
}

/* ─── WHAT IT'S NOT ─── */
#not {
    background: var(--bg);
}

.not-inner {
    display: flex;
    flex-direction: column;
    gap: 0;
}

.not-header {
    text-align: center;
    margin-bottom: 3rem;
}

.not-header h2 {
    margin-top: 0.75rem;
}

.not-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 1px;
    background: var(--border);
    border: 1px solid var(--border);
}

.not-card {
    background: var(--bg-card);
    padding: 2rem;
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.not-x {
    font-family: 'Space Mono', monospace;
    font-size: 1.2rem;
    color: rgba(255, 80, 80, 0.5);
    font-weight: 700;
}

.not-card h3 {
    font-size: 1rem;
    color: var(--white);
}

.not-card p {
    font-size: 0.9rem;
    color: var(--muted);
    line-height: 1.6;
}

/* ─── CTA ─── */
#cta {
    background: var(--bg);
    padding: 7rem 0;
}

.cta-box {
    border: 1px solid var(--teal);
    background: linear-gradient(135deg, rgba(7, 122, 125, 0.06) 0%, transparent 60%);
    padding: 4rem;
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 2rem;
    position: relative;
    overflow: hidden;
}

.cta-box::before {
    content: '';
    position: absolute;
    top: -60px;
    right: -60px;
    width: 220px;
    height: 220px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(128, 255, 219, 0.06) 0%, transparent 70%);
    pointer-events: none;
}

.cta-box h2 {
    max-width: 560px;
    color: var(--white);
}

.cta-box p {
    max-width: 480px;
    font-size: 1rem;
    line-height: 1.75;
}

.cta-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

.cta-note {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: var(--muted2);
    letter-spacing: 0.06em;
}

/* ─── FOOTER ─── */
footer {
    border-top: 1px solid rgba(255, 255, 255, 0.05);
    padding: 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-brand {
    font-family: 'Space Mono', monospace;
    font-size: 0.72rem;
    color: var(--muted2);
    letter-spacing: 0.06em;
}

.footer-brand span {
    color: var(--teal-mid);
}

.footer-links {
    display: flex;
    gap: 2rem;
}

.footer-links a {
    font-family: 'Space Mono', monospace;
    font-size: 0.65rem;
    color: var(--muted2);
    letter-spacing: 0.06em;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--white);
    text-decoration: none;
}

/* ─── SCROLL LINE ─── */
.scroll-line {
    display: flex;
    align-items: center;
    gap: 1rem;
    margin-top: 3rem;
}

.scroll-line-bar {
    width: 40px;
    height: 1px;
    background: var(--teal);
}

.scroll-line span {
    font-family: 'Space Mono', monospace;
    font-size: 0.6rem;
    color: var(--muted2);
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

/* ─── RESPONSIVE ─── */

/* Tablet / small desktop */
@media (max-width: 1024px) {
    .why-inner {
        gap: 3rem;
    }

    .arch-card {
        padding: 2rem 1.6rem;
    }
}

@media (max-width: 900px) {
    .container {
        padding: 0 1.5rem;
    }

    #hero {
        min-height: auto;
        padding-top: 7rem;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .hero-desc {
        max-width: none;
    }

    .brain-layers {
        --d: min(340px, 82vw);
    }

    .problem-inner {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .arch-grid {
        grid-template-columns: 1fr;
    }

    .pipeline-steps {
        grid-template-columns: 1fr 1fr;
        gap: 1rem 0;
    }

    .pipeline-step:not(:last-child)::after {
        display: none;
    }

    .why-inner {
        grid-template-columns: 1fr;
        gap: 3rem;
    }

    .why-left {
        position: static;
    }

    .not-grid {
        grid-template-columns: 1fr;
    }

    .cta-box {
        padding: 2.5rem;
    }

    footer {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
    }
}

@media (max-width: 600px) {
    nav {
        padding: 1rem 1.25rem;
    }

    .container {
        padding: 0 1.25rem;
    }

    section {
        padding: 4rem 0;
    }

    #cta {
        padding: 4.5rem 0;
    }

    h1 {
        font-size: clamp(2rem, 9vw, 2.6rem);
    }

    .hero-actions {
        gap: 0.75rem;
    }

    .hero-actions .btn-primary,
    .hero-actions .btn-ghost {
        width: 100%;
        justify-content: center;
    }

    .brain-layers {
        --d: min(280px, 80vw);
    }

    .brain-legend {
        max-width: 320px;
    }

    .pipeline-steps {
        grid-template-columns: 1fr;
    }

    .cta-box {
        padding: 2rem 1.5rem;
    }

    .cta-actions .btn-primary,
    .cta-actions .btn-ghost {
        width: 100%;
        justify-content: center;
    }

    .footer-links {
        gap: 1.25rem;
        flex-wrap: wrap;
        justify-content: center;
    }
}

@media (max-width: 380px) {
    .brain-layers {
        --d: min(240px, 78vw);
    }
}

@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
    }

    html {
        scroll-behavior: auto;
    }
}