@import url("fonts.css");
@import url("variables.css");

/* =========================================================
   DARK THEME
   ========================================================= */

:root[data-theme="dark"] {
    --color-bg: #222222;
    --color-surface: #111111;
    --color-surface-raised: #252525;

    --color-border: #444444;
    --color-border-strong: #666666;

    --color-text: #ffffff;
    --color-text-muted: #d8d8d8;
    --color-text-faint: #ffffff;

    --color-accent: #41358b;
    --color-accent-secondary: #232222;
    --color-accent-muted: #555555;
}

/* =========================================================
   RESET
   ========================================================= */

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;

    background: var(--color-bg);
    color: var(--color-text);

    font-family: var(--font-body);
    line-height: 1.6;

    -webkit-font-smoothing: antialiased;
}

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

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

button,
input,
textarea {
    font: inherit;
}


/* =========================================================
   GLOBAL LAYOUT
   ========================================================= */

main {
    width: min(
        calc(100% - 4rem),
        var(--content-width)
    );

    margin: 0 auto;
}


/* =========================================================
   HEADER & NAVIGATION
   ========================================================= */

.site-header {
    width: min(
        calc(100% - 4rem),
        var(--content-width)
    );

    margin: 0 auto;

    padding: 1.75rem 0;

    display: flex;

    align-items: center;

    justify-content: space-between;

    border-bottom:
        1px solid var(--color-border);
}

.site-title {
    font-family: var(--font-display);

    font-size: 1.5rem;

    font-weight: 400;

    letter-spacing: 0.08em;

    text-transform: uppercase;
}

.header-actions {
    display: flex;
    align-items: center;
    gap: 1.5rem;
}

.desktop-nav {
    display: flex;

    gap: 1.5rem;
    align-items: center;
    font-family: var(--font-body);
    font-size: 0.9rem;

    letter-spacing: 0.08em;

    text-transform: uppercase;
}

.desktop-nav a {
    color: var(--color-text-muted);

    transition:
        color var(--transition-fast);
}

.desktop-nav a:hover {
    color: var(--color-text);
}

.desktop-nav .terminal-toggle {
    background: transparent;
    border: 1px solid var(--color-accent-secondary);
    color: var(--color-text-muted);
    cursor: pointer;
    font-family: var(--font-workbench);
    font-size: 0.85rem;
    letter-spacing: 0.2rem;
    padding: 0.35rem 0.7rem;
    text-transform: uppercase;
    transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast);
}

.desktop-nav .terminal-toggle:hover,
.desktop-nav .terminal-toggle:focus-visible {
    background: rgba(0, 51, 102, 0.08);
    border-color: var(--color-accent);
    color: var(--color-text);
    outline: none;
}

.desktop-nav .theme-toggle-btn {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 0.95rem;
    line-height: 1;
    min-width: 2.25rem;
    min-height: 2.25rem;
    padding: 0.25rem;
    border-radius: 999px;
    text-transform: uppercase;
    transition: color var(--transition-fast), border-color var(--transition-fast), background-color var(--transition-fast), transform var(--transition-fast);
}

.desktop-nav .theme-toggle-btn svg {
    display: block;
    image-rendering: pixelated;
}

.desktop-nav .theme-toggle-btn:hover,
.desktop-nav .theme-toggle-btn:focus-visible {
    background: var(--color-surface-raised);
    border-color: var(--color-accent-secondary);
    color: var(--color-text);
    outline: none;
    transform: translateY(-1px);
}

/* Mobile Menu Hamburger Toggle Button */
.mobile-menu-toggle {
    display: none;
    align-items: center;
    gap: 0.6rem;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    font-family: var(--font-workbench, var(--font-mono));
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    padding: 0.45rem 0.85rem;
    min-height: 44px;
    cursor: pointer;
    border-radius: 4px;
    transition: background var(--transition-fast), border-color var(--transition-fast), color var(--transition-fast);
}

.mobile-menu-toggle:hover,
.mobile-menu-toggle:focus-visible {
    background: var(--color-surface-raised);
    border-color: var(--color-accent);
    color: var(--color-text);
    outline: none;
}

.mobile-menu-toggle .menu-icon {
    display: flex;
    flex-direction: column;
    gap: 3px;
    width: 16px;
}

.mobile-menu-toggle .menu-icon span {
    display: block;
    width: 100%;
    height: 2px;
    background-color: var(--color-accent);
    transition: transform var(--transition-fast);
}


/* =========================================================
   MOBILE NAVIGATION DRAWER & OVERLAY
   ========================================================= */

.mobile-nav-overlay {
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.75);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 10000;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.mobile-nav-overlay.is-active {
    opacity: 1;
    pointer-events: auto;
}

.mobile-nav-drawer {
    position: fixed;
    top: 0;
    right: 0;
    width: min(85vw, 360px);
    height: 100vh;
    height: 100dvh;
    background: var(--color-bg);
    border-left: 2px solid var(--color-accent);
    z-index: 10001;
    transform: translateX(100%);
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
    display: flex;
    flex-direction: column;
    padding: 1.5rem;
    gap: 1.5rem;
    box-shadow: -10px 0 30px rgba(0, 0, 0, 0.6);
    overflow-y: auto;
}

.mobile-nav-drawer.is-active {
    transform: translateX(0);
}

.drawer-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding-bottom: 1rem;
    border-bottom: 1px solid var(--color-border);
}

.drawer-title {
    font-family: var(--font-workbench, var(--font-mono));
    font-size: 0.9rem;
    color: var(--color-accent);
    letter-spacing: 0.1em;
}

.drawer-close-btn {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-family: var(--font-workbench, var(--font-mono));
    font-size: 0.85rem;
    padding: 0.4rem 0.7rem;
    min-height: 44px;
    cursor: pointer;
    transition: color var(--transition-fast), border-color var(--transition-fast);
}

.drawer-close-btn:hover,
.drawer-close-btn:focus-visible {
    color: var(--color-text);
    border-color: var(--color-accent);
    outline: none;
}

.mobile-nav-links {
    display: flex;
    flex-direction: column;
    gap: 0.25rem;
}

.mobile-nav-links a {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0.85rem 1rem;
    font-family: var(--font-display);
    font-size: 1.2rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-text-muted);
    border-bottom: 1px solid var(--color-border);
    transition: color var(--transition-fast), background-color var(--transition-fast);
}

.mobile-nav-links a:hover,
.mobile-nav-links a:focus-visible {
    color: var(--color-accent);
    background: var(--color-surface);
    outline: none;
}

.drawer-actions {
    margin-top: auto;
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
    padding-top: 1rem;
    border-top: 1px solid var(--color-border);
}

.mobile-drawer-btn {
    width: 100%;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 0.6rem 1rem;
    font-family: var(--font-workbench, var(--font-mono));
    font-size: 0.9rem;
    letter-spacing: 0.1em;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    color: var(--color-text);
    cursor: pointer;
    border-radius: 4px;
    transition: background var(--transition-fast), border-color var(--transition-fast);
}

.mobile-drawer-btn:hover,
.mobile-drawer-btn:focus-visible {
    background: var(--color-surface-raised);
    border-color: var(--color-accent);
    outline: none;
}


/* =========================================================
   FLOATING BACK TO TOP BUTTON
   ========================================================= */

.back-to-top-btn {
    position: fixed;
    bottom: 2rem;
    right: 1.5rem;
    z-index: 990;
    background: var(--color-surface-raised, #252525);
    color: var(--color-accent);
    border: 1px solid var(--color-accent);
    padding: 0.6rem 1rem;
    font-family: var(--font-workbench, var(--font-mono));
    font-size: 0.85rem;
    letter-spacing: 0.1em;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.4);
    opacity: 0;
    visibility: hidden;
    transform: translateY(12px);
    transition: opacity 0.3s ease, visibility 0.3s ease, transform 0.3s ease, background-color 0.2s ease;
    border-radius: 4px;
    min-height: 44px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.back-to-top-btn.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
}

.back-to-top-btn:hover,
.back-to-top-btn:focus-visible {
    background: var(--color-accent);
    color: var(--color-text);
    outline: none;
}


/* =========================================================
   HERO / HOMEPAGE
   ========================================================= */

.hero {
    min-height: 70vh;

    display: flex;

    flex-direction: column;

    justify-content: center;

    max-width: 900px;

    margin: 0 auto;

    padding: 6rem 0;
}

.hero h1 {
    margin: 0;

    font-family: var(--font-body);

    font-size: clamp(
        5rem,
        12vw,
        11rem
    );

    font-weight: 400;

    line-height: 0.85;

    letter-spacing: -0.05em;
}

.hero p {
    max-width: 520px;

    margin-top: 3rem;

    color: var(--color-text-muted);

    font-size: 1.1rem;
}


/* =========================================================
   PAGE HEADERS
   ========================================================= */

.page-header {
    padding: 8rem 0 4rem;
}

.page-header h1 {
    margin: 1rem 0 0;

    font-family: var(--font-body);

    font-size: clamp(
        3.5rem,
        8vw,
        7rem
    );

    font-weight: 400;

    line-height: 0.9;

    letter-spacing: -0.04em;
}

.page-header > p {
    max-width: 600px;

    margin-top: 2rem;

    color: var(--color-text-muted);

    font-size: 1.05rem;
}


/* =========================================================
   SECTION HEADERS
   ========================================================= */

.section-header {
    display: flex;

    align-items: baseline;

    justify-content: space-between;

    margin-top: var(--spacing-xl);

    padding-bottom: 1rem;

    border-bottom:
        1px solid var(--color-border);
}

.section-header h2 {
    margin: 0;

    font-family: var(--font-body);

    font-size: 2rem;

    font-weight: 400;
}


/* =========================================================
   PUBLICATION LABEL
   ========================================================= */

.publication-type {
    margin: 0;

    color: var(--color-text-faint);

    font-family: var(--font-body);

    font-size: 0.8rem;

    letter-spacing: 0.15em;

    text-transform: uppercase;
}


/* =========================================================
   PUBLICATION LIST
   ========================================================= */

.publication-list {
    display: flex;

    flex-direction: column;
}

.publication-card {
    display: grid;

    grid-template-columns:
        120px 1fr 120px;

    gap: 2rem;

    padding: 2rem 0;

    border-bottom:
        1px solid var(--color-border);
}

.publication-card h2,
.publication-card h3 {
    margin: 0;

    font-family: var(--font-display);

    font-size: 1.8rem;

    font-weight: 400;

    line-height: 1.15;
}

.publication-card h2 a,
.publication-card h3 a {
    transition:
        color var(--transition-fast);

    color: var(--color-accent);
}

.publication-card p {
    margin: 0.5rem 0 0;

    color: var(--color-text-muted);
}

.publication-card time {
    color: var(--color-text-faint);

    font-family: var(--font-body);

    font-size: 0.85rem;

    text-align: right;
}


/* =========================================================
   CATEGORY GRID
   ========================================================= */

.category-list {
    display: grid;

    grid-template-columns:
        repeat(2, 1fr);

    gap: 1px;

    margin-top: 2rem;

    background:
        var(--color-border);
}

.category-list a {
    background:
        var(--color-bg);

    padding: 2.5rem;

    display: flex;

    flex-direction: column;

    gap: 0.5rem;

    transition:
        background var(--transition-normal);
}

.category-list a:hover {
    background:
        var(--color-surface);
}

.category-list strong {
    font-family: var(--font-body);

    font-size: 1.5rem;

    font-weight: 400;
}

.category-list span {
    color: var(--color-text-muted);

    font-size: 0.9rem;
}


/* =========================================================
   PUBLICATION PAGE
   ========================================================= */

.publication {
    width: min(
        100%,
        var(--reading-width)
    );

    margin: 0 auto;

    padding:
        var(--spacing-xl)
        0;
}

.publication-header {
    margin-bottom: 5rem;
}

.publication-header h1 {
    margin: 1rem 0;

    font-family: var(--font-display);
    font-size: clamp(
        3rem,
        7vw,
        6rem
    );

    font-weight: 400;

    line-height: 0.95;

    letter-spacing: -0.04em;
}

.publication-subtitle {
    max-width: 600px;

    color: var(--color-text-muted);

    font-size: 1.15rem;
}

.publication-header time {
    display: block;

    margin-top: 2rem;

    color: var(--color-text-faint);

    font-family: var(--font-body);

    font-size: 0.7rem;
}


/* =========================================================
   ARTICLE CONTENT
   ========================================================= */

.publication-body {
    font-size: 1.05rem;

    line-height: 1.85;
}

.publication-body p {
    margin:
        0 0
        1.5rem;
}

.publication-body h2 {
    margin:
        4rem 0
        1.5rem;

    font-family: var(--font-body);

    font-size: 2rem;

    font-weight: 400;

    line-height: 1.1;
}

.publication-body h3 {
    margin:
        3rem 0
        1rem;

    font-family: var(--font-body);

    font-size: 1.4rem;

    font-weight: 400;
}

.publication-body h4 {
    margin:
        2rem 0
        0.75rem;

    font-family: var(--font-body);

    font-size: 1.15rem;

    font-weight: 400;
}

.publication-body a {
    color: var(--color-accent);

    border-bottom:
        1px solid
        var(--color-accent-muted);
}

.publication-body strong {
    color: var(--color-text);
}

.publication-body em {
    font-family: var(--font-body);
}

.publication-body ul,
.publication-body ol {
    margin:
        1.5rem 0;

    padding-left: 1.5rem;
}

.publication-body li {
    margin-bottom: 0.5rem;
}

.publication-body blockquote {
    margin:
        3rem 0;

    padding:
        0 0 0 2rem;

    border-left:
        2px solid
        var(--color-accent);

    color: var(--color-text-muted);

    font-family: var(--font-body);

    font-size: 1.25rem;
}

.publication-body hr {
    margin:
        4rem 0;

    border: 0;

    border-top:
        1px solid
        var(--color-border);
}


/* =========================================================
   CODE
   ========================================================= */

.publication-body code {
    padding:
        0.15rem
        0.35rem;

    background:
        var(--color-surface);

    border:
        1px solid
        var(--color-border);

    font-family:
        var(--font-mono);

    font-size: 0.85em;
}

.publication-body pre {
    overflow-x: auto;

    margin:
        2rem 0;

    padding: 1.5rem;

    background:
        var(--color-surface);

    border:
        1px solid
        var(--color-border);
}

.publication-body pre code {
    padding: 0;

    background: none;

    border: 0;
}


/* =========================================================
   IMAGES
   ========================================================= */

.publication-body img {
    width: 100%;

    margin:
        3rem 0;
}

.publication-body figure {
    margin:
        3rem 0;
}

.publication-body figcaption {
    margin-top: 0.75rem;

    color: var(--color-text-faint);

    font-family: var(--font-mono);

    font-size: 0.7rem;
}


/* =========================================================
   FOOTER
   ========================================================= */

footer {
    width: min(
        calc(100% - 4rem),
        var(--content-width)
    );

    margin: 8rem auto 0;

    padding:
        2rem 0;

    border-top:
        1px solid
        var(--color-border);

    color: var(--color-text-faint);

    font-family: var(--font-body);

    font-size: 0.65rem;

    letter-spacing: 0.05em;
}


/* =========================================================
   MOBILE RESPONSIVE & LAYOUT REFINEMENTS
   ========================================================= */

@media (max-width: 768px) {

    .status-bar {
        display: none !important;
    }

    .desktop-nav {
        display: none;
    }

    .mobile-menu-toggle {
        display: flex;
    }

    .site-header {
        width: calc(100% - 1.5rem);
        padding: 1rem 0;
        flex-direction: row;
        align-items: center;
        justify-content: space-between;
    }

    main {
        width: calc(100% - 1.5rem);
        padding: 0.5rem 0;
        margin-top: 0.5rem;
        background: transparent;
        border: none;
        clip-path: none;
    }

    main::before {
        display: none;
    }

    .hero {
        min-height: 40vh;
        padding: 2rem 0;
    }

    .hero h1 {
        font-size: clamp(2.5rem, 10vw, 5rem);
    }

    .hero p {
        font-size: 1rem;
        margin-top: 1.25rem;
    }

    .page-header {
        padding: 2rem 0 1.5rem;
    }

    .page-header h1 {
        font-size: clamp(2.2rem, 8vw, 4.5rem);
    }

    .publication-card {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 1.15rem 0;
    }

    .publication-card h2,
    .publication-card h3 {
        font-size: 1.35rem;
    }

    .publication-card p {
        font-size: 0.95rem;
        margin-top: 0.25rem;
    }

    .publication-card time {
        text-align: left;
        font-size: 0.8rem;
    }

    .category-list {
        grid-template-columns: 1fr;
        gap: 10px;
        margin-top: 1.25rem;
    }

    .category-list a {
        padding: 1.25rem 1.5rem;
    }

    .publication,
    .case-file {
        width: 100%;
        max-width: 100%;
        padding: 1rem 0;
    }

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

    .publication-header h1 {
        font-size: clamp(2rem, 7vw, 4rem);
    }

    footer {
        width: calc(100% - 1.5rem);
        margin-top: 3rem;
        padding: 1.25rem 0;
    }
}

@media (max-width: 480px) {

    .site-header {
        width: calc(100% - 1rem);
    }

    main {
        width: calc(100% - 1rem);
        padding: 0.25rem 0;
        margin-top: 0.25rem;
    }

    .category-list a {
        padding: 1rem 1.15rem;
    }

    footer {
        width: calc(100% - 1rem);
    }
}


/* =========================================================
   CASE FILE
   ========================================================= */


/* ---------------------------------------------------------
   CASE CONTAINER
   --------------------------------------------------------- */

.case-file {
    width: min(
        100%,
        var(--content-width)
    );

    margin: 0 auto;

    padding:
        var(--spacing-xl)
        0;
}


/* ---------------------------------------------------------
   CASE HEADER
   --------------------------------------------------------- */

.case-header {
    display: flex;

    justify-content: space-between;

    align-items: flex-end;

    gap: 4rem;

    padding-bottom: 2rem;
}

.case-heading {
    max-width: 850px;
}

.case-label {
    margin: 0;

    color: var(--color-accent);

    font-family: var(--font-display);
    font-size: 0.85rem;

    letter-spacing: 0.15em;
}

.case-heading h1 {
    margin: 1rem 0 0;

    font-family: var(--font-display);

    font-size: clamp(
        4rem,
        5vw,
        8rem
    );

    font-weight: 400;

    line-height: 0.9;

    letter-spacing: -0.05em;
}

.case-subtitle {
    max-width: 650px;

    margin: 2rem 0 0;

    color: var(--color-text-muted);

    font-size: 1.1rem;
}

.case-meta {
    min-width: 220px;
    display: flex;
    flex-direction: column;
    gap: 0.6rem;
    color: var(--color-text-faint);
    font-family: var(--font-workbench, var(--font-mono));
    font-size: 0.85rem;
    letter-spacing: 0.08em;
}

.case-meta-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px dashed var(--color-border);
    padding-bottom: 0.4rem;
    width: 100%;
}

.case-meta-row:last-child {
    border-bottom: none;
    padding-bottom: 0;
}

.case-meta-row .meta-label {
    color: var(--color-text-muted);
    font-size: 0.8rem;
    text-transform: uppercase;
}

.case-meta-row .meta-val {
    color: var(--color-text);
    font-weight: 500;
}


/* ---------------------------------------------------------
   CASE RULE
   --------------------------------------------------------- */

.case-rule {
    width: 100%;

    height: 1px;

    background:
        var(--color-border-strong);
}


/* ---------------------------------------------------------
   ARTICLE LAYOUT
   --------------------------------------------------------- */

.article-layout {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 5rem;
    padding-top: 4rem;
}


/* ---------------------------------------------------------
   ARTICLE TABLE OF CONTENTS
   --------------------------------------------------------- */

.article-toc {
    position: sticky;
    top: 2rem;
    align-self: start;
}

.article-toc:empty {
    display: none;
}

.article-toc p {
    margin: 0 0 1rem;
    color: var(--color-text-faint);
    font-family: var(--font-body);
    font-size: 0.85rem;
    letter-spacing: 0.12em;
}

.article-toc ol {
    margin: 0;
    padding: 0;
    list-style: none;
    counter-reset: toc-section;
}

.article-toc li {
    counter-increment: toc-section;
    margin-bottom: 0.6rem;
    font-family: var(--font-body);
    font-size: 0.85rem;
}

.article-toc li::before {
    content: counter(toc-section, decimal-leading-zero) " ";
    color: var(--color-text-faint);
}

.article-toc a {
    color: var(--color-text-muted);
    transition: color var(--transition-fast);
}

.article-toc a:hover,
.article-toc a.active {
    color: var(--color-text);
}


/* ---------------------------------------------------------
   CASE BODY
   --------------------------------------------------------- */

.case-body {
    max-width:
        var(--reading-width);

    font-size: 1.05rem;

    line-height: 1.85;
}

.case-section {
    scroll-margin-top: 2rem;
}

.case-section + .case-section {
    margin-top: 5rem;
}

.case-section h2 {
    margin:
        0 0
        1.5rem;

    padding-bottom: 0.75rem;

    border-bottom:
        1px solid
        var(--color-border);

    font-family: var(--font-body);

    font-size: 2rem;

    font-weight: 400;

    line-height: 1.1;
}

.article-body {
    max-width: var(--reading-width);
    font-size: 1.35rem;
    line-height: 1.85;
}

.article-body h2 {
    scroll-margin-top: 2rem;
}

.case-body p {
    margin:
        0 0
        1.5rem;
}

.case-body h3 {
    margin:
        3rem 0
        1rem;

    color: var(--color-text-muted);

    font-family: var(--font-body);

    font-size: 0.75rem;

    font-weight: 400;

    letter-spacing: 0.1em;

    text-transform: uppercase;
}


/* ---------------------------------------------------------
   CASE QUOTATIONS
   --------------------------------------------------------- */

.case-body blockquote {
    margin:
        3rem 0;

    padding:
        1.5rem 2rem;

    border-left:
        2px solid
        var(--color-accent);

    background:
        var(--color-surface);

    color: var(--color-text-muted);

    font-family: var(--font-body);

    font-size: 1.15rem;
}


/* ---------------------------------------------------------
   CASE TABLES
   --------------------------------------------------------- */

.case-body table {
    width: 100%;

    margin:
        3rem 0;

    border-collapse: collapse;

    font-size: 0.85rem;
}

.case-body th {
    padding:
        0.75rem;

    border-bottom:
        1px solid
        var(--color-border-strong);

    color: var(--color-text-faint);

    font-family: var(--font-body);

    font-size: 0.65rem;

    font-weight: 400;

    text-align: left;

    text-transform: uppercase;
}

.case-body td {
    padding:
        0.75rem;

    border-bottom:
        1px solid
        var(--color-border);
}


/* ---------------------------------------------------------
   CASE MOBILE & RESPONSIVE ARTICLE TOC
   --------------------------------------------------------- */

.article-toc-toggle {
    display: none;
}

@media (max-width: 800px) {

    .case-file {
        width: calc(100% - 1rem);
        padding: 1.5rem 0;
    }

    .case-header {
        flex-direction: column;
        align-items: flex-start;
        gap: 1.5rem;
        padding-bottom: 1.5rem;
    }

    .case-heading h1 {
        font-size: clamp(2.2rem, 8vw, 4.5rem);
    }

    .case-subtitle {
        margin-top: 1rem;
        font-size: 1rem;
    }

    .case-meta {
        text-align: left;
        width: 100%;
        display: flex;
        flex-direction: column;
        align-items: stretch;
        gap: 0.65rem;
        padding: 0.85rem 1.15rem;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-left: 3px solid var(--color-accent);
        border-radius: 4px;
        font-size: 0.85rem;
    }

    .case-meta-row {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        gap: 0.75rem;
        border-bottom: 1px dashed var(--color-border);
        padding-bottom: 0.5rem;
    }

    .case-meta-row:last-child {
        border-bottom: none;
        padding-bottom: 0;
    }

    .article-layout {
        grid-template-columns: 1fr;
        gap: 1.75rem;
        padding-top: 1.5rem;
    }

    .article-toc {
        position: static;
        background: var(--color-surface);
        border: 1px solid var(--color-border);
        border-radius: 4px;
        padding: 0.75rem 1rem;
    }

    .article-toc-toggle {
        display: flex;
        align-items: center;
        justify-content: space-between;
        width: 100%;
        background: transparent;
        border: none;
        color: var(--color-accent);
        font-family: var(--font-workbench, var(--font-mono));
        font-size: 0.85rem;
        letter-spacing: 0.1em;
        cursor: pointer;
        padding: 0.25rem 0;
        text-transform: uppercase;
        min-height: 44px;
    }

    .article-toc-toggle::after {
        content: "▼";
        font-size: 0.7rem;
        transition: transform 0.3s ease;
    }

    .article-toc.is-expanded .article-toc-toggle::after {
        transform: rotate(180deg);
    }

    .article-toc-content {
        display: none;
        margin-top: 0.75rem;
        padding-top: 0.75rem;
        border-top: 1px dashed var(--color-border);
        max-height: 50vh;
        overflow-y: auto;
    }

    .article-toc.is-expanded .article-toc-content {
        display: block;
    }

    .article-toc p {
        display: none;
    }

    .article-toc ol {
        display: flex;
        flex-direction: column;
        gap: 0.6rem;
    }

    .article-toc li {
        margin: 0;
    }

    /* Article Text Readability on Mobile */
    .article-body,
    .publication-body,
    .case-body {
        font-size: 1.05rem;
        line-height: 1.7;
        letter-spacing: 0.01em;
        word-break: break-word;
        overflow-wrap: break-word;
    }

    .article-body p,
    .publication-body p,
    .case-body p {
        margin-bottom: 1.25rem;
    }

    .article-body h2,
    .publication-body h2,
    .case-body h2 {
        font-size: 1.45rem;
        margin: 2.25rem 0 1rem;
        line-height: 1.25;
        padding-bottom: 0.5rem;
        border-bottom: 1px solid var(--color-border);
        scroll-margin-top: 1.5rem;
    }

    .article-body h3,
    .publication-body h3,
    .case-body h3 {
        font-size: 1.2rem;
        margin: 1.75rem 0 0.75rem;
        line-height: 1.3;
    }

    .article-body h4,
    .publication-body h4,
    .case-body h4 {
        font-size: 1.05rem;
        margin: 1.5rem 0 0.5rem;
    }

    .article-body blockquote,
    .publication-body blockquote,
    .case-body blockquote {
        margin: 1.5rem 0;
        padding: 1rem 1.25rem;
        border-left: 3px solid var(--color-accent);
        background: var(--color-surface);
        font-size: 1rem;
        line-height: 1.6;
        border-radius: 0 4px 4px 0;
    }

    .article-body ul,
    .publication-body ul,
    .case-body ul,
    .article-body ol,
    .publication-body ol,
    .case-body ol {
        margin: 1rem 0 1.25rem;
        padding-left: 1.25rem;
    }

    .article-body li,
    .publication-body li,
    .case-body li {
        margin-bottom: 0.5rem;
        line-height: 1.65;
    }

    .article-body pre,
    .publication-body pre,
    .case-body pre {
        margin: 1.25rem 0;
        padding: 1rem;
        font-size: 0.85rem;
        line-height: 1.5;
        border-radius: 4px;
        border: 1px solid var(--color-border);
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    .case-body table,
    .publication-body table {
        display: block;
        width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        margin: 1.5rem 0;
    }
}

/* ---------------------------------------------------------
   CASE STATUS STAMP
   --------------------------------------------------------- */

.case-meta-label {
    /* Inherits most styles from .case-meta */
    text-transform: uppercase;
}

.case-status-stamp {
    display: inline-block; /* Allows padding and transforms */
    padding: 0.3em 0.6em;
    border: 1px solid;
    border-radius: 3px;
    font-family: var(--font-workbench); /* Terminal-like font */
    font-size: 0.75rem;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 0.3em;
    transform: rotate(-1.5deg); /* Slight rotation for a "stamped" look */
    box-shadow: 2px 2px 5px rgba(0, 0, 0, 0.3); /* Subtle shadow */
    margin-top: -0.2rem; /* Space from the label above */
    text-align: center; /* Center text within the stamp */
    min-width: 80px; /* Ensure a minimum width for consistency */
    line-height: 1; /* Adjust line height for better vertical centering */
}

.case-status-stamp.case-status-solved {
    color: #00ffcc; /* Bright green from terminal theme */
    border-color: #00ffcc;
    background-color: rgba(0, 255, 204, 0.1);
}

.case-status-stamp.case-status-unresolved {
    color: #ff5577; /* Bright red from terminal theme */
    border-color: #ff5577;
    background-color: rgba(255, 85, 119, 0.1);
}

.case-status-stamp.case-status-ongoing {
    color: #00bcd4; /* Bright blue/cyan from terminal theme */
    border-color: #00bcd4;
    background-color: rgba(0, 188, 212, 0.1);
}
/* =========================================================
   ALABASTER CYBER VIBE
   ========================================================= */

.crt-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.08) 50%), linear-gradient(90deg, rgba(255, 0, 0, 0.03), rgba(0, 255, 0, 0.01), rgba(0, 0, 255, 0.03));
    background-size: 100% 3px, 3px 100%;
    z-index: 9999;
    pointer-events: none;
    opacity: 0.5;
}

.noise-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    background-image: url('data:image/svg+xml;utf8,%3Csvg viewBox="0 0 200 200" xmlns="http://www.w3.org/2000/svg"%3E%3Cfilter id="noiseFilter"%3E%3CfeTurbulence type="fractalNoise" baseFrequency="0.85" numOctaves="3" stitchTiles="stitch"/%3E%3C/filter%3E%3Crect width="100%25" height="100%25" filter="url(%23noiseFilter)"/%3E%3C/svg%3E');
    opacity: 0.15;
    z-index: 9998;
    pointer-events: none;
    mix-blend-mode: multiply;
}

.status-bar {
    background: var(--color-text);
    color: var(--color-bg);
    font-family: var(--font-japanese), var(--font-body);
    font-size: 1rem;
    padding: 0.2rem 2rem;
    display: flex;
    justify-content: flex-end;
    gap: 2rem;
    border-bottom: 2px solid var(--color-accent);
}

.status-item.positive {
    color: #228b22;
    font-weight: bold;
}

.status-item.blink {
    animation: blinker 1s linear infinite;
    color: var(--color-accent);
    font-weight: bold;
}

@keyframes blinker {
    50% { opacity: 0; }
}

.marquee-container {
    background: var(--color-border);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1rem;
    padding: 0.4rem 0;
    overflow: hidden;
    white-space: nowrap;
    border-bottom: 1px solid var(--color-text);
}

.marquee-content {
    display: inline-block;
    animation: marquee 20s linear infinite;
}

.marquee-content span {
    padding-right: 0.1rem;
}

@keyframes marquee {
    0% { transform: translateX(0%); }
    100% { transform: translateX(-50%); }
}

.cyber-glitch {
    position: relative;
    color: var(--color-accent);
    text-shadow: 1px 1px var(--color-text);
}

.cyber-glitch::before, .cyber-glitch::after {
    content: "MANOR";
    position: absolute;
    top: 0;
    left: 0;
    opacity: 0.8;
}
.cyber-glitch::before {
    color: var(--color-accent-secondary);
    z-index: -1;
    transform: translate(-2px, 1px);
}
.cyber-glitch::after {
    color: var(--color-border-strong);
    z-index: -2;
    transform: translate(2px, -1px);
}

main {
    background: var(--color-surface);
    border: 2px solid var(--color-border-strong);
    padding: 3rem;
    margin-top: 3rem;
    clip-path: polygon(0 0, calc(100% - 40px) 0, 100% 40px, 100% 100%, 40px 100%, 0 calc(100% - 40px));
    position: relative;
}

main::before {
    content: "";
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    border: 1px solid var(--color-accent);
    clip-path: polygon(0 0, calc(100% - 40px) 0, 100% 40px, 100% 100%, 40px 100%, 0 calc(100% - 40px));
    pointer-events: none;
}



/* ======================================================
   SERIAL EXPERIMENTS LAIN // WIRED TERMINAL BOOT SEQUENCE
   ======================================================
   HOW THIS SECTION IS ORGANIZED:
     1. FULLSCREEN CANVAS & SCROLL LOCK
     2. ACCESSIBILITY / SCREEN-READER SKIP CONTROL
     3. DISTORTED FRAME & STATIC SCANLINE SYSTEM
     4. BACKGROUND GLYPH LAYER
     5. TITLE CARD ("PRESENT DAY / PRESENT TIME")
     6. GUI WRAPPER & TOP STATUS BAR
     7. FILE PANE & LOG STREAM
     8. TELEMETRY BOX
     9. CONTROLS BAR & EXIT PROMPT
    10. MOBILE & REDUCED MOTION OVERRIDES
   ====================================================== */

/* ======================================================
   1. FULLSCREEN CANVAS & SCROLL LOCK
   ====================================================== */
#boot-screen {
    position: fixed !important;
    top: 0 !important;
    left: 0 !important;
    width: 100vw !important;
    height: 100vh !important;
    background-color: #12182b !important; /* Cyan-Blue Dark Vignette */
    background-image: radial-gradient(ellipse at center, rgba(0, 145, 255, 0.35) 0%, rgba(4, 6, 14, 0.95) 78%);
    radial-gradient(ellipse at center, rgba(0, 40, 70, 0.35) 0%, rgba(4, 6, 14, 0.95) 78%);
    color: #55d6ff; /* Cyan-Blue */
    font-family: var(--font-mono);
    z-index: 999999 !important;
    box-sizing: border-box;

    display: flex;
    overflow-y: auto;
    overflow-x: hidden;

    margin: 0;
    padding: 0;
    opacity: 1;

    /* Custom thin cyan scrollbar */
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 255, 204, 0.5) rgba(0, 0, 0, 0.3);
}

#boot-screen::-webkit-scrollbar {
    width: 10px;
}
#boot-screen::-webkit-scrollbar-track {
    background: rgba(0, 0, 0, 0.3);
}
#boot-screen::-webkit-scrollbar-thumb {
    background: rgba(0, 255, 204, 0.4);
    border: 2px solid rgba(0, 0, 0, 0.3);
}
#boot-screen::-webkit-scrollbar-thumb:hover {
    background: rgba(0, 255, 204, 0.7);
}

/* Scroll Lock on body while boot screen is active */
html.wired-locked,
body.wired-locked {
    overflow: hidden !important;
    height: 100%;
}

/* CRT Scanline overlay effect */
#boot-screen::before {
    content: "";
    position: fixed;
    inset: 0;
    background: linear-gradient(rgba(18, 16, 16, 0) 50%, rgba(0, 0, 0, 0.18) 50%);
    background-size: 100% 3px;
    z-index: 6;
    pointer-events: none;
    mix-blend-mode: multiply;
}

/* Soft Vignette */
#boot-screen::after {
    content: "";
    position: fixed;
    inset: 0;
    box-shadow: inset 0 0 12vw rgba(0, 0, 0, 0.75);
    z-index: 6;
    pointer-events: none;
}

/* slice out transition on exit */
/* ======================================================
   CRT SLICE-GLITCH EXIT ANIMATION
   ====================================================== */

/* Triggered on exit: slices, skews, flashes, and collapses into a zero-height CRT line */
#boot-screen.wired-slice-exit {
    animation: crtSliceCollapse 0.45s steps(1) forwards;
    pointer-events: none;
}

@keyframes crtSliceCollapse {
    0% {
        clip-path: inset(0 0 0 0);
        transform: scale(1, 1);
        filter: brightness(1);
        opacity: 1;
    }
    20% {
        /* Horizontal slice offset 1 */
        clip-path: inset(25% 0 55% 0);
        transform: skewX(-8deg) translateX(-4px);
        filter: brightness(1.4);
        opacity: 1;
    }
    40% {
        /* Horizontal slice offset 2 */
        clip-path: inset(65% 0 10% 0);
        transform: skewX(12deg) translateX(6px);
        filter: brightness(1.8);
        opacity: 1;
    }
    60% {
        /* Middle slice collapse */
        clip-path: inset(42% 0 42% 0);
        transform: skewX(-15deg) scale(1.02, 0.4);
        filter: brightness(2.5);
        opacity: 1;
    }
    80% {
        /* Collapses into a thin horizontal glowing phosphor line */
        clip-path: inset(49.5% 0 49.5% 0);
        transform: scale(1, 0.02);
        filter: brightness(4);
        opacity: 0.9;
    }
    100% {
        /* Final collapse to zero */
        clip-path: inset(50% 0 50% 0);
        transform: scale(0, 0);
        filter: brightness(5);
        opacity: 0;
    }
}


/* ======================================================
   2. ACCESSIBILITY CONTROL
   ====================================================== */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.sr-only:focus {
    position: fixed;
    top: 1rem;
    left: 1rem;
    width: auto;
    height: auto;
    padding: 0.6rem 1rem;
    margin: 0;
    overflow: visible;
    clip: auto;
    z-index: 1000001;
    background: #04060e;
    color: #ffaa00;
    border: 1px solid #ffaa00;
    font-family: var(--font-mono);
    font-size: 0.85rem;
}


/* ======================================================
   3. DISTORTED FRAME & STATIC SCANLINE SYSTEM
   ====================================================== */
.frame-distort {
    position: relative;
}

/* Double ghost borders giving an off-kilter terminal aesthetic */
.frame-distort::before,
.frame-distort::after {
    content: "";
    position: absolute;
    inset: -3px;
    pointer-events: none;
    z-index: 0;
    border: 1px solid;
}

.frame-distort::before {
    border-color: rgba(0, 255, 204, 0.45);
    transform: rotate(-0.7deg) skewX(-0.5deg);
}

.frame-distort::after {
    border-color: rgba(255, 0, 90, 0.2);
    transform: rotate(0.9deg) skewX(0.6deg);
}

.frame-content {
    position: relative;
    z-index: 2; /* Ensures content stays crisp and readable above scanlines */
}

/* Persistent subtle scanline background layer (static noise and flicker removed) */
.noise-layer {
    position: absolute;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    opacity: 0.25; /* Low opacity guarantees high text readability */
    background: repeating-linear-gradient(
        0deg,
        rgba(0, 255, 204, 0.12) 0px,
        rgba(0, 255, 204, 0.12) 1px,
        transparent 1px,
        transparent 3px
    );
}


/* ======================================================
   4. BACKGROUND GLYPH LAYER
   ====================================================== */
.wired-bg-text-layer {
    position: absolute;
    top: 5%;
    left: 5%;
    width: 90vw;
    height: 90vh;
    font-family: 'Workbench', sans-serif;
    font-size: 2.5rem;
    line-height: 1.3;
    color: rgba(0, 180, 255, 0.22);
    pointer-events: none;
    z-index: 1;
    white-space: pre-wrap;
    text-shadow: 0 0 5px rgba(0, 180, 255, 0.15);
    animation: bgLayerDrift 12s ease-in-out infinite alternate;
}

@keyframes bgLayerDrift {
    from { opacity: 0.55; }
    to   { opacity: 1; }
}


/* ======================================================
   5. TITLE CARD ("PRESENT DAY / PRESENT TIME")
   ====================================================== */
.wired-title-card {
    position: fixed;
    inset: 0;
    z-index: 100 !important; /* Higher than gui-wrapper so it displays on top during boot */
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
    background: rgba(4, 6, 14, 0.95);
    font-family: 'Workbench', monospace;
    font-size: clamp(1.7rem, 5vw, 3.6rem);
    letter-spacing: 0.35em;
    color: #9ce8ff;
    pointer-events: none;
    opacity: 1;
    transition: opacity 0.4s ease;
}

.wired-title-card span {
    opacity: 0;
    transform: translateY(6px);
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.wired-title-card span.is-shown {
    opacity: 1;
    transform: translateY(0);
    text-shadow:
        0 0 12px rgba(0, 200, 255, 0.6),
        2px 0 rgba(255, 0, 90, 0.35),
        -2px 0 rgba(0, 255, 180, 0.35);
}

.wired-title-card.is-hidden {
    opacity: 0;
}


/* ======================================================
   6. GUI WRAPPER & TOP STATUS BAR
   ====================================================== */
.wired-gui-wrapper {
    position: relative;
    z-index: 5;
    width: min(92vw, 1400px);
    min-height: 82vh;
    margin: auto;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    gap: 1.5rem;
    padding: 3vh 0;
}

.wired-top-bar {
    display: flex;
    flex-wrap: wrap;
    justify-content: space-between;
    align-items: center;
    gap: 0.75rem;
    padding: 0.5rem 1rem; /* Padding for the top bar */
    font-family: 'Workbench', monospace;
    font-size: 1.1rem;
    color: #9ce8ff;
}

.wired-node-box {
    display: flex;
    align-items: center;
    gap: 12px;
    background: rgba(0, 0, 0, 0.7);
    border: 1px solid #00bcff;
    padding: 4px 12px;
    border-radius: 4px;
    transform: rotate(-0.25deg);
}

.wired-meter-dots {
    display: flex;
    gap: 4px;
}

.wired-meter-dots span {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background-color: #00bcd4;
    box-shadow: 0 0 6px #00bcd4;
}

.node-id {
    color: #00ffcc; /* Bright green */
    font-size: 1.2rem;
    letter-spacing: 2px;
}


/* ======================================================
   7. FILE PANE & LOG STREAM
   ====================================================== */
.wired-viewport {
    display: block; /* Full width viewport */
    width: 100%;
    flex-grow: 1;
    margin-top: 1rem;
}

.wired-file-pane {
    background: rgba(8, 20, 45, 0.75);
    border: 1px solid rgba(0, 200, 255, 0.4);
    box-shadow: 0 0 20px rgba(0, 0, 0, 0.6);
    padding: 1rem;
    display: flex;
    flex-direction: column;
    gap: 1rem;
    width: 100%;
    transform: rotate(-0.2deg);
}

.wired-file-header {
    font-family: 'Workbench', monospace;
    font-size: 1.6rem;
    color: #00ffcc;
    border-bottom: 1px solid rgba(0, 200, 255, 0.3);
    padding-bottom: 0.3rem;
}

.wired-stream-body {
    flex-grow: 1;
    min-height: 280px;
    max-height: 50vh;
    overflow-y: auto;
    font-size: 1.2rem;
    line-height: 1.6;
    color: #ffffff;
}

/* ======================================================
   LOG STREAM LINES & PHOSPHOR DECAY
   ====================================================== */

.wired-log-line {
    border-left: 2px solid #00bcd4;
    padding-left: 8px;
    margin-bottom: 3px;
    white-space: pre-wrap;
    word-break: break-word;

    /* Phosphor bloom: starts bright cyan/green with high glow, then cools down */
    animation: phosphorDecay 1s ease-out forwards;
}

/* Keyframe for CRT phosphor persistence and brightness decay */
@keyframes phosphorDecay {
    0% {
        color: #dffffb;
        text-shadow: 0 0 10px #00ffcc, 0 0 20px rgba(0, 255, 204, 0.8);
    }
    30% {
        color: #88f7ff;
        text-shadow: 0 0 6px rgba(0, 255, 204, 0.5);
    }
    100% {
        color: #ffffff;
        text-shadow: 0 0 2px rgba(0, 255, 204, 0.15);
    }
}

.wired-log-line.is-active::after {
    content: "\2588";
    color: #55d6ff;
    animation: blinker 1s steps(1) infinite;
}

.wired-skip-hint {
    margin: 0;
    font-family: var(--font-mono);
    font-size: 0.85rem;
    letter-spacing: 0.04em;
    color: rgba(0, 255, 204, 0.55);
    animation: blinker 1.6s linear infinite;
    transition: opacity 0.3s ease;
}

.wired-skip-hint.is-hidden {
    opacity: 0;
    pointer-events: none;
}


/* ======================================================
   8. TELEMETRY BOX
   ====================================================== */
.wired-telemetry-block {
    background: rgba(0, 0, 0, 0.5);
    border: 1px solid rgba(0, 200, 255, 0.3);
    padding: 0.6rem;
    font-size: 0.78rem;
    color: #8edeff;
    display: flex;
    flex-direction: column;
    gap: 0.3rem;
}

.wired-telemetry-row {
    display: flex;
    justify-content: space-between;
    gap: 1rem;
    border-bottom: 1px dashed rgba(0, 200, 255, 0.15);
    padding-bottom: 0.25rem;
}

.wired-telemetry-row:last-child {
    border-bottom: 0;
    padding-bottom: 0;
}

.wired-telemetry-row > span:first-child {
    color: #4f92b0;
    letter-spacing: 0.06em;
    flex-shrink: 0;
}

.wired-telemetry-row > span:last-child {
    color: #ffffff;
    text-align: right;
    overflow-wrap: anywhere;
}

.wired-telemetry-row [data-field].is-resolved {
    color: #00ffcc;
    animation: fieldResolve 0.4s ease;
}

@keyframes fieldResolve {
    from { opacity: 0; transform: translateX(4px); }
    to   { opacity: 1; transform: translateX(0); }
}


/* ======================================================
   9. CONTROLS BAR & EXIT PROMPT & CLI PROMPT
   ====================================================== */
.wired-controls-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 1.5rem;
    opacity: 0;
    transform: translateY(8px);
    pointer-events: none;
    transition: opacity 0.4s ease, transform 0.4s ease;
}

.wired-controls-bar.is-visible {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.wired-status-chip {
    display: flex;
    align-items: center;
    gap: 10px;
    font-family: 'Workbench', monospace;
    font-size: 1.3rem;
    color: #9ce8ff;
    letter-spacing: 0.06em;
}

.wired-exit-prompt {
    appearance: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    background: rgba(0, 0, 0, 0.55);
    border: 1px dashed rgba(255, 170, 0, 0.55);
    padding: 0.65rem 1.15rem;
    font-family: var(--font-mono);
    font-size: 1.05rem;
    font-weight: 700;
    letter-spacing: 0.04em;
    color: #ffaa00;
    text-shadow: 0 0 8px rgba(255, 170, 0, 0.4);
    cursor: pointer;
}

.wired-exit-caret {
    color: #00ffcc;
}

.wired-exit-cursor {
    color: #00c8ff;
    animation: blinker 1s steps(1) infinite;
}

.wired-exit-prompt:hover,
.wired-exit-prompt:focus-visible {
    border-style: solid;
    background: rgba(0, 238, 255, 0.1);
    color: #fff2cf;
    text-shadow: 0 0 14px rgba(0, 234, 255, 0.7);
    outline: none;
}

.wired-exit-prompt:focus-visible {
    outline: 2px solid #00fffb;
    outline-offset: 4px;
}

/* ======================================================
   INLINE TERMINAL PROMPT
   ====================================================== */

/* Prompt container appended directly inside the log body */
.wired-prompt-line {
    display: flex;
    align-items: center;
    border-left: 2px solid #10bad5;
    padding-left: 8px;
    margin-top: 6px;
    margin-bottom: 3px;
}

/* Seamless input field that matches the terminal font & color */
.wired-inline-input {
    background: transparent;
    border: none;
    outline: none;
    font-family: var(--font-mono);
    font-size: 1.2rem;
    font-weight: 700;
    color: #10bad5;
    text-shadow: 0 0 6px #10bbd566;
    flex-grow: 1;
    padding: 0;
    margin: 0;

    /* Modern standard block caret */
    caret-color: #10bad5;
    caret-shape: block;
}

.wired-inline-input::placeholder {
    color: #10bad5;
    font-weight: 400;
}

.wired-exit-caret {
    color: #00ffcc;
    font-weight: 700;
    margin-right: 4px;
}

/* Error red text highlighting for unrecognized CLI commands */
.wired-log-line.is-error {
    color: #ff5577;
    border-left-color: #ff2255;
}

/* ======================================================
   10. MOBILE & REDUCED MOTION OVERRIDES
   ====================================================== */
@media (max-width: 768px) {
    .wired-gui-wrapper {
        width: 95vw;
        min-height: 88vh;
        padding: 2vh 0;
        gap: 0.85rem;
    }
    .wired-title-card {
        font-size: clamp(1.4rem, 6vw, 2.5rem);
        letter-spacing: 0.18em;
    }
    .wired-top-bar {
        font-size: 0.85rem;
        padding: 0.4rem 0.6rem;
    }
    .wired-node-box {
        padding: 3px 8px;
        font-size: 0.85rem;
    }
    .wired-file-pane {
        padding: 0.75rem;
    }
    .wired-file-header {
        font-size: 1.15rem;
    }
    .wired-stream-body {
        min-height: 200px;
        max-height: 40vh;
        font-size: 0.95rem;
    }
    .wired-inline-input {
        font-size: 16px; /* Prevents iOS auto-zoom on focus */
    }
    .wired-controls-bar {
        flex-direction: column;
        align-items: stretch;
        gap: 0.75rem;
    }
    .wired-exit-prompt {
        justify-content: center;
        min-height: 44px;
        font-size: 0.95rem;
    }
    .wired-status-chip {
        font-size: 1rem;
        justify-content: center;
    }
}

@media (prefers-reduced-motion: reduce) {
    #boot-screen,
    #boot-screen.wired-slice-exit,
    .wired-bg-text-layer,
    .wired-title-card,
    .wired-title-card span,
    .wired-log-line.is-active::after,
    .wired-skip-hint,
    .wired-controls-bar {
        animation: none !important;
        transition-duration: 0.01ms !important;
    }
}

/* ======================================================
   MATRIX DIGITAL RAIN CANVAS
   ====================================================== */
.wired-matrix-canvas {
    position: absolute;
    inset: 0;
    width: 100vw;
    height: 100vh;
    z-index: 1;
    pointer-events: none;
    opacity: 0.35;
}

/* ======================================================
   BLINKING BLOCK TEXT CURSOR & INLINE PROMPT
   ====================================================== */
/* Fallback blinking block text cursor when input is focused */
.wired-inline-input:focus {
    animation: blockCaretPulse 1s steps(1) infinite;
}

@keyframes blockCaretPulse {
    50% { caret-color: transparent; }
}

/* ======================================================
   KEYSTROKE FLICKER
   ====================================================== */

/* Quick scanline flash on every keypress */
.wired-file-pane.is-keystroke-flicker {
    filter: brightness(1.22) contrast(1.08);
}


/* ======================================================
   THEME TOGGLE BUTTON
   ====================================================== */

.theme-toggle-btn {
    background: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-text-muted);
    font-family: var(--font-workbench);
    font-size: 0.75rem;
    padding: 0.3rem 0.75rem;
    letter-spacing: 0.08em;
    cursor: pointer;
    transition: color 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.theme-toggle-btn:hover {
    color: var(--color-text);
    border-color: var(--color-accent);
    background: var(--color-surface);
}