/* ─────────────────────────────────────────
   MACALINAO STUDIO · AI LEARNING COURSE
   Built on macalinao.com V6 design tokens
   Warm paper · Charcoal ink · Signal orange
   ───────────────────────────────────────── */

@import url('https://fonts.googleapis.com/css2?family=Manrope:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600&family=JetBrains+Mono:wght@400;500;600&display=swap');

:root {
  /* V6 tokens — kept verbatim so the course slots into the parent site */
  --paper:   #ebe7dd;
  --paper-2: #e3dfd4;
  --paper-3: #d8d3c6;
  --ink:     #0e0e0c;
  --ink-2:   #5a574f;
  --ink-3:   #908b7f;
  --ink-4:   #b9b4a8;
  --line:    rgba(14,14,12,.10);
  --line-2:  rgba(14,14,12,.20);
  --dark:    #14130f;
  --dark-2:  #1d1c17;
  --accent:  #ff4d00;
  --accent-2:#cc3d00;
  --ok:      #2e8b57;
  --warn:    #d97706;

  /* Course-specific accents (used only inside lesson visuals) */
  --gemini:  #378ADD;
  --sonnet:  #BA7517;
  --teal:    #1D9E75;
  --purple:  #7F77DD;

  --display: 'Manrope', system-ui, sans-serif;
  --text:    'Inter', system-ui, sans-serif;
  --mono:    'JetBrains Mono', 'SF Mono', Consolas, monospace;
  --ease:    cubic-bezier(.22,.8,.1,1);
  --ease-2:  cubic-bezier(.76,0,.24,1);

  --pad-x:   40px;
  --pad-y:   100px;
  --max-w:   1440px;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; font-size: 16px; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: var(--text);
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  cursor: none;
  font-weight: 400;
}
a { color: inherit; text-decoration: none; }
button { font-family: inherit; background: none; border: 0; cursor: none; color: inherit; }
img, svg { display: block; max-width: 100%; }
ul { list-style: none; }
::selection { background: var(--accent); color: var(--paper); }

/* Fall back to a normal cursor on touch devices where the custom cursor is hidden */
@media (hover: none) {
  body, button, a { cursor: auto; }
}

/* ── PAPER GRAIN (matches V6) ── */
body::before {
  content: '';
  position: fixed; inset: 0;
  pointer-events: none; z-index: 1;
  background-image: radial-gradient(rgba(14,14,12,.025) 1px, transparent 1px);
  background-size: 3px 3px;
  mix-blend-mode: multiply;
  opacity: .5;
}

/* ── CUSTOM CURSOR (matches V6) ── */
.cursor {
  position: fixed;
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--ink);
  pointer-events: none;
  z-index: 9999;
  transform: translate(-50%, -50%);
  transition: width .25s var(--ease), height .25s var(--ease),
              background .25s, opacity .2s, mix-blend-mode 0s;
  mix-blend-mode: multiply;
}
.cursor.big { width: 56px; height: 56px; background: var(--accent); mix-blend-mode: normal; opacity: .85; }
.cursor.dark { background: var(--paper); mix-blend-mode: difference; }
@media (hover: none) { .cursor { display: none; } }

/* ── REUSABLE LABEL (matches V6) ── */
.lbl, .meta {
  font-family: var(--mono);
  font-size: 11px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3);
}

/* ═══════════════════════════════════════════
   NAV (matches V6)
═══════════════════════════════════════════ */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 200;
  display: grid; grid-template-columns: 1fr auto 1fr;
  align-items: center;
  height: 64px; padding: 0 var(--pad-x);
  border-bottom: 1px solid transparent;
  transition: background .35s var(--ease), border-color .35s, backdrop-filter .35s;
}
.nav.scrolled {
  background: rgba(235,231,221,.85);
  backdrop-filter: blur(14px) saturate(120%);
  border-color: var(--line);
}
.nav-brand {
  justify-self: start;
  display: flex; align-items: center; gap: 12px;
  font-family: var(--display);
  font-size: 14px; font-weight: 700;
  letter-spacing: -.005em;
}
.nav-brand strong { font-weight: 800; }
.nav-brand .crumb {
  display: inline-flex; align-items: center; gap: 8px;
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3);
}
.nav-brand .crumb::before {
  content: '/'; color: var(--ink-4);
}
.nav-links {
  display: flex; gap: 28px;
  justify-self: center;
  font-family: var(--mono);
  font-size: 11px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-2);
}
.nav-links a { transition: color .2s; position: relative; padding: 4px 0; }
.nav-links a::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: 0;
  height: 1px; background: var(--accent);
  transform: scaleX(0); transform-origin: left;
  transition: transform .35s var(--ease);
}
.nav-links a:hover { color: var(--ink); }
.nav-links a:hover::after { transform: scaleX(1); }
.nav-right { justify-self: end; display: flex; gap: 12px; }
.nav-cta {
  font-family: var(--mono);
  font-size: 11px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  padding: 9px 16px;
  border: 1px solid var(--ink);
  background: var(--ink);
  color: var(--paper);
  transition: background .2s, color .2s;
}
.nav-cta:hover { background: var(--accent); border-color: var(--accent); color: var(--ink); }

/* ═══════════════════════════════════════════
   HERO (course landing variant)
═══════════════════════════════════════════ */
.hero {
  min-height: 92svh;
  padding: 140px var(--pad-x) 60px;
  display: flex; flex-direction: column;
  justify-content: flex-end;
  border-bottom: 1px solid var(--line);
  position: relative;
  z-index: 2;
}
.hero-eyebrow {
  display: flex; align-items: center; gap: 14px;
  margin-bottom: 36px;
  font-family: var(--mono);
  font-size: 11px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3);
  flex-wrap: wrap;
}
.hero-eyebrow .sep { width: 24px; height: 1px; background: var(--line-2); }
.hero-eyebrow .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--accent); display: inline-block; }
.hero-title {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(54px, 9vw, 144px);
  letter-spacing: -.045em; line-height: .92;
  margin-bottom: 56px;
  position: relative;
}
.hero-title em { font-style: italic; font-weight: 300; color: var(--accent); }
.hero-title .light { font-weight: 300; color: var(--ink-2); }
.hero-meta {
  display: grid; grid-template-columns: repeat(4, 1fr);
  gap: 32px; padding-top: 32px;
  border-top: 1px solid var(--line);
}
.hero-meta-col .l {
  font-family: var(--mono); font-size: 10px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3); margin-bottom: 10px;
}
.hero-meta-col .v { font-size: 14px; line-height: 1.55; color: var(--ink); }

/* ═══════════════════════════════════════════
   SECTION SCAFFOLD
═══════════════════════════════════════════ */
.sec {
  padding: var(--pad-y) var(--pad-x);
  position: relative; z-index: 2;
  border-bottom: 1px solid var(--line);
}
.sec.dark { background: var(--dark); color: var(--paper); border-color: rgba(235,231,221,.08); }
.sec.dark .lbl, .sec.dark .meta { color: rgba(235,231,221,.4); }
.sec.dark .sec-head .num-block .num { color: var(--accent); }
.sec.dark .sec-head .num-block .scope { color: rgba(235,231,221,.5); }
.sec.dark .sec-head h2 { color: var(--paper); }

.sec-head {
  display: grid; grid-template-columns: 220px 1fr;
  gap: 60px; align-items: baseline;
  margin-bottom: 60px;
}
.sec-head .num-block { display: flex; flex-direction: column; gap: 6px; }
.sec-head .num-block .num {
  font-family: var(--mono); font-size: 11px; font-weight: 600;
  letter-spacing: .16em; color: var(--accent);
}
.sec-head .num-block .scope {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3);
}
.sec-head h2 {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(36px, 4.4vw, 60px);
  letter-spacing: -.03em; line-height: 1.04;
}
.sec-head h2 em { font-style: italic; font-weight: 300; color: var(--accent); }
.sec-head .sec-desc {
  font-size: 15px; line-height: 1.65;
  color: var(--ink-2);
  max-width: 540px;
  margin-top: 18px;
}

/* ═══════════════════════════════════════════
   MODULE GRID (course landing)
═══════════════════════════════════════════ */
.modules {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1px; background: var(--line);
  border: 1px solid var(--line);
}
.module {
  display: flex; flex-direction: column;
  background: var(--paper);
  padding: 28px 22px 22px;
  position: relative;
  cursor: none;
  transition: background .3s var(--ease);
  outline: none;
  min-height: 220px;
}
.module:hover { background: var(--paper-2); }
.module:focus-visible { background: var(--paper-2); box-shadow: inset 0 0 0 2px var(--accent); }
.module .m-num {
  font-family: var(--mono); font-size: 10px; font-weight: 600;
  letter-spacing: .16em; color: var(--accent);
  margin-bottom: 14px;
}
.module .m-name {
  font-family: var(--display); font-weight: 700;
  font-size: 22px; letter-spacing: -.02em;
  line-height: 1.15;
  margin-bottom: 10px;
}
.module .m-desc {
  font-size: 13.5px; line-height: 1.55;
  color: var(--ink-2);
  flex: 1;
}
.module .m-tags {
  display: flex; flex-wrap: wrap; gap: 4px;
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-2);
}
.module .m-tag {
  font-family: var(--mono);
  font-size: 9px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase;
  padding: 3px 8px;
  background: var(--paper-3);
  color: var(--ink-2);
  border-radius: 100px;
}
.module .m-tag.audio { background: rgba(255,77,0,.12); color: var(--accent-2); }
.module .m-tag.demo  { background: rgba(46,139,87,.12); color: var(--ok); }
.module .m-tag.video { background: rgba(217,119,6,.15); color: var(--warn); }
.module::after {
  content: '↗';
  position: absolute; top: 22px; right: 22px;
  font-family: var(--mono);
  color: var(--ink-3);
  font-size: 14px;
  transition: color .2s, transform .25s var(--ease);
}
.module:hover::after { color: var(--accent); transform: translate(2px, -2px); }

/* "Track" filter pills above the grid */
.track-bar {
  display: flex; flex-wrap: wrap; gap: 8px;
  margin-bottom: 32px;
}
.track-pill {
  font-family: var(--mono);
  font-size: 11px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  padding: 8px 14px;
  border: 1px solid var(--line-2);
  border-radius: 100px;
  color: var(--ink-2);
  background: transparent;
  transition: all .2s var(--ease);
}
.track-pill.on, .track-pill:hover {
  color: var(--paper);
  background: var(--ink);
  border-color: var(--ink);
}
.track-pill.on { background: var(--accent); border-color: var(--accent); color: var(--ink); }

/* ═══════════════════════════════════════════
   LESSON PAGE
═══════════════════════════════════════════ */
.lesson-hero {
  padding: 140px var(--pad-x) 60px;
  border-bottom: 1px solid var(--line);
  position: relative; z-index: 2;
}
.lesson-eyebrow {
  font-family: var(--mono);
  font-size: 11px; font-weight: 500;
  letter-spacing: .16em; text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 24px;
}
.lesson-eyebrow .accent { color: var(--accent); }
.lesson-title {
  font-family: var(--display); font-weight: 800;
  font-size: clamp(40px, 6vw, 84px);
  letter-spacing: -.035em; line-height: .98;
  margin-bottom: 24px;
  max-width: 18ch;
}
.lesson-title em { font-style: italic; font-weight: 300; color: var(--accent); }
.lesson-tagline {
  font-family: var(--text);
  font-size: 18px; line-height: 1.55;
  color: var(--ink-2);
  max-width: 60ch;
}
.lesson-meta {
  display: flex; flex-wrap: wrap; gap: 28px;
  margin-top: 40px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  font-family: var(--mono); font-size: 11px;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3);
}
.lesson-meta strong { color: var(--ink); font-weight: 600; margin-left: 8px; }

/* Body — long-form lesson content */
.lesson-body {
  padding: 80px var(--pad-x);
  max-width: 980px;
  margin: 0 auto;
}
.lesson-body section { margin-bottom: 72px; }
.lesson-body h2 {
  font-family: var(--display); font-weight: 700;
  font-size: clamp(28px, 3.2vw, 40px);
  letter-spacing: -.025em; line-height: 1.1;
  margin-bottom: 20px;
}
.lesson-body h2 em { font-style: italic; font-weight: 300; color: var(--accent); }
.lesson-body h3 {
  font-family: var(--display); font-weight: 600;
  font-size: 22px; letter-spacing: -.015em;
  margin: 32px 0 12px;
}
.lesson-body p { font-size: 16px; line-height: 1.7; color: var(--ink-2); margin-bottom: 14px; max-width: 64ch; }
.lesson-body p strong { color: var(--ink); font-weight: 600; }
.lesson-body p code, .lesson-body li code {
  font-family: var(--mono); font-size: 13px;
  background: var(--paper-3); color: var(--ink);
  padding: 1px 6px; border-radius: 3px;
}
.lesson-body ul:not(.tabs):not(.bare) { display: flex; flex-direction: column; gap: 8px; margin: 14px 0 24px; max-width: 64ch; }
.lesson-body ul:not(.tabs):not(.bare) li {
  font-size: 15.5px; line-height: 1.6; color: var(--ink-2);
  padding-left: 22px; position: relative;
}
.lesson-body ul:not(.tabs):not(.bare) li::before {
  content: '→';
  position: absolute; left: 0; top: 0;
  color: var(--accent);
  font-family: var(--mono); font-weight: 600;
}

/* Pull-out callout */
.callout {
  border-left: 3px solid var(--accent);
  background: var(--paper-2);
  padding: 20px 28px;
  margin: 28px 0;
  font-size: 16px; line-height: 1.7;
  color: var(--ink-2);
}
.callout strong { color: var(--ink); font-weight: 600; }
.callout .lbl { display: block; margin-bottom: 8px; color: var(--accent); }

/* Two-col card grid inside lesson body */
.l-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 16px;
  margin: 24px 0 32px;
}
.l-card {
  border: 1px solid var(--line);
  background: var(--paper);
  padding: 22px 22px;
}
.l-card .l-card-title {
  font-family: var(--display); font-weight: 700;
  font-size: 16px; letter-spacing: -.01em;
  margin-bottom: 8px;
}
.l-card .l-card-body {
  font-size: 14px; line-height: 1.6;
  color: var(--ink-2);
}
.l-card.accent { border-color: var(--accent); }
.l-card.accent .l-card-title { color: var(--accent); }

/* Audio narrator chip */
.audio-chip {
  display: inline-flex; align-items: center; gap: 10px;
  font-family: var(--mono);
  font-size: 11px; font-weight: 600;
  letter-spacing: .14em; text-transform: uppercase;
  padding: 8px 14px;
  background: var(--paper-2);
  border: 1px solid var(--line-2);
  border-radius: 100px;
  color: var(--ink-2);
  cursor: none;
  transition: all .2s var(--ease);
  margin: 6px 6px 6px 0;
}
.audio-chip:hover { color: var(--paper); background: var(--accent); border-color: var(--accent); }
.audio-chip .play { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); transition: background .2s; }
.audio-chip:hover .play { background: var(--paper); }
.audio-chip.playing .play { background: var(--ok); animation: pulse 1.4s ease-in-out infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .45; } }

/* Embedded illustration — uses paper-3 frame like V6 .p-art */
.illus-frame {
  width: 100%; aspect-ratio: 16/9;
  background: var(--paper-3);
  border: 1px solid var(--line);
  overflow: hidden;
  margin: 24px 0;
  position: relative;
}
.illus-frame.dark { background: var(--dark); }
.illus-frame > svg, .illus-frame > img, .illus-frame > video {
  width: 100%; height: 100%;
  display: block;
}
.illus-frame > video { object-fit: cover; }
.illus-cap {
  font-family: var(--mono); font-size: 11px; font-weight: 500;
  letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-3);
  margin: -16px 0 32px;
}

/* Demo iframe wrapper */
.demo-frame {
  width: 100%;
  border: 1px solid var(--line);
  background: var(--paper);
  margin: 24px 0;
  position: relative;
}
.demo-frame > iframe {
  width: 100%; min-height: 540px;
  border: 0; display: block;
}
.demo-frame .demo-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 12px 18px;
  background: var(--paper-2);
  border-bottom: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3);
}
.demo-frame .demo-header .open-btn {
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 4px 10px;
  border-radius: 100px;
  font-size: 9px;
}
.demo-frame .demo-header .open-btn:hover {
  background: var(--accent); color: var(--paper);
}

/* Lesson nav (prev / next at bottom) */
.lesson-pager {
  display: grid; grid-template-columns: 1fr 1fr;
  gap: 1px;
  background: var(--line);
  border-top: 1px solid var(--line);
}
.lesson-pager a {
  background: var(--paper);
  padding: 36px 28px;
  display: flex; flex-direction: column; gap: 8px;
  transition: background .2s;
}
.lesson-pager a:hover { background: var(--paper-2); }
.lesson-pager .l { font-family: var(--mono); font-size: 10px; letter-spacing: .16em; text-transform: uppercase; color: var(--ink-3); }
.lesson-pager .v { font-family: var(--display); font-weight: 700; font-size: 18px; letter-spacing: -.015em; }
.lesson-pager .v::before { content: '←  '; color: var(--accent); }
.lesson-pager a + a .v::before { content: ''; }
.lesson-pager a + a .v::after { content: '  →'; color: var(--accent); }
.lesson-pager a + a { text-align: right; }

/* Course progress thread (showed on lesson page hero) */
.thread {
  display: flex; gap: 4px; flex-wrap: wrap;
  margin-top: 24px;
}
.thread-tick {
  width: 12px; height: 4px;
  background: var(--line-2);
}
.thread-tick.done { background: var(--ink); }
.thread-tick.now { background: var(--accent); height: 6px; margin-top: -1px; }

/* ═══════════════════════════════════════════
   FOOTER
═══════════════════════════════════════════ */
footer {
  padding: 56px var(--pad-x);
  display: grid; grid-template-columns: 1fr auto 1fr auto auto;
  gap: 24px;
  border-top: 1px solid var(--line);
  font-family: var(--mono);
  font-size: 11px; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--ink-3);
  position: relative; z-index: 2;
}
footer span { display: inline-flex; align-items: center; }
footer span:nth-child(2)::before { content: '·'; color: var(--ink-4); margin-right: 24px; }
footer a { color: var(--ink-2); transition: color .2s; }
footer a:hover { color: var(--accent); }

/* Reveal-on-scroll (matches V6) */
.reveal { opacity: 0; transform: translateY(20px); transition: opacity .8s var(--ease), transform .8s var(--ease); }
.reveal.in { opacity: 1; transform: translateY(0); }
.reveal.d1 { transition-delay: .12s; }
.reveal.d2 { transition-delay: .22s; }
.reveal.d3 { transition-delay: .32s; }
.reveal.d4 { transition-delay: .42s; }

/* ═══════════════════════════════════════════
   FEATURED MODULES (editorial hero row)
═══════════════════════════════════════════ */
.featured {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-bottom: 1px;
}
.feat {
  background: var(--paper);
  padding: 28px 30px 26px;
  position: relative;
  cursor: none;
  transition: background .3s var(--ease);
  outline: none;
  display: flex; flex-direction: column;
  min-height: 320px;
  overflow: hidden;
}
.feat:hover { background: var(--paper-2); }
.feat:focus-visible { background: var(--paper-2); box-shadow: inset 0 0 0 2px var(--accent); }

.feat-w6 { grid-column: span 6; min-height: 380px; }
.feat-w4 { grid-column: s