/* ---------- tokens ---------- */
:root {
    --paper: #FAF9F6;
    --card: #FFFFFF;
    --ink: #1C1B17;
    --soft: #5B5850;
    --faint: #A29E92;
    --line: #E8E5DD;
    --line-dark: #D6D2C8;
    --accent: #B4551D;
    --accent-ink: #8F4013;
    --wash: #F4EFE7;
    --serif: 'Fraunces', Georgia, serif;
    --sans: 'Inter', system-ui, sans-serif;
}

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

html {
    scroll-behavior: smooth
}

body {
    background: var(--paper);
    color: var(--ink);
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.6;
    -webkit-font-smoothing: antialiased
}

a {
    color: inherit;
    text-decoration: none
}

button {
    font: inherit;
    background: none;
    border: none;
    cursor: pointer;
    color: inherit
}

:focus-visible {
    outline: 2px solid var(--accent);
    outline-offset: 3px;
    border-radius: 2px
}

.wrap {
    max-width: 1040px;
    margin: 0 auto;
    padding: 0 32px
}

.serif {
    font-family: var(--serif)
}

.label {
    font-size: 12px;
    letter-spacing: .14em;
    text-transform: uppercase;
    color: var(--faint);
    font-weight: 500
}

.vh {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0)
}

.skip {
    position: absolute;
    top: -48px;
    left: 24px;
    background: var(--ink);
    color: var(--paper);
    padding: 10px 18px;
    z-index: 99;
    transition: top .15s
}

.skip:focus {
    top: 12px
}

/* ---------- header ---------- */
header {
    position: sticky;
    top: 0;
    z-index: 50;
    background: rgba(250, 249, 246, .9);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--line)
}

.bar {
    height: 76px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px
}

.brand {
    font-family: var(--serif);
    font-size: 22px;
    font-weight: 500;
    letter-spacing: -.01em;
    display: flex;
    align-items: baseline;
    gap: 10px
}

.brand em {
    font-style: italic;
    font-weight: 300;
    color: var(--faint);
    font-size: 15px
}

.grades-nav {
    display: flex;
    align-items: center;
    gap: 4px
}

.grades-nav .label {
    margin-right: 12px
}

.gpill {
    font-family: var(--serif);
    font-size: 17px;
    width: 44px;
    height: 44px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    color: var(--soft);
    transition: all .2s;
    border: 1px solid transparent
}

.gpill:hover {
    color: var(--ink);
    border-color: var(--line-dark)
}

.gpill.active {
    background: var(--ink);
    color: var(--paper)
}

/* ---------- view transitions ---------- */
.view {
    animation: rise .5s ease-out
}

@keyframes rise {
    from {
        opacity: 0;
        transform: translateY(10px)
    }

    to {
        opacity: 1;
        transform: none
    }
}

/* ---------- breadcrumb (shared: grade + watch) ---------- */
.crumb {
    padding: 5px 0 5px;
    font-size: 14px;
    color: var(--faint);
    display: flex;
    gap: 10px;
    align-items: center
}

.crumb a:hover {
    color: var(--ink)
}

.crumb span {
    color: var(--line-dark)
}

/* ---------- footer ---------- */
footer {
    border-top: 1px solid var(--line);
    padding: 36px 0 44px
}

.foot {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    gap: 16px;
    font-size: 13px;
    color: var(--faint)
}

.foot .serif {
    font-size: 16px;
    color: var(--soft)
}

/* ---------- shared empty state ---------- */
.empty-msg {
    padding: 60px 0;
    color: var(--faint);
    font-size: 15px
}

/* ---------- responsive ---------- */
@media (max-width:640px) {
    .wrap {
        padding: 0 20px
    }

    .bar {
        height: 64px
    }

    .brand em {
        display: none
    }

    .grades-nav .label {
        display: none
    }

    .gpill {
        width: 38px;
        height: 38px;
        font-size: 15px
    }

    .foot {
        flex-direction: column;
        gap: 6px
    }
}

@media (prefers-reduced-motion:reduce) {
    * {
        transition: none !important;
        animation: none !important
    }
}