/* ==========================================================================
   ronri.xyz — Logic as Spatial Experiment
   Blackboard-Isometric coordinate system in pure CSS transforms.
   --------------------------------------------------------------------------
   Design Notes (from DESIGN.md):
     Fonts loaded: Caveat, Inconsolata, Share Tech Mono, Russo One.
     Animation strategy: path-draw-svg + fade-reveal driven by Intersection
     Observer at threshold 0.3, plus chalk-dust particles. Spatial Narrative
     Experience:** vertical scroll through XYZ planes. Coordinate Space**.
   ========================================================================== */

/* --- Design Tokens ------------------------------------------------------- */
:root {
    --bg-primary: #1A2B1A;          /* Blackboard Green */
    --bg-secondary: #243424;        /* Slate Board */
    --block-top: #2E4A2E;           /* Block Surface */
    --block-shadow: #152015;        /* Block Shadow */
    --chalk: #E8E4D8;               /* Chalk White */
    --grid-lime: #B4E84D;           /* Grid Lime */
    --axis-gray: #7A8B7A;           /* Axis Gray */
    --origin-gold: #E8C84D;         /* Origin Gold */

    --font-hand: "Caveat", "Kalam", cursive;
    --font-mono-bold: "Inconsolata", "JetBrains Mono", monospace;
    --font-tech: "Share Tech Mono", "VT323", monospace;
    --font-display: "Russo One", "Inter", sans-serif;

    --grid-px: 48px;
    --section-pad: 6rem;
}

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

html {
    scroll-behavior: smooth;
}

body {
    background: var(--bg-primary);
    color: var(--chalk);
    font-family: var(--font-hand);
    font-size: 18px;
    line-height: 1.4;
    overflow-x: hidden;
    min-height: 100vh;
    position: relative;
    /* Faint chalkboard grain via repeating gradient */
    background-image:
        radial-gradient(circle at 22% 18%, rgba(232, 228, 216, 0.018) 0, transparent 38%),
        radial-gradient(circle at 78% 72%, rgba(180, 232, 77, 0.015) 0, transparent 42%),
        repeating-linear-gradient(
            45deg,
            transparent 0,
            transparent 3px,
            rgba(232, 228, 216, 0.008) 3px,
            rgba(232, 228, 216, 0.008) 6px
        );
}

a {
    color: inherit;
    text-decoration: none;
}

/* --- Chalk dust particle layer ------------------------------------------ */
.chalk-dust {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 5;
    overflow: hidden;
}

.chalk-particle {
    position: absolute;
    top: -20px;
    width: 2px;
    height: 2px;
    background: var(--chalk);
    border-radius: 50%;
    opacity: 0;
    animation-name: chalk-fall;
    animation-timing-function: linear;
    animation-iteration-count: infinite;
    will-change: transform, opacity;
}

.chalk-particle.tiny {
    width: 1px;
    height: 1px;
}

@keyframes chalk-fall {
    0% {
        transform: translateY(-20px) translateX(0);
        opacity: 0;
    }
    8% {
        opacity: 0.15;
    }
    50% {
        transform: translateY(50vh) translateX(6px);
        opacity: 0.12;
    }
    92% {
        opacity: 0.08;
    }
    100% {
        transform: translateY(105vh) translateX(12px);
        opacity: 0;
    }
}

/* --- HUD coordinate readout --------------------------------------------- */
.hud {
    position: fixed;
    top: 50%;
    right: 1.5rem;
    transform: translateY(-50%);
    z-index: 30;
    font-family: var(--font-tech);
    font-size: 12px;
    color: var(--axis-gray);
    background: rgba(21, 32, 21, 0.55);
    border: 1px solid rgba(180, 232, 77, 0.18);
    padding: 0.85rem 1rem;
    backdrop-filter: blur(2px);
    line-height: 1.6;
    letter-spacing: 0.08em;
}

.hud-row {
    display: flex;
    justify-content: space-between;
    gap: 1.2rem;
}

.hud-key {
    color: var(--grid-lime);
    font-weight: 700;
}

.hud-val {
    color: var(--chalk);
    font-variant-numeric: tabular-nums;
}

.hud-meta {
    margin-top: 0.55rem;
    padding-top: 0.55rem;
    border-top: 1px dashed rgba(122, 139, 122, 0.4);
    color: var(--axis-gray);
    font-size: 10px;
    opacity: 0.85;
}

/* --- Brand header ------------------------------------------------------- */
.brand {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 40;
    padding: 1.25rem 2rem;
    display: flex;
    align-items: center;
    justify-content: space-between;
    background: linear-gradient(180deg, rgba(21, 32, 21, 0.85) 0%, rgba(21, 32, 21, 0) 100%);
    backdrop-filter: blur(3px);
    pointer-events: none;
}

.brand > * {
    pointer-events: auto;
}

.brand-mark {
    display: flex;
    align-items: baseline;
    gap: 0.85rem;
}

.brand-kanji {
    font-family: var(--font-display);
    font-size: 26px;
    color: var(--chalk);
    letter-spacing: 0.05em;
    text-shadow: 0 0 14px rgba(232, 228, 216, 0.18);
}

.brand-domain {
    font-family: var(--font-tech);
    font-size: 12px;
    color: var(--axis-gray);
    letter-spacing: 0.22em;
    text-transform: lowercase;
}

.brand-nav {
    display: flex;
    gap: 1.4rem;
    font-family: var(--font-tech);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.nav-link {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 0.15rem;
    color: var(--axis-gray);
    transition: color 220ms ease;
    padding: 0.25rem 0.5rem;
    border-right: 1px solid transparent;
}

.nav-link:hover,
.nav-link.is-active {
    color: var(--chalk);
    border-right-color: var(--grid-lime);
}

.nav-axis {
    color: var(--grid-lime);
    font-weight: 700;
    font-size: 12px;
}

.nav-name {
    font-size: 9px;
    color: var(--axis-gray);
}

/* --- Coordinate space main ---------------------------------------------- */
.coordinate-space {
    position: relative;
    perspective: 1400px;
    perspective-origin: 50% 30%;
}

/* --- Isometric grid backgrounds ----------------------------------------- */
.iso-grid {
    position: absolute;
    inset: 0;
    pointer-events: none;
    overflow: hidden;
    z-index: 0;
}

.iso-grid::before,
.iso-grid::after {
    content: "";
    position: absolute;
    inset: -50%;
    background-image:
        repeating-linear-gradient(
            30deg,
            rgba(180, 232, 77, 0.20) 0,
            rgba(180, 232, 77, 0.20) 1px,
            transparent 1px,
            transparent var(--grid-px)
        ),
        repeating-linear-gradient(
            150deg,
            rgba(180, 232, 77, 0.20) 0,
            rgba(180, 232, 77, 0.20) 1px,
            transparent 1px,
            transparent var(--grid-px)
        );
    transform-origin: center center;
    transition: transform 1800ms cubic-bezier(.5, 0, .2, 1);
}

.iso-grid::after {
    background-image:
        radial-gradient(circle, rgba(180, 232, 77, 0.32) 0 1.5px, transparent 1.6px);
    background-size: var(--grid-px) calc(var(--grid-px) * 0.577);
    background-position: 0 0;
    opacity: 0.5;
}

.iso-grid.in-view::before,
.iso-grid.in-view::after {
    animation: grid-breath 12s ease-in-out infinite;
}

@keyframes grid-breath {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.65;
    }
}

/* Per-plane grid orientation (achieved through subtle offset) */
.grid-xy::before {
    transform: translate(0, 0);
}

.grid-xz::before {
    transform: translate(0, -10%) skewY(-2deg);
}

.grid-xz::after {
    transform: translate(0, -10%);
}

.grid-yz::before {
    transform: translate(0, 0) skewX(2deg);
}

.grid-yz::after {
    transform: translate(0, 0) skewX(2deg);
}

.grid-origin::before {
    background-image:
        repeating-linear-gradient(
            30deg,
            rgba(180, 232, 77, 0.30) 0,
            rgba(180, 232, 77, 0.30) 1px,
            transparent 1px,
            transparent var(--grid-px)
        ),
        repeating-linear-gradient(
            90deg,
            rgba(180, 232, 77, 0.18) 0,
            rgba(180, 232, 77, 0.18) 1px,
            transparent 1px,
            transparent var(--grid-px)
        ),
        repeating-linear-gradient(
            150deg,
            rgba(180, 232, 77, 0.30) 0,
            rgba(180, 232, 77, 0.30) 1px,
            transparent 1px,
            transparent var(--grid-px)
        );
}

/* --- INTRO PLANE -------------------------------------------------------- */
.intro-plane {
    position: relative;
    height: 100vh;
    min-height: 720px;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.intro-content {
    position: relative;
    z-index: 2;
    text-align: center;
    padding: 0 2rem;
    max-width: 880px;
}

.prelude {
    font-family: var(--font-tech);
    font-size: 12px;
    color: var(--grid-lime);
    letter-spacing: 0.32em;
    text-transform: uppercase;
    margin-bottom: 1.6rem;
    opacity: 0.85;
}

.intro-title {
    font-family: var(--font-display);
    font-size: clamp(96px, 18vw, 220px);
    font-weight: 400;
    letter-spacing: 0.04em;
    color: var(--chalk);
    line-height: 1;
    margin-bottom: 1.5rem;
    text-shadow:
        0 0 30px rgba(232, 228, 216, 0.18),
        0 0 80px rgba(180, 232, 77, 0.10);
}

.intro-title span {
    color: var(--grid-lime);
    text-shadow:
        0 0 30px rgba(180, 232, 77, 0.45),
        0 0 80px rgba(180, 232, 77, 0.18);
}

.intro-sub {
    font-family: var(--font-hand);
    font-size: 32px;
    color: var(--chalk);
    margin-bottom: 1.2rem;
    letter-spacing: 0.01em;
}

.intro-meta {
    font-family: var(--font-tech);
    font-size: 12px;
    color: var(--axis-gray);
    letter-spacing: 0.22em;
    text-transform: uppercase;
}

.intro-axes {
    margin-top: 3.4rem;
    display: flex;
    justify-content: center;
    gap: 4rem;
}

.intro-axis {
    display: flex;
    align-items: center;
    gap: 0.85rem;
}

.axis-label {
    font-family: var(--font-mono-bold);
    font-size: 22px;
    font-weight: 700;
    color: var(--grid-lime);
}

.axis-line {
    display: block;
    width: 80px;
    height: 1px;
    background: var(--grid-lime);
    box-shadow: 0 0 8px rgba(180, 232, 77, 0.6);
    transform-origin: left center;
}

.ax-x .axis-line {
    transform: rotate(0deg);
}

.ax-y .axis-line {
    transform: rotate(-60deg);
}

.ax-z .axis-line {
    transform: rotate(30deg);
    background: linear-gradient(90deg, var(--grid-lime), rgba(180, 232, 77, 0.2));
}

.scroll-cue {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    font-family: var(--font-tech);
    font-size: 11px;
    color: var(--axis-gray);
    letter-spacing: 0.32em;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.4rem;
    z-index: 3;
}

.scroll-arrow {
    font-size: 22px;
    color: var(--grid-lime);
    animation: scroll-bob 2s ease-in-out infinite;
}

@keyframes scroll-bob {
    0%, 100% { transform: translateY(0); opacity: 0.6; }
    50% { transform: translateY(8px); opacity: 1; }
}

/* --- Plane sections ----------------------------------------------------- */
.plane {
    position: relative;
    width: 100%;
    overflow: hidden;
    padding: var(--section-pad) 2rem;
}

.plane-xy {
    min-height: 100vh;
}

.plane-xz {
    min-height: 120vh;
}

.plane-yz {
    min-height: 120vh;
}

.origin-plane {
    min-height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* Plane header */
.plane-header {
    position: relative;
    z-index: 5;
    max-width: 1200px;
    margin: 0 auto 4rem auto;
    display: grid;
    grid-template-columns: auto auto 1fr;
    gap: 1.5rem 2rem;
    align-items: end;
}

.plane-coord {
    grid-row: 1;
    grid-column: 1;
    font-family: var(--font-tech);
    font-size: 13px;
    color: var(--grid-lime);
    letter-spacing: 0.18em;
    padding: 0.4rem 0.7rem;
    border: 1px solid rgba(180, 232, 77, 0.4);
    align-self: center;
}

.plane-title {
    grid-row: 1;
    grid-column: 2;
    font-family: var(--font-display);
    font-size: clamp(60px, 9vw, 110px);
    font-weight: 400;
    letter-spacing: 0.3em;
    color: var(--chalk);
    opacity: 0.4;
    line-height: 0.95;
    text-transform: uppercase;
}

.plane-subtitle {
    grid-row: 1;
    grid-column: 3;
    font-family: var(--font-hand);
    font-size: 24px;
    color: var(--chalk);
    align-self: center;
    max-width: 520px;
    line-height: 1.35;
    opacity: 0.92;
}

/* --- Isometric stage ---------------------------------------------------- */
.iso-stage {
    position: relative;
    z-index: 4;
    max-width: 1200px;
    margin: 0 auto;
    perspective: 1400px;
    perspective-origin: 50% 40%;
}

.stage-xy {
    height: 560px;
}

.stage-xz {
    height: 720px;
}

.stage-yz {
    height: 720px;
}

/* --- Iso block ---------------------------------------------------------- */
.iso-block {
    position: absolute;
    width: 320px;
    transform-style: preserve-3d;
    opacity: 0;
    transform: translate3d(0, 30px, 0);
    transition:
        opacity 800ms ease-out,
        transform 800ms cubic-bezier(.2, .8, .2, 1);
}

.iso-block.is-revealed {
    opacity: 1;
    transform: translate3d(0, 0, 0);
}

.iso-block .block-faces {
    position: relative;
    width: 100%;
    height: 110px;
    transform-style: preserve-3d;
    transform: rotateX(60deg) rotateZ(-45deg);
}

.face {
    position: absolute;
    inset: 0;
    backface-visibility: hidden;
    border: 1px solid rgba(180, 232, 77, 0.3);
}

.face-top {
    background: var(--block-top);
    box-shadow: inset 0 0 30px rgba(180, 232, 77, 0.06);
}

.face-front {
    background: var(--bg-secondary);
    transform: rotateX(-90deg);
    transform-origin: bottom center;
    height: 60px;
    top: auto;
    bottom: 0;
}

.face-side {
    background: var(--block-shadow);
    transform: rotateY(90deg);
    transform-origin: right center;
    width: 60px;
    left: auto;
    right: 0;
}

.block-label {
    position: relative;
    z-index: 2;
    margin-top: -40px;
    padding: 1.1rem 1.3rem;
    background: rgba(21, 32, 21, 0.78);
    border: 1px solid rgba(180, 232, 77, 0.35);
    border-left: 3px solid var(--grid-lime);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.45);
    backdrop-filter: blur(3px);
}

.block-label.small {
    padding: 0.85rem 1rem;
}

.block-tag {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 0.5rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px dashed rgba(122, 139, 122, 0.4);
}

.tag-axis {
    font-family: var(--font-mono-bold);
    font-size: 14px;
    font-weight: 700;
    color: var(--grid-lime);
    letter-spacing: 0.05em;
}

.tag-coord {
    font-family: var(--font-tech);
    font-size: 11px;
    color: var(--axis-gray);
    letter-spacing: 0.12em;
}

.proposition {
    font-family: var(--font-hand);
    font-size: 24px;
    color: var(--chalk);
    line-height: 1.25;
    margin-bottom: 0.4rem;
    letter-spacing: 0.005em;
}

.block-label.small .proposition {
    font-size: 20px;
}

.formal {
    font-family: var(--font-mono-bold);
    font-size: 18px;
    font-weight: 700;
    color: var(--grid-lime);
    letter-spacing: 0.06em;
    margin-top: 0.3rem;
    text-shadow: 0 0 8px rgba(180, 232, 77, 0.18);
}

.formal .op {
    color: var(--grid-lime);
    margin: 0 0.15em;
    font-weight: 700;
}

/* --- Block placement on each plane -------------------------------------- */
/* XY plane — three axiom blocks */
.stage-xy [data-pos="a1"] { top: 60px;  left: 80px; }
.stage-xy [data-pos="a2"] { top: 220px; left: 480px; }
.stage-xy [data-pos="a3"] { top: 110px; left: 850px; }

/* XZ plane — six propositions */
.stage-xz [data-pos="b1"] { top: 540px; left: 60px;  width: 280px; }
.stage-xz [data-pos="b2"] { top: 380px; left: 320px; width: 280px; }
.stage-xz [data-pos="b3"] { top: 480px; left: 580px; width: 280px; }
.stage-xz [data-pos="b4"] { top: 240px; left: 880px; width: 280px; }
.stage-xz [data-pos="b5"] { top: 160px; left: 380px; width: 300px; }
.stage-xz [data-pos="b6"] { top: 380px; left: 880px; width: 280px; }

/* YZ plane — depth stack */
.stage-yz [data-pos="c1"] { top: 60px;  left: 80px;  width: 380px; transform: scale(1.05); }
.stage-yz [data-pos="c2"] { top: 200px; left: 320px; width: 340px; transform: scale(0.92); }
.stage-yz [data-pos="c3"] { top: 360px; left: 540px; width: 300px; transform: scale(0.82); }
.stage-yz [data-pos="c4"] { top: 500px; left: 760px; width: 260px; transform: scale(0.72); }

.iso-block.depth-1 .block-label { background: rgba(21, 32, 21, 0.88); }
.iso-block.depth-2 .block-label { background: rgba(21, 32, 21, 0.78); opacity: 0.92; }
.iso-block.depth-3 .block-label { background: rgba(21, 32, 21, 0.68); opacity: 0.78; }
.iso-block.depth-4 .block-label { background: rgba(21, 32, 21, 0.58); opacity: 0.62; }

.iso-block.depth-1.is-revealed,
.iso-block.depth-2.is-revealed,
.iso-block.depth-3.is-revealed,
.iso-block.depth-4.is-revealed {
    opacity: 1;
}

/* --- Erased ghosts ------------------------------------------------------ */
.erased-ghost {
    position: absolute;
    font-family: var(--font-hand);
    font-size: 28px;
    color: var(--chalk);
    opacity: 0.10;
    filter: blur(1px);
    letter-spacing: 0.01em;
    transform: rotate(-3deg);
    pointer-events: none;
    z-index: 1;
    max-width: 360px;
}

.ghost-1 { top: 380px;  left: 60px;  transform: rotate(-2deg); }
.ghost-2 { top: 80px;   left: 720px; transform: rotate(2deg); }
.ghost-3 { top: 80px;   left: 80px;  transform: rotate(-3deg); }
.ghost-4 { top: 620px;  left: 760px; transform: rotate(2deg); }
.ghost-5 { top: 100px;  left: 720px; transform: rotate(-2deg); }
.ghost-6 { top: 600px;  left: 60px;  transform: rotate(3deg); }

/* --- Inference SVG lines ------------------------------------------------ */
.inference-svg {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 3;
    pointer-events: none;
    overflow: visible;
}

.infer-line {
    fill: none;
    stroke: var(--grid-lime);
    stroke-width: 1.5;
    opacity: 0.55;
    stroke-dasharray: 1200;
    stroke-dashoffset: 1200;
    transition: stroke-dashoffset 1400ms cubic-bezier(.4, 0, .2, 1);
    filter: drop-shadow(0 0 4px rgba(180, 232, 77, 0.45));
    marker-end: url(#arrowhead-xz);
}

.inference-svg.in-view .infer-line {
    stroke-dashoffset: 0;
}

.inference-svg.in-view .infer-line:nth-child(1) { transition-delay: 200ms; }
.inference-svg.in-view .infer-line:nth-child(2) { transition-delay: 600ms; }
.inference-svg.in-view .infer-line:nth-child(3) { transition-delay: 1000ms; }
.inference-svg.in-view .infer-line:nth-child(4) { transition-delay: 1400ms; }
.inference-svg.in-view .infer-line:nth-child(5) { transition-delay: 1800ms; }

/* --- Origin / Convergence ---------------------------------------------- */
.origin-plane {
    flex-direction: column;
    text-align: center;
    padding: var(--section-pad) 2rem;
    position: relative;
}

.origin-axes {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
}

.axis-arrow {
    fill: none;
    stroke: var(--grid-lime);
    stroke-width: 3;
    stroke-linecap: round;
    stroke-dasharray: 800;
    stroke-dashoffset: 800;
    transition: stroke-dashoffset 1500ms cubic-bezier(.3, .7, .3, 1);
    filter: drop-shadow(0 0 6px rgba(180, 232, 77, 0.45));
}

.origin-plane.in-view .axis-arrow {
    stroke-dashoffset: 0;
}

.origin-plane.in-view .axis-arrow.axis-x { transition-delay: 0ms; }
.origin-plane.in-view .axis-arrow.axis-y { transition-delay: 500ms; }
.origin-plane.in-view .axis-arrow.axis-z { transition-delay: 1000ms; }

.axis-text {
    font-family: var(--font-mono-bold);
    font-size: 22px;
    font-weight: 700;
    fill: var(--grid-lime);
    opacity: 0;
    transition: opacity 600ms ease;
}

.origin-plane.in-view .axis-text {
    opacity: 1;
    transition-delay: 1500ms;
}

/* The central cube */
.origin-cube-wrap {
    position: relative;
    width: 220px;
    height: 220px;
    margin: 1rem auto 3rem auto;
    perspective: 1100px;
    z-index: 3;
}

.origin-cube {
    position: relative;
    width: 100%;
    height: 100%;
    transform-style: preserve-3d;
    transform: rotateX(-22deg) rotateY(-32deg);
    animation: cube-float 14s ease-in-out infinite;
}

@keyframes cube-float {
    0%, 100% { transform: rotateX(-22deg) rotateY(-32deg); }
    50% { transform: rotateX(-22deg) rotateY(-50deg); }
}

.cube-face {
    position: absolute;
    width: 220px;
    height: 220px;
    border: 1px solid var(--grid-lime);
    background: rgba(36, 52, 36, 0.85);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow:
        inset 0 0 40px rgba(180, 232, 77, 0.10),
        0 0 30px rgba(180, 232, 77, 0.18);
}

.cube-face span {
    font-family: var(--font-display);
    font-size: 110px;
    color: var(--origin-gold);
    text-shadow:
        0 0 20px rgba(232, 200, 77, 0.6),
        0 0 40px rgba(232, 200, 77, 0.3);
}

.cf-front  { transform: translateZ(110px); }
.cf-back   { transform: rotateY(180deg) translateZ(110px); background: rgba(46, 74, 46, 0.85); }
.cf-left   { transform: rotateY(-90deg) translateZ(110px); background: rgba(21, 32, 21, 0.92); }
.cf-right  { transform: rotateY(90deg)  translateZ(110px); background: rgba(36, 52, 36, 0.85); }
.cf-top    { transform: rotateX(90deg)  translateZ(110px); background: rgba(46, 74, 46, 0.85); }
.cf-bottom { transform: rotateX(-90deg) translateZ(110px); background: rgba(21, 32, 21, 0.95); }

.origin-glow {
    position: absolute;
    inset: -80px;
    border-radius: 50%;
    background: radial-gradient(
        circle,
        rgba(232, 200, 77, 0.30) 0%,
        rgba(180, 232, 77, 0.10) 40%,
        transparent 70%
    );
    z-index: -1;
    animation: glow-pulse 4s ease-in-out infinite;
    pointer-events: none;
}

@keyframes glow-pulse {
    0%, 100% { opacity: 0.7; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.08); }
}

.origin-content {
    position: relative;
    z-index: 4;
    max-width: 760px;
    margin: 0 auto;
}

.origin-coord {
    font-family: var(--font-tech);
    font-size: 13px;
    color: var(--grid-lime);
    letter-spacing: 0.32em;
    margin-bottom: 1rem;
    opacity: 0.85;
}

.origin-title {
    font-family: var(--font-display);
    font-size: clamp(40px, 6vw, 72px);
    font-weight: 400;
    letter-spacing: 0.32em;
    color: var(--chalk);
    margin-bottom: 1.4rem;
    opacity: 0.65;
}

.origin-prop {
    font-family: var(--font-hand);
    font-size: 28px;
    color: var(--chalk);
    line-height: 1.35;
    margin-bottom: 1.6rem;
}

.origin-formal {
    font-family: var(--font-mono-bold);
    font-size: 18px;
    font-weight: 700;
    color: var(--grid-lime);
    letter-spacing: 0.04em;
    line-height: 1.6;
    text-shadow: 0 0 8px rgba(180, 232, 77, 0.25);
    margin-bottom: 2.4rem;
}

.origin-formal .op {
    color: var(--origin-gold);
    margin: 0 0.1em;
}

.origin-strokes {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.85rem;
    flex-wrap: wrap;
    font-family: var(--font-mono-bold);
    font-weight: 700;
    font-size: 26px;
}

.stroke {
    color: var(--grid-lime);
    text-shadow: 0 0 12px rgba(180, 232, 77, 0.45);
    padding: 0.25rem 0.85rem;
    border: 1px solid rgba(180, 232, 77, 0.4);
    background: rgba(21, 32, 21, 0.55);
    transition: transform 600ms ease;
}

.stroke-plus,
.stroke-eq {
    color: var(--axis-gray);
    font-family: var(--font-mono-bold);
    font-size: 22px;
}

.s-final {
    font-family: var(--font-display);
    color: var(--origin-gold);
    border-color: rgba(232, 200, 77, 0.6);
    background: rgba(46, 74, 46, 0.5);
    text-shadow:
        0 0 16px rgba(232, 200, 77, 0.6),
        0 0 32px rgba(232, 200, 77, 0.25);
    font-size: 30px;
    letter-spacing: 0.05em;
}

/* --- Footer ------------------------------------------------------------- */
.board-footer {
    position: relative;
    padding: 4rem 2rem 3rem 2rem;
    border-top: 1px dashed rgba(180, 232, 77, 0.25);
    overflow: hidden;
}

.footer-grid {
    position: absolute;
    inset: 0;
    background-image:
        repeating-linear-gradient(
            30deg,
            rgba(180, 232, 77, 0.10) 0,
            rgba(180, 232, 77, 0.10) 1px,
            transparent 1px,
            transparent 32px
        ),
        repeating-linear-gradient(
            150deg,
            rgba(180, 232, 77, 0.10) 0,
            rgba(180, 232, 77, 0.10) 1px,
            transparent 1px,
            transparent 32px
        );
    opacity: 0.5;
    pointer-events: none;
}

.footer-content {
    position: relative;
    z-index: 2;
    display: flex;
    align-items: baseline;
    justify-content: center;
    gap: 1.4rem;
    flex-wrap: wrap;
    text-align: center;
}

.footer-mark {
    font-family: var(--font-display);
    font-size: 22px;
    color: var(--chalk);
    letter-spacing: 0.05em;
}

.footer-domain {
    font-family: var(--font-tech);
    font-size: 12px;
    color: var(--grid-lime);
    letter-spacing: 0.2em;
}

.footer-meta {
    font-family: var(--font-tech);
    font-size: 11px;
    color: var(--axis-gray);
    letter-spacing: 0.18em;
}

/* --- Scroll-progress active state for blocks ---------------------------- */
.iso-block.is-revealed .block-faces {
    animation: block-settle 1200ms ease-out forwards;
}

@keyframes block-settle {
    0% { transform: rotateX(60deg) rotateZ(-45deg) translateY(20px); }
    100% { transform: rotateX(60deg) rotateZ(-45deg) translateY(0); }
}

/* Subtle hover lift on blocks (for interactivity feel) */
.iso-block:hover .block-faces {
    transform: rotateX(60deg) rotateZ(-45deg) translateZ(8px);
    transition: transform 400ms ease;
}

.iso-block:hover .block-label {
    border-left-color: var(--origin-gold);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.6), 0 0 24px rgba(180, 232, 77, 0.18);
    transition: all 300ms ease;
}

/* --- Mobile / responsive ------------------------------------------------ */
@media (max-width: 1080px) {
    .iso-stage {
        height: auto !important;
    }

    .stage-xy,
    .stage-xz,
    .stage-yz {
        height: auto !important;
        display: flex;
        flex-direction: column;
        gap: 2rem;
    }

    .iso-block {
        position: relative !important;
        top: auto !important;
        left: auto !important;
        width: 100% !important;
        max-width: 560px;
        margin: 0 auto;
        transform: none !important;
    }

    .iso-block .block-faces {
        display: none;
    }

    .block-label {
        margin-top: 0;
        border-left-width: 4px;
    }

    .erased-ghost {
        display: none;
    }

    .inference-svg {
        display: none;
    }

    .plane-header {
        grid-template-columns: 1fr;
        gap: 0.75rem;
    }

    .plane-coord,
    .plane-title,
    .plane-subtitle {
        grid-row: auto;
        grid-column: 1;
    }

    .plane-title {
        font-size: 64px;
    }

    .hud {
        display: none;
    }

    .brand-nav {
        display: none;
    }

    .brand {
        padding: 0.85rem 1.2rem;
    }
}

@media (max-width: 640px) {
    body {
        font-size: 16px;
    }

    .intro-title {
        font-size: 28vw;
    }

    .intro-sub {
        font-size: 22px;
    }

    .intro-axes {
        gap: 1.6rem;
    }

    .axis-line {
        width: 40px;
    }

    .proposition {
        font-size: 20px;
    }

    .origin-cube-wrap {
        width: 160px;
        height: 160px;
    }

    .cube-face {
        width: 160px;
        height: 160px;
    }

    .cube-face span {
        font-size: 80px;
    }

    .cf-front  { transform: translateZ(80px); }
    .cf-back   { transform: rotateY(180deg) translateZ(80px); }
    .cf-left   { transform: rotateY(-90deg) translateZ(80px); }
    .cf-right  { transform: rotateY(90deg)  translateZ(80px); }
    .cf-top    { transform: rotateX(90deg)  translateZ(80px); }
    .cf-bottom { transform: rotateX(-90deg) translateZ(80px); }

    .origin-strokes {
        font-size: 20px;
        gap: 0.4rem;
    }

    .s-final {
        font-size: 24px;
    }

    .origin-formal {
        font-size: 14px;
    }
}
