/* =========================================================
   LANDING + POP-UP DETAILS FORM
   Page 1 is a landing: the course picture, the course name, what the video
   holds and one button. The button (and the picture) open steps 1-2 as a
   sheet that slides up from the bottom; assets/form-sheet.js drives it.
   Loaded after index.html's own styles, so equal selectors here win.
   ========================================================= */

/* ---------- landing ---------- */
/* the progress rail belongs to the form; the landing header shows just the brand */
body:has(#landing:not([hidden])) .rail{display:none}
.landing[hidden]{display:none}
.landing{position:relative; isolation:isolate}
/* a faint red glow and grid (the thumbnail's own motif) behind the top of the page */
.landing::before{
  content:""; position:absolute; z-index:-1; top:-40px; left:50%; width:100vw; height:760px; transform:translateX(-50%);
  pointer-events:none;
  background:
    radial-gradient(560px 320px at 50% 26%, color-mix(in srgb, var(--red) 9%, transparent), transparent 70%),
    linear-gradient(color-mix(in srgb, var(--line) 70%, transparent) 1px, transparent 1px) 0 0 / 34px 34px,
    linear-gradient(90deg, color-mix(in srgb, var(--line) 70%, transparent) 1px, transparent 1px) 0 0 / 34px 34px;
  -webkit-mask-image:radial-gradient(640px 460px at 50% 32%, #000 30%, transparent 75%);
  mask-image:radial-gradient(640px 460px at 50% 32%, #000 30%, transparent 75%)
}
.landing .hero{padding:18px 0 8px; text-align:center}
.landing .hero-vid{margin:0 0 22px}
.landing h1{font-size:clamp(34px, 8.8vw, 54px); line-height:1.05; text-wrap:balance}
.landing h1 .grad{color:var(--red)}

/* the poster reads as a locked video: a dark wash, a play button, the promise,
   and a lock tag - the whole picture is the button that opens the form */
.landing .hero-vid{position:relative; isolation:isolate}
.hv-shade{
  position:absolute; inset:0; pointer-events:none;
  background:linear-gradient(180deg, rgba(0,0,0,.52) 0%, rgba(0,0,0,.46) 40%, rgba(0,0,0,.78) 100%)
}
.hv-play{
  position:absolute; left:50%; top:44%; transform:translate(-50%,-50%);
  width:74px; height:74px; border-radius:50%; display:grid; place-items:center; pointer-events:none;
  color:#fff; background:var(--red); box-shadow:0 12px 28px rgba(0,0,0,.5)
}
.hv-play svg{margin-left:4px}
/* a ring that breathes, like a player waiting to be pressed */
.hv-play::after{
  content:""; position:absolute; inset:-10px; border-radius:50%; border:2px solid rgba(255,255,255,.5);
  animation:hvPulse 2.4s ease-out infinite
}
@keyframes hvPulse{0%{transform:scale(.9); opacity:.9} 70%,100%{transform:scale(1.3); opacity:0}}
.hv-label{
  position:absolute; left:10px; right:10px; top:calc(44% + 52px); text-align:center; pointer-events:none;
  color:#fff; font-family:var(--display); font-weight:800; font-size:clamp(16px, 4.6vw, 21px);
  letter-spacing:-.01em; text-shadow:0 2px 12px rgba(0,0,0,.65)
}
.hv-lock{
  position:absolute; left:12px; top:12px; display:inline-flex; align-items:center; gap:6px;
  padding:6px 13px; border-radius:999px; pointer-events:none; white-space:nowrap;
  background:rgba(0,0,0,.55); color:#fff; font-size:12.5px; font-weight:700;
  backdrop-filter:blur(6px); -webkit-backdrop-filter:blur(6px)
}
@media (hover:hover){
  .landing .hero-vid:hover .hv-play{transform:translate(-50%,-50%) scale(1.07)}
}
@media (max-width:359px){
  .hv-play{width:62px; height:62px}
  .hv-lock{font-size:11.5px; padding:5px 10px}
}

.ld-eyebrow{
  display:inline-flex; align-items:center; gap:8px; margin:0 0 14px; padding:6px 13px 6px 11px;
  border-radius:999px; background:var(--red-tint); color:var(--red-ink);
  font-size:12.5px; font-weight:700; letter-spacing:.08em; text-transform:uppercase
}
.ld-dot{position:relative; width:8px; height:8px; border-radius:50%; background:var(--red)}
.ld-dot::after{content:""; position:absolute; inset:0; border-radius:50%; background:var(--red); animation:ldPing 1.8s ease-out infinite}
@keyframes ldPing{from{transform:scale(1); opacity:.7} to{transform:scale(2.8); opacity:0}}

/* the course format, right under the name: 6 weeks, online */
.ld-format{
  display:inline-flex; align-items:center; gap:8px; margin:14px 0 0; padding:8px 16px;
  border-radius:999px; background:var(--surface); border:1px solid color-mix(in srgb, var(--red) 35%, transparent);
  color:var(--ink-2); font-size:16px; font-weight:600; line-height:1.3
}
.ld-format svg{flex:none; color:var(--red)}
.ld-format b{color:var(--red-ink); font-weight:800}
.ld-format + .ld-sub{margin-top:12px}

.ld-sub{margin:14px auto 0; max-width:30em; font-size:18px; line-height:1.5; color:var(--ink-2); text-wrap:balance}
.ld-sub mark{
  color:var(--ink); font-weight:700; padding:0 2px;
  background:linear-gradient(transparent 62%, color-mix(in srgb, var(--red) 30%, transparent) 62%)
}

/* the course at a glance: one strip, three facts */
.ld-stats{
  list-style:none; margin:24px 0 0; padding:14px 4px; display:grid; grid-template-columns:repeat(3, 1fr);
  background:var(--surface); border:1px solid var(--line); border-radius:18px
}
.ld-stats li{display:flex; flex-direction:column; align-items:center; gap:3px; padding:0 6px; min-width:0}
.ld-stats li + li{border-left:1px solid var(--line)}
.ld-stats b{font-family:var(--display); font-size:20px; font-weight:800; line-height:1.2; color:var(--ink)}
.ld-stats b[lang="ta"]{font-family:var(--tamil); font-weight:500; font-size:18px}
.ld-stats span{font-size:12.5px; font-weight:600; line-height:1.3; color:var(--ink-3)}

/* bonus: the AI Agent demo */
.ld-bonus{
  display:flex; align-items:center; gap:14px; margin-top:12px; padding:14px 16px;
  text-align:left; background:var(--surface); border:1px solid var(--line); border-radius:18px
}
.ld-bonus p{margin:0; font-size:15.5px; line-height:1.45; color:var(--ink-2)}
.ld-bonus b{color:var(--ink)}
.ld-tag{
  display:inline-block; margin-right:2px; padding:2px 8px; border-radius:999px; vertical-align:1px;
  font-size:11px; font-weight:800; letter-spacing:.08em; text-transform:uppercase;
  color:var(--red-ink); background:var(--red-tint)
}
.perk-ic{
  flex:none; width:46px; height:46px; border-radius:14px; display:grid; place-items:center;
  color:var(--red); background:var(--red-tint)
}

/* the unlock box: a thin red frame with a padlock badge on its edge */
.unlock{
  position:relative; margin-top:40px; padding:36px 18px 18px; border-radius:24px; background:var(--surface);
  border:1.5px solid color-mix(in srgb, var(--red) 45%, var(--line));
  box-shadow:0 24px 50px -30px color-mix(in srgb, var(--red) 45%, transparent)
}
.unlock-badge{
  position:absolute; left:50%; top:-28px; transform:translateX(-50%);
  width:56px; height:56px; border-radius:50%; display:grid; place-items:center; color:#fff;
  background:var(--red); box-shadow:0 0 0 6px var(--paper)
}
.unlock-title{margin:0; font-family:var(--display); font-size:21px; font-weight:800; line-height:1.25; color:var(--ink); text-wrap:balance}
.unlock-sub{margin:4px 0 0; font-size:15.5px; font-weight:600; color:var(--ink-2)}

.cta-watch{
  position:relative; overflow:hidden; width:100%; height:62px; margin-top:18px; padding:0 22px; gap:12px;
  border-radius:999px; color:#fff; font-size:18.5px; font-weight:800; letter-spacing:.005em;
  background:var(--red); box-shadow:0 12px 26px -14px color-mix(in srgb, var(--red) 80%, transparent)
}
.cta-watch:hover{background:var(--red-ink)}
.cta-play{
  flex:none; width:34px; height:34px; border-radius:50%; display:grid; place-items:center;
  background:#fff; color:var(--red)
}
.cta-play svg{margin-left:2px}
/* a slow light sweep keeps the eye on the one action on the page */
.cta-watch::after{
  content:""; position:absolute; top:0; bottom:0; left:-45%; width:30%; pointer-events:none;
  background:linear-gradient(100deg, transparent, rgba(255,255,255,.22), transparent);
  transform:skewX(-18deg); animation:ctaSweep 4.2s ease-in-out 1.5s infinite
}
@keyframes ctaSweep{0%{left:-45%} 40%,100%{left:130%}}
.unlock-note{margin:12px 0 0; font-size:13.5px; font-weight:600; color:var(--ink-3)}
.unlock-note [lang="ta"]{font-family:var(--tamil); font-weight:500}

.landing .foot{margin-top:30px}
@media (max-width:359px){
  .ld-stats b{font-size:17px}
  .ld-stats span{font-size:11.5px}
  .cta-watch{font-size:17px; padding:0 16px}
}
@media (min-width:760px){
  .landing .hero{padding:36px 0 8px}
  .ld-sub{font-size:19px}
  .ld-stats{padding:16px 6px}
  .ld-stats b{font-size:22px}
  .ld-stats span{font-size:13.5px}
  .ld-bonus{padding:16px 20px}
  .ld-bonus p{font-size:16px}
  .unlock{padding:40px 32px 24px}
  .unlock-title{font-size:23px}
}

/* ---------- the sheet ---------- */
.fs{position:fixed; inset:0; z-index:60}
.fs[hidden]{display:none}
html.fs-lock, html.fs-lock body{overflow:hidden}
.fs-scrim{position:absolute; inset:0; background:rgba(0,0,0,.52); opacity:0; transition:opacity .32s ease}
.fs.fs-in .fs-scrim{opacity:1}
.fs-panel{
  position:absolute; left:0; right:0; bottom:var(--fs-kb, 0px);
  /* --fs-vh follows the visible screen (it shrinks when the phone keyboard opens) */
  height:calc(100vh - 28px); height:min(calc(var(--fs-vh, 100dvh) - 28px), 880px);
  display:flex; flex-direction:column; background:var(--surface); color:var(--ink);
  border-radius:22px 22px 0 0; box-shadow:0 -14px 44px rgba(0,0,0,.25); overflow:hidden;
  transform:translateY(100%); transition:transform .42s cubic-bezier(.32,.72,0,1)
}
.fs.fs-in .fs-panel{transform:none}
.fs.fs-out .fs-panel{transition:transform .26s cubic-bezier(.4,0,1,1)}
.fs.fs-out .fs-scrim{transition-duration:.26s}
.fs.fs-drag .fs-panel{transition:none}
.fs.fs-kb .fs-panel{height:calc(var(--fs-vh, 100dvh) - 8px); border-radius:16px 16px 0 0}

.fs-top{flex:none; padding:8px 10px 0; touch-action:none; user-select:none; -webkit-user-select:none}
.fs-grab{width:42px; height:5px; margin:0 auto 2px; border-radius:3px; background:var(--line)}
.fs-bar{display:grid; grid-template-columns:48px 1fr 48px; align-items:center; min-height:48px}
.fs-x{
  width:44px; height:44px; padding:0; border:0; border-radius:50%; background:transparent;
  display:grid; place-items:center; cursor:pointer; color:var(--ink); transition:background .15s
}
.fs-x:hover{background:var(--paper)}
.fs-title{
  display:flex; align-items:center; justify-content:center; gap:8px; min-width:0;
  font-family:var(--display); font-weight:700; font-size:15px; line-height:1.2; white-space:nowrap
}
.fs-title img{flex:none; width:22px; height:22px}
.fs-count{text-align:right; padding-right:8px; font-size:13px; font-weight:700; color:var(--ink-3); white-space:nowrap}
.fs-prog{display:grid; grid-template-columns:1fr 1fr; gap:6px; padding:6px 10px 12px}
.fs-prog i{position:relative; height:4px; border-radius:2px; background:var(--line); overflow:hidden}
.fs-prog i::after{
  content:""; position:absolute; inset:0; background:var(--red);
  transform:scaleX(0); transform-origin:left; transition:transform .45s ease
}
.fs-prog i.on::after{transform:none}

.fs-body{
  flex:1; min-height:0; overflow-y:auto; overscroll-behavior:contain; -webkit-overflow-scrolling:touch;
  display:flex; flex-direction:column; padding:0 20px; border-top:1px solid var(--line)
}

/* the two pages: the sheet decides which one shows, so a page stays put while
   the sheet slides away after the last step */
.fs .step{display:none; animation:none}
.fs .step.fs-on{display:flex; flex-direction:column; flex:1 0 auto}
.fs .step > .narrow{display:flex; flex-direction:column; flex:1 0 auto; width:100%; max-width:560px}
.fs .step form{display:flex; flex-direction:column; flex:1 0 auto}
.fs .step.fs-fwd{animation:fsFwd .34s cubic-bezier(.2,.8,.2,1)}
.fs .step.fs-back{animation:fsBack .34s cubic-bezier(.2,.8,.2,1)}
@keyframes fsFwd{from{opacity:0; transform:translateX(44px)}}
@keyframes fsBack{from{opacity:0; transform:translateX(-44px)}}

.fs .hero{padding:18px 0 18px}
.fs h2{font-size:clamp(24px, 6.6vw, 30px); line-height:1.12}
.fs .lede{margin-top:8px; font-size:16px}
.fs-kicker{display:flex; align-items:center; gap:7px; margin:0 0 8px; font-size:13px; font-weight:700; letter-spacing:.06em; text-transform:uppercase; color:var(--red-ink)}
.fs-kicker svg{flex:none}
.fs .panel{padding:0; border:0; border-radius:0; background:none}
.fs .legend{font-size:20px}

/* the button bar stays in reach at the bottom, WhatsApp-style; a spacer that
   grows pushes it down when the page is short */
.fs .step form::after{content:""; order:1; flex:1 0 22px}
.fs .actions{
  order:2; position:sticky; bottom:0; z-index:3; margin:0 -20px; padding:12px 20px 14px;
  background:var(--surface); border-top:1px solid var(--line)
}
.fs .privacy{order:3; margin:0; padding:2px 0 16px}
.fs .actions .btn-primary{background:var(--red); color:#fff}
.fs .actions .btn-primary:hover{background:var(--red-ink)}

/* step 3 stays on show behind the sheet when "Change my answers" opened it */
#step3.keep{display:block}

/* desktop: a card that rises into the middle of the screen */
@media (min-width:760px) and (min-height:560px){
  .fs-panel{
    left:50%; top:50%; right:auto; bottom:auto; width:min(560px, calc(100vw - 48px));
    height:min(760px, calc(100vh - 64px)); border-radius:22px;
    opacity:0; transform:translate(-50%, calc(-50% + 56px));
    transition:transform .4s cubic-bezier(.2,.8,.2,1), opacity .28s ease
  }
  .fs.fs-in .fs-panel{opacity:1; transform:translate(-50%, -50%)}
  .fs.fs-out .fs-panel{transition:transform .24s ease-in, opacity .2s ease-in}
  .fs-grab{visibility:hidden}
  .fs-body, .fs .actions{padding-left:28px; padding-right:28px}
  .fs .actions{margin:0 -28px}
}

/* phones: the landing's button pinned to the bottom while the real one is off screen.
   It repeats that button, so it is hidden from screen readers and the Tab order. */
.ld-sticky{
  position:fixed; left:0; right:0; bottom:0; z-index:30; padding:10px 14px 12px;
  background:color-mix(in srgb, var(--paper) 90%, transparent);
  backdrop-filter:blur(10px); -webkit-backdrop-filter:blur(10px); border-top:1px solid var(--line);
  transform:translateY(110%); transition:transform .3s cubic-bezier(.2,.8,.2,1); pointer-events:none
}
.ld-sticky.show{transform:none; pointer-events:auto}
.ld-sticky .cta-watch{margin:0; height:54px; font-size:17px}
.ld-sticky .cta-play{width:30px; height:30px}
@media (min-width:760px){ .ld-sticky{display:none} }
