/* terminal.css — IBM Terminal Design System — theempireneverended.com
 * Tokens: --terminal-green #33FF33 | --terminal-green-dim #1A8A1A
 *         --terminal-black #000000 | --terminal-font 'IBM Plex Mono'
 *         --terminal-font-size 13px (14px 768px+) | --cursor-blink-rate 530ms
 *         --text-reveal-speed 30ms (0ms prefers-reduced-motion; read by terminal.js)
 *         --terminal-pink #FF69B4 | VALIS pink — transmission text only
 */

@import url('https://fonts.googleapis.com/css2?family=IBM+Plex+Mono&display=swap');

/* AC #1: Custom properties */
:root {
    --terminal-green: #33FF33;
    --terminal-green-dim: #1A8A1A;
    --terminal-black: #000000;
    --terminal-font: 'IBM Plex Mono';
    --terminal-font-size: 13px;
    --cursor-blink-rate: 530ms;
    --text-reveal-speed: 30ms;
    --terminal-pink: #FF69B4;
}

/* AC #7: Visual purity reset — no rounded corners, shadows, gradients, decorations, scrollbars */
* {
    border: none;
    outline: none;
    box-shadow: none;
    border-radius: 0;
    background-image: none;
    text-decoration: none;
    scrollbar-width: none;
    -webkit-tap-highlight-color: transparent;
}

/* AC #7: No visual media */
img, svg, canvas, video {
    display: none;
}

/* AC #7: No scrollbars (webkit) */
::-webkit-scrollbar { display: none; }

/* AC #2: html/body layout lock */
html, body {
    margin: 0;
    padding: 0;
    background: var(--terminal-black);
    overflow: hidden;
    overscroll-behavior: none;
    width: 100%;
    height: 100%;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

/* AC #2: Terminal container */
.terminal {
    width: 100%;
    height: 100%;
    background: var(--terminal-black);
    padding: 12px;
    box-sizing: border-box;
    overflow: hidden;
    position: relative;
    touch-action: manipulation;
}

/* AC #3: Universal typography */
*, *::before, *::after {
    font-family: var(--terminal-font), 'Courier New', monospace;
    font-size: var(--terminal-font-size);
    font-weight: 400;
    line-height: 1.6;
    color: var(--terminal-green);
    letter-spacing: 0;
}

/* Reset paragraph margin — critical for ASCII art portrait (39 × <p> with default
 * browser margin ~16px top+bottom = grotesquely elongated portrait) */
p { margin: 0; padding: 0; }

/* AC #3: Uniform heading and emphasis */
h1, h2, h3, h4, h5, h6 {
    font-size: var(--terminal-font-size);
    font-weight: 400;
    margin: 0;
}

strong, b { font-weight: 400; }
em, i     { font-style: normal; }

/* Dim utility: separators, system messages, [0] PRAXED */
.terminal-dim { color: var(--terminal-green-dim); }

/* Bright utility: "Ready." final boot message */
.terminal-bright { color: #AAFFAA; }

/* Pink utility: VALIS signal — transmission text only */
.terminal-pink { color: var(--terminal-pink); }

/* AC #3: Link reset */
a { color: var(--terminal-green); text-decoration: none; }

/* AC #4: Single 768px breakpoint */
@media (min-width: 768px) {
    :root { --terminal-font-size: 14px; }
    .terminal { padding: 16px; }
}

/* AC #5: Cursor blink — step-end for sharp IBM on/off flash */
@keyframes cursor-blink {
    0%, 100% { opacity: 1; }
    50%       { opacity: 0; }
}

.cursor {
    display: inline-block;
    width: 0.6em;
    height: 1.2em;
    background: var(--terminal-green);
    vertical-align: text-bottom;
    animation: cursor-blink var(--cursor-blink-rate) step-end infinite;
}

/* Active cursor: static solid block during text reveal */
.cursor--active {
    display: inline-block;
    width: 0.6em;
    height: 1.2em;
    background: var(--terminal-green);
    vertical-align: text-bottom;
    animation: none;
    opacity: 1;
}

/* AC #6: Accessibility — reduced motion */
@media (prefers-reduced-motion: reduce) {
    :root { --text-reveal-speed: 0ms; }
    .cursor { animation: none; opacity: 1; }
}

/* Touch target sizing — 44px minimum */
[data-menu-key] {
    padding-top: 12px;
    padding-bottom: 12px;
    cursor: pointer;
}

/* Landing page layout — flex column, scrollable output */
.terminal {
    display: flex;
    flex-direction: column;
}

#main {
    flex: 1 1 0;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

#terminal-output {
    flex: 1 1 0;
    min-height: 0;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    overscroll-behavior-y: none;
}

/* Output paragraphs: pre-wrap for \n line breaks, overflow-wrap for long words */
#terminal-output p {
    white-space: pre-wrap;
    overflow-wrap: break-word;
}

/* Desktop: shrink to content height so text anchors top-left */
@media (min-width: 768px) {
    #main {
        flex: 0 0 auto;
    }
    #terminal-output {
        flex: 0 0 auto;
        overflow-y: auto;
        max-height: 90vh;
    }
}
