@import url('https://fonts.googleapis.com/css2?family=Barlow+Condensed:wght@500;600;700&family=IBM+Plex+Mono:wght@400;500;600&family=IBM+Plex+Sans:wght@400;500;600&display=swap');

/* ═══════════════════════════════════════════════════════════════
   DONUT NETWORK · "SIGNAL BOX" DESIGN SYSTEM

   Idea: a timetable and signage system for a railway that happens to
   run Minecraft accounts. Flat ink-on-paper surfaces, hairline rules
   instead of boxes, one signal-amber accent, monospaced timetable
   labels, squared corners.

   Dark ("night timetable") is the default. Light ("paper timetable")
   is switched on with <html data-theme="light"> (theme.js).
   Every colour used by a page comes from the tokens below.
═══════════════════════════════════════════════════════════════ */
:root {
    color-scheme: dark;

    /* type */
    --font-body:    'IBM Plex Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
    --font-head:    'Barlow Condensed', 'Arial Narrow', 'Liberation Sans Narrow', 'Roboto Condensed', system-ui, sans-serif;
    --font-display: var(--font-head);
    --font-mono:    'IBM Plex Mono', ui-monospace, 'SFMono-Regular', Menlo, Consolas, monospace;

    /* surfaces: warm near-black, each step only a few points lighter */
    --bg-base:      #0F0E0C;
    --bg-raised:    #151411;
    --bg-surface:   #1A1815;
    --bg-overlay:   #23201C;
    --bg-muted:     #37332C;
    --input-bg:     #0B0A09;

    /* accent: signal amber (the colour of a departure board) */
    --accent:       #F5A623;
    --accent-mid:   #FFB93D;                 /* hover */
    --accent-light: #FFD27A;
    --accent-text:  #FFC247;                 /* accent used as TEXT */
    --accent-2:     #E9A857;
    --accent-rgb:   245, 166, 35;
    --accent-glow:  rgba(245, 166, 35, 0.30);
    --accent-tint:  rgba(245, 166, 35, 0.12);
    --on-accent:    #17140F;                 /* text on a filled accent */

    /* text (all pass 4.5:1 on --bg-base) */
    --text-bright:  #F4EEE1;
    --text-main:    #D8D0C0;
    --text-muted:   #A0988A;
    --text-faint:   #8A8272;

    /* rules */
    --border:        rgba(244, 238, 225, 0.12);
    --border-soft:   rgba(244, 238, 225, 0.07);
    --border-strong: rgba(244, 238, 225, 0.24);
    --border-focus:  #FFC247;
    --ink-rgb:       244, 238, 225;
    --shade-rgb:     0, 0, 0;

    /* status: signal colours */
    --ok:           #5ED394;
    --warning:      #EBD34F;
    --danger:       #FF7262;
    --ok-rgb:       94, 211, 148;
    --warning-rgb:  235, 211, 79;
    --danger-rgb:   255, 114, 98;
    --success:      var(--ok);
    --success-tint: rgba(var(--ok-rgb), 0.12);
    --warning-tint: rgba(var(--warning-rgb), 0.12);
    --danger-tint:  rgba(var(--danger-rgb), 0.12);
    --info:         var(--accent-text);
    --info-tint:    var(--accent-tint);
    --orange:       #E9A857;

    /* console / chat viewer: dark in both modes */
    --console-bg:     #0A0908;
    --console-text:   #E6DFD0;
    --console-sent:   #FFC247;
    --console-border: rgba(244, 238, 225, 0.14);
    /* inventory slots */
    --slot-bg:        #211E19;
    --slot-bg-has:    #2D2921;
    --slot-border:    rgba(244, 238, 225, 0.12);

    /* shape: near-square, like signage */
    --r-sm: 2px;
    --r-md: 3px;
    --r-lg: 4px;
    --r-xl: 6px;

    /* spacing scale (4px base) */
    --s-1: 4px;  --s-2: 8px;  --s-3: 12px; --s-4: 16px;
    --s-5: 24px; --s-6: 32px; --s-7: 48px; --s-8: 72px; --s-9: 112px;

    --sidebar-w: 220px;
    --ease: cubic-bezier(.2, .7, .2, 1);
    --transition: 0.16s var(--ease);
    --transition-slow: 0.28s var(--ease);
    --shadow-soft: none;
    --shadow-lift: 0 12px 32px rgba(0, 0, 0, 0.55);

    /* legacy alias support: older page styles reference these names */
    --bg-main:      var(--bg-base);
    --bg-card:      var(--bg-surface);
    --bg-sidebar:   var(--bg-raised);
    --accent-hover: var(--accent-mid);
    --green:        var(--success);
    --yellow:       var(--warning);
    --red:          var(--danger);
}

/* ── light: paper timetable ── */
:root[data-theme="light"] {
    color-scheme: light;

    --bg-base:      #EEE9DB;
    --bg-raised:    #F5F1E6;
    --bg-surface:   #FAF8F1;
    --bg-overlay:   #E4DECC;
    --bg-muted:     #D5CEB9;
    --input-bg:     #FAF8F1;

    --accent:       #F2A100;
    --accent-mid:   #FFB21F;
    --accent-light: #FFC95C;
    --accent-text:  #8A4A00;
    --accent-2:     #B8730A;
    --accent-rgb:   214, 134, 0;
    --accent-glow:  rgba(214, 134, 0, 0.25);
    --accent-tint:  rgba(214, 134, 0, 0.13);
    --on-accent:    #17140F;

    --text-bright:  #15130F;
    --text-main:    #2E2A22;
    --text-muted:   #5C5546;
    --text-faint:   #6F6757;

    --border:        rgba(21, 19, 15, 0.16);
    --border-soft:   rgba(21, 19, 15, 0.09);
    --border-strong: rgba(21, 19, 15, 0.34);
    --border-focus:  #8A4A00;
    --ink-rgb:       21, 19, 15;
    --shade-rgb:     21, 19, 15;

    --ok:           #17703F;
    --warning:      #7D5200;
    --danger:       #B3261E;
    --ok-rgb:       23, 112, 63;
    --warning-rgb:  125, 82, 0;
    --danger-rgb:   179, 38, 30;
    --orange:       #8A4A00;

    --console-border: rgba(21, 19, 15, 0.4);
    --slot-bg:        #D5CEB9;
    --slot-bg-has:    #E4DECC;
    --slot-border:    rgba(21, 19, 15, 0.2);

    --shadow-lift: 0 12px 28px rgba(21, 19, 15, 0.18);
}

/* ═══════════════ reset + base ═══════════════ */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
    font-family: var(--font-body);
    background: var(--bg-base);
    color: var(--text-main);
    display: block;
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
    font-size: 14px;
    line-height: 1.55;
    font-feature-settings: "tnum" 1;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-head);
    color: var(--text-bright);
    font-weight: 600;
    line-height: 1.1;
    letter-spacing: 0.01em;
}

a { color: var(--accent-text); text-underline-offset: 3px; }
a:hover { color: var(--text-bright); }

code, kbd, samp, pre { font-family: var(--font-mono); font-size: .92em; }
code { background: rgba(var(--ink-rgb), .07); padding: 1px 5px; border-radius: var(--r-sm); }

hr { border: 0; border-top: 1px solid var(--border); margin: var(--s-5) 0; }

img { max-width: 100%; }

.sr-only {
    position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}

/* skip link, shown on keyboard focus */
.skip {
    position: absolute; left: var(--s-3); top: -60px; z-index: 100;
    background: var(--accent); color: var(--on-accent); padding: 10px 16px; font-weight: 600; text-decoration: none;
    transition: top .15s;
}
.skip:focus { top: var(--s-3); }

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; scroll-behavior: auto !important; }
}


/* ═══════════════ theme switch (button added by theme.js) ═══════════════ */
button.theme-toggle {
    flex: none; margin: 0; padding: 0; width: 36px; height: 36px; min-height: 36px; display: inline-flex; align-items: center; justify-content: center;
    background: transparent !important; color: var(--text-muted) !important; border: 1px solid var(--border) !important; border-radius: var(--r-sm) !important; cursor: pointer;
    transition: color var(--transition), border-color var(--transition);
}
button.theme-toggle:hover { color: var(--text-bright) !important; border-color: var(--border-strong) !important; background: transparent !important; }
button.theme-toggle svg { width: 18px; height: 18px; display: block; }
button.theme-toggle.floating { position: fixed; right: 16px; bottom: 16px; z-index: 60; background: var(--bg-surface) !important; }
