/* ===============================
   HSGeometry — Global Theme
   =============================== */

/* Site-wide (light theme) */
:root{
  --bg:#f4f5f9;
  --ink:#0e1726;
  --muted:#8a93a5;
  --brand:#38bdf8;
  --turq:#14c8c4;
  --ring:#1f2937;

  /* Hero-only (dotted banner) */
  --hero-bg-from:#00b4d5;     /* blue */
  --hero-bg-to:#0f172a;       /* slate-900 */
  --hero-dot:#384154;         /* dot color; lighten if too faint */
  --hero-dot-size: 2.2px;     /* ← bigger dots (tweak here) */
  --hero-dot-gap: 18px;       /* spacing (smaller = denser) */
  --hero-min-h: clamp(320px, 42vw, 560px);
}

/* ===============================
   Base
   =============================== */
*{ box-sizing:border-box; }
html{ scroll-behavior:smooth; }
html, body{
  margin:0;
  background:var(--bg);
  color:var(--ink);
  font-family: Inter, system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
}

/* ===============================
   Header / Nav
   =============================== */
.nav{
  display:flex; justify-content:space-between; align-items:center;
  padding:14px 18px;
  border-bottom:1px solid rgba(0,0,0,.06);
  position:sticky; top:0; z-index:50;
  backdrop-filter:blur(6px);
  background:rgba(255,255,255,.65);
}
.logo{ font-weight:800; letter-spacing:.2px; color:#0d263f; }
.logo span{ color:var(--turq); }
.menu a{ color:#0d263f; text-decoration:none; margin-left:12px; }
.menu a:hover{ opacity:.85; }

/* ===============================
   HERO — dotted background + morphing dots
   =============================== */
.hero-banner{
  position:relative;
  display:grid; place-items:center;
  min-height:var(--hero-min-h);
  overflow:hidden; isolation:isolate;
  color:#e6f0ff;
  background: radial-gradient(120% 100% at 50% 0%,
               var(--hero-bg-from) 0%, var(--hero-bg-to) 60%, #090f1a 100%);
}

/* dotted grid plane */
.hero-banner::before{
  content:"";
  position:absolute; inset:0; z-index:0; pointer-events:none;
  background-image: radial-gradient(var(--hero-dot) var(--hero-dot-size),
                                    transparent var(--hero-dot-size));
  background-size: var(--hero-dot-gap) var(--hero-dot-gap);
  opacity:.78;
  animation: dot-drift 50s linear infinite;
}
@keyframes dot-drift { to { background-position: 110px 80px; } }

/* soft vignette/glow */
.hero-banner::after{
  content:"";
  position:absolute; inset:-20%; z-index:1; pointer-events:none;
  background:
    radial-gradient(100% 70% at 50% 40%, transparent 55%, rgba(0,0,0,.55) 100%),
    radial-gradient(30% 40% at 80% 20%, rgba(255,255,255,.05), transparent 60%),
    radial-gradient(25% 50% at 20% 75%, rgba(255,255,255,.04), transparent 70%);
}

/* hero content layout */
.hero-inner{
  position:relative; z-index:2;
  width:min(1200px, 92vw);
  padding:22px 18px 12px;
  display:grid; grid-template-columns:1.1fr 1.4fr;
  gap:clamp(12px, 3vw, 28px); align-items:center;
}
@media (max-width: 860px){
  .hero-inner{ grid-template-columns:1fr; text-align:center; }
}
.hero-copy h1{
  margin:0 0 8px;
  font-size:clamp(28px, 4.2vw, 48px);
  line-height:1.05; letter-spacing:.2px; color:#fff;
}
.tagline{
  margin:8px 0 0; color:#cfe8ff; opacity:.95;
  font-size:clamp(14px, 2.2vw, 18px);
}

/* SVG stage for morphing dots */
.morph-svg{
  width:100%; height:auto; display:block;
  aspect-ratio:12/4;
}

/* the dots that form the morphing shape
   NOTE: fill is dynamically set by morph-hero.js to color-cycle per shape. */
.dot{
  fill: currentColor;
  opacity: .95;
  filter:
    drop-shadow(0 0 1px rgba(255,255,255,.9))
    drop-shadow(0 0 8px rgba(155,229,255,.35));
}

/* ===============================
   Main Content
   =============================== */
main.hero{
  max-width:980px; margin:0 auto; padding:28px 18px;
}
.lesson-list h2{ margin:6px 0 8px; color:#0d263f; }
.status{ margin-top:10px; color:var(--muted); font-size:14px; }

/* ===============================
   Category Grid & Cards
   =============================== */
.grid{
  display:grid;
  grid-template-columns:repeat(auto-fit, minmax(240px,1fr));
  gap:24px; margin-top:20px; justify-items:stretch;
}
.card{
  border:none; border-radius:14px; padding:16px;
  background:linear-gradient(135deg, var(--turq), var(--brand));
  color:#fff;
  transition: transform .18s ease, box-shadow .18s ease, border-color .18s ease;
  text-decoration:none;
}
.card h3{
  margin:0 0 6px; color:#fff;
  text-shadow:0 1px 1px rgba(0,0,0,.35);
}
.card:hover{
  transform:translateY(-2px);
  box-shadow:0 10px 24px rgba(0,0,0,.25);
}

/* ===============================
   Footer
   =============================== */
.foot{
  padding:20px 12px;
  border-top:1px solid rgba(0,0,0,.06);
  text-align:center; color:#4b5563;
  margin-top:40px;
}

/* ===============================
   Accessibility
   =============================== */
@media (prefers-reduced-motion: reduce){
  .hero-banner::before{ animation:none; }
}

/* ===== Let's Learn — generic two-column layout ===== */
.lesson-layout {
  display: grid;
  grid-template-columns: 300px 1fr;   /* left = vocab, right = visuals */
  gap: 24px;
  margin-top: 24px;
  align-items: start;
}
@media (max-width: 900px){
  .lesson-layout { grid-template-columns: 1fr; }
}

/* Left panel (Geometric Vocab) */
.vocab-panel {
  background:#ffffff;
  border:1px solid rgba(0,0,0,.08);
  border-radius:12px;
  padding:14px;
  position:sticky; top:88px;   /* stays in view while scrolling */
  max-height: calc(100vh - 120px);
  overflow:auto;
}
.vocab-panel h3 { margin:4px 0 10px; color:#0d263f; }

.vocab-list { margin:0; padding:0; }
.vocab-item + .vocab-item { border-top:1px solid rgba(0,0,0,.06); }
.vocab-term{
  width:100%; text-align:left; background:transparent; border:0;
  padding:12px 4px; font-weight:700; color:#0d263f; cursor:pointer;
  display:flex; justify-content:space-between; align-items:center;
}
.vocab-term:hover{ background:#f7fafc; border-radius:8px; }
.vocab-def{ display:none; padding:0 4px 12px 4px; color:#374151; line-height:1.55; }
.vocab-item[aria-expanded="true"] .vocab-def{ display:block; }
.chev{ transition: transform .2s ease; }
.vocab-item[aria-expanded="true"] .chev{ transform: rotate(180deg); }

/* Right panel (Concept + PPT) */
.visual-panel{
  background:#ffffff;
  border:1px solid rgba(0,0,0,.08);
  border-radius:12px;
  padding:16px;
}
.visual-panel h3{ margin:4px 0 10px; color:#0d263f; }

/* Buttons (shared) */
.btn{
  display:inline-block; padding:8px 12px; border-radius:10px; border:0; cursor:pointer;
  background:linear-gradient(135deg, var(--turq), var(--brand)); color:#fff; font-weight:600;
}
.btn.secondary{ background:linear-gradient(135deg, #94a3b8, #64748b); }
.btn.small{ padding:6px 10px; font-size:14px; }

/* Category page — subtopic cards */
.topic-grid{
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.topic-card{
  padding:14px 16px;
  border-radius:14px;
  background: linear-gradient(135deg, var(--turq), var(--brand));
  color:#fff;
}
.topic-card h3{
  margin:0 0 6px;
  font-size:18px;
  color:#fff;
  text-shadow:0 1px 1px rgba(0,0,0,.35);
}
.topic-card .topic-blurb{
  margin:2px 0 0;
  opacity:.95;
}

/* Practice steps toggle */
.steps[data-hidden="true"]{ display:none; }
.steps[data-hidden="false"]{
  display:block; margin-top:10px; padding:12px;
  background:#f8fafc; border:1px solid rgba(0,0,0,.06); border-radius:10px;
}

/* Quiz buttons */
.quiz .option{
  display:block; width:100%; text-align:left; margin:8px 0; padding:10px 12px;
  border:1px solid rgba(0,0,0,.1); border-radius:10px; background:#fff; cursor:pointer;
}
.quiz .option.correct{ border-color:#16a34a; background:#ecfdf5; }
.quiz .option.incorrect{ border-color:#dc2626; background:#fef2f2; }

/* Tab bar styling */
.tabbar {
  display: flex;
  justify-content: flex-start;
  align-items: center;
  gap: 10px;   /* spacing between tabs */
  margin: 20px 0;
}

/* Each tab button */
.tabbar .tab {
  display: inline-flex;
  align-items: center;
  padding: 8px 14px;
  border: none;
  border-radius: 6px;
  background: #f1f5f9;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.tabbar .tab[aria-selected="true"] {
  background: #3b82f6;
  color: #fff;
}

/* Back button inside tabbar */
.tabbar .back-btn {
  margin-left: auto;   /* pushes it to far right */
  padding: 8px 12px;
  border-radius: 6px;
  background: #000;            /* forced black */
  color: #fff;
  font-size: 0.9em;
  text-decoration: none;
  border: none;
}
.tabbar .back-btn:hover { background: #333; }

/* panels */
.tab-panel{ display:none; }
.tab-panel.active{ display:block; }

/* make non-Learn panels look nice */
.panel-card{
  background:#fff; border:1px solid rgba(0,0,0,.08); border-radius:12px; padding:16px;
}

/* PPT embed */
.ppt-embed {
  width: 100%;
  min-height: 420px;
  background: #fff;
  border: 1px solid #e2e8f0;
  border-radius: 10px;
  overflow: hidden;
}
.ppt-embed iframe {
  width: 100%;
  height: 640px;       /* increase if your slides are taller */
  border: 0;
  display: block;
}
@media (max-width: 900px){
  .ppt-embed iframe { height: 520px; }
}
.mini-quiz .option{ margin:6px 0; }
.mini-feedback{ margin-top:6px; font-weight:600; }
.mini-feedback.ok{ color:#16a34a; }       /* green */
.mini-feedback.no{ color:#dc2626; }       /* red  */
