/* ==========================================================================
   NerdyPal marketing site — visual prototype (sections 1–4)
   Brand source: NerdyPal iOS app (GlassDesignSystem / OnboardingView palette)
   RTL-ready: logical properties only; no physical left/right values.
   ========================================================================== */

:root {
  /* Deep navy foundation (app onboarding + lecture-prep backgrounds) */
  --bg-0: #04060c;
  --bg-1: #0d0d26;
  --bg-2: #0d1a38;

  /* Brand accents (app cyan→blue identity) */
  --cyan: #00bcd4;
  --sky: #32ade6;
  --blue: #007aff;
  --grad: linear-gradient(120deg, var(--cyan), var(--sky) 45%, var(--blue));

  /* Ink */
  --ink: #eef3fa;
  --muted: #a7b6c8;
  --faint: #64748b;

  /* Liquid Glass recipe (LiquidGlassCard) */
  --glass-fill: linear-gradient(135deg,
      rgba(0, 188, 212, .14), rgba(0, 122, 255, .10) 55%, rgba(102, 212, 190, .05));
  --glass-stroke: rgba(255, 255, 255, .16);
  --glass-glow: 0 10px 30px rgba(0, 0, 0, .35), 0 6px 24px rgba(0, 188, 212, .12);

  --radius-card: 20px;
  --radius-pill: 999px;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Segoe UI",
      Roboto, "Helvetica Neue", Arial, sans-serif;

  --wrap: 1120px;
  --ease-out: cubic-bezier(.22, .8, .3, 1);
}

/* ---------- Reset & base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg-0);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: clip;
}

img { max-width: 100%; height: auto; display: block; }

h1, h2, h3, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

a { color: inherit; text-decoration: none; }

:focus-visible {
  outline: 2px solid var(--cyan);
  outline-offset: 3px;
  border-radius: 6px;
}

.wrap {
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.skip-link {
  position: absolute;
  inset-block-start: -3rem;
  inset-inline-start: 1rem;
  z-index: 100;
  padding: .5rem 1rem;
  background: var(--bg-2);
  border-radius: 8px;
  transition: inset-block-start .2s;
}
.skip-link:focus-visible { inset-block-start: 1rem; }

/* ---------- Shared brand pieces ---------- */
.grad-text {
  background: var(--grad);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.dim-text { color: var(--faint); }

.glass-card {
  background: var(--glass-fill);
  border: 1px solid var(--glass-stroke);
  border-radius: var(--radius-card);
  box-shadow: var(--glass-glow);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

.glass-chip {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .35rem .9rem;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-stroke);
  background: rgba(255, 255, 255, .05);
  font-size: .85rem;
  color: var(--muted);
}

.badge-verified {
  display: inline-flex;
  align-items: center;
  gap: .3rem;
  padding: .25rem .8rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(72, 199, 142, .45);
  background: rgba(38, 116, 79, .18);
  color: #5ede9f;
  font-size: .82rem;
  font-weight: 600;
  white-space: nowrap;
}

.badge-lang {
  padding: .25rem .8rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(50, 173, 230, .45);
  background: rgba(0, 122, 255, .12);
  color: var(--sky);
  font-size: .82rem;
  font-weight: 600;
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  inset-block-start: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg-0) 72%, transparent);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-block-end: 1px solid rgba(255, 255, 255, .06);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: .7rem;
}

.brand { display: inline-flex; align-items: center; gap: .6rem; }
.brand-icon { border-radius: 9px; }
.brand-name { font-weight: 700; font-size: 1.15rem; letter-spacing: -.01em; }

.lang-switch {
  display: inline-flex;
  gap: .25rem;
  padding: .25rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .04);
}
.lang-btn {
  padding: .35rem 1rem;
  border-radius: var(--radius-pill);
  font-size: .88rem;
  font-weight: 600;
  color: var(--muted);
  transition: all .3s var(--ease-out);
}
.lang-btn:hover { color: var(--ink); }
.lang-btn.is-active {
  background: linear-gradient(120deg, rgba(0, 188, 212, .22), rgba(0, 122, 255, .2));
  border: 0;
  color: var(--ink);
}

/* ---------- Section scaffolding ---------- */
.section { padding-block: clamp(5rem, 12vh, 8.5rem); position: relative; }

.section-head h2 {
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  line-height: 1.12;
  letter-spacing: -.02em;
  font-weight: 800;
  text-wrap: balance;
}

.section-head p {
  margin-block-start: 1rem;
  max-width: 34em;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
}

.section-head.center { text-align: center; }
.section-head.center p { margin-inline: auto; }

/* ---------- Scroll reveal ---------- */
.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .7s var(--ease-out), transform .7s var(--ease-out);
}
.reveal[data-delay="1"] { transition-delay: .1s; }
.reveal[data-delay="2"] { transition-delay: .2s; }
.reveal[data-delay="3"] { transition-delay: .32s; }
.reveal[data-delay="4"] { transition-delay: .45s; }
.reveal.in { opacity: 1; transform: none; }

/* ==========================================================================
   1 · HERO
   ========================================================================== */
.hero {
  position: relative;
  padding-block: clamp(3.5rem, 9vh, 7rem) clamp(4rem, 10vh, 7rem);
  background:
    radial-gradient(60% 50% at 20% 0%, rgba(13, 26, 56, .9), transparent 70%),
    radial-gradient(50% 40% at 85% 20%, rgba(0, 188, 212, .10), transparent 70%),
    var(--bg-0);
  overflow: clip;
}

.hero-glow {
  position: absolute;
  inset-inline-end: -12%;
  inset-block-start: 8%;
  width: min(48vw, 640px);
  aspect-ratio: 1;
  background: radial-gradient(closest-side, rgba(0, 122, 255, .18), transparent 70%);
  filter: blur(20px);
  pointer-events: none;
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  align-items: center;
  gap: clamp(2rem, 5vw, 4.5rem);
  position: relative;
}

.hero-copy h1 {
  font-size: clamp(2.5rem, 6.2vw, 4.4rem);
  line-height: 1.05;
  letter-spacing: -.025em;
  font-weight: 800;
  text-wrap: balance;
}

.hero-sub {
  margin-block-start: 1.4rem;
  max-width: 30em;
  font-size: clamp(1.05rem, 1.8vw, 1.25rem);
  color: var(--muted);
}

/* CTAs — primary is an availability status until the store URL is approved */
.cta-row {
  margin-block-start: 2rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 1rem 1.4rem;
}

.cta-status {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  padding: .7rem 1.4rem;
  border-radius: var(--radius-pill);
  background: linear-gradient(120deg, rgba(0, 188, 212, .16), rgba(0, 122, 255, .14));
  border: 1px solid rgba(0, 188, 212, .45);
  color: var(--ink);
  font-weight: 650;
  font-size: .98rem;
  cursor: default;
}
.cta-status-dot {
  width: .55rem; height: .55rem;
  border-radius: 50%;
  background: var(--cyan);
  animation: pulse 2.2s ease-in-out infinite;
  flex: none;
}

.cta-secondary {
  font-weight: 650;
  font-size: .98rem;
  color: var(--muted);
  border-block-end: 1px solid transparent;
  transition: all .3s var(--ease-out);
}
.cta-secondary:hover {
  color: var(--cyan);
  border-block-end-color: rgba(0, 188, 212, .5);
}

/* Stage rail — the signature sequence, also the hero's controls */
.stage-rail {
  margin-block-start: 2.2rem;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: .3rem;
}

.rail-link {
  width: .45rem;
  height: 1px;
  background: linear-gradient(90deg, rgba(0,188,212,.5), rgba(0,122,255,.5));
  opacity: .5;
}

.stage-chip {
  display: inline-flex;
  align-items: center;
  gap: .4rem;
  padding: .4rem .7rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .04);
  color: var(--muted);
  font-size: .82rem;
  font-weight: 600;
  transition: all .35s var(--ease-out);
  white-space: nowrap;
}

.stage-chip:hover { border-color: rgba(0, 188, 212, .5); color: var(--ink); }

.stage-chip.is-active {
  background: linear-gradient(120deg, rgba(0, 188, 212, .2), rgba(0, 122, 255, .18));
  border-color: rgba(0, 188, 212, .6);
  color: var(--ink);
  box-shadow: 0 4px 18px rgba(0, 188, 212, .18);
}

.stage-dot { width: .55rem; height: .55rem; border-radius: 50%; background: var(--faint); flex: none; }
.stage-chip.is-active .stage-dot.rec { background: #ff5a5a; animation: pulse 1.4s ease-in-out infinite; }
.stage-chip.is-active .stage-dot.spin { background: var(--cyan); animation: pulse 1.1s ease-in-out infinite; }
.stage-chip.is-active .stage-dot.ok { background: #5ede9f; }
.stage-chip.is-active .stage-dot.notes { background: var(--sky); }

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(.6); opacity: .55; }
}

/* --- Phone frame (shared) --- */
.hero-stage { position: relative; display: grid; justify-items: center; }

.phone {
  position: relative;
  width: min(320px, 78vw);
  aspect-ratio: 1206 / 2622;
  border-radius: clamp(38px, 12vw, 48px);
  background: #000;
  border: 1px solid rgba(255, 255, 255, .14);
  box-shadow:
    inset 0 0 0 6px #0a0d14,
    0 24px 60px rgba(0, 0, 0, .55),
    0 10px 40px rgba(0, 122, 255, .12);
  overflow: hidden;
}

.phone-notch {
  position: absolute;
  inset-block-start: 12px;
  inset-inline-start: 50%;
  transform: translateX(-50%);
  width: 32%;
  height: 22px;
  background: #0a0d14;
  border-radius: var(--radius-pill);
  z-index: 5;
}
:dir(rtl) .phone-notch { transform: translateX(50%); }

.phone-shadow {
  width: 70%;
  height: 34px;
  margin-block-start: 1.4rem;
  border-radius: 50%;
  background: radial-gradient(closest-side, rgba(0, 122, 255, .22), transparent 75%);
  filter: blur(6px);
}

/* --- Hero phone faces --- */
.phone-face {
  position: absolute;
  inset: 6px;
  border-radius: clamp(32px, 10vw, 42px);
  background: linear-gradient(170deg, var(--bg-1), var(--bg-0) 60%);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1.1rem;
  padding: 2rem 1.4rem;
  text-align: center;
  overflow: hidden;
  opacity: 0;
  transform: scale(.985);
  transition: opacity .6s var(--ease-out), transform .6s var(--ease-out);
  pointer-events: none;
}
.phone-face.is-shown { opacity: 1; transform: none; }

.stage-shot { padding: 0; background: #000; }
.face-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: inherit;
}

.face-course h3 { font-size: 1.05rem; font-weight: 700; line-height: 1.3; }
.face-course p { margin-block-start: .3rem; font-size: .78rem; color: var(--faint); }

.face-foot { font-size: .8rem; color: var(--faint); max-width: 20em; }

/* Recording face */
.rec-pill { color: #ff8080; border-color: rgba(255, 90, 90, .4); font-weight: 600; }
.rec-dot {
  width: .6rem; height: .6rem; border-radius: 50%;
  background: #ff5a5a; flex: none;
  animation: pulse 1.4s ease-in-out infinite;
}

.waveform {
  display: flex;
  align-items: center;
  gap: 3px;
  height: 54px;
}
.waveform i {
  width: 4px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
  height: 30%;
  animation: wave 1.15s ease-in-out infinite;
}
.waveform i:nth-child(3n)  { animation-delay: .12s; }
.waveform i:nth-child(3n+1){ animation-delay: .3s; }
.waveform i:nth-child(4n)  { animation-delay: .48s; }
.waveform i:nth-child(5n)  { animation-delay: .2s; height: 45%; }
.waveform i:nth-child(7n)  { animation-delay: .6s; }
@keyframes wave {
  0%, 100% { transform: scaleY(.45); }
  50% { transform: scaleY(1.6); }
}

.rec-timer {
  font-size: 2rem;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
}

/* Processing face */
.proc-list {
  width: 100%;
  display: grid;
  gap: .9rem;
  text-align: start;
}
.proc-list li {
  display: flex;
  align-items: center;
  gap: .8rem;
  opacity: .45;
}
.proc-list li.done, .proc-list li.working { opacity: 1; }

.proc-badge {
  flex: none;
  width: 2rem; height: 2rem;
  display: grid; place-items: center;
  border-radius: 12px;
  background: rgba(0, 188, 212, .14);
  border: 1px solid rgba(0, 188, 212, .3);
  color: var(--cyan);
  font-size: .9rem;
}
.proc-badge.spin {
  position: relative;
}
.proc-badge.spin::after {
  content: "";
  width: .9rem; height: .9rem;
  border-radius: 50%;
  border: 2px solid rgba(0, 188, 212, .3);
  border-block-start-color: var(--cyan);
  animation: rotate 1s linear infinite;
}
@keyframes rotate { to { transform: rotate(360deg); } }

.proc-label { font-size: .88rem; font-weight: 600; line-height: 1.3; }
.proc-label em { display: block; font-style: normal; font-weight: 400; font-size: .74rem; color: var(--faint); }
.proc-pct { margin-inline-start: auto; font-size: .8rem; color: var(--cyan); font-variant-numeric: tabular-nums; }

.proc-bar {
  width: 100%;
  height: 5px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .08);
  overflow: hidden;
}
.proc-bar span {
  display: block;
  height: 100%;
  width: 62%;
  border-radius: inherit;
  background: var(--grad);
  animation: fill 3s var(--ease-out) infinite alternate;
  transform-origin: 0 50%;
}
:dir(rtl) .proc-bar span { transform-origin: 100% 50%; }
@keyframes fill { from { transform: scaleX(.55); } to { transform: scaleX(.85); } }

/* Ready face */
.ready-check {
  width: 74px; height: 74px;
  display: grid; place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, rgba(94, 222, 159, .2), rgba(0, 188, 212, .15));
  border: 1px solid rgba(94, 222, 159, .5);
  font-size: 2rem;
  color: #5ede9f;
  box-shadow: 0 8px 30px rgba(94, 222, 159, .2);
}
.ready-title { font-size: 1.3rem; font-weight: 800; }
.ready-badges { display: flex; gap: .5rem; }
.ready-list { display: grid; gap: .45rem; font-size: .92rem; color: var(--muted); }
.ready-list li::before { content: "· "; color: var(--cyan); }

/* --- Recreated app screens (flashcards / quiz / chat) ---
   Faithful to the app's dark UI so recreated states sit next to real
   screenshots without a visible seam. Reusable for future sections. */
.app-face {
  justify-content: flex-start;
  align-items: stretch;
  text-align: start;
  gap: .7rem;
  padding: 2.6rem .95rem 1.1rem;
  background: #000;
}

/* Fixed-height phone face: never crush rows to fit — clip at the bottom */
.app-face > * { flex-shrink: 0; }
.app-head h3 { font-size: .92rem; font-weight: 700; line-height: 1.3; }
.app-head p { margin-block-start: .2rem; font-size: .68rem; color: var(--faint); }

.app-tabs {
  display: flex;
  gap: .35rem;
  flex-wrap: wrap;
}
.app-tabs span {
  padding: .28rem .7rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .07);
  font-size: .66rem;
  font-weight: 600;
  color: var(--muted);
  white-space: nowrap;
}
.app-tabs .is-on { background: var(--cyan); color: #04222a; }


/* Flashcard state (mirrors FlashcardsReviewView: Knew it / Review again) */
.flash-card {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .8rem;
  border-radius: 16px;
  background: rgba(255, 255, 255, .05);
  padding: 1rem .9rem;
  text-align: center;
}
.flash-count { font-size: .68rem; font-weight: 700; color: var(--cyan); }
.flash-q { font-size: .95rem; font-weight: 750; line-height: 1.5; }
.flash-hint { font-size: .66rem; color: var(--faint); }
.flash-actions { display: flex; gap: .5rem; }
.flash-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35rem;
  padding: .6rem;
  border-radius: 14px;
  font-size: .74rem;
  font-weight: 700;
}
.flash-knew {
  background: rgba(94, 222, 159, .14);
  border: 1px solid rgba(94, 222, 159, .45);
  color: #5ede9f;
}
.flash-again {
  background: rgba(255, 159, 10, .12);
  border: 1px solid rgba(255, 159, 10, .4);
  color: #ffb340;
}

/* Quiz state (mirrors QuizView: lettered options, reveal, feedback card) */
.quiz-block { display: grid; gap: .5rem; flex: 1; align-content: start; }
.quiz-count {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: .66rem;
  font-weight: 700;
  color: var(--cyan);
}
.quiz-score { color: #5ede9f; }
.quiz-q { font-size: .8rem; font-weight: 750; line-height: 1.5; }
.quiz-opts { display: grid; gap: .35rem; }
.quiz-opts li {
  display: flex;
  align-items: center;
  gap: .45rem;
  padding: .42rem .6rem;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .16);
  background: rgba(255, 255, 255, .03);
  font-size: .66rem;
  line-height: 1.4;
  color: var(--muted);
}
.q-letter {
  flex: none;
  width: 1.1rem;
  height: 1.1rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, .3);
  font-style: normal;
  font-size: .54rem;
  font-weight: 700;
}
.quiz-opts .is-correct {
  border-color: rgba(94, 222, 159, .6);
  background: rgba(38, 116, 79, .14);
  color: #a9ecc8;
}
.is-correct .q-letter.q-check { border-color: rgba(94, 222, 159, .6); color: #5ede9f; }
.quiz-fb {
  border-radius: 12px;
  border: 1px solid rgba(94, 222, 159, .4);
  background: rgba(38, 116, 79, .12);
  padding: .5rem .7rem;
  display: grid;
  gap: .25rem;
}
.quiz-fb-title { font-size: .68rem; font-weight: 750; color: #5ede9f; }
.quiz-fb-expl { font-size: .62rem; line-height: 1.5; color: var(--muted); }
.quiz-next {
  display: block;
  text-align: center;
  padding: .65rem;
  border-radius: var(--radius-pill);
  background: var(--cyan);
  color: #04222a;
  font-size: .78rem;
  font-weight: 750;
}

/* Explanation chat state (mirrors the chat + collapsible source block) */
.chat-block { display: grid; gap: .55rem; align-content: start; }
.chat-q {
  justify-self: end;
  max-width: 92%;
  padding: .6rem .8rem;
  border-radius: 14px;
  border-start-end-radius: 4px;
  background: rgba(0, 90, 110, .45);
  font-size: .72rem;
  line-height: 1.5;
}
.chat-a {
  justify-self: start;
  max-width: 94%;
  padding: .6rem .8rem;
  border-radius: 14px;
  border-start-start-radius: 4px;
  background: rgba(255, 255, 255, .06);
  display: grid;
  gap: .45rem;
}
.chat-a p:first-child { font-size: .72rem; line-height: 1.55; color: var(--ink); }
.src-toggle {
  display: flex;
  align-items: center;
  gap: .35rem;
  font-size: .62rem;
  font-weight: 650;
  color: var(--cyan);
}
.src-card {
  border-radius: 12px;
  background: rgba(255, 255, 255, .05);
  border: 1px solid rgba(255, 255, 255, .1);
  padding: .5rem .7rem;
  display: grid;
  gap: .3rem;
}
.src-cap { font-size: .58rem; font-weight: 700; color: var(--cyan); }
.src-body { font-size: .64rem; line-height: 1.5; color: var(--muted); }
.chat-input {
  margin-block-start: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: .5rem;
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: var(--radius-pill);
  padding: .45rem .8rem;
  font-size: .64rem;
  color: var(--faint);
}
.chat-send { color: var(--cyan); }
:dir(rtl) .chat-send { transform: scaleX(-1); }

/* ==========================================================================
   2 · ONE LECTURE, EVERYTHING YOU NEED (scroll transformation)
   ========================================================================== */
.flow {
  background:
    radial-gradient(55% 35% at 80% 8%, rgba(13, 26, 56, .8), transparent 70%),
    var(--bg-0);
}

.lecture-chip {
  margin-block-start: 2.6rem;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1.4rem;
}
.lecture-mic { font-size: 1.4rem; }
.lecture-meta { display: grid; line-height: 1.35; }
.lecture-meta strong { font-size: .98rem; }
.lecture-meta span { font-size: .82rem; color: var(--muted); }

.flow-grid {
  margin-block-start: 1rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2rem, 6vw, 5rem);
  /* Columns stretch to full row height so the sticky phone can travel */
}
.flow-steps { grid-column: 1; grid-row: 1; }
.flow-stage { grid-column: 2; grid-row: 1; }

/* Steps + connecting thread */
.flow-steps {
  position: relative;
  padding-inline-start: 2rem;
  display: grid;
  align-content: start;
  gap: clamp(6rem, 22vh, 11rem);
  /* Trailing padding keeps the phone fully pinned while the last step is read */
  padding-block: clamp(3rem, 10vh, 5rem) clamp(10rem, 24vh, 14rem);
}

.flow-thread {
  position: absolute;
  inset-block: 0;
  inset-inline-start: .45rem;
  width: 2px;
  background: rgba(255, 255, 255, .08);
  border-radius: 1px;
  overflow: hidden;
}
.flow-thread-fill {
  display: block;
  width: 100%;
  height: 0%;
  background: var(--grad);
  transition: height .4s var(--ease-out);
}

.flow-step {
  position: relative;
  transition: opacity .45s var(--ease-out);
  opacity: .38;
  scroll-margin-block: 40vh;
}
.flow-step::before {
  content: "";
  position: absolute;
  inset-inline-start: -2rem;
  inset-block-start: .5rem;
  width: .95rem; height: .95rem;
  border-radius: 50%;
  background: var(--bg-1);
  border: 2px solid rgba(255, 255, 255, .2);
  transform: translateX(-.075rem);
  transition: all .35s var(--ease-out);
}
:dir(rtl) .flow-step::before { transform: translateX(.075rem); }

.flow-step.is-active { opacity: 1; }
.flow-step.is-active::before {
  background: var(--cyan);
  border-color: rgba(0, 188, 212, .8);
  box-shadow: 0 0 16px rgba(0, 188, 212, .55);
}

.flow-step h3 {
  display: flex;
  align-items: baseline;
  gap: .7rem;
  font-size: clamp(1.25rem, 2.4vw, 1.6rem);
  font-weight: 750;
  letter-spacing: -.015em;
}
.step-num {
  font-size: .8rem;
  font-weight: 700;
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
}
.flow-step p {
  margin-block-start: .6rem;
  color: var(--muted);
  max-width: 26em;
}

/* Sticky phone + contextual caption travel together */
.flow-stage { position: relative; }
.stage-pin {
  position: sticky;
  inset-block-start: clamp(3.6rem, 8vh, 5rem);
  display: grid;
  justify-items: center;
  gap: 1rem;
}
/* Slightly smaller than the hero phone so the caption fits below the fold */
.stage-pin .phone { width: min(288px, 78vw); }

/* Restrained micro-information that crossfades with each state */
.stage-captions {
  display: grid;
  justify-items: center;
  min-height: 1.3em;
  font-size: .84rem;
  color: var(--faint);
}
.stage-cap {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(4px);
  transition: opacity .5s var(--ease-out), transform .5s var(--ease-out);
  white-space: nowrap;
}
.stage-cap.is-shown { opacity: 1; transform: none; }

.flow-note {
  margin-block-start: 2.5rem;
  text-align: center;
  color: var(--faint);
  font-size: .95rem;
}

/* ==========================================================================
   3 · FOCUS ON THE LECTURE (typography-led)
   ========================================================================== */
.focus {
  background: linear-gradient(180deg, var(--bg-0), var(--bg-1) 55%, var(--bg-0));
  overflow: clip;
}
.focus-glow {
  position: absolute;
  inset-inline-start: 50%;
  inset-block-start: 40%;
  transform: translate(-50%, -50%);
  width: min(70vw, 800px);
  aspect-ratio: 1.6;
  background: radial-gradient(closest-side, rgba(0, 188, 212, .09), transparent 70%);
  pointer-events: none;
}
:dir(rtl) .focus-glow { transform: translate(50%, -50%); }

.focus-inner { position: relative; display: grid; justify-items: center; }

.focus-lines {
  margin-block-start: clamp(3rem, 8vh, 5rem);
  text-align: center;
  display: grid;
  gap: .4rem;
}
.focus-line {
  font-size: clamp(1.7rem, 4.6vw, 3.1rem);
  font-weight: 800;
  letter-spacing: -.02em;
  line-height: 1.2;
  color: var(--ink);
}
.focus-line:nth-child(2) { color: var(--muted); }
.focus-line:nth-child(3) { color: var(--faint); }
.focus-line-grad { margin-block-start: 1.6rem; }

.focus-chip {
  margin-block-start: clamp(3rem, 8vh, 4.5rem);
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  padding: .8rem 1.6rem;
  border-radius: var(--radius-pill);
}
.mini-wave { display: flex; align-items: center; gap: 3px; height: 22px; }
.mini-wave i {
  width: 3px; border-radius: 2px; height: 40%;
  background: linear-gradient(180deg, var(--cyan), var(--blue));
  animation: wave 1.3s ease-in-out infinite;
}
.mini-wave i:nth-child(2n) { animation-delay: .18s; }
.mini-wave i:nth-child(3n) { animation-delay: .34s; height: 60%; }
.mini-wave i:nth-child(5n) { animation-delay: .5s; }
.focus-chip-time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: .95rem; }

.focus-foot {
  margin-block-start: clamp(2.5rem, 6vh, 3.5rem);
  max-width: 34em;
  text-align: center;
  color: var(--muted);
  font-size: clamp(1rem, 1.6vw, 1.15rem);
}

/* ==========================================================================
   4 · SMART SUMMARY (trust)
   ========================================================================== */
.trust {
  background:
    radial-gradient(50% 40% at 15% 20%, rgba(13, 26, 56, .75), transparent 70%),
    var(--bg-0);
}

.trust-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, .9fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}

.trust-points {
  margin-block-start: 2.5rem;
  display: grid;
  gap: 1.6rem;
}
.trust-points li { display: flex; gap: 1rem; align-items: flex-start; }

.point-mark {
  flex: none;
  min-width: 2.6rem;
  height: 2.6rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-size: .85rem;
  font-weight: 700;
}
.point-src {
  padding-inline: .5rem;
  background: rgba(0, 188, 212, .12);
  border: 1px solid rgba(0, 188, 212, .35);
  color: var(--cyan);
  font-variant-numeric: tabular-nums;
}
.point-honest {
  background: rgba(255, 214, 102, .1);
  border: 1px solid rgba(255, 214, 102, .35);
  color: #ffd666;
}
.trust-points .badge-verified { min-width: 2.6rem; height: 2.6rem; border-radius: 14px; justify-content: center; font-size: 1rem; }

.trust-points strong { font-size: 1.05rem; }
.trust-points p { margin-block-start: .3rem; color: var(--muted); font-size: .95rem; max-width: 30em; }

.trust-cta { margin-block-start: 2.4rem; color: var(--muted); }
.trust-cta strong { color: var(--cyan); }

/* Interactive Notes ⇄ Explain (styled like the app's segment pills) */
.trust-stage { display: grid; justify-items: center; gap: 1.2rem; }

.seg-pills {
  display: inline-flex;
  gap: .4rem;
  padding: .3rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .04);
}
.seg-pill {
  padding: .5rem 1.5rem;
  border-radius: var(--radius-pill);
  font-size: .95rem;
  font-weight: 650;
  color: var(--muted);
  transition: all .3s var(--ease-out);
}
.seg-pill:hover { color: var(--ink); }
.seg-pill.is-active {
  background: var(--cyan);
  color: #04222a;
  box-shadow: 0 4px 16px rgba(0, 188, 212, .35);
}

#trust-screen { position: absolute; inset: 0; }

.trust-caption { font-size: .8rem; color: var(--faint); }

/* ---------- Footer ---------- */
.site-footer {
  border-block-start: 1px solid rgba(255, 255, 255, .06);
  padding-block: 2.2rem;
  background: var(--bg-0);
}
.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}
.footer-note { color: var(--faint); font-size: .88rem; }

/* ==========================================================================
   Arabic typography adaptation — not a mechanical mirror.
   Connected Arabic script must never inherit Latin negative letter-spacing,
   and display sizes need taller leading.
   ========================================================================== */
html[lang="ar"] h1,
html[lang="ar"] h2,
html[lang="ar"] h3,
html[lang="ar"] .focus-line,
html[lang="ar"] .brand-name {
  letter-spacing: 0;
}
html[lang="ar"] .hero-copy h1 { line-height: 1.22; font-size: clamp(2.3rem, 5.6vw, 4rem); }
html[lang="ar"] .section-head h2 { line-height: 1.3; }
html[lang="ar"] .focus-line { line-height: 1.4; }

/* ==========================================================================
   Design-system note (third signature moment, not built yet):
   a later "one long lecture → a complete study session" section should reuse
   .phone + .phone-face states, the .app-face screen recreations, the
   .stage-pin/.stage-captions pinned-transform pattern, and .stage-chip rails —
   no new primitives should be needed.
   ========================================================================== */

/* ==========================================================================
   Responsive
   ========================================================================== */
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { text-align: center; }
  .hero-sub { margin-inline: auto; }
  .stage-rail { justify-content: center; }
  .rail-link { display: none; }
  .cta-row { justify-content: center; }
  .hero-stage { margin-block-start: 1rem; }

  /* Flow section: block layout so the phone (first in DOM) can pin
     while the steps scroll beneath its faded backdrop */
  .flow-grid { display: block; }
  .flow-stage {
    position: sticky;
    inset-block-start: 3.4rem;
    z-index: 5;
    display: grid;
    justify-items: center;
    padding-block: 1rem 1.6rem;
    background: linear-gradient(180deg, var(--bg-0) 82%, transparent);
  }
  .flow-stage .phone { width: min(198px, 52vw); }
  .stage-pin { position: static; gap: .7rem; }
  .stage-captions { font-size: .76rem; }
  .stage-pin .app-face { padding: 1.4rem .6rem .7rem; gap: .45rem; }
  .stage-pin .app-tabs span { font-size: .56rem; padding: .2rem .5rem; }
  .stage-pin .flash-q { font-size: .8rem; }
  .stage-pin .quiz-q { font-size: .66rem; }
  .stage-pin .quiz-count { font-size: .6rem; }
  .stage-pin .quiz-block { gap: .35rem; }
  .stage-pin .quiz-opts { gap: .3rem; }
  .stage-pin .quiz-opts li { padding: .32rem .5rem; font-size: .6rem; line-height: 1.35; }
  .stage-pin .quiz-next { display: none; }
  .stage-pin .quiz-fb-expl { font-size: .56rem; }
  .stage-pin .chat-q, .stage-pin .chat-a p:first-child { font-size: .66rem; }
  .stage-pin .src-body { font-size: .58rem; }
  .stage-pin .chat-input { display: none; }
  .stage-pin .n-text { font-size: .62rem; }
  .stage-pin .notes-face .n-card:last-of-type { display: none; }
  .flow-steps {
    /* Trailing room ≈ pinned-stage height, so the last caption clears the
       readable band before the sticky phone releases over it */
    padding-block: 1rem clamp(20rem, 58vh, 30rem);
    gap: clamp(11rem, 34vh, 17rem);
  }
  .flow-step { text-align: center; }
  .flow-step h3 { justify-content: center; }
  .flow-step p { margin-inline: auto; }
  .flow-steps { padding-inline-start: 0; }
  .flow-thread, .flow-step::before { display: none; }

  .trust-grid { grid-template-columns: 1fr; }
  .trust-stage { order: 1; }
}

@media (max-width: 520px) {
  .lang-btn { padding: .3rem .8rem; font-size: .82rem; }
  .phone { width: min(260px, 74vw); }
  .stage-chip { font-size: .8rem; padding: .4rem .8rem; }
  .lecture-chip { width: 100%; }
}

/* ==========================================================================
   Reduced motion — everything readable, nothing moving
   ========================================================================== */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  .reveal { opacity: 1; transform: none; }
  .hint-arrow { animation: none; }
}

/* ==========================================================================
   5 · ATTACHMENTS
   ========================================================================== */
.att {
  background:
    radial-gradient(45% 40% at 85% 15%, rgba(13, 26, 56, .7), transparent 70%),
    var(--bg-0);
}
.att-grid {
  display: grid;
  grid-template-columns: minmax(0, .9fr) minmax(0, 1.1fr);
  gap: clamp(2.5rem, 6vw, 5rem);
  align-items: center;
}
.att-stage { display: grid; justify-items: center; }
.point-att {
  background: rgba(0, 188, 212, .1);
  border: 1px solid rgba(0, 188, 212, .3);
  font-size: 1rem;
}
.att-rule {
  margin-block-start: 2.2rem;
  padding-inline-start: 1rem;
  border-inline-start: 2px solid rgba(0, 188, 212, .45);
  color: var(--muted);
  font-size: .95rem;
  max-width: 32em;
}

/* My Files recreated screen (mirrors notesTab + AttachmentsSectionView) */
.files-priv { font-size: .58rem; color: var(--faint); line-height: 1.5; }
.files-addpill {
  margin-inline-start: auto;
  font-size: .56rem;
  font-weight: 650;
  color: var(--cyan);
  border: 1px solid rgba(0, 188, 212, .4);
  border-radius: var(--radius-pill);
  padding: .08rem .45rem;
  white-space: nowrap;
}
.files-card {
  border-radius: 14px;
  background: rgba(255, 255, 255, .05);
  padding: .65rem .75rem;
  display: grid;
  gap: .45rem;
}
.files-label {
  display: flex;
  align-items: center;
  gap: .4rem;
  font-size: .68rem;
  font-weight: 700;
  color: var(--cyan);
}
.files-note { font-size: .74rem; line-height: 1.5; }
.files-photos { display: flex; gap: .45rem; }
.files-photos span {
  flex: 1;
  aspect-ratio: 1.15;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(160deg, rgba(13, 26, 56, .9), rgba(4, 6, 12, .9));
  border: 1px solid rgba(255, 255, 255, .1);
  font-size: .62rem;
  color: var(--muted);
}
.files-slide { display: flex; align-items: center; gap: .6rem; }
.files-doc {
  flex: none;
  width: 2rem; height: 2rem;
  display: grid; place-items: center;
  border-radius: 10px;
  background: rgba(0, 188, 212, .12);
  border: 1px solid rgba(0, 188, 212, .3);
  font-size: .85rem;
}
.files-file { font-size: .66rem; font-weight: 650; line-height: 1.4; overflow-wrap: anywhere; }
.files-meta { font-size: .6rem; color: var(--faint); margin-block-start: .15rem; }

/* ==========================================================================
   6 · ARABIC / ENGLISH / MIXED
   ========================================================================== */
.bi {
  background: linear-gradient(180deg, var(--bg-0), var(--bg-1) 60%, var(--bg-0));
  overflow: clip;
}
.bi-badges {
  margin-block-start: 2.2rem;
  display: flex;
  justify-content: center;
  gap: .6rem;
  flex-wrap: wrap;
}
.bi-phones {
  margin-block-start: 2.6rem;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  gap: clamp(1rem, 4vw, 3rem);
}
.bi-phone { width: min(250px, 40vw); }
.bi-phone-a { transform: rotate(-3.5deg) translateY(14px); }
.bi-phone-b { transform: rotate(3deg); }
:dir(rtl) .bi-phone-a { transform: rotate(3.5deg) translateY(14px); }
:dir(rtl) .bi-phone-b { transform: rotate(-3deg); }
.trust-caption.center { text-align: center; margin-block-start: 2.2rem; }

/* ==========================================================================
   7 · GO DEEPER — Explain-more concept sheet (mirrors ConceptDetailSheet)
   ========================================================================== */
.deep-face { gap: .8rem; padding-block-start: 2.6rem; }
.deep-eyebrow {
  font-size: .6rem;
  font-weight: 750;
  letter-spacing: .12em;
  color: var(--cyan);
}
html[lang="ar"] .deep-eyebrow { letter-spacing: 0; }
.deep-title { font-size: 1.1rem; font-weight: 800; line-height: 1.3; }
.deep-btn {
  margin-block-start: auto;
  text-align: center;
  border: 1px solid rgba(0, 188, 212, .5);
  color: var(--cyan);
  border-radius: var(--radius-pill);
  padding: .55rem;
  font-size: .72rem;
  font-weight: 700;
}

/* ==========================================================================
   8 · PRIVACY
   ========================================================================== */
.priv {
  background:
    radial-gradient(50% 45% at 50% 30%, rgba(13, 26, 56, .65), transparent 75%),
    var(--bg-0);
}
.priv-inner { max-width: 680px; display: grid; justify-items: center; }
.priv-points {
  margin-block-start: 2.8rem;
  display: grid;
  gap: 1.6rem;
  justify-self: stretch;
}
.priv-points li { display: flex; gap: 1rem; align-items: flex-start; }
.point-priv {
  background: rgba(94, 222, 159, .08);
  border: 1px solid rgba(94, 222, 159, .3);
  font-size: .95rem;
}
.priv-points strong { font-size: 1.05rem; }
.priv-points p { margin-block-start: .3rem; color: var(--muted); font-size: .95rem; }
.priv-foot {
  margin-block-start: 2.4rem;
  color: var(--faint);
  font-size: .92rem;
  text-align: center;
}

/* ==========================================================================
   9 · NOT ANOTHER AI CHAT
   ========================================================================== */
.why { background: var(--bg-0); }
.why-grid {
  margin-block-start: 3rem;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(1.2rem, 3vw, 2rem);
  align-items: stretch;
  max-width: 880px;
  margin-inline: auto;
}
.why-panel { border-radius: var(--radius-card); padding: 1.8rem 1.6rem; }
.why-generic {
  border: 1px dashed rgba(255, 255, 255, .16);
  color: var(--faint);
}
.why-panel-title {
  font-size: .95rem;
  font-weight: 700;
  margin-block-end: 1.1rem;
  color: var(--muted);
}
.why-list { display: grid; gap: .55rem; font-size: .95rem; }
.why-list li::before { content: "· "; }
.why-np { display: grid; align-content: center; gap: .7rem; }
.why-np-title { display: flex; align-items: center; gap: .5rem; color: var(--ink); margin-block-end: .2rem; }
.why-np-title img { border-radius: 6px; }
.why-np-main { font-size: 1.45rem; font-weight: 800; letter-spacing: -.015em; }
.why-np-sub { color: var(--muted); font-size: .98rem; }
.why-close {
  margin-block-start: 3.2rem;
  text-align: center;
  font-size: clamp(1.4rem, 3.2vw, 2.1rem);
  font-weight: 800;
  letter-spacing: -.015em;
  line-height: 1.35;
}

/* ==========================================================================
   10 · SIGNATURE: ONE LECTURE → STUDY SESSION
   Mobile-first: static composition. Desktop (901px+): pinned scene with a
   scroll-scrubbed expansion driven by the --p custom property (default 1,
   so no-JS and reduced-motion get the final state).
   ========================================================================== */
.session {
  background:
    radial-gradient(55% 45% at 50% 45%, rgba(13, 26, 56, .8), transparent 75%),
    var(--bg-0);
}
.session-scene {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: clamp(1.8rem, 4vh, 2.8rem);
  padding-block: clamp(5rem, 12vh, 8rem);
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}
.session-title {
  text-align: center;
  font-size: clamp(1.9rem, 4.5vw, 3rem);
  line-height: 1.15;
  letter-spacing: -.02em;
  font-weight: 800;
  text-wrap: balance;
}
.session-board {
  width: min(1040px, 100%);
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .9rem;
}
.session-pill {
  grid-column: 1 / -1;
  justify-self: center;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
  padding: .9rem 1.4rem;
  border-radius: var(--radius-card);
}
.session-card {
  border-radius: 16px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: linear-gradient(160deg, rgba(13, 26, 56, .85), rgba(4, 6, 12, .92));
  box-shadow: 0 10px 30px rgba(0, 0, 0, .35);
  padding: 1rem 1.1rem;
  display: grid;
  gap: .4rem;
  align-content: start;
  --p: 1;
  opacity: var(--p);
}
.ses-card-title { font-size: .92rem; font-weight: 750; }
.ses-card-label { font-size: .7rem; font-weight: 700; color: var(--cyan); }
.ses-card-body { font-size: .82rem; color: var(--muted); line-height: 1.5; }
.ses-correct { color: #a9ecc8; }
.session-links { display: none; }
.session-close {
  text-align: center;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.2rem);
  font-weight: 650;
}

@media (min-width: 901px) {
  .session { height: 260vh; }
  .session-scene {
    position: sticky;
    inset-block-start: 0;
    height: 100vh;
    box-sizing: border-box;
  }
  .session-board {
    position: relative;
    display: block;
    height: min(56vh, 480px);
    --p: 0;
  }
  .session-pill {
    position: absolute;
    inset-block-start: 50%;
    inset-inline-start: 50%;
    translate: -50% -50%;
    z-index: 2;
    white-space: nowrap;
  }
  :dir(rtl) .session-pill { translate: 50% -50%; }
  .session-card {
    position: absolute;
    width: min(250px, 24vw);
    transform:
      translate(calc(var(--tx) * var(--txm, 1) * (1 - var(--p))),
                calc(var(--ty) * (1 - var(--p))))
      scale(calc(.6 + .4 * var(--p)));
  }
  :dir(rtl) .session-card { --txm: -1; }
  .ses-notes { inset-inline-start: 2%; inset-block-start: 4%; --tx: 300px; --ty: 150px; }
  .ses-cards { inset-inline-start: 6%; inset-block-end: 6%; --tx: 270px; --ty: -140px; }
  .ses-quiz  { inset-inline-end: 2%; inset-block-start: 6%; --tx: -300px; --ty: 140px; }
  .ses-ask   { inset-inline-end: 5%; inset-block-end: 4%; --tx: -280px; --ty: -150px; }

  .session-links { display: block; position: absolute; inset: 0; pointer-events: none; }
  .ses-link {
    position: absolute;
    /* physical coords on purpose: the rotation angles are physical too */
    top: 50%;
    left: 50%;
    width: min(24vw, 300px);
    height: 1px;
    background: linear-gradient(90deg, rgba(0, 188, 212, .45), transparent);
    opacity: calc(var(--p, 1) * .5);
    transform-origin: 0 50%;
  }
  .ses-link-0 { transform: rotate(200deg); }
  .ses-link-1 { transform: rotate(160deg); }
  .ses-link-2 { transform: rotate(-20deg); }
  .ses-link-3 { transform: rotate(20deg); }
  /* Mirrored card layout in RTL → mirror the lines (θ → 180 − θ) */
  :dir(rtl) .ses-link-0 { transform: rotate(-20deg); }
  :dir(rtl) .ses-link-1 { transform: rotate(20deg); }
  :dir(rtl) .ses-link-2 { transform: rotate(200deg); }
  :dir(rtl) .ses-link-3 { transform: rotate(160deg); }
}

/* ==========================================================================
   11 · FINAL CTA
   ========================================================================== */
.cta {
  position: relative;
  overflow: clip;
  background:
    radial-gradient(60% 55% at 50% 20%, rgba(13, 26, 56, .9), transparent 75%),
    var(--bg-0);
}
.cta-glow {
  position: absolute;
  inset-inline-start: 50%;
  inset-block-start: 30%;
  transform: translate(-50%, -50%);
  width: min(60vw, 700px);
  aspect-ratio: 1.4;
  background: radial-gradient(closest-side, rgba(0, 122, 255, .16), transparent 70%);
  filter: blur(10px);
  pointer-events: none;
}
:dir(rtl) .cta-glow { transform: translate(50%, -50%); }
.cta-inner {
  position: relative;
  display: grid;
  justify-items: center;
  text-align: center;
  gap: 1.4rem;
}
.cta-icon {
  border-radius: 20px;
  box-shadow: 0 12px 40px rgba(0, 122, 255, .3);
}
.cta-inner h2 {
  font-size: clamp(2.2rem, 5.5vw, 3.8rem);
  line-height: 1.1;
  letter-spacing: -.02em;
  font-weight: 800;
  text-wrap: balance;
}
.cta-sub { color: var(--muted); font-size: clamp(1rem, 1.8vw, 1.2rem); max-width: 30em; }
.cta-row-center { margin-block-start: .4rem; justify-content: center; }

/* ==========================================================================
   Production footer
   ========================================================================== */
.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2rem;
  padding-block: 2.8rem 2rem;
}
.footer-brand { display: grid; gap: .7rem; align-content: start; justify-items: start; }
.footer-tag { color: var(--faint); font-size: .92rem; }
.footer-col { display: grid; gap: .55rem; align-content: start; justify-items: start; }
.footer-head {
  font-size: .8rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .08em;
  color: var(--faint);
  margin-block-end: .3rem;
}
html[lang="ar"] .footer-head { letter-spacing: 0; text-transform: none; }
.footer-col a { color: var(--muted); font-size: .95rem; transition: color .25s var(--ease-out); }
.footer-col a:hover { color: var(--cyan); }
.footer-bottom {
  border-block-start: 1px solid rgba(255, 255, 255, .06);
  padding-block: 1.4rem;
}

/* ==========================================================================
   New-section responsive
   ========================================================================== */
@media (max-width: 900px) {
  .att-grid { grid-template-columns: 1fr; }
  .att-stage { order: 1; }
  .att .phone { width: min(280px, 76vw); }

  .bi-phone { width: min(180px, 42vw); }
  .bi-phone-a { transform: rotate(-2.5deg) translateY(8px); }
  .bi-phone-b { transform: rotate(2deg); }
  :dir(rtl) .bi-phone-a { transform: rotate(2.5deg) translateY(8px); }
  :dir(rtl) .bi-phone-b { transform: rotate(-2deg); }

  .deep .trust-stage { order: 1; }

  .why-grid { grid-template-columns: 1fr; }

  .session-board { grid-template-columns: 1fr; }
  .session-pill { justify-self: stretch; justify-content: center; flex-wrap: wrap; text-align: center; }
  /* Mobile signature motion: outcomes emerge from the lecture pill as they
     scroll into view (JS scrubs --p; default 1 keeps no-JS/reduced-motion static) */
  .session-pill {
    opacity: var(--p, 1);
    transform: translateY(calc((1 - var(--p, 1)) * 18px)) scale(calc(.96 + .04 * var(--p, 1)));
  }
  .session-card {
    transform: translateY(calc((1 - var(--p)) * -26px)) scale(calc(.93 + .07 * var(--p)));
  }

  .footer-grid { grid-template-columns: 1fr; gap: 1.8rem; }
}

/* ==========================================================================
   Faithful in-phone components (source of truth: app working tree 2026-08-31)
   ========================================================================== */

/* 5-segment lecture picker: التسجيل/المذكرة/النص/ملفاتي/الشرح */
.seg-strip {
  flex-wrap: nowrap;
  overflow: hidden;
  -webkit-mask-image: linear-gradient(to right, #000 88%, transparent);
  mask-image: linear-gradient(to right, #000 88%, transparent);
}
:dir(rtl) .seg-strip {
  -webkit-mask-image: linear-gradient(to left, #000 88%, transparent);
  mask-image: linear-gradient(to left, #000 88%, transparent);
}
.seg-strip span { flex: none; font-size: .58rem; padding: .22rem .5rem; }

/* Trust chip (real labels: "✓ Verified" / «✓ نسخة معتمدة») */
.trust-chip {
  align-self: flex-start;
  display: inline-flex;
  padding: .16rem .55rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(72, 199, 142, .45);
  background: rgba(38, 116, 79, .16);
  color: #5ede9f;
  font-size: .6rem;
  font-weight: 700;
  white-space: nowrap;
}

/* Study-notes cards (Overview / Structured summary / Key concepts) */
.notes-face { gap: .55rem; padding-block-start: 2.3rem; }
.n-card {
  border-radius: 14px;
  background: rgba(255, 255, 255, .05);
  padding: .6rem .7rem;
  display: grid;
  gap: .35rem;
  justify-items: start;
}
.n-label { font-size: .64rem; font-weight: 700; color: var(--cyan); }
.n-sub { font-size: .56rem; font-weight: 650; color: var(--faint); }
.n-text { font-size: .68rem; line-height: 1.55; color: var(--ink); }
.n-bullet::before { content: "•  "; color: var(--cyan); }
.explain-capsule {
  display: inline-flex;
  align-items: center;
  padding: .14rem .5rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(0, 188, 212, .5);
  color: var(--cyan);
  font-size: .56rem;
  font-weight: 700;
  white-space: nowrap;
}
.n-chips { display: flex; flex-wrap: wrap; gap: .3rem; }
.n-chips span {
  padding: .16rem .5rem;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, .07);
  font-size: .58rem;
  color: var(--muted);
  white-space: nowrap;
}
.pdf-row {
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: .4rem;
  border-radius: 10px;
  background: rgba(0, 188, 212, .08);
  border: 1px solid rgba(0, 188, 212, .25);
  color: var(--cyan);
  font-size: .64rem;
  font-weight: 650;
  padding: .4rem;
}
.mini-tabbar {
  margin-block-start: auto;
  display: flex;
  justify-content: space-around;
  gap: .3rem;
  padding-block-start: .5rem;
  border-block-start: 1px solid rgba(255, 255, 255, .08);
  font-size: .58rem;
  color: var(--faint);
}
.mini-tabbar .is-on { color: var(--cyan); font-weight: 700; }

/* Recording face (mirrors activeRecordingCard: timer, quality chip, controls) */
.rec-face { padding-block-start: 2.6rem; }
.rec-center {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: .9rem;
  text-align: center;
}
.rec-remaining {
  font-size: .7rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.rec-quality {
  display: inline-flex;
  align-items: center;
  gap: .5rem;
  padding: .3rem .85rem;
  border-radius: var(--radius-pill);
  border: 1px solid rgba(94, 222, 159, .4);
  background: rgba(94, 222, 159, .1);
  color: #5ede9f;
  font-size: .68rem;
  font-weight: 650;
}
.rec-quality-wave { height: 12px !important; }
.rec-quality-wave i { background: #5ede9f !important; width: 2px !important; }
.rec-controls { display: flex; gap: .6rem; }
.rec-btn {
  flex: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .45rem;
  padding: .6rem;
  border-radius: 14px;
  font-size: .72rem;
  font-weight: 700;
}
.rec-glyph { font-size: .55rem; }
.rec-btn-pause {
  background: rgba(255, 159, 10, .13);
  border: 1px solid rgba(255, 159, 10, .4);
  color: #ffb340;
}
.rec-btn-stop {
  background: rgba(255, 90, 90, .13);
  border: 1px solid rgba(255, 90, 90, .45);
  color: #ff8080;
}

/* Processing face (mirrors ProcessingOverlay: progress + 5-row checklist) */
.proc-face { padding-block-start: 2.6rem; gap: .85rem; }
.proc-head { text-align: center; }
.proc-head h3 { font-size: 1rem; }
.proc-progress { display: flex; align-items: center; gap: .6rem; }
.proc-progress .proc-bar { flex: 1; }
.proc-state {
  margin-inline-start: auto;
  font-size: .56rem;
  color: var(--faint);
  white-space: nowrap;
}
.proc-state.st-done { color: #5ede9f; }
.proc-state.st-working { color: var(--cyan); }

/* Ready face privacy footnote (real string: rawAudioDeletedNote) */
.ready-foot {
  font-size: .64rem;
  line-height: 1.5;
  color: rgba(94, 222, 159, .75);
  text-align: center;
  max-width: 22em;
}

/* Narrow-screen refinements for the faithful components */
@media (max-width: 900px) {
  .stage-pin .seg-strip span { font-size: .5rem; padding: .16rem .38rem; }
  .stage-pin .trust-chip { font-size: .52rem; }
  .stage-pin .flash-q { font-size: .74rem; }
  .stage-pin .n-card { padding: .45rem .55rem; }
  .bi-phone .app-face { padding: 1.6rem .55rem .7rem; gap: .4rem; }
  .bi-phone .seg-strip span { font-size: .46rem; padding: .14rem .34rem; }
  .bi-phone .n-text { font-size: .56rem; }
  .bi-phone .n-label { font-size: .54rem; }
  .bi-phone .trust-chip { font-size: .48rem; }
  .bi-phone .n-chips span { font-size: .48rem; }
  .bi-phone .explain-capsule { font-size: .48rem; }
  .bi-phone .mini-tabbar { font-size: .46rem; }
  .deep .phone { width: min(280px, 76vw); margin-inline: auto; }
}
