:root {
    --bg: #f5f3ee;
    --paper: #fbfaf7;
    --ink: #171918;
    --muted: #6c706c;
    --line: rgba(23, 25, 24, .13);

    --accent: #b7dd42;
    --dark: #16201c;
    --warm: #ece6da;

    --radius: 24px;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-snap-type: y proximity;
}

html.reading-mode {
    scroll-snap-type: none;
}

body {
    margin: 0;

    background: var(--bg);
    color: var(--ink);

    font-family:
        Inter,
        ui-sans-serif,
        system-ui,
        -apple-system,
        BlinkMacSystemFont,
        "Segoe UI",
        sans-serif;

    -webkit-font-smoothing: antialiased;
}

.topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;

    z-index: 100;

    height: 68px;
    padding: 0 32px;

    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;

    color: white;

    mix-blend-mode: difference;
    pointer-events: none;
}

.brand,
.course-id,
.progress {
    pointer-events: auto;
}

.brand {
    justify-self: start;

    display: flex;
    align-items: center;
    gap: 11px;

    color: inherit;
    text-decoration: none;
}

.brand-mark {
    width: 31px;
    height: 22px;

    display: grid;
    place-items: center;

    border: 1.5px solid currentColor;
    border-radius: 60% 40% 60% 40%;

    transform: rotate(-6deg);
}

.brand-eye {
    width: 7px;
    height: 7px;

    border-radius: 50%;
    background: currentColor;
}

.brand-name {
    font-size: .72rem;
    font-weight: 750;
    letter-spacing: .14em;
}

.course-id {
    justify-self: center;

    display: flex;
    gap: 18px;

    font-size: .7rem;
    letter-spacing: .1em;
    text-transform: uppercase;
}

.institution {
    font-weight: 800;
}

.progress {
    justify-self: end;

    font-size: .76rem;
    font-weight: 700;
    font-variant-numeric: tabular-nums;
}

.progress-separator {
    margin: 0 5px;
    opacity: .45;
}


/* =========================================================
   ÉCRANS
   ========================================================= */

.screen {
    position: relative;

    min-height: 100svh;

    padding:
        clamp(92px, 11vh, 125px)
        7vw
        clamp(58px, 8vh, 90px);

    display: flex;
    align-items: center;

    scroll-snap-align: start;

    background:
        linear-gradient(
            rgba(23, 25, 24, .035) 1px,
            transparent 1px
        ),
        linear-gradient(
            90deg,
            rgba(23, 25, 24, .035) 1px,
            transparent 1px
        ),
        var(--paper);

    background-size: 48px 48px;
}

.screen.dark {
    background: var(--dark);
    color: #f7f8f2;
}

.screen.warm {
    background: var(--warm);
}

.screen.accent {
    background: var(--accent);
}

.screen--hero {
    min-height: 100svh;
}

.screen--dense {
    padding-top: clamp(80px, 9vh, 100px);
    padding-bottom: clamp(40px, 5vh, 60px);
}

.screen--dense h2 {
    margin-bottom: 24px;

    font-size: clamp(2.2rem, 4vw, 4.4rem);
}

.screen-inner {
    width: 100%;
    margin: auto;
}

.screen-inner.narrow {
    max-width: 1050px;
}

.screen-inner.wide {
    max-width: 1380px;
}


/* =========================================================
   TYPOGRAPHIE
   ========================================================= */

.eyebrow {
    margin-bottom: 28px;

    font-size: .72rem;
    font-weight: 800;
    letter-spacing: .16em;
    text-transform: uppercase;

    opacity: .66;
}

h1,
h2,
h3,
p {
    margin-top: 0;
}

h1 {
    max-width: 1150px;

    margin-bottom: 35px;

    font-size: clamp(4rem, 8.4vw, 8.5rem);
    line-height: .89;
    letter-spacing: -.065em;
    font-weight: 720;
}

h1 span {
    color: var(--accent);
}

h2 {
    max-width: 1050px;

    margin-bottom: 42px;

    font-size: clamp(2.5rem, 5vw, 5.5rem);
    line-height: .98;
    letter-spacing: -.052em;
    font-weight: 680;
}

.lead {
    max-width: 720px;

    color: rgba(255, 255, 255, .72);

    font-size: clamp(1.2rem, 2vw, 1.65rem);
    line-height: 1.5;
}

.definition {
    max-width: 820px;

    font-size: clamp(1.2rem, 2vw, 1.6rem);
    line-height: 1.55;
}

.muted {
    max-width: 700px;

    color: rgba(255, 255, 255, .6);

    font-size: 1.15rem;
    line-height: 1.6;
}


/* =========================================================
   HERO
   ========================================================= */

.hero-meta {
    position: absolute;

    left: 7vw;
    right: 7vw;
    bottom: 48px;

    display: flex;
    justify-content: space-between;

    padding-top: 17px;

    border-top: 1px solid rgba(255, 255, 255, .18);

    color: rgba(255, 255, 255, .55);

    font-size: .72rem;
    letter-spacing: .08em;
    text-transform: uppercase;
}


/* =========================================================
   QUESTION / WOOCLAP
   ========================================================= */

.choices {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 14px;

    margin-top: 45px;
}

.choice {
    padding: 24px;

    border: 1px solid rgba(23, 25, 24, .15);
    border-radius: 18px;

    font-weight: 800;
}

.choice span {
    margin-left: 15px;

    font-size: 1.25rem;
    font-weight: 550;
}

.interaction-card {
    margin-top: 55px;
    padding-top: 22px;

    display: flex;
    align-items: center;
    justify-content: space-between;

    border-top: 1px solid var(--line);
}

.interaction-card p {
    margin: 4px 0 0;

    color: var(--muted);
}

.interaction-badge {
    padding: 9px 14px;

    border: 1px solid var(--ink);
    border-radius: 999px;

    font-size: .66rem;
    font-weight: 900;
    letter-spacing: .12em;
}


/* =========================================================
   ÉQUATIONS
   ========================================================= */

.equation-main {
    margin: 30px 0 44px;

    font-size: clamp(2.4rem, 6vw, 5.7rem);

    text-align: left;
}

.katex-display {
    margin: 0 !important;
    text-align: inherit !important;
}


/* =========================================================
   UNITÉS
   ========================================================= */

.unit-row {
    margin-top: 48px;
    padding-top: 20px;

    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 24px;

    border-top: 1px solid var(--line);
}

.unit-row > div {
    display: grid;
    grid-template-columns: auto 1fr auto;
    gap: 12px;
    align-items: baseline;
}

.unit-symbol {
    font-size: 1.45rem;
    font-weight: 800;
}

.unit-row span:nth-child(2) {
    color: var(--muted);
}


/* =========================================================
   GRAND NOMBRE
   ========================================================= */

.big-number {
    display: flex;
    align-items: center;
    gap: 32px;
    flex-wrap: wrap;

    margin: 30px 0 28px;
}

.big-number .value {
    font-size: clamp(3rem, 6vw, 6rem);
    font-weight: 750;
    letter-spacing: -.05em;
}

.big-number .equals {
    font-size: 3rem;
    opacity: .35;
}


/* =========================================================
   ORDRES DE GRANDEUR
   ========================================================= */

.magnitude-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 16px;
}

.magnitude-grid article {
    min-height: 215px;

    padding: 27px;

    border: 1px solid var(--line);
    border-radius: var(--radius);

    background: rgba(255, 255, 255, .42);
}

.magnitude {
    font-size: clamp(2.1rem, 3vw, 3.3rem);
    font-weight: 800;
    letter-spacing: -.05em;
}

.object {
    margin-top: 12px;

    font-size: 1.15rem;
    font-weight: 700;
}

.magnitude-grid p {
    margin-top: 30px;

    color: var(--muted);
    line-height: 1.45;
}

.scale {
    margin-top: 40px;

    display: grid;
    grid-template-columns: auto 1fr auto;
    align-items: center;
    gap: 14px;

    color: var(--muted);

    font-size: .75rem;
}

.scale div {
    height: 1px;
    background: var(--ink);
}


/* =========================================================
   CALCUL
   ========================================================= */

.question {
    margin-bottom: 20px;

    font-size: 1.3rem;
    font-weight: 650;
}

.calculation {
    margin-top: 18px;

    font-size: clamp(1.2rem, 2.2vw, 2rem);
}

.calculation .katex-display {
    margin: 9px 0 !important;
}

.result {
    margin-top: 22px;
    padding-top: 20px;

    border-top: 1px solid rgba(23, 25, 24, .25);

    font-size: clamp(1.8rem, 3.3vw, 3.4rem);
}


/* =========================================================
   ÉNERGIE / PUISSANCE
   ========================================================= */

.split-concept {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: stretch;
    gap: 25px;
}

.split-concept > div:not(.not-equal) {
    padding: 32px;

    border: 1px solid var(--line);
    border-radius: var(--radius);
}

.concept-label {
    display: block;

    margin-bottom: 22px;

    font-size: .67rem;
    font-weight: 850;
    letter-spacing: .14em;
}

.split-concept strong {
    display: block;

    font-size: clamp(2.5rem, 4vw, 4.2rem);
    letter-spacing: -.05em;
}

.split-concept p {
    margin: 12px 0 0;

    color: var(--muted);
}

.not-equal {
    align-self: center;

    font-size: 3.5rem;
    opacity: .35;
}

.statement {
    margin-top: 38px;

    font-size: 1.3rem;
}

.material-hook {
    max-width: 850px;

    margin-top: 22px;
    padding-left: 20px;

    border-left: 4px solid var(--accent);

    color: var(--muted);

    font-size: 1.12rem;
    line-height: 1.55;
}


/* =========================================================
   SYNTHÈSE
   ========================================================= */

.final-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
}

.final-grid > div {
    padding: 32px;

    border: 1px solid rgba(255, 255, 255, .17);
    border-radius: var(--radius);
}

.final-grid span {
    color: var(--accent);

    font-size: .75rem;
    font-weight: 850;
}

.final-grid h3 {
    margin: 16px 0 32px;

    font-size: clamp(1.7rem, 3vw, 3rem);
    letter-spacing: -.04em;
}

.final-grid p {
    color: rgba(255, 255, 255, .52);
}

.final-grid strong {
    font-size: 1.3rem;
}

.next {
    margin-top: 42px;
    padding-top: 22px;

    display: flex;
    justify-content: space-between;
    gap: 20px;

    border-top: 1px solid rgba(255, 255, 255, .15);
}

.next span {
    color: rgba(255, 255, 255, .45);
}


/* =========================================================
   AIDE PRÉSENTATION
   ========================================================= */

.presentation-hint {
    position: fixed;

    left: 50%;
    bottom: 22px;

    z-index: 200;

    transform: translateX(-50%);

    display: flex;
    align-items: center;
    gap: 7px;

    padding: 8px 11px;

    border-radius: 12px;

    background: rgba(20, 25, 22, .88);
    color: white;

    font-size: .68rem;

    backdrop-filter: blur(12px);

    opacity: 1;

    transition:
        opacity .45s ease,
        transform .45s ease;
}

.presentation-hint.is-hidden {
    opacity: 0;
    transform: translate(-50%, 12px);

    pointer-events: none;
}

.presentation-hint span {
    min-width: 25px;

    padding: 4px 6px;

    text-align: center;

    border: 1px solid rgba(255, 255, 255, .28);
    border-radius: 5px;
}

.presentation-hint small {
    margin-right: 8px;
    opacity: .6;
}


/* =========================================================
   MODE LECTURE
   ========================================================= */

.reading-mode .screen {
    min-height: auto;

    padding-top: 120px;
    padding-bottom: 120px;
}


/* =========================================================
   MOBILE
   ========================================================= */

@media (max-width: 900px) {

    html {
        scroll-snap-type: none;
    }

    .topbar {
        height: 60px;
        padding: 0 18px;

        grid-template-columns: 1fr auto;
    }

    .course-id {
        display: none;
    }

    .screen,
    .screen--dense {
        min-height: auto;

        padding:
            100px
            22px
            72px;
    }

    .screen--hero {
        min-height: 100svh;
    }

    h1 {
        font-size: clamp(3.5rem, 15vw, 6rem);
    }

    h2,
    .screen--dense h2 {
        font-size: clamp(2.35rem, 10vw, 4rem);
    }

    .hero-meta {
        display: none;
    }

    .choices,
    .magnitude-grid,
    .final-grid {
        grid-template-columns: 1fr;
    }

    .unit-row {
        grid-template-columns: 1fr;
    }

    .split-concept {
        grid-template-columns: 1fr;
    }

    .not-equal {
        justify-self: center;
    }

    .presentation-hint {
        display: none;
    }

    .magnitude-grid article {
        min-height: 0;
    }
}
