:root {
    --ink: #111827;
    --muted: #667085;
    --paper: #f3f7f6;
    --panel: #ffffff;
    --line: #d7e0dd;
    --teal: #0f766e;
    --teal-dark: #0b4f49;
    --aqua: #18b6a8;
    --gold: #d59b2d;
    --violet: #5542a9;
    --deep: #071018;
    --shadow: 0 22px 60px rgba(15, 23, 42, .11);
    --soft-shadow: 0 10px 30px rgba(15, 23, 42, .08);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(24, 182, 168, .14), transparent 32rem),
        linear-gradient(180deg, #f7fbfa 0%, var(--paper) 45%, #eef4f2 100%);
    font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    line-height: 1.58;
    -webkit-font-smoothing: antialiased;
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
    outline: 3px solid rgba(24, 182, 168, .36);
    outline-offset: 3px;
}

.site-header {
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 24px;
    padding: 14px clamp(18px, 4vw, 56px);
    background: rgba(255, 255, 255, .78);
    border-bottom: 1px solid rgba(17, 24, 39, .08);
    box-shadow: 0 10px 26px rgba(15, 23, 42, .05);
    backdrop-filter: blur(18px);
}

.brand {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 210px;
}

.brand-mark {
    display: grid;
    place-items: center;
    width: 46px;
    height: 46px;
    border-radius: 8px;
    color: white;
    background:
        linear-gradient(145deg, rgba(255, 255, 255, .18), transparent 42%),
        linear-gradient(135deg, var(--teal), var(--violet));
    box-shadow: 0 12px 28px rgba(15, 118, 110, .28);
    font-weight: 900;
}

.brand strong,
.brand small {
    display: block;
}

.brand strong {
    font-size: 1.05rem;
    letter-spacing: .02em;
}

.brand small,
.muted {
    color: var(--muted);
}

.nav {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 6px;
}

.nav a {
    padding: 9px 13px;
    border-radius: 8px;
    color: #26323d;
    font-size: .95rem;
    font-weight: 750;
    transition: background .18s ease, color .18s ease, transform .18s ease;
}

.nav a:hover {
    color: var(--teal-dark);
    background: rgba(15, 118, 110, .1);
    transform: translateY(-1px);
}

.flash {
    width: min(1120px, calc(100% - 36px));
    margin: 18px auto 0;
    padding: 13px 16px;
    border: 1px solid rgba(15, 118, 110, .2);
    border-radius: 8px;
    color: #104a43;
    background: #e8f8f4;
    box-shadow: var(--soft-shadow);
}

.hero {
    min-height: min(760px, calc(100vh - 74px));
    display: flex;
    align-items: center;
    position: relative;
    overflow: hidden;
    padding: clamp(58px, 8vw, 104px) clamp(20px, 6vw, 80px);
    color: white;
    background:
        linear-gradient(90deg, rgba(3, 8, 14, .95) 0%, rgba(7, 16, 24, .82) 46%, rgba(7, 16, 24, .18) 100%),
        url("hero-physics.png") center right / cover no-repeat;
}

.hero::after {
    content: "";
    position: absolute;
    inset: auto 0 0;
    height: 130px;
    background: linear-gradient(180deg, transparent, var(--paper));
    pointer-events: none;
}

.hero-copy {
    position: relative;
    z-index: 1;
    max-width: 680px;
}

h1,
h2,
h3 {
    margin: 0 0 14px;
    line-height: 1.06;
    letter-spacing: 0;
}

h1 {
    font-size: clamp(3.4rem, 9vw, 7.8rem);
    font-weight: 900;
}

.page-band h1,
.reader h1 {
    max-width: 920px;
    font-size: clamp(2.35rem, 6vw, 5.1rem);
}

h2 {
    font-size: clamp(1.7rem, 3vw, 2.55rem);
    font-weight: 880;
}

h3 {
    font-weight: 840;
}

.hero p {
    max-width: 590px;
    color: rgba(255, 255, 255, .84);
    font-size: 1.22rem;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--gold);
    font-size: .76rem;
    font-weight: 900;
    letter-spacing: .13em;
    text-transform: uppercase;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    padding: 11px 17px;
    border: 1px solid var(--teal);
    border-radius: 8px;
    color: white;
    background: linear-gradient(135deg, var(--teal), #10988c);
    box-shadow: 0 14px 30px rgba(15, 118, 110, .22);
    font-weight: 850;
    cursor: pointer;
    transition: transform .18s ease, box-shadow .18s ease, background .18s ease;
}

.button:hover {
    transform: translateY(-1px);
    box-shadow: 0 18px 40px rgba(15, 118, 110, .28);
}

.button.ghost {
    color: var(--teal-dark);
    background: rgba(255, 255, 255, .72);
    box-shadow: none;
}

.hero .button.ghost {
    color: white;
    border-color: rgba(255, 255, 255, .38);
    background: rgba(255, 255, 255, .08);
}

.hero-actions,
.admin-actions form {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    margin-top: 26px;
}

.section-head,
.grid,
.split,
.admin-shell,
.reader,
.page-band {
    width: min(1160px, calc(100% - 36px));
    margin: 0 auto;
}

.section-head {
    display: flex;
    align-items: end;
    justify-content: space-between;
    gap: 24px;
    padding: 72px 0 20px;
}

.section-head > a {
    color: var(--teal-dark);
    font-weight: 900;
}

.grid {
    display: grid;
    gap: 18px;
}

.course-grid,
.article-grid,
.video-grid {
    grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}

.card,
.panel {
    border: 1px solid rgba(17, 24, 39, .08);
    border-radius: 8px;
    background: rgba(255, 255, 255, .92);
    box-shadow: var(--soft-shadow);
}

.card {
    position: relative;
    padding: 22px;
    overflow: hidden;
    transition: transform .2s ease, box-shadow .2s ease, border-color .2s ease;
}

.card::before {
    content: "";
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 4px;
    background: linear-gradient(90deg, var(--teal), var(--gold), var(--violet));
    opacity: .78;
}

.card:hover {
    border-color: rgba(15, 118, 110, .24);
    box-shadow: var(--shadow);
    transform: translateY(-4px);
}

.course-card {
    min-height: 230px;
    display: flex;
    flex-direction: column;
}

.course-card p,
.article-card p {
    color: #4d5965;
}

.course-level,
.topic-pill {
    display: inline-flex;
    width: fit-content;
    margin-bottom: 18px;
    padding: 5px 10px;
    border: 1px solid rgba(15, 118, 110, .12);
    border-radius: 999px;
    color: var(--teal-dark);
    background: #e8f5f2;
    font-size: .78rem;
    font-weight: 900;
}

.article-card h2,
.course-card h2,
.course-card h3 {
    font-size: 1.35rem;
}

.article-card small {
    color: var(--muted);
    font-weight: 700;
}

.video-card {
    padding: 0;
    overflow: hidden;
}

.video-card iframe {
    display: block;
    width: 100%;
    aspect-ratio: 16 / 9;
    border: 0;
    background: var(--deep);
}

.video-card h2,
.video-card h3 {
    padding: 17px 18px 20px;
    font-size: 1.02rem;
}

.page-band {
    padding: 78px 0 32px;
}

.page-band.compact {
    max-width: 940px;
}

.page-band p:not(.eyebrow) {
    color: #4d5965;
    font-size: 1.12rem;
}

.split {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: 30px;
    padding: 26px 0 78px;
}

.split > div,
.admin-shell section {
    border: 1px solid rgba(17, 24, 39, .08);
    border-radius: 8px;
    background: rgba(255, 255, 255, .74);
    box-shadow: var(--soft-shadow);
    padding: 24px;
}

.module-list {
    display: grid;
    gap: 12px;
    padding-left: 22px;
}

.module-list li {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
    font-weight: 740;
}

.article-row {
    display: grid;
    gap: 4px;
    padding: 15px 0;
    border-bottom: 1px solid var(--line);
    transition: color .18s ease, transform .18s ease;
}

.article-row:hover {
    color: var(--teal-dark);
    transform: translateX(3px);
}

.article-row span {
    color: var(--muted);
}

.reader {
    max-width: 850px;
    padding: 78px 0;
}

.reader .lead {
    font-size: 1.35rem;
    color: #34404a;
}

.body-copy {
    margin: 30px 0;
    color: #2d3742;
    font-size: 1.08rem;
}

.admin-shell {
    padding: 58px 0 84px;
}

.admin-actions {
    margin-bottom: 18px;
}

.panel {
    padding: 26px;
}

.article-form {
    margin: 20px 0 32px;
}

.login-panel {
    max-width: 520px;
}

label {
    display: grid;
    gap: 7px;
    margin-bottom: 14px;
    color: #34404a;
    font-size: .92rem;
    font-weight: 850;
}

input,
select,
textarea {
    width: 100%;
    padding: 12px 13px;
    border: 1px solid #cbd8d5;
    border-radius: 8px;
    background: #fbfdfc;
    color: var(--ink);
    font: inherit;
    transition: border-color .18s ease, box-shadow .18s ease, background .18s ease;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--teal);
    background: white;
    box-shadow: 0 0 0 4px rgba(15, 118, 110, .11);
    outline: none;
}

textarea {
    resize: vertical;
}

.form-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
    gap: 12px;
}

.footer {
    display: flex;
    justify-content: space-between;
    gap: 24px;
    padding: 38px clamp(18px, 4vw, 56px);
    color: white;
    background:
        linear-gradient(135deg, rgba(15, 118, 110, .22), transparent 38%),
        var(--deep);
}

.footer p {
    margin: 6px 0 0;
    color: #b8c1c6;
}

.footer-links {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    font-weight: 750;
}

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

code {
    padding: 2px 5px;
    border-radius: 5px;
    background: rgba(0, 0, 0, .07);
}

@media (max-width: 760px) {
    .site-header,
    .footer,
    .section-head,
    .split {
        display: block;
    }

    .brand {
        min-width: 0;
    }

    .nav {
        justify-content: flex-start;
        margin-top: 14px;
    }

    .nav a {
        padding: 8px 10px;
    }

    .hero {
        min-height: 690px;
        align-items: end;
        padding-bottom: 74px;
        background:
            linear-gradient(180deg, rgba(8, 13, 19, .46) 0%, rgba(8, 13, 19, .94) 62%),
            url("hero-physics.png") center right / cover no-repeat;
    }

    h1 {
        font-size: clamp(3.15rem, 16vw, 5rem);
    }

    .section-head {
        padding-top: 56px;
    }

    .split > div {
        margin-bottom: 18px;
    }

    .footer-links {
        margin-top: 18px;
    }
}
