/* =============================================
   Base CSS - Colors, Fonts, Resets
============================================= */

:root {
    --color-bg-paper: #F8F8F5;
    --color-bg-folder: #F4F4F1;
    --color-bg-tab: #E8E8E3;
    --color-tab-folder: #DDD5CB;
    --color-text-ink: #1A1A18;
    --color-text-gray: #666660;
    --color-text-blue-ink: #003366;
    --color-accent: #1A2B3C;
    --color-border: #C8C8C2;
    --color-stamp-red: #1A1A18;
    --color-gold: #666660;
    --color-margin-line: rgba(26, 26, 24, 0.1);

    --font-legal: 'JetBrains Mono', 'Courier New', monospace;
    --font-main: 'Raleway', sans-serif;
    --font-hand: 'Caveat', cursive;

    /* Mainframe Theme Fonts */
    --font-mainframe-head: 'VT323', monospace;
    --font-mainframe-body: 'IBM Plex Mono', monospace;

    --header-height-desktop: 76px;
    --header-height-mobile: 64px;
    --bottom-nav-height: 72px;
    --admin-bar-offset: 0px;
}

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

body {
    font-family: var(--font-main);
    background: var(--color-bg-paper);
    color: var(--color-text-ink);
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    min-height: 100vh;
}

body.admin-bar {
    --admin-bar-offset: 32px;
}

@media screen and (max-width: 782px) {
    body.admin-bar {
        --admin-bar-offset: 46px;
    }
}

.screen-reader-text {
    border: 0;
    clip: rect(1px, 1px, 1px, 1px);
    -webkit-clip-path: inset(50%);
    clip-path: inset(50%);
    height: 1px;
    margin: -1px;
    overflow: hidden;
    padding: 0;
    position: absolute !important;
    width: 1px;
    word-wrap: normal !important;
}

.screen-reader-text:focus {
    background-color: var(--color-bg-paper);
    -webkit-clip-path: none;
    clip-path: none;
    color: var(--color-text-ink);
    display: block;
    font-family: var(--font-legal);
    font-size: 12px;
    font-weight: 700;
    height: auto;
    left: 12px;
    line-height: normal;
    padding: 12px 16px;
    text-decoration: none;
    top: calc(var(--admin-bar-offset) + 12px);
    width: auto;
    z-index: 100000;
}

#primary[tabindex="-1"]:focus {
    outline: 0;
}

a {
    color: var(--color-text-ink);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 3px;
    transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

a:hover {
    color: var(--color-stamp-red);
    text-decoration-color: var(--color-stamp-red);
}

a:visited {
    color: var(--color-stamp-red);
}

body::after {
    content: '';
    position: fixed;
    inset: 0;
    background-image: url('https://www.transparenttextures.com/patterns/paper-fibers.png');
    opacity: 0.022;
    pointer-events: none;
    z-index: 9000;
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(12px); }
    to   { opacity: 1; transform: translateY(0); }
}

/* Brutalist Text Selection */
::selection {
    background-color: var(--color-text-ink);
    color: var(--color-bg-paper);
}

::-moz-selection {
    background-color: var(--color-text-ink);
    color: var(--color-bg-paper);
}

/* =============================================
   Code-Morph Component
   Morphs from standard text to Mainframe terminal
============================================= */

.code-morph {
    transition: all 0.4s cubic-bezier(0.23, 1, 0.32, 1);
    padding: 10px;
    border: 1px solid transparent;
    cursor: help;
    font-family: var(--font-main);
    position: relative;
    overflow: hidden;
}

.code-morph:hover {
    background: #0D0D0D; /* Carbon Black */
    color: #FFB000;      /* Amber */
    font-family: var(--font-mainframe-body);
    border: 1px solid #FFB000;
    padding: 25px;
    box-shadow: 0 0 20px rgba(255, 176, 0, 0.2);
    transform: scale(1.02);
    z-index: 10;
}

.code-morph .keyword { color: inherit; font-weight: inherit; transition: color 0.4s; }

.code-morph:hover .keyword { 
    color: #FF79C6; /* Pink/Purple keyword */
    font-weight: bold; 
}
.code-morph:hover .string { 
    color: #8BE9FD; /* Cyan string */
}
.code-morph:hover .comment { 
    color: #6272A4; /* Grey comment */
    font-style: italic;
}

.code-morph:hover::before {
    content: "LGL_SOURCE // V4.0";
    position: absolute;
    top: 5px;
    right: 10px;
    font-size: 10px;
    font-family: var(--font-mainframe-head);
    opacity: 0.6;
}
