/* ==========================================================================
   TimeHexOn - Shared Stylesheet
   The time travelling monk's permacomputer aesthetic
   Dark, minimal, monospace. Hexagonal truth tessellates.
   ========================================================================== */

/* --------------------------------------------------------------------------
   CSS Custom Properties
   -------------------------------------------------------------------------- */

:root {
    --bg-primary: #50404d;
    --bg-secondary: #3d3139;
    --bg-tertiary: #453a42;
    --bg-panel: #382e35;

    --text-primary: #fff;
    --text-secondary: #ccc;
    --text-muted: #999;
    --text-dim: #777;

    --accent: #4a9a6a;
    --accent-bright: #6abf8a;
    --accent-dim: #3a6a4a;
    --accent-glow: rgba(74, 154, 106, 0.4);
    --accent-glow-strong: rgba(74, 154, 106, 0.7);

    --border-color: #222;
    --border-accent: #4a9a6a;
    --border-subtle: #1a1a1a;

    --code-bg: #453a42;
    --code-border: #222;
    --pre-bg: #3d3139;
    --pre-text: #c8c8c8;

    --shadow: rgba(0, 0, 0, 0.6);
    --shadow-accent: rgba(74, 154, 106, 0.15);

    --font-mono: "IBM Plex Mono", "Fira Mono", "Source Code Pro", "Courier New", "Consolas", monospace;
    --container-width: 900px;

    --hex-clip: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);

    --accent-red: #D40000;
    --accent-red-dim: rgba(212, 0, 0, 0.15);

    --accent-blue: #0044CC;
    --accent-blue-bright: #3377EE;
    --accent-purple: #8822CC;
    --accent-gold: #CC8800;
    --accent-cyan: #00AACC;
    --accent-yellow: #CCAA00;

    --shadow-sm: 0 1px 3px rgba(0,0,0,0.5), 0 0 2px rgba(74,154,106,0.1);
    --shadow-md: 0 2px 8px rgba(0,0,0,0.5), 0 0 6px rgba(74,154,106,0.15);
    --shadow-lg: 0 4px 16px rgba(0,0,0,0.5), 0 0 12px rgba(74,154,106,0.2);
    --glow-sm: 0 0 8px rgba(74,154,106,0.3);
    --glow-md: 0 0 16px rgba(74,154,106,0.4);

    --transition-default: 0.25s cubic-bezier(0.4, 0, 0.2, 1);

    --space-xs: 0.25rem;
    --space-sm: 0.5rem;
    --space-md: 1rem;
    --space-lg: 1.5rem;
    --space-xl: 2rem;
    --space-2xl: 3rem;
}


/* --------------------------------------------------------------------------
   Reset & Base
   -------------------------------------------------------------------------- */

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

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    background:
        repeating-linear-gradient(
            0deg,
            transparent,
            transparent 58px,
            rgba(74,154,106,0.03) 58px,
            rgba(74,154,106,0.03) 60px
        ),
        repeating-linear-gradient(
            60deg,
            transparent,
            transparent 58px,
            rgba(74,154,106,0.03) 58px,
            rgba(74,154,106,0.03) 60px
        ),
        repeating-linear-gradient(
            120deg,
            transparent,
            transparent 58px,
            rgba(74,154,106,0.03) 58px,
            rgba(74,154,106,0.03) 60px
        ),
        radial-gradient(ellipse at 50% 0%, #080d08 0%, #000 70%);
    color: var(--text-primary);
    font-family: var(--font-mono);
    line-height: 1.7;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}


/* --------------------------------------------------------------------------
   Typography
   -------------------------------------------------------------------------- */

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-mono);
    font-weight: 700;
    line-height: 1.3;
    color: var(--text-primary);
    letter-spacing: -0.02em;
}

h1 {
    font-size: clamp(1.8rem, 5vw, 2.6rem);
    margin-bottom: 1.5rem;
    padding-bottom: 0.75rem;
    border-bottom: 2px solid var(--accent);
    text-shadow: 0 0 20px var(--accent-glow);
    position: relative;
}

h1::before {
    content: "/// ";
    color: var(--accent);
    font-weight: 400;
}

h1::after {
    content: "\2B21";
    position: absolute;
    right: 0;
    top: 50%;
    transform: translateY(-50%);
    font-size: 3rem;
    opacity: 0.06;
    color: var(--accent);
}

h2 {
    font-size: 1.4rem;
    margin-top: 2.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.4rem;
    border-bottom: 1px solid var(--border-color);
    color: var(--text-secondary);
}

h2::before {
    content: "// ";
    color: var(--accent-dim);
    font-weight: 400;
}

h3 {
    font-size: 1.15rem;
    margin-top: 2rem;
    margin-bottom: 0.75rem;
    color: var(--accent-bright);
}

h4 {
    font-size: 1rem;
    margin-top: 1.5rem;
    margin-bottom: 0.5rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    font-size: 0.85rem;
}

p {
    margin-bottom: 1rem;
    overflow-wrap: break-word;
    word-break: break-word;
}

strong {
    color: var(--text-primary);
    font-weight: 700;
}

em {
    color: var(--text-secondary);
    font-style: italic;
}

small {
    font-size: 0.85rem;
    color: var(--text-muted);
}

hr {
    border: none;
    border-top: 1px solid var(--border-color);
    margin: 2rem 0;
}


/* --------------------------------------------------------------------------
   Links
   -------------------------------------------------------------------------- */

a {
    color: var(--accent-bright);
    text-decoration: none;
    transition: color 0.2s ease, text-shadow 0.2s ease;
    border-bottom: 1px solid transparent;
}

a:hover,
a:focus {
    color: #8ad5a8;
    text-shadow: 0 0 12px var(--accent-glow), 0 0 20px var(--accent-glow);
    border-bottom-color: var(--accent);
}

a:active {
    color: var(--accent);
    transform: scale(0.98);
}

a:visited {
    color: var(--accent);
}


/* --------------------------------------------------------------------------
   Layout: Container
   -------------------------------------------------------------------------- */

.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 2rem 1.5rem;
}


/* --------------------------------------------------------------------------
   Layout: Page Grid
   -------------------------------------------------------------------------- */

.page {
    display: grid;
    grid-template-columns: 1fr;
    grid-template-rows: auto 1fr auto;
    min-height: 100vh;
    grid-template-areas:
        "header"
        "main"
        "footer";
}

.page-header {
    grid-area: header;
}

.page-main {
    grid-area: main;
}

.page-footer {
    grid-area: footer;
}


/* --------------------------------------------------------------------------
   Layout: Content Grids
   -------------------------------------------------------------------------- */

.grid-2 {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
}

.grid-3 {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.5rem;
}

.grid-auto {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
}


/* --------------------------------------------------------------------------
   Navigation
   -------------------------------------------------------------------------- */

.nav {
    background: var(--bg-secondary);
    border-bottom: 1px solid var(--border-color);
    padding: 0.75rem 0;
}

.nav .container {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 2rem;
    align-items: center;
    padding-top: 0;
    padding-bottom: 0;
}

.nav-brand {
    font-weight: 700;
    font-size: 1rem;
    color: var(--text-primary);
    text-decoration: none;
    border-bottom: none;
    letter-spacing: 0.05em;
}

.nav-brand:hover {
    color: var(--accent-bright);
    text-shadow: 0 0 8px var(--accent-glow);
    border-bottom: none;
}

.nav-links {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 1.5rem;
    justify-self: end;
    list-style: none;
}

.nav-links a {
    color: var(--text-muted);
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    padding: 0.25rem 0;
    border-bottom: 1px solid transparent;
}

.nav-links a:hover {
    color: var(--accent-bright);
    border-bottom-color: var(--accent);
    text-shadow: 0 0 8px var(--accent-glow);
}

.nav-links a.active {
    color: var(--accent-bright);
    border-bottom-color: var(--accent);
}


/* --------------------------------------------------------------------------
   Breadcrumb
   -------------------------------------------------------------------------- */

.breadcrumb {
    list-style: none;
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 0;
    align-items: center;
    font-size: 0.85rem;
    color: var(--text-muted);
    margin-bottom: 1.5rem;
    padding: 0.5rem 0;
}

.breadcrumb li {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: max-content;
    gap: 0;
    align-items: center;
}

.breadcrumb li + li::before {
    content: " / ";
    color: var(--text-dim);
    margin: 0 0.5rem;
    white-space: pre;
}

.breadcrumb a {
    color: var(--text-muted);
    font-size: 0.85rem;
}

.breadcrumb a:hover {
    color: var(--accent-bright);
}

.breadcrumb .current {
    color: var(--text-secondary);
}


/* --------------------------------------------------------------------------
   Back Link
   -------------------------------------------------------------------------- */

.back-link {
    display: inline-block;
    margin-bottom: 1.5rem;
    color: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    transition: color 0.2s ease, text-shadow 0.2s ease;
}

.back-link::before {
    content: "<- ";
}

.back-link:hover {
    color: var(--accent-bright);
    text-shadow: 0 0 8px var(--accent-glow);
}


/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */

.section {
    margin-bottom: 3rem;
    padding-bottom: 2rem;
    border-bottom: none;
}

.section::after {
    content: "\2B21 \2B21 \2B21";
    display: block;
    text-align: center;
    color: var(--accent-dim);
    margin-top: 2rem;
    letter-spacing: 0.5em;
    opacity: 0.3;
}

.section:last-child {
    border-bottom: none;
    margin-bottom: 0;
}

.section:last-child::after {
    display: none;
}

.section-header {
    margin-bottom: 1.5rem;
}

.intro {
    font-size: 1.05rem;
    color: var(--text-secondary);
    margin-bottom: 2rem;
    font-style: italic;
    border-left: 2px solid var(--accent-dim);
    padding-left: 1rem;
}


/* --------------------------------------------------------------------------
   Cards & Panels
   -------------------------------------------------------------------------- */

.card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    padding: 1.5rem;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-default), box-shadow var(--transition-default), border-color var(--transition-default);
}

.card:hover {
    border-color: var(--accent-dim);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), var(--glow-sm);
}

.card-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.75rem;
    color: var(--text-primary);
}

.card-body {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.panel {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent);
    padding: 1.5rem;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-sm);
}

.panel-title {
    font-weight: 700;
    margin-bottom: 0.5rem;
    color: var(--accent-bright);
}


/* --------------------------------------------------------------------------
   Hexagonal Card (decorative variant)
   -------------------------------------------------------------------------- */

.hex-card {
    background: var(--bg-panel);
    border: 1px solid var(--accent-dim);
    padding: 1.5rem;
    position: relative;
    clip-path: polygon(
        4% 0%, 96% 0%,
        100% 4%, 100% 96%,
        96% 100%, 4% 100%,
        0% 96%, 0% 4%
    );
}

.hex-card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--accent), transparent);
}

/* Hex decorative element */
.hex-motif {
    width: 48px;
    height: 48px;
    background: var(--accent-dim);
    clip-path: var(--hex-clip);
    display: inline-block;
    opacity: 0.6;
}

.hex-motif-sm {
    width: 24px;
    height: 24px;
    background: var(--accent-dim);
    clip-path: var(--hex-clip);
    display: inline-block;
    opacity: 0.4;
}

.hex-border {
    border: 1px solid var(--accent-dim);
    clip-path: polygon(
        4% 0%, 96% 0%,
        100% 4%, 100% 96%,
        96% 100%, 4% 100%,
        0% 96%, 0% 4%
    );
}


/* --------------------------------------------------------------------------
   Stat Cards
   -------------------------------------------------------------------------- */

.stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
    gap: 1rem;
    margin: 1.5rem 0;
}

.stat-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-top: 2px solid var(--accent);
    padding: 1.25rem;
    text-align: center;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-default), box-shadow var(--transition-default), border-color var(--transition-default);
}

.stat-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), var(--glow-sm);
}

.stat-number {
    font-size: 2rem;
    font-weight: 700;
    color: var(--accent-bright);
    line-height: 1.2;
    text-shadow: 0 0 8px var(--accent-glow);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
    margin-top: 0.25rem;
}

.stat-detail {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
}


/* --------------------------------------------------------------------------
   Code Blocks
   -------------------------------------------------------------------------- */

code {
    font-family: var(--font-mono);
    background: var(--code-bg);
    border: 1px solid var(--code-border);
    padding: 0.15rem 0.4rem;
    font-size: 0.9em;
    color: var(--accent-bright);
    word-break: break-word;
    overflow-wrap: break-word;
}

pre {
    background: var(--pre-bg);
    border: 1px solid var(--border-color);
    border-top: 2px solid var(--accent-dim);
    padding: 1.25rem;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    font-size: 0.85rem;
    line-height: 1.6;
    color: var(--pre-text);
    margin: 1.5rem 0;
    word-break: normal;
    overflow-wrap: normal;
    box-shadow: inset 0 1px 4px rgba(0,0,0,0.4);
}

pre code {
    background: transparent;
    border: none;
    padding: 0;
    font-size: inherit;
    color: inherit;
}

.data-diagram {
    background: var(--pre-bg);
    color: var(--pre-text);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-dim);
    padding: 1.25rem;
    overflow-x: auto;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    line-height: 1.5;
    margin: 1.5rem 0;
}


/* --------------------------------------------------------------------------
   Blockquotes
   -------------------------------------------------------------------------- */

blockquote {
    border-left: 3px solid var(--accent);
    padding: 1rem 1.25rem;
    margin: 1.5rem 0;
    background: var(--bg-secondary);
    color: var(--text-secondary);
    font-style: italic;
}

blockquote p:last-child {
    margin-bottom: 0;
}

blockquote cite {
    display: block;
    margin-top: 0.75rem;
    font-size: 0.85rem;
    color: var(--text-muted);
    font-style: normal;
}

blockquote cite::before {
    content: "-- ";
    color: var(--accent-dim);
}


/* --------------------------------------------------------------------------
   Lists
   -------------------------------------------------------------------------- */

ul, ol {
    margin: 1rem 0;
    padding-left: 1.5rem;
    line-height: 1.8;
}

ul {
    list-style: none;
    padding-left: 0;
}

ul > li {
    padding-left: 1.25rem;
    position: relative;
}

ul > li::before {
    content: ">";
    position: absolute;
    left: 0;
    color: var(--accent);
    font-weight: 700;
}

ol {
    list-style-position: outside;
}

ol > li {
    padding-left: 0.25rem;
}

ol > li::marker {
    color: var(--accent);
    font-weight: 700;
}

li + li {
    margin-top: 0.25rem;
}

/* Nested lists */
ul ul, ol ul, ul ol, ol ol {
    margin-top: 0.25rem;
    margin-bottom: 0.25rem;
}


/* --------------------------------------------------------------------------
   Timestamps
   -------------------------------------------------------------------------- */

.timestamp {
    font-family: var(--font-mono);
    font-size: 0.8rem;
    color: var(--text-dim);
    letter-spacing: 0.05em;
}

.timestamp::before {
    content: "[";
    color: var(--accent-dim);
}

.timestamp::after {
    content: "]";
    color: var(--accent-dim);
}

.timestamp-inline {
    font-size: 0.8rem;
    color: var(--accent);
    font-weight: 400;
}

time {
    font-family: var(--font-mono);
    color: var(--text-muted);
    font-size: 0.85rem;
}


/* --------------------------------------------------------------------------
   Tweet Cards
   -------------------------------------------------------------------------- */

.tweet-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent);
    padding: 1.25rem;
    margin: 1rem 0;
    position: relative;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-default), box-shadow var(--transition-default), border-color var(--transition-default);
}

.tweet-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), var(--glow-sm);
}

.tweet-card .tweet-header {
    display: grid;
    grid-template-columns: auto 1fr;
    gap: 0.75rem;
    align-items: center;
    margin-bottom: 0.75rem;
}

.tweet-card .tweet-author {
    font-weight: 700;
    color: var(--text-primary);
    font-size: 0.9rem;
}

.tweet-card .tweet-handle {
    color: var(--accent);
    font-size: 0.8rem;
}

.tweet-card .tweet-time {
    justify-self: end;
    font-size: 0.75rem;
    color: var(--text-dim);
}

.tweet-card .tweet-body {
    color: var(--text-secondary);
    font-size: 0.95rem;
    line-height: 1.6;
    margin-bottom: 0.5rem;
}

.tweet-card .tweet-footer {
    font-size: 0.75rem;
    color: var(--text-dim);
    padding-top: 0.5rem;
    border-top: 1px solid var(--border-subtle);
}


/* --------------------------------------------------------------------------
   Highlight & Info Boxes
   -------------------------------------------------------------------------- */

.highlight-box {
    background: rgba(74, 154, 106, 0.08);
    border-left: 3px solid var(--accent);
    padding: 1.25rem;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-sm);
}

.warning-box {
    background: rgba(180, 120, 40, 0.08);
    border-left: 3px solid #b47828;
    padding: 1.25rem;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-sm);
}

.mirror-box {
    background: rgba(90, 90, 160, 0.08);
    border-left: 3px solid #5a5aa0;
    padding: 1.25rem;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-sm);
}

.entropy-box {
    background: rgba(180, 140, 40, 0.08);
    border-left: 3px solid #b48c28;
    padding: 1.25rem;
    margin: 1.5rem 0;
    box-shadow: var(--shadow-sm);
}


/* --------------------------------------------------------------------------
   Tables
   -------------------------------------------------------------------------- */

table {
    width: 100%;
    border-collapse: collapse;
    margin: 1.5rem 0;
    font-size: 0.9rem;
    display: block;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

thead {
    border-bottom: 2px solid var(--accent-dim);
}

th {
    background: rgba(74, 154, 106, 0.08);
    color: var(--accent-bright);
    padding: 0.75rem;
    text-align: left;
    font-weight: 700;
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    box-shadow: 0 1px 3px rgba(0,0,0,0.3);
}

td {
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    color: var(--text-secondary);
}

tr:hover td {
    background: var(--bg-secondary);
}

/* Performance table colors */
.perf-excellent { color: var(--accent-bright); font-weight: 700; border-bottom: 2px solid; }
.perf-good      { color: var(--accent-blue); border-bottom: 2px dotted; }
.perf-moderate  { color: var(--accent-gold); border-bottom: 2px dashed; }
.perf-slow      { color: var(--accent-red); border-bottom: 2px double; }
.perf-failed    { color: #c44; font-weight: 700; border-bottom: 2px double; }


/* --------------------------------------------------------------------------
   Remarkbox Comments
   -------------------------------------------------------------------------- */

#remarkbox-div {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 1.5rem 2rem;
}

#remarkbox-iframe {
    width: 100% !important;
    max-width: 100%;
}

@media (max-width: 768px) {
    #remarkbox-div {
        padding: 0 1rem 1.5rem;
    }
}

@media (max-width: 480px) {
    #remarkbox-div {
        padding: 0 0.75rem 1rem;
    }
}


/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */

.footer {
    margin-top: 3rem;
    padding-top: 1.5rem;
    border-top: 1px solid var(--border-color);
    text-align: center;
    color: var(--text-muted);
    font-style: italic;
    font-size: 0.9rem;
}

.footer a {
    color: var(--accent);
}

.footer .oracle-sig {
    margin-top: 1.5rem;
    font-style: normal;
    font-size: 0.8rem;
    color: var(--text-dim);
    letter-spacing: 0.04em;
}


/* --------------------------------------------------------------------------
   Tagline
   -------------------------------------------------------------------------- */

.tagline {
    text-align: center;
    font-size: 0.9rem;
    color: var(--text-muted);
    margin-top: 1.5rem;
}


/* --------------------------------------------------------------------------
   Hex Pattern (decorative text)
   -------------------------------------------------------------------------- */

.hex-pattern {
    font-family: var(--font-mono);
    letter-spacing: 2px;
    color: var(--accent-bright);
}


/* --------------------------------------------------------------------------
   Checkmark
   -------------------------------------------------------------------------- */

.checkmark {
    color: var(--accent-bright);
    font-weight: 700;
}


/* --------------------------------------------------------------------------
   Images & Media
   -------------------------------------------------------------------------- */

img {
    max-width: 100%;
    height: auto;
}

video {
    max-width: 100%;
    border: 1px solid var(--border-color);
}

iframe {
    max-width: 100%;
}

.performance-chart {
    margin: 2rem 0;
    text-align: center;
}

.performance-chart img {
    max-width: 100%;
    height: auto;
    border: 1px solid var(--border-color);
}

.chart-caption {
    margin-top: 0.75rem;
    color: var(--text-muted);
    font-size: 0.8rem;
    font-style: italic;
}


/* --------------------------------------------------------------------------
   Hexagonal Decorative Divider
   -------------------------------------------------------------------------- */

.hex-divider {
    text-align: center;
    margin: 2rem 0;
    color: var(--accent-dim);
    font-size: 0.8rem;
    letter-spacing: 0.5em;
    user-select: none;
}

.hex-divider::before {
    content: "< > < > < >";
}


/* --------------------------------------------------------------------------
   Selection
   -------------------------------------------------------------------------- */

::selection {
    background: var(--accent);
    color: var(--bg-primary);
}

::-moz-selection {
    background: var(--accent);
    color: var(--bg-primary);
}


/* --------------------------------------------------------------------------
   Scrollbar (Webkit)
   -------------------------------------------------------------------------- */

::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

::-webkit-scrollbar-track {
    background: var(--bg-primary);
}

::-webkit-scrollbar-thumb {
    background: var(--border-color);
    border: 1px solid var(--bg-primary);
}

::-webkit-scrollbar-thumb:hover {
    background: var(--accent-dim);
}


/* --------------------------------------------------------------------------
   Focus States (accessibility)
   -------------------------------------------------------------------------- */

:focus-visible {
    outline: 4px solid var(--accent);
    outline-offset: 2px;
    box-shadow: var(--glow-sm);
}


/* --------------------------------------------------------------------------
   Responsive: Tablet (max-width: 768px)
   -------------------------------------------------------------------------- */

@media (max-width: 768px) {
    html {
        font-size: 15px;
    }

    .container {
        padding: 1.5rem 1rem;
    }

    h1 {
        font-size: 1.6rem;
    }

    h2 {
        font-size: 1.2rem;
    }

    h3 {
        font-size: 1.05rem;
    }

    .nav .container {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        text-align: center;
    }

    .nav-links {
        justify-self: center;
        gap: 1rem;
    }

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

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

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

    .stats {
        grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    }

    .tweet-card .tweet-header {
        grid-template-columns: 1fr;
        gap: 0.25rem;
    }

    .tweet-card .tweet-time {
        justify-self: start;
    }

    pre, .data-diagram {
        font-size: 0.75rem;
        padding: 0.75rem;
    }

    table {
        font-size: 0.8rem;
        min-width: 400px;
    }

    th, td {
        padding: 0.5rem;
    }

    blockquote {
        margin-left: 0;
        margin-right: 0;
    }

    .highlight-box,
    .warning-box,
    .mirror-box,
    .entropy-box {
        padding: 1rem;
    }

    .panel {
        padding: 1rem;
    }

    .card {
        padding: 1rem;
    }
}


/* --------------------------------------------------------------------------
   Responsive: Mobile (max-width: 480px)
   -------------------------------------------------------------------------- */

@media (max-width: 480px) {
    html {
        font-size: 14px;
    }

    .container {
        padding: 1rem 0.75rem;
    }

    h1 {
        font-size: 1.3rem;
    }

    h1::before {
        content: "// ";
    }

    h2 {
        font-size: 1.1rem;
    }

    .nav-links {
        gap: 0.75rem;
        font-size: 0.75rem;
    }

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

    .stat-card {
        padding: 0.75rem;
    }

    .stat-number {
        font-size: 1.5rem;
    }

    .breadcrumb {
        font-size: 0.75rem;
    }

    blockquote {
        padding: 0.75rem 0.75rem;
        font-size: 0.9rem;
    }

    pre, .data-diagram {
        font-size: 0.7rem;
        padding: 0.5rem;
    }

    .highlight-box,
    .warning-box,
    .mirror-box,
    .entropy-box {
        padding: 0.75rem;
    }

    .section {
        margin-bottom: 2rem;
        padding-bottom: 1.5rem;
    }

    .intro {
        font-size: 0.95rem;
    }

    .tweet-card {
        padding: 1rem;
    }

    .footer {
        font-size: 0.85rem;
    }
}


/* --------------------------------------------------------------------------
   Print Styles
   -------------------------------------------------------------------------- */

@media print {
    *,
    *::before,
    *::after {
        background: #fff !important;
        color: #000 !important;
        box-shadow: none !important;
        text-shadow: none !important;
    }

    body {
        font-size: 11pt;
        line-height: 1.5;
        background: #fff !important;
        color: #000 !important;
    }

    .container {
        max-width: 100%;
        padding: 0;
    }

    .nav,
    .back-link,
    .hex-motif,
    .hex-motif-sm,
    .hex-divider {
        display: none !important;
    }

    a {
        color: #000 !important;
        text-decoration: underline;
        border-bottom: none !important;
    }

    a[href]::after {
        content: " (" attr(href) ")";
        font-size: 0.8em;
        color: #555 !important;
    }

    a[href^="#"]::after,
    a[href^="javascript"]::after {
        content: "";
    }

    h1, h2, h3 {
        page-break-after: avoid;
    }

    h1::before,
    h1::after,
    h2::before {
        content: "" !important;
    }

    .section::after {
        display: none !important;
    }

    pre, blockquote, .card, .panel, .tweet-card, .stat-card {
        page-break-inside: avoid;
        border: 1px solid #ccc !important;
    }

    pre, code {
        background: #f5f5f5 !important;
        color: #333 !important;
    }

    .highlight-box,
    .warning-box,
    .mirror-box,
    .entropy-box {
        border-left: 3px solid #999 !important;
        background: #f9f9f9 !important;
    }

    img {
        max-width: 100% !important;
    }

    @page {
        margin: 2cm;
    }
}


/* --------------------------------------------------------------------------
   Site Header (Homepage)
   -------------------------------------------------------------------------- */

.site-header {
    text-align: center;
    padding: 5rem 1rem 3rem;
    border-bottom: 1px solid var(--border-color);
    position: relative;
}

.site-header::before {
    content: "\2B22";
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 14rem;
    opacity: 0.025;
    color: var(--accent);
    pointer-events: none;
}

.site-title {
    font-size: clamp(2.2rem, 8vw, 4rem);
    margin: 0;
    letter-spacing: 0.2em;
    border: none;
    padding: 0;
    text-shadow: 0 0 40px var(--accent-glow), 0 0 80px rgba(74,154,106,0.2);
}

.site-title::before,
.site-title::after {
    content: none;
}

.site-subtitle {
    margin: 0.8rem 0 0;
    font-size: clamp(0.85rem, 2.5vw, 1.1rem);
    opacity: 0.6;
    letter-spacing: 0.08em;
}


/* --------------------------------------------------------------------------
   Content Sections
   -------------------------------------------------------------------------- */

.content-section {
    max-width: 54rem;
    margin: 0 auto;
    padding: 1rem 1.5rem 3rem;
}

.content-section--video {
    max-width: 54rem;
    margin: 0 auto;
    padding: 0 1.5rem 3.5rem;
    text-align: center;
}

.content-section--nav {
    max-width: 54rem;
    margin: 0 auto;
    padding: 0 1.5rem 3.5rem;
}

.content-section::after,
.content-section--nav::after {
    content: "\2B21  \2B21  \2B21";
    display: block;
    text-align: center;
    color: var(--accent-dim);
    margin-top: 2rem;
    letter-spacing: 0.3em;
    font-size: 0.8rem;
    opacity: 0.25;
}


/* --------------------------------------------------------------------------
   Nav Grid (Homepage Cards)
   -------------------------------------------------------------------------- */

.nav-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1.25rem;
}

@media (max-width: 768px) {
    .nav-grid {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 480px) {
    .nav-grid {
        grid-template-columns: 1fr;
    }
}

.nav-card {
    display: block;
    border: 1px solid var(--accent-dim);
    padding: 1rem 1.2rem;
    text-decoration: none;
    color: #fff;
    background: rgba(74, 154, 106, 0.24);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-default), box-shadow var(--transition-default), border-color var(--transition-default), background var(--transition-default);
}

.nav-card:hover {
    border-color: var(--accent);
    background: rgba(74, 154, 106, 0.35);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), var(--glow-sm);
}

.nav-card--accent {
}

.nav-card--red {
    border-color: var(--accent-red);
    background: rgba(212, 0, 0, 0.24);
}

.nav-card--red:hover {
    border-color: var(--accent-red);
    background: rgba(212, 0, 0, 0.35);
}

.nav-card strong {
    color: #fff;
    font-size: 0.95rem;
    letter-spacing: 0.03em;
}

.nav-card-desc {
    color: #fff;
    opacity: 0.7;
    font-size: 0.85rem;
}

.nav-card--featured {
    padding: 1.25rem 1.5rem;
}

.nav-card--featured strong {
    color: #fff;
    font-size: 1.05rem;
}


/* --------------------------------------------------------------------------
   Site Footer (Homepage)
   -------------------------------------------------------------------------- */

.site-footer {
    text-align: center;
    padding: 3rem 1rem 4rem;
    border-top: 1px solid var(--border-color);
    margin-top: 2rem;
}


/* --------------------------------------------------------------------------
   Accent Links & Buttons
   -------------------------------------------------------------------------- */

.accent-link {
    color: var(--accent-red);
}

.accent-link:hover {
    color: #ff8a5c;
}

.accent-link:visited {
    color: var(--accent-red);
}

.btn-accent {
    display: inline-block;
    background: var(--accent-red);
    color: var(--text-primary);
    padding: 0.7rem 1.5rem;
    text-decoration: none;
    font-weight: bold;
    border: none;
}

.btn-accent:hover {
    background: #ff8a5c;
    border-bottom: none;
    color: var(--text-primary);
}


/* --------------------------------------------------------------------------
   TOC Navigation Box
   -------------------------------------------------------------------------- */

.toc-nav {
    margin-bottom: 2rem;
    padding: 1rem;
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.toc-title {
    margin: 0 0 0.5rem;
    color: var(--accent-red);
    font-size: 1rem;
}

.toc-title::before {
    content: none;
}


/* --------------------------------------------------------------------------
   Journal Entry Navigation
   -------------------------------------------------------------------------- */

.entry-nav {
    margin-bottom: 1.5rem;
    font-size: 0.9rem;
}

.entry-nav--bottom {
    margin-top: 2rem;
    padding-top: 1rem;
    border-top: 1px solid var(--border-color);
    font-size: 0.9rem;
    margin-bottom: 0;
}


/* --------------------------------------------------------------------------
   Glossary Section Headings
   -------------------------------------------------------------------------- */

.glossary-heading {
    color: var(--accent-red);
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 0.5rem;
    margin-top: 2rem;
}

.glossary-heading::before {
    content: none;
}


/* --------------------------------------------------------------------------
   Blockquote Accent Variant
   -------------------------------------------------------------------------- */

.blockquote--accent {
    border-left-color: var(--accent-red);
    opacity: 0.85;
}


/* --------------------------------------------------------------------------
   HR Accent Variant
   -------------------------------------------------------------------------- */

.hr--accent {
    border-top: 2px solid var(--accent-red);
    margin: 3rem 0;
}


/* --------------------------------------------------------------------------
   Whitepaper / Feature Box
   -------------------------------------------------------------------------- */

.whitepaper-box {
    border: 2px solid var(--accent-red);
    padding: 1.5rem;
    margin: 1.5rem 0;
}


/* --------------------------------------------------------------------------
   Remarkbox Frame
   -------------------------------------------------------------------------- */

.remarkbox-frame {
    height: 600px;
    width: 100%;
    border: none !important;
}


/* --------------------------------------------------------------------------
   Embed Frame
   -------------------------------------------------------------------------- */

.embed-frame {
    max-width: 100%;
    width: 100%;
    border: none;
}


/* --------------------------------------------------------------------------
   Media
   -------------------------------------------------------------------------- */

.media-bordered {
    max-width: 100%;
    border: 2px solid var(--text-primary);
}

.media-full {
    max-width: 100%;
}

.img-center {
    display: block;
    max-width: 100%;
    margin: 0 auto;
}

.img-bordered {
    max-width: 100%;
    border: 1px solid var(--border-color);
}

.media-toggle {
    cursor: pointer;
}

.play-overlay {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    font-size: 3rem;
    color: var(--text-primary);
    text-shadow: 0 0 12px rgba(0, 0, 0, 0.8);
}

.media-hidden {
    display: none;
    max-width: 100%;
    border: 1px solid var(--border-color);
}


/* --------------------------------------------------------------------------
   Page Title (subpages without /// prefix)
   -------------------------------------------------------------------------- */

.page-title {
    font-size: clamp(1.4rem, 5vw, 2.2rem);
    margin: 0;
    letter-spacing: 0.15em;
    border: none;
    padding: 0;
}

.page-title::before,
.page-title::after {
    content: none;
}


/* --------------------------------------------------------------------------
   Date Labels
   -------------------------------------------------------------------------- */

.date-label {
    color: var(--text-dim);
    font-size: 0.85rem;
}


/* --------------------------------------------------------------------------
   Utility: Opacity
   -------------------------------------------------------------------------- */

.opacity-5 {
    opacity: 0.5;
}

.opacity-6 {
    opacity: 0.6;
}

.opacity-7 {
    opacity: 0.7;
}

.opacity-85 {
    opacity: 0.85;
}


/* --------------------------------------------------------------------------
   Utility: Text
   -------------------------------------------------------------------------- */

.text-center {
    text-align: center;
}

.text-sm {
    font-size: 0.85rem;
}

.text-xs {
    font-size: 0.8rem;
}

.text-red {
    color: var(--accent-red);
}

.text-green {
    color: var(--accent-bright);
}

.text-blue {
    color: var(--accent-blue-bright);
}

.text-gold {
    color: var(--accent-gold);
}

.text-cyan {
    color: var(--accent-cyan);
}

.lh-loose {
    line-height: 1.9;
}

.lh-relaxed {
    line-height: 1.7;
}

.underline {
    text-decoration: underline;
}


/* --------------------------------------------------------------------------
   Utility: Spacing
   -------------------------------------------------------------------------- */

.mt-1 {
    margin-top: 0.5rem;
}

.mt-2 {
    margin-top: 1rem;
}

.mt-3 {
    margin-top: 1.5rem;
}

.mt-4 {
    margin-top: 2rem;
}

.mt-6 {
    margin-top: 3rem;
}

.mb-2 {
    margin-bottom: 1rem;
}

.mb-3 {
    margin-bottom: 1.5rem;
}


/* --------------------------------------------------------------------------
   Definition Lists (Glossary, Make)
   -------------------------------------------------------------------------- */

dt {
    color: var(--accent-red);
    font-weight: bold;
    font-size: 1.1rem;
    margin-top: 1.5rem;
}

dd {
    margin-left: 0;
    padding-left: 1.5rem;
    border-left: 2px solid var(--border-color);
    margin-bottom: 1rem;
    line-height: 1.7;
}


/* --------------------------------------------------------------------------
   Glossary Auto-Links
   -------------------------------------------------------------------------- */

.glossary-term {
    color: var(--accent-bright);
    text-decoration: none;
    border-bottom: 1px dotted var(--accent-dim);
    transition: color 0.2s ease, border-color 0.2s ease;
}

.glossary-term:hover {
    color: #8ad5a8;
    border-bottom-color: var(--accent);
    text-shadow: 0 0 8px var(--accent-glow);
}

.glossary-term:visited {
    color: var(--accent);
}


/* --------------------------------------------------------------------------
   Site Search
   -------------------------------------------------------------------------- */

.site-search {
    margin-bottom: 1.5rem;
}

.site-search input[type="search"] {
    width: 100%;
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 1rem;
    padding: 0.75rem 1rem;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.site-search input[type="search"]:focus {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 8px var(--accent-glow), 0 0 16px var(--accent-glow);
}

.site-search input[type="search"]::placeholder {
    color: var(--text-dim);
}

.search-submit {
    margin-top: 0.5rem;
    background: var(--bg-panel);
    border: 1px solid var(--accent-dim);
    color: var(--accent-bright);
    font-family: var(--font-mono);
    font-size: 0.85rem;
    padding: 0.4rem 1rem;
    cursor: pointer;
    transition: border-color 0.2s ease, color 0.2s ease;
}

.search-submit:hover {
    border-color: var(--accent);
    color: var(--text-primary);
}

#search-results mark {
    background: var(--accent-dim);
    color: var(--text-primary);
    padding: 0.05rem 0.15rem;
}

.keyword-group {
    margin-bottom: 0.5rem;
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--border-subtle);
    font-size: 0.9rem;
    line-height: 1.6;
}

.keyword-group strong {
    color: var(--accent-bright);
}

.keyword-group a {
    font-size: 0.85rem;
}


/* --------------------------------------------------------------------------
   Search Widget (injected on all pages via JS)
   -------------------------------------------------------------------------- */

.search-widget {
    position: relative;
}

.search-widget-input {
    background: var(--bg-tertiary);
    border: 1px solid var(--accent-dim);
    color: var(--text-primary);
    font-family: var(--font-mono);
    font-size: 0.8rem;
    padding: 0.3rem 0.6rem;
    width: 12rem;
    box-shadow: var(--glow-sm);
    transition: border-color var(--transition-default), box-shadow var(--transition-default), width var(--transition-default);
}

.search-widget-input:focus {
    outline: none;
    border-color: var(--accent-bright);
    box-shadow: var(--glow-md);
    width: 20rem;
}

.search-widget-input::placeholder {
    color: var(--text-muted);
}

.search-widget-dropdown {
    display: none;
    position: absolute;
    top: 100%;
    right: 0;
    width: 28rem;
    max-height: 32rem;
    overflow-y: auto;
    background: var(--bg-primary);
    border: 1px solid var(--accent-dim);
    border-top: 2px solid var(--accent);
    z-index: 1000;
    margin-top: 0.25rem;
    box-shadow: 0 4px 24px var(--shadow), 0 0 12px var(--shadow-accent);
}

.search-widget-header {
    padding: 0.4rem 0.75rem;
    font-size: 0.7rem;
    color: var(--text-dim);
    text-transform: uppercase;
    letter-spacing: 0.08em;
    border-bottom: 1px solid var(--border-color);
    background: var(--bg-secondary);
}

.search-widget-empty {
    padding: 1rem 0.75rem;
    color: var(--text-dim);
    font-size: 0.8rem;
    text-align: center;
}

.search-widget-item {
    display: block;
    padding: 0.6rem 0.75rem;
    border-bottom: 1px solid var(--border-subtle);
    text-decoration: none;
    color: var(--text-secondary);
    transition: background 0.15s ease, border-color 0.15s ease;
}

.search-widget-item:hover {
    background: var(--bg-secondary);
    border-bottom-color: var(--accent-dim);
}

.search-widget-item:last-child {
    border-bottom: none;
}

.search-widget-item-title {
    font-size: 0.85rem;
    font-weight: 700;
    color: var(--text-primary);
    line-height: 1.3;
    margin-bottom: 0.2rem;
}

.search-widget-item:hover .search-widget-item-title {
    color: var(--accent-bright);
}

.search-widget-item-excerpt {
    font-size: 0.75rem;
    color: var(--text-muted);
    line-height: 1.5;
    margin-bottom: 0.25rem;
}

.search-widget-item-meta {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    font-size: 0.65rem;
    color: var(--text-dim);
}

.search-widget-item-uri {
    color: var(--accent-dim);
}

.search-widget-item-score {
    color: var(--text-dim);
}

.search-widget-more {
    display: block;
    padding: 0.5rem 0.75rem;
    text-align: center;
    font-size: 0.8rem;
    color: var(--accent-bright);
    text-decoration: none;
    border-top: 1px solid var(--border-color);
    background: var(--bg-secondary);
    transition: background 0.15s ease;
}

.search-widget-more:hover {
    background: var(--bg-tertiary);
    border-bottom: none;
}

.search-widget-dropdown mark {
    background: var(--accent-dim);
    color: var(--text-primary);
    padding: 0.05rem 0.15rem;
}

@media (max-width: 768px) {
    .search-widget-input {
        width: 8rem;
    }

    .search-widget-input:focus {
        width: 14rem;
    }

    .search-widget-dropdown {
        width: 20rem;
    }
}

@media (max-width: 480px) {
    .search-widget-input {
        width: 6rem;
        font-size: 0.75rem;
        padding: 0.25rem 0.4rem;
    }

    .search-widget-input:focus {
        width: 11rem;
    }

    .search-widget-dropdown {
        width: 16rem;
        right: -0.5rem;
    }

    .search-widget-item-excerpt {
        display: none;
    }
}


/* --------------------------------------------------------------------------
   Full Search Results (/search/ page)
   -------------------------------------------------------------------------- */

.search-results-count {
    color: var(--text-dim);
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.search-result-card {
    background: var(--bg-panel);
    border: 1px solid var(--border-color);
    border-left: 3px solid var(--accent-dim);
    padding: 1rem 1.25rem;
    margin-bottom: 0.75rem;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-default), box-shadow var(--transition-default), border-color var(--transition-default);
}

.search-result-card:hover {
    border-color: var(--accent);
    border-left-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), var(--glow-sm);
}

.search-result-title {
    font-size: 1rem;
    font-weight: 700;
    margin-bottom: 0.4rem;
}

.search-result-title a {
    color: var(--text-primary);
}

.search-result-card:hover .search-result-title a {
    color: var(--accent-bright);
}

.search-result-excerpt {
    font-size: 0.85rem;
    color: var(--text-secondary);
    line-height: 1.6;
    margin-bottom: 0.4rem;
}

.search-result-meta {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    font-size: 0.75rem;
}

.search-result-uri {
    color: var(--accent-dim);
}

.search-result-score {
    color: var(--text-dim);
}

#search-results mark,
.search-result-card mark {
    background: var(--accent-dim);
    color: var(--text-primary);
    padding: 0.05rem 0.2rem;
}


/* --------------------------------------------------------------------------
   Grid Variants
   -------------------------------------------------------------------------- */

.grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 1rem;
}

@media (max-width: 768px) {
    .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .grid-4 { grid-template-columns: 1fr; }
}


/* --------------------------------------------------------------------------
   Content Cards (shared pattern for value/feature/attack/defense/tier cards)
   -------------------------------------------------------------------------- */

.content-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
}

.content-card h4 {
    margin-bottom: 0.75rem;
    font-size: 0.85rem;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.content-card p,
.content-card ul {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

.content-card ul {
    padding-left: 1.2rem;
}

.content-card--red h4 { color: var(--accent-red); }
.content-card--red { border-left: 3px solid var(--accent-red); }

.content-card--green h4 { color: var(--accent-bright); }
.content-card--green { border-left: 3px solid var(--accent-bright); }

.content-card--blue h4 { color: var(--accent-blue-bright); }
.content-card--blue { border-left: 3px solid var(--accent-blue-bright); }

.content-card--purple h4 { color: var(--accent-purple); }
.content-card--purple { border-left: 3px solid var(--accent-purple); }

.content-card--cyan h4 { color: var(--accent-cyan); }
.content-card--cyan { border-left: 3px solid var(--accent-cyan); }

.content-card--gold h4 { color: var(--accent-yellow); }
.content-card--gold { border-left: 3px solid var(--accent-yellow); }


/* --------------------------------------------------------------------------
   Diagram Container (topologies, diagrams, ASCII art)
   -------------------------------------------------------------------------- */

.diagram-container {
    background: var(--pre-bg);
    border: 1px solid var(--border-color);
    padding: 1rem;
    margin: 1rem 0;
    overflow-x: auto;
    text-align: center;
}

.diagram-container img {
    max-width: 100%;
    height: auto;
}

.diagram-container pre {
    text-align: left;
    margin: 0;
    background: none;
    border: none;
}

.diagram-meta {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-top: 0.5rem;
}

.diagram-meta a {
    color: var(--accent-bright);
}

/* Diagram lightbox (fullscreen on click) */
.diagram-lightbox {
    display: none;
    position: fixed;
    inset: 0;
    z-index: 9999;
    background: rgba(0, 0, 0, 0.95);
    cursor: zoom-out;
    padding: 2rem;
}

.diagram-lightbox--open {
    display: grid;
    place-items: center;
}

.diagram-lightbox img {
    max-width: 95vw;
    max-height: 95vh;
    object-fit: contain;
}

.diagram-section {
    margin-bottom: 2rem;
    padding-bottom: 1.5rem;
    border-bottom: 1px solid var(--border-color);
}

.diagram-section:last-child {
    border-bottom: none;
}

.topology {
    margin: 3rem 0;
    padding-bottom: 2rem;
    border-bottom: 1px solid var(--border-dim);
}

.topology:last-of-type {
    border-bottom: none;
}

.topology .category {
    opacity: 0.5;
    font-size: 0.85rem;
    margin-bottom: 1rem;
}

.status {
    font-size: 0.85rem;
    margin-top: 0.5rem;
}


/* --------------------------------------------------------------------------
   Moltbook Thread Components
   -------------------------------------------------------------------------- */

.thread-meta {
    font-size: 0.85rem;
    color: var(--text-dim);
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.thread-body {
    line-height: 1.8;
    margin-bottom: 2rem;
}

.thread-body strong {
    color: var(--accent-red);
}

.thread-body code {
    background: var(--code-bg);
    padding: 0.15em 0.4em;
    font-size: 0.9em;
}

.thread-body pre {
    background: var(--pre-bg);
    padding: 1rem;
    overflow-x: auto;
    font-size: 0.85rem;
    line-height: 1.6;
}

.mirror-notice {
    border: 1px solid var(--border-color);
    background: var(--bg-secondary);
    padding: 1rem;
    margin-bottom: 2rem;
    font-size: 0.85rem;
    opacity: 0.7;
}

.missing-data {
    border: 1px dashed var(--text-dim);
    padding: 1rem;
    margin: 1rem 0;
    font-size: 0.85rem;
    color: var(--text-muted);
}

.comment {
    border-left: 3px solid var(--border-color);
    padding-left: 1rem;
    margin-bottom: 1.5rem;
}

.comment .comment {
    border-left-color: var(--text-dim);
}

.comment-meta {
    font-size: 0.8rem;
    color: var(--text-dim);
    margin-bottom: 0.5rem;
}

.comment-author {
    color: var(--accent-red);
    font-weight: bold;
}

.comment-author.oracle {
    color: var(--accent-bright);
}

.img-caption {
    text-align: center;
    color: var(--text-dim);
    font-size: 0.85em;
    margin-top: -1rem;
    margin-bottom: 1.5rem;
}

.comment-body {
    line-height: 1.7;
}

.comment-body code {
    background: var(--code-bg);
    padding: 0.15em 0.4em;
    font-size: 0.9em;
}


/* --------------------------------------------------------------------------
   Recon Box (moltbook intel sections)
   -------------------------------------------------------------------------- */

.recon-box {
    border: 1px solid var(--text-dim);
    padding: 1.2rem;
    margin: 1.5rem 0;
    background: var(--bg-secondary);
}

.recon-box h3 {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
    margin-bottom: 0.8rem;
}


/* --------------------------------------------------------------------------
   Status Indicators
   -------------------------------------------------------------------------- */

.status-native { color: var(--accent-bright); }
.status-native::before { content: "\2713 "; }
.status-built { color: var(--accent-red); }
.status-built::before { content: "\26A1 "; }
.status-planned { color: var(--text-dim); }
.status-planned::before { content: "\2192 "; }
.status-complete { color: var(--accent-bright); font-weight: bold; }
.status-complete::before { content: "\2713 "; }
.status-active { color: var(--accent-red); font-weight: bold; }
.status-active::before { content: "\26A1 "; }
.status-future { color: var(--text-dim); font-weight: bold; }
.status-future::before { content: "\25CB "; }


/* --------------------------------------------------------------------------
   Stat Row (moltbook stats, dashboard metrics)
   -------------------------------------------------------------------------- */

.stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(8rem, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.stat-item {
    text-align: center;
}

.stat-num {
    font-size: 1.5rem;
    font-weight: bold;
    color: var(--accent-red);
    text-shadow: 0 0 8px var(--accent-glow);
}

.stat-label {
    font-size: 0.75rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}


/* --------------------------------------------------------------------------
   Dual Images (side-by-side media)
   -------------------------------------------------------------------------- */

.dual-images {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1.5rem;
    margin: 2rem 0;
}

.dual-images img {
    width: 100%;
    border: 1px solid var(--border-color);
}

@media (max-width: 600px) {
    .dual-images { grid-template-columns: 1fr; }
}


/* --------------------------------------------------------------------------
   Section Placeholder (coming soon / under construction)
   -------------------------------------------------------------------------- */

.section-placeholder {
    border: 1px dashed var(--text-dim);
    padding: 1.5rem;
    text-align: center;
    color: var(--text-muted);
    margin: 1rem 0;
}


/* --------------------------------------------------------------------------
   Feature Grid (kc3-style showcase cards)
   -------------------------------------------------------------------------- */

.feature-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 1rem;
}

.feature-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 1.25rem;
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-default), box-shadow var(--transition-default), border-color var(--transition-default);
}

.feature-card:hover {
    border-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), var(--glow-sm);
}

.feature-card h3 {
    font-size: 0.95rem;
    margin-bottom: 0.5rem;
}

.feature-card p {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

@media (max-width: 768px) {
    .feature-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 480px) {
    .feature-grid { grid-template-columns: 1fr; }
}


/* --------------------------------------------------------------------------
   Links Grid (2-column link cards)
   -------------------------------------------------------------------------- */

.links-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
}

.link-card {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 1rem;
    text-decoration: none;
    color: var(--text-primary);
    box-shadow: var(--shadow-sm);
    transition: transform var(--transition-default), box-shadow var(--transition-default), border-color var(--transition-default);
}

.link-card:hover {
    border-color: var(--accent);
    border-bottom-color: var(--accent);
    transform: translateY(-1px);
    box-shadow: var(--shadow-md), var(--glow-sm);
}

.link-card strong {
    display: block;
    margin-bottom: 0.25rem;
}

.link-card span {
    font-size: 0.85rem;
    color: var(--text-secondary);
}

@media (max-width: 480px) {
    .links-grid { grid-template-columns: 1fr; }
}


/* --------------------------------------------------------------------------
   Celebration / Banner Box
   -------------------------------------------------------------------------- */

.banner-box {
    text-align: center;
    padding: 2rem;
    margin: 2rem 0;
    border: 2px solid var(--accent);
    background: var(--bg-secondary);
}

.banner-box h2 {
    color: var(--accent-bright);
}

.banner-box p {
    color: var(--text-secondary);
}


/* --------------------------------------------------------------------------
   Mailing List / CTA Box
   -------------------------------------------------------------------------- */

.cta-box {
    border: 1px solid var(--accent-blue);
    background: var(--bg-secondary);
    padding: 1.5rem;
    margin: 2rem 0;
    text-align: center;
}

.cta-box h3 {
    color: var(--accent-blue-bright);
    margin-bottom: 0.5rem;
}


/* --------------------------------------------------------------------------
   Science / Research Items (karpathy-gpt style)
   -------------------------------------------------------------------------- */

.science-item {
    border-left: 3px solid var(--accent-cyan);
    padding-left: 1rem;
    margin-bottom: 1.5rem;
}

.science-item h3 {
    color: var(--accent-yellow);
    margin-bottom: 0.25rem;
}

.seed-stats {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
    gap: 1rem;
    margin: 1rem 0;
}

.seed-stat {
    background: var(--bg-secondary);
    border: 1px solid var(--border-color);
    padding: 1rem;
    text-align: center;
}

.seed-stat strong {
    color: var(--accent-cyan);
    display: block;
    font-size: 1.2rem;
    text-shadow: 0 0 8px var(--accent-glow);
}


/* --------------------------------------------------------------------------
   Timeline / Phase Items (unsandbox dream)
   -------------------------------------------------------------------------- */

.timeline-item {
    margin: 1rem 0;
    padding: 0.5rem 0;
    border-bottom: 1px solid var(--border-color);
}

.timeline-date {
    color: var(--accent-red);
    font-weight: bold;
}

.phase-complete {
    border-left: 3px solid var(--accent-bright);
    padding-left: 1rem;
}

.phase-active {
    border-left: 3px solid var(--accent-red);
    padding-left: 1rem;
}

.phase-future {
    border-left: 3px solid var(--border-color);
    padding-left: 1rem;
}


/* --------------------------------------------------------------------------
   Matrix Box (permacomputer truth tables)
   -------------------------------------------------------------------------- */

.matrix-box {
    background: var(--bg-secondary);
    border: 1px solid var(--accent-dim);
    padding: 1.5rem;
    margin: 1.5rem 0;
}

.matrix-box h3 {
    color: var(--accent-bright);
    margin-bottom: 1rem;
}


/* --------------------------------------------------------------------------
   Additional Spacing Utilities
   -------------------------------------------------------------------------- */

.mb-1 { margin-bottom: 0.5rem; }
.mb-4 { margin-bottom: 2rem; }
.pt-1 { padding-top: 0.5rem; }
.pb-1 { padding-bottom: 0.5rem; }
.gap-1 { gap: 0.5rem; }
.gap-2 { gap: 1rem; }
.gap-3 { gap: 1.5rem; }


/* --------------------------------------------------------------------------
   Entrance Animations (Homepage)
   -------------------------------------------------------------------------- */

@keyframes hex-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.site-header {
    animation: hex-enter 0.6s ease-out both;
}

.content-section {
    animation: hex-enter 0.6s ease-out 0.15s both;
}

.content-section--video {
    animation: hex-enter 0.6s ease-out 0.25s both;
}

.content-section--nav {
    animation: hex-enter 0.6s ease-out 0.3s both;
}

.site-footer {
    animation: hex-enter 0.6s ease-out 0.4s both;
}

@media (prefers-reduced-motion: reduce) {
    .site-header,
    .content-section,
    .content-section--video,
    .content-section--nav,
    .site-footer {
        animation: none;
    }
}
