/*
 * Reset, page frame and typography. Nothing here knows about a component.
 */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@400;600;700&family=Inter:wght@400;500;600&display=swap');

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

html,
body {
    height: 100%;
}

body {
    background-color: var(--bg);
    background-image:
        radial-gradient(circle at 8% 12%, rgba(211, 47, 47, 0.09) 0%, transparent 42%),
        radial-gradient(circle at 92% 88%, rgba(92, 19, 19, 0.07) 0%, transparent 46%);
    background-attachment: fixed;
    color: var(--text);
    font-family: var(--font-body);
    font-size: var(--t-md);
    line-height: 1.5;
    overflow: hidden; /* the shell scrolls its panes, not the page */
}

h1, h2, h3, h4 {
    font-family: var(--font-head);
    font-weight: 700;
    letter-spacing: 0.4px;
    line-height: 1.25;
}

h1 { font-size: var(--t-2xl); }
h2 { font-size: var(--t-xl); }
h3 { font-size: var(--t-lg); text-transform: uppercase; }
h4 { font-size: var(--t-md); text-transform: uppercase; color: var(--text-dim); }

a {
    color: var(--accent);
    text-decoration: none;
}

a:hover {
    text-decoration: underline;
}

code, pre, .mono {
    font-family: var(--font-mono);
    font-size: 0.92em;
}

/*
 * A visible focus ring everywhere. The old sheet removed outlines on buttons
 * and inputs, which left keyboard use with no indication of where you were.
 */
:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 2px;
}

::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}

::-webkit-scrollbar-track {
    background: transparent;
}

::-webkit-scrollbar-thumb {
    background: rgba(211, 47, 47, 0.28);
    border-radius: 99px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(211, 47, 47, 0.5);
}

/* ── The shell ────────────────────────────────────────────────────────── */

.shell {
    display: grid;
    grid-template-columns: var(--rail-w) minmax(0, 1fr) var(--dock-w);
    grid-template-rows: var(--header-h) minmax(0, 1fr);
    grid-template-areas:
        'brand  header  header'
        'rail   screen  dock';
    height: 100vh;
}

.shell.dock-collapsed {
    grid-template-columns: var(--rail-w) minmax(0, 1fr) 44px;
}

.brand {
    grid-area: brand;
    display: flex;
    align-items: center;
    gap: var(--s2);
    padding: 0 var(--s4);
    border-bottom: 1px solid var(--line);
    border-right: 1px solid var(--line);
    font-family: var(--font-head);
    font-weight: 700;
    letter-spacing: 1px;
    text-transform: uppercase;
}

.brand svg {
    color: var(--accent);
}

.topbar {
    grid-area: header;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: var(--s4);
    padding: 0 var(--s5);
    border-bottom: 1px solid var(--line);
    z-index: var(--z-header);
}

.rail {
    grid-area: rail;
    display: flex;
    flex-direction: column;
    gap: var(--s1);
    padding: var(--s4) var(--s3);
    border-right: 1px solid var(--line);
    overflow-y: auto;
}

.screen {
    grid-area: screen;
    padding: var(--s5);
    overflow-y: auto;
}

.dock {
    grid-area: dock;
    display: flex;
    flex-direction: column;
    min-height: 0;
    border-left: 1px solid var(--line);
    background: rgba(10, 10, 15, 0.5);
    z-index: var(--z-dock);
}

/*
 * Desktop-first, per spec 8.1: usable but not optimised below 1280px. Under
 * 1100 the dock stops taking a column of its own and the rail loses its labels.
 */
@media (max-width: 1100px) {
    .shell,
    .shell.dock-collapsed {
        grid-template-columns: 64px minmax(0, 1fr);
        grid-template-areas:
            'brand  header'
            'rail   screen';
    }

    .dock {
        position: fixed;
        top: var(--header-h);
        right: 0;
        bottom: 0;
        width: var(--dock-w);
        max-width: 100vw;
        box-shadow: var(--shadow);
    }

    .shell.dock-collapsed .dock {
        width: 44px;
    }

    .rail-label,
    .brand-name {
        display: none;
    }
}

[hidden] { display: none !important; }
