/* =====================================================================
   TIERA Learn — 101.tieraonline.in
   Engineered "ember / metal" system. Dark-first, theme-aware, no CDNs.
   Signature: the signal-trace learning path (a spectrum you climb).
   ===================================================================== */

:root {
  /* ground / structure */
  --ground: #0b1016;
  --ground-2: #090d12;
  --panel: #141b23;
  --panel-2: #19222c;
  --field-a: #1b2530;
  --field-b: #2b3644;
  --line: rgba(198, 207, 216, 0.12);
  --line-strong: rgba(198, 207, 216, 0.22);

  /* ink */
  --ink-hi: #eef2f7;
  --ink-mid: #9fb0c0;
  --ink-low: #5d6975;

  /* ember accent */
  --ember: #f24a23;
  --ember-light: #f58a6b;
  --ember-deep: #c93c19;
  --ember-glow: rgba(242, 74, 23, 0.32);

  /* metal hardware */
  --metal-hi: #c6cfd8;
  --metal-mid: #8a97a6;
  --metal-low: #59646f;

  /* semantic */
  --pass: #34c98a;
  --pass-dim: rgba(52, 201, 138, 0.16);

  --radius: 14px;
  --radius-lg: 22px;
  --shadow: 0 30px 80px -40px rgba(0, 0, 0, 0.8);

  --display: "Space Grotesk", "Chakra Petch", ui-sans-serif, system-ui,
    -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto,
    Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", "Roboto Mono", Menlo,
    Consolas, monospace;
}

/* Light theme — a machined-aluminium daylight variant. Ember is preserved;
   the dark badge/cover art keeps its own field so it reads on light too. */
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) {
    --ground: #eef1f5;
    --ground-2: #e4e9ef;
    --panel: #ffffff;
    --panel-2: #f4f7fa;
    --field-a: #eaeff4;
    --field-b: #dbe3ec;
    --line: rgba(37, 48, 60, 0.12);
    --line-strong: rgba(37, 48, 60, 0.2);
    --ink-hi: #16202b;
    --ink-mid: #4a5867;
    --ink-low: #8391a0;
    --ember-glow: rgba(242, 74, 23, 0.2);
    --shadow: 0 30px 70px -45px rgba(20, 30, 45, 0.5);
  }
}
:root[data-theme="light"] {
  --ground: #eef1f5;
  --ground-2: #e4e9ef;
  --panel: #ffffff;
  --panel-2: #f4f7fa;
  --field-a: #eaeff4;
  --field-b: #dbe3ec;
  --line: rgba(37, 48, 60, 0.12);
  --line-strong: rgba(37, 48, 60, 0.2);
  --ink-hi: #16202b;
  --ink-mid: #4a5867;
  --ink-low: #8391a0;
  --ember-glow: rgba(242, 74, 23, 0.2);
  --shadow: 0 30px 70px -45px rgba(20, 30, 45, 0.5);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  margin: 0;
  background: var(--ground);
  color: var(--ink-hi);
  font-family: var(--body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
img, svg { display: block; max-width: 100%; }
h1, h2, h3, h4 { font-family: var(--display); font-weight: 700; margin: 0; }

/* focus — visible, ember, keyboard-only */
:focus-visible {
  outline: 2px solid var(--ember);
  outline-offset: 3px;
  border-radius: 4px;
}

.container { width: 100%; max-width: 1200px; margin: 0 auto; padding: 0 clamp(20px, 4vw, 44px); }
.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  background: var(--ember); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-weight: 700; transition: top 0.2s;
}
.skip-link:focus { top: 12px; }

/* ---------- background grid field ---------- */
.grid-field {
  position: absolute; inset: 0; pointer-events: none; z-index: 0;
  background-image:
    linear-gradient(var(--line) 1px, transparent 1px),
    linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 46px 46px;
  mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 78%);
  -webkit-mask-image: radial-gradient(ellipse 90% 70% at 50% 0%, #000 30%, transparent 78%);
  opacity: 0.8;
}

/* ================= NAV ================= */
.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--ground) 82%, transparent);
  backdrop-filter: blur(14px) saturate(1.2);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; gap: 20px; height: 66px; }
.nav-logo img { height: 26px; width: auto; }
:root[data-theme="light"] .nav-logo img,
.nav-logo img { filter: none; }
@media (prefers-color-scheme: light) {
  :root:not([data-theme="dark"]) .nav-logo img { filter: brightness(0.15) saturate(1); }
}
:root[data-theme="light"] .nav-logo img { filter: brightness(0.15) saturate(1); }
.nav-tag {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--ink-low);
  padding-left: 14px; margin-left: 2px; border-left: 1px solid var(--line);
}
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.nav-links a {
  font-size: 14px; color: var(--ink-mid); padding: 8px 12px; border-radius: 8px;
  font-weight: 500; transition: color 0.18s, background 0.18s;
}
.nav-links a:hover { color: var(--ink-hi); background: color-mix(in srgb, var(--metal-hi) 8%, transparent); }
.nav-links a.active { color: var(--ink-hi); }
@media (max-width: 720px) {
  .nav-tag { display: none; }
  .nav-links a.hide-sm { display: none; }
}

/* ================= BUTTONS / CHIPS ================= */
.btn {
  display: inline-flex; align-items: center; gap: 9px; justify-content: center;
  font-family: var(--display); font-weight: 600; font-size: 15px;
  padding: 13px 22px; border-radius: 12px; cursor: pointer;
  border: 1px solid transparent; transition: transform 0.15s, box-shadow 0.2s, background 0.2s, border-color 0.2s;
  line-height: 1;
}
.btn svg { width: 16px; height: 16px; }
.btn-primary {
  background: linear-gradient(180deg, var(--ember-light), var(--ember) 60%, var(--ember-deep));
  color: #fff;
  box-shadow: 0 14px 30px -12px rgba(242, 74, 23, 0.7), inset 0 1px 0 rgba(255, 255, 255, 0.25);
}
.btn-primary:hover { transform: translateY(-2px); box-shadow: 0 20px 40px -14px rgba(242, 74, 23, 0.8), inset 0 1px 0 rgba(255, 255, 255, 0.3); }
.btn-ghost {
  background: color-mix(in srgb, var(--panel) 70%, transparent);
  border-color: var(--line-strong); color: var(--ink-hi);
}
.btn-ghost:hover { border-color: var(--metal-mid); background: var(--panel-2); }
.btn:disabled, .btn[aria-disabled="true"] {
  opacity: 0.55; cursor: not-allowed; pointer-events: none;
  background: var(--panel); color: var(--ink-mid); border-color: var(--line);
  box-shadow: none;
}
.btn-block { width: 100%; }

.chip {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.14em;
  text-transform: uppercase; font-weight: 600;
  padding: 7px 13px; border-radius: 999px;
  border: 1px solid var(--line-strong); color: var(--ink-mid);
  background: color-mix(in srgb, var(--panel) 60%, transparent);
}
.chip .dot { width: 7px; height: 7px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 10px var(--ember); }
.eyebrow {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.24em;
  text-transform: uppercase; color: var(--ember-light); font-weight: 600;
}

/* ================= HERO ================= */
.hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(120% 90% at 15% -10%, color-mix(in srgb, var(--field-b) 55%, transparent), transparent 60%),
    radial-gradient(90% 80% at 92% 0%, rgba(242, 74, 23, 0.14), transparent 55%);
}
.hero-inner { position: relative; z-index: 2; padding: clamp(56px, 9vw, 108px) 0 clamp(40px, 6vw, 72px); }
.hero-grid { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(28px, 5vw, 64px); align-items: center; }
@media (max-width: 940px) { .hero-grid { grid-template-columns: 1fr; } }

.hero h1 {
  font-size: clamp(2.5rem, 6.4vw, 5rem);
  line-height: 0.98; letter-spacing: -0.03em; margin-top: 22px;
  font-weight: 700;
}
.hero h1 .accent {
  background: linear-gradient(100deg, var(--ember-light), var(--ember));
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero p.lede {
  margin-top: 22px; max-width: 40ch; font-size: clamp(1rem, 1.6vw, 1.2rem);
  color: var(--ink-mid); line-height: 1.6;
}
.hero-cta { margin-top: 34px; display: flex; flex-wrap: wrap; gap: 14px; }
.hero-meta {
  margin-top: 30px; display: flex; flex-wrap: wrap; gap: 10px 22px;
  font-family: var(--mono); font-size: 12.5px; color: var(--ink-low);
  letter-spacing: 0.04em;
}
.hero-meta b { color: var(--ink-mid); font-weight: 600; }

/* Hero scope panel — a live-ish spectrum/waveform "instrument" */
.scope {
  position: relative; border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--panel-2), var(--ground-2));
  box-shadow: var(--shadow); overflow: hidden; min-height: 300px;
}
.scope-head {
  display: flex; align-items: center; gap: 10px; padding: 14px 18px;
  border-bottom: 1px solid var(--line); font-family: var(--mono);
  font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-low);
}
.scope-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--ember); box-shadow: 0 0 10px var(--ember); }
.scope-head span:last-child { margin-left: auto; color: var(--ink-mid); }
.scope canvas { display: block; width: 100%; height: 260px; }

/* ================= SECTION SCAFFOLD ================= */
.section { position: relative; padding: clamp(52px, 8vw, 96px) 0; border-bottom: 1px solid var(--line); }
.section-head { max-width: 62ch; }
.section-head h2 {
  font-size: clamp(1.8rem, 4vw, 3rem); line-height: 1.05; letter-spacing: -0.02em; margin-top: 16px;
}
.section-head p { margin-top: 16px; color: var(--ink-mid); font-size: 1.02rem; }
.section-head p .hi { color: var(--ink-hi); }
.section-note { margin-top: 12px; font-size: 13px; color: var(--ink-low); }
.mono-brand { font-family: var(--mono); color: var(--ember-light); }

/* ================= LEARNING PATH (signature) ================= */
.path-wrap {
  position: relative; margin-top: 44px; border: 1px solid var(--line-strong);
  border-radius: var(--radius-lg); background: linear-gradient(180deg, var(--panel), var(--ground-2));
  box-shadow: var(--shadow); overflow: hidden;
  padding: clamp(24px, 4vw, 52px) clamp(18px, 3vw, 40px) clamp(28px, 4vw, 44px);
}
.path-wrap .grid-field {
  mask-image: none; -webkit-mask-image: none; opacity: 0.5;
  background-size: 38px 38px;
}
.path-canvas { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 1; pointer-events: none; }
.path-track {
  position: relative; z-index: 2; display: grid; gap: 30px 18px;
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 900px) { .path-track { grid-template-columns: 1fr; gap: 14px; } }

.path-stage { display: flex; flex-direction: column; align-items: center; text-align: center; }
.path-stage-label {
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--ink-low); margin-bottom: 14px;
}
.path-stage-label b { color: var(--ember-light); font-weight: 600; }

/* course pips leading into a badge */
.pips { display: flex; align-items: center; justify-content: center; gap: 10px; margin-bottom: 16px; flex-wrap: wrap; }
.pip {
  position: relative; width: 46px; height: 46px; border-radius: 12px; overflow: hidden;
  border: 1px solid var(--line-strong); background: var(--ground-2);
  box-shadow: 0 10px 22px -14px rgba(0, 0, 0, 0.9); transition: transform 0.18s, border-color 0.18s;
}
.pip img { width: 100%; height: 100%; object-fit: cover; }
a.pip:hover { transform: translateY(-3px); border-color: color-mix(in srgb, var(--ember) 55%, transparent); }
.pip.locked { filter: grayscale(0.7); opacity: 0.55; }
.pip .pip-num {
  position: absolute; left: 3px; top: 3px; font-family: var(--mono); font-size: 9px; font-weight: 700;
  background: var(--ember); color: #fff; border-radius: 5px; padding: 1px 4px; line-height: 1.2;
}
.pip .pip-check {
  position: absolute; right: 2px; bottom: 2px; width: 15px; height: 15px; border-radius: 50%;
  background: var(--pass); color: #04150d; display: none; align-items: center; justify-content: center;
}
.pip.passed .pip-check { display: flex; }
.pip .pip-check svg { width: 10px; height: 10px; }

/* badge medallion in path */
.medallion { position: relative; }
.medallion .halo {
  position: absolute; inset: -14px; border-radius: 50%; z-index: -1;
  background: radial-gradient(circle, var(--ember-glow), transparent 68%);
  opacity: 0; transition: opacity 0.4s;
}
.medallion.available .halo { opacity: 1; animation: haloPulse 3.4s ease-in-out infinite; }
.medallion.earned .halo { opacity: 1; }
@keyframes haloPulse { 0%, 100% { transform: scale(0.94); opacity: 0.55; } 50% { transform: scale(1.06); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .medallion.available .halo { animation: none; } }
.medallion img { width: clamp(104px, 13vw, 130px); height: auto; filter: drop-shadow(0 16px 34px rgba(0, 0, 0, 0.5)); }
.medallion.locked img { opacity: 0.85; }

.path-badge-name { margin-top: 14px; font-size: 1.05rem; font-weight: 700; }
.path-badge-state {
  margin-top: 8px; display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.12em; text-transform: uppercase;
  padding: 5px 11px; border-radius: 999px; font-weight: 600;
}
.state-locked { border: 1px solid var(--line-strong); color: var(--ink-mid); background: color-mix(in srgb, var(--panel) 60%, transparent); }
.state-available { background: var(--ember); color: #fff; }
.state-earned { background: var(--pass-dim); color: var(--pass); border: 1px solid color-mix(in srgb, var(--pass) 40%, transparent); }
.path-badge-state svg { width: 11px; height: 11px; }

.path-foot {
  position: relative; z-index: 2; margin-top: 36px; padding-top: 24px; border-top: 1px solid var(--line);
  display: flex; flex-wrap: wrap; gap: 16px; align-items: center; justify-content: space-between;
}
.path-foot p { margin: 0; font-size: 13px; color: var(--ink-low); }

/* ================= CATALOG ================= */
.track { margin-top: clamp(38px, 6vw, 64px); }
.track:first-of-type { margin-top: 44px; }
.track-head {
  display: flex; align-items: flex-end; gap: 18px 24px; flex-wrap: wrap;
  padding-bottom: 18px; border-bottom: 1px solid var(--line-strong);
}
.track-index {
  font-family: var(--mono); font-size: 12px; letter-spacing: 0.18em; color: var(--ink-low);
  text-transform: uppercase;
}
.track-head h3 { font-size: clamp(1.35rem, 3vw, 2rem); letter-spacing: -0.01em; }
.track-emblem { width: 40px; height: 40px; flex: none; }
.track-emblem.locked { opacity: 0.7; }
.track-title-group { display: flex; align-items: center; gap: 14px; }
.track-status { margin-left: auto; display: flex; align-items: center; gap: 12px; }
.track-count { font-size: 13px; color: var(--ink-low); font-family: var(--mono); }

/* badge-exam CTA (revealed only when a track's courses are all passed) */
.badge-exam-cta {
  display: none; margin-top: 22px; align-items: center; gap: 18px; flex-wrap: wrap;
  padding: 18px 22px; border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--ember) 45%, transparent);
  background: linear-gradient(120deg, color-mix(in srgb, var(--ember) 14%, transparent), transparent);
}
.badge-exam-cta.show { display: flex; }
.badge-exam-cta .txt { flex: 1 1 260px; }
.badge-exam-cta .txt strong { display: block; font-family: var(--display); font-size: 1.05rem; }
.badge-exam-cta .txt span { font-size: 13px; color: var(--ink-mid); }

.cards { margin-top: 26px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 22px; }
@media (max-width: 900px) { .cards { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 600px) { .cards { grid-template-columns: 1fr; } }

.card {
  display: flex; flex-direction: column; border: 1px solid var(--line);
  border-radius: var(--radius); overflow: hidden; background: var(--panel);
  transition: transform 0.2s, border-color 0.2s, box-shadow 0.2s;
  position: relative;
}
.card.live:hover { transform: translateY(-4px); border-color: color-mix(in srgb, var(--ember) 50%, transparent); box-shadow: 0 26px 50px -30px rgba(0, 0, 0, 0.75); }
.card-media { position: relative; aspect-ratio: 16 / 10; overflow: hidden; background: var(--ground-2); }
.card-media img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s; }
.card.live:hover .card-media img { transform: scale(1.05); }

/* placeholder art for "soon" courses — a machined spectrum plate */
.card-plate {
  position: absolute; inset: 0;
  background:
    radial-gradient(120% 90% at 50% 0%, var(--field-b), var(--ground-2) 70%);
  display: flex; align-items: center; justify-content: center;
}
.card-plate::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 26px 100%; opacity: 0.4;
  mask-image: linear-gradient(0deg, transparent, #000);
  -webkit-mask-image: linear-gradient(0deg, transparent, #000);
}
.card-plate svg { width: 62px; height: 62px; opacity: 0.55; position: relative; }

.card-flag {
  position: absolute; left: 12px; top: 12px; z-index: 3;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700;
  padding: 6px 11px; border-radius: 999px;
}
.flag-free { background: var(--ember); color: #fff; box-shadow: 0 8px 20px -8px rgba(242, 74, 23, 0.85); }
.flag-soon { background: color-mix(in srgb, var(--ground) 78%, transparent); color: var(--ink-mid); border: 1px solid var(--line-strong); backdrop-filter: blur(6px); }
.card-flag svg { width: 11px; height: 11px; }

.card-body { display: flex; flex-direction: column; flex: 1; padding: 20px; gap: 12px; }
.card-body h4 { font-size: 1.12rem; line-height: 1.25; letter-spacing: -0.01em; }
.card.live:hover h4 { color: var(--ink-hi); }
.card-body p { margin: 0; font-size: 13.5px; color: var(--ink-mid); line-height: 1.55; flex: 1; }
.card-foot {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding-top: 14px; margin-top: 4px; border-top: 1px solid var(--line);
}
.card-meta { font-family: var(--mono); font-size: 11px; color: var(--ink-low); letter-spacing: 0.04em; }

/* state chip driven by progress.js */
.state-chip {
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; font-weight: 600;
  padding: 5px 10px; border-radius: 999px; border: 1px solid var(--line-strong); color: var(--ink-low);
}
.state-chip svg { width: 11px; height: 11px; }
.state-chip.is-progress { color: var(--ember-light); border-color: color-mix(in srgb, var(--ember) 40%, transparent); }
.state-chip.is-passed { color: var(--pass); border-color: color-mix(in srgb, var(--pass) 40%, transparent); background: var(--pass-dim); }
.state-chip.is-soon { color: var(--ink-low); }

.card-start {
  display: inline-flex; align-items: center; gap: 7px; font-family: var(--display);
  font-weight: 600; font-size: 13.5px; color: var(--ember-light);
}
.card-start svg { width: 14px; height: 14px; transition: transform 0.18s; }
.card.live:hover .card-start svg { transform: translateX(3px); }
.card-start.disabled { color: var(--ink-low); }

/* whole-card link overlay for launched courses */
.card-link { position: absolute; inset: 0; z-index: 2; }

/* ================= FRAMING / NOT-ISO band ================= */
.framing {
  display: grid; grid-template-columns: 1.1fr 0.9fr; gap: clamp(26px, 5vw, 60px); align-items: center;
}
@media (max-width: 860px) { .framing { grid-template-columns: 1fr; } }
.framing .lead { font-size: clamp(1.5rem, 3vw, 2.1rem); line-height: 1.15; letter-spacing: -0.02em; font-family: var(--display); font-weight: 700; }
.framing .lead .hi { color: var(--ember-light); }
.callout {
  border: 1px solid var(--line-strong); border-radius: var(--radius); padding: 24px;
  background: linear-gradient(160deg, var(--panel-2), var(--ground-2));
}
.callout h4 { display: flex; align-items: center; gap: 10px; font-size: 0.95rem; letter-spacing: 0.02em; }
.callout h4 svg { width: 18px; height: 18px; color: var(--ember); flex: none; }
.callout p { margin: 12px 0 0; font-size: 14px; color: var(--ink-mid); line-height: 1.6; }
.callout .divider { height: 1px; background: var(--line); margin: 18px 0; }
.callout .fine { font-size: 12.5px; color: var(--ink-low); }

/* ================= BADGES PAGE ================= */
.badge-ladder { display: grid; gap: 26px; margin-top: 44px; }
.rung {
  position: relative; display: grid; grid-template-columns: 220px 1fr; gap: clamp(22px, 4vw, 48px);
  align-items: center; border: 1px solid var(--line); border-radius: var(--radius-lg);
  background: var(--panel); padding: clamp(24px, 4vw, 40px); overflow: hidden;
}
.rung.available { border-color: color-mix(in srgb, var(--ember) 40%, transparent); box-shadow: 0 30px 70px -46px rgba(242, 74, 23, 0.55); }
.rung.earned { border-color: color-mix(in srgb, var(--pass) 38%, transparent); }
@media (max-width: 760px) { .rung { grid-template-columns: 1fr; text-align: center; } }
.rung-emblem { display: flex; flex-direction: column; align-items: center; gap: 16px; }
.rung-emblem img { width: 100%; max-width: 190px; filter: drop-shadow(0 20px 44px rgba(0, 0, 0, 0.5)); }
.rung-emblem.locked img { opacity: 0.85; }
.rung-num {
  position: absolute; top: 20px; right: 24px; font-family: var(--mono); font-size: 12px;
  letter-spacing: 0.14em; color: var(--ink-low);
}
.rung h3 { font-size: clamp(1.4rem, 3vw, 2rem); letter-spacing: -0.01em; }
.rung .tagline { margin-top: 8px; color: var(--ink-mid); font-size: 1rem; }
.prereq-line {
  margin-top: 16px; display: inline-flex; align-items: center; gap: 9px; font-size: 13px;
  font-family: var(--mono); color: var(--ink-mid); padding: 8px 14px; border-radius: 999px;
  border: 1px solid var(--line-strong); background: color-mix(in srgb, var(--panel-2) 70%, transparent);
}
.prereq-line svg { width: 13px; height: 13px; color: var(--ember); }
.course-chain { margin-top: 22px; display: flex; flex-direction: column; gap: 2px; }
.chain-item {
  display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line);
}
.chain-item:first-child { border-top: none; }
.chain-node {
  width: 26px; height: 26px; flex: none; border-radius: 8px; border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 11px;
  color: var(--ink-low); background: var(--ground-2);
}
.chain-item.passed .chain-node { background: var(--pass-dim); border-color: color-mix(in srgb, var(--pass) 45%, transparent); color: var(--pass); }
.chain-node svg { width: 13px; height: 13px; }
.chain-item .chain-name { font-weight: 600; font-size: 15px; }
.chain-item.soon .chain-name { color: var(--ink-mid); }
.chain-mini { margin-left: auto; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-low); }
.chain-item a.chain-name:hover { color: var(--ember-light); }
.rung-cta { margin-top: 26px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* how-to & cert-vs-badge explainer */
.explain { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin-top: 44px; }
@media (max-width: 760px) { .explain { grid-template-columns: 1fr; } }
.explain-card { border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel); padding: 26px; }
.explain-card .ic {
  width: 44px; height: 44px; border-radius: 12px; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--ember) 14%, transparent); color: var(--ember); margin-bottom: 16px;
}
.explain-card.badge .ic { background: var(--pass-dim); color: var(--pass); }
.explain-card .ic svg { width: 22px; height: 22px; }
.explain-card h4 { font-size: 1.15rem; }
.explain-card p { margin: 10px 0 0; font-size: 14px; color: var(--ink-mid); line-height: 1.6; }

.steps { counter-reset: step; margin-top: 44px; display: grid; grid-template-columns: repeat(4, 1fr); gap: 18px; }
@media (max-width: 880px) { .steps { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 480px) { .steps { grid-template-columns: 1fr; } }
.step { position: relative; border: 1px solid var(--line); border-radius: var(--radius); padding: 24px 20px; background: var(--panel); }
.step::before {
  counter-increment: step; content: counter(step, decimal-leading-zero);
  font-family: var(--mono); font-size: 12px; color: var(--ember); letter-spacing: 0.1em;
}
.step h4 { margin-top: 12px; font-size: 1.02rem; }
.step p { margin-top: 8px; font-size: 13.5px; color: var(--ink-mid); line-height: 1.55; }

/* ================= COURSE PLACEHOLDER / MISSING ================= */
.player-shell { min-height: 100vh; display: flex; flex-direction: column; }
.player-back {
  position: fixed; left: 18px; top: 18px; z-index: 20;
  display: inline-flex; align-items: center; gap: 8px; font-size: 13px; font-weight: 600;
  padding: 9px 15px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--ground) 82%, transparent); backdrop-filter: blur(10px);
  color: var(--ink-mid);
}
.player-back:hover { color: var(--ink-hi); border-color: var(--metal-mid); }
.player-back svg { width: 14px; height: 14px; }
.player-stage {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  text-align: center; padding: 80px 24px; position: relative; overflow: hidden;
}
.player-stage .badge-emblem { width: 150px; margin-bottom: 30px; filter: drop-shadow(0 20px 40px rgba(0,0,0,0.5)); }
.player-stage h1 { font-size: clamp(1.8rem, 5vw, 3rem); letter-spacing: -0.02em; }
.player-stage .tag { font-family: var(--mono); color: var(--ember-light); letter-spacing: 0.2em; text-transform: uppercase; font-size: 12px; margin-bottom: 18px; }
.player-stage p { margin-top: 18px; max-width: 52ch; color: var(--ink-mid); }
.player-stage .cta-row { margin-top: 32px; display: flex; gap: 14px; flex-wrap: wrap; justify-content: center; }
.player-note { margin-top: 26px; font-family: var(--mono); font-size: 12px; color: var(--ink-low); }

/* ================= FOOTER ================= */
.footer { position: relative; background: var(--ground-2); border-top: 1px solid var(--line); }
.footer-inner { padding: clamp(40px, 6vw, 64px) 0 40px; display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 36px; }
@media (max-width: 760px) { .footer-inner { grid-template-columns: 1fr; gap: 28px; } }
.footer-logo img { height: 26px; margin-bottom: 18px; }
@media (prefers-color-scheme: light) { :root:not([data-theme="dark"]) .footer-logo img { filter: brightness(0.15); } }
:root[data-theme="light"] .footer-logo img { filter: brightness(0.15); }
.footer p { color: var(--ink-low); font-size: 13.5px; max-width: 38ch; }
.footer h5 { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-low); margin: 0 0 14px; }
.footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 10px; }
.footer ul a { font-size: 14px; color: var(--ink-mid); }
.footer ul a:hover { color: var(--ember-light); }
.footer-bottom {
  border-top: 1px solid var(--line); padding: 20px 0; display: flex; flex-wrap: wrap; gap: 12px;
  align-items: center; justify-content: space-between; font-size: 12.5px; color: var(--ink-low);
}
.footer-bottom .mono { font-family: var(--mono); }

/* ================= COURSE DETAIL PAGE ================= */
/* generic card hover for navigable (soon) cards; live keeps its stronger lift */
.card:hover { border-color: var(--line-strong); }

.crumbs {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 12px; color: var(--ink-low); letter-spacing: 0.04em;
  margin-bottom: 20px;
}
.crumbs a { color: var(--ink-mid); }
.crumbs a:hover { color: var(--ember-light); }
.crumbs .sep { color: var(--ink-low); opacity: 0.6; }

.course-hero { position: relative; overflow: hidden; border-bottom: 1px solid var(--line); }
.course-hero::before {
  content: ""; position: absolute; inset: 0; z-index: 0;
  background:
    radial-gradient(115% 90% at 12% -10%, color-mix(in srgb, var(--field-b) 50%, transparent), transparent 58%),
    radial-gradient(80% 80% at 96% 0%, rgba(242, 74, 23, 0.13), transparent 55%);
}
.course-hero-inner { position: relative; z-index: 2; padding: clamp(30px, 5vw, 56px) 0 clamp(40px, 6vw, 68px); }
.course-hero-grid { display: grid; grid-template-columns: 1.08fr 0.92fr; gap: clamp(28px, 5vw, 56px); align-items: center; }
@media (max-width: 940px) { .course-hero-grid { grid-template-columns: 1fr; } }

.course-hero h1 {
  font-size: clamp(2rem, 4.6vw, 3.4rem); line-height: 1.03; letter-spacing: -0.025em; margin-top: 16px;
}
.course-hero .lede { margin-top: 18px; max-width: 46ch; font-size: clamp(1rem, 1.5vw, 1.18rem); color: var(--ink-mid); }
.course-meta {
  margin-top: 24px; display: flex; flex-wrap: wrap; gap: 10px;
}
.course-meta .m {
  display: inline-flex; align-items: center; gap: 7px;
  font-family: var(--mono); font-size: 11.5px; letter-spacing: 0.06em; color: var(--ink-mid);
  padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: color-mix(in srgb, var(--panel) 55%, transparent);
}
.course-meta .m svg { width: 13px; height: 13px; color: var(--ember-light); }
.course-cta { margin-top: 28px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }
.start-note { margin-top: 14px; font-family: var(--mono); font-size: 12px; color: var(--ink-low); letter-spacing: 0.02em; }

/* hero art — cover (launched) or machined "locked" plate (soon) */
.course-art {
  position: relative; border: 1px solid var(--line-strong); border-radius: var(--radius-lg);
  overflow: hidden; background: var(--ground-2); box-shadow: var(--shadow); aspect-ratio: 16 / 11;
}
.course-art img { width: 100%; height: 100%; object-fit: cover; }
.course-art.soon {
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px;
  background: radial-gradient(120% 90% at 50% 0%, var(--field-b), var(--ground-2) 72%);
  text-align: center; padding: 30px;
}
.course-art.soon::after {
  content: ""; position: absolute; inset: 0;
  background-image: linear-gradient(90deg, var(--line) 1px, transparent 1px);
  background-size: 30px 100%; opacity: 0.4;
  mask-image: linear-gradient(0deg, transparent, #000); -webkit-mask-image: linear-gradient(0deg, transparent, #000);
}
.course-art.soon img { width: clamp(96px, 16vw, 130px); height: auto; position: relative; z-index: 1; opacity: 0.9; }
.course-art .ribbon {
  position: relative; z-index: 1;
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 11px; letter-spacing: 0.12em; text-transform: uppercase; font-weight: 700;
  padding: 8px 15px; border-radius: 999px;
  background: color-mix(in srgb, var(--ground) 72%, transparent); color: var(--ink-mid);
  border: 1px solid var(--line-strong); backdrop-filter: blur(6px);
}
.course-art .ribbon svg { width: 12px; height: 12px; }
.course-art .flag-free {
  position: absolute; left: 14px; top: 14px; z-index: 3;
  display: inline-flex; align-items: center; gap: 6px;
  font-family: var(--mono); font-size: 10px; letter-spacing: 0.1em; text-transform: uppercase; font-weight: 700;
  padding: 6px 11px; border-radius: 999px; background: var(--ember); color: #fff;
  box-shadow: 0 8px 20px -8px rgba(242, 74, 23, 0.85);
}
.course-art .flag-free svg { width: 11px; height: 11px; }

/* outcomes */
.outcome-grid { margin-top: 34px; display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
@media (max-width: 720px) { .outcome-grid { grid-template-columns: 1fr; } }
.outcome {
  display: flex; gap: 14px; align-items: flex-start; padding: 18px 20px;
  border: 1px solid var(--line); border-radius: var(--radius); background: var(--panel);
}
.outcome .tick {
  flex: none; width: 26px; height: 26px; border-radius: 8px; display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--ember) 15%, transparent); color: var(--ember);
}
.outcome .tick svg { width: 15px; height: 15px; }
.outcome p { margin: 0; font-size: 14.5px; color: var(--ink-mid); line-height: 1.5; }
.outcome p b { color: var(--ink-hi); font-weight: 600; }

/* SIGNATURE — the syllabus as a measurement chain / signal rail */
.syllabus { position: relative; }
.syllabus-list { position: relative; margin-top: 34px; }
.syllabus-list::before {
  content: ""; position: absolute; left: 21px; top: 26px; bottom: 26px; width: 2px;
  background: linear-gradient(180deg, var(--ember), var(--ember-deep) 42%, var(--metal-low));
  opacity: 0.5; border-radius: 2px;
}
.lesson {
  position: relative; display: grid; grid-template-columns: 44px 1fr; gap: 20px; align-items: baseline;
  padding: 15px 0; border-top: 1px solid var(--line);
}
.lesson:first-child { border-top: none; }
.lesson-num {
  position: relative; z-index: 1; width: 44px; height: 44px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--mono); font-size: 13px; font-weight: 700; color: var(--ember-light);
  background: var(--panel); border: 1px solid color-mix(in srgb, var(--ember) 35%, transparent);
  box-shadow: 0 0 0 4px var(--ground);
}
.lesson-body { padding-top: 4px; }
.lesson-kick {
  font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-low);
}
.lesson-title { margin-top: 4px; font-family: var(--display); font-weight: 600; font-size: clamp(1rem, 1.6vw, 1.14rem); line-height: 1.3; letter-spacing: -0.01em; }
.syllabus-foot {
  margin-top: 26px; display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-family: var(--mono); font-size: 12px; color: var(--ink-low);
  padding: 14px 18px; border: 1px dashed var(--line-strong); border-radius: var(--radius);
}
.syllabus-foot svg { width: 15px; height: 15px; color: var(--ember); flex: none; }

/* track + prerequisite panel */
.course-track { display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(24px, 4vw, 44px); align-items: start; }
@media (max-width: 860px) { .course-track { grid-template-columns: 1fr; } }
.track-card {
  border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--panel);
  padding: clamp(22px, 3vw, 32px);
}
.track-card .track-emblem-row { display: flex; align-items: center; gap: 16px; }
.track-card .track-emblem-row img { width: 56px; height: 56px; flex: none; }
.track-card .track-emblem-row.locked img { opacity: 0.7; }
.track-card h3 { font-size: 1.3rem; letter-spacing: -0.01em; }
.track-card .track-kicker { font-family: var(--mono); font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-low); }
.prereq-chain { margin-top: 22px; display: flex; flex-direction: column; gap: 2px; }
.prereq-step { display: flex; align-items: center; gap: 12px; padding: 11px 0; border-top: 1px solid var(--line); font-size: 14.5px; }
.prereq-step:first-child { border-top: none; }
.prereq-step .n {
  width: 24px; height: 24px; flex: none; border-radius: 7px; border: 1px solid var(--line-strong);
  display: flex; align-items: center; justify-content: center; font-family: var(--mono); font-size: 11px; color: var(--ink-low);
  background: var(--ground-2);
}
.prereq-step.here .n { background: var(--ember); border-color: var(--ember); color: #fff; }
.prereq-step.here { color: var(--ink-hi); font-weight: 600; }
.prereq-step .mini { margin-left: auto; font-family: var(--mono); font-size: 10.5px; letter-spacing: 0.08em; text-transform: uppercase; color: var(--ink-low); }

/* reveal-on-load (respect reduced motion) */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.7s ease, transform 0.7s ease; }
.reveal.in { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) { .reveal { opacity: 1; transform: none; transition: none; } }
