/* ============================================================
   Coachat — Global Styles
   ============================================================ */

@import url("tokens.css");

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: clip;                /* iOS: clip on html, not body — prevents scroll-anchor jumpiness */
  overscroll-behavior-y: none;
}
/* Smooth-scroll only on pointer devices — let iOS use native momentum instead */
@media (hover: hover) and (pointer: fine) {
  html { scroll-behavior: smooth; }
}
body {
  font-family: var(--font-body);
  background: var(--ink);
  color: var(--bone);
  font-size: var(--fs-body);
  line-height: var(--lh-relaxed);
}
img, svg { display: block; max-width: 100%; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

/* ---------- Grain overlay ---------- */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: url("../img/grain.svg");
  opacity: 0.035;
  z-index: 9999;
}
@media (max-width: 900px) {
  /* Fixed + mix-blend on iOS causes scroll jank; drop the overlay entirely on small screens */
  body::after { display: none; }
}

/* ---------- Typography helpers ---------- */
.eyebrow {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: var(--fs-eyebrow);
  color: var(--volt);
  letter-spacing: var(--tr-eyebrow);
}

.mono {
  font-family: var(--font-mono);
  font-size: var(--fs-mono);
  letter-spacing: var(--tr-mono);
  text-transform: uppercase;
}

.display {
  font-family: var(--font-display);
  font-weight: 700;
  letter-spacing: var(--tr-section);
  line-height: var(--lh-snug);
}

.display--hero {
  font-size: var(--fs-hero);
  letter-spacing: var(--tr-hero);
  line-height: var(--lh-tight);
}

.volt-gradient {
  background: linear-gradient(135deg, var(--volt) 0%, #9EFF00 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

/* ---------- Container / section ---------- */
.container { width: 100%; max-width: var(--container-w); margin-inline: auto; padding-inline: clamp(20px, 4vw, 40px); }
.section { padding-block: var(--section-pad-y); position: relative; }
.section--obsidian { background: var(--obsidian); }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--sp-2);
  padding: 14px 24px;
  border-radius: var(--r-pill);
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 600;
  transition: transform 300ms var(--ease-out), box-shadow 300ms var(--ease-out), background 300ms var(--ease-out), color 300ms var(--ease-out);
  will-change: transform;
}
.btn--primary { background: var(--volt); color: var(--ink); }
.btn--primary:hover { transform: translateY(-2px); box-shadow: 0 10px 30px var(--volt-glow); }
.btn--ghost { background: transparent; color: var(--bone); border: 1px solid var(--hairline); }
.btn--ghost:hover { border-color: var(--volt); }

.btn-badge { display: inline-block; transition: transform 300ms var(--ease-out), filter 300ms var(--ease-out); }
.btn-badge img { height: 56px; width: auto; }
.btn-badge:hover { transform: translateY(-2px); filter: drop-shadow(0 10px 20px var(--volt-glow)); }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset-inline: 0;
  top: 0;
  z-index: 100;
  padding-block: var(--sp-4);
  background: rgba(10, 12, 16, 0.75);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border-bottom: 1px solid transparent;
  transition: border-color 300ms ease;
}
@media (max-width: 900px) {
  /* Solid bg on mobile — backdrop-filter on fixed elements murders iOS scroll perf */
  .site-header {
    background: rgba(10, 12, 16, 0.96);
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }
}
.site-header.is-scrolled { border-bottom-color: var(--hairline); }
.site-header__inner { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-5); }
.brand { display: inline-flex; align-items: center; gap: var(--sp-3); }
.brand__mark { width: 40px; height: 40px; border-radius: var(--r-sm); overflow: hidden; background: var(--volt); }
.brand__mark img { width: 100%; height: 100%; object-fit: contain; }
.brand__word { font-family: var(--font-brand); font-weight: 700; font-size: 18px; letter-spacing: -0.02em; }

.nav { display: flex; align-items: center; gap: var(--sp-3); }
.nav__link { font-size: 14px; color: var(--bone); opacity: 0.8; padding: 8px 12px; transition: opacity 200ms ease; }
.nav__link:hover { opacity: 1; }
.nav__lang { font-size: 13px; padding: 8px 12px; border: 1px solid var(--hairline); border-radius: var(--r-pill); transition: border-color 200ms ease; }
.nav__lang:hover { border-color: var(--volt); }
.nav__badge img { height: 40px; }

.nav__menu-btn { display: none; width: 40px; height: 40px; align-items: center; justify-content: center; border-radius: var(--r-sm); }
.nav__menu-btn:hover { background: var(--hairline); }

@media (max-width: 900px) {
  .nav__link, .nav__badge { display: none; }
  .nav__menu-btn { display: inline-flex; }
}

/* ---------- Focus ---------- */
:focus-visible { outline: 2px solid var(--volt); outline-offset: 3px; border-radius: 4px; }

/* ---------- Reduced motion baseline ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 200ms !important; }
}

/* ---------- Mobile menu ---------- */
.mobile-menu {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: var(--ink);
  display: flex;
  flex-direction: column;
  padding-block: var(--sp-5) var(--sp-8);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-12px);
  transition: opacity 300ms var(--ease-out), transform 300ms var(--ease-out), visibility 300ms;
}
.mobile-menu.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
.mobile-menu__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-8); }
.mobile-menu__close { width: 40px; height: 40px; border-radius: var(--r-sm); display: inline-flex; align-items: center; justify-content: center; }
.mobile-menu__close:hover { background: var(--hairline); }
.mobile-menu__nav { display: flex; flex-direction: column; gap: var(--sp-3); }
.mobile-menu__link {
  display: flex;
  align-items: center;
  padding: 18px 20px;
  background: var(--obsidian);
  border: 1px solid var(--hairline);
  border-radius: var(--r-md);
  font-size: 16px;
  font-weight: 500;
  transition: border-color 200ms ease, background 200ms ease;
}
.mobile-menu__link:hover { border-color: var(--volt); }
.mobile-menu__link--primary { background: var(--volt); color: var(--ink); border-color: var(--volt); }
body.menu-open { overflow: hidden; }

/* ---------- Device (bare screenshot) ---------- */
.device {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: clamp(28px, 3.5vw, 40px);
  border: 1px solid var(--hairline);
  box-shadow:
    0 40px 80px rgba(0, 0, 0, 0.55),
    0 0 0 1px rgba(255, 255, 255, 0.03) inset;
  isolation: isolate;
}

.device-wrap {
  position: relative;
  display: inline-flex;
  justify-content: center;
  align-items: center;
  isolation: isolate;
}
.device-wrap::before {
  content: "";
  position: absolute;
  inset: -6% -8%;
  background: radial-gradient(closest-side, var(--volt-soft) 0%, transparent 70%);
  filter: blur(28px);
  z-index: -1;
  pointer-events: none;
  opacity: 0.7;
}
@media (max-width: 900px) {
  /* filter: blur() on many elements wrecks iOS compositor — drop halos on mobile */
  .device-wrap::before { display: none; }
}

.device--hero {
  width: clamp(240px, 26vw, 340px);
  transform: perspective(1200px) rotateY(-8deg) rotateX(4deg);
  animation: device-float 6s var(--ease-in-out) infinite;
  will-change: transform;
}
@keyframes device-float {
  0%, 100% { transform: perspective(1200px) rotateY(-8deg) rotateX(4deg) translateY(0); }
  50% { transform: perspective(1200px) rotateY(-8deg) rotateX(4deg) translateY(-8px); }
}
@media (max-width: 900px) {
  /* Kill continuous 3D transform on touch devices — iOS momentum scroll + animated transforms = jank */
  .device--hero { animation: none; transform: none; }
}
.device--stage { width: clamp(240px, 26vw, 320px); }
.device--deep  { width: clamp(240px, 24vw, 320px); will-change: transform; }

/* ---------- Hero ---------- */
.hero { padding-block: calc(var(--section-pad-y) + 40px) var(--section-pad-y); position: relative; overflow: hidden; }
.hero__glow {
  position: absolute;
  top: -160px; left: 50%;
  width: 900px; height: 900px;
  transform: translateX(-50%);
  background: radial-gradient(circle, var(--volt-soft) 0%, transparent 70%);
  pointer-events: none;
  z-index: 0;
}
.hero__inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  align-items: center;
  gap: var(--sp-9);
}
.hero__copy > * + * { margin-top: var(--sp-5); }
.hero__copy .eyebrow { display: inline-block; margin-bottom: var(--sp-2); }
.hero__lead { font-size: var(--fs-body-lg); color: rgba(245,241,236,0.78); max-width: 46ch; line-height: var(--lh-normal); }
.hero__ctas { display: flex; flex-wrap: wrap; align-items: center; gap: var(--sp-4); }
.hero__visual { display: flex; justify-content: center; }

@media (max-width: 900px) {
  .hero__inner { grid-template-columns: 1fr; text-align: center; }
  .hero__copy > * { margin-inline: auto; }
  .hero__lead { margin-inline: auto; }
  .hero__ctas { justify-content: center; }
  .hero__visual { margin-top: var(--sp-7); }
}

/* ---------- Marquee ---------- */
.marquee {
  border-block: 1px solid var(--hairline);
  padding-block: var(--sp-5);
  overflow: hidden;
  background: var(--ink);
}
.marquee__track {
  display: inline-flex;
  align-items: center;
  gap: var(--sp-6);
  white-space: nowrap;
  animation: marquee-scroll 60s linear infinite;
  will-change: transform;
}
.marquee:hover .marquee__track { animation-play-state: paused; }
.marquee__item { font-family: var(--font-serif); font-style: italic; font-size: clamp(20px, 3vw, 28px); color: var(--bone); opacity: 0.8; }
.marquee__dot { color: var(--volt); font-size: 8px; }
@keyframes marquee-scroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}
html[dir="rtl"] .marquee__track { animation-direction: reverse; }
@media (max-width: 900px) {
  /* Pause marquee on mobile — continuous transform during touch scroll causes stutter */
  .marquee__track { animation: none; transform: translateX(0); }
}

/* ---------- Meet your coach ---------- */
.meet { position: relative; overflow: hidden; text-align: center; }
.meet__glow {
  position: absolute;
  inset: auto 0 -20% 0;
  margin-inline: auto;
  width: 900px; height: 900px; max-width: 100%;
  background: radial-gradient(circle, var(--volt-soft) 0%, transparent 60%);
  pointer-events: none;
}
.meet__inner { position: relative; z-index: 1; display: grid; gap: var(--sp-6); }
.meet__inner .eyebrow { display: inline-block; margin-inline: auto; }
.meet__lead { max-width: 62ch; margin-inline: auto; font-size: var(--fs-body-lg); color: rgba(245,241,236,0.74); line-height: var(--lh-normal); }
.meet__stage { display: flex; justify-content: center; margin-top: var(--sp-6); }

/* ---------- Generic section head ---------- */
.section-head { text-align: center; max-width: 780px; margin-inline: auto; margin-bottom: var(--sp-9); display: grid; gap: var(--sp-3); }
.section-head .eyebrow { display: inline-block; margin-inline: auto; }

/* ---------- How it works ---------- */
.how__list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--sp-7);
}
.how__step { display: grid; gap: var(--sp-4); padding-block-start: var(--sp-5); border-block-start: 1px solid var(--hairline); }
.how__num { color: var(--volt); font-size: 12px; font-weight: 600; }
.how__title { font-family: var(--font-display); font-size: clamp(24px, 3vw, 34px); font-weight: 600; letter-spacing: -0.01em; line-height: 1.1; }
.how__body { color: rgba(245,241,236,0.7); max-width: 32ch; line-height: var(--lh-normal); }

/* ---------- Feature deep-dives ---------- */
.deep { padding-bottom: var(--section-pad-y); }
.deep__stages { display: grid; gap: var(--sp-10); }

.deep-stage__grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: start;          /* was: center — sticky needs top-aligned cells */
  gap: var(--sp-9);
  min-height: 140vh;           /* provides scroll room for the sticky visual */
}
.deep-stage__grid--reverse .deep-stage__copy { order: 0; }
.deep-stage__grid--reverse .deep-stage__visual { order: 1; }

.deep-stage__visual { display: contents; }   /* let the inner be the grid child so sticky works cleanly */

.deep-stage__copy { padding-block: 10vh 20vh; }
.deep-stage__copy > * + * { margin-top: var(--sp-4); }
.deep-stage__copy .eyebrow { display: inline-block; }
.deep-stage__points { display: grid; gap: var(--sp-3); margin-top: var(--sp-5); font-size: var(--fs-body-lg); color: rgba(245,241,236,0.8); }
.deep-stage__points li { padding-inline-start: 20px; position: relative; }
.deep-stage__points li::before { content: ""; position: absolute; inset-inline-start: 0; top: 12px; width: 8px; height: 2px; background: var(--volt); }

.device--deep { width: clamp(240px, 24vw, 320px); will-change: transform; }

@media (max-width: 900px) {
  .deep__stages { gap: var(--sp-8); }
  .deep-stage__grid,
  .deep-stage__grid--reverse {
    grid-template-columns: 1fr;
    gap: var(--sp-6);
    min-height: auto;
  }
  .deep-stage__visual { display: flex; justify-content: center; }
  .deep-stage__grid--reverse .deep-stage__copy { order: 1; }
  .deep-stage__grid--reverse .deep-stage__visual { order: 0; }
  .deep-stage__copy { padding-block: 0; }
}

@media (max-width: 900px) { .how__list { grid-template-columns: 1fr; gap: var(--sp-6); } }

/* ---------- Why / stats ---------- */
.why__grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--sp-5); }
.stat {
  padding: var(--sp-6);
  border: 1px solid var(--hairline);
  border-radius: var(--r-lg);
  background: linear-gradient(180deg, rgba(20,22,28,0.6) 0%, rgba(20,22,28,0.2) 100%);
  display: grid;
  gap: var(--sp-2);
  align-content: start;
}
.stat__value {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: clamp(40px, 5vw, 72px);
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--bone);
}
.stat__suffix { font-family: var(--font-serif); font-style: italic; font-size: clamp(24px, 3vw, 40px); color: var(--volt); margin-inline-start: 4px; }
.stat__label { color: var(--ash); font-size: 14px; letter-spacing: 0.01em; }
@media (max-width: 900px) { .why__grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .why__grid { grid-template-columns: 1fr; } }

/* ---------- For coaches ---------- */
.coaches__grid { display: grid; grid-template-columns: 1.1fr 0.9fr; gap: var(--sp-9); align-items: center; }
.coaches__copy > * + * { margin-top: var(--sp-4); }
.coaches__copy .eyebrow { display: inline-block; }
.coaches__lead { color: rgba(245,241,236,0.72); font-size: var(--fs-body-lg); max-width: 52ch; line-height: var(--lh-normal); }
.coaches__copy .btn { margin-top: var(--sp-5); }

.coaches__tile {
  position: relative;
  border: 1px solid var(--hairline);
  border-radius: var(--r-xl);
  overflow: hidden;
  background: var(--ink);
  box-shadow: 0 30px 60px rgba(0,0,0,0.35);
}
.coaches__tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(10,12,16,0.55), rgba(10,12,16,0.82));
  pointer-events: none;
}
.coaches__tile-chrome { display: flex; align-items: center; gap: var(--sp-2); padding: 10px 14px; background: var(--obsidian); border-bottom: 1px solid var(--hairline); }
.coaches__tile-chrome span { width: 10px; height: 10px; border-radius: 50%; background: var(--hairline); }
.coaches__tile-chrome span:nth-child(1) { background: #FF5F57; }
.coaches__tile-chrome span:nth-child(2) { background: #FFBD2E; }
.coaches__tile-chrome span:nth-child(3) { background: #28CA41; }
.coaches__tile-chrome em { margin-inline-start: var(--sp-3); color: var(--ash); font-style: normal; font-size: 11px; }
.coaches__tile img { width: 100%; display: block; max-height: 440px; object-fit: cover; object-position: top; }

@media (max-width: 900px) { .coaches__grid { grid-template-columns: 1fr; gap: var(--sp-7); } }

/* ---------- Download ---------- */
.download { text-align: center; position: relative; overflow: hidden; }
.download__glow {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 900px; height: 900px; max-width: 100%;
  background: radial-gradient(circle, var(--volt-soft) 0%, transparent 60%);
  pointer-events: none;
}
.download__inner { position: relative; z-index: 1; display: grid; gap: var(--sp-5); }
.download__inner .eyebrow { display: inline-block; margin-inline: auto; }
.download__lead { color: rgba(245,241,236,0.72); font-size: var(--fs-body-lg); max-width: 48ch; margin-inline: auto; }
.download__cta { display: flex; justify-content: center; align-items: center; gap: var(--sp-6); flex-wrap: wrap; margin-top: var(--sp-4); }
.download__qr { display: inline-flex; flex-direction: column; align-items: center; gap: var(--sp-2); padding: var(--sp-3); border: 1px solid var(--hairline); border-radius: var(--r-md); background: var(--ink); }
.download__qr img { width: 120px; height: 120px; }
.download__rating { margin-top: var(--sp-4); color: var(--ash); }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--hairline); padding-block: var(--sp-7) var(--sp-7); }
.site-footer__inner { display: grid; grid-template-columns: auto 1fr auto auto; gap: var(--sp-5); align-items: center; }
.site-footer__meta { color: var(--ash); white-space: nowrap; }
.site-footer__links { display: flex; gap: var(--sp-4); }
.site-footer__links a { color: var(--ash); font-size: 14px; transition: color 200ms; }
.site-footer__links a:hover { color: var(--bone); }
.site-footer__social { display: flex; gap: var(--sp-2); }
.site-footer__social a {
  width: 40px; height: 40px; border-radius: 50%;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--hairline); color: var(--ash);
  transition: color 200ms, border-color 200ms, background 200ms;
}
.site-footer__social a:hover { color: var(--ink); background: var(--volt); border-color: var(--volt); }

@media (max-width: 900px) {
  .site-footer__inner { grid-template-columns: 1fr; text-align: center; justify-items: center; gap: var(--sp-4); }
}

/* ---------- Deep-stage sticky visuals ---------- */
.deep-stage { position: relative; }
.deep-stage__visual-inner {
  position: sticky;
  top: 80px;                   /* clears the fixed site-header (64px + a little breathing room) */
  align-self: start;
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: calc(100vh - 80px);
  min-height: calc(100dvh - 80px); /* dvh handles iOS address-bar collapse without pushing content */
}

@media (max-width: 900px) {
  .deep-stage__visual-inner {
    position: static;
    min-height: auto;
  }
}

/* ---------- Arabic hero rhythm ---------- */
.hero__headline--ar { display: grid; gap: var(--sp-2); }
.hero__headline-line { display: block; line-height: 1.1; }
html[lang="ar"] .hero__copy > * + * { margin-top: var(--sp-6); }
html[lang="ar"] .hero__lead { margin-top: var(--sp-5); }

/* ---------- Cursor-follow glow on cards ---------- */
.glow-card { position: relative; isolation: isolate; }
.glow-card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(240px circle at var(--mx, 50%) var(--my, 50%), var(--volt-soft) 0%, transparent 60%);
  opacity: 0;
  transition: opacity 250ms ease;
  pointer-events: none;
  z-index: -1;
}
.glow-card:hover::before { opacity: 1; }

/* ---------- Legal pages (Privacy, Terms) ---------- */
.legal {
  padding-block: calc(var(--sp-10) + 40px) var(--section-pad-y);
}
.legal__inner {
  max-width: 760px;
  margin-inline: auto;
}
.legal__head {
  margin-bottom: var(--sp-9);
  padding-bottom: var(--sp-6);
  border-bottom: 1px solid var(--hairline);
}
.legal__head .eyebrow { display: inline-block; margin-bottom: var(--sp-3); }
.legal__head h1 {
  font-family: var(--font-display);
  font-size: clamp(36px, 5vw, 64px);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: var(--sp-3);
}
.legal__head p { color: var(--ash); font-size: 14px; font-family: var(--font-mono); letter-spacing: 0.04em; }
.legal__body p,
.legal__body ul,
.legal__body ol { color: rgba(245,241,236,0.78); font-size: 16px; line-height: 1.75; }
.legal__body > * + * { margin-top: var(--sp-4); }
.legal__body h2 {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.4vw, 28px);
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--bone);
  margin-top: var(--sp-8) !important;
  margin-bottom: var(--sp-4);
}
.legal__body h2 + p,
.legal__body h2 + ul { margin-top: 0; }
.legal__body h3 {
  font-family: var(--font-display);
  font-size: 17px;
  font-weight: 600;
  color: var(--bone);
  margin-top: var(--sp-5);
  margin-bottom: var(--sp-2);
}
.legal__body ul,
.legal__body ol { padding-inline-start: var(--sp-5); display: grid; gap: var(--sp-2); }
.legal__body ul { list-style: none; }
.legal__body ul li { padding-inline-start: var(--sp-4); position: relative; }
.legal__body ul li::before {
  content: "";
  position: absolute;
  inset-inline-start: 0;
  top: 12px;
  width: 8px;
  height: 2px;
  background: var(--volt);
}
.legal__body ol { list-style: decimal; padding-inline-start: var(--sp-6); }
.legal__body ol li::marker { color: var(--volt); font-family: var(--font-mono); font-weight: 600; }
.legal__body a { color: var(--volt); border-bottom: 1px solid var(--volt-soft); transition: border-color 200ms; }
.legal__body a:hover { border-bottom-color: var(--volt); }
.legal__body strong { color: var(--bone); font-weight: 600; }
