:root {
    --bg: #07090e;
    --bg-raised: #1e293b;
    --text: #eef3f4;
    --accent: #ffffff;
    --muted: #98b0d4;
    --border: #1e293b;
    --callout-bg: rgba(6, 16, 33, 1);
    --callout: #22d3ee;
    --blockquote-bg: #1e293b;
    --max-width: 65rem;
}

body {
    font-family: 'Inter', sans-serif;
    font-size: 1.1rem;
    line-height: 1.75;
    color: var(--text);
    background: var(--bg);
    margin: 0;
    padding: 2rem 1.5rem 4rem;
}

article {
    max-width: var(--max-width);
    margin: 0 auto;
}

.logo {
    display: block;
    width: 100%;
    max-width: 640px;
    margin: 0 auto 1.5rem;
    height: auto;
}

h1, h2, h3, h4, h5, h6 {
    font-family: 'Orbitron', sans-serif;
    line-height: 1.3;
    margin-top: 4.5rem;
    margin-bottom: 1.1rem;
    font-weight: 700;
    color: var(--accent);
}

h1 {
    font-size: 2rem;
    margin-top: 0;
    margin-bottom: 0.5rem;
    border-bottom: 1px solid rgba(34, 211, 238, 0.25);
    padding-bottom: 0.5rem;
}

h2, h3, h4, h5, h6 { color: #adffea; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.25rem; }
h4 { font-size: 1.125rem; }
h5 { font-size: 1.05rem; }

p { margin: 0 0 1rem; }

.lead {
    font-style: italic;
    color: var(--muted);
}

a {
    color: #fffebd;
}

img {
    max-width: 100%;
    height: auto;
    display: block;
    margin: 1.5rem auto;
    border-radius: 4px;
}

picture {

    img {
        margin: 0;
    }
}

#observations-plot {
    display: block;
    max-width: 100%;
    margin: 1.5rem auto;
    border-radius: 4px;
}

blockquote {
    border-left: 3px solid var(--border);
    margin: 2.3rem 0;
    padding: 0.5rem 1rem;
    color: var(--muted);
    background: var(--blockquote-bg);
    border-radius: 0 4px 4px 0;
}

blockquote p:last-child { margin-bottom: 0; }

.callout {
    border-left: 4px solid var(--callout);
    background: var(--callout-bg);
    margin: 2.3rem 0;
    padding: 1rem 1.25rem;
    border-radius: 0 6px 6px 0;
    box-shadow: inset 0 0 12px rgba(34, 211, 238, 0.04);
}

.callout-title {
    font-family: 'Orbitron', sans-serif;
    font-weight: 600;
    font-size: 0.9rem;
    color: var(--callout);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.03em;
}

.callout p:last-child { margin-bottom: 0; }

.textWithImage {
    display: grid;
    gap: 3rem;
    grid-template-columns: 1fr 1fr;
    margin: 2.3rem 0;
    align-items: center;

    @media (max-width: 760px) {
        display: flex;
        flex-direction: column-reverse;
    }
}

.textWithImage__text {
}

ul, ol {
    margin: 0 0 1rem;
    padding-left: 2.5rem;
}

li { margin-bottom: 0.5rem; }
li p { margin-bottom: 0.5rem; }
li:last-child { margin-bottom: 0; }

.example-block {
    margin: 2.3rem 0 2.3rem 1rem;
    padding-left: 1rem;
    border-left: 2px solid var(--border);
    background: var(--bg-raised);
    padding: 0.75rem 1rem;
    border-radius: 0 4px 4px 0;
}

strong {
    font-weight: 700;
    color: #ffcdcd;
}

em { font-style: italic; }

.katex { color: #ffb567; }

.katex-display {
    margin: 2.3rem 0;
    overflow-x: auto;
    overflow-y: hidden;
    background: #4a696e;
    padding: 1rem 1.25rem;
    border-radius: 8px;
}

.katex .katex-html > .newline {
    height: 1rem;
}

.photo-attribution {
    display: block;
    text-align: center;
    font-size: 0.8rem;
    color: var(--muted);
    margin-top: 0.4rem;
}

.attribution-dialog {
    background: var(--bg-raised);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 8px;
    max-width: 40rem;
    padding: 0;
}

.attribution-dialog::backdrop {
    background: rgba(0, 0, 0, 0.6);
}

.attribution-dialog__content {
    padding: 1.5rem 2rem;
    position: relative;
}

.attribution-dialog__content p {
    margin: 0;
    font-size: 0.95rem;
    line-height: 1.6;
}

.attribution-dialog__close {
    position: absolute;
    top: 0.5rem;
    right: 0.75rem;
    background: none;
    border: none;
    color: var(--muted);
    font-size: 1.5rem;
    cursor: pointer;
    line-height: 1;
    padding: 0.25rem;
}

.attribution-dialog__close:hover {
    color: var(--text);
}

/* ── Floating nav ── */

.floating-nav {
    position: fixed;
    top: 1.5rem;
    left: calc(50% + var(--max-width) / 2 + 1rem);
    right: 1rem;
    max-width: 265px;
    max-height: calc(100vh - 3rem);
    overflow-y: auto;
    z-index: 100;
    background: rgba(7, 9, 14, 0.92);
    border: 1px solid rgba(34, 211, 238, 0.15);
    border-radius: 8px;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow:
        0 0 20px rgba(34, 211, 238, 0.06),
        0 4px 24px rgba(0, 0, 0, 0.4);
    scrollbar-width: thin;
    scrollbar-color: rgba(34, 211, 238, 0.2) transparent;
}

.floating-nav::-webkit-scrollbar {
    width: 4px;
}

.floating-nav::-webkit-scrollbar-track {
    background: transparent;
}

.floating-nav::-webkit-scrollbar-thumb {
    background: rgba(34, 211, 238, 0.2);
    border-radius: 2px;
}

.floating-nav__header {
    position: sticky;
    top: 0;
    background: rgba(7, 9, 14, 0.95);
    padding: 0.75rem 1rem 0.5rem;
    border-bottom: 1px solid rgba(34, 211, 238, 0.1);
    z-index: 1;
}

.floating-nav__title {
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #22d3ee;
}

.floating-nav__list {
    list-style: none;
    margin: 0;
    padding: 0.5rem 0 0.75rem;
}

.floating-nav__item {
    margin: 0;
}

.floating-nav__item a {
    display: block;
    padding: 0.25rem 1rem;
    font-size: 0.78rem;
    line-height: 1.4;
    color: var(--muted);
    text-decoration: none;
    border-left: 2px solid transparent;
    transition: color 0.2s, border-color 0.2s, background 0.2s;
}

.floating-nav__item a:hover {
    color: var(--text);
    background: rgba(34, 211, 238, 0.05);
}

.floating-nav__link--active {
    color: #adffea !important;
    border-left-color: #22d3ee !important;
    background: rgba(34, 211, 238, 0.08);
}

.floating-nav__item--h1 a { padding-left: 1rem; font-weight: 700; color: var(--accent); font-size: 0.82rem; }
.floating-nav__item--h2 a { padding-left: 1rem; }
.floating-nav__item--h3 a { padding-left: 1.75rem; }
.floating-nav__item--h4 a { padding-left: 2.5rem; }
.floating-nav__item--h5 a { padding-left: 3.25rem; font-size: 0.74rem; }
.floating-nav__item--h6 a { padding-left: 4rem; font-size: 0.72rem; }

.floating-nav__item--collapsible {
    overflow: hidden;
    max-height: 60px;
    transition: max-height 0.25s ease, opacity 0.25s ease;
    opacity: 1;
}

.floating-nav__item--collapsed {
    max-height: 0;
    opacity: 0;
}

.floating-nav__item--has-children > a::after {
    content: '';
    display: inline-block;
    width: 0;
    height: 0;
    margin-left: 0.4rem;
    vertical-align: middle;
    border-top: 4px solid transparent;
    border-bottom: 4px solid transparent;
    border-left: 5px solid currentColor;
    opacity: 0.4;
    transition: transform 0.25s ease, opacity 0.25s ease;
}

.floating-nav__item--expanded > a::after {
    transform: rotate(90deg);
    opacity: 0.7;
}

.floating-nav__links {
    display: flex;
    flex-direction: column;
    gap: 0.4rem;
    padding: 0.75rem 0.75rem;
    border-top: 1px solid rgba(34, 211, 238, 0.1);
}

.floating-nav__btn {
    display: block;
    padding: 0.45rem 0.7rem;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.65rem;
    font-weight: 600;
    letter-spacing: 0.03em;
    text-align: center;
    text-decoration: none;
    color: #adffea;
    border: 1px solid rgba(34, 211, 238, 0.25);
    border-radius: 5px;
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.08), rgba(169, 86, 255, 0.06));
    transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
}

.floating-nav__btn:hover {
    border-color: rgba(34, 211, 238, 0.5);
    background: linear-gradient(135deg, rgba(34, 211, 238, 0.14), rgba(169, 86, 255, 0.1));
    box-shadow: 0 0 10px rgba(34, 211, 238, 0.1);
    color: #adffea;
}

.floating-nav__btn--alt {
    color: #c68fff;
    border-color: rgba(169, 86, 255, 0.25);
    background: linear-gradient(135deg, rgba(169, 86, 255, 0.06), rgba(34, 211, 238, 0.04));
}

.floating-nav__btn--alt:hover {
    border-color: rgba(169, 86, 255, 0.5);
    background: linear-gradient(135deg, rgba(169, 86, 255, 0.12), rgba(34, 211, 238, 0.06));
    box-shadow: 0 0 10px rgba(169, 86, 255, 0.1);
    color: #c68fff;
}

.floating-nav-toggle {
    display: none;
    position: fixed;
    top: 1rem;
    right: 1rem;
    z-index: 101;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    border: 1px solid rgba(34, 211, 238, 0.2);
    background: rgba(7, 9, 14, 0.92);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    color: #22d3ee;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    box-shadow:
        0 0 12px rgba(34, 211, 238, 0.08),
        0 2px 8px rgba(0, 0, 0, 0.3);
    transition: border-color 0.2s, box-shadow 0.2s;
}

.floating-nav-toggle:hover {
    border-color: rgba(34, 211, 238, 0.4);
    box-shadow:
        0 0 16px rgba(34, 211, 238, 0.12),
        0 2px 8px rgba(0, 0, 0, 0.3);
}

.floating-nav-toggle--active {
    border-color: rgba(34, 211, 238, 0.5);
    background: rgba(34, 211, 238, 0.1);
}

@media (max-width: 1649px) {
    .floating-nav {
        display: none;
        left: auto;
        right: 1rem;
        top: 3.5rem;
        width: 280px;
        max-width: calc(100vw - 2rem);
    }

    .floating-nav--open {
        display: block;
    }

    .floating-nav-toggle {
        display: flex;
    }
}

/* Footer */
.site-footer {
    max-width: var(--max-width);
    margin: 0 auto;
    padding-top: 4rem;
}

.footer-divider {
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--callout) 30%, #a956ff 70%, transparent);
    opacity: 0.4;
    margin-bottom: 2rem;
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-family: 'Orbitron', sans-serif;
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--muted);
}

.footer-links a {
    color: var(--muted);
    text-decoration: none;
    transition: color 0.2s;
}

.footer-links a:hover {
    color: var(--callout);
}

.footer-dot {
    margin: 0 0.5rem;
    opacity: 0.4;
}

@media (max-width: 600px) {
    body {
        font-size: 1rem;
        padding: 1rem 1rem 3rem;
    }
    h1 { font-size: 1.6rem; }
    h2 { font-size: 1.3rem; }
    .katex-display {
        font-size: 0.9em;
    }
    .footer-content {
        flex-direction: column;
        gap: 0.5rem;
        text-align: center;
    }
}
