/* ======================================== */
/* STUDYNEST SETS LESSONS                  */
/* ======================================== */

:root {
    --navy: #0f438c;
    --navy-dark: #0a326b;
    --blue: #7867a8;
    --blue-light: #eee9f8;
    --page: #f4f1fa;
    --card: #ffffff;
    --border: #ded8eb;
    --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(78, 58, 126, 0.08);
}

* { 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; }
}
/* ======================================== */
/* VARIATION-SPECIFIC COMPONENTS            */
/* ======================================== */

.relationship-flow {
    display: grid;
    grid-template-columns: minmax(120px, 1fr) auto minmax(120px, 1fr);
    align-items: center;
    gap: 18px;
    margin: 24px 0;
}

.relationship-box {
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 19px;
    color: var(--navy);
    background: #f8fbff;
    font-size: 1.05rem;
    font-weight: 800;
    text-align: center;
}

.relationship-arrow {
    color: var(--blue);
    font-size: 2rem;
    font-weight: 900;
}

.ratio-strip {
    display: grid;
    grid-template-columns: repeat(4, minmax(80px, 1fr));
    gap: 12px;
    margin: 22px 0;
}

.ratio-strip div {
    padding: 17px 12px;
    border: 1px solid var(--border);
    border-radius: 16px;
    background: #f9fbfd;
    text-align: center;
}

.ratio-strip strong {
    display: block;
    color: var(--navy);
    font-size: 1.1rem;
}

.recognition-box {
    margin: 22px 0;
    padding: 21px 24px;
    border-left: 5px solid #7b68b0;
    border-radius: 0 17px 17px 0;
    background: #eee8f8;
}

.recognition-box h3 {
    margin-top: 0;
    color: #5c4788;
}

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

.answers-section summary {
    padding: 18px 22px;
    color: var(--navy);
    font-weight: 800;
    cursor: pointer;
    list-style-position: inside;
}

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

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

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

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

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

.answer-working {
    margin-top: 7px;
    padding: 10px 13px;
    border-radius: 12px;
    color: var(--text);
    background: white;
}

@media (max-width: 700px) {
    .relationship-flow {
        grid-template-columns: 1fr;
    }

    .relationship-arrow {
        transform: rotate(90deg);
        text-align: center;
    }

    .ratio-strip {
        grid-template-columns: repeat(2, minmax(80px, 1fr));
    }
}
/* ======================================== */
/* SETS-SPECIFIC COMPONENTS                 */
/* ======================================== */

.set-braces-display {
    display: flex;
    margin: 24px 0;
    align-items: center;
    justify-content: center;
    gap: 16px;
    color: var(--navy);
}

.set-brace {
    font-family: Georgia, serif;
    font-size: 5rem;
    line-height: 1;
}

.set-elements {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 10px;
}

.set-element {
    display: grid;
    min-width: 52px;
    min-height: 52px;
    padding: 8px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 14px;
    background: #f8fbff;
    font-weight: 900;
}

.concept-map {
    display: grid;
    gap: 16px;
    margin: 24px auto;
    max-width: 760px;
    text-align: center;
}

.concept-root,
.concept-branch,
.concept-leaf {
    padding: 18px;
    border: 1px solid var(--border);
    border-radius: 18px;
    background: white;
    box-shadow: var(--shadow);
}

.concept-root {
    color: white;
    background: var(--navy);
    font-size: 1.15rem;
    font-weight: 900;
}

.concept-branches {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 16px;
}

.concept-leaves {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 12px;
}

.symbol-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0,1fr));
    gap: 14px;
    margin: 22px 0;
}

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

.symbol-card strong {
    display: block;
    margin-bottom: 6px;
    color: var(--navy);
    font-size: 1.5rem;
}

.method-comparison {
    display: grid;
    grid-template-columns: repeat(2, minmax(0,1fr));
    gap: 18px;
    margin: 24px 0;
}

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

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

.where-used {
    margin: 22px 0;
    padding: 22px;
    border: 1px solid var(--border);
    border-radius: 20px;
    background: linear-gradient(135deg, #f7fffc, #eef8f6);
}

.where-used h3 {
    margin-top: 0;
}

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

.answers-section summary {
    padding: 18px 22px;
    color: var(--navy);
    font-weight: 800;
    cursor: pointer;
    list-style-position: inside;
}

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

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

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

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

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

.answer-working {
    margin-top: 7px;
    padding: 10px 13px;
    border-radius: 12px;
    color: var(--text);
    background: white;
}

@media (max-width: 760px) {
    .concept-branches,
    .concept-leaves,
    .symbol-grid,
    .method-comparison {
        grid-template-columns: 1fr;
    }
}

/* ======================================== */
/* SETS-SPECIFIC HERO                       */
/* Soft lilac topic theme + Venn diagram.   */
/* ======================================== */

.sets-hero-art {
    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,.96), transparent 32%),
        linear-gradient(145deg, #f9f7fd, #eee9f8);
    box-shadow: var(--shadow);
    overflow: hidden;
}

.sets-universal {
    position: absolute;
    top: 48px;
    left: 45px;
    width: 220px;
    height: 145px;
    border: 3px solid var(--navy);
    border-radius: 20px;
    background: rgba(255,255,255,.52);
    animation: setsContainerFloat 5.8s ease-in-out infinite;
}

.set-circle {
    position: absolute;
    top: 24px;
    display: grid;
    width: 96px;
    height: 96px;
    place-items: center;
    border: 3px solid var(--blue);
    border-radius: 50%;
    color: var(--navy);
    background: rgba(238,233,248,.68);
    font-weight: 900;
}

.set-a {
    left: 35px;
}

.set-b {
    right: 35px;
}

.set-overlap {
    position: absolute;
    z-index: 4;
    top: 63px;
    left: 50%;
    padding: 4px 7px;
    border-radius: 8px;
    color: var(--navy);
    background: rgba(255,255,255,.88);
    font-size: .72rem;
    font-weight: 900;
    transform: translateX(-50%);
}

.set-chip {
    position: absolute;
    z-index: 5;
    display: grid;
    min-width: 62px;
    height: 43px;
    padding: 8px;
    place-items: center;
    border: 1px solid var(--border);
    border-radius: 14px;
    color: var(--navy);
    background: white;
    box-shadow: var(--shadow);
    font-weight: 900;
    animation: setsChipFloat 4.6s ease-in-out infinite;
}

.chip-union {
    top: 18px;
    left: 24px;
}

.chip-complement {
    right: 25px;
    bottom: 16px;
    animation-delay: .8s;
}

.set-dot {
    position: absolute;
    z-index: 2;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--yellow-border);
    animation: setsDotPulse 3.4s ease-in-out infinite;
}

.dot-one {
    top: 29px;
    right: 45px;
}

.dot-two {
    bottom: 31px;
    left: 41px;
    animation-delay: .5s;
}

.dot-three {
    right: 67px;
    bottom: 65px;
    animation-delay: 1s;
}

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

@keyframes setsChipFloat {
    0%, 100% { transform: translateY(0) rotate(0); }
    50% { transform: translateY(-6px) rotate(2deg); }
}

@keyframes setsDotPulse {
    0%, 100% { opacity: .55; transform: scale(1); }
    50% { opacity: 1; transform: scale(1.3); }
}

@media (prefers-reduced-motion: reduce) {
    .sets-universal,
    .set-chip,
    .set-dot {
        animation: none;
    }
}
