/* ======================================== */
/* STUDYNEST REAL NUMBERS LESSONS                  */
/* ======================================== */

:root {
    --navy: #0f438c;
    --navy-dark: #0a326b;
    --blue: #2c73c9;
    --blue-light: #dceafa;
    --page: #eef4fb;
    --card: #ffffff;
    --border: #d9e2ed;
    --text: #1e2c43;
    --muted: #4f5d70;
    --yellow: #fff2bf;
    --yellow-border: #f5ad00;
    --green: #e4f5e8;
    --green-dark: #2f7444;
    --pink: #f8e8ef;
    --pink-dark: #8b4664;
    --purple: #eee8f8;
    --purple-dark: #654d91;
    --shadow: 0 12px 30px rgba(19, 57, 104, 0.07);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
    margin: 0;
    color: var(--text);
    background: var(--page);
    font-family: Arial, Helvetica, sans-serif;
    line-height: 1.65;
}

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

.announcement-bar {
    padding: 8px 18px;
    color: #111;
    background: #f7b500;
    font-size: .82rem;
    font-weight: 700;
    text-align: center;
}

.site-header {
    display: flex;
    min-height: 76px;
    padding: 0 38px;
    align-items: center;
    justify-content: space-between;
    gap: 30px;
    border-bottom: 1px solid var(--border);
    background: white;
}

.logo {
    color: var(--navy);
    font-size: 1.45rem;
    font-weight: 800;
}

.main-navigation {
    display: flex;
    flex-wrap: wrap;
    gap: 24px;
}

.main-navigation a {
    font-size: .88rem;
    font-weight: 700;
}

.lesson-hero {
    display: grid;
    min-height: 400px;
    padding: 60px clamp(22px, 7vw, 95px);
    align-items: center;
    grid-template-columns: minmax(0, 1.1fr) minmax(310px, .9fr);
    gap: 45px;
    background:
        radial-gradient(circle at 85% 15%, rgba(255,255,255,.95), transparent 26%),
        linear-gradient(135deg, #f8fbff, #eaf2fb);
}

.lesson-label,
.eyebrow {
    margin: 0 0 10px;
    color: var(--navy);
    font-size: .78rem;
    font-weight: 900;
    letter-spacing: .12em;
    text-transform: uppercase;
}

.lesson-hero h1 {
    margin: 0;
    color: var(--navy);
    font-size: clamp(2.9rem, 6vw, 4.8rem);
    line-height: 1.04;
    letter-spacing: -.04em;
}

.lesson-subtitle {
    max-width: 680px;
    margin: 20px 0 0;
    color: var(--muted);
    font-size: 1.08rem;
}

.lesson-meta {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    margin-top: 24px;
}

.meta-pill {
    padding: 8px 13px;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--navy);
    background: white;
    font-size: .78rem;
    font-weight: 800;
}

.hero-visual {
    display: grid;
    min-height: 270px;
    place-items: center;
}

.mini-coordinate-plane {
    position: relative;
    width: 290px;
    height: 245px;
    border: 1px solid var(--border);
    border-radius: 25px;
    background:
        linear-gradient(#dfe8f2 1px, transparent 1px),
        linear-gradient(90deg, #dfe8f2 1px, transparent 1px),
        white;
    background-size: 32px 32px;
    box-shadow: var(--shadow);
}

.mini-coordinate-plane::before,
.mini-coordinate-plane::after {
    content: "";
    position: absolute;
    background: var(--navy);
}

.mini-coordinate-plane::before {
    top: 20px;
    bottom: 20px;
    left: 50%;
    width: 3px;
}

.mini-coordinate-plane::after {
    right: 20px;
    bottom: 50%;
    left: 20px;
    height: 3px;
}

.plot-dot {
    position: absolute;
    z-index: 2;
    width: 15px;
    height: 15px;
    border: 3px solid white;
    border-radius: 50%;
    background: var(--blue);
    box-shadow: 0 3px 9px rgba(15,67,140,.25);
}

.dot-a { left: 205px; top: 55px; }
.dot-b { left: 75px; top: 155px; }
.dot-c { left: 180px; top: 180px; }

.graph-line-demo {
    position: absolute;
    z-index: 1;
    left: 55px;
    bottom: 65px;
    width: 205px;
    height: 5px;
    border-radius: 999px;
    background: var(--blue);
    transform: rotate(-36deg);
    transform-origin: left center;
}

.lesson-main {
    width: min(1180px, calc(100% - 28px));
    margin: 36px auto 70px;
}

.lesson-section {
    margin-bottom: 28px;
    padding: 38px 52px;
    border: 1px solid var(--border);
    border-radius: 27px;
    background: white;
    box-shadow: var(--shadow);
}

.lesson-section h2 {
    margin: 0 0 18px;
    color: var(--navy);
    font-size: clamp(1.65rem, 3vw, 2.25rem);
}

.lesson-section h3 {
    margin: 25px 0 10px;
    color: var(--navy);
}

.lesson-section p { color: var(--muted); }

.objective-list,
.summary-list,
.practice-list {
    margin: 14px 0 0;
    padding-left: 24px;
}

.objective-list li,
.summary-list li,
.practice-list li {
    margin: 8px 0;
}

.think-box,
.key-idea,
.tip-box,
.warning-box,
.did-you-know,
.challenge-box {
    margin: 22px 0;
    padding: 20px 23px;
    border-radius: 0 17px 17px 0;
}

.think-box {
    border-left: 5px solid var(--yellow-border);
    background: var(--yellow);
}

.key-idea {
    border-left: 5px solid var(--blue);
    background: #eaf3ff;
}

.tip-box {
    border-left: 5px solid #54a46a;
    background: var(--green);
}

.warning-box {
    border-left: 5px solid #d5648f;
    background: var(--pink);
}

.did-you-know {
    border-left: 5px solid #8367b2;
    background: var(--purple);
}

.challenge-box {
    border-left: 5px solid #815a20;
    background: #f9eddc;
}

.math-display {
    margin: 20px 0;
    padding: 17px;
    border: 1px solid var(--border);
    border-radius: 15px;
    color: var(--navy);
    background: #f8fbff;
    font-size: 1.18rem;
    font-weight: 800;
    text-align: center;
}

.visual-grid-two {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 20px;
    margin-top: 22px;
}

.visual-card {
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 21px;
    background: #f9fbfd;
}

.visual-card h3 { margin-top: 0; }

.coordinate-diagram,
.travel-diagram,
.line-diagram {
    position: relative;
    width: min(100%, 480px);
    height: 310px;
    margin: 24px auto;
    border: 1px solid var(--border);
    border-radius: 22px;
    background:
        linear-gradient(#dde7f1 1px, transparent 1px),
        linear-gradient(90deg, #dde7f1 1px, transparent 1px),
        white;
    background-size: 35px 35px;
    overflow: hidden;
}

.axis-x,
.axis-y {
    position: absolute;
    z-index: 2;
    background: var(--navy);
}

.axis-x {
    left: 25px;
    right: 25px;
    top: 50%;
    height: 3px;
}

.axis-y {
    top: 25px;
    bottom: 25px;
    left: 50%;
    width: 3px;
}

.axis-label {
    position: absolute;
    z-index: 3;
    color: var(--navy);
    font-weight: 900;
}

.x-label { right: 12px; top: calc(50% - 24px); }
.y-label { left: calc(50% + 10px); top: 8px; }

.quadrant {
    position: absolute;
    color: #7c8b9d;
    font-size: .75rem;
    font-weight: 800;
}

.q1 { right: 52px; top: 42px; }
.q2 { left: 52px; top: 42px; }
.q3 { left: 52px; bottom: 42px; }
.q4 { right: 52px; bottom: 42px; }

.example-table {
    width: 100%;
    margin: 22px 0;
    border-collapse: collapse;
    overflow: hidden;
    border-radius: 14px;
}

.example-table th,
.example-table td {
    padding: 13px;
    border: 1px solid var(--border);
    text-align: center;
}

.example-table th {
    color: white;
    background: var(--navy);
}

.example-table tr:nth-child(even) td {
    background: #f5f8fc;
}

.worked-example {
    margin: 22px 0;
    padding: 24px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: #fbfcfe;
}

.worked-example h3 { margin-top: 0; }

.step {
    display: grid;
    grid-template-columns: 42px minmax(0,1fr);
    gap: 14px;
    margin-top: 16px;
    align-items: start;
}

.step-number {
    display: grid;
    width: 38px;
    height: 38px;
    place-items: center;
    border-radius: 50%;
    color: white;
    background: var(--navy);
    font-weight: 900;
}

.quick-check {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 15px;
    margin-top: 20px;
}

.quick-card {
    padding: 20px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #f9fbfd;
}

.level-heading {
    display: inline-flex;
    margin: 22px 0 8px;
    padding: 7px 12px;
    border-radius: 999px;
    color: var(--navy);
    background: var(--blue-light);
    font-size: .75rem;
    font-weight: 900;
}

.lesson-navigation {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 15px;
    margin-top: 34px;
}

.nav-button {
    display: flex;
    min-height: 52px;
    padding: 12px 18px;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border);
    border-radius: 999px;
    color: var(--navy);
    background: white;
    font-weight: 800;
    text-align: center;
}

.nav-button.primary {
    color: white;
    background: var(--navy);
}

.site-footer {
    padding: 34px 20px 24px;
    color: white;
    background: var(--navy);
    text-align: center;
}

.site-footer p { margin: 8px 0; font-size: .82rem; }

@media (max-width: 900px) {
    .lesson-hero { grid-template-columns: 1fr; }
    .visual-grid-two { grid-template-columns: 1fr; }
    .quick-check { grid-template-columns: 1fr; }
}

@media (max-width: 700px) {
    .site-header {
        padding: 18px 20px;
        align-items: flex-start;
        flex-direction: column;
    }

    .lesson-hero {
        padding: 45px 23px;
        text-align: center;
    }

    .lesson-meta { justify-content: center; }
    .lesson-section { padding: 28px 23px; }
    .lesson-navigation { grid-template-columns: 1fr; }
}

/* ======================================== */
/* GRAPH REFRESH: ANSWERS & POLISH          */
/* ======================================== */

.answers-section details {
    margin-top: 18px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #f8fbff;
}

.answers-section summary {
    padding: 18px 22px;
    color: var(--navy);
    font-weight: 850;
    cursor: pointer;
    list-style-position: inside;
    transition: background .2s ease;
}

.answers-section summary:hover {
    background: #edf5ff;
}

.answers-content {
    padding: 8px 25px 25px;
    border-top: 1px solid var(--border);
}

.answers-content h3 {
    margin: 22px 0 8px;
}

.answers-content ol {
    padding-left: 25px;
}

.answers-content li {
    margin: 10px 0;
    color: var(--muted);
}

.mini-coordinate-plane {
    animation: graphPlaneFloat 6s ease-in-out infinite;
}

.plot-dot {
    animation: graphPointPulse 3.4s ease-in-out infinite;
}

.dot-b { animation-delay: .45s; }
.dot-c { animation-delay: .9s; }

.graph-line-demo {
    animation: graphLineGlow 4s ease-in-out infinite;
}

@keyframes graphPlaneFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
}

@keyframes graphPointPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.18); }
}

@keyframes graphLineGlow {
    0%, 100% { opacity: .82; }
    50% { opacity: 1; box-shadow: 0 0 16px rgba(44,115,201,.34); }
}

@media (prefers-reduced-motion: reduce) {
    .mini-coordinate-plane,
    .plot-dot,
    .graph-line-demo {
        animation: none;
    }
}

/* ======================================== */
/* ALGEBRA TOPIC THEME                      */
/* Exact shared template + soft blue accent */
/* ======================================== */

:root {
    --blue: #4f78a8;
    --blue-light: #e8f0f8;
    --page: #edf4fb;
    --border: #d4e0ec;
    --shadow: 0 12px 30px rgba(39, 73, 112, 0.08);
}

.algebra-hero-visual {
    position: relative;
    width: 310px;
    height: 245px;
    border: 1px solid var(--border);
    border-radius: 25px;
    background:
        radial-gradient(circle at 18% 15%, rgba(255,255,255,.98), transparent 31%),
        linear-gradient(145deg, #f8fbff, #e8f0f8);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.algebra-balance {
    position: absolute;
    inset: 25px 18px 12px;
    animation: algebraBalanceFloat 5.5s ease-in-out infinite;
}

.balance-beam {
    position: absolute;
    top: 69px;
    left: 27px;
    width: 220px;
    height: 6px;
    border-radius: 999px;
    background: var(--navy);
    transform: rotate(-2deg);
}

.balance-stand {
    position: absolute;
    top: 71px;
    left: 132px;
    width: 7px;
    height: 112px;
    border-radius: 999px;
    background: var(--navy);
}

.balance-base {
    position: absolute;
    left: 88px;
    bottom: 17px;
    width: 96px;
    height: 10px;
    border-radius: 999px;
    background: var(--navy);
}

.balance-pan {
    position: absolute;
    top: 95px;
    display: grid;
    min-width: 84px;
    min-height: 55px;
    padding: 8px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 16px;
    color: var(--navy);
    background: white;
    box-shadow: var(--shadow);
    font-weight: 900;
}

.balance-pan::before {
    content: "";
    position: absolute;
    bottom: 100%;
    left: 50%;
    width: 2px;
    height: 27px;
    background: var(--navy);
}

.pan-left { left: 1px; }
.pan-right { right: 1px; }

.algebra-symbol {
    position: absolute;
    z-index: 3;
    display: grid;
    min-width: 50px;
    height: 49px;
    padding: 7px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 15px;
    color: var(--navy);
    background: white;
    box-shadow: var(--shadow);
    font-size: 1.05rem;
    font-weight: 900;
    animation: algebraSymbolFloat 4.8s ease-in-out infinite;
}

.symbol-x { top: 22px; left: 28px; }
.symbol-brackets { top: 22px; right: 28px; animation-delay: .6s; }
.symbol-equals { right: 34px; bottom: 18px; animation-delay: 1.1s; }

/* Original Algebra content classes inside the approved lesson cards. */

.story-card {
    background: linear-gradient(135deg, #fffdf7, white);
}

.practice-card {
    background: linear-gradient(135deg, #f8fbff, white);
}

.success-card {
    background: linear-gradient(135deg, #f6fcf7, white);
}

.worked-example,
.example-box,
.math-box,
.note-box,
.info-box,
.tip-box,
.warning-box,
.success-box,
.study-question {
    margin: 20px 0;
    padding: 20px 23px;
    border-radius: 0 17px 17px 0;
}

.worked-example,
.example-box,
.study-question {
    border-left: 5px solid var(--yellow-border);
    background: var(--yellow);
}

.math-box {
    overflow-x: auto;
    border-left: 5px solid var(--blue);
    color: var(--navy);
    background: var(--blue-light);
    font-weight: 800;
    text-align: center;
}

.note-box,
.info-box,
.success-box {
    border-left: 5px solid var(--green-dark);
    background: var(--green);
}

.tip-box {
    border-left: 5px solid var(--yellow-border);
    background: var(--yellow);
}

.warning-box {
    border-left: 5px solid var(--pink-dark);
    background: var(--pink);
}

.definition-grid,
.foil-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 16px;
    margin: 22px 0;
}

.definition-card,
.foil-step {
    padding: 19px;
    border: 1px solid var(--border);
    border-radius: 17px;
    background: #f8fbff;
}

.check-list {
    padding-left: 0 !important;
    list-style: none;
}

.check-list li::before {
    content: "✓";
    margin-right: 9px;
    color: var(--green-dark);
    font-weight: 900;
}

.study-table,
table {
    width: 100%;
    margin: 22px 0;
    border-collapse: collapse;
}

.study-table th,
.study-table td,
table th,
table td {
    padding: 13px;
    border: 1px solid var(--border);
    text-align: left;
}

.study-table th,
table th {
    color: var(--navy);
    background: var(--blue-light);
}

.foil-letter {
    display: inline-grid;
    width: 32px;
    height: 32px;
    margin-right: 8px;
    place-items: center;
    border-radius: 9px;
    color: white;
    background: var(--blue);
    font-weight: 900;
}

.progress-wrap {
    margin-top: 18px;
}

.progress-label,
.progress-labels {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    color: var(--navy);
    font-weight: 800;
}

.progress-bar {
    height: 12px;
    margin-top: 13px;
    overflow: hidden;
    border-radius: 999px;
    background: var(--blue-light);
}

.progress-fill {
    height: 100%;
    border-radius: inherit;
    background: var(--blue);
}

.lesson-section details {
    margin-top: 18px;
    overflow: hidden;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: #f8fbff;
}

.lesson-section summary {
    padding: 18px 22px;
    color: var(--navy);
    font-weight: 800;
    cursor: pointer;
}

.lesson-section details > *:not(summary) {
    margin-right: 22px;
    margin-left: 22px;
}

.lesson-section details > *:last-child {
    margin-bottom: 22px;
}

@keyframes algebraBalanceFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-7px); }
}

@keyframes algebraSymbolFloat {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-7px) rotate(3deg); }
}

@media (prefers-reduced-motion: reduce) {
    .algebra-balance,
    .algebra-symbol {
        animation: none;
    }
}

@media (max-width: 760px) {
    .definition-grid,
    .foil-grid {
        grid-template-columns: 1fr;
    }
}

/* Algebra concept animations: layered on the original StudyNest template */
.lesson-main{max-width:980px}.lesson-section ul{padding-left:1.35rem}.study-visual{border:1px solid var(--border);border-radius:22px;padding:1.25rem;background:linear-gradient(180deg,#fbfeff,#f4f9fc);margin:1.3rem 0}.study-visual h2{margin-top:0}.visual-stage{min-height:220px;display:grid;place-items:center;position:relative;overflow:hidden}.token-row{display:flex;gap:.7rem;flex-wrap:wrap;justify-content:center}.alg-token{padding:.65rem .9rem;border-radius:14px;background:white;border:2px solid var(--blue);font:800 1.25rem Cambria Math,serif;transition:.45s}.alg-token.active{transform:translateY(-10px);background:#fff5cd;border-color:var(--yellow)}.equation-balance{display:grid;grid-template-columns:1fr auto 1fr;align-items:center;gap:1rem;width:min(100%,560px)}.eq-side{padding:1rem;border-radius:16px;background:white;border:2px solid var(--blue);font:800 1.35rem Cambria Math,serif;text-align:center}.eq-sign{font-size:2rem;font-weight:900}.visual-controls{display:flex;justify-content:center;gap:.7rem;flex-wrap:wrap;margin-top:1rem}.visual-controls button{border:0;background:var(--navy);color:white;padding:.65rem 1rem;border-radius:999px;font-weight:800;cursor:pointer}.visual-controls button.secondary{background:white;color:var(--navy);border:1px solid var(--border)}.visual-caption{text-align:center;color:var(--muted);font-size:.92rem;min-height:1.7em}.number-line{position:relative;width:min(92%,600px);height:100px}.number-line .axis{position:absolute;left:5%;right:5%;top:48px;height:4px;background:var(--navy)}.number-line .mark{position:absolute;top:39px;width:4px;height:22px;background:var(--navy)}.number-line .point{position:absolute;top:32px;width:34px;height:34px;border-radius:50%;background:white;border:5px solid var(--rose);transition:.5s}.number-line .ray{position:absolute;top:44px;height:12px;background:var(--blue);border-radius:8px;transition:.5s}.parabola-svg,.lines-svg{width:min(100%,620px);height:auto}.draw-path{stroke-dasharray:700;stroke-dashoffset:700;animation:draw 3.2s ease forwards infinite alternate}.pulse{animation:pulse 1.5s ease-in-out infinite}.factor-group{display:flex;align-items:center;gap:.5rem;flex-wrap:wrap;justify-content:center}.factor-brace{font-size:3rem;color:var(--blue)}@keyframes draw{to{stroke-dashoffset:0}}@keyframes pulse{50%{transform:scale(1.1);opacity:.72}}
