/* ==========================================================================
   base.css — Reset, colours, typography, effects
   Shared across all samuelmarks.com pages
   ========================================================================== */

/* --- Theme variables --- */
:root {
    --bg:           #0c0c0c;
    --bg-surface:   #1a1510;
    --bg-raised:    #12100c;
    --border:       #2a2015;
    --border-mid:   #1e1710;
    --border-faint: #1a1410;
    --text:         #c87830;
    --text-bright:  #e8943c;
    --text-glow:    #ffa854;
    --text-dim:     #a88868;
    --text-muted:   #9a7e58;
    --text-faint:   #6d5535;
    --info:         #5b9bd5;
    --danger:       #c44;
    --danger-dim:   #8b3030;
    --success:      #5a9a5a;
    --scanline:     rgba(0,0,0,0.06);
    --glow-bg:      rgba(200,120,48,0.04);
    --modal-bg:     rgba(0,0,0,0.85);
}

[data-theme="light"] {
    --bg:           #f5e6d0;
    --bg-surface:   #eddbc2;
    --bg-raised:    #f0dfc8;
    --border:       #d4b896;
    --border-mid:   #dcc5a8;
    --border-faint: #e0ccb0;
    --text:         #3a2010;
    --text-bright:  #1a0f05;
    --text-glow:    #0c0804;
    --text-dim:     #6b4f35;
    --text-muted:   #8b6b48;
    --text-faint:   #8b7050;
    --info:         #2a6aab;
    --danger:       #b33;
    --danger-dim:   #c55;
    --success:      #3a7a3a;
    --scanline:     rgba(0,0,0,0.02);
    --glow-bg:      rgba(200,120,48,0.06);
    --modal-bg:     rgba(0,0,0,0.5);
}

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

html, body {
    min-height: 100%;
    background-color: var(--bg);
    color: var(--text);
    font-family: 'Fira Code', 'Courier New', monospace;
    font-size: 14px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body { overflow-x: hidden; overflow-y: auto; }

/* --- Links --- */
a { color: var(--text); text-decoration: underline; text-underline-offset: 0.15em; }
a:hover { color: var(--text-bright); }

/* --- Typography helpers --- */
.dim { color: var(--text-dim); }
.info { color: var(--info); }
.danger { color: var(--danger); }

.page-title {
    font-size: 1rem; font-weight: 500; color: var(--text-bright); margin-bottom: 1.5em;
    text-shadow: 0 0 10px rgba(232,148,60,0.2);
}

.section-heading {
    font-size: 0.8rem; text-transform: uppercase; letter-spacing: 0.15em;
    color: var(--text-dim); margin-bottom: 0.8em; margin-top: 1em;
}
.section-heading::before { content: '# '; color: var(--text-muted); }

/* --- Terminal effects --- */
.scanlines {
    position: fixed; top: 0; left: 0; width: 100%; height: 100%;
    background: repeating-linear-gradient(0deg, transparent, transparent 2px, var(--scanline) 2px, var(--scanline) 4px);
    pointer-events: none; z-index: 100;
}

.glow {
    position: fixed; width: 800px; height: 800px; border-radius: 50%;
    background: radial-gradient(circle, var(--glow-bg) 0%, transparent 70%);
    top: 50%; left: 50%; transform: translate(-50%, -50%); pointer-events: none;
}

/* --- Terminal prompt & cursor --- */
.prompt { color: var(--text-muted); font-size: 0.85rem; margin-bottom: 2em; }
.cursor {
    display: inline-block; width: 0.55em; height: 1.1em;
    background: var(--text-bright); vertical-align: text-bottom;
    animation: blink 1s step-end infinite; opacity: 0.8;
}
@keyframes blink { 50% { opacity: 0; } }

/* --- Flash messages --- */
.flash { padding: 0.6em 0; font-size: 0.85rem; margin-bottom: 1em; }
.flash-success { color: var(--info); }
.flash-success::before { content: '[OK] '; }
.flash-error { color: var(--danger); }
.flash-error::before { content: '[ERR] '; }

/* --- Errors list --- */
.errors { color: var(--danger); font-size: 0.8rem; margin-bottom: 1em; }
.errors li { margin-bottom: 0.2em; list-style: none; }
.errors li::before { content: '! '; }

/* --- Theme toggle --- */
.theme-toggle {
    background: none; border: 1px solid var(--border); color: var(--text-muted);
    font-family: 'Fira Code', monospace; font-size: 0.75rem;
    padding: 0.2em 0.5em; cursor: pointer; border-radius: 3px;
    transition: color 0.2s, border-color 0.2s;
}
.theme-toggle:hover { color: var(--text-bright); border-color: var(--text-bright); }

/* --- Responsive base --- */
@media (max-width: 640px) {
    html { font-size: 13px; }
}
