/* =====================================================================
   landing.css: the scrollytelling landing page
   ===================================================================== */

/* ---- Hero ---------------------------------------------------------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; align-items: center;
  padding-top: var(--nav-h);
  background:
    radial-gradient(120% 90% at 50% -10%, #fbfbfd 0%, #f4f4f7 55%, #eeeef1 100%);
  overflow: hidden;
}
.hero__inner { text-align: center; }
.hero__eyebrow { margin-bottom: 20px; }
.hero__title { margin-inline: auto; }
.hero__grad {
  background: linear-gradient(180deg, #1d1d1f 0%, #6e6e73 130%);
  -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__lead { max-width: 640px; margin: 26px auto 0; }
.hero__cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 34px; }
.hero__cta .btn--start { background: #0a66d8; }
.hero__meta {
  margin-top: 30px; display: flex; gap: 12px; justify-content: center; flex-wrap: wrap;
  color: var(--text-3); font-size: 0.86rem;
}
.hero__meta .dot { opacity: 0.5; }
.hero__scrollhint {
  position: absolute; bottom: 26px; left: 50%; transform: translateX(-50%);
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  color: var(--text-3); font-size: 0.72rem; letter-spacing: 0.1em; text-transform: uppercase;
}
.hero__scrollhint .dotc { animation: dotdrop 1.8s var(--ease-soft) infinite; }
@keyframes dotdrop { 0%,100% { transform: translateY(0); opacity: 1; } 50% { transform: translateY(6px); opacity: 0.3; } }

/* ---- The idea (pinned) -------------------------------------------- */
.idea { position: relative; }
.idea__sticky {
  position: sticky; top: 0; min-height: 100svh;
  display: flex; align-items: center;
  background: var(--bg);
}
/* When JS runs, GSAP handles the pin, so drop sticky so they don't fight. */
.idea.js-on .idea__sticky { position: relative; top: auto; }
/* GSAP pins this; when GSAP absent, sticky gives a graceful version */
.idea__grid {
  display: grid; grid-template-columns: 1fr 1fr; gap: clamp(30px, 6vw, 80px);
  align-items: center; width: 100%;
}
.idea__head { margin: 16px 0 30px; }
.idea__steps { position: relative; display: grid; }
.idea__step {
  grid-area: 1 / 1; font-size: 1.12rem; line-height: 1.55; color: var(--text-2);
  max-width: 30ch;
}
.idea__step strong { color: var(--text); }
/* JS toggles .is-active; CSS fallback shows all stacked */
.idea.js-on .idea__step { opacity: 0.16; transform: translateY(10px); transition: opacity .5s var(--ease-out), transform .5s var(--ease-out); }
.idea.js-on .idea__step.is-active { opacity: 1; transform: none; }

/* context window visual */
.idea__viz { display: flex; justify-content: center; }
.win {
  width: min(420px, 100%); background: var(--bg-subtle);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); overflow: hidden;
}
.win__bar {
  display: flex; align-items: center; gap: 6px; padding: 12px 16px;
  background: #ececf0; border-bottom: 1px solid var(--line);
}
.win__bar span { width: 10px; height: 10px; border-radius: 50%; background: #c7c7cc; }
.win__bar em { margin-left: 10px; font-style: normal; font-size: 0.74rem; color: var(--text-3); letter-spacing: 0.02em; }
.win__body { padding: 14px; display: flex; flex-direction: column; gap: 8px; min-height: 300px; }
.tok {
  border-radius: 8px; padding: 10px 12px; font-size: 0.82rem; font-family: var(--font-mono);
  color: var(--text-2); background: #fff; border: 1px solid var(--line-soft);
}
.tok--sys  { background: #efeff2; }
.tok--load { color: var(--text-3); border-style: dashed;
  transition: opacity .5s var(--ease-out), transform .5s var(--ease-out), max-height .5s var(--ease-out);
}
/* stage classes toggled by JS */
.win[data-stage="1"] .tok--load { opacity: 0.4; }
.win[data-stage="2"] .tok--load { opacity: 0; transform: translateY(-6px); max-height: 0; padding-block: 0; margin: 0; border-width: 0; }
.win[data-stage="2"] .tok--load.keep { opacity: 1; transform: none; max-height: 60px; padding-block: 10px; border-width: 1px;
  border-style: solid; border-color: var(--success); color: var(--success); background: var(--success-soft); }
.win__meter { height: 4px; background: #e3e3e8; }
.win__meter i { display: block; height: 100%; width: 100%; background: var(--text-3);
  transition: width .6s var(--ease-out), background .6s var(--ease-out); }
.win[data-stage="1"] .win__meter i { width: 92%; }
.win[data-stage="2"] .win__meter i { width: 46%; background: var(--success); }
.win__caption { padding: 10px 16px 14px; font-size: 0.78rem; color: var(--text-3); text-align: center; }

@media (max-width: 860px) {
  .idea__grid { grid-template-columns: 1fr; }
  .idea__sticky { min-height: auto; padding-block: 80px; position: static; }
  .idea.js-on .idea__step { opacity: 1; transform: none; margin-bottom: 14px; }
  .idea__steps { display: block; }
}

/* ---- Four primitives ---------------------------------------------- */
.prims { background: var(--bg-sink); border-top: 1px solid var(--line-soft); }
.prims__head { max-width: 640px; margin-bottom: 52px; }
.prims__head h2 { margin: 12px 0 16px; }
.prims__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 20px; }
.pcard {
  background: var(--card); border: 1px solid var(--line-soft); border-radius: var(--radius);
  padding: 26px 22px 24px; box-shadow: var(--shadow-sm);
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out);
}
.pcard:hover { transform: translateY(-4px); box-shadow: var(--shadow-md); }
.pcard__ico { width: 42px; height: 42px; border-radius: 11px; background: var(--bg-subtle);
  display: grid; place-items: center; margin-bottom: 18px; }
.pcard__ico svg { width: 23px; height: 23px; stroke: var(--text); }
.pcard h3 { margin-bottom: 8px; }
.pcard p { font-size: 0.94rem; line-height: 1.5; }
.pcard__when { display: block; margin-top: 16px; padding-top: 14px; border-top: 1px solid var(--line-soft);
  font-size: 0.82rem; color: var(--text-3); }
.pcard__when em { font-style: normal; color: var(--accent); font-weight: 560; }
@media (max-width: 900px) { .prims__grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 520px) { .prims__grid { grid-template-columns: 1fr; } }

/* ---- Context-as-budget teaser ------------------------------------- */
.ctxteaser__wrap { max-width: 760px; margin-inline: auto; }
.ctxteaser__intro { text-align: center; }
.ctxteaser__intro h2 { margin: 12px 0 16px; }
.ctxteaser__intro .lead { margin-inline: auto; }
.ctxteaser .ctxfill { margin-top: 32px; }
.ctxteaser__cta { text-align: center; margin-top: 28px; }

/* ---- Tiers -------------------------------------------------------- */
.tiers__grid { display: grid; grid-template-columns: 0.9fr 1.1fr; gap: clamp(32px, 6vw, 80px); align-items: center; }
.tiers__copy h2 { margin: 12px 0 18px; }
.tiers__copy .btn { margin-top: 26px; }
.tiers__list { list-style: none; display: flex; flex-direction: column; gap: 14px; }
.tier { display: flex; gap: 18px; align-items: flex-start; background: var(--bg-subtle);
  border: 1px solid var(--line-soft); border-radius: var(--radius); padding: 22px 24px; }
.tier__n { flex: none; width: 34px; height: 34px; border-radius: 50%; background: var(--bg);
  border: 1px solid var(--line); display: grid; place-items: center; font-weight: 620; font-size: 0.95rem; }
.tier h4 { margin-bottom: 4px; }
.tier p { font-size: 0.92rem; }
@media (max-width: 820px) { .tiers__grid { grid-template-columns: 1fr; } }

/* ---- Course list -------------------------------------------------- */
.course__head { max-width: 640px; margin-bottom: 44px; }
.course__head h2 { margin: 12px 0 16px; }
.course__progress { display: flex; align-items: center; gap: 16px; margin-top: 20px; }
.course__count { font-size: 0.82rem; font-weight: 560; color: var(--success); }
.course__reset {
  display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px;
  font-size: 0.8rem; font-weight: 540; color: var(--text-2); cursor: pointer;
  background: transparent; border: 1px solid var(--line); border-radius: var(--radius-sm, 8px);
  transition: background var(--dur-1), border-color var(--dur-1), color var(--dur-1);
}
.course__reset:hover { background: var(--bg-subtle); border-color: var(--line); color: var(--text); }
.course__reset svg { width: 14px; height: 14px; stroke: currentColor; }
.course__list { display: flex; flex-direction: column; gap: 12px; }
.mrow {
  display: grid; grid-template-columns: 56px 1fr auto; gap: 22px; align-items: center;
  padding: 24px 26px; background: var(--card); border: 1px solid var(--line-soft);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  transition: transform var(--dur-2) var(--ease-out), box-shadow var(--dur-2) var(--ease-out), border-color var(--dur-2);
}
.mrow:hover { transform: translateY(-3px); box-shadow: var(--shadow-md); border-color: var(--line); }
.mrow__n { font-size: 1.5rem; font-weight: 640; color: var(--text-3); letter-spacing: -0.02em; font-variant-numeric: tabular-nums; }
.mrow__body h3 { font-size: 1.16rem; margin-bottom: 5px; }
.mrow__body p { font-size: 0.92rem; line-height: 1.45; max-width: 60ch; }
.mrow__tag { display: inline-block; margin-bottom: 8px; font-size: 0.68rem; letter-spacing: 0.1em;
  text-transform: uppercase; color: var(--text-3); }
.mrow__meta { display: flex; flex-direction: column; align-items: flex-end; gap: 8px; text-align: right; }
.mrow__min { font-size: 0.8rem; color: var(--text-3); white-space: nowrap; }
.mrow__go { width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--line);
  display: grid; place-items: center; transition: background var(--dur-1), transform var(--dur-1) var(--ease-out); }
.mrow:hover .mrow__go { background: var(--text); transform: translateX(2px); }
.mrow:hover .mrow__go svg { stroke: #fff; }
.mrow__go svg { width: 15px; height: 15px; stroke: var(--text); }
.mrow.is-done .mrow__n { color: var(--success); }
.mrow__done { display: none; align-items: center; gap: 5px; font-size: 0.78rem; color: var(--success); font-weight: 560; }
.mrow__done svg { width: 14px; height: 14px; stroke: var(--success); }
.mrow.is-done .mrow__done { display: inline-flex; }

@media (max-width: 640px) {
  .mrow { grid-template-columns: 40px 1fr; }
  .mrow__meta { grid-column: 2; flex-direction: row; align-items: center; justify-content: space-between; }
}

.course__more { margin-top: 34px; padding: 26px; border: 1px dashed var(--line); border-radius: var(--radius);
  background: transparent; }
.course__more h4 { margin-bottom: 6px; }
.course__more p { font-size: 0.9rem; margin-bottom: 16px; }
.course__more ul { list-style: none; display: flex; flex-wrap: wrap; gap: 10px; }
.course__more li { font-size: 0.82rem; color: var(--text-3); background: var(--bg-subtle);
  border: 1px solid var(--line-soft); border-radius: 980px; padding: 7px 14px; }

/* ---- Finale ------------------------------------------------------- */
.finale { background: var(--bg-sink); border-top: 1px solid var(--line-soft); }
.finale__head { margin-bottom: 14px; }
