/* FRASE website — dark theme with the mobile app's tokens (lib/core/utils/style.dart). */

:root {
  /* AppColor */
  --primary: #3E776E;
  --primary-light: #4E9088;
  --primary-container: #1A3330;
  --on-primary-container: #9ECCC6;
  --accent-reading: #4A6FA5;
  --accent-echo: #B5654A;
  --accent-constellation: #7A5C9E;
  --accent-expressions: #2F4858;

  /* Dark scheme */
  --bg: #121212;
  --surface: #1C1C1C;
  --card: #242424;
  --on-surface: #F5F5F5;
  --muted: #9E9E9E;
  --outline: #333333;
  --outline-variant: #2A2A2A;
  --error: #F87171;
  --fire: #F59E0B;

  /* AppRadius */
  --r-card: 24px;
  --r-chip: 40px;
  --r-input: 12px;

  --font: "Inter", "IBM Plex Sans Arabic", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-book: "Literata", Georgia, serif;
  --container: 1120px;
  --gutter: 20px;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { scroll-behavior: smooth; scroll-padding-top: 72px; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--on-surface);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
h1, h2, h3 { margin: 0; line-height: 1.15; letter-spacing: -0.02em; }
p { margin: 0; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Icons ------------------------------------------------------------------ */

.ms {
  font-family: "Material Symbols Rounded";
  font-weight: 400;
  font-style: normal;
  font-size: 1.25em;
  line-height: 1;
  display: inline-block;
  vertical-align: middle;
  white-space: nowrap;
  font-variation-settings: "FILL" 0, "wght" 400, "GRAD" 0, "opsz" 24;
  -webkit-font-feature-settings: "liga";
}

.icon-badge {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  color: var(--on-primary-container);
  font-size: 22px;
}
.icon-badge-lg { width: 52px; height: 52px; font-size: 28px; margin-bottom: 18px; }
.icon-fire { background: color-mix(in srgb, var(--fire) 16%, transparent); color: var(--fire); }

/* Buttons ---------------------------------------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border-radius: var(--r-chip);
  padding: 12px 22px;
  font-weight: 600;
  transition: background .2s, transform .2s;
}
.btn-sm { padding: 8px 16px; font-size: 14px; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:hover { background: var(--primary-light); }

.store-buttons { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 32px; }

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 180px;
  padding: 10px 20px 10px 16px;
  border-radius: 14px;
  background: var(--on-surface);
  color: var(--bg);
  font-weight: 700;
  font-size: 18px;
  line-height: 1.1;
  text-align: start;
  white-space: nowrap;
  transition: transform .2s, background .2s;
}
.store-btn:hover { transform: translateY(-2px); background: #fff; }
.store-btn .uil { font-size: 30px; }
.store-btn small { display: block; font-size: 11px; font-weight: 500; opacity: .75; }

/* Nav -------------------------------------------------------------------- */

.nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: color-mix(in srgb, var(--bg) 82%, transparent);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid var(--outline-variant);
}
.nav-inner { display: flex; align-items: center; gap: 24px; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: .08em; }
.nav-links { display: flex; gap: 24px; margin-inline-start: auto; font-size: 14px; color: var(--muted); }
.nav-links a:hover { color: var(--on-surface); }

/* Sections --------------------------------------------------------------- */

.section { padding: 96px 0; }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-head .lead { margin-top: 16px; }

h2 { font-size: clamp(28px, 4vw, 40px); font-weight: 700; }
.lead { color: var(--muted); font-size: 18px; line-height: 1.65; }

.kicker,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 16px;
  color: var(--on-primary-container);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.eyebrow {
  padding: 6px 14px;
  border-radius: var(--r-chip);
  background: var(--primary-container);
  text-transform: none;
  letter-spacing: 0;
}

/* Phones (mockups already include the device frame) */
.phone { width: 100%; max-width: 320px; filter: drop-shadow(0 30px 60px rgba(0, 0, 0, .55)); }

/* Hero ------------------------------------------------------------------- */

.hero {
  position: relative;
  padding: 72px 0 48px;
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -20% -10% auto auto;
  width: 720px;
  height: 720px;
  background: radial-gradient(circle, color-mix(in srgb, var(--primary) 35%, transparent), transparent 65%);
  pointer-events: none;
}
.hero-grid {
  position: relative;
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: 48px;
}
h1 { font-size: clamp(40px, 6.4vw, 68px); font-weight: 800; margin-bottom: 24px; }
.accent { color: var(--primary-light); }
.hero-copy .lead { max-width: 560px; }

.hero-phones { position: relative; height: 620px; }
.hero-phones .phone { position: absolute; width: 300px; }
.phone-back { right: 0; top: 10px; transform: rotate(6deg); opacity: .9; }
.phone-front { right: 150px; top: 40px; transform: rotate(-4deg); }

/* Split (text + phone) -------------------------------------------------- */

.split {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  align-items: center;
  gap: 64px;
}
.split-reverse .split-media { order: 2; }
.split-media { display: flex; justify-content: center; }
.split h2 { margin-bottom: 24px; }

.feature-list,
.check-list { list-style: none; margin: 0; padding: 0; }
.feature-list li {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--outline-variant);
}
.feature-list li:last-child { border-bottom: 0; }

/* Exercises: same look as the Practice hub cards ----------------------- */

.exercise-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.ex-card {
  position: relative;
  overflow: hidden;
  min-height: 340px;
  padding: 24px;
  border-radius: var(--r-card);
  color: #fff;
  transition: transform .25s;
}
.ex-card:hover { transform: translateY(-4px); }
.ex-card h3 { font-size: 22px; margin-bottom: 10px; }
.ex-card p { font-size: 15px; line-height: 1.5; color: rgba(255, 255, 255, .85); position: relative; z-index: 1; }
/* Cropped, tilted corner icon, as on the app's cards. */
.ex-icon {
  position: absolute;
  inset-inline-end: -28px;
  bottom: -36px;
  font-size: 150px;
  line-height: 1;
  color: rgba(255, 255, 255, .18);
  transform: rotate(-20deg);
}
.ex-listening { background: var(--primary); }
.ex-reading { background: var(--accent-reading); }
.ex-echo { background: var(--accent-echo); }
.ex-constellation { background: var(--accent-constellation); }

.levels {
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
  margin-top: 32px;
  padding: 20px 24px;
  border-radius: var(--r-card);
  background: var(--surface);
  color: var(--muted);
}
.level-chips { display: flex; gap: 6px; }
.level-chips span {
  padding: 4px 12px;
  border-radius: var(--r-chip);
  background: var(--card);
  color: var(--on-surface);
  font-size: 13px;
  font-weight: 700;
}

.phone-row {
  display: flex;
  justify-content: center;
  gap: 48px;
  margin-top: 64px;
}
.phone-row .phone { max-width: 280px; }

/* FRASE AI demo --------------------------------------------------------- */

.ai-demo {
  margin-top: 32px;
  padding: 20px 24px;
  border-radius: var(--r-card);
  background: var(--surface);
  font-family: var(--font-book);
  font-size: 18px;
  line-height: 1.7;
}
.ai-demo .wrong { color: var(--error); background: color-mix(in srgb, var(--error) 10%, transparent); }
.ai-demo .fix {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
  color: var(--on-primary-container);
}

/* Duo panels ------------------------------------------------------------ */

.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.panel {
  padding: 36px;
  border-radius: var(--r-card);
  background: var(--surface);
}
.panel h2 { font-size: 28px; margin-bottom: 14px; }
.panel p { color: var(--muted); }
.check-list li { display: flex; gap: 12px; padding: 6px 0; color: var(--muted); }
.check-list .ms { color: var(--on-primary-container); }

.drills { list-style: none; margin: 24px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 8px; }
.drills li {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: var(--r-chip);
  background: var(--card);
  font-size: 14px;
  font-weight: 500;
}
.drills .ms { font-size: 18px; color: var(--on-primary-container); }

.week { display: flex; gap: 8px; margin-top: 20px; }
.week span {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: var(--card);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
}
.week .done { background: var(--primary); color: #fff; }

/* Languages -------------------------------------------------------------- */

.lang-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}
.lang-grid li {
  padding: 18px 20px;
  border-radius: calc(var(--r-input) + 4px);
  background: var(--surface);
  transition: background .2s;
}
.lang-grid li:hover { background: var(--card); }
.lang-grid b { display: block; font-size: 18px; font-weight: 600; }
.lang-grid span { color: var(--muted); font-size: 13px; }

/* Pro -------------------------------------------------------------------- */

.pro-card {
  padding: 48px;
  border-radius: var(--r-card);
  text-align: center;
  background:
    radial-gradient(circle at 50% 0%, color-mix(in srgb, var(--primary) 40%, transparent), transparent 60%),
    var(--surface);
  border: 1px solid var(--outline);
}
.pro-card h2 { margin-bottom: 24px; }
.pro-links { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.pro-links a {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 10px 18px;
  border-radius: var(--r-chip);
  background: var(--card);
  font-size: 14px;
  font-weight: 600;
}
.pro-links a:hover { background: var(--outline); }
.pro-links .ms { font-size: 16px; color: var(--muted); }

/* CTA & footer ------------------------------------------------------------ */

.cta { text-align: center; }
.cta-inner { display: flex; flex-direction: column; align-items: center; }
.cta-inner img { margin-bottom: 24px; }
.cta-inner .lead { margin-top: 12px; }
.cta .store-buttons { justify-content: center; }

.footer { border-top: 1px solid var(--outline-variant); padding: 28px 0; color: var(--muted); font-size: 14px; }
.footer-inner { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; }
.footer nav { display: flex; gap: 20px; margin-inline-start: auto; }
.footer a:hover { color: var(--on-surface); }

/* Features ticker --------------------------------------------------------- */

.ticker {
  position: relative;
  overflow: hidden;
  padding: 18px 0;
  border-block: 1px solid var(--outline-variant);
  background: var(--surface);
  /* Fade the edges into the page. */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.ticker-track {
  display: flex;
  width: max-content;
  animation: ticker 45s linear infinite;
}
.ticker:hover .ticker-track { animation-play-state: paused; }
.ticker-list {
  display: flex;
  flex: none;
  list-style: none;
  margin: 0;
  padding: 0;
}
.ticker-list li {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 0 28px;
  font-size: 17px;
  font-weight: 600;
  white-space: nowrap;
}
/* Dot between items, in the app's accent colours. */
.ticker-list li::after {
  content: "";
  width: 6px;
  height: 6px;
  margin-inline-start: 46px;
  border-radius: 50%;
  background: var(--primary-light);
}
.ticker-list li:nth-child(4n+2)::after { background: var(--accent-reading); }
.ticker-list li:nth-child(4n+3)::after { background: var(--accent-echo); }
.ticker-list li:nth-child(4n)::after { background: var(--accent-constellation); }
.ticker-list .ms,
.ticker-list .uil { font-size: 22px; color: var(--on-primary-container); }

@keyframes ticker {
  to { transform: translateX(-50%); }
}

/* Brand band at the very bottom of the page: full width, kept at least
   24px tall on phones (cropped rather than squashed). */
.brand-band {
  width: 100%;
  height: clamp(24px, 3.3vw, 64px);
  object-fit: cover;
  object-position: left center;
}

/* Right-to-left (Arabic) ---------------------------------------------------- */

[dir="rtl"] .ex-icon { transform: rotate(20deg); }
[dir="rtl"] .ai-demo .fix .ms { transform: none; }
[dir="rtl"] .kicker,
[dir="rtl"] .eyebrow { letter-spacing: 0; font-size: 15px; }

/* Animations (only once animations.js has run: html.anim) ------------------ */

/* Hero entrance on load. */
@keyframes rise {
  from { opacity: 0; translate: 0 24px; }
  to { opacity: 1; translate: 0 0; }
}
.anim .hero-title { animation: rise .8s cubic-bezier(.2, .7, .2, 1) both; }
.anim .hero-lead { animation: rise .8s .15s cubic-bezier(.2, .7, .2, 1) both; }
.anim .hero-stores { animation: rise .8s .3s cubic-bezier(.2, .7, .2, 1) both; }
.anim .hero-phones { animation: rise 1s .2s cubic-bezier(.2, .7, .2, 1) both; }

/* Scroll reveal. */
.anim .reveal {
  opacity: 0;
  translate: 0 32px;
  transition: opacity .8s cubic-bezier(.2, .7, .2, 1), translate .8s cubic-bezier(.2, .7, .2, 1);
}
.anim .reveal.is-visible { opacity: 1; translate: 0 0; }

.anim .stagger > * {
  opacity: 0;
  translate: 0 24px;
  transition:
    opacity .6s cubic-bezier(.2, .7, .2, 1) calc(var(--i, 0) * 90ms),
    translate .6s cubic-bezier(.2, .7, .2, 1) calc(var(--i, 0) * 90ms),
    transform .25s, background .2s;
}
.anim .stagger.is-visible > * { opacity: 1; translate: 0 0; }

/* Exercise cards: the corner icon turns a little on hover. */
.ex-icon { transition: transform .5s cubic-bezier(.2, .7, .2, 1); }
.ex-card:hover .ex-icon { transform: rotate(-8deg) scale(1.06); }
[dir="rtl"] .ex-card:hover .ex-icon { transform: rotate(8deg) scale(1.06); }

/* FRASE AI demo: the mistake lights up, then the fix slides in. */
.anim .ai-demo .wrong {
  color: inherit;
  background: transparent;
  transition: color .5s .5s, background .5s .5s;
}
.anim .ai-demo.is-visible .wrong {
  color: var(--error);
  background: color-mix(in srgb, var(--error) 10%, transparent);
}
.anim .ai-demo .fix {
  opacity: 0;
  translate: -12px 0;
  transition: opacity .6s 1.3s, translate .6s 1.3s cubic-bezier(.2, .7, .2, 1);
}
.anim .ai-demo.is-visible .fix { opacity: 1; translate: 0 0; }

/* Streak days pop in one after another. */
@keyframes pop {
  0% { scale: .4; opacity: 0; }
  70% { scale: 1.15; }
  100% { scale: 1; opacity: 1; }
}
.anim .week .done { opacity: 0; }
.anim .week.is-visible .done { animation: pop .5s cubic-bezier(.2, .7, .2, 1) both; }
.anim .week.is-visible .done:nth-child(5) { animation-delay: .3s; }
.anim .week.is-visible .done:nth-child(6) { animation-delay: .5s; }
.anim .week.is-visible .done:nth-child(7) { animation-delay: .7s; }

/* Nav shadow once scrolled. */
.nav { transition: box-shadow .3s; }
.nav.scrolled { box-shadow: 0 8px 24px rgba(0, 0, 0, .35); }

/* Responsive -------------------------------------------------------------- */

@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav .btn { margin-inline-start: auto; }
  .hero-grid,
  .split { grid-template-columns: 1fr; gap: 40px; }
  .split-reverse .split-media { order: 0; }
  .hero-phones { height: 520px; max-width: 460px; margin: 0 auto; width: 100%; }
  .hero-phones .phone { width: 250px; }
  .phone-front { right: auto; left: 0; }
  .exercise-grid { grid-template-columns: repeat(2, 1fr); }
  .duo { grid-template-columns: 1fr; }
  .lang-grid { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 560px) {
  :root { --gutter: 16px; }
  .section { padding: 64px 0; }
  .hero { padding-top: 40px; }
  .hero-phones { height: 420px; }
  .hero-phones .phone { width: 200px; }
  .exercise-grid { grid-template-columns: 1fr; }
  .ex-card { min-height: 220px; }
  .phone-row { gap: 16px; }
  .phone-row .phone { max-width: 46%; }
  .lang-grid { grid-template-columns: repeat(2, 1fr); }
  .panel, .pro-card { padding: 28px 22px; }
  .store-btn { flex: 1 1 0; min-width: 0; gap: 10px; padding: 10px 14px 10px 12px; font-size: 16px; }
  .store-btn .uil { font-size: 26px; }
  .split-media .phone { max-width: 260px; }
  .footer nav { margin-inline-start: 0; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
  .ticker-track { animation: none; }
  .ticker { overflow-x: auto; }
}
