/* The Singularity School — homepage styles
   Golden-hour palette drawn from the Lupa artwork. */

:root {
  color-scheme: light;
  --night: #1d2547;
  --night-2: #2c2f63;
  --dusk: #5a3d7a;
  --ink: #2a2440;
  --ink-soft: #5b5470;
  --cream: #fff8ec;
  --sand: #fbefdc;
  --paper: #ffffff;
  --gold: #f4a93b;
  --gold-deep: #d9821c;
  --amber: #e7962c;
  --coral: #e8693e;
  --rose: #d9587a;
  --plum: #8a5bb5;
  --indigo: #4b5bc4;
  --sea: #2b8a98;
  --leaf: #4f9a4a;
  --line: rgba(42, 36, 64, 0.12);
  --shadow: 0 10px 30px -12px rgba(42, 30, 70, 0.35);
  --radius: 22px;
  --radius-sm: 14px;
  --font-head: "Fraunces", Georgia, "Times New Roman", serif;
  --font-body: "Nunito", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.6;
  color: var(--ink);
  background: var(--cream);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
h1, h2, h3, h4 { font-family: var(--font-head); line-height: 1.15; margin: 0 0 .5em; color: var(--night); }
h2 { font-size: clamp(1.9rem, 4vw, 2.75rem); }
h3 { font-size: 1.4rem; }
p { margin: 0 0 1em; }
figure { margin: 0; }
ul, ol { padding: 0; margin: 0; list-style: none; }

.wrap { width: 100%; max-width: 1180px; margin: 0 auto; padding: 0 16px; }
@media (min-width: 640px) { .wrap { padding: 0 28px; } }

.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.skip-link { position: absolute; left: 12px; top: -60px; background: var(--gold); color: var(--night); padding: 10px 16px; border-radius: 10px; font-weight: 800; z-index: 100; }
.skip-link:focus { top: 12px; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; border-radius: 6px; }

/* Buttons */
.btn {
  display: inline-flex; align-items: center; gap: .5em;
  padding: .8em 1.4em; border-radius: 999px; border: 2px solid transparent;
  font: 800 1rem/1.1 var(--font-body); text-decoration: none; cursor: pointer;
  transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
.btn:hover { transform: translateY(-2px); }
.btn-gold { background: var(--gold); color: var(--night); box-shadow: 0 6px 18px -6px rgba(217, 130, 28, .7); }
.btn-gold:hover { background: #ffb84e; }
.btn-outline { border-color: var(--night); color: var(--night); background: transparent; }
.btn-outline:hover { background: var(--night); color: var(--cream); }
.btn-small { padding: .55em 1.1em; font-size: .95rem; }
.soon { font-size: .72rem; font-weight: 800; text-transform: uppercase; letter-spacing: .05em; background: var(--sand); color: var(--gold-deep); padding: .25em .6em; border-radius: 999px; }
.text-link { font-weight: 800; color: var(--coral); text-decoration: none; }
.text-link:hover { text-decoration: underline; }

.eyebrow { font-weight: 800; letter-spacing: .12em; text-transform: uppercase; font-size: .8rem; color: var(--gold); margin-bottom: .6em; }
.eyebrow-dark { color: var(--coral); }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(29, 37, 71, .92);
  backdrop-filter: saturate(1.4) blur(10px);
  -webkit-backdrop-filter: saturate(1.4) blur(10px);
  color: var(--cream);
  border-bottom: 1px solid rgba(255,255,255,.08);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; min-height: 68px; gap: 16px; }
.brand { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; }
.brand img { border-radius: 50%; border: 2px solid var(--gold); }
.nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 46px; height: 46px; border-radius: 12px; border: 0; background: rgba(255,255,255,.08); cursor: pointer; }
.nav-toggle-bars, .nav-toggle-bars::before, .nav-toggle-bars::after { display: block; width: 22px; height: 2.5px; border-radius: 2px; background: var(--cream); position: relative; transition: transform .2s ease, opacity .2s ease; }
.nav-toggle-bars::before, .nav-toggle-bars::after { content: ""; position: absolute; left: 0; }
.nav-toggle-bars::before { top: -7px; }
.nav-toggle-bars::after { top: 7px; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars { background: transparent; }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bars::after { transform: translateY(-7px) rotate(-45deg); }

.site-nav { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--night); padding: 8px 16px 20px; border-bottom: 1px solid rgba(255,255,255,.1); }
.site-nav.open { display: block; }
.site-nav a { display: block; padding: 12px 6px; text-decoration: none; font-weight: 700; color: var(--cream); border-bottom: 1px solid rgba(255,255,255,.08); }
.site-nav a:hover { color: var(--gold); }
.site-nav .btn { display: inline-flex; margin-top: 14px; border: 0; color: var(--night); }
.site-nav .btn:hover { color: var(--night); }

@media (min-width: 1100px) {
  .nav-toggle { display: none; }
  .site-nav { display: block; position: static; background: none; padding: 0; border: 0; }
  .site-nav ul { display: flex; align-items: center; gap: 2px; }
  .site-nav a { border: 0; padding: 8px 10px; font-size: .95rem; border-radius: 10px; }
  .site-nav a[aria-current="page"] { color: var(--gold); }
  .site-nav .btn { margin: 0 0 0 8px; padding: .55em 1.1em; }
}

/* Hero */
.hero {
  position: relative; overflow: hidden;
  color: var(--cream);
  background:
    radial-gradient(1200px 500px at 85% 110%, rgba(255, 170, 80, .55), transparent 60%),
    radial-gradient(800px 400px at 10% 120%, rgba(232, 105, 62, .45), transparent 60%),
    linear-gradient(180deg, var(--night) 0%, var(--night-2) 45%, var(--dusk) 100%);
  padding: 40px 0 56px;
}
.hero::before { /* soft stars */
  content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background-image:
    radial-gradient(1.5px 1.5px at 12% 18%, #fff, transparent),
    radial-gradient(1px 1px at 28% 8%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 46% 22%, #fff, transparent),
    radial-gradient(1px 1px at 63% 12%, #fff, transparent),
    radial-gradient(1.5px 1.5px at 78% 6%, #fff, transparent),
    radial-gradient(1px 1px at 92% 24%, #fff, transparent),
    radial-gradient(1px 1px at 6% 40%, #fff, transparent);
}
.hero-grid { position: relative; display: grid; gap: 32px; align-items: center; }
.hero-art { order: -1; }
.hero-art img { border-radius: var(--radius); box-shadow: 0 30px 60px -25px rgba(0,0,0,.6), 0 0 0 6px rgba(255, 200, 120, .18); }
.hero h1 { color: var(--cream); font-size: clamp(2.4rem, 7vw, 4.2rem); letter-spacing: -.01em; }
.hero h1 span { display: block; color: var(--gold); }
.lead { font-size: clamp(1.05rem, 2.2vw, 1.25rem); color: rgba(255, 248, 236, .9); max-width: 34em; }

@media (min-width: 960px) {
  .hero { padding: 72px 0 88px; }
  .hero-grid { grid-template-columns: 1fr 1.08fr; gap: 56px; }
  .hero-art { order: 0; }
}

/* Search */
.search { margin-top: 28px; background: rgba(255,255,255,.97); color: var(--ink); border-radius: var(--radius); padding: 18px; box-shadow: 0 20px 40px -20px rgba(0,0,0,.55); }
.search-label { display: block; font-family: var(--font-head); font-weight: 700; color: var(--night); font-size: 1.15rem; margin-bottom: 10px; }
.search-row { display: grid; grid-template-columns: 1fr; gap: 10px; position: relative; }
.search-icon { position: absolute; left: 16px; top: 15px; width: 22px; height: 22px; fill: none; stroke: var(--ink-soft); stroke-width: 2.4; stroke-linecap: round; pointer-events: none; }
.search input, .search select {
  width: 100%; font: 700 1.05rem var(--font-body); color: var(--ink);
  border: 2px solid var(--line); border-radius: 14px; background: var(--paper);
  padding: 13px 14px; min-height: 52px;
}
.search input { padding-left: 48px; }
.search input:focus, .search select:focus { border-color: var(--gold); outline: none; box-shadow: 0 0 0 4px rgba(244, 169, 59, .25); }
@media (min-width: 560px) { .search-row { grid-template-columns: 1fr auto; } .search select { width: auto; } }
.search-chips { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-top: 12px; font-size: .9rem; color: var(--ink-soft); font-weight: 700; }
.search-chips button { font: 700 .9rem var(--font-body); border: 0; background: var(--sand); color: var(--night); padding: 6px 14px; border-radius: 999px; cursor: pointer; }
.search-chips button:hover { background: #f7dfb8; }
.search-results { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 12px; }
.search-count { font-weight: 800; font-size: .9rem; color: var(--ink-soft); margin-bottom: 8px; }
.search-results ul { max-height: 300px; overflow: auto; display: grid; gap: 6px; }
.result { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; text-align: left; padding: 10px 12px; border-radius: 12px; border: 0; background: var(--cream); cursor: pointer; font: inherit; color: inherit; }
.result:hover, .result:focus-visible { background: #fdebd0; }
.result-title { font-weight: 800; color: var(--night); }
.result-meta { font-size: .85rem; color: var(--ink-soft); white-space: nowrap; }
.search-note { font-size: .82rem; color: var(--ink-soft); margin: 10px 0 0; }

/* Sections */
.section { padding: 64px 0; }
@media (min-width: 960px) { .section { padding: 96px 0; } }
.section-head { max-width: 680px; margin-bottom: 36px; }
.section-head p:last-child { color: var(--ink-soft); font-size: 1.1rem; }
.section-head-row { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 12px; max-width: none; }
.section-head-row h2 { margin: 0; }

.split { display: grid; gap: 32px; align-items: center; }
@media (min-width: 900px) {
  .split { grid-template-columns: 1.05fr 1fr; gap: 64px; }
  .split-reverse { grid-template-columns: 1.1fr .9fr; }
}
.rounded-art img { border-radius: var(--radius); box-shadow: var(--shadow); }
.split-copy p { color: var(--ink-soft); }

.tick-list { display: grid; gap: 10px; margin-top: 18px; }
.tick-list li { position: relative; padding-left: 34px; font-weight: 700; }
.tick-list li::before { content: ""; position: absolute; left: 0; top: .2em; width: 22px; height: 22px; border-radius: 50%; background: radial-gradient(circle, #fff3c4 0 25%, var(--gold) 26% 100%); box-shadow: 0 0 12px rgba(244,169,59,.7); }

/* Grades */
.grades { background: var(--sand); }
.grade-picker { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
@media (min-width: 720px) { .grade-picker { grid-template-columns: repeat(9, 1fr); } }
.grade-btn {
  font: 700 .85rem var(--font-body); color: var(--ink-soft);
  border: 2px solid transparent; background: var(--paper); border-radius: 18px;
  padding: 14px 6px; cursor: pointer; display: grid; justify-items: center; gap: 2px;
  box-shadow: 0 4px 14px -8px rgba(42,30,70,.4); transition: transform .15s ease, background .15s ease;
}
.grade-btn b { font-family: var(--font-head); font-size: 1.9rem; line-height: 1; color: var(--night); }
.grade-btn:hover { transform: translateY(-3px); }
.grade-btn[aria-pressed="true"] { background: var(--night); color: var(--gold); border-color: var(--gold); }
.grade-btn[aria-pressed="true"] b { color: var(--cream); }
.grade-panel {
  margin-top: 22px; background: var(--paper); border-radius: var(--radius); padding: 24px;
  display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 18px;
  box-shadow: var(--shadow); border-left: 8px solid var(--gold);
}
.grade-panel h3 { margin-bottom: .25em; }
.grade-panel p { margin: 0 0 .4em; color: var(--ink-soft); }
.grade-band { font-weight: 800; font-size: .8rem; text-transform: uppercase; letter-spacing: .1em; color: var(--coral) !important; }
.status { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: .9rem; color: var(--leaf) !important; }
.status .dot { width: 10px; height: 10px; border-radius: 50%; background: currentColor; }
.status.later { color: var(--gold-deep) !important; }

/* Subjects */
.subject-grid { display: grid; gap: 14px; grid-template-columns: repeat(2, 1fr); }
@media (min-width: 800px) { .subject-grid { grid-template-columns: repeat(4, 1fr); } }
.subject a {
  height: 100%; display: flex; flex-direction: column; gap: 6px; text-decoration: none;
  background: var(--paper); border-radius: var(--radius-sm); padding: 18px;
  border-top: 5px solid var(--accent, var(--gold));
  box-shadow: 0 6px 18px -12px rgba(42,30,70,.5); transition: transform .15s ease, box-shadow .15s ease;
}
.subject a:hover { transform: translateY(-4px); box-shadow: var(--shadow); }
.subject-icon { font-size: 1.8rem; line-height: 1; width: 52px; height: 52px; display: grid; place-items: center; border-radius: 14px; background: color-mix(in srgb, var(--accent, var(--gold)) 14%, white); margin-bottom: 4px; }
.subject-name { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; color: var(--night); line-height: 1.2; }
.subject-desc { font-size: .92rem; color: var(--ink-soft); }
.subject.harbor { grid-column: 1 / -1; }
.subject.harbor a {
  flex-direction: row; padding: 0; overflow: hidden; border-top: 0;
  background: linear-gradient(120deg, var(--night) 0%, var(--dusk) 70%, #b0567a 100%);
}
.subject.harbor img { width: 38%; max-width: 220px; object-fit: cover; object-position: center 30%; aspect-ratio: auto; }
.subject.harbor .subject-body { display: flex; flex-direction: column; justify-content: center; gap: 8px; padding: 22px; }
.subject.harbor .subject-name { color: var(--cream); font-size: clamp(1.4rem, 3vw, 2rem); }
.subject.harbor .subject-desc { color: rgba(255,248,236,.88); font-size: 1rem; }
.tag { align-self: flex-start; font-size: .75rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; background: var(--gold); color: var(--night); padding: 4px 10px; border-radius: 999px; }
@media (min-width: 800px) {
  .subject.harbor { grid-column: span 2; grid-row: span 2; }
  .subject.harbor a { flex-direction: column; }
  .subject.harbor img { width: 100%; max-width: none; height: 230px; object-position: center 35%; }
}
.subjects-note { margin-top: 24px; color: var(--ink-soft); font-size: .95rem; }

/* Featured lessons */
.featured { background: linear-gradient(180deg, var(--cream), var(--sand)); }
.lesson-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(230px, 72%);
  gap: 16px; overflow-x: auto; scroll-snap-type: x mandatory; padding: 6px 4px 18px; margin: 0 -4px;
  scrollbar-width: thin;
}
@media (min-width: 720px) { .lesson-row { grid-auto-columns: minmax(230px, 1fr); } }
.lesson { scroll-snap-align: start; }
.lesson a { display: flex; flex-direction: column; height: 100%; text-decoration: none; background: var(--paper); border-radius: var(--radius-sm); overflow: hidden; box-shadow: 0 8px 20px -14px rgba(42,30,70,.55); transition: transform .15s ease; }
.lesson a:hover { transform: translateY(-4px); }
.lesson-art { display: block; aspect-ratio: 4 / 3; overflow: hidden; background: var(--night); }
.lesson-art img { width: 100%; height: 100%; object-fit: cover; object-position: center 30%; }
.lesson-art-math { display: grid; place-items: center; background: radial-gradient(circle at 70% 30%, #ffcf7a, var(--amber) 45%, var(--coral)); color: var(--night); font-family: var(--font-head); font-size: 2.6rem; font-weight: 700; }
.lesson-art-math b { color: var(--cream); text-shadow: 0 0 16px rgba(255,255,255,.8); }
.lesson-art-frac { background: radial-gradient(circle at 30% 30%, #9fe0e6, var(--sea) 60%, var(--night-2)); color: var(--cream); font-size: 2.2rem; }
.lesson-meta { margin: 14px 16px 0; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--coral); }
.lesson-title { margin: 4px 16px 0; font-family: var(--font-head); font-size: 1.15rem; font-weight: 700; color: var(--night); line-height: 1.25; }
.lesson-info { margin: 6px 16px 16px; font-size: .9rem; color: var(--ink-soft); }

/* How */
.how { background: linear-gradient(160deg, var(--night) 0%, var(--night-2) 60%, var(--dusk) 100%); color: var(--cream); }
.how h2 { color: var(--cream); }
.how .split-copy p { color: rgba(255,248,236,.85); }
.how-example { background: rgba(255,255,255,.08); border-radius: 14px; padding: 12px 16px; font-size: .95rem; }
.how-example b { color: var(--gold); }
.steps { counter-reset: step; display: grid; gap: 10px; margin: 20px 0; }
.steps li { counter-increment: step; display: flex; align-items: center; gap: 14px; background: rgba(255,255,255,.06); border-radius: 14px; padding: 10px 14px; }
.steps li::before { content: counter(step); flex: none; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--night); font-weight: 800; font-family: var(--font-head); }
.steps b { color: var(--cream); }
.three-clicks b { color: var(--gold); }
.how-art { justify-self: center; max-width: 380px; }
.how-art img { border-radius: 200px 200px var(--radius) var(--radius); box-shadow: 0 0 0 8px rgba(244,169,59,.2), 0 30px 60px -25px rgba(0,0,0,.7); }

/* Doors */
.door-grid { display: grid; gap: 18px; }
@media (min-width: 860px) { .door-grid { grid-template-columns: repeat(3, 1fr); } }
.door { background: var(--paper); border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); display: flex; flex-direction: column; scroll-margin-top: 90px; }
.door img { width: 100%; height: 220px; object-fit: cover; object-position: center 30%; }
.door-body { padding: 22px; display: flex; flex-direction: column; flex: 1; }
.door-body p { color: var(--ink-soft); flex: 1; }
.door-body .btn { align-self: flex-start; }

/* About */
.about { background: var(--sand); }
.about-art { max-width: 420px; justify-self: center; }
.about-art img { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }

/* Footer */
.site-footer { background: var(--night); color: rgba(255,248,236,.82); padding: 56px 0 24px; }
.site-footer h4 { color: var(--gold); font-family: var(--font-body); font-size: .85rem; text-transform: uppercase; letter-spacing: .1em; }
.site-footer a { text-decoration: none; }
.site-footer a:hover { color: var(--gold); }
.site-footer .brand { color: var(--cream); margin-bottom: 12px; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: repeat(2, 1fr); }
.footer-brand { grid-column: 1 / -1; }
.footer-grid ul { display: grid; gap: 8px; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; } .footer-brand { grid-column: auto; } }
.footer-base { margin-top: 36px; padding-top: 18px; border-top: 1px solid rgba(255,255,255,.1); font-size: .88rem; }
.footer-base p { margin: 0; }

/* Coming soon dialog */
.soon-dialog { border: 0; padding: 0; border-radius: var(--radius); max-width: min(560px, calc(100vw - 32px)); overflow: hidden; box-shadow: 0 40px 80px -20px rgba(0,0,0,.6); background: var(--paper); color: var(--ink); }
.soon-dialog::backdrop { background: rgba(20, 22, 50, .6); backdrop-filter: blur(3px); }
.soon-dialog[open] { display: grid; grid-template-columns: 1fr; }
.soon-dialog img { width: 100%; height: 200px; object-fit: cover; object-position: center 60%; }
.soon-body { padding: 24px; }
.soon-body p { color: var(--ink-soft); }
@media (min-width: 560px) {
  .soon-dialog[open] { grid-template-columns: 200px 1fr; }
  .soon-dialog img { height: 100%; }
  .soon-body { align-self: center; }
}

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

@media (min-width: 1080px) {
  .lesson-row { grid-auto-flow: row; grid-template-columns: repeat(5, 1fr); overflow: visible; }
}

/* ===================== Inner pages ===================== */
a.result { text-decoration: none; }
.search-count a { color: var(--coral); font-weight: 800; }
.h3 { font-size: 1.4rem; }
.muted { color: var(--ink-soft); font-size: .95rem; }
.muted-light { color: rgba(255,248,236,.8); font-weight: 700; }
.sample-note { font-size: .85rem; color: var(--ink-soft); margin-top: 18px; }
.section-tight { padding: 40px 0 72px; }
.row-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; margin-top: 22px; }
.prose { max-width: 720px; }
.prose h2 { margin-top: 1.4em; }
.prose h2:first-child, .prose .eyebrow + h2 { margin-top: 0; }
.prose p, .prose li { color: var(--ink-soft); }
.prose a, .callout a, .feature a, .split-copy p a { color: var(--coral); font-weight: 700; }
.text-link-light { color: var(--gold); }
.as-button { background: none; border: 0; cursor: pointer; font: inherit; font-weight: 800; padding: 0; }

.page-hero {
  color: var(--cream);
  background:
    radial-gradient(900px 380px at 90% 120%, rgba(255, 170, 80, .45), transparent 60%),
    linear-gradient(170deg, var(--night) 0%, var(--night-2) 55%, var(--dusk) 100%);
  padding: 36px 0 44px;
}
@media (min-width: 960px) { .page-hero { padding: 56px 0 64px; } }
.page-hero h1 { color: var(--cream); font-size: clamp(2.1rem, 5.5vw, 3.4rem); text-wrap: balance; }
.page-hero .lead a { color: var(--gold); font-weight: 800; }
.page-hero .split { align-items: center; }
.page-hero .rounded-art { max-width: 380px; justify-self: center; }
.page-hero .rounded-art img { max-height: 380px; width: 100%; object-fit: cover; }
.page-hero .status { color: #8fe08a !important; }
.page-hero .status.later { color: var(--gold) !important; }
.crumbs { font-size: .88rem; color: rgba(255,248,236,.7); margin-bottom: 18px; }
.crumbs a { color: rgba(255,248,236,.9); font-weight: 700; }
.crumbs a:hover { color: var(--gold); }

.callout { background: var(--sand); border-radius: var(--radius-sm); padding: 18px 20px; margin: 20px 0; }
.callout h3 { font-size: 1.15rem; }
.callout p:last-child { margin-bottom: 0; }
.chip-list { display: flex; flex-wrap: wrap; gap: 8px; }
.chip-list a { display: inline-block; text-decoration: none; background: var(--paper); border: 2px solid var(--line); padding: 6px 14px; border-radius: 999px; font-weight: 700; }
.chip-list a:hover { border-color: var(--gold); }

.pill { display: inline-block; font-size: .78rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; background: var(--sand); color: var(--ink); }
.pill-go { background: #dff3dc; color: #2e6b2a; }
.pill-soon { background: #fdebd0; color: #94560f; }
.pill-light { background: rgba(255,255,255,.14); color: var(--cream); font-size: .9rem; padding: 5px 14px; }

/* Grades */
.grade-cards { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
.grade-card { display: grid; gap: 4px; height: 100%; text-decoration: none; background: var(--paper); border-radius: var(--radius-sm); padding: 20px; box-shadow: 0 6px 18px -12px rgba(42,30,70,.5); border-top: 5px solid var(--line); transition: transform .15s ease; }
.grade-card:hover { transform: translateY(-4px); }
.grade-card.is-ready { border-top-color: var(--gold); }
.grade-big { font-family: var(--font-head); font-size: 3rem; line-height: 1; color: var(--night); }
.grade-name { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; color: var(--night); }
.grade-blurb { color: var(--ink-soft); font-size: .93rem; }
.grade-card .status { margin: 6px 0 0; }
.band-key { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 24px; color: var(--ink-soft); }
.band-key p { margin: 0; }
.grade-switch { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 22px; }
.grade-chip { text-decoration: none; padding: 6px 12px; border-radius: 12px; background: rgba(255,255,255,.1); font-size: .85rem; font-weight: 700; color: var(--cream); }
.grade-chip b { font-family: var(--font-head); font-size: 1.1rem; }
.grade-chip:hover { background: rgba(255,255,255,.2); }
.grade-chip[aria-current="page"] { background: var(--gold); color: var(--night); }

/* Subject dashboards */
.subject-dash { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); }
.subject-card { display: flex; flex-direction: column; gap: 6px; background: var(--paper); border-radius: var(--radius-sm); padding: 20px; border-top: 5px solid var(--accent, var(--gold)); box-shadow: 0 6px 18px -12px rgba(42,30,70,.5); scroll-margin-top: 90px; }
.subject-card-head { display: flex; gap: 14px; align-items: center; margin-bottom: 6px; }
.subject-card h3 { margin: 0; font-size: 1.2rem; }
.subject-card .subject-desc { margin: 0; }
.subject-card .text-link { margin-top: auto; padding-top: 8px; }
.unit-name { margin: 8px 0 2px; font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .06em; color: var(--coral); }
.unit-lessons { display: grid; gap: 4px; }
.lesson-link { font-weight: 700; color: var(--night); text-decoration: none; }
.lesson-link:hover { color: var(--coral); text-decoration: underline; }
.lesson-link.is-soon { color: var(--ink-soft); }

/* Library */
.library { display: grid; gap: 28px; align-items: start; }
@media (min-width: 960px) { .library { grid-template-columns: 290px 1fr; } .lib-filters { position: sticky; top: 92px; } }
.lib-filters { display: grid; gap: 14px; background: var(--paper); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.field { display: grid; gap: 6px; min-width: 0; }
.field label, .check { font-weight: 800; font-size: .9rem; color: var(--night); }
.field input, .field select, .field textarea {
  width: 100%; font: 600 1rem var(--font-body); color: var(--ink); border: 2px solid var(--line); border-radius: 12px;
  background: var(--paper); padding: 11px 12px; min-height: 48px;
}
.field input:focus, .field select:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(244,169,59,.25); }
.check { display: flex; align-items: center; gap: 10px; }
.check input { width: 20px; height: 20px; accent-color: var(--gold-deep); }
.lib-filters .as-button { color: var(--coral); justify-self: start; }
.lib-count { font-weight: 800; color: var(--ink-soft); }
.lib-results { display: grid; gap: 14px; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.lib-card a { display: flex; flex-direction: column; gap: 4px; height: 100%; text-decoration: none; background: var(--paper); padding: 18px; border-radius: var(--radius-sm); box-shadow: 0 6px 18px -12px rgba(42,30,70,.5); transition: transform .15s ease; }
.lib-card a:hover { transform: translateY(-3px); }
.lib-card .lesson-meta { margin: 0; }
.lib-title { font-family: var(--font-head); font-weight: 700; font-size: 1.15rem; color: var(--night); line-height: 1.25; }
.lib-unit { color: var(--ink-soft); font-size: .9rem; }
.lib-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 10px; }

/* Lesson */
.lesson-facts { display: flex; gap: 8px; flex-wrap: wrap; }
.goal { margin-top: 20px; background: rgba(255,255,255,.1); border-left: 6px solid var(--gold); border-radius: 14px; padding: 14px 18px; max-width: 640px; }
.goal p { margin: 0; color: var(--cream); font-size: 1.1rem; }
.goal .goal-label { font-size: .78rem; font-weight: 800; text-transform: uppercase; letter-spacing: .1em; color: var(--gold); margin-bottom: 4px; }
.lesson-layout { display: grid; gap: 24px; align-items: start; scroll-margin-top: 80px; }
@media (min-width: 960px) { .lesson-layout { grid-template-columns: 270px 1fr; gap: 40px; } .stepper { position: sticky; top: 92px; } }
.stepper { background: var(--paper); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.stepper-progress { display: grid; gap: 8px; font-weight: 800; font-size: .9rem; color: var(--ink-soft); }
.stepper .bar { height: 8px; border-radius: 99px; background: var(--sand); overflow: hidden; }
.stepper .bar span { display: block; height: 100%; background: linear-gradient(90deg, var(--gold), var(--coral)); transition: width .3s ease; }
.stepper ol { display: grid; gap: 4px; counter-reset: s; }
.stepper a { counter-increment: s; display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 12px; text-decoration: none; font-weight: 700; font-size: .95rem; color: var(--ink-soft); }
.stepper a::before { content: counter(s); flex: none; width: 26px; height: 26px; border-radius: 50%; display: grid; place-items: center; background: var(--sand); color: var(--night); font-size: .85rem; font-weight: 800; }
.stepper a:hover { background: var(--cream); }
.stepper a.done::before { content: "✓"; background: #dff3dc; color: #2e6b2a; }
.stepper a[aria-current="step"] { background: var(--night); color: var(--cream); }
.stepper a[aria-current="step"]::before { background: var(--gold); }
@media (max-width: 959px) {
  .stepper ol { grid-auto-flow: column; grid-auto-columns: max-content; overflow-x: auto; padding-bottom: 4px; }
  .stepper a { font-size: .85rem; }
}
.lesson-body { min-width: 0; background: var(--paper); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
@media (min-width: 640px) { .lesson-body { padding: 32px; } }
.step-panel h2 { display: flex; align-items: center; gap: 12px; font-size: clamp(1.5rem, 3.5vw, 2rem); }
.step-panel h2:focus { outline: none; }
.step-num { flex: none; width: 44px; height: 44px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--night); font-size: 1.3rem; }
.lupa-says { display: grid; gap: 18px; align-items: center; }
.lupa-says img { border-radius: var(--radius-sm); }
@media (min-width: 720px) { .lupa-says { grid-template-columns: 1fr 1.2fr; } .lupa-says-small { grid-template-columns: 200px 1fr; } }
.lupa-says-small img { max-height: 260px; width: 100%; object-fit: cover; }
.bubble { position: relative; background: var(--cream); border: 2px solid #f6dcb0; border-radius: 20px; padding: 18px 20px; font-size: 1.08rem; }
.bubble p:last-child { margin: 0; }
.video-slot { display: grid; place-items: center; text-align: center; gap: 6px; padding: 28px 18px; margin-bottom: 18px; border-radius: var(--radius-sm); background: linear-gradient(160deg, var(--night), var(--dusk)); color: var(--cream); }
.video-slot > span { width: 56px; height: 56px; border-radius: 50%; display: grid; place-items: center; background: var(--gold); color: var(--night); font-size: 1.4rem; }
.video-slot p { margin: 0; color: rgba(255,248,236,.85); }
.prose-in p { font-size: 1.08rem; }
.examples { display: grid; gap: 14px; }
.example { border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 16px 18px; }
.example h3 { font-size: 1.1rem; }
.example .work { margin: 0; background: #eef7f8; border-radius: 10px; padding: 10px 12px; }
.qs { display: grid; gap: 14px; counter-reset: q; }
.q { counter-increment: q; border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; display: grid; gap: 10px; }
.q > label { font-weight: 700; }
.q > label::before { content: counter(q) ". "; color: var(--coral); font-weight: 800; }
.q input { font: 700 1.05rem var(--font-body); border: 2px solid var(--line); border-radius: 12px; padding: 10px 12px; min-height: 46px; width: 100%; max-width: 260px; }
.q input:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(244,169,59,.25); }
.q-row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.q-row input { flex: 1 1 140px; }
.q-feedback { margin: 0; font-weight: 700; min-height: 0; }
.q-feedback:empty { display: none; }
.is-right { border-color: #9bd596 !important; background: #f3fbf2; }
.is-right .q-feedback { color: #2e6b2a; }
.is-wrong { border-color: #f2b38f !important; background: #fff6f0; }
.is-wrong .q-feedback { color: #a3461c; }
.btn-ghost { background: var(--sand); color: var(--night); }
.score { margin: 0; font-weight: 800; color: var(--night); }
.quiz fieldset { border: 2px solid var(--line); border-radius: var(--radius-sm); padding: 14px 16px; margin: 0 0 14px; display: grid; gap: 6px; }
.quiz legend { font-weight: 800; padding: 0 6px; color: var(--night); }
.quiz label { display: flex; align-items: center; gap: 10px; padding: 8px 10px; border-radius: 10px; cursor: pointer; }
.quiz label:hover { background: var(--cream); }
.quiz input { width: 20px; height: 20px; accent-color: var(--gold-deep); }
.step-nav { display: flex; justify-content: space-between; gap: 12px; margin-top: 28px; padding-top: 20px; border-top: 1px solid var(--line); }
.btn:disabled { opacity: .4; cursor: default; transform: none; }

/* Lupa's Harbor */
.harbor-motto { font-family: var(--font-head); font-size: 1.3rem; color: var(--gold); }
.journey { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); counter-reset: j; }
.journey li { counter-increment: j; background: var(--paper); border-radius: var(--radius-sm); overflow: hidden; box-shadow: 0 6px 18px -12px rgba(42,30,70,.5); }
.journey img { width: 100%; aspect-ratio: 5 / 4; object-fit: cover; object-position: center 25%; }
.journey div { padding: 14px 16px 18px; }
.journey h3 { font-size: 1.15rem; margin-bottom: .3em; }
.journey h3::before { content: counter(j) ". "; color: var(--coral); }
.journey p { margin: 0; color: var(--ink-soft); font-size: .95rem; }
.breathe-stage { display: grid; place-items: center; min-height: 300px; }
.breathe-ring {
  width: 150px; height: 150px; border-radius: 50%; display: grid; place-content: center; text-align: center; gap: 2px;
  background: radial-gradient(circle, #fff3c4 0%, var(--gold) 55%, rgba(244,169,59,.2) 100%);
  box-shadow: 0 0 60px rgba(244,169,59,.6); color: var(--night); transition-property: transform; transition-timing-function: ease-in-out;
}
.breathe-ring span { font-weight: 800; }
.breathe-ring b { font-family: var(--font-head); font-size: 2rem; line-height: 1; }
.breathe-ring.is-in { transform: scale(1.6); }
.breathe-ring.is-hold { transform: scale(1.6); }
.breathe-ring.is-out { transform: scale(1); }
.feelings { display: flex; flex-wrap: wrap; gap: 10px; }
.feelings button { display: grid; justify-items: center; gap: 4px; min-width: 96px; padding: 14px 12px; border-radius: 18px; border: 2px solid transparent; background: var(--paper); font: 800 .95rem var(--font-body); color: var(--night); cursor: pointer; box-shadow: 0 4px 14px -8px rgba(42,30,70,.4); }
.feelings button span { font-size: 2rem; line-height: 1; }
.feelings button[aria-pressed="true"] { border-color: var(--gold); background: #fff4dd; }
.feel-reply { max-width: 640px; }

/* Demo banner, dashboard, portals */
.demo-banner { background: #fdebd0; color: #6b3c06; font-size: .92rem; padding: 10px 0; }
.demo-banner a { color: #6b3c06; font-weight: 800; }
.dash-hello { display: flex; align-items: center; gap: 20px; }
.dash-hello img { width: 96px; height: 96px; border-radius: 50%; object-fit: cover; object-position: center 15%; border: 4px solid var(--gold); flex: none; }
.dash-hello h1 { margin-bottom: .1em; }
.dash-hello .lead { margin: 0; }
.dash-grid { display: grid; gap: 18px; }
@media (min-width: 860px) { .dash-grid { grid-template-columns: 1fr 1fr; } }
.panel { background: var(--paper); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); min-width: 0; }
.panel h2 { font-size: 1.4rem; }
.panel h3 { font-size: 1.15rem; margin-top: 1em; }
.panel h3:first-child { margin-top: 0; }
.next-lesson { display: grid; gap: 2px; text-decoration: none; padding: 14px 16px; border-radius: var(--radius-sm); background: var(--cream); margin-bottom: 10px; border-left: 6px solid var(--gold); }
.next-lesson:hover { background: #fdebd0; }
.next-lesson .lesson-meta { margin: 0; }
.progress-list { display: grid; gap: 12px; }
.progress-list li { display: grid; grid-template-columns: minmax(110px, 1fr) 2fr 44px; gap: 12px; align-items: center; font-weight: 700; }
.progress-list b { text-align: right; font-variant-numeric: tabular-nums; }
.meter { height: 12px; border-radius: 99px; background: var(--sand); overflow: hidden; }
.meter span { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, var(--gold), var(--coral)); }
.task-list { display: grid; gap: 10px; }
.task-list li { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; padding: 10px 12px; border-radius: 12px; background: var(--cream); font-weight: 600; }
.task-list a { color: var(--night); font-weight: 800; }
.task-due { margin-left: auto; font-size: .85rem; color: var(--ink-soft); font-weight: 700; }
.badges { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.badges li { display: grid; justify-items: center; gap: 4px; text-align: center; padding: 12px 6px; border-radius: 14px; background: var(--cream); font-size: .85rem; font-weight: 800; color: var(--ink-soft); filter: grayscale(1); opacity: .55; }
.badges li span { font-size: 1.8rem; }
.badges li.earned { filter: none; opacity: 1; color: var(--night); background: #fff4dd; box-shadow: inset 0 0 0 2px var(--gold); }
.feature-grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
.feature { background: var(--paper); border-radius: var(--radius-sm); padding: 20px; box-shadow: 0 6px 18px -12px rgba(42,30,70,.5); }
.feature h3 { font-size: 1.15rem; }
.feature p { margin: 0; color: var(--ink-soft); }
.portal { background: var(--sand); scroll-margin-top: 70px; }
.portal-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.portal-tabs button { font: 800 .95rem var(--font-body); padding: 10px 18px; border-radius: 999px; border: 2px solid var(--line); background: var(--paper); color: var(--night); cursor: pointer; }
.portal-tabs button[aria-selected="true"] { background: var(--night); color: var(--cream); border-color: var(--night); }
.table-scroll { overflow-x: auto; }
.data-table { width: 100%; border-collapse: collapse; font-size: .95rem; }
.data-table th, .data-table td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); }
.data-table th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--ink-soft); }
.data-table td { font-variant-numeric: tabular-nums; }
.roadmap { background: var(--paper); border-radius: var(--radius-sm); overflow: hidden; }
.msg-list { display: grid; gap: 12px; }
.msg-list li { background: var(--cream); border-radius: 14px; padding: 14px 16px; }
.msg-list p { margin: 4px 0; }
.msg-list span { font-size: .8rem; color: var(--ink-soft); }
.stat-row { display: grid; gap: 12px; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); }
.stat { background: var(--cream); border-radius: 14px; padding: 16px; display: grid; }
.stat b { font-family: var(--font-head); font-size: 2.2rem; color: var(--night); line-height: 1.1; }
.stat span { color: var(--ink-soft); font-weight: 700; font-size: .9rem; }

/* Contact, FAQ */
.contact-form { display: grid; gap: 16px; }
.contact-form .btn { justify-self: start; }
.form-status { margin: 0; font-weight: 800; color: var(--coral); }
.form-status:empty { display: none; }
.contact-email { font-weight: 800; color: var(--night) !important; }
.contact-art { max-width: 240px; }
.faq details { background: var(--paper); border-radius: var(--radius-sm); padding: 4px 18px; margin-bottom: 12px; box-shadow: 0 6px 18px -14px rgba(42,30,70,.5); }
.faq summary { cursor: pointer; font-weight: 800; color: var(--night); padding: 14px 0; font-size: 1.05rem; }
.faq details p { margin-top: 0; }
.lesson-layout > *, .library > *, .split > * { min-width: 0; }
