/* ------------------------------------------------
   Self-hosted Source Sans 3
   ------------------------------------------------ */
@font-face {
    font-family: 'Source Sans 3';
    font-style: normal;
    font-weight: 300 600;
    font-display: swap;
    src: url('fonts/source-sans-3-latin-ext.woff2') format('woff2');
    unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

@font-face {
    font-family: 'Source Sans 3';
    font-style: normal;
    font-weight: 300 600;
    font-display: swap;
    src: url('fonts/source-sans-3-latin.woff2') format('woff2');
    unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* ------------------------------------------------
   Color Palette — "Basalt & Storm"
   ------------------------------------------------ */
:root {
    --color-header-bg: #0A0C0E;
    --color-page-bg: #1A1E21;
    --color-card: #242A2E;
    --color-border: #2D3539;
    --color-heading: #C5CDD1;
    --color-body: #B8C5CA;
    --color-secondary: #8FA8B0;
    --color-link: #A8CD7C;
    --color-link-hover: #C2DCA3;
    --color-accent: #7A9483;
    --header-h: 74px;
    --footer-h: 57px;
}

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

html {
    scrollbar-gutter: stable;
}

html, body {
    height: 100%;
    background-color: var(--color-page-bg);
    color: var(--color-body);
    font-family: 'Source Sans 3', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    font-size: 15px;
    line-height: 1.6;
}

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

.skip-link:focus {
    position: fixed;
    top: 8px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 100;
    width: auto;
    height: auto;
    padding: 8px 16px;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: normal;
    background: var(--color-header-bg);
    color: var(--color-heading);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    font-size: 14px;
    text-decoration: none;
}

/* ------------------------------------------------
   Header
   ------------------------------------------------ */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 40px;
    height: var(--header-h);
    padding: 0 48px;
    background-color: var(--color-header-bg);
    border-bottom: 1px solid var(--color-border);
}

.nav {
    display: flex;
    gap: 4px;
}

.header-sep {
    width: 1px;
    height: 28px;
    background-color: var(--color-border);
    flex-shrink: 0;
}

.name {
    font-size: 13px;
    font-weight: 600;
    color: var(--color-heading);
    letter-spacing: 0.14em;
    text-transform: uppercase;
    flex-shrink: 0;
}

.nav-link {
    padding: 8px 12px;
    color: var(--color-secondary);
    text-decoration: none;
    font-size: 14px;
    font-weight: 400;
    border-radius: 4px;
    transition: color 0.15s;
    position: relative;
    display: inline-flex;
    align-items: center;
}

.nav-link:hover {
    color: var(--color-link-hover);
}

.nav-link.active {
    color: var(--color-heading);
}

.nav-link.active::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 12px;
    right: 12px;
    height: 2px;
    background-color: var(--color-accent);
    border-radius: 1px;
}

/* ------------------------------------------------
   Focus styles
   ------------------------------------------------ */
:focus-visible {
    outline: 2px solid var(--color-link);
    outline-offset: 2px;
}

.nav-link:focus-visible {
    outline-offset: 4px;
    border-radius: 2px;
}

/* ------------------------------------------------
   Content Area
   ------------------------------------------------ */
.content {
    margin-top: var(--header-h);
    min-height: calc(100vh - var(--header-h));
    display: flex;
    justify-content: center;
}

.section {
    width: 100%;
    max-width: 660px;
    padding: 48px 24px 56px;
    animation: fadeIn 0.15s ease-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

.section p {
    margin-bottom: 16px;
    text-align: justify;
}

.section ul {
    margin: 0 0 16px 20px;
}

.section li {
    margin-bottom: 6px;
}

.piece-desc {
    color: var(--color-secondary);
}

/* ------------------------------------------------
   Footer
   ------------------------------------------------ */
.footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background-color: var(--color-page-bg);
    border-top: 1px solid var(--color-border);
    z-index: 10;
}

.footer-inner {
    max-width: 660px;
    margin: 0 auto;
    height: 56px;
    padding: 0 24px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.footer-copy {
    font-size: 12px;
    color: var(--color-secondary);
}

.footer-icons {
    display: flex;
    gap: 4px;
}

.footer-icons a {
    color: var(--color-secondary);
    transition: color 0.15s;
    display: flex;
    padding: 8px;
}

.footer-icons a:hover {
    color: var(--color-heading);
}

.footer-icons a[data-tooltip] {
    position: relative;
}

.footer-icons a[data-tooltip]::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: calc(100% + 6px);
    right: 0;
    padding: 4px 8px;
    background: var(--color-card);
    border: 1px solid var(--color-border);
    border-radius: 4px;
    color: var(--color-body);
    font-family: ui-monospace, 'SF Mono', Menlo, monospace;
    font-size: 12px;
    line-height: 1.4;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s;
    pointer-events: none;
}

.footer-icons a[data-tooltip]:hover::after,
.footer-icons a[data-tooltip]:focus-visible::after {
    opacity: 1;
    visibility: visible;
}

/* ------------------------------------------------
   Links
   ------------------------------------------------ */
a {
    color: var(--color-link);
    text-decoration: none;
    transition: color 0.15s;
}

a:hover {
    color: var(--color-link-hover);
}

/* Links inside running text are underlined so they read as links */
.section p a,
.section li a {
    text-decoration: underline;
    text-underline-offset: 2px;
}

/* ------------------------------------------------
   Mobile
   ------------------------------------------------ */
@media (max-width: 600px) {
    :root {
        --header-h: 58px;
    }

    .header {
        padding: 0 20px;
        gap: 20px;
    }

    .name {
        font-size: 14px;
    }

    .nav-link {
        padding: 8px 8px;
        font-size: 13px;
    }

    .section {
        padding: 32px 20px 48px;
    }

    .footer-inner {
        height: 52px;
        padding: 0 20px;
    }

    .footer-copy {
        font-size: 11px;
    }
}

/* Narrow phones. The header is a centered flex row, so once the name plus four
   nav links exceed the viewport it clips off *both* edges rather than
   scrolling — and scrollWidth never reports it. Tighten spacing instead of
   dropping the name. */
@media (max-width: 380px) {
    .header {
        gap: 10px;
    }

    .name {
        font-size: 13px;
    }

    .nav {
        gap: 2px;
    }

    .nav-link {
        padding: 8px 4px;
    }
}
