:root {
    --bg: #eff5fb;
    --bg-strong: #061a31;
    --surface: rgba(255, 255, 255, 0.88);
    --surface-strong: #ffffff;
    --surface-dark: rgba(7, 22, 41, 0.86);
    --border: rgba(7, 34, 61, 0.12);
    --border-strong: rgba(7, 34, 61, 0.18);
    --text: #11233b;
    --muted: #5e6f83;
    --primary: #0d63ff;
    --primary-strong: #0a4ecb;
    --accent: #ffba36;
    --success: #198754;
    --danger: #c53d2d;
    --shadow: 0 18px 60px rgba(6, 26, 49, 0.12);
    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    font-family: "Manrope", sans-serif;
    color: var(--text);
    background:
        radial-gradient(circle at top left, rgba(13, 99, 255, 0.18), transparent 24rem),
        radial-gradient(circle at top right, rgba(255, 186, 54, 0.18), transparent 18rem),
        linear-gradient(180deg, #f8fbff 0%, #edf3f9 52%, #eef4fb 100%);
    min-height: 100vh;
}

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

a:hover {
    text-decoration: underline;
}

button,
input,
select {
    font: inherit;
}

.container {
    width: min(1120px, calc(100% - 2rem));
    margin: 0 auto;
}

.page-shell {
    overflow: clip;
}

.site-header {
    color: #fff;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.08), transparent 34%),
        radial-gradient(circle at top right, rgba(53, 230, 211, 0.22), transparent 18rem),
        linear-gradient(135deg, #071a31 0%, #0a315f 55%, #0d63ff 100%);
    padding: 0.65rem 0 2.1rem;
    border-bottom-left-radius: 28px;
    border-bottom-right-radius: 28px;
    box-shadow: 0 28px 64px rgba(6, 26, 49, 0.22);
}

.topbar,
.hero,
.footer-grid,
.calculator-wrap,
.content-block {
    display: grid;
    gap: 1.5rem;
}

.topbar {
    grid-template-columns: auto 1fr;
    align-items: center;
    padding: 0.1rem 0 0.45rem;
}

.brand {
    font-family: "Space Grotesk", sans-serif;
    color: #fff;
    font-size: 1.15rem;
    font-weight: 700;
    letter-spacing: -0.02em;
}

.topbar-links {
    display: flex;
    justify-content: flex-end;
    flex-wrap: wrap;
    gap: 0.75rem 1rem;
}

.topbar-links a {
    color: rgba(255, 255, 255, 0.88);
    font-size: 0.96rem;
}

.hero {
    grid-template-columns: 1fr;
    padding: 0.45rem 0 0;
}

.hero h1,
.section-heading h2,
.content-main h2,
.faq-section h2 {
    font-family: "Space Grotesk", sans-serif;
    letter-spacing: -0.03em;
    margin: 0;
}

.hero h1 {
    font-size: clamp(1.85rem, 2.7vw, 2.8rem);
    line-height: 1.03;
    /*max-width: 20ch;*/
}

.hero-lead {
    margin: 0.75rem 0 0;
    /*max-width: 60ch;*/
    color: rgba(255, 255, 255, 0.9);
    font-size: 0.98rem;
    line-height: 1.65;
}

.eyebrow,
.grade-kicker,
.print-kicker {
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
    letter-spacing: 0.12em;
}

.eyebrow {
    color: var(--primary-strong);
    margin: 0 0 0.65rem;
}

.site-header .eyebrow {
    color: rgba(255, 255, 255, 0.7);
}

.hero-actions,
.form-actions,
.result-actions,
.topbar-links,
.preset-buttons {
    display: flex;
    flex-wrap: wrap;
}

.hero-actions {
    gap: 0.7rem;
    margin-top: 1rem;
}

.primary-link,
.secondary-link,
.primary-button,
.ghost-button,
.action-button,
.card-link {
    border-radius: 999px;
    padding: 0.72rem 1rem;
    border: 1px solid transparent;
    transition: 180ms ease;
}

.primary-link,
.primary-button,
.card-link {
    background: linear-gradient(135deg, var(--accent), #ffd57d);
    color: #1d1d1d;
    font-weight: 800;
}

.secondary-link,
.ghost-button,
.action-button {
    background: rgba(255, 255, 255, 0.1);
    color: inherit;
    border-color: rgba(255, 255, 255, 0.2);
}

.secondary-link:hover,
.primary-link:hover,
.primary-button:hover,
.ghost-button:hover,
.action-button:hover,
.card-link:hover {
    transform: translateY(-1px);
    text-decoration: none;
}

main {
    margin-top: -0.35rem;
}

.class-hub,
.calculator-section,
.content-sections,
.faq-section {
    padding: 1rem 0 0;
}

.section-heading {
    max-width: 72ch;
}

.section-heading--compact {
    max-width: none;
}

.section-heading p {
    color: var(--muted);
    line-height: 1.6;
    margin-top: 0.45rem;
}

.grade-switcher {
    display: flex;
    flex-wrap: wrap;
    gap: 0.7rem;
    margin-top: 1rem;
}

.sticky-card,
.content-block,
.faq-item,
.preset-strip,
.calculator-form,
.noscript-warning {
    background: var(--surface);
    backdrop-filter: blur(16px);
    border: 1px solid var(--border);
    box-shadow: var(--shadow);
    border-radius: var(--radius);
}

.grade-chip {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    min-width: 124px;
    padding: 0.7rem 1rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.9);
    border: 1px solid var(--border-strong);
    color: var(--text);
    font-size: 0.98rem;
    font-weight: 700;
}

.grade-chip:hover {
    text-decoration: none;
    border-color: rgba(13, 99, 255, 0.32);
    transform: translateY(-1px);
}

.grade-chip.is-current {
    background: rgba(13, 99, 255, 0.1);
    color: var(--primary-strong);
    border-color: rgba(13, 99, 255, 0.18);
}

.calculator-wrap {
    grid-template-columns: minmax(0, 1.62fr) minmax(250px, 0.68fr);
    align-items: start;
    gap: 0.9rem;
    margin-top: 1rem;
}

.preset-strip,
.calculator-form,
.sticky-card {
    padding: 0.82rem;
}

.preset-strip-header strong {
    display: block;
    font-size: 1rem;
}

.preset-strip-header p,
.tiny-note-grid p,
.result-summary p,
.content-main p,
.content-aside p,
.faq-item p,
.form-feedback {
    color: var(--muted);
    line-height: 1.6;
}

.preset-select-wrap {
    display: grid;
    gap: 0.45rem;
    margin-top: 0.85rem;
}

.preset-select-label {
    font-size: 0.88rem;
    font-weight: 700;
}

.preset-select {
    width: 100%;
    appearance: none;
    border: 1px solid rgba(7, 34, 61, 0.16);
    border-radius: 14px;
    padding: 0.78rem 2.8rem 0.78rem 0.95rem;
    background:
        linear-gradient(45deg, transparent 50%, var(--muted) 50%) calc(100% - 18px) calc(50% - 2px) / 8px 8px no-repeat,
        linear-gradient(135deg, var(--muted) 50%, transparent 50%) calc(100% - 12px) calc(50% - 2px) / 8px 8px no-repeat,
        rgba(255, 255, 255, 0.9);
    color: var(--text);
}

.course-list {
    display: grid;
    gap: 0.7rem;
}

.course-card {
    border: 1px solid var(--border);
    border-radius: 16px;
    padding: 0.72rem;
    background: rgba(255, 255, 255, 0.88);
}

.course-header {
    display: grid;
    grid-template-columns: minmax(0, 1.45fr) 114px auto;
    gap: 0.55rem;
    align-items: end;
}

.field,
.term-panel {
    display: grid;
    gap: 0.28rem;
}

.field span,
.term-panel legend {
    font-size: 0.88rem;
    font-weight: 700;
    color: var(--text);
}

.field input {
    width: 100%;
    border: 1px solid rgba(7, 34, 61, 0.16);
    border-radius: 12px;
    padding: 0.58rem 0.72rem;
    background: #fff;
}

.remove-course {
    align-self: center;
    height: 40px;
    padding: 0.55rem 0.8rem;
    border: 1px solid rgba(197, 61, 45, 0.18);
    background: rgba(197, 61, 45, 0.08);
    border-radius: 12px;
    color: var(--danger);
}

.course-terms {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.62rem;
    margin-top: 0.65rem;
}

.term-panel {
    margin: 0;
    min-width: 0;
    border: 1px solid var(--border);
    border-radius: 14px;
    padding: 0.72rem;
}

.term-panel legend {
    padding: 0 0.3rem;
    font-size: 0.84rem;
}

.term-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.55rem;
    flex-wrap: wrap;
}

.term-toggle {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-size: 0.84rem;
    color: var(--muted);
}

.term-option {
    display: inline-flex;
    align-items: center;
    gap: 0.45rem;
    padding: 0.36rem 0.62rem;
    border-radius: 999px;
    background: rgba(7, 34, 61, 0.05);
    color: var(--text);
    font-size: 0.8rem;
    font-weight: 700;
}

.term-option input {
    margin: 0;
}

.term-note {
    margin: 0;
    color: var(--muted);
    font-size: 0.82rem;
    line-height: 1.5;
}

.term-inputs {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.5rem;
}

.term-inputs input:disabled {
    background: #f3f5f8;
    color: #90a0b2;
}

.field[hidden] {
    display: none !important;
}

.form-actions {
    gap: 0.6rem;
    margin-top: 0.8rem;
}

.primary-button {
    border: none;
}

.ghost-button,
.action-button {
    color: var(--text);
    border-color: var(--border-strong);
    background: rgba(255, 255, 255, 0.78);
}

.ghost-button:hover,
.action-button:hover {
    border-color: rgba(13, 99, 255, 0.25);
}

.form-feedback {
    min-height: 1.6rem;
    margin: 0.85rem 0 0;
}

.form-feedback.is-error {
    color: var(--danger);
}

.form-feedback.is-success {
    color: var(--success);
}

.sticky-card {
    position: sticky;
    top: 1rem;
}

.sticky-card h3 {
    margin: 0 0 0.7rem;
}

.result-summary {
    min-height: 150px;
}

.result-placeholder {
    margin: 0;
}

.summary-score {
    display: grid;
    gap: 0.2rem;
    padding: 0.9rem;
    border-radius: 18px;
    background:
        radial-gradient(circle at top right, rgba(255, 186, 54, 0.22), transparent 10rem),
        linear-gradient(135deg, rgba(13, 99, 255, 0.1), rgba(7, 34, 61, 0.02));
}

.summary-score strong {
    font-family: "Space Grotesk", sans-serif;
    font-size: clamp(1.8rem, 3vw, 2.5rem);
    line-height: 1;
}

.summary-score span {
    color: var(--muted);
}

.summary-chip-row,
.stats-grid {
    display: grid;
    gap: 0.6rem;
    margin-top: 0.8rem;
}

.summary-chip-row {
    grid-template-columns: repeat(2, minmax(0, 1fr));
}

.summary-chip,
.stat-card {
    border-radius: 18px;
    border: 1px solid var(--border);
    background: rgba(255, 255, 255, 0.75);
}

.summary-chip {
    padding: 0.7rem 0.85rem;
}

.summary-chip small,
.stat-card small {
    display: block;
    color: var(--muted);
    font-size: 0.82rem;
}

.summary-chip strong,
.stat-card strong {
    display: block;
    margin-top: 0.25rem;
}

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

.stat-card {
    padding: 0.8rem;
}

.result-table-wrap {
    margin-top: 0.8rem;
    overflow-x: auto;
}

.result-table {
    width: 100%;
    border-collapse: collapse;
    min-width: 560px;
}

.result-table th,
.result-table td {
    text-align: left;
    padding: 0.62rem 0.5rem;
    border-bottom: 1px solid rgba(7, 34, 61, 0.08);
    font-size: 0.88rem;
}

.result-actions {
    gap: 0.55rem;
    margin-top: 0.8rem;
}

.action-button[disabled] {
    opacity: 0.45;
    cursor: not-allowed;
}

.tiny-note-grid {
    display: grid;
    gap: 0.55rem;
    margin-top: 0.8rem;
}

.tiny-note-grid p {
    margin: 0;
    padding: 0.58rem 0.7rem;
    border-radius: 14px;
    background: rgba(7, 34, 61, 0.04);
    font-size: 0.85rem;
}

.content-sections .container {
    display: grid;
    gap: 1rem;
}

.content-block {
    grid-template-columns: minmax(0, 1.4fr) minmax(240px, 0.8fr);
    padding: 1.15rem;
}

.content-main p,
.content-main ul,
.content-aside p {
    margin-top: 0.7rem;
}

.content-list {
    padding-left: 1.1rem;
    color: var(--muted);
    line-height: 1.75;
}

.content-aside {
    padding: 1rem;
    border-radius: 16px;
    background:
        linear-gradient(180deg, rgba(255, 186, 54, 0.12), rgba(255, 255, 255, 0.8));
    border: 1px solid rgba(255, 186, 54, 0.24);
}

.faq-list {
    display: grid;
    gap: 0.7rem;
    margin-top: 1rem;
}

.faq-item {
    padding: 0.85rem 1rem;
}

.faq-item summary {
    font-weight: 800;
    cursor: pointer;
    list-style: none;
}

.faq-item summary::-webkit-details-marker {
    display: none;
}

.faq-item p {
    margin-bottom: 0;
}

.site-footer {
    margin-top: 2rem;
    padding: 1.6rem 0 2.4rem;
    background: #08172a;
    color: rgba(255, 255, 255, 0.88);
}

.footer-grid {
    grid-template-columns: 1.2fr 1fr 0.9fr;
}

.footer-grid a {
    display: block;
    color: rgba(255, 255, 255, 0.82);
    margin-bottom: 0.5rem;
}

.print-stage {
    position: fixed;
    inset: 0;
    pointer-events: none;
    opacity: 0;
    overflow: hidden;
}

.hologram-sheet {
    max-width: 860px;
    margin: 0 auto;
    padding: 2rem;
    color: #0b1730;
    background:
        radial-gradient(circle at top right, rgba(13, 99, 255, 0.25), transparent 12rem),
        radial-gradient(circle at top left, rgba(255, 186, 54, 0.22), transparent 12rem),
        linear-gradient(135deg, rgba(255, 255, 255, 0.96), rgba(239, 247, 255, 0.96));
    border: 1px solid rgba(13, 99, 255, 0.18);
    border-radius: 28px;
    box-shadow: 0 24px 48px rgba(6, 26, 49, 0.16);
}

.print-header {
    padding-bottom: 1.2rem;
    border-bottom: 1px solid rgba(7, 34, 61, 0.08);
    margin-bottom: 1.2rem;
}

.noscript-warning {
    margin: 1.5rem auto;
    padding: 1rem 1.2rem;
    max-width: 720px;
}

@media (max-width: 1100px) {
    .stats-grid,
    .footer-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }
}

@media (max-width: 920px) {
    .hero,
    .calculator-wrap,
    .content-block,
    .topbar {
        grid-template-columns: 1fr;
    }

    .topbar-links {
        justify-content: flex-start;
    }

    .sticky-card {
        position: static;
    }

    .hero h1 {
        max-width: 18ch;
    }

    .summary-chip-row,
    .stats-grid {
        grid-template-columns: 1fr;
    }
}

@media (max-width: 720px) {
    .course-header,
    .course-terms,
    .term-inputs,
    .footer-grid {
        grid-template-columns: 1fr;
    }

    .site-header {
        padding-bottom: 1.45rem;
        border-bottom-left-radius: 22px;
        border-bottom-right-radius: 22px;
    }

    .hero h1 {
        font-size: 1.8rem;
        max-width: none;
    }

    .hero-lead {
        font-size: 0.94rem;
    }

    .primary-link,
    .secondary-link,
    .primary-button,
    .ghost-button,
    .action-button,
    .card-link,
    .grade-chip,
    .remove-course {
        width: 100%;
        justify-content: center;
        text-align: center;
    }
}

@media print {
    @page {
        margin: 12mm;
    }

    body {
        background: #fff;
        color: #111;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    .page-shell,
    .noscript-warning {
        display: none !important;
    }

    .print-stage {
        position: static;
        opacity: 1;
        pointer-events: auto;
        overflow: visible;
    }

    .hologram-sheet {
        box-shadow: none;
        border-radius: 0;
        border: 0;
        max-width: none;
        padding: 0;
    }
}
