/* ==========================================================================
   Dimly — brand-awareness marketing site
   Colors sourced 1:1 from the app's AppColors.dart. Do not approximate.
   ========================================================================== */

:root {
  /* Brand — exact values from AppColors.dart */
  --purple:        hsl(261, 100%, 71%);
  --purple-light:  hsl(271, 91%, 57%);
  --purple-dark:   hsl(273, 100%, 58%);
  --blue:          #1CB0F6;
  --blue-dark:     #0E8ACB;
  --error-red:     hsl(0, 100%, 71%);
  --success-green: hsl(143, 100%, 71%);
  --score-green:   #4CAF50;
  --score-lgreen:  #8BC34A;
  --score-yellow:  #FFEB3B;
  --score-red:     #F44336;
  --bg:            #F9F9FB;
  --surface:       #FFFFFF;
  --text:          #303030;
  --text-2:        #6A6A6A;

  /* Derived tints (purple at low alpha — not new hues) */
  --purple-tint:   hsl(261, 100%, 71%, 0.09);
  --purple-line:   hsl(261, 100%, 71%, 0.28);
  --border:        #E7E6EE;

  /* Type scale */
  --fs-hero: clamp(2.125rem, 5.5vw, 3.375rem);
  --fs-h2:   clamp(1.5rem, 3.5vw, 2.125rem);
  --fs-h3:   1.1875rem;
  --fs-body: 1.0625rem;
  --fs-sm:   0.875rem;

  /* Space */
  --section: clamp(80px, 11vw, 128px);
  --radius: 16px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, -apple-system, "Segoe UI", sans-serif;
  font-size: var(--fs-body);
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

a { color: inherit; }

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

.wrap {
  width: min(100% - 40px, 1080px);
  margin-inline: auto;
}

/* --------------------------------------------------------------------------
   Header
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: hsl(0, 0%, 100%, 0.88);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.site-header .wrap {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 64px;
}

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 1.25rem;
  letter-spacing: -0.02em;
  text-decoration: none;
  color: var(--text);
  margin-right: auto;
}

.logo-mark {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  overflow: hidden;
  flex: 0 0 auto;
  background: var(--purple-light); /* fallback if image fails */
}

.logo-mark img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.14); /* crop the icon's outer light padding/shadow */
}

.nav-links {
  display: none;
  gap: 28px;
  list-style: none;
}

.nav-links a {
  text-decoration: none;
  color: var(--text-2);
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: color 0.15s ease;
}

.nav-links a:hover { color: var(--text); }

/* Language toggle */
.lang-toggle {
  display: inline-flex;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  padding: 3px;
}

.lang-toggle button {
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--text-2);
  padding: 10px 14px;
  min-height: 44px;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}

.lang-toggle button[aria-pressed="true"] {
  background: var(--purple-tint);
  color: var(--purple-dark);
}

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 12px 24px;
  border-radius: 12px;
  border: 0;
  font: inherit;
  font-size: 1rem;
  font-weight: 700;
  text-decoration: none;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.btn-primary {
  background: var(--purple-light);
  color: #fff;
}

.btn-primary:hover { background: var(--purple-dark); }

.btn-ghost {
  background: var(--surface);
  color: var(--text);
  border: 1px solid var(--border);
}

.btn-ghost:hover { border-color: var(--purple-line); }

.header-cta { min-height: 44px; padding: 10px 18px; font-size: var(--fs-sm); }

/* --------------------------------------------------------------------------
   Hero — loads instantly, no entrance animation
   -------------------------------------------------------------------------- */
.hero {
  padding-block: clamp(56px, 8vw, 104px);
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.hero .wrap {
  display: grid;
  gap: 48px;
  align-items: center;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: var(--purple-tint);
  color: var(--purple-dark);
  font-size: var(--fs-sm);
  font-weight: 700;
  padding: 7px 14px;
  border-radius: 999px;
  margin-bottom: 20px;
}

.hero h1 {
  font-size: var(--fs-hero);
  line-height: 1.12;
  letter-spacing: -0.03em;
  font-weight: 800;
  margin-bottom: 18px;
  text-wrap: balance;
}

.hero .lede {
  color: var(--text-2);
  max-width: 34em;
  margin-bottom: 30px;
}

.store-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 16px;
}

.store-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--text);
  color: #fff;
  text-decoration: none;
  border-radius: 12px;
  padding: 10px 18px;
  min-height: 52px;
  transition: background 0.15s ease;
}

.store-badge:hover { background: #1c1c1c; }

.store-badge .badge-label { display: flex; flex-direction: column; line-height: 1.2; }
.store-badge .badge-small { font-size: 0.6875rem; opacity: 0.8; }
.store-badge .badge-big { font-size: 0.9375rem; font-weight: 700; }

/* Hero stats — 3k+ users, subjects, platforms */
.hero-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--border);
}

.stat { display: flex; flex-direction: column; }

.stat-num {
  font-size: 1.375rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.stat-label {
  font-size: var(--fs-sm);
  color: var(--text-2);
  font-weight: 600;
}

/* Hero screenshot — pre-composed marketing image, shown whole */
.hero-shot {
  width: min(100%, 320px);
  margin-inline: auto;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 24px 60px -28px hsl(261, 60%, 30%, 0.45);
}

.hero-shot img { width: 100%; height: auto; }

/* Device frame — wraps raw in-app screenshots so they read as a phone */
.device {
  width: min(100%, 260px);
  margin-inline: auto;
  margin-top: 6px;
  border: 9px solid #1b1b22;
  border-radius: 30px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 18px 44px -26px hsl(261, 50%, 25%, 0.5);
}

.device img { width: 100%; height: auto; }

/* --------------------------------------------------------------------------
   Sections
   -------------------------------------------------------------------------- */
.section { padding-block: var(--section); }

.section-alt { background: var(--surface); border-block: 1px solid var(--border); }

.section-head { max-width: 620px; margin-bottom: clamp(36px, 5vw, 56px); }

.section-head h2 {
  font-size: var(--fs-h2);
  letter-spacing: -0.02em;
  line-height: 1.2;
  margin-bottom: 12px;
  text-wrap: balance;
}

.section-head p { color: var(--text-2); }

/* Subjects */
.subject-grid {
  display: grid;
  gap: 18px;
}

.subject-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 28px 26px;
}

.subject-card .icon {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  background: var(--purple-tint);
  color: var(--purple-dark);
  display: grid;
  place-items: center;
  margin-bottom: 18px;
}

.subject-card h3 { font-size: var(--fs-h3); margin-bottom: 8px; }
.subject-card p { color: var(--text-2); font-size: 0.9375rem; }

/* Scoring */
.scoring-grid { display: grid; gap: 22px; }

.feature-card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 26px;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.section-alt .feature-card { background: var(--bg); }

.feature-card h3 { font-size: var(--fs-h3); }
.feature-card > p { color: var(--text-2); font-size: 0.9375rem; }

.pill {
  align-self: flex-start;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--purple-dark);
  background: var(--purple-tint);
  border-radius: 999px;
  padding: 5px 12px;
}

/* Score color scale — score colors appear ONLY here, illustrating prediction */
.score-scale { margin-top: 6px; }

.score-scale .bar {
  display: flex;
  height: 10px;
  border-radius: 999px;
  overflow: hidden;
}

.score-scale .bar span { flex: 1; }
.score-scale .s-red    { background: var(--score-red); }
.score-scale .s-yellow { background: var(--score-yellow); }
.score-scale .s-lgreen { background: var(--score-lgreen); }
.score-scale .s-green  { background: var(--score-green); }

.score-scale .scale-caption {
  display: flex;
  justify-content: space-between;
  font-size: 0.75rem;
  color: var(--text-2);
  margin-top: 8px;
}

/* Subjects note — mock exams callout under the subject cards */
.subjects-note {
  margin-top: 22px;
  padding: 16px 20px;
  background: var(--purple-tint);
  border: 1px solid var(--purple-line);
  border-radius: 12px;
  color: var(--text);
  font-size: 0.9375rem;
  font-weight: 600;
  max-width: 46em;
}

/* --------------------------------------------------------------------------
   Gallery — horizontal scroll of real app screens
   -------------------------------------------------------------------------- */
.gallery-scroll {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 6px 20px 16px;
  width: 100%;
  scrollbar-width: thin;
}

.gallery-item {
  flex: 0 0 auto;
  width: 200px;
  aspect-ratio: 9 / 19;
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--border);
  background: #0f0f14;
  scroll-snap-align: center;
  box-shadow: 0 14px 36px -26px hsl(261, 50%, 25%, 0.5);
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
}

/* --------------------------------------------------------------------------
   Free vs Premium
   -------------------------------------------------------------------------- */
.compare-scroll { overflow-x: auto; }

.compare {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  min-width: 480px;
}

.compare th, .compare td {
  padding: 16px 18px;
  text-align: left;
  font-size: 0.9375rem;
  border-bottom: 1px solid var(--border);
}

.compare tr:last-child th, .compare tr:last-child td { border-bottom: 0; }

.compare thead th {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: var(--text-2);
}

.compare thead th.premium-col { color: var(--purple-dark); }

.compare tbody th { font-weight: 600; }

.compare td.premium-col { background: var(--purple-tint); font-weight: 600; }

.compare .muted { color: var(--text-2); font-weight: 400; }

.compare .yes { color: var(--purple-dark); }

.energy-note {
  margin-top: 16px;
  font-size: var(--fs-sm);
  color: var(--text-2);
  max-width: 46em;
}

/* --------------------------------------------------------------------------
   Coming soon — Drills (locked)
   -------------------------------------------------------------------------- */
.drill-showcase {
  display: grid;
  gap: 32px;
  align-items: center;
}

.drill-media {
  position: relative;
  width: min(100%, 300px);
  margin-inline: auto;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 22px 56px -30px hsl(261, 60%, 30%, 0.5);
}

.drill-media img {
  width: 100%;
  height: auto;
  display: block;
  /* locked: image is dimmed + softened behind the overlay */
  filter: grayscale(0.15) brightness(0.72) blur(1px);
}

.lock-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  background: hsl(261, 45%, 22%, 0.42);
}

.lock-badge {
  position: relative;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  color: #fff;
  background: linear-gradient(160deg, var(--purple) 0%, var(--purple-dark) 100%);
  box-shadow: 0 8px 24px -6px hsl(273, 100%, 40%, 0.7);
}

/* The one added motion the founder asked for: a soft pulsing ring on the lock */
.lock-pulse {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 2px solid #fff;
  opacity: 0;
  animation: lockPulse 2.4s ease-out infinite;
}

@keyframes lockPulse {
  0%   { transform: scale(1);   opacity: 0.55; }
  70%  { transform: scale(1.7); opacity: 0; }
  100% { transform: scale(1.7); opacity: 0; }
}

.lock-text {
  font-size: var(--fs-sm);
  font-weight: 700;
  color: #fff;
  letter-spacing: 0.03em;
  background: hsl(0, 0%, 0%, 0.35);
  padding: 6px 14px;
  border-radius: 999px;
  backdrop-filter: blur(2px);
}

.coming-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: linear-gradient(160deg, var(--purple) 0%, var(--purple-dark) 100%);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 999px;
  padding: 6px 14px;
  margin-bottom: 18px;
}

.drill-copy h3 { font-size: var(--fs-h3); margin-bottom: 10px; }
.drill-copy > p { color: var(--text-2); font-size: 0.9375rem; max-width: 42em; margin-bottom: 18px; }

.drill-points { list-style: none; display: grid; gap: 10px; }

.drill-points li {
  position: relative;
  padding-left: 26px;
  font-size: 0.9375rem;
  color: var(--text);
}

.drill-points li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.45em;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--purple-light);
}

/* --------------------------------------------------------------------------
   Founder note
   -------------------------------------------------------------------------- */
.founder {
  max-width: 640px;
  margin-inline: auto;
  text-align: center;
}

.founder .rule {
  width: 48px;
  height: 4px;
  border-radius: 2px;
  background: var(--purple);
  margin: 0 auto 26px;
}

.founder h2 {
  font-size: var(--fs-h2);
  letter-spacing: -0.02em;
  margin-bottom: 18px;
}

.founder p { color: var(--text-2); }

.founder p + p { margin-top: 14px; }

/* --------------------------------------------------------------------------
   Team
   -------------------------------------------------------------------------- */
.section-head-center {
  margin-inline: auto;
  text-align: center;
}

/* Marquee viewport. Without JS (or under reduced motion) it stays a plain
   horizontally scrollable row, so every member is still reachable. */
.team-marquee {
  overflow-x: auto;
  overflow-y: hidden;
  padding-block: 4px;
  scrollbar-width: thin;
}

.team-marquee.is-looping {
  overflow: hidden;
  /* soften both edges so cards fade in/out rather than clipping hard */
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}

.team-track {
  display: flex;
  align-items: stretch;
  width: max-content;
  padding-inline: 20px;
}

.team-marquee.is-looping .team-track {
  padding-inline: 0;
  animation: teamScroll 44s linear infinite;
}

/* Pause so people can actually read a card that catches their eye */
.team-marquee.is-looping:hover .team-track,
.team-marquee.is-looping:focus-within .team-track {
  animation-play-state: paused;
}

@keyframes teamScroll {
  from { transform: translateX(0); }
  to   { transform: translateX(-50%); }
}

/* Uniform trailing margin (not gap) keeps the -50% wrap point exact */
.team-card {
  flex: 0 0 auto;
  width: 260px;
  margin-right: 18px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 30px 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 4px;
}

.team-avatar {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  margin-bottom: 12px;
  background: var(--purple-tint);
  color: var(--purple-dark);
  font-size: 1.5rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.team-name {
  font-size: var(--fs-h3);
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text);
}

.team-role {
  font-size: var(--fs-sm);
  font-weight: 600;
  color: var(--purple-dark);
  text-wrap: balance;
}

/* --------------------------------------------------------------------------
   Download band
   -------------------------------------------------------------------------- */
.download-band { text-align: center; }

.download-band h2 {
  font-size: var(--fs-h2);
  letter-spacing: -0.02em;
  margin-bottom: 24px;
  text-wrap: balance;
}

.download-band .store-badges { justify-content: center; margin-bottom: 0; }

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  padding-block: 44px;
}

.footer-top {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
  text-align: center;
  padding-bottom: 26px;
  border-bottom: 1px solid var(--border);
}

.footer-right {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.site-footer .logo { margin-right: 0; }

.footer-contact {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--text-2);
  text-decoration: none;
  font-size: var(--fs-sm);
  font-weight: 600;
  transition: color 0.15s ease;
}

.footer-contact:hover { color: var(--purple-dark); }
.footer-contact svg { color: var(--purple); }

.footer-social { display: flex; gap: 10px; }

.social-link {
  width: 44px;
  height: 44px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: var(--text-2);
  background: var(--surface);
  border: 1px solid var(--border);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}

.social-link:hover {
  color: var(--purple-dark);
  border-color: var(--purple-line);
  background: var(--purple-tint);
}

.footer-bottom {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  text-align: center;
  padding-top: 24px;
}

.site-footer .founders { font-size: var(--fs-sm); color: var(--text); font-weight: 600; }
.site-footer .fineprint { font-size: var(--fs-sm); color: var(--text-2); }

/* --------------------------------------------------------------------------
   Reveal — the ONLY scroll animation: 0.3s opacity fade, first entry only
   -------------------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transition: opacity 0.3s ease;
}

.reveal.is-visible { opacity: 1; }

/* If JS fails or user prefers reduced motion, everything stays visible */
.no-js .reveal { opacity: 1; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transition: none; }
  .lock-pulse { animation: none; opacity: 0.4; }
  .team-track { animation: none !important; }
  * { transition-duration: 0.01ms !important; }
}

/* --------------------------------------------------------------------------
   Breakpoints (mobile-first)
   -------------------------------------------------------------------------- */
@media (min-width: 720px) {
  .subject-grid { grid-template-columns: repeat(3, 1fr); }
  .scoring-grid { grid-template-columns: 1fr 1fr; }
  .hero .wrap { grid-template-columns: 1.15fr 0.85fr; }
  .drill-showcase { grid-template-columns: 300px 1fr; }
  .drill-media { margin-inline: 0; }
  .footer-top {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
  .footer-right { flex-direction: row; align-items: center; gap: 24px; }
  .footer-bottom {
    flex-direction: row;
    justify-content: space-between;
    text-align: left;
  }
}

/* Center the gallery track's content on wide screens */
@media (min-width: 1120px) {
  .gallery-scroll {
    justify-content: center;
    padding-inline: max(20px, calc((100% - 1080px) / 2));
  }
}

@media (min-width: 900px) {
  .nav-links { display: flex; }
}
