:root {
    color-scheme: dark;
    --blue: #2f6bff;
    --red: #ff2d55;
    --ink: #07111f;
    --panel: rgba(9, 18, 34, 0.82);
    --panel-strong: rgba(14, 26, 48, 0.94);
    --border: rgba(255, 255, 255, 0.14);
    --text: #edf4ff;
    --muted: #b7c4d8;
    --soft: rgba(255, 255, 255, 0.075);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
    margin: 0;
    background:
        linear-gradient(135deg, rgba(47, 107, 255, 0.28) 0%, rgba(7, 17, 31, 0) 40%),
        linear-gradient(315deg, rgba(255, 45, 85, 0.22) 0%, rgba(7, 17, 31, 0) 38%),
        linear-gradient(180deg, #07111f 0%, #130b19 54%, #07111f 100%);
    color: var(--text);
}

body {
    min-width: 320px;
}

a {
    color: inherit;
}

.skip-link {
    position: fixed;
    left: 14px;
    top: 12px;
    z-index: 40;
    transform: translateY(-140%);
    border-radius: 8px;
    padding: 10px 12px;
    background: #ffffff;
    color: #07111f;
    font-weight: 780;
    text-decoration: none;
    transition: transform 0.16s ease;
}

.skip-link:focus {
    transform: translateY(0);
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 20;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    min-height: 64px;
    padding: 10px clamp(14px, 2.6vw, 34px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(7, 17, 31, 0.88);
    backdrop-filter: blur(18px);
}

.site-brand {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    color: #ffffff;
    text-decoration: none;
}

.site-brand__mark {
    display: inline-grid;
    place-items: center;
    width: 34px;
    height: 34px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--blue), var(--red));
    font-weight: 820;
}

.site-brand__text {
    font-size: 1rem;
    font-weight: 780;
}

.site-nav {
    display: flex;
    align-items: center;
    gap: 6px;
}

.site-nav__link {
    border: 1px solid transparent;
    border-radius: 8px;
    padding: 9px 12px;
    color: var(--muted);
    font-size: 0.94rem;
    font-weight: 700;
    text-decoration: none;
}

.site-nav__link:hover,
.site-nav__link.is-active {
    border-color: rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.site-nav-toggle {
    display: none;
    width: 42px;
    height: 42px;
    border: 1px solid rgba(255, 255, 255, 0.14);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
}

.site-nav-toggle span {
    display: block;
    width: 18px;
    height: 2px;
    margin: 4px auto;
    border-radius: 999px;
    background: currentColor;
}

.site-shell {
    width: min(1120px, calc(100% - 28px));
    margin: 0 auto;
    padding: clamp(24px, 4vw, 46px) 0 54px;
}

.site-shell--full {
    width: 100%;
    padding: 0;
}

.analysis-page {
    position: relative;
    display: flex;
    min-height: calc(100vh - 64px);
    flex-direction: column;
    background:
        linear-gradient(135deg, rgba(47, 107, 255, 0.28) 0%, rgba(7, 17, 31, 0) 40%),
        linear-gradient(315deg, rgba(255, 45, 85, 0.22) 0%, rgba(7, 17, 31, 0) 38%),
        linear-gradient(180deg, #07111f 0%, #130b19 54%, #07111f 100%);
}

.analysis-loader {
    position: absolute;
    inset: 0;
    z-index: 2;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 28px;
    background:
        radial-gradient(circle at 42% 42%, rgba(47, 107, 255, 0.18), transparent 34%),
        radial-gradient(circle at 58% 56%, rgba(255, 45, 85, 0.16), transparent 36%),
        linear-gradient(180deg, #07111f 0%, #130b19 100%);
    color: #ffffff;
    opacity: 1;
    transition: opacity 0.22s ease, visibility 0.22s ease;
}

.analysis-loader.is-hidden {
    visibility: hidden;
    opacity: 0;
    pointer-events: none;
}

.analysis-loader__mark {
    display: inline-grid;
    place-items: center;
    width: 48px;
    height: 48px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--blue), var(--red));
    font-size: 1.28rem;
    font-weight: 860;
    box-shadow: 0 18px 48px rgba(47, 107, 255, 0.24);
}

.analysis-loader__eyebrow,
.analysis-loader__text {
    margin: 0;
}

.analysis-loader__eyebrow {
    color: #8db7ff;
    font-size: 0.78rem;
    font-weight: 820;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.analysis-loader__text {
    margin-top: 4px;
    color: var(--text);
    font-size: 1.02rem;
    font-weight: 720;
}

.analysis-frame {
    flex: 1 1 auto;
    min-height: calc(100vh - 64px);
    width: 100%;
    border: 0;
    border-radius: 0;
    background: #07111f;
}

.page-hero {
    padding: clamp(22px, 5vw, 50px) 0 22px;
}

.eyebrow {
    margin: 0 0 8px;
    color: #8db7ff;
    font-size: 0.75rem;
    font-weight: 820;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.page-hero h1 {
    max-width: 850px;
    margin: 0;
    color: #ffffff;
    font-size: clamp(2rem, 5vw, 4.6rem);
    line-height: 0.98;
}

.lede {
    max-width: 740px;
    margin: 18px 0 0;
    color: var(--muted);
    font-size: clamp(1rem, 2vw, 1.24rem);
    line-height: 1.55;
}

.step-grid,
.feature-grid,
.contact-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 14px;
}

.feature-grid--about {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.contact-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
}

.step,
.feature,
.contact-panel {
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px;
    background: var(--panel);
}

.step {
    display: flex;
    gap: 14px;
}

.step__number {
    display: inline-grid;
    place-items: center;
    flex: 0 0 42px;
    width: 42px;
    height: 42px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--blue), var(--red));
    color: #ffffff;
    font-size: 0.85rem;
    font-weight: 820;
}

.step h2,
.feature h2,
.contact-panel h2,
.callout-band h2,
.text-band h2 {
    margin: 0 0 8px;
    color: #ffffff;
    font-size: 1.08rem;
    line-height: 1.25;
}

.step p,
.feature p,
.contact-panel p,
.callout-band p,
.text-band p {
    margin: 0;
    color: var(--muted);
    font-size: 0.96rem;
    line-height: 1.52;
}

.callout-band,
.text-band {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 16px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    padding: 18px;
    background:
        linear-gradient(120deg, rgba(47, 107, 255, 0.24), rgba(255, 45, 85, 0.16)),
        var(--panel-strong);
}

.text-band {
    display: block;
}

.button-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 42px;
    border: 0;
    border-radius: 8px;
    padding: 10px 14px;
    background: linear-gradient(135deg, var(--blue), var(--red));
    color: #ffffff;
    font-weight: 780;
    text-decoration: none;
    white-space: nowrap;
}

.button-link--secondary {
    border: 1px solid rgba(255, 255, 255, 0.16);
    background: rgba(255, 255, 255, 0.08);
}

.funding-acknowledgment {
    display: flex;
    align-items: center;
    gap: 14px;
    margin-top: 18px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding-top: 14px;
    color: var(--muted);
}

.funding-acknowledgment img {
    flex: 0 0 auto;
    width: min(180px, 34vw);
    height: auto;
    opacity: 0.88;
}

.funding-acknowledgment p {
    max-width: 760px;
    margin: 0;
    color: var(--muted);
    font-size: 0.78rem;
    line-height: 1.42;
}

.funding-acknowledgment a {
    color: #dbeafe;
    font-weight: 700;
    text-decoration: none;
}

.funding-acknowledgment a:hover {
    color: #ffffff;
    text-decoration: underline;
    text-decoration-color: rgba(255, 45, 85, 0.72);
}

.contact-links {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 14px;
}

.tutorial-doc-hero {
    padding-bottom: 10px;
}

.tutorial-doc {
    max-width: 920px;
}

.tutorial-toc {
    margin: 8px 0 30px;
    border: 1px solid var(--border);
    border-radius: 8px;
    padding: 18px 20px;
    background:
        linear-gradient(135deg, rgba(47, 107, 255, 0.12), rgba(255, 45, 85, 0.06)),
        rgba(9, 18, 34, 0.72);
}

.tutorial-toc ol {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 22px;
    margin: 0;
    padding-left: 1.2rem;
}

.tutorial-toc a {
    color: #dbeafe;
    font-weight: 720;
    text-decoration: none;
}

.tutorial-toc a:hover {
    color: #ffffff;
    text-decoration: underline;
    text-decoration-color: rgba(255, 45, 85, 0.72);
}

.tutorial-doc-section {
    padding: 30px 0 4px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.tutorial-doc-section:first-of-type {
    border-top: 0;
    padding-top: 0;
}

.tutorial-doc-section h2,
.tutorial-next h2 {
    max-width: 860px;
    margin: 0 0 14px;
    color: #ffffff;
    font-size: clamp(1.55rem, 3vw, 2.7rem);
    line-height: 1.08;
}

.tutorial-doc-section p,
.tutorial-doc-section li,
.tutorial-next p {
    color: var(--muted);
    font-size: 1.02rem;
    line-height: 1.68;
}

.tutorial-doc-section p {
    max-width: 850px;
    margin: 0;
}

.tutorial-doc-section p + p {
    margin-top: 14px;
}

.tutorial-doc-section strong {
    color: #f8fbff;
}

.tutorial-doc-section code {
    border: 1px solid rgba(125, 178, 255, 0.22);
    border-radius: 6px;
    padding: 0.08rem 0.34rem;
    background: rgba(255, 255, 255, 0.08);
    color: #ffffff;
    font-size: 0.92em;
}

.tutorial-callout {
    max-width: 850px;
    margin-top: 18px !important;
    border-left: 3px solid var(--red);
    border-radius: 8px;
    padding: 14px 16px;
    background:
        linear-gradient(135deg, rgba(47, 107, 255, 0.12), rgba(255, 45, 85, 0.1)),
        rgba(255, 255, 255, 0.055);
}

.tutorial-doc-figure {
    margin: 24px 0;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 8px;
    background: var(--panel);
}

.tutorial-doc-figure img {
    display: block;
    width: 100%;
    height: auto;
    object-position: top center;
    background: transparent;
}

.tutorial-doc-figure--compact img,
.tutorial-doc-figure--small img {
    width: auto;
    max-width: 100%;
    margin: 0 auto;
}

.tutorial-doc-figure figcaption {
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    padding: 12px 14px;
    color: var(--muted);
    font-size: 0.95rem;
    line-height: 1.52;
}

.tutorial-doc-figure figcaption strong {
    color: #ffffff;
}

.tutorial-advanced {
    max-width: 850px;
    margin-top: 18px;
    border: 1px solid rgba(125, 178, 255, 0.2);
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.045);
}

.tutorial-advanced summary {
    cursor: pointer;
    padding: 12px 14px;
    color: #dbeafe;
    font-size: 0.92rem;
    font-weight: 780;
}

.tutorial-advanced p {
    margin: 0 !important;
    padding: 0 14px 14px;
    font-size: 0.95rem;
    line-height: 1.58;
}

.tutorial-next {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    margin-top: 34px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 8px;
    padding: 20px;
    background:
        linear-gradient(120deg, rgba(47, 107, 255, 0.24), rgba(255, 45, 85, 0.16)),
        var(--panel-strong);
}

.tutorial-next h2 {
    margin-bottom: 8px;
    font-size: clamp(1.3rem, 2.2vw, 1.9rem);
}

.tutorial-next p {
    max-width: 660px;
    margin: 0;
}

.site-footer {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 18px;
    width: min(1120px, calc(100% - 28px));
    margin: 0 auto;
    padding: 0 0 34px;
    color: var(--muted);
}

.site-footer__brand {
    font-weight: 820;
    color: #ffffff;
}

.site-footer__nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 10px 14px;
}

.site-footer__link {
    color: var(--muted);
    font-size: 0.9rem;
    font-weight: 700;
    text-decoration: none;
}

.site-footer__link:hover {
    color: #ffffff;
}

@media (max-width: 720px) {
    .site-nav-toggle {
        display: inline-block;
    }

    .site-nav {
        position: absolute;
        top: calc(100% + 8px);
        right: 14px;
        display: none;
        width: min(280px, calc(100vw - 28px));
        flex-direction: column;
        align-items: stretch;
        border: 1px solid var(--border);
        border-radius: 8px;
        padding: 8px;
        background: rgba(7, 17, 31, 0.96);
        box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
    }

    .site-nav.is-open {
        display: flex;
    }

    .step-grid,
    .feature-grid,
    .contact-grid,
    .tutorial-toc ol {
        grid-template-columns: 1fr;
    }

    .callout-band,
    .funding-acknowledgment,
    .tutorial-next {
        align-items: stretch;
        flex-direction: column;
    }

    .site-footer {
        align-items: flex-start;
        flex-direction: column;
    }

    .site-footer__nav {
        justify-content: flex-start;
    }

    .analysis-frame {
        min-height: calc(100vh - 64px);
    }
}

@media (max-width: 980px) {
    .tutorial-toc ol {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 560px) {
    .site-brand__text {
        font-size: 0.94rem;
    }

    .site-shell {
        width: min(100% - 18px, 1600px);
    }

    .page-hero h1 {
        font-size: 2rem;
        line-height: 1.04;
    }

    .analysis-frame {
        min-height: calc(100vh - 64px);
    }
}
