/* ================================================================
   CircleNotes — Class 9 NCERT Circles revision site
   ================================================================ */

:root {
  --paper:      #faf8f4;
  --paper-2:    #f3efe7;
  --card:       #ffffff;
  --ink:        #191712;
  --ink-soft:   #55504a;
  --ink-dim:    #8b8478;
  --line:       #e7e1d5;
  --line-soft:  #efe9dd;
  --accent:     #4338ca;
  --accent-ink: #312a9e;
  --accent-soft:#eceafe;
  --amber:      #b45309;
  --amber-soft: #fbeed8;
  --radius:     18px;
  --shadow-sm:  0 1px 2px rgba(25, 23, 18, 0.05);
  --shadow-md:  0 14px 34px -18px rgba(25, 23, 18, 0.18);
  --shadow-lg:  0 40px 80px -40px rgba(25, 23, 18, 0.28);
  --serif:      "Fraunces", Georgia, "Times New Roman", serif;
  --sans:       "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --mono:       "IBM Plex Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--sans);
  background: var(--paper);
  color: var(--ink);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, h5, .serif {
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
}

.hidden {
  display: none !important;
}

#site {
  min-height: 100vh;
  overflow-x: clip;
}

::selection {
  background: var(--accent-soft);
  color: var(--accent-ink);
}

/* ---------------- top bar ---------------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 100;
  display: flex;
  align-items: center;
  gap: 2rem;
  padding: 0.85rem 2.5rem;
  background: rgba(250, 248, 244, 0.85);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s, box-shadow 0.25s;
}

.topbar.is-scrolled {
  border-bottom-color: var(--line);
  box-shadow: 0 8px 24px -20px rgba(25, 23, 18, 0.5);
}

.brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
  flex-shrink: 0;
}

.brand-mark {
  position: relative;
  width: 26px;
  height: 26px;
  border: 3.5px solid var(--accent);
  border-radius: 50%;
  transition: transform 0.5s cubic-bezier(0.2, 1.4, 0.3, 1);
}

.brand:hover .brand-mark {
  transform: rotate(90deg);
}

.brand-dot {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: 50%;
}

.brand-name {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.4px;
}

.brand-name em {
  font-style: italic;
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 1.7rem;
  margin-right: auto;
}

.nav-links a {
  position: relative;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 0.92rem;
  font-weight: 500;
  padding: 0.2rem 0;
  transition: color 0.15s;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -2px;
  width: 100%;
  height: 2px;
  background: var(--accent);
  border-radius: 2px;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.2, 1);
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--ink);
}

.nav-links a:hover::after,
.nav-links a.active::after {
  transform: scaleX(1);
}

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.8rem;
}

.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 40px;
  height: 40px;
  padding: 9px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}

.nav-toggle span,
.nav-toggle::before,
.nav-toggle::after {
  content: "";
  display: block;
  height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.25s;
}

.nav-toggle span {
  width: 100%;
}

.nav-toggle::before { width: 100%; }
.nav-toggle::after  { width: 70%; }

.nav-toggle.open::before { transform: translateY(7px) rotate(45deg); }
.nav-toggle.open::after  { transform: translateY(-7px) rotate(-45deg) translateX(3px); }
.nav-toggle.open span    { opacity: 0; }

/* ---------------- buttons ---------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.55rem;
  font-weight: 600;
  font-size: 0.95rem;
  text-decoration: none;
  border: none;
  border-radius: 999px;
  padding: 0.8rem 1.5rem;
  cursor: pointer;
  transition: transform 0.2s cubic-bezier(0.2, 1, 0.3, 1), box-shadow 0.2s,
              background 0.2s, color 0.2s, border-color 0.2s;
}

.btn:active {
  transform: scale(0.97);
}

.btn-primary {
  background: var(--ink);
  color: var(--paper);
  box-shadow: var(--shadow-md);
}

.btn-primary:hover {
  background: var(--accent-ink);
  transform: translateY(-2px);
  box-shadow: 0 20px 40px -20px rgba(49, 42, 158, 0.55);
}

.btn-primary svg {
  transition: transform 0.2s;
}

.btn-primary:hover svg {
  transform: translateX(3px);
}

.btn-ghost {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}

.btn-ghost:hover {
  border-color: var(--ink);
  transform: translateY(-2px);
}

.btn-line {
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
}

.btn-line:hover {
  background: #fff;
  color: var(--accent-ink);
}

.btn-nav {
  font-size: 0.82rem;
  padding: 0.5rem 1rem;
  background: var(--accent-soft);
  color: var(--accent-ink);
}

.btn-nav:hover {
  background: var(--accent);
  color: #fff;
}

.btn-lg {
  padding: 1rem 1.9rem;
  font-size: 1.02rem;
}

/* ---------------- hero ---------------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 3.5rem;
  align-items: center;
  max-width: 1200px;
  margin: 0 auto;
  padding: 4.5rem 2.5rem 4.5rem;
}

.hero-bg {
  position: absolute;
  inset: -10% -30% auto;
  height: 700px;
  overflow: hidden;
  pointer-events: none;
  z-index: -1;
}

.orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(70px);
}

.orb-1 {
  width: 480px;
  height: 480px;
  top: -140px;
  left: 8%;
  background: radial-gradient(circle, rgba(67, 56, 202, 0.16), transparent 65%);
}

.orb-2 {
  width: 400px;
  height: 400px;
  top: 60px;
  right: 12%;
  background: radial-gradient(circle, rgba(180, 83, 9, 0.13), transparent 65%);
  animation: drift 12s ease-in-out infinite alternate;
}

.orb-3 {
  width: 300px;
  height: 300px;
  top: 300px;
  left: 45%;
  background: radial-gradient(circle, rgba(67, 56, 202, 0.1), transparent 65%);
  animation: drift 16s ease-in-out infinite alternate-reverse;
}

@keyframes drift {
  from { transform: translate(0, 0); }
  to   { transform: translate(50px, 30px); }
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent-ink);
  background: var(--accent-soft);
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  margin-bottom: 1.5rem;
}

.badge-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: pulse 2.4s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(67, 56, 202, 0.4); }
  50%      { box-shadow: 0 0 0 6px rgba(67, 56, 202, 0); }
}

.hero h1 {
  font-size: clamp(2.9rem, 5.4vw, 4.3rem);
  letter-spacing: -0.03em;
  margin-bottom: 1.3rem;
}

.hero h1 em {
  font-style: italic;
  color: var(--amber);
}

.lede {
  font-size: 1.12rem;
  color: var(--ink-soft);
  max-width: 33rem;
  margin-bottom: 1.9rem;
}

.lede strong {
  color: var(--ink);
  font-weight: 600;
  background: linear-gradient(transparent 62%, var(--amber-soft) 62%);
}

.hero-search {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.85rem 1.2rem;
  color: var(--ink-dim);
  margin-bottom: 1.6rem;
  max-width: 33rem;
  box-shadow: var(--shadow-sm);
  transition: border-color 0.15s, box-shadow 0.15s;
}

.hero-search:focus-within {
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.hero-search input {
  flex: 1;
  min-width: 0;
  border: none;
  outline: none;
  background: transparent;
  font: inherit;
  font-size: 1rem;
  color: var(--ink);
}

.hero-search input::placeholder {
  color: var(--ink-dim);
}

.hero-search kbd {
  font-family: var(--mono);
  font-size: 0.78rem;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-bottom-width: 2px;
  border-radius: 6px;
  padding: 0.1rem 0.45rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-bottom: 2.6rem;
}

.stats {
  display: flex;
  flex-wrap: wrap;
  gap: 2.6rem;
  padding-top: 1.8rem;
  border-top: 1px solid var(--line);
}

.stat dt {
  font-family: var(--serif);
  font-size: 1.9rem;
  font-weight: 700;
  letter-spacing: -0.03em;
  font-feature-settings: "tnum";
}

.stat dd {
  font-size: 0.82rem;
  color: var(--ink-dim);
  font-weight: 500;
}

/* ---------------- diagram ---------------- */
.hero-art {
  position: relative;
}

.diagram-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 1.7rem 1.8rem 1.4rem;
  box-shadow: var(--shadow-lg);
}

.diagram-head {
  display: flex;
  align-items: baseline;
  gap: 0.6rem;
  margin-bottom: 0.4rem;
}

.diagram-title {
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
}

.diagram-sub {
  font-size: 0.82rem;
  color: var(--ink-dim);
}

.diagram {
  width: 100%;
  height: auto;
  display: block;
  font-family: var(--sans);
}

.c-main {
  fill: none;
  stroke: var(--ink);
  stroke-width: 2.5;
}

.c-ghost {
  fill: none;
  stroke: var(--line);
  stroke-width: 1;
  stroke-dasharray: 3 6;
  transform-origin: 220px 200px;
  animation: spin 60s linear infinite;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

.c-point {
  fill: var(--ink);
}

.c-point-main {
  fill: var(--accent);
}

.c-orbiter {
  fill: var(--amber);
}

.d-diameter {
  stroke: var(--ink-dim);
  stroke-width: 1.2;
  stroke-dasharray: 4 4;
}

.d-arrowhead {
  fill: var(--ink-dim);
}

.d-radius {
  stroke: var(--ink-dim);
  stroke-width: 2;
}

.d-chord {
  stroke: var(--accent);
  stroke-width: 2.6;
  stroke-linecap: round;
}

.d-arc {
  stroke: var(--amber);
  stroke-width: 2.6;
  fill: none;
  stroke-linecap: round;
}

.d-arc-major {
  stroke-dasharray: 7 6;
}

.d-angle {
  stroke: var(--accent);
  stroke-width: 1.6;
  opacity: 0.6;
}

.lbl {
  font-size: 15px;
  font-weight: 500;
  fill: var(--ink-soft);
}

.lbl-strong {
  font-weight: 700;
  fill: var(--ink);
}

.lbl-lead {
  font-size: 13px;
  fill: var(--ink-dim);
}

.lbl-dim {
  font-size: 12.5px;
  fill: var(--ink-dim);
}

.lbl-mark {
  fill: var(--amber);
  font-weight: 600;
}

.legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.45rem;
  padding-top: 0.9rem;
  border-top: 1px dashed var(--line);
}

.lg {
  font-size: 0.76rem;
  font-weight: 600;
  padding: 0.28rem 0.7rem;
  border-radius: 999px;
  border: 1px solid;
}

.lg-radius  { color: var(--ink-dim);   border-color: var(--line); }
.lg-chord   { color: var(--accent-ink);border-color: #d8d4f8; background: var(--accent-soft); }
.lg-arc     { color: var(--amber);     border-color: #f0dcb8; background: var(--amber-soft); }
.lg-sector  { color: var(--ink-soft);  border-color: var(--line); background: var(--paper); }
.lg-segment { color: var(--ink-soft);  border-color: var(--line); background: var(--paper); }

.float-chip {
  position: absolute;
  font-family: var(--serif);
  font-size: 0.95rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0.7rem 1.1rem;
  box-shadow: var(--shadow-md);
  color: var(--ink-soft);
  animation: bob 5s ease-in-out infinite;
}

.float-chip strong {
  color: var(--accent);
}

.chip-a {
  top: -18px;
  right: -14px;
}

.chip-b {
  bottom: -16px;
  left: -18px;
  animation-delay: 2.5s;
}

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

/* ---------------- ticker ---------------- */
.ticker {
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  padding: 0.85rem 0;
  user-select: none;
}

.ticker-track {
  display: flex;
  align-items: center;
  gap: 2.2rem;
  width: max-content;
  animation: ticker 40s linear infinite;
  font-family: var(--mono);
  font-size: 0.85rem;
  white-space: nowrap;
}

.ticker-track i {
  color: var(--amber);
  font-style: normal;
}

@keyframes ticker {
  to { transform: translateX(-50%); }
}

/* ---------------- sections ---------------- */
.section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 5rem 2.5rem;
  border-top: 1px solid var(--line-soft);
}

.section-paper {
  max-width: none;
  background: var(--paper-2);
  border-top: 1px solid var(--line-soft);
}

.section-paper > * {
  max-width: 1200px;
  margin-left: auto;
  margin-right: auto;
}

.section-head {
  max-width: 44rem;
  margin-bottom: 3rem;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.75rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--amber);
  margin-bottom: 0.9rem;
}

.eyebrow::after {
  content: "";
  width: 44px;
  height: 1px;
  background: currentColor;
}

.section-head h2 {
  font-size: clamp(1.9rem, 3.4vw, 2.6rem);
  margin-bottom: 0.6rem;
}

.section-head p {
  color: var(--ink-soft);
  font-size: 1.04rem;
}

/* ---------------- concept cards ---------------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.4rem;
}

.card {
  position: relative;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.7rem 1.7rem 1.4rem;
  transition: transform 0.3s cubic-bezier(0.2, 1, 0.3, 1), box-shadow 0.3s,
              border-color 0.3s;
}

.card:hover {
  transform: translateY(-6px);
  border-color: #d8d4f8;
  box-shadow: 0 26px 50px -30px rgba(49, 42, 158, 0.35);
}

.card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 1.1rem;
}

.num {
  font-family: var(--mono);
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 8px;
  padding: 0.25rem 0.6rem;
}

.ico {
  width: 34px;
  height: 34px;
  color: var(--accent);
  opacity: 0.85;
}

.card h3 {
  font-size: 1.18rem;
  margin-bottom: 0.5rem;
}

.card p {
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-bottom: 1.1rem;
}

.card-link {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: var(--ink-dim);
}

.card:hover .card-link {
  color: var(--amber);
}

/* ---------------- key terms ---------------- */
.term-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.term {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 1.3rem 1.5rem;
  transition: transform 0.3s cubic-bezier(0.2, 1, 0.3, 1), box-shadow 0.3s;
}

.term:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.term-glyph {
  font-family: var(--mono);
  font-size: 0.72rem;
  color: var(--amber);
  letter-spacing: 0.1em;
}

.term h4 {
  font-size: 1.08rem;
  margin: 0.35rem 0 0.4rem;
}

.term p {
  font-size: 0.9rem;
  color: var(--ink-soft);
}

.callout {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 2.2rem;
  background: var(--amber-soft);
  border: 1px solid #f0dcb8;
  border-radius: 14px;
  padding: 1.2rem 1.5rem;
}

.callout-ico {
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--amber);
  color: #fff;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 700;
}

.callout p {
  font-size: 0.95rem;
  color: #6b4218;
}

.callout em {
  font-weight: 600;
}

/* ---------------- theorems ---------------- */
.th-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.1rem;
}

.th {
  display: flex;
  gap: 1.2rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.4rem 1.6rem;
  transition: transform 0.3s cubic-bezier(0.2, 1, 0.3, 1), box-shadow 0.3s,
              border-color 0.3s;
}

.th:hover {
  transform: translateY(-4px);
  border-color: #d8d4f8;
  box-shadow: 0 22px 44px -30px rgba(49, 42, 158, 0.4);
}

.th-num {
  font-family: var(--mono);
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--accent-ink);
  background: var(--accent-soft);
  border-radius: 10px;
  padding: 0.35rem 0.55rem;
  height: fit-content;
}

.th-body h3 {
  font-size: 1.08rem;
  margin-bottom: 0.3rem;
}

.th-body p {
  font-size: 0.92rem;
  color: var(--ink-soft);
  margin-bottom: 0.7rem;
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.chip {
  font-family: var(--mono);
  font-size: 0.72rem;
  padding: 0.2rem 0.6rem;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--ink-dim);
}

.chip-proof {
  border-color: #d8d4f8;
  color: var(--accent-ink);
  background: var(--accent-soft);
}

.chip-star {
  border-color: #f0dcb8;
  color: var(--amber);
  background: var(--amber-soft);
}

/* ---------------- formulas ---------------- */
.formula-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.1rem;
}

.formula {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 1.4rem 1.6rem;
  transition: transform 0.3s cubic-bezier(0.2, 1, 0.3, 1), box-shadow 0.3s;
}

.formula:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-md);
}

.f-name {
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--ink-dim);
}

.f-eq {
  font-family: var(--serif);
  font-size: 1.85rem;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--accent);
  font-feature-settings: "tnum";
}

.f-note {
  font-size: 0.85rem;
  color: var(--ink-dim);
}

/* ---------------- worked example ---------------- */
.worked {
  margin-top: 2.4rem;
  background: var(--ink);
  color: var(--paper);
  border-radius: 22px;
  padding: 2.2rem 2.4rem;
}

.worked-tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #f5c98a;
  background: rgba(245, 201, 138, 0.14);
  border: 1px solid rgba(245, 201, 138, 0.35);
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.9rem;
}

.worked-head h3 {
  font-size: 1.55rem;
  color: #fff;
  margin-bottom: 0.6rem;
}

.worked-body > p {
  color: rgba(250, 248, 244, 0.75);
  font-size: 0.98rem;
  max-width: 46rem;
}

.steps {
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  margin: 1.3rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: step;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 2.6rem;
  color: rgba(250, 248, 244, 0.85);
  font-size: 0.97rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0.1rem;
  display: grid;
  place-items: center;
  width: 1.7rem;
  height: 1.7rem;
  border-radius: 50%;
  border: 1px solid rgba(245, 201, 138, 0.5);
  color: #f5c98a;
  font-family: var(--mono);
  font-size: 0.8rem;
}

.steps strong {
  color: #f5c98a;
}

.steps-note {
  margin-top: 1.1rem;
  font-size: 0.9rem;
  color: rgba(250, 248, 244, 0.6);
  border-left: 2px solid rgba(245, 201, 138, 0.5);
  padding-left: 0.9rem;
}

/* ---------------- accordions (solutions + faq) ---------------- */
.ex-list,
.faq-list {
  display: flex;
  flex-direction: column;
  gap: 0.8rem;
}

.ex,
.faq {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 14px;
  overflow: hidden;
  transition: border-color 0.2s, box-shadow 0.3s;
}

.ex:hover,
.faq:hover {
  border-color: #d8d4f8;
}

.ex[open],
.faq[open] {
  border-color: #d8d4f8;
  box-shadow: 0 22px 44px -34px rgba(49, 42, 158, 0.35);
}

.ex summary,
.faq summary {
  display: flex;
  align-items: center;
  gap: 0.8rem;
  cursor: pointer;
  list-style: none;
  padding: 1.05rem 1.4rem;
  font-weight: 600;
  font-size: 0.98rem;
}

.ex summary::-webkit-details-marker,
.faq summary::-webkit-details-marker {
  display: none;
}

.ex summary::before,
.faq summary::before {
  content: "+";
  display: grid;
  place-items: center;
  flex-shrink: 0;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--accent-soft);
  color: var(--accent-ink);
  font-size: 1.1rem;
  font-weight: 400;
  transition: transform 0.25s;
}

.ex[open] summary::before,
.faq[open] summary::before {
  content: "–";
  transform: rotate(180deg);
}

.ex-tag {
  margin-left: auto;
  flex-shrink: 0;
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--amber);
  background: var(--amber-soft);
  padding: 0.18rem 0.6rem;
  border-radius: 999px;
}

.ex-body,
.faq > p {
  padding: 0 1.4rem 1.2rem 3.9rem;
  color: var(--ink-soft);
  font-size: 0.95rem;
  max-width: 60rem;
}

.faq > p {
  padding-left: 3.9rem;
}

/* ---------------- CTA ---------------- */
.cta {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 2.5rem 5rem;
}

.cta-inner {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(600px 300px at 85% 10%, rgba(245, 201, 138, 0.25), transparent 60%),
    linear-gradient(135deg, #4338ca 0%, #312a9e 55%, #191712 130%);
  color: #fff;
  border-radius: 28px;
  padding: 4.5rem 3.5rem;
  text-align: center;
}

.cta-inner h2 {
  font-size: clamp(1.8rem, 3.6vw, 2.6rem);
  margin-bottom: 0.7rem;
}

.cta-inner p {
  color: rgba(255, 255, 255, 0.75);
  max-width: 34rem;
  margin: 0 auto 2rem;
}

.cta-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
}

.cta-actions .btn-primary {
  background: #fff;
  color: var(--accent-ink);
}

.cta-actions .btn-primary:hover {
  background: var(--amber-soft);
}

/* ---------------- footer ---------------- */
.footer {
  background: var(--ink);
  color: rgba(250, 248, 244, 0.7);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.6fr 1fr 1fr 1fr;
  gap: 2.5rem;
  max-width: 1200px;
  margin: 0 auto;
  padding: 4rem 2.5rem 3rem;
}

.footer .brand {
  color: #fff;
  margin-bottom: 1rem;
}

.footer .brand-name em {
  color: #a5b4fc;
}

.footer-brand p {
  font-size: 0.9rem;
  max-width: 26rem;
}

.footer-col {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  font-size: 0.9rem;
}

.footer-col h5 {
  font-family: var(--mono);
  font-size: 0.76rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: #f5c98a;
  margin-bottom: 0.5rem;
}

.footer-col a {
  color: rgba(250, 248, 244, 0.7);
  text-decoration: none;
  transition: color 0.15s;
  width: fit-content;
}

.footer-col a:hover {
  color: #fff;
}

.footer-base {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: space-between;
  max-width: 1200px;
  margin: 0 auto;
  padding: 1.4rem 2.5rem;
  border-top: 1px solid rgba(250, 248, 244, 0.12);
  font-size: 0.85rem;
}

.footer-dim {
  color: rgba(250, 248, 244, 0.4);
}

/* ---------------- reveal on scroll ---------------- */
.reveal {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.7s cubic-bezier(0.2, 0.7, 0.2, 1),
              transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1);
}

.reveal.in {
  opacity: 1;
  transform: none;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}

/* ================================================================
   PRANK OVERLAYS
   ================================================================ */

.overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
}

/* countdown */
#stage-countdown {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  background: rgba(243, 239, 231, 0.97);
  backdrop-filter: blur(8px);
  text-align: center;
}

.loader {
  position: relative;
  width: 164px;
  height: 164px;
  margin-bottom: 0.6rem;
}

.ring {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.ring-track {
  fill: none;
  stroke: #ded7c8;
  stroke-width: 5;
}

.ring-fill {
  fill: none;
  stroke: var(--accent);
  stroke-width: 5;
  stroke-linecap: round;
  stroke-dasharray: 276.5;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}

.countdown-number {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 3.6rem;
  font-weight: 700;
  color: var(--ink);
  font-feature-settings: "tnum";
}

#countdown-label {
  font-family: var(--serif);
  font-size: 1.5rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.countdown-sub {
  color: var(--ink-soft);
  font-size: 1rem;
}

/* frozen desktop */
#frozen-shot {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  user-select: none;
  -webkit-user-drag: none;
  pointer-events: none;
}

#click-catcher {
  position: absolute;
  inset: 0;
  cursor: none;
}

/* messi reveal */
#stage-messi {
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #0a1a3a 0%, #001028 100%);
  animation: fade-in 0.6s ease;
}

.messi-card {
  text-align: center;
  color: #fff;
  padding: 2rem;
}

.messi-kicker {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: #6ea8d8;
  margin-bottom: 1.6rem;
  animation: fade-in 0.8s 0.5s ease both;
}

.messi-text {
  font-size: clamp(2.8rem, 9vw, 6rem);
  font-weight: 700;
  font-family: var(--serif);
  font-style: italic;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, #75aadb 0%, #ffffff 50%, #75aadb 100%);
  background-size: 200% 100%;
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: pop 0.55s cubic-bezier(0.2, 1.4, 0.4, 1) both,
             shimmer 3s linear infinite;
}

.messi-sub {
  margin-top: 1.2rem;
  font-size: 1.3rem;
  color: #9db8d6;
  animation: fade-in 0.8s 0.35s ease both;
}

#replay-btn {
  margin-top: 2.5rem;
  font-family: var(--sans);
  font-size: 0.95rem;
  font-weight: 600;
  color: #0a1a3a;
  background: #ffffff;
  border: none;
  border-radius: 999px;
  padding: 0.8rem 2rem;
  cursor: pointer;
  transition: transform 0.15s;
  animation: fade-in 0.8s 0.7s ease both;
}

#replay-btn:hover {
  transform: scale(1.05);
}

@keyframes pop {
  from { transform: scale(0.5); opacity: 0; }
  to   { transform: scale(1);   opacity: 1; }
}

@keyframes fade-in {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes shimmer {
  from { background-position: 0% 0; }
  to   { background-position: 200% 0; }
}

/* toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  transform: translateX(-50%);
  z-index: 2000;
  background: var(--ink);
  color: #fff;
  font-family: var(--sans);
  font-size: 0.9rem;
  padding: 0.8rem 1.4rem;
  border-radius: 999px;
  box-shadow: 0 12px 30px -8px rgba(25, 23, 18, 0.5);
  transition: opacity 0.3s;
}

/* ---------------- responsive ---------------- */
@media (max-width: 1024px) {
  .card-grid, .term-grid, .formula-grid { grid-template-columns: 1fr 1fr; }
  .th-grid { grid-template-columns: 1fr; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 900px) {
  .nav-links {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    gap: 0.4rem;
    padding: 1rem 2.5rem 1.4rem;
    background: var(--paper);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-md);
    display: none;
  }

  .nav-links.open { display: flex; }

  .nav-toggle { display: flex; }

  .hero {
    grid-template-columns: 1fr;
    padding: 3rem 1.5rem;
    gap: 2.5rem;
  }

  .hero-art { max-width: 480px; }

  .section, .cta { padding-left: 1.5rem; padding-right: 1.5rem; }

  .cta-inner { padding: 3.2rem 1.8rem; }

  .section { padding-top: 3.5rem; padding-bottom: 3.5rem; }
}

@media (max-width: 640px) {
  .topbar { padding: 0.8rem 1.25rem; }

  .card-grid, .term-grid, .formula-grid, .th-grid { grid-template-columns: 1fr; }

  .stats { gap: 1.2rem 2rem; }

  .worked { padding: 1.7rem 1.5rem; }

  .ex-body, .faq > p { padding-left: 1.4rem; }

  .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; padding: 2.5rem 1.5rem; }

  .footer-base { padding: 1.2rem 1.5rem; }

  .chip-a { right: 0; }
  .chip-b { left: 0; }
}
