:root {
  --ink: #142d35;
  --ink-soft: #52646a;
  --paper: #f7f8f4;
  --paper-deep: #edf1ec;
  --card: #ffffff;
  --mint: #b8f3d5;
  --mint-deep: #68d8aa;
  --orange: #ffb764;
  --lavender: #e4e2ff;
  --line: #dce4df;
  --shadow: 0 18px 45px rgba(29, 55, 57, 0.08);
  --shadow-heavy: 0 28px 80px rgba(17, 39, 43, 0.18);
  --radius: 22px;
  --sans: "Plus Jakarta Sans", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "DM Serif Display", Georgia, serif;
  --mono: "DM Mono", monospace;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--sans); font-size: 14px; line-height: 1.6; overflow-x: hidden; transition: background .3s ease, color .3s ease; }
button, input { font: inherit; }
button, a { -webkit-tap-highlight-color: transparent; }
a { color: inherit; text-decoration: none; }
button { cursor: pointer; }
.page-wrap { width: min(1160px, calc(100% - 72px)); margin-inline: auto; }
.ambient { position: fixed; z-index: -1; border-radius: 999px; filter: blur(2px); pointer-events: none; opacity: .45; }
.ambient-one { width: 420px; height: 420px; top: 520px; right: -210px; background: var(--lavender); }
.ambient-two { width: 260px; height: 260px; top: 1240px; left: -180px; background: #d5f1e2; }

.topbar { height: 78px; display: flex; align-items: center; justify-content: space-between; gap: 24px; padding: 0 max(36px, calc((100vw - 1160px) / 2)); background: rgba(247, 248, 244, .88); border-bottom: 1px solid rgba(220, 228, 223, .8); position: sticky; top: 0; z-index: 20; backdrop-filter: blur(18px); }
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand-mark { width: 34px; height: 34px; border: 1.5px solid var(--ink); background: var(--mint); border-radius: 50%; display: grid; place-items: center; transform: rotate(-8deg); }
.brand-mark svg { width: 23px; height: 23px; fill: none; stroke: var(--ink); stroke-width: 2.5; stroke-linecap: round; stroke-linejoin: round; }
.brand-type { display: flex; flex-direction: column; line-height: 1; gap: 4px; }
.brand-type strong { font-size: 18px; letter-spacing: -.07em; font-weight: 800; }
.brand-type small { font: 8px var(--mono); text-transform: uppercase; letter-spacing: .13em; color: var(--ink-soft); }
.topnav { display: flex; align-items: center; gap: 28px; margin-left: auto; }
.topnav a { color: var(--ink-soft); font-weight: 600; transition: color .2s ease; }
.topnav a:hover { color: var(--ink); }
.topnav a span { font: 10px var(--mono); color: var(--ink); background: var(--mint); padding: 3px 6px; border-radius: 20px; margin-left: 3px; }
.nav-quiz { border: 0; background: var(--ink); color: var(--paper); border-radius: 999px; padding: 10px 15px; font-weight: 700; transition: transform .2s ease, background .2s ease; }
.nav-quiz:hover { transform: translateY(-2px); background: #224b54; }
.spark { color: var(--orange); margin-right: 5px; }
.theme-toggle { display: inline-flex; align-items: center; gap: 7px; border: 1px solid var(--line); background: transparent; color: var(--ink-soft); border-radius: 999px; padding: 9px 12px; font-size: 11px; font-weight: 700; white-space: nowrap; }
.theme-icon { font-size: 16px; line-height: 1; }

.hero { min-height: 565px; display: grid; grid-template-columns: .92fr 1.08fr; align-items: center; gap: 28px; padding-top: 64px; padding-bottom: 62px; }
.eyebrow, .section-kicker { margin: 0 0 18px; color: var(--ink-soft); font: 500 10px var(--mono); letter-spacing: .15em; text-transform: uppercase; }
.eyebrow { display: flex; align-items: center; gap: 10px; }
.eyebrow-line { display: inline-block; width: 30px; height: 1px; background: var(--orange); }
.hero h1 { max-width: 580px; margin: 0; font-size: clamp(52px, 6vw, 86px); letter-spacing: -.085em; line-height: .95; font-weight: 800; }
em { font-family: var(--serif); font-weight: 400; letter-spacing: -.045em; }
.hero-sub { max-width: 450px; margin: 30px 0 27px; color: var(--ink-soft); font-size: 16px; }
.hero-sub strong { color: var(--ink); font-weight: 700; }
.hero-actions { display: flex; align-items: center; gap: 22px; }
.button { display: inline-flex; align-items: center; gap: 22px; border: 0; border-radius: 999px; padding: 13px 16px 13px 20px; font-weight: 800; transition: transform .2s ease, box-shadow .2s ease; }
.button span { display: grid; place-items: center; width: 26px; height: 26px; border-radius: 50%; font-size: 17px; }
.button:hover { transform: translateY(-2px); box-shadow: 0 10px 20px rgba(20, 45, 53, .12); }
.button-primary { color: var(--ink); background: var(--mint); }
.button-primary span { background: var(--ink); color: var(--mint); }
.text-button { border: 0; padding: 12px 0; background: transparent; color: var(--ink); font-weight: 700; }
.text-button span { display: inline-block; margin-left: 5px; transition: transform .2s ease; }
.text-button:hover span { transform: translateX(5px); }
.hero-note { display: flex; align-items: center; gap: 8px; margin-top: 54px; color: var(--ink-soft); font-size: 11px; }
.check-dot { display: grid; place-items: center; width: 20px; height: 20px; border-radius: 50%; background: var(--mint); color: var(--ink); font-size: 11px; font-weight: 800; }
.hero-art { min-height: 420px; position: relative; isolation: isolate; }
.hero-art::before { content: ""; position: absolute; width: 330px; height: 330px; top: 30px; right: 78px; border-radius: 50%; background: #ebf0e7; z-index: -2; }
.orbit { position: absolute; border: 1px solid rgba(20, 45, 53, .13); border-radius: 50%; transform: rotate(-22deg); }
.orbit-one { width: 400px; height: 154px; top: 111px; right: 35px; }
.orbit-two { width: 410px; height: 225px; top: 76px; right: 30px; transform: rotate(53deg); }
.lab-card { position: absolute; z-index: 2; background: var(--card); border: 1px solid rgba(220, 228, 223, .9); box-shadow: var(--shadow-heavy); }
.lab-main { width: 238px; height: 310px; top: 50px; right: 164px; padding: 20px; border-radius: 24px; transform: rotate(4deg); }
.lab-card-top, .lab-card-bottom { display: flex; justify-content: space-between; align-items: center; }
.mini-label { font: 9px var(--mono); letter-spacing: .12em; color: var(--ink-soft); }
.lab-dot { width: 8px; height: 8px; background: var(--orange); border-radius: 50%; }
.flask-large { height: 222px; display: grid; place-items: center; }
.flask-large svg { width: 138px; height: 175px; fill: none; stroke: var(--ink); stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.flask-large svg path:first-child { stroke: var(--ink); }
.flask-large svg path:nth-child(2) { fill: var(--mint); }
.lab-card-bottom { padding-top: 13px; border-top: 1px solid var(--line); justify-content: flex-start; gap: 10px; }
.lab-card-bottom strong { font-size: 40px; line-height: 1; letter-spacing: -.08em; }
.lab-card-bottom span { font-size: 10px; line-height: 1.3; color: var(--ink-soft); }
.float-card { position: absolute; z-index: 3; display: flex; align-items: center; gap: 10px; padding: 12px 14px 12px 11px; border: 1px solid var(--line); background: rgba(255,255,255,.93); box-shadow: var(--shadow); border-radius: 15px; min-width: 178px; }
.float-progress { right: 2px; top: 35px; transform: rotate(-4deg); }
.float-score { left: 12px; bottom: 38px; transform: rotate(3deg); }
.float-icon { width: 26px; height: 26px; border-radius: 9px; background: var(--lavender); display: grid; place-items: center; font-weight: 800; }
.float-card div { display: flex; flex-direction: column; line-height: 1.25; flex: 1; }
.float-card strong { font-size: 11px; }
.float-card small { color: var(--ink-soft); font-size: 9px; }
.float-card b { font: 700 16px var(--mono); }
.molecule { position: absolute; z-index: 1; display: flex; align-items: center; gap: 6px; }
.molecule span, .molecule i, .molecule b { display: block; width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--ink); background: var(--mint); }
.molecule i { width: 8px; height: 8px; background: var(--orange); }
.molecule b { width: 20px; height: 20px; background: var(--lavender); }
.molecule-a { top: 4px; left: 130px; transform: rotate(20deg); }
.molecule-b { right: 22px; bottom: 36px; transform: rotate(-30deg); }

.stats-strip { display: grid; grid-template-columns: 1.25fr .9fr 1.12fr .9fr; align-items: center; gap: 24px; padding: 27px 30px; margin-bottom: 132px; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.stat-intro .section-kicker { margin-bottom: 5px; }
.stat-intro p { margin: 0; font-size: 13px; color: var(--ink-soft); }
.stat { min-height: 54px; display: flex; align-items: center; gap: 12px; border-left: 1px solid var(--line); padding-left: 24px; position: relative; }
.stat-number { font-size: 32px; line-height: 1; letter-spacing: -.08em; font-weight: 800; }
.stat-label { color: var(--ink-soft); font-size: 10px; line-height: 1.35; }
.stat-label small { font-size: 9px; }
.stat-label b { color: var(--ink); }
.stat-progress { display: grid; grid-template-columns: auto 1fr; column-gap: 12px; }
.progress-line { height: 4px; grid-column: 1 / -1; margin-top: 10px; background: var(--paper-deep); border-radius: 99px; overflow: hidden; }
.progress-line i { display: block; height: 100%; width: 0%; background: var(--mint-deep); border-radius: inherit; transition: width .4s ease; }

.chapter-section { padding-bottom: 140px; }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 40px; margin-bottom: 40px; }
.section-heading h2, .loop-copy h2 { margin: 0; font-size: clamp(39px, 4.8vw, 62px); letter-spacing: -.08em; line-height: .97; }
.section-blurb { width: 280px; margin: 0 3% 5px 0; color: var(--ink-soft); font-size: 12px; line-height: 1.65; }
.library-tools { display: flex; justify-content: space-between; align-items: center; gap: 20px; margin-bottom: 28px; }
.search-wrap { display: flex; align-items: center; gap: 10px; width: min(360px, 100%); padding: 12px 15px; border: 1px solid var(--line); border-radius: 12px; background: rgba(255,255,255,.65); transition: border .2s ease, box-shadow .2s ease; }
.search-wrap:focus-within { border-color: var(--mint-deep); box-shadow: 0 0 0 3px rgba(104, 216, 170, .18); }
.search-wrap span { font-size: 23px; transform: rotate(-20deg); line-height: 1; color: var(--ink-soft); }
.search-wrap input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); font-size: 11px; }
.search-wrap input::placeholder { color: #8a9898; }
.filter-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; justify-content: flex-end; }
.chip { border: 1px solid transparent; background: transparent; padding: 8px 10px; border-radius: 999px; color: var(--ink-soft); font-size: 10px; font-weight: 700; }
.chip span { margin-left: 4px; color: #94a3a1; font: 10px var(--mono); }
.chip.active { color: var(--ink); background: var(--mint); }
.chip.active span { color: var(--ink); }
.chapter-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 15px; }
.card { min-height: 262px; display: flex; flex-direction: column; padding: 22px; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); transition: transform .25s ease, box-shadow .25s ease, border-color .25s ease; animation: card-in .5s both; }
.card:nth-child(3n + 2) { animation-delay: .04s; }
.card:nth-child(3n + 3) { animation-delay: .08s; }
.card:hover { transform: translateY(-5px); border-color: #c2d7ce; box-shadow: var(--shadow); }
.card-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.tag { display: inline-flex; align-items: center; width: fit-content; padding: 5px 8px; background: var(--paper-deep); border-radius: 6px; color: var(--ink-soft); font: 9px var(--mono); letter-spacing: .07em; }
.card-number { color: #a1b2ad; font: 11px var(--mono); }
.card h3 { max-width: 280px; margin: 20px 0 10px; font-size: 20px; letter-spacing: -.06em; line-height: 1.1; }
.card p { min-height: 46px; margin: 0; color: var(--ink-soft); font-size: 11px; line-height: 1.55; }
.topic-row { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 14px; }
.topic-pill { padding: 4px 7px; border-radius: 5px; background: rgba(228, 226, 255, .55); color: #666391; font-size: 9px; }
.card-bottom { margin-top: auto; padding-top: 21px; }
.card-progress { display: flex; align-items: center; gap: 9px; margin-bottom: 12px; color: var(--ink-soft); font: 9px var(--mono); }
.card-progress-rail { flex: 1; height: 3px; overflow: hidden; background: var(--paper-deep); border-radius: 99px; }
.card-progress-rail i { display: block; height: 100%; width: 0; background: var(--mint-deep); border-radius: inherit; transition: width .35s ease; }
.card-actions { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.card-link { border: 0; padding: 0; background: transparent; color: var(--ink); font-size: 11px; font-weight: 800; }
.card-link span { display: inline-block; margin-left: 7px; transition: transform .2s ease; }
.card-link:hover span { transform: translateX(4px); }
.card-review { color: var(--mint-deep); font: 9px var(--mono); text-transform: uppercase; letter-spacing: .06em; }
.empty-card { grid-column: 1 / -1; min-height: 150px; display: grid; place-items: center; text-align: center; background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); color: var(--ink-soft); }
.empty-card strong { display: block; margin-bottom: 4px; color: var(--ink); }

.loop-section { padding-bottom: 84px; }
.loop-card { min-height: 380px; display: grid; grid-template-columns: .9fr 1.1fr 95px; gap: 44px; align-items: center; padding: 50px 48px; background: var(--ink); color: var(--paper); border-radius: 30px; overflow: hidden; position: relative; }
.loop-card::before { content: ""; position: absolute; width: 520px; height: 520px; right: 105px; top: -310px; border: 1px solid rgba(184, 243, 213, .2); border-radius: 50%; box-shadow: 0 0 0 54px rgba(184, 243, 213, .04), 0 0 0 108px rgba(184, 243, 213, .03); }
.loop-card::after { content: ""; position: absolute; width: 220px; height: 220px; left: -120px; bottom: -130px; border-radius: 50%; background: var(--orange); opacity: .12; }
.loop-copy, .loop-steps, .loop-seal { position: relative; z-index: 1; }
.loop-copy .eyebrow { color: rgba(247,248,244,.55); }
.loop-copy .eyebrow-line { background: var(--orange); }
.loop-copy h2 { color: var(--paper); }
.loop-copy > p:not(.eyebrow) { max-width: 275px; margin: 22px 0 28px; color: rgba(247,248,244,.62); font-size: 11px; }
.button-light { background: var(--mint); color: var(--ink); }
.loop-steps { display: flex; flex-direction: column; gap: 22px; }
.loop-step { display: grid; grid-template-columns: 42px 1fr; gap: 14px; align-items: start; padding-bottom: 20px; border-bottom: 1px solid rgba(247,248,244,.13); }
.loop-step:last-child { padding-bottom: 0; border: 0; }
.loop-step > span { color: var(--orange); font: 11px var(--mono); }
.loop-step strong { display: block; font-size: 14px; }
.loop-step p { margin: 4px 0 0; color: rgba(247,248,244,.55); font-size: 10px; }
.loop-seal { display: grid; place-items: center; align-content: center; width: 78px; height: 78px; border: 1px solid rgba(184,243,213,.5); border-radius: 50%; color: var(--mint); text-align: center; font: 8px var(--mono); letter-spacing: .08em; line-height: 1.3; transform: rotate(13deg); }
.loop-seal b { font-size: 17px; line-height: 1; }
.footer { display: flex; align-items: center; justify-content: space-between; gap: 20px; padding: 0 0 30px; color: var(--ink-soft); }
.footer .brand { color: var(--ink); transform: scale(.85); transform-origin: left center; }
.footer p, .footer-note { margin: 0; font: 10px var(--mono); }

.modal-backdrop { position: fixed; inset: 0; z-index: 40; display: grid; place-items: center; padding: 24px; background: rgba(12, 30, 34, .56); opacity: 0; visibility: hidden; transition: opacity .22s ease, visibility .22s ease; backdrop-filter: blur(8px); }
.modal-backdrop.show { opacity: 1; visibility: visible; }
.modal { width: min(620px, 100%); max-height: min(750px, calc(100vh - 48px)); overflow-y: auto; background: var(--paper); border-radius: 25px; box-shadow: var(--shadow-heavy); transform: translateY(16px) scale(.98); transition: transform .25s ease; }
.modal-backdrop.show .modal { transform: translateY(0) scale(1); }
.modal-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 20px; padding: 28px 30px 16px; }
.modal-head h2 { margin: 12px 0 0; font-size: 30px; letter-spacing: -.07em; line-height: 1.05; }
.close { width: 32px; height: 32px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; background: var(--card); color: var(--ink); font-size: 16px; }
.lesson { padding: 0 30px 30px; }
.lesson > p:first-child { margin: 0 0 23px; color: var(--ink-soft); }
.lesson h3 { margin: 25px 0 10px; font-size: 12px; letter-spacing: -.02em; }
.topic-list { display: flex; flex-wrap: wrap; gap: 7px; padding: 0; margin: 0; list-style: none; }
.topic-list li { padding: 7px 9px; background: var(--card); border: 1px solid var(--line); border-radius: 8px; color: var(--ink-soft); font-size: 10px; }
.formula-box { padding: 14px 17px; background: var(--ink); color: var(--mint); border-radius: 12px; font: 12px/1.8 var(--mono); }
.strategy { padding: 13px 15px; background: var(--lavender); border-radius: 12px; color: #53507f; font-size: 11px; }
.modal-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 25px; }
.modal-actions .button { padding-top: 11px; padding-bottom: 11px; }
.button-secondary { border: 1px solid var(--line); background: var(--card); color: var(--ink); }
.quiz-body { padding: 0 30px 30px; }
.quiz-progress { height: 5px; margin: 4px 30px 22px; overflow: hidden; background: var(--paper-deep); border-radius: 99px; }
.quiz-progress i { display: block; width: 12.5%; height: 100%; background: var(--mint-deep); transition: width .25s ease; }
.quiz-question { margin: 25px 0 21px; font-size: 20px; line-height: 1.25; letter-spacing: -.05em; }
.options { display: grid; gap: 9px; }
.option { display: grid; grid-template-columns: 28px 1fr; align-items: center; gap: 8px; text-align: left; padding: 13px 14px; border: 1px solid var(--line); border-radius: 12px; background: var(--card); color: var(--ink); font-size: 11px; transition: border .2s ease, transform .2s ease, background .2s ease; }
.option:hover { transform: translateX(3px); border-color: var(--mint-deep); }
.option .option-letter { width: 24px; height: 24px; display: grid; place-items: center; border-radius: 7px; background: var(--paper-deep); font: 10px var(--mono); }
.option.correct { background: #dcf8e8; border-color: #71d6a6; }
.option.wrong { background: #ffebe1; border-color: #f0aa85; }
.feedback { margin-top: 16px; padding: 14px; border-radius: 12px; background: var(--paper-deep); font-size: 11px; }
.feedback strong { display: block; margin-bottom: 4px; }
.result { margin: 0 30px 25px; padding: 22px; border-radius: 15px; background: var(--mint); color: var(--ink); }
.result h3 { margin: 0 0 6px; font-size: 24px; letter-spacing: -.06em; }
.result p { margin: 0; font-size: 11px; }

@keyframes card-in { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } }
@media (max-width: 900px) { .topbar { padding-inline: 24px; } .topnav { gap: 15px; } .theme-label { display: none; } .hero { grid-template-columns: .95fr 1.05fr; } .lab-main { right: 110px; } .float-progress { right: -4px; } .float-score { left: -3px; } .chapter-grid { grid-template-columns: repeat(2, 1fr); } .loop-card { grid-template-columns: 1fr 1fr; } .loop-seal { position: absolute; right: 36px; top: 40px; } }
@media (max-width: 680px) { .page-wrap { width: min(100% - 36px, 480px); } .topbar { height: 68px; padding-inline: 18px; } .topnav { display: none; } .hero { display: block; padding-top: 52px; padding-bottom: 38px; } .hero h1 { font-size: clamp(53px, 16vw, 76px); } .hero-sub { margin-top: 24px; } .hero-note { margin-top: 28px; } .hero-art { min-height: 390px; margin-top: 12px; transform: scale(.9); transform-origin: top center; } .stats-strip { grid-template-columns: 1fr 1fr; gap: 22px 15px; margin-bottom: 83px; padding: 22px 0; } .stat-intro { grid-column: 1 / -1; } .stat { padding-left: 13px; } .stat:nth-child(2) { border-left: 0; padding-left: 0; } .stat-number { font-size: 26px; } .section-heading { display: block; margin-bottom: 29px; } .section-blurb { width: auto; margin-top: 22px; } .library-tools { display: block; } .search-wrap { width: 100%; margin-bottom: 10px; } .filter-chips { justify-content: flex-start; } .chapter-grid { grid-template-columns: 1fr; } .chapter-section { padding-bottom: 88px; } .loop-card { display: block; padding: 36px 26px; } .loop-copy > p:not(.eyebrow) { max-width: 300px; } .loop-steps { margin-top: 40px; } .loop-seal { right: 24px; top: 34px; } .footer { display: block; padding-bottom: 24px; } .footer p { margin: 22px 0 10px; } .modal-backdrop { padding: 12px; } .modal { max-height: calc(100vh - 24px); border-radius: 20px; } .modal-head, .lesson, .quiz-body { padding-left: 21px; padding-right: 21px; } .quiz-progress { margin-left: 21px; margin-right: 21px; } .result { margin-inline: 21px; } }

body.dark { --ink: #edf7f1; --ink-soft: #a8bdb7; --paper: #14262c; --paper-deep: #1b353a; --card: #193138; --line: #2b484b; --lavender: #363752; --mint: #a6f0cc; --mint-deep: #6be0ad; --orange: #ffc174; --shadow: 0 18px 45px rgba(0, 0, 0, .18); --shadow-heavy: 0 28px 80px rgba(0, 0, 0, .28); }
body.dark .topbar { background: rgba(20, 38, 44, .88); border-color: rgba(43,72,75,.8); }
body.dark .ambient-one { background: #303252; opacity: .35; } body.dark .ambient-two { background: #194a3f; opacity: .25; }
body.dark .hero-art::before { background: #1b3438; } body.dark .float-card { background: rgba(25,49,56,.94); }
body.dark .formula-box { background: #0e1e24; } body.dark .strategy { color: #d4d1fc; background: #343452; }
body.dark .option.correct { background: #234b3b; } body.dark .option.wrong { background: #50372d; }
body.dark .search-wrap { background: rgba(25,49,56,.65); }

@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; animation-duration: .01ms !important; transition-duration: .01ms !important; } }
