/* ============================================================
   riron.xyz — Theoretical Research Portal
   Design: Bento-box dashboard as narrative scaffold.
   Palette: triadic CRT (cyan / magenta / violet) on deep space.
   ============================================================ */

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

:root {
    --c-deep:       #0b1628;
    --c-panel:      #122240;
    --c-screen:     #e8edf5;
    --c-cyan:       #4cc9f0;
    --c-magenta:    #f72585;
    --c-violet:     #7209b7;
    --c-grid:       #1a3a5c;
    --c-grid-soft:  #2d4a6f;
    --c-indigo:     #3a0ca3;

    --font-display: "Outfit", "Inter", "Space Grotesk", system-ui, sans-serif;
    --font-body:    "Nunito Sans", "Inter", system-ui, sans-serif;
    --font-mono:    "Space Mono", "JetBrains Mono", ui-monospace, monospace;
    --font-jp:      "Noto Sans JP", "Outfit", sans-serif;

    --topbar-h: 40px;
    --gutter:   16px;
    --section-pad: 20px;
}

html, body {
    width: 100%;
    min-height: 100%;
}

body {
    background: var(--c-deep);
    color: var(--c-screen);
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.7;
    font-weight: 400;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    overflow-x: hidden;
    position: relative;
}

/* Faint deep-space gradient under everything */
body::before {
    content: "";
    position: fixed;
    inset: 0;
    background:
        radial-gradient(ellipse at 80% 10%, rgba(76,201,240,0.07), transparent 60%),
        radial-gradient(ellipse at 10% 90%, rgba(114,9,183,0.10), transparent 65%),
        radial-gradient(ellipse at 50% 50%, rgba(58,12,163,0.06), transparent 70%);
    pointer-events: none;
    z-index: 0;
}

/* --- Scan lines (subtle CRT overlay) ----------------------------- */
.scan-lines {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 200;
    background: repeating-linear-gradient(
        to bottom,
        rgba(0,0,0,0)    0px,
        rgba(0,0,0,0)    1px,
        rgba(0,0,0,0.04) 1px,
        rgba(0,0,0,0.04) 2px
    );
    mix-blend-mode: multiply;
}

/* --- Orbital paths background ------------------------------------ */
.orbital-bg {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    opacity: 0.85;
    transition: transform 600ms ease-out;
}
.orbital-bg svg {
    width: 100%;
    height: 100%;
}

/* --- Top bar ------------------------------------------------------ */
.topbar {
    position: fixed;
    top: 0; left: 0; right: 0;
    height: var(--topbar-h);
    background: rgba(11, 22, 40, 0.85);
    border-bottom: 1px solid rgba(45, 74, 111, 0.6);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    z-index: 150;
    display: flex;
    align-items: center;
}
.topbar-inner {
    width: 100%;
    height: 100%;
    padding: 0 18px;
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
}
.brand {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: var(--c-screen);
    display: flex;
    align-items: center;
    gap: 10px;
}
.brand-mark { color: var(--c-cyan); }
.brand-divider { color: var(--c-grid-soft); }
.brand-status {
    color: var(--c-screen);
    opacity: 0.7;
}
.section-indicators {
    display: flex;
    gap: 8px;
    align-items: center;
    justify-content: center;
}
.indicator {
    display: inline-flex;
    width: 18px;
    height: 12px;
    align-items: center;
    justify-content: center;
    text-decoration: none;
}
.indicator i {
    display: block;
    width: 14px;
    height: 4px;
    background: rgba(45, 74, 111, 0.9);
    transition: background 220ms ease, transform 220ms ease;
}
.indicator:hover i { background: rgba(76, 201, 240, 0.5); }
.indicator.active i {
    background: var(--c-cyan);
    box-shadow: 0 0 8px rgba(76,201,240,0.55);
    transform: scaleY(1.4);
}
.topbar-meta {
    display: flex;
    gap: 14px;
    justify-content: flex-end;
    align-items: center;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--c-screen);
}
.meta-cell { opacity: 0.75; }
.meta-cell.pulse {
    color: var(--c-magenta);
    animation: pulseDot 1.6s ease-in-out infinite;
}
@keyframes pulseDot {
    0%, 100% { opacity: 1; }
    50%      { opacity: 0.35; }
}

/* --- Grid section / frame ---------------------------------------- */
.grid-section {
    position: relative;
    z-index: 2;
    padding: calc(var(--topbar-h) + 32px) 24px 24px;
    min-height: 100vh;
}
.grid-section:first-of-type {
    padding-top: calc(var(--topbar-h) + 24px);
    min-height: 100vh;
}
.section-frame {
    position: relative;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    grid-auto-rows: minmax(190px, auto);
    gap: var(--gutter);
    max-width: 1480px;
    margin: 0 auto;
    padding: 8px;
}

/* Grid lines layer (full-section lattice) */
.grid-lines {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
    overflow: hidden;
}
.grid-lines::before,
.grid-lines::after {
    content: "";
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(to right, rgba(45,74,111,0.45) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(45,74,111,0.45) 1px, transparent 1px);
    background-size: 25% 33.3333%;
    background-position: 0 0;
    animation: gridPulse 6s ease-in-out infinite;
}
.grid-lines::after {
    background-image:
        linear-gradient(to right, rgba(76,201,240,0.10) 1px, transparent 1px),
        linear-gradient(to bottom, rgba(76,201,240,0.10) 1px, transparent 1px);
    background-size: 25% 33.3333%;
    animation: gridPulse 6s ease-in-out -3s infinite;
}
@keyframes gridPulse {
    0%, 100% { opacity: 0.55; }
    50%      { opacity: 0.85; }
}

/* Grid reveal (section 00 first paint) */
.grid-section.boot .grid-lines::before,
.grid-section.boot .grid-lines::after {
    transform-origin: top left;
    animation: gridDraw 1.2s ease-out 0.05s 1 both,
               gridPulse 6s ease-in-out 1.4s infinite;
}
@keyframes gridDraw {
    0%   { opacity: 0; transform: scaleX(0); }
    40%  { opacity: 0.6; transform: scaleX(1); }
    70%  { opacity: 0.6; transform: scaleX(1) scaleY(0.05); }
    100% { opacity: 0.7; transform: scaleX(1) scaleY(1); }
}

/* --- Panels ------------------------------------------------------ */
.panel {
    position: relative;
    z-index: 1;
    background: linear-gradient(180deg, rgba(18, 34, 64, 0.92), rgba(11, 22, 40, 0.92));
    border: 1px solid rgba(45, 74, 111, 0.85);
    padding: 18px 20px;
    display: flex;
    flex-direction: column;
    gap: 10px;
    color: var(--c-screen);
    overflow: hidden;
    transition: box-shadow 300ms ease, border-color 300ms ease, transform 300ms ease;

    /* Panel reveal animation defaults; .visible state triggers */
    opacity: 0;
    transform: scale(0.96) translateY(8px);
}
.panel.visible {
    animation: panelFadeIn 460ms cubic-bezier(0.16, 0.84, 0.36, 1) forwards;
}
@keyframes panelFadeIn {
    0%   { opacity: 0; transform: scale(0.95) translateY(10px); }
    100% { opacity: 1; transform: scale(1) translateY(0); }
}

.panel::before {
    /* corner ticks */
    content: "";
    position: absolute;
    top: 6px; left: 6px;
    width: 10px; height: 10px;
    border-top: 1px solid var(--c-cyan);
    border-left: 1px solid var(--c-cyan);
    opacity: 0.55;
    pointer-events: none;
}
.panel::after {
    content: "";
    position: absolute;
    bottom: 6px; right: 6px;
    width: 10px; height: 10px;
    border-bottom: 1px solid var(--c-cyan);
    border-right: 1px solid var(--c-cyan);
    opacity: 0.55;
    pointer-events: none;
}

.panel:hover {
    box-shadow: inset 0 0 36px rgba(76, 201, 240, 0.10);
    border-color: rgba(76, 201, 240, 0.55);
}

/* Panel meta strip */
.panel-meta {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(232, 237, 245, 0.7);
    padding-bottom: 8px;
    border-bottom: 1px solid rgba(45, 74, 111, 0.6);
}
.meta-label { color: var(--c-screen); opacity: 0.85; }
.meta-time { margin-left: auto; opacity: 0.55; }

.status-dot {
    display: inline-block;
    width: 6px;
    height: 6px;
    border-radius: 50%;
    flex: 0 0 auto;
    box-shadow: 0 0 6px currentColor;
}
.dot-cyan    { background: var(--c-cyan);    color: var(--c-cyan); }
.dot-magenta { background: var(--c-magenta); color: var(--c-magenta); }
.dot-violet  { background: var(--c-violet);  color: var(--c-violet); }

/* status dot blink-once on panel reveal */
.panel.visible .status-dot {
    animation: dotBlink 700ms ease-out 220ms 1;
}
@keyframes dotBlink {
    0%   { transform: scale(1); }
    40%  { transform: scale(1.9); filter: brightness(1.6); }
    100% { transform: scale(1); filter: brightness(1); }
}

/* --- Typography in panels ---------------------------------------- */
.panel-title {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 18px;
    letter-spacing: 0.005em;
    color: var(--c-screen);
}
.panel-title.small { font-size: 16px; }
.panel-title-lg {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: clamp(26px, 2.8vw, 38px);
    line-height: 1.15;
    letter-spacing: -0.01em;
    color: var(--c-screen);
    margin-top: 4px;
}
.panel-body {
    font-family: var(--font-body);
    font-size: 15px;
    line-height: 1.7;
    color: rgba(232, 237, 245, 0.84);
}
.panel-body.small { font-size: 13.5px; line-height: 1.65; }
.panel-body b { color: var(--c-cyan); font-weight: 700; }

.panel-foot {
    margin-top: auto;
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: rgba(232, 237, 245, 0.7);
    letter-spacing: 0.04em;
    border-top: 1px dashed rgba(45, 74, 111, 0.6);
    padding-top: 8px;
}
.foot-key { color: var(--c-cyan); }
.foot-val { color: var(--c-screen); }

/* --- Hero block (Section 00) ------------------------------------- */
.panel-hero {
    justify-content: space-between;
    background: linear-gradient(160deg, rgba(18,34,64,0.95), rgba(11,22,40,0.92) 60%, rgba(58,12,163,0.18));
}
.hero-block {
    display: flex;
    align-items: center;
    gap: 18px;
    margin-top: 6px;
}
.hero-jp {
    font-family: var(--font-display);
    font-weight: 700;
    font-size: clamp(64px, 10vw, 168px);
    line-height: 0.92;
    letter-spacing: -0.02em;
    color: var(--c-screen);
    position: relative;
    overflow: hidden;
}
.hero-jp .hero-jp-glyph {
    font-family: var(--font-jp);
    font-weight: 500;
    background: linear-gradient(120deg, var(--c-cyan) 0%, var(--c-screen) 50%, var(--c-magenta) 100%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    display: inline-block;
    transform: translateY(110%);
    animation: heroRise 1.0s cubic-bezier(0.16, 0.84, 0.36, 1) 1.25s 1 forwards;
}
@keyframes heroRise {
    0%   { transform: translateY(110%); opacity: 0.2; }
    60%  { transform: translateY(-6%); opacity: 1; }
    100% { transform: translateY(0); opacity: 1; }
}
.hero-cursor {
    width: 4px;
    height: clamp(48px, 6vw, 96px);
    background: var(--c-magenta);
    box-shadow: 0 0 12px var(--c-magenta);
    animation: blink 1.0s steps(2, end) infinite;
    margin-bottom: 6px;
}
@keyframes blink {
    0%, 49%   { opacity: 1; }
    50%, 100% { opacity: 0; }
}

.hero-tag {
    font-family: var(--font-mono);
    font-size: 13px;
    letter-spacing: 0.08em;
    color: rgba(232, 237, 245, 0.8);
    display: flex;
    flex-wrap: wrap;
    align-items: baseline;
    gap: 10px;
    margin-top: 8px;
}
.tag-mark { color: var(--c-cyan); }
.tag-sep { color: var(--c-grid-soft); }
.tag-desc { color: rgba(232,237,245,0.68); }

.hero-lede {
    font-family: var(--font-body);
    font-size: 16px;
    line-height: 1.65;
    max-width: 56ch;
    color: rgba(232, 237, 245, 0.86);
    margin-top: 4px;
}

.hero-readout {
    margin-top: auto;
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    border-top: 1px solid rgba(45,74,111,0.6);
    padding-top: 12px;
}
.readout-row {
    display: flex;
    flex-direction: column;
    gap: 2px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.10em;
    text-transform: uppercase;
}
.readout-row span { color: rgba(232,237,245,0.55); }
.readout-row b { color: var(--c-cyan); font-size: 14px; font-weight: 700; }

/* --- Visualizations ---------------------------------------------- */
.viz {
    width: 100%;
    height: auto;
    display: block;
    margin-top: 4px;
    flex: 1 1 auto;
}
.viz-area-line { stroke-dasharray: 600; stroke-dashoffset: 600; }
.panel.visible .viz-area-line { animation: drawLine 1.5s ease-out 350ms forwards; }
.viz-line-trace { stroke-dasharray: 760; stroke-dashoffset: 760; }
.panel.visible .viz-line-trace { animation: drawLine 1.6s ease-out 380ms forwards; }
.panel.visible .viz-line-trace.alt { animation-delay: 520ms; }
.viz-cascade path { stroke-dasharray: 520; stroke-dashoffset: 520; }
.panel.visible .viz-cascade path { animation: drawLine 1.4s ease-out 320ms forwards; }
.panel.visible .viz-cascade path:last-of-type { animation-delay: 480ms; }
@keyframes drawLine {
    to { stroke-dashoffset: 0; }
}

.viz-radial-poly {
    transform-origin: center;
    transform: scale(0.5);
    opacity: 0;
}
.panel.visible .viz-radial-poly {
    animation: radialPop 700ms cubic-bezier(0.16, 0.84, 0.36, 1) 320ms forwards;
}
@keyframes radialPop {
    0%   { transform: scale(0.4); opacity: 0; }
    60%  { transform: scale(1.04); opacity: 1; }
    100% { transform: scale(1); opacity: 1; }
}

.viz-bar { transform-origin: bottom; transform: scaleY(0); }
.panel.visible .viz-bar { animation: barRise 700ms cubic-bezier(0.16, 0.84, 0.36, 1) forwards; }
.panel.visible .viz-bar:nth-child(1)  { animation-delay: 160ms; }
.panel.visible .viz-bar:nth-child(2)  { animation-delay: 220ms; }
.panel.visible .viz-bar:nth-child(3)  { animation-delay: 280ms; }
.panel.visible .viz-bar:nth-child(4)  { animation-delay: 340ms; }
.panel.visible .viz-bar:nth-child(5)  { animation-delay: 400ms; }
.panel.visible .viz-bar:nth-child(6)  { animation-delay: 460ms; }
.panel.visible .viz-bar:nth-child(7)  { animation-delay: 520ms; }
.panel.visible .viz-bar:nth-child(8)  { animation-delay: 580ms; }
.panel.visible .viz-bar:nth-child(9)  { animation-delay: 640ms; }
.panel.visible .viz-bar:nth-child(10) { animation-delay: 700ms; }
.panel.visible .viz-bar:nth-child(11) { animation-delay: 760ms; }
@keyframes barRise {
    to { transform: scaleY(1); }
}

.viz-orbital .orbit-node {
    transform-origin: 100px 120px;
}
.viz-orbital .orbit-node:nth-of-type(2) { animation: orbitSpin 14s linear infinite; }
.viz-orbital .orbit-node:nth-of-type(3) { animation: orbitSpin 22s linear infinite reverse; }
.viz-orbital .orbit-node:nth-of-type(4) { animation: orbitSpin 36s linear infinite; }
@keyframes orbitSpin {
    from { transform: rotate(0); }
    to   { transform: rotate(360deg); }
}

.viz-point {
    cursor: pointer;
    transition: transform 180ms ease, filter 180ms ease;
    transform-origin: center;
    transform-box: fill-box;
}
.viz-point:hover {
    transform: scale(1.4);
    filter: drop-shadow(0 0 6px currentColor);
}

/* Network panel */
.viz-network { width: 100%; height: auto; }
.net-edges line {
    stroke-dasharray: 360;
    stroke-dashoffset: 360;
}
.panel.visible .net-edges line { animation: drawLine 1.4s ease-out 280ms forwards; }
.panel.visible .net-edges line:nth-child(2n)  { animation-delay: 360ms; }
.panel.visible .net-edges line:nth-child(3n)  { animation-delay: 460ms; }
.panel.visible .net-edges line:nth-child(5n)  { animation-delay: 540ms; }

.net-nodes .node circle {
    transform-origin: center;
    transform-box: fill-box;
    transform: scale(0);
    cursor: pointer;
    transition: transform 200ms ease, filter 200ms ease;
}
.panel.visible .net-nodes .node:nth-child(1)  circle { animation: nodePop 480ms ease-out 600ms forwards; }
.panel.visible .net-nodes .node:nth-child(2)  circle { animation: nodePop 480ms ease-out 660ms forwards; }
.panel.visible .net-nodes .node:nth-child(3)  circle { animation: nodePop 480ms ease-out 720ms forwards; }
.panel.visible .net-nodes .node:nth-child(4)  circle { animation: nodePop 480ms ease-out 780ms forwards; }
.panel.visible .net-nodes .node:nth-child(5)  circle { animation: nodePop 480ms ease-out 840ms forwards; }
.panel.visible .net-nodes .node:nth-child(6)  circle { animation: nodePop 480ms ease-out 900ms forwards; }
.panel.visible .net-nodes .node:nth-child(7)  circle { animation: nodePop 480ms ease-out 960ms forwards; }
.panel.visible .net-nodes .node:nth-child(8)  circle { animation: nodePop 480ms ease-out 1020ms forwards; }
.panel.visible .net-nodes .node:nth-child(9)  circle { animation: nodePop 480ms ease-out 1080ms forwards; }
.panel.visible .net-nodes .node:nth-child(10) circle { animation: nodePop 480ms ease-out 1140ms forwards; }
.panel.visible .net-nodes .node:nth-child(11) circle { animation: nodePop 480ms ease-out 1200ms forwards; }
.net-nodes .node:hover circle {
    transform: scale(1.5);
    filter: drop-shadow(0 0 8px currentColor);
}
@keyframes nodePop {
    0%   { transform: scale(0); }
    70%  { transform: scale(1.18); }
    100% { transform: scale(1); }
}

/* Dial */
.viz-dial { width: 100%; max-height: 100px; }
.dial-arc { transition: stroke-dashoffset 1.0s ease-out; }
.dial-needle {
    transform-origin: 80px 90px;
    transform: rotate(-90deg);
}
.panel.visible .dial-needle { animation: needleSwing 1.2s cubic-bezier(0.34, 1.56, 0.64, 1) 280ms forwards; }
@keyframes needleSwing {
    0%   { transform: rotate(-90deg); }
    60%  { transform: rotate(8deg); }
    100% { transform: rotate(-12deg); }
}
.dial-readout {
    display: flex;
    align-items: baseline;
    gap: 8px;
    font-family: var(--font-mono);
    margin-top: -6px;
}
.dial-num { color: var(--c-cyan); font-size: 22px; font-weight: 700; }
.dial-cap { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: rgba(232,237,245,0.55); }

/* Mini bars */
.bars-mini {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 4px;
    align-items: end;
    height: 70px;
    margin-top: 4px;
}
.bars-mini i {
    display: block;
    width: 100%;
    height: var(--h, 50%);
    background: linear-gradient(to top, var(--c-violet), var(--c-cyan));
    opacity: 0.85;
    transform-origin: bottom;
    transform: scaleY(0);
}
.panel.visible .bars-mini i { animation: barRise 600ms ease-out forwards; }
.panel.visible .bars-mini i:nth-child(1) { animation-delay: 200ms; }
.panel.visible .bars-mini i:nth-child(2) { animation-delay: 250ms; }
.panel.visible .bars-mini i:nth-child(3) { animation-delay: 300ms; }
.panel.visible .bars-mini i:nth-child(4) { animation-delay: 350ms; }
.panel.visible .bars-mini i:nth-child(5) { animation-delay: 400ms; }
.panel.visible .bars-mini i:nth-child(6) { animation-delay: 450ms; }
.panel.visible .bars-mini i:nth-child(7) { animation-delay: 500ms; }
.panel.visible .bars-mini i:nth-child(8) { animation-delay: 550ms; }

/* Bars legend */
.bars-legend {
    display: flex;
    gap: 16px;
    margin-top: 4px;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.10em;
    text-transform: uppercase;
    color: rgba(232,237,245,0.65);
}
.bars-legend span { display: inline-flex; align-items: center; gap: 6px; }
.bars-legend i {
    display: inline-block;
    width: 10px; height: 10px;
}
.lg-cyan { background: var(--c-cyan); }
.lg-magenta { background: var(--c-magenta); }
.lg-violet { background: var(--c-violet); }
.lg-cyan-thin { background: rgba(76,201,240,0.4); border: 1px solid var(--c-cyan); }

/* --- Clock + counter --------------------------------------------- */
.clock-display {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 30px;
    letter-spacing: 0.04em;
    color: var(--c-cyan);
    text-shadow: 0 0 14px rgba(76,201,240,0.35);
    margin-top: 4px;
}
.clock-bar {
    height: 4px;
    background: rgba(45,74,111,0.55);
    overflow: hidden;
    margin-top: 4px;
}
.clock-bar i {
    display: block;
    height: 100%;
    width: var(--w, 50%);
    background: linear-gradient(to right, var(--c-cyan), var(--c-magenta));
}
.clock-foot {
    margin-top: auto;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    color: rgba(232,237,245,0.55);
    text-transform: uppercase;
}

.counter-large {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: clamp(36px, 4vw, 56px);
    letter-spacing: 0.02em;
    line-height: 1;
    color: var(--c-cyan);
    text-shadow: 0 0 12px rgba(76,201,240,0.30);
    margin: 6px 0 4px;
}
.counter-cap {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    color: rgba(232,237,245,0.6);
    text-transform: uppercase;
}

/* --- Ledger ------------------------------------------------------ */
.ledger-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-top: 4px;
}
.ledger-list li {
    display: grid;
    grid-template-columns: 64px 1fr;
    align-items: baseline;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(45,74,111,0.55);
    font-family: var(--font-mono);
    font-size: 12.5px;
    letter-spacing: 0.06em;
}
.ledger-list li span { color: var(--c-cyan); font-weight: 700; }
.ledger-list li b { color: var(--c-screen); font-weight: 600; opacity: 0.85; }

/* --- Manifest tags ----------------------------------------------- */
.manifest-tags {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin-top: 4px;
}
.tag {
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: 0.06em;
    color: var(--c-cyan);
    background: rgba(76,201,240,0.08);
    border: 1px solid rgba(76,201,240,0.4);
    padding: 4px 10px;
    text-transform: uppercase;
}

/* --- Version ----------------------------------------------------- */
.version-block { margin-top: 4px; }
.ver-large {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 26px;
    color: var(--c-cyan);
    margin-bottom: 4px;
}
.ver-line {
    font-family: var(--font-mono);
    font-size: 11.5px;
    letter-spacing: 0.06em;
    color: rgba(232,237,245,0.65);
}

/* --- Axiom list -------------------------------------------------- */
.axiom-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 12px;
    margin-top: 4px;
}
.axiom-list li {
    display: grid;
    grid-template-columns: 56px 1fr 80px;
    align-items: start;
    padding: 12px 0;
    border-top: 1px solid rgba(45,74,111,0.45);
    gap: 14px;
}
.axiom-id {
    font-family: var(--font-mono);
    color: var(--c-cyan);
    font-size: 13px;
    font-weight: 700;
    letter-spacing: 0.08em;
}
.axiom-body h4 {
    font-family: var(--font-display);
    font-weight: 600;
    font-size: 17px;
    color: var(--c-screen);
    margin-bottom: 4px;
}
.axiom-body p {
    font-family: var(--font-body);
    font-size: 14px;
    line-height: 1.6;
    color: rgba(232,237,245,0.78);
}
.axiom-tag {
    justify-self: end;
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    padding: 2px 8px;
    border: 1px solid rgba(45,74,111,0.7);
    height: fit-content;
}
.axiom-tag:nth-of-type(1),
.axiom-list li:nth-child(1) .axiom-tag { color: var(--c-cyan); border-color: rgba(76,201,240,0.5); }
.axiom-list li:nth-child(2) .axiom-tag { color: var(--c-magenta); border-color: rgba(247,37,133,0.5); }
.axiom-list li:nth-child(3) .axiom-tag { color: var(--c-violet); border-color: rgba(114,9,183,0.6); }
.axiom-list li:nth-child(4) .axiom-tag { color: var(--c-cyan); border-color: rgba(76,201,240,0.5); }

/* --- Quote / cite ------------------------------------------------ */
.quote {
    font-family: var(--font-display);
    font-style: italic;
    font-size: 15.5px;
    line-height: 1.55;
    color: var(--c-screen);
    border-left: 2px solid var(--c-magenta);
    padding-left: 12px;
    margin: 4px 0;
}
.cite-foot {
    display: flex;
    justify-content: space-between;
    margin-top: auto;
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: rgba(232,237,245,0.6);
}
.cite-name { color: var(--c-screen); opacity: 0.8; }
.cite-id   { color: var(--c-magenta); }

/* --- Model table ------------------------------------------------- */
.model-table {
    margin-top: 8px;
    border: 1px solid rgba(45,74,111,0.6);
}
.model-table .row {
    display: grid;
    grid-template-columns: 64px 1.5fr 1fr 0.6fr 0.8fr;
    gap: 12px;
    padding: 10px 14px;
    border-bottom: 1px dashed rgba(45,74,111,0.55);
    font-family: var(--font-mono);
    font-size: 12.5px;
    letter-spacing: 0.04em;
    align-items: center;
}
.model-table .row:last-child { border-bottom: none; }
.model-table .row.head {
    background: rgba(45, 74, 111, 0.25);
    color: rgba(232,237,245,0.7);
    text-transform: uppercase;
    font-size: 11px;
    letter-spacing: 0.12em;
}
.model-table .row span:first-child { color: var(--c-cyan); }
.model-table .row span:nth-child(2) { color: var(--c-screen); font-family: var(--font-display); font-weight: 600; font-size: 14px; letter-spacing: 0; }
.model-table .row.dim { opacity: 0.5; }
.st-cyan    { color: var(--c-cyan); }
.st-magenta { color: var(--c-magenta); }
.st-violet  { color: var(--c-violet); }
.st-dim     { color: rgba(232,237,245,0.45); }

/* --- Phase grid -------------------------------------------------- */
.phase-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 4px;
    margin: 6px 0;
    aspect-ratio: 1 / 1;
    max-width: 130px;
}
.phase-grid .cell {
    width: 100%;
    aspect-ratio: 1 / 1;
    background: rgba(45,74,111,0.45);
}
.phase-grid .cell.on  { background: var(--c-cyan); box-shadow: 0 0 6px rgba(76,201,240,0.5); }
.phase-grid .cell.mag { background: var(--c-magenta); box-shadow: 0 0 6px rgba(247,37,133,0.6); }

/* --- Coh grid (4 stat cells) ------------------------------------- */
.coh-grid {
    margin-top: 12px;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}
.coh-cell {
    background: rgba(45, 74, 111, 0.18);
    border: 1px solid rgba(45,74,111,0.55);
    padding: 14px 14px;
}
.coh-num {
    font-family: var(--font-mono);
    font-size: 32px;
    font-weight: 700;
    color: var(--c-cyan);
    line-height: 1;
}
.coh-cap {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(232,237,245,0.55);
    margin-top: 4px;
}

/* --- Alerts ------------------------------------------------------ */
.alerts-list {
    list-style: none;
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 4px;
}
.alerts-list li {
    display: grid;
    grid-template-columns: 70px 110px 1fr;
    align-items: center;
    gap: 14px;
    padding: 10px 0;
    border-top: 1px solid rgba(45,74,111,0.4);
    font-size: 13.5px;
}
.al-time {
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--c-cyan);
    letter-spacing: 0.06em;
}
.al-tag {
    font-family: var(--font-mono);
    font-size: 11px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 3px 8px;
    border: 1px solid currentColor;
    text-align: center;
    width: fit-content;
}
.al-cyan    { color: var(--c-cyan); }
.al-magenta { color: var(--c-magenta); }
.al-violet  { color: var(--c-violet); }
.al-msg { color: rgba(232,237,245,0.8); font-family: var(--font-body); }

/* --- Legend list (network) --------------------------------------- */
.legend-list {
    list-style: none;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 10px 18px;
    margin-top: 4px;
}
.legend-list li {
    display: grid;
    grid-template-columns: 18px auto 1fr;
    align-items: center;
    gap: 10px;
    font-family: var(--font-mono);
    font-size: 12.5px;
}
.legend-list b { color: var(--c-screen); font-weight: 700; letter-spacing: 0.04em; }
.legend-list span { color: rgba(232,237,245,0.6); font-size: 11.5px; letter-spacing: 0.04em; }
.lg-dot {
    display: inline-block;
    width: 10px; height: 10px;
    border-radius: 50%;
}

/* --- Hub status -------------------------------------------------- */
.hub-status {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 6px;
}
.hub-line {
    display: flex;
    justify-content: space-between;
    font-family: var(--font-mono);
    font-size: 12.5px;
    padding: 6px 0;
    border-bottom: 1px dashed rgba(45,74,111,0.55);
}
.hub-line span { color: rgba(232,237,245,0.6); letter-spacing: 0.06em; text-transform: uppercase; font-size: 11.5px; }
.hub-line b { color: var(--c-cyan); font-weight: 700; }

/* --- Channel rows ------------------------------------------------ */
.channel-row {
    display: grid;
    grid-template-columns: 76px 1fr;
    gap: 12px;
    align-items: center;
    padding: 8px 0;
    border-top: 1px solid rgba(45,74,111,0.4);
    font-family: var(--font-mono);
    font-size: 13px;
}
.channel-row:first-of-type { margin-top: auto; }
.ch-key { color: var(--c-magenta); letter-spacing: 0.16em; font-size: 11px; text-transform: uppercase; }
.ch-val { color: var(--c-screen); }

/* --- Serial / barcode ------------------------------------------- */
.serial-num {
    font-family: var(--font-mono);
    font-weight: 700;
    font-size: 22px;
    color: var(--c-cyan);
    margin: 6px 0 2px;
    letter-spacing: 0.06em;
}
.serial-bars {
    display: flex;
    gap: 2px;
    height: 26px;
    align-items: stretch;
    margin-top: 8px;
}
.serial-bars i {
    display: block;
    background: var(--c-screen);
    opacity: 0.85;
}
.serial-bars i:nth-child(1)  { width: 3px; }
.serial-bars i:nth-child(2)  { width: 1px; }
.serial-bars i:nth-child(3)  { width: 5px; }
.serial-bars i:nth-child(4)  { width: 2px; }
.serial-bars i:nth-child(5)  { width: 1px; }
.serial-bars i:nth-child(6)  { width: 6px; }
.serial-bars i:nth-child(7)  { width: 2px; }
.serial-bars i:nth-child(8)  { width: 4px; }
.serial-bars i:nth-child(9)  { width: 1px; }
.serial-bars i:nth-child(10) { width: 3px; }
.serial-bars i:nth-child(11) { width: 5px; }
.serial-bars i:nth-child(12) { width: 2px; }

/* --- Entries grid ------------------------------------------------ */
.entries-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 10px;
    margin-top: 6px;
}
.entry {
    background: rgba(45,74,111,0.12);
    border: 1px solid rgba(45,74,111,0.55);
    padding: 12px 12px 10px;
    display: flex;
    flex-direction: column;
    gap: 6px;
    transition: border-color 220ms ease, transform 220ms ease;
}
.entry:hover {
    border-color: rgba(76,201,240,0.55);
    transform: translateY(-2px);
}
.entry-id {
    font-family: var(--font-mono);
    font-size: 11px;
    color: var(--c-cyan);
    letter-spacing: 0.10em;
}
.entry-name {
    font-family: var(--font-display);
    font-size: 14px;
    font-weight: 600;
    color: var(--c-screen);
    line-height: 1.3;
    flex: 1 1 auto;
}
.entry-tag {
    font-family: var(--font-mono);
    font-size: 10.5px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    padding: 2px 7px;
    border: 1px solid currentColor;
    width: fit-content;
}
.tag-cyan    { color: var(--c-cyan); }
.tag-magenta { color: var(--c-magenta); }
.tag-violet  { color: var(--c-violet); }
.entry-date {
    font-family: var(--font-mono);
    font-size: 11px;
    color: rgba(232,237,245,0.5);
}

/* --- Footer block ------------------------------------------------ */
.footer-block {
    display: flex;
    flex-direction: column;
    gap: 14px;
    margin-top: 4px;
}
.footer-brand {
    display: flex;
    align-items: baseline;
    gap: 14px;
}
.fb-jp {
    font-family: var(--font-jp);
    font-weight: 500;
    font-size: 32px;
    color: var(--c-cyan);
}
.fb-en {
    font-family: var(--font-mono);
    font-size: 14px;
    color: var(--c-screen);
    letter-spacing: 0.10em;
}
.footer-meta {
    display: flex;
    flex-direction: column;
    gap: 4px;
    font-family: var(--font-mono);
    font-size: 11.5px;
    color: rgba(232,237,245,0.55);
    letter-spacing: 0.06em;
    margin-top: auto;
}

/* --- Tooltip ----------------------------------------------------- */
.tooltip {
    position: fixed;
    z-index: 300;
    pointer-events: none;
    background: rgba(11,22,40,0.95);
    border-left: 2px solid var(--c-cyan);
    padding: 8px 12px;
    font-family: var(--font-mono);
    font-size: 12px;
    color: var(--c-screen);
    letter-spacing: 0.04em;
    box-shadow: 0 8px 24px rgba(0,0,0,0.45);
    opacity: 0;
    transform: translateY(-2px);
    transition: opacity 150ms ease, transform 150ms ease;
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 140px;
}
.tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}
#tipLabel { color: rgba(232,237,245,0.65); font-size: 11px; letter-spacing: 0.10em; text-transform: uppercase; }
#tipValue { color: var(--c-cyan); font-weight: 700; }

/* --- Responsive: tablets ---------------------------------------- */
@media (max-width: 1100px) {
    .section-frame {
        grid-template-columns: repeat(4, 1fr);
        gap: 12px;
    }
    .panel-title-lg { font-size: clamp(24px, 3.6vw, 32px); }
    .entries-grid { grid-template-columns: repeat(3, 1fr); }
    .alerts-list li { grid-template-columns: 60px 100px 1fr; gap: 10px; }
}

/* --- Responsive: mobile (single column data feed) --------------- */
@media (max-width: 768px) {
    .section-frame {
        grid-template-columns: 1fr;
        grid-auto-rows: auto;
        gap: 0;
        padding: 0;
    }
    /* Force every panel to a single full-width column */
    .panel {
        grid-column: 1 / -1 !important;
        grid-row: auto !important;
        border-bottom: none;
    }
    .panel + .panel { border-top: 1px solid rgba(45,74,111,0.6); }
    .panel:last-child { border-bottom: 1px solid rgba(45,74,111,0.6); }

    .grid-section { padding: calc(var(--topbar-h) + 16px) 12px 12px; }

    .topbar-inner { grid-template-columns: 1fr auto; }
    .topbar-meta { display: none; }
    .section-indicators { gap: 5px; }
    .indicator i { width: 10px; }

    .hero-jp { font-size: clamp(56px, 22vw, 110px); }
    .hero-readout { grid-template-columns: repeat(2, 1fr); }
    .coh-grid { grid-template-columns: 1fr 1fr; }
    .entries-grid { grid-template-columns: 1fr 1fr; }
    .axiom-list li { grid-template-columns: 48px 1fr; }
    .axiom-tag { display: none; }
    .model-table .row {
        grid-template-columns: 50px 1fr 0.6fr;
    }
    .model-table .row span:nth-child(3),
    .model-table .row span:nth-child(4) { display: none; }
    .alerts-list li { grid-template-columns: 56px 80px 1fr; gap: 8px; }
    .legend-list { grid-template-columns: 1fr; }
}

/* --- Reduced motion --------------------------------------------- */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
    }
    .panel { opacity: 1; transform: none; }
    .hero-jp .hero-jp-glyph { transform: none; opacity: 1; }
    .viz-area-line, .viz-line-trace, .viz-cascade path, .net-edges line { stroke-dashoffset: 0; }
    .viz-bar, .bars-mini i { transform: scaleY(1); }
    .viz-radial-poly { transform: scale(1); opacity: 1; }
    .net-nodes .node circle { transform: scale(1); }
}
