/*
 * WHITECHALK's website: motion (24 Nov 2026). Loaded after app.css by landing_head() (views/landing/parts.php).
 * - Nothing is hidden unless JavaScript runs: <html class="js"> is set by an inline line in <head> before paint.
 * - prefers-reduced-motion: every animation and transition here is switched off and everything shows at once.
 * One easing for the whole site, so it moves as one thing.
 */
/* Elements waiting to slide in from the side must not widen the page (clip keeps the sticky header working) */
html, body { overflow-x: clip; }

:root {
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
  --ease-spring: cubic-bezier(0.34, 1.4, 0.64, 1);
}

/* ---------- Scroll reveal: [data-reveal] rises in when it enters the screen; --d staggers siblings ---------- */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 28px, 0);
  transition: opacity 0.8s var(--ease-out), transform 0.9s var(--ease-out);
  transition-delay: calc(var(--d, 0) * 90ms);
}
.js [data-reveal="left"] { transform: translate3d(-32px, 0, 0); }
.js [data-reveal="right"] { transform: translate3d(32px, 0, 0); }
.js [data-reveal="scale"] { transform: scale(0.96); transform-origin: 50% 100%; }
.js [data-reveal="fade"] { transform: none; }
.js [data-reveal].is-in { opacity: 1; transform: none; }
/* Once it's in, hovers on it react at once (no stagger delay, a short transition) */
.js [data-reveal].is-settled { transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out), background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.35s var(--ease-out); }

/* ---------- Hero: words rise one after another, then the buttons, then the product rises into view ---------- */
.js .hero-word {
  display: inline-block;
  opacity: 0;
  transform: translate3d(0, 0.45em, 0) rotate(2deg);
  filter: blur(6px);
  animation: hero-word 0.9s var(--ease-out) forwards;
  animation-delay: calc(120ms + var(--w) * 70ms);
}
@keyframes hero-word { to { opacity: 1; transform: none; filter: blur(0); } }

/* ONLINE: a green underline draws itself under it once it's in */
.hero-online { position: relative; display: inline-block; }
.js .hero-online::after {
  content: "";
  position: absolute; left: 4%; right: 6%; bottom: 0.02em; height: 0.07em;
  border-radius: 999px; background: #059669; opacity: 0.22;
  transform: scaleX(0); transform-origin: 0 50%;
  animation: draw-x 0.9s var(--ease-out) 1.05s forwards;
}
@keyframes draw-x { to { transform: scaleX(1); } }

.js .hero-fade { opacity: 0; transform: translate3d(0, 16px, 0); animation: rise 0.8s var(--ease-out) forwards; animation-delay: var(--delay, 0.7s); }
@keyframes rise { to { opacity: 1; transform: none; } }

.js .hero-panel { opacity: 0; transform: translate3d(0, 80px, 0); animation: panel-rise 1.2s var(--ease-out) forwards; animation-delay: var(--delay, 0.9s); }
@keyframes panel-rise { to { opacity: 1; transform: translate3d(0, var(--parallax, 0px), 0); } }
.hero-panel.is-done { opacity: 1; animation: none; transform: translate3d(0, var(--parallax, 0px), 0); }

/* The payment card arrives like a notification; the toggles then show the admin's control */
.js .hero-ping { opacity: 0; transform: translate3d(0, -14px, 0) scale(0.96); animation: ping-in 0.7s var(--ease-spring) 1.9s forwards; }
@keyframes ping-in { to { opacity: 1; transform: none; } }
.hero-ping-dot { position: relative; }
.hero-ping-dot::after {
  content: ""; position: absolute; inset: -4px; border-radius: 999px; border: 2px solid #059669; opacity: 0;
}
.js .hero-ping-dot::after { animation: ring 1.6s var(--ease-out) 2.3s 2; }
@keyframes ring { 0% { opacity: 0.6; transform: scale(0.6); } 100% { opacity: 0; transform: scale(1.8); } }

.hero-toggle { transition: background-color 0.35s var(--ease-in-out); }
.hero-toggle > span { transition: transform 0.35s var(--ease-spring); }
.hero-toggle[data-on="true"] { background-color: #3730A3; }
.hero-toggle[data-on="false"] { background-color: #C9CBE8; }
.hero-toggle[data-on="true"] > span { transform: translateX(20px); }

/* ---------- Header: a shadow once the page scrolls; the section you're in is marked ---------- */
.site-header { transition: box-shadow 0.3s ease, border-color 0.3s ease; }
.site-header.is-scrolled { box-shadow: 0 6px 24px rgba(15, 23, 42, 0.07); border-color: transparent; }
.nav-link { position: relative; padding: 6px 0; }
.nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; border-radius: 2px;
  background: #F5A524; transform: scaleX(0); transition: transform 0.35s var(--ease-out);
}
.nav-link:hover::after, .nav-link[aria-current="true"]::after { transform: scaleX(1); }

/* ---------- Buttons: lift on hover, press in on click ---------- */
.btn-motion { transition: transform 0.25s var(--ease-out), box-shadow 0.25s var(--ease-out), background-color 0.2s ease; }
.btn-motion:hover { transform: translateY(-2px); box-shadow: 0 10px 24px -8px rgba(15, 23, 42, 0.35); }
.btn-motion:active { transform: translateY(0) scale(0.98); box-shadow: none; transition-duration: 0.08s; }
.btn-motion .btn-arrow { display: inline-block; transition: transform 0.25s var(--ease-out); }
.btn-motion:hover .btn-arrow { transform: translateX(3px); }

/* ---------- Who it's for: the open card's points unfold; the preview swaps with a slide ---------- */
.who-points { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.45s var(--ease-out), opacity 0.35s ease; opacity: 0; }
.who-points > ul { overflow: hidden; min-height: 0; }
.who-points.is-open { grid-template-rows: 1fr; opacity: 1; }
[data-tab-card] { transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.35s var(--ease-out), transform 0.35s var(--ease-out); }
[data-tab-card]:not(.is-open):hover { transform: translateX(4px); border-color: #C9CBE8; }
[data-dot] { transition: background-color 0.3s ease, transform 0.4s var(--ease-spring); }
[data-tab-card].is-open [data-dot] { transform: scale(1.15); }
.who-preview-in { animation: preview-in 0.55s var(--ease-out); }
@keyframes preview-in { from { opacity: 0; transform: translate3d(0, 18px, 0) scale(0.98); } to { opacity: 1; transform: none; } }
.who-preview-in .who-row { animation: row-in 0.5s var(--ease-out) backwards; animation-delay: calc(140ms + var(--r) * 70ms); }
@keyframes row-in { from { opacity: 0; transform: translate3d(0, 10px, 0); } }

/* ---------- Feature cards: icon nudges on hover ---------- */
.feature-card { transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out); }
.feature-card:hover { transform: translateY(-6px); box-shadow: 0 24px 50px -20px rgba(0, 0, 0, 0.55); }
.feature-card .feature-icon { transition: transform 0.45s var(--ease-spring), background-color 0.3s ease; }
.feature-card:hover .feature-icon { transform: rotate(-8deg) scale(1.08); background-color: #FEF3C7; }

/* ---------- Live in four steps: the amber line slides to the open step; its content slides in ---------- */
.step-indicator { position: absolute; bottom: 0; left: 0; height: 3px; background: #F59E0B; transition: transform 0.5s var(--ease-out), width 0.5s var(--ease-out); }
.step-in .step-copy > * { animation: rise 0.55s var(--ease-out) backwards; }
.step-in .step-copy > *:nth-child(2) { animation-delay: 60ms; }
.step-in .step-copy > *:nth-child(3) { animation-delay: 120ms; }
.step-in .step-copy > *:nth-child(4) { animation-delay: 180ms; }
.step-in .step-art > * { animation: art-in 0.7s var(--ease-out) backwards 80ms; }
@keyframes art-in { from { opacity: 0; transform: translate3d(40px, 0, 0) scale(0.97); } }
.step-in .step-art .step-art-late { animation: art-in 0.7s var(--ease-out) backwards 260ms; }
[data-num] { transition: background-color 0.3s ease, color 0.3s ease, transform 0.4s var(--ease-spring); }
[aria-selected="true"] > [data-num] { transform: scale(1.1); }

/* ---------- FAQ: answers open and close smoothly; the + turns into − ---------- */
.faq-body { overflow: hidden; }
.faq-icon { transition: background-color 0.3s ease, transform 0.4s var(--ease-spring); }
details[open] .faq-icon { transform: rotate(180deg); }
.faq-icon .faq-v { transition: transform 0.3s var(--ease-out); transform-origin: 50% 50%; }
details[open] .faq-icon .faq-v { transform: scaleY(0); }
.faq-row.is-closing .faq-icon { transform: none; background-color: #F1F5F9; }
.faq-row.is-closing .faq-icon .faq-v { transform: none; }
.faq-row summary { transition: color 0.2s ease; }
.faq-row summary:hover { color: #4F46E5; }

/* ---------- Final call to action: "Teach." writes itself in ---------- */
.js .cta-teach { display: inline-block; clip-path: inset(0 100% 0 0); transition: clip-path 1.1s var(--ease-in-out) 0.35s; }
.js .is-in .cta-teach { clip-path: inset(0 -10% 0 0); }

/* ---------- Book a call: the modal grows in; the tick draws itself ---------- */
#book-dialog[open] { animation: dialog-in 0.45s var(--ease-out); }
#book-dialog[open]::backdrop { animation: backdrop-in 0.35s ease; }
#book-dialog.is-closing { animation: dialog-out 0.22s ease-in forwards; }
#book-dialog.is-closing::backdrop { animation: backdrop-out 0.22s ease-in forwards; }
@keyframes dialog-in { from { opacity: 0; transform: translate3d(0, 24px, 0) scale(0.97); } }
@keyframes dialog-out { to { opacity: 0; transform: translate3d(0, 12px, 0) scale(0.98); } }
@keyframes backdrop-in { from { opacity: 0; } }
@keyframes backdrop-out { to { opacity: 0; } }
.book-step-in { animation: rise 0.45s var(--ease-out); }
.tick-circle { animation: tick-pop 0.6s var(--ease-spring) backwards; }
.tick-path { stroke-dasharray: 24; stroke-dashoffset: 24; animation: tick-draw 0.5s var(--ease-out) 0.25s forwards; }
@keyframes tick-pop { from { transform: scale(0.4); opacity: 0; } }
@keyframes tick-draw { to { stroke-dashoffset: 0; } }
.field-shake { animation: shake 0.4s var(--ease-in-out); }
@keyframes shake { 20% { transform: translateX(-6px); } 40% { transform: translateX(5px); } 60% { transform: translateX(-3px); } 80% { transform: translateX(2px); } }
.btn-busy { position: relative; color: transparent !important; }
.btn-busy::after {
  content: ""; position: absolute; left: 50%; top: 50%; width: 20px; height: 20px; margin: -10px 0 0 -10px;
  border-radius: 50%; border: 2.5px solid #0F172A; border-right-color: transparent; animation: spin 0.7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- Reduced motion: no movement anywhere, everything shows at once ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-delay: 0ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; transition-delay: 0ms !important; scroll-behavior: auto !important; }
  .js [data-reveal], .js .hero-word, .js .hero-fade, .js .hero-panel, .js .hero-ping { opacity: 1 !important; transform: none !important; filter: none !important; }
  .js .cta-teach { clip-path: none !important; }
  .tick-path { stroke-dashoffset: 0; }
}
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- Hero headline (24 Nov 2026): the institution word rotates under an amber highlighter; hovering the
   headline pauses it, ONLINE ripples, and a soft light follows the cursor across the hero ---------- */
.hero-rotator { position: relative; display: inline-block; vertical-align: bottom; white-space: nowrap; transition: width 0.6s var(--ease-out); }
.hero-rotator::before { /* the highlighter */
  content: ""; position: absolute; left: -0.08em; right: -0.08em; bottom: 0.1em; height: 0.34em; z-index: -1;
  border-radius: 0.12em 0.2em 0.16em 0.1em; background: #FCD34D; opacity: 0.55;
  transform: scaleX(0); transform-origin: 0 50%;
}
.js .hero-rotator.is-marked::before { animation: marker 0.75s var(--ease-out) forwards; }
@keyframes marker { 0% { transform: scaleX(0); } 100% { transform: scaleX(1); } }
.hero-rotor-word { display: inline-block; }
.hero-rotor-word.is-entering { animation: word-in 0.6s var(--ease-out) backwards; }
.hero-rotor-word.is-leaving { position: absolute; left: 0; top: 0; animation: word-out 0.45s var(--ease-in-out) forwards; }
@keyframes word-out { to { opacity: 0; transform: translate3d(0, -0.45em, 0); filter: blur(4px); } }
@keyframes word-in { from { opacity: 0; transform: translate3d(0, 0.5em, 0); filter: blur(4px); } }

.hero-letter { display: inline-block; }
.hero-title:hover .hero-letter { animation: letter-wave 0.7s var(--ease-out); animation-delay: calc(var(--l) * 55ms); }
@keyframes letter-wave { 35% { transform: translate3d(0, -0.12em, 0); color: #047857; } }
.js .hero-online::after { transition: opacity 0.3s ease; }
.hero-title:hover .hero-online::after { opacity: 0.4; }

.hero-glow {
  position: absolute; inset: 0; pointer-events: none; z-index: 0; opacity: 0; transition: opacity 0.6s ease;
  background: radial-gradient(520px circle at var(--mx, 50%) var(--my, 30%), rgba(245, 165, 36, 0.13), rgba(5, 150, 105, 0.05) 45%, transparent 70%);
}
[data-hero] > :not(.hero-glow) { position: relative; z-index: 1; }
[data-hero].is-lit .hero-glow { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  .hero-glow { display: none; }
  .hero-rotator::before { transform: scaleX(1); }
}
