/* Course pages (/<slug>/, built by tools/pages.mjs). No 3D world here: each hero shows its island poster.
   Same tokens, type scale (13, 15, 16, 18, 20, 24, h2, h1) and components as the home page; this file only lays them out. */
.page-course main { z-index: auto; }
.cp { position: relative; background: var(--bg); color: var(--fg); padding-block: clamp(56px, 7vw, 96px); }
.cp-tight { padding-top: 0; }
.cp-in { max-width: calc(var(--maxw) + 2 * var(--pad)); margin-inline: auto; padding-inline: var(--pad); }
.cp-narrow > * { max-width: 820px; }   /* reading width, still aligned to the page's left edge */
.cp h2 { font-size: clamp(2rem, 3.2vw, 2.75rem); }

/* nav: always solid; the page's own enrol button sits in it */
.nav-sub .nav-links { margin-left: auto; }
.nav-sub .nav-cta { white-space: nowrap; }

/* hero */
.cp-hero { padding-top: calc(64px + clamp(32px, 5vw, 64px)); background: linear-gradient(180deg, #0E0B1F, #211A4A); }
.cp-hero .cp-in { display: grid; grid-template-columns: minmax(0, 640px) minmax(0, 1fr); column-gap: 48px; align-items: center; }
.cp-hero h1 { font-size: clamp(2.75rem, 5.2vw, 4.5rem); margin: 16px 0 18px; }
.cp-hero h1 [lang="ta"] { font-size: .62em; font-stretch: 100%; font-weight: 600; letter-spacing: 0; white-space: nowrap; }
/* the hero scene: the poster until the 3D scene has drawn, then the canvas (course-world.js) */
.cp-stage { position: relative; width: 100%; max-width: 560px; margin-left: auto; aspect-ratio: 1; }
.cp-poster { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; transition: opacity .7s; }
.cp-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; transition: opacity .4s; }
.cp-stage.live .cp-canvas { opacity: 1; }
.cp-stage.live .cp-poster { opacity: 0; }
.cp-labels { position: absolute; inset: 0; pointer-events: none; }
.cp-label { position: absolute; left: 0; top: 0; font-family: var(--f-mono); font-size: 13px; line-height: 1; white-space: nowrap; padding: 6px 10px; border-radius: var(--r-pill); background: rgba(26,21,51,.9); color: var(--on-ink); box-shadow: 0 0 0 1px var(--line-ink); opacity: 0; transition: opacity .3s, background .2s; }
.cp-label.hi { background: var(--violet); color: #fff; box-shadow: none; }
.cp-label-name { display: none; margin-left: 8px; }
.cp-label.hi .cp-label-name { display: inline; }
.cp-bubble { position: absolute; left: 0; top: 0; z-index: 1; max-width: calc(100% - 12px); width: max-content; text-align: center; background: #fff; color: var(--text); font-weight: 600; font-size: 17px; line-height: 1.2; padding: 10px 16px; border-radius: var(--r-lg); box-shadow: var(--shadow-2); pointer-events: none; opacity: 0; scale: .9; transition: opacity .25s, scale .25s var(--ease-out); }
.cp-bubble::after { content: ""; position: absolute; left: 50%; bottom: -6px; width: 14px; height: 14px; margin-left: -7px; background: #fff; border-radius: 3px; rotate: 45deg; }
.cp-bubble.on { opacity: 1; scale: 1; }
.cp-bubble[lang="ta"] { font-size: 19px; }
.cp-pause { display: grid; position: absolute; right: 8px; bottom: 8px; }
.cp-pause[hidden] { display: none; }
.crumb { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; font-family: var(--f-mono); font-size: 13px; color: var(--fg-2); }
.crumb a { color: inherit; text-underline-offset: 3px; }
.crumb .badge { font-family: var(--f-sans); }
.cp-facts { list-style: none; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; margin-top: 24px; }
.cp-facts li { font-size: 15px; padding: 6px 12px; border-radius: var(--r-pill); box-shadow: inset 0 0 0 1px var(--hair); }
.cp-facts [lang="ta"] { font-size: 17px; line-height: 1.3; }
.cp-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; margin-top: 28px; }
.cp-price b { font-family: var(--f-mono); font-size: 48px; font-weight: 600; line-height: 1; letter-spacing: -.03em; font-variant-numeric: tabular-nums; }
.cp-price span { font-size: 15px; color: var(--fg-2); }
.cp-hero .ctas { margin-top: 24px; }
.cp-hero .coupon { display: inline-block; margin-top: 16px; }
.final-card .coupon { display: inline-block; margin: -8px 0 20px; }
.cp-note { font-size: 15px; color: var(--fg-2); margin-top: 16px; }
.cp-warn { font-size: 15px; color: var(--fg); margin-top: 20px; padding: 12px 16px; border-radius: var(--r-md); box-shadow: inset 0 0 0 1px var(--hair); max-width: 36em; }

/* body blocks */
.cp-body { font-size: var(--t-lg); line-height: 1.55; color: var(--fg-2); }
.cp-small { font-size: 15px; color: var(--fg-2); margin-top: 14px; }
.cp-small a, .faq a { color: var(--link); font-weight: 600; text-underline-offset: 3px; }
.cp-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.cp-card { background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 24px; }
.cp-card h3, .mod h3 { font-size: 20px; font-weight: 600; line-height: 1.25; margin-bottom: 6px; }
.cp-card p { color: var(--text-2); }
.cp-split { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.ticks { list-style: none; padding: 0; display: grid; gap: 10px; margin-top: 10px; color: var(--text-2); }
.ticks li { position: relative; padding-left: 26px; }
.ticks li::before { content: ""; position: absolute; left: 2px; top: .6em; width: 10px; height: 10px; border-radius: 50%; background: var(--violet); }
.ticks-no li::before { background: none; box-shadow: inset 0 0 0 2px var(--text-3); }

/* modules */
.mods { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; }
.mod-groups { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.mod { background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow-1); padding: 24px; }
.mod-head { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; margin-bottom: 8px; font-family: var(--f-mono); font-size: 13px; color: var(--text-3); }
.mod-n { color: var(--violet); }
.mod p { color: var(--text-2); }
.lessons { margin-top: 10px; padding-left: 20px; color: var(--text-2); display: grid; gap: 4px; }
.lessons li::marker { color: var(--violet); }
.mod-nums { list-style: none; padding: 0; margin-top: 8px; display: grid; gap: 2px; color: var(--text-2); }
.mod-nums li { display: grid; grid-template-columns: 34px minmax(0, 1fr); align-items: baseline; padding: 6px 0; border-top: 1px solid var(--line); }
.mod-nums li:first-child { border-top: 0; }
.mod-nums .n { font-family: var(--f-mono); font-size: 13px; color: var(--violet); }
.cp-zero { margin-top: 40px; font-size: var(--t-lg); color: var(--fg-2); display: flex; align-items: baseline; gap: 16px; flex-wrap: wrap; }
.cp-zero b { font-family: var(--f-mono); font-weight: 400; font-size: clamp(4rem, 8vw, 6rem); line-height: 1; color: transparent; -webkit-text-stroke: 1.5px var(--violet); }
.cp .tools { margin-top: 32px; }

/* reviews */
.cp-reviews { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 16px; align-items: start; }
.cp-rating { display: flex; align-items: baseline; gap: 10px; margin: -16px 0 24px; color: var(--fg-2); font-size: 15px; }
.cp-rating b { font-size: 40px; font-weight: 600; line-height: 1; color: var(--fg); letter-spacing: -.03em; }

/* teacher */
.cp-teacher-in { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: 48px; align-items: center; }
.cp-teacher h2 { margin-bottom: 16px; }
.cp-teacher .lede { margin-bottom: 24px; }
.cp-teacher .text-link { margin-top: 8px; }

/* FAQ */
.faq { border-top: 1px solid var(--hair); }
.faq details { border-bottom: 1px solid var(--hair); }
.faq summary { cursor: pointer; list-style: none; min-height: 64px; display: flex; align-items: center; gap: 16px; padding: 12px 0; font-weight: 600; font-size: var(--t-lg); line-height: 1.3; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; margin-left: auto; font-size: 24px; font-weight: 400; color: var(--violet); }
.faq details[open] summary::after { content: "−"; }
.faq p { color: var(--fg-2); padding: 0 40px 24px 0; max-width: 44em; }

/* final call: a white card on violet, as on the home page */
.final-card { max-width: 720px; margin-inline: auto; background: #fff; color: var(--text); border-radius: var(--r-xl); padding: clamp(28px, 4vw, 48px); text-align: center; box-shadow: 0 24px 60px rgba(14,11,31,.25); }
.final-card h2 { color: var(--violet); margin-bottom: 12px; }
.final-card .door-meta { color: var(--text-2); margin-bottom: 24px; }
.final-card .btn { min-width: min(100%, 320px); }
.final-card .cp-small { color: var(--text-2); }
.final-card a:not(.btn) { color: var(--violet); }

/* other courses */
.more-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 16px; }
.more-card { display: flex; flex-direction: column; gap: 8px; padding: 24px; background: var(--paper); border-radius: var(--r-lg); box-shadow: var(--shadow-1); text-decoration: none; color: var(--text); transition: transform .15s var(--ease-out), box-shadow .15s; }
.more-card:hover { transform: translateY(-2px); box-shadow: var(--shadow-2); }
.more-name { font-size: 24px; font-weight: 600; line-height: 1.2; }
.more-meta { font-size: 15px; color: var(--text-2); }
.more-meta b { font-size: 15px; font-weight: 600; color: var(--text); }
.more-card .go { margin-top: auto; padding-top: 8px; }

/* mobile buy bar: always there on phones and tablets, never on desktop */
.buy-bar { display: none; }

@media (max-width: 960px) {
  .nav-sub .nav-links { display: flex; gap: 16px; }
  .nav-sub .nav-wide, .nav-sub .nav-cta { display: none; }
  .cp-hero { padding-top: calc(56px + 24px); }
  .cp-hero .cp-in { display: flex; flex-direction: column-reverse; align-items: stretch; }
  .cp-stage { max-width: none; aspect-ratio: auto; height: 26svh; min-height: 170px; margin: 0 0 8px; }
  .cp-pause { right: 0; bottom: 0; }
  .cp-label:not(.hi) { visibility: hidden; }   /* a small window: only the step he is on */
  .cp-hero h1 { font-size: clamp(36px, 10vw, 56px); margin: 12px 0 14px; }
  .cp-price b { font-size: 40px; }
  .cp-grid, .cp-split, .mods, .mod-groups, .cp-reviews, .more-grid { grid-template-columns: 1fr; }
  .cp-teacher-in { grid-template-columns: 1fr; gap: 28px; }
  .cp-teacher .portrait { aspect-ratio: 3 / 2; }
  .faq summary { font-size: 18px; }
  .faq p { padding-right: 0; }
  .buy-bar { position: fixed; left: 0; right: 0; bottom: 0; z-index: 10; display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 8px 16px calc(8px + env(safe-area-inset-bottom)); background: rgba(14,11,31,.94); backdrop-filter: blur(12px); -webkit-backdrop-filter: blur(12px); box-shadow: 0 -1px 0 var(--line-ink); color: var(--on-ink); }
  .buy-bar p { display: grid; min-width: 0; font-size: 13px; line-height: 1.3; color: var(--on-ink-2); }
  .buy-bar .buy-name { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .buy-bar .buy-name .ta { font-size: 17px; }
  .buy-bar b { font-size: 18px; font-weight: 600; color: var(--on-ink); }
  .buy-bar .btn { flex: none; }
  .buy-bar { transition: transform .25s var(--ease-out); }
  .bar-wait .buy-bar { transform: translateY(110%); }   /* course.js: hidden while the hero button is on screen */
  .foot { padding-bottom: calc(40px + 64px + env(safe-area-inset-bottom)); }
}
@media (min-width: 600px) and (max-width: 960px) {
  .cp-grid, .mods, .mod-groups, .more-grid, .cp-reviews { grid-template-columns: 1fr 1fr; }
  .cp-split { grid-template-columns: 1fr 1fr; }
  .cp-hero .ctas .btn { width: auto; }
  .cp-teacher-in { grid-template-columns: 240px minmax(0, 1fr); }
  .cp-teacher .portrait { aspect-ratio: 4 / 5; }
}
@media (max-width: 380px) { .nav-sub .nav-links a { font-size: 13px; } }
