/* ========== Reset & Base ========== */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  /* App colors from StockYan — teal is the single accent, used the way the
     reference layout uses its acid tone: big flat blocks, not gradients. */
  --primary: #009E72;
  --primary-light: #00C48C;
  --primary-dark: #007A58;
  --secondary: #7C3AED;
  --accent: #0891B2;
  --green: #00FF88;
  --green-solid: #22C55E;
  --red: #FF5A5A;
  --orange: #FF9500;
  --warning: #c98f0a;
  --info: #3B82F6;
  --gold: #e8b64c;

  /* Ink for text/icons that sit ON a filled accent surface */
  --on-accent: #04120D;

  /* Dark theme — flatter and warmer-black than before to match the reference */
  --bg: #050706;
  --bg-surface: #0C100E;
  --bg-card: #101512;
  --bg-card-hover: #151C18;
  --text-primary: #F2F5F3;
  --text-secondary: #9AA8A0;
  --text-muted: #6B7972;
  --border: #1D2521;
  --divider: #1D2521;
  --muted: #0C100E;

  /* Shadows — neutral black only, no coloured glow */
  --shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
  --shadow-lg: 0 24px 70px rgba(0, 0, 0, 0.6);
  --shadow-glow: 0 0 0 rgba(0, 0, 0, 0);

  /* Radius */
  --radius: 12px;
  --radius-lg: 20px;
  --radius-xl: 28px;

  /* Motion — one easing everywhere so the whole page feels like one system */
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
  --dur: 0.35s;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
  width: 100%;
  /* Firefox — thin dark track with a brand-tinted thumb */
  scrollbar-width: thin;
  scrollbar-color: #2A3630 var(--bg);
}

/* ========== Scrollbar (WebKit / Chromium) ========== */
::-webkit-scrollbar {
  width: 10px;
  height: 10px;
}

::-webkit-scrollbar-track {
  background: var(--bg);
}

::-webkit-scrollbar-thumb {
  background: #2A3630;
  border-radius: 100px;
  /* inset border keeps the thumb visually thinner than its hit area */
  border: 2px solid var(--bg);
  background-clip: padding-box;
  transition: background-color var(--dur) var(--ease);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--primary);
  background-clip: padding-box;
}

::-webkit-scrollbar-corner {
  background: var(--bg);
}

body {
  font-family: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--bg);
  color: var(--text-primary);
  line-height: 1.6;
  overflow-x: hidden;
  width: 100%;
  max-width: 100%;
}

img,
picture,
svg,
video {
  max-width: 100%;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 24px;
}

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

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

/* ========== Typography ========== */
/* The reference pairs a heavy weight against a light weight on the same line:
   "Best crypto / investing platform / for your future." We do the same with
   .t-light for the de-emphasised half of each headline. */
h1, h2, h3, h4 {
  font-weight: 800;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1 { font-size: clamp(2.6rem, 5.4vw, 4.2rem); }
h2 { font-size: clamp(2rem, 4vw, 3.1rem); }
h3 { font-size: 1.2rem; letter-spacing: -0.01em; }
h4 { font-size: 1rem; }

.t-light {
  font-weight: 400;
  color: var(--text-secondary);
}

/* Accent word inside a headline. Kept named .gradient-text so existing markup
   keeps working, but it's a flat brand fill now — crisper at large sizes. */
.gradient-text,
.gradient-text-light {
  color: var(--primary-light);
  -webkit-text-fill-color: currentColor;
}

/* Eyebrow above a headline: "KEEP YOUR MONEY SAFE !" */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-secondary);
  margin-bottom: 20px;
}

.eyebrow::before {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--primary-light);
}

/* ========== Section Header ========== */
/* Reference style: headline left, supporting copy in a narrow right column. */
.section-header {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 48px;
  align-items: end;
  margin: 0 0 56px;
  max-width: none;
  text-align: left;
}

.section-header.light {
  color: var(--text-primary);
}

.section-header p {
  color: var(--text-secondary);
  font-size: 0.98rem;
  line-height: 1.75;
  max-width: 46ch;
}

/* Centered variant for the CTA block */
.section-header.is-centered {
  display: block;
  max-width: 680px;
  margin: 0 auto 56px;
  text-align: center;
}

.section-header.is-centered p {
  margin: 16px auto 0;
}

.section-tag {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(0, 196, 140, 0.1);
  border: 1px solid rgba(0, 196, 140, 0.25);
  border-radius: 100px;
  color: var(--primary-light);
  font-size: 0.85rem;
  font-weight: 600;
  letter-spacing: 0.5px;
  margin-bottom: 16px;
}

/* ========== Buttons ========== */
/* Pill button with a filled brand face — the reference's "Explore now". */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 13px 26px;
  border-radius: 100px;
  border: 1px solid transparent;
  font-family: inherit;
  font-size: 0.92rem;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  will-change: transform;
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease), color var(--dur) var(--ease);
}

.btn-primary {
  background: var(--primary-light);
  color: var(--on-accent);
}

.btn-primary:hover {
  transform: translateY(-2px);
  background: #14D89C;
}

.btn-ghost {
  background: transparent;
  border-color: var(--border);
  color: var(--text-primary);
}

.btn-ghost:hover {
  transform: translateY(-2px);
  border-color: rgba(0, 196, 140, 0.5);
  color: var(--primary-light);
}

/* Circular outline arrow badge from the reference's hero note */
.arrow-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 54px;
  height: 54px;
  flex-shrink: 0;
  border-radius: 50%;
  border: 1px solid rgba(0, 196, 140, 0.45);
  color: var(--primary-light);
  font-size: 1.05rem;
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

/* ========== Navigation ========== */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  padding: 18px 0;
  background: transparent;
  /* only cheap properties animate; no layout-triggering padding change */
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
  border-bottom: 1px solid transparent;
}

.nav.scrolled {
  background: rgba(5, 7, 6, 0.82);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--border);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.3rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.nav-logo img {
  width: 34px;
  height: 34px;
  border-radius: 9px;
}

/* Nav links live in a subtle pill rail, centered like the reference */
.nav-links {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-links a {
  padding: 9px 16px;
  border-radius: 100px;
  font-size: 0.92rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

.nav-links a:hover {
  color: var(--text-primary);
  background: rgba(255, 255, 255, 0.045);
}

.nav-cta {
  padding: 11px 24px !important;
  background: var(--primary-light) !important;
  border-radius: 100px;
  color: var(--on-accent) !important;
  font-weight: 700 !important;
  will-change: transform;
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease) !important;
}

.nav-cta:hover {
  transform: translateY(-2px);
  background: #14D89C !important;
  color: var(--on-accent) !important;
}

.nav-toggle {
  display: none;
  background: none;
  border: none;
  color: var(--text-primary);
  font-size: 1.4rem;
  cursor: pointer;
  padding: 4px 8px;
}

/* Mobile menu: fades/slides with transform+opacity instead of display flips,
   so opening it is composited rather than a hard layout jump. */
.mobile-menu {
  position: fixed;
  inset: 0;
  background: rgba(5, 7, 6, 0.97);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  z-index: 999;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 28px;
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease),
    visibility 0s linear var(--dur);
}

.mobile-menu.open {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease),
    visibility 0s;
}

.mobile-menu a {
  font-size: 1.4rem;
  font-weight: 700;
  color: var(--text-secondary);
  transition: color var(--dur) var(--ease);
}

.mobile-menu a:hover {
  color: var(--primary-light);
}

.mobile-menu .nav-cta {
  color: var(--on-accent) !important;
}

/* ========== Hero ========== */
.hero {
  padding: 132px 0 96px;
  position: relative;
  overflow: hidden;
}

.hero-container {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 56px;
  align-items: center;
  position: relative;
  z-index: 1;
}

/* lift the copy above the vertical centre — the phone column is much taller,
   so true centring pushes the text too far down the fold */
.hero-content {
  transform: translateY(-56px);
}

.hero-content h1 {
  max-width: 12ch;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  background: rgba(0, 196, 140, 0.1);
  border: 1px solid rgba(0, 196, 140, 0.25);
  border-radius: 100px;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--primary-light);
  margin-bottom: 24px;
}

.hero-badge i {
  font-size: 0.8rem;
}

.hero-subtitle {
  color: var(--text-secondary);
  font-size: 1.02rem;
  max-width: 46ch;
  margin-top: 22px;
  line-height: 1.75;
}

.hero-buttons {
  display: flex;
  gap: 14px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.store-btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 13px 22px;
  border-radius: 100px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-primary);
  will-change: transform;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}

.store-btn:hover {
  transform: translateY(-3px);
  border-color: rgba(0, 196, 140, 0.45);
  background: var(--bg-card-hover);
}

.store-btn i {
  font-size: 1.7rem;
}

.store-btn .store-label {
  display: block;
  font-size: 0.68rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1;
}

.store-btn .store-name {
  display: block;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1.3;
}

/* Live version badge under the Windows button (set by script.js from the
   Firebase version.json). Hidden until populated so it takes no space. */
.store-btn .store-version {
  display: block;
  font-size: 0.68rem;
  font-weight: 500;
  line-height: 1.2;
  color: var(--text-secondary);
  opacity: 0.85;
}
.store-btn .store-version:empty {
  display: none;
}

.store-btn.apple,
.store-btn.google,
.store-btn.windows {
  background: var(--bg-card);
  color: var(--text-primary);
}

.store-btn.windows i {
  color: #00a4ef;
}

.store-btn.large {
  padding: 16px 28px;
}

.store-btn.large i {
  font-size: 2rem;
}

.store-btn.large .store-name {
  font-size: 1.12rem;
}

/* Hero stats — mirrors the "168K+ / Realtime Users" cluster */
.hero-stats {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-top: 32px;
}

.stat-number {
  display: block;
  font-size: 1.6rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.stat-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  font-weight: 400;
}

.stat-divider {
  width: 1px;
  height: 38px;
  background: var(--border);
}

/* Hero Visual — two phones at opposing tilts with an orbit ring behind them,
   as in the reference. The composition is sized off the front phone; the back
   phone and the SVG are absolutely positioned against it. */
/* Both phones are absolutely positioned against this box, so it carries the
   composition's height itself rather than inheriting it from a child. */
.hero-visual {
  position: relative;
  height: clamp(600px, 82vh, 700px);
}

/* Sized so that once rotated, neither device extends past the hero's padding
   and gets clipped by its overflow:hidden. */
.hero-visual .phone-mockup {
  height: clamp(380px, 50vh, 450px);
}

/* Orbit ring. Entirely static geometry — nothing here animates. */
.hero-orbit {
  position: absolute;
  top: 50%;
  left: 50%;
  width: min(120%, 580px);
  height: auto;
  transform: translate(-50%, -50%);
  z-index: 1;
  pointer-events: none;
  overflow: visible;
  /* Soft edge fade so the stroke tapers off instead of ending in a hard cut.
     Kept wide enough that the ring itself stays fully visible. */
  -webkit-mask-image: radial-gradient(ellipse 78% 76% at 50% 48%, #000 82%, transparent 100%);
  mask-image: radial-gradient(ellipse 78% 76% at 50% 48%, #000 82%, transparent 100%);
}

.hero-orbit-ring {
  stroke: var(--primary-light);
  stroke-width: 1.6;
  stroke-linecap: round;
  fill: none;
  opacity: 0.45;
}

/* Matches the reference pairing: a large phone high on the left with a slight
   anticlockwise lean, and a smaller one dropped to the lower right at a much
   stronger clockwise angle, overlapping the first phone's bottom corner. */
/* Stacking order, back to front:
   1 .hero-orbit (ring) → 2 .phone-back → 4 .phone-front → 5 .floating-card */
.hero-visual .phone-front {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 4;
  /* a touch larger than the shared .phone-mockup size so it reads as the
     primary device against the smaller rear phone */
  height: clamp(420px, 56vh, 500px);
  transform: translate(-82%, -78%) rotate(-18deg);
}

.hero-visual .phone-back {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 2;
  height: 68%;
  margin: 0;
  transform: translate(5%, -40%) rotate(28deg);
}

.phone-mockup {
  height: clamp(560px, 82vh, 680px);
  aspect-ratio: 290 / 620;
  background: #12100F;
  border-radius: 42px;
  border: 3px solid #232825;
  padding: 8px;
  box-shadow: var(--shadow-lg), var(--shadow-glow);
  position: relative;
  z-index: 2;
}

.phone-screen {
  width: 100%;
  height: 100%;
  border-radius: 35px;
  overflow: hidden;
  background: #000;
  position: relative;
}

/* Mask the screenshot status bar (time/battery/signal) in the app previews */
.tabs-preview .phone-screen::before,
.paper-visual .phone-screen::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 5.2%;
  background: #000;
  z-index: 5;
}

.phone-screen picture {
  width: 100%;
  height: 100%;
  display: block;
}

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

/* Dynamic Island */
.phone-mockup::after {
  content: '';
  position: absolute;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: 88px;
  height: 27px;
  background: #000;
  border-radius: 20px;
  z-index: 10;
}

.phone-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: linear-gradient(180deg, var(--bg-surface) 0%, #000 100%);
}

.phone-placeholder img {
  width: 64px;
  height: 64px;
  border-radius: 14px;
}

.phone-placeholder p {
  font-size: 1.2rem;
  font-weight: 700;
  color: var(--text-secondary);
}

/* Floating chips. `float` animates transform only and is promoted to its own
   layer, so it never triggers layout or paint while running. */
.floating-card {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 11px 17px;
  background: rgba(12, 16, 14, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid var(--border);
  border-radius: 100px;
  font-size: 0.82rem;
  font-weight: 600;
  z-index: 3;
  will-change: transform;
  animation: float 5s var(--ease) infinite;
}

.floating-card i {
  font-size: 1rem;
}

/* Chips ring the composition: upper-left, mid-right, lower-left — clear of
   both devices. z-index keeps them above the phones. */
.card-1 {
  top: 0%;
  left: -12%;
  z-index: 5;
  animation-delay: 0s;
}

.card-1 i { color: var(--primary-light); }

.card-2 {
  top: 52%;
  right: -22%;
  z-index: 5;
  animation-delay: 1.6s;
}

.card-2 i { color: var(--orange); }

.card-3 {
  bottom: 16%;
  left: -2%;
  z-index: 5;
  animation-delay: 3.2s;
}

.card-3 i { color: var(--primary-light); }

@keyframes float {
  0%, 100% { transform: translate3d(0, 0, 0); }
  50%      { transform: translate3d(0, -12px, 0); }
}

/* ========== Features ========== */
.features {
  padding: 110px 0;
}

/* ---- Features carousel ---- */
.features-slider {
  position: relative;
}

/* Viewport clips the track; the fade edges hint at more cards either side. */
.features-viewport {
  overflow: hidden;
  padding: 4px;
  margin: -4px;
}

/* The track slides by whole cards. Only `transform` animates, so moving the
   carousel never triggers layout — it stays on the compositor. */
.features-grid {
  --cards: 3;
  --gap: 16px;
  --slide: 0.62s;
  display: flex;
  gap: var(--gap);
  /* cards are centred so the taller featured card grows evenly above and
     below its neighbours rather than pushing the row down */
  align-items: center;
  will-change: transform;
  /* gentle ease-in-out: no abrupt start or stop between auto-advances */
  transition: transform var(--slide) cubic-bezier(0.4, 0, 0.2, 1);
}

/* Flat cards. The hover lift is transform-only; the featured state is a pure
   colour swap, so nothing ever changes size as the highlight moves. */
.feature-card {
  position: relative;
  /* n cards per view, sharing the gaps between them */
  flex: 0 0 calc((100% - (var(--cards) - 1) * var(--gap)) / var(--cards));
  display: flex;
  flex-direction: column;
  padding: 32px 26px 30px;
  /* fixed heights: the featured card is taller, and because both the outgoing
     and incoming card animate on the same clock the swap reads as a single
     motion rather than one box collapsing next to another */
  height: 228px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  will-change: transform;
  transition: height var(--slide) cubic-bezier(0.4, 0, 0.2, 1),
    background-color var(--slide) var(--ease),
    border-color var(--slide) var(--ease),
    transform var(--dur) var(--ease);
}

.feature-card:hover {
  transform: translateY(-6px);
  background: var(--bg-card-hover);
  border-color: rgba(0, 196, 140, 0.35);
}

/* Centre card: solid brand green and taller than its neighbours. */
.feature-card.is-featured {
  height: 258px;
  background: var(--primary-light);
  border-color: var(--primary-light);
  z-index: 2;
}

.feature-card.is-featured:hover {
  background: #14D89C;
  border-color: #14D89C;
  transform: none;
}

.feature-card.is-featured h3,
.feature-card.is-featured p {
  color: var(--on-accent);
}

.feature-card.is-featured p {
  opacity: 0.78;
}

.feature-card.is-featured .feature-icon {
  background: rgba(4, 18, 13, 0.12);
  color: var(--on-accent);
}

/* ---- Carousel dots ---- */
.features-controls {
  display: flex;
  justify-content: center;
  margin-top: 40px;
}

.slider-dots {
  display: flex;
  align-items: center;
  gap: 9px;
}

.slider-dot {
  width: 7px;
  height: 7px;
  padding: 0;
  border: none;
  border-radius: 100px;
  background: #2A3630;
  cursor: pointer;
  overflow: hidden;
  transition: width 0.45s var(--ease), background-color 0.45s var(--ease);
}

.slider-dot:hover {
  background: #3A4A42;
}

/* Active dot stretches into a track; the ::before fill sweeps across it as a
   countdown to the next slide. Animating transform (not width) keeps the
   countdown on the compositor so it can't stutter the slide itself. */
.slider-dot.is-active {
  width: 30px;
  background: #2A3630;
}

.slider-dot::before {
  content: '';
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  background: var(--primary-light);
  transform: scaleX(0);
  transform-origin: left center;
}

.slider-dot.is-active::before {
  animation: dotCountdown var(--interval, 3200ms) linear forwards;
}

@keyframes dotCountdown {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}

/* paused auto-play (hover) freezes the countdown with it */
.features-slider.is-paused .slider-dot.is-active::before {
  animation-play-state: paused;
}

.feature-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  margin-bottom: 18px;
}

.feature-icon.green  { background: rgba(0, 196, 140, 0.12); color: #00C48C; }
.feature-icon.blue   { background: rgba(59, 130, 246, 0.12); color: #60A5FA; }
.feature-icon.purple { background: rgba(124, 58, 237, 0.12); color: #C084FC; }
.feature-icon.orange { background: rgba(255, 149, 0, 0.12); color: #FF9500; }
.feature-icon.red    { background: rgba(255, 90, 90, 0.12); color: #FF5A5A; }
.feature-icon.teal   { background: rgba(8, 145, 178, 0.12); color: #22D3EE; }
.feature-icon.indigo { background: rgba(59, 130, 246, 0.12); color: #3B82F6; }
.feature-icon.pink   { background: rgba(236, 72, 153, 0.12); color: #ec4899; }

.feature-card h3 {
  margin-bottom: 10px;
}

.feature-card p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.65;
}

/* ========== Screenshots ========== */
.screenshots {
  /* extra vertical room so the tilted phone group sits fully inside the
     section's own clip boundary rather than being cut at either edge */
  padding: 150px 0;
  overflow: hidden;
}

/* Copy on the left, screens cascading in from the right edge — the reference's
   arrangement. The right column is allowed to run past the container so the
   cards bleed off-screen instead of stopping at the gutter. */
/* 4/8 split: copy in a third, the phone arrangement in the remaining two. */
.screenshots-layout {
  display: grid;
  grid-template-columns: 4fr 8fr;
  gap: 48px;
  align-items: center;
}

/* Static slanted trio. The group is rotated as a whole, and each phone is
   stepped down the diagonal so they overlap like a fanned deck. No animation
   and no marquee — nothing here moves. */
/* A rotated child still occupies its pre-rotation box, so the tilted group
   can't size the stage on its own. The height is set explicitly and is large
   enough for the rotated arrangement — clipping stays off so nothing is cut. */
.screenshots-stage {
  position: relative;
  height: clamp(560px, 66vh, 700px);
  min-width: 0;
  overflow: visible;
}


/* Three slanted columns holding 2 | 1 | 2 phones. The whole group is rotated
   once; the columns keep real gaps so the phones stay clearly separated. */
/* Absolutely centred, then rotated about its own middle — so the tilt can't
   push the group off-centre or stretch the stage. */
.shots {
  position: absolute;
  top: 50%;
  left: 50%;
  display: flex;
  align-items: center;
  gap: 26px;
  transform: translate(-50%, -50%) rotate(22deg);
}

.shots-col {
  display: flex;
  flex-direction: column;
  gap: 26px;
}

.shot {
  flex: 0 0 auto;
  width: clamp(112px, 12.5vw, 154px);
  aspect-ratio: 240 / 480;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid #262E29;
  background: var(--bg-card);
  box-shadow: 0 26px 55px rgba(0, 0, 0, 0.62);
  will-change: transform;
  transition: transform var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

/* the middle column sits slightly forward and taller than its neighbours */
.shots-col:nth-child(2) {
  z-index: 2;
}

.shots-col:nth-child(2) .shot {
  width: clamp(170px, 19.5vw, 238px);
}

.shot:hover {
  transform: translateY(-10px);
  border-color: rgba(0, 196, 140, 0.5);
}

.shot picture,
.shot img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: top center;
}

.screenshots-copy h2 {
  margin-bottom: 18px;
}

.screenshots-copy p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.75;
  max-width: 42ch;
}

/* the copy column is narrower than the hero, so let the stats wrap rather
   than overflow, and give them a little more air above */
.screenshots-copy .hero-stats {
  flex-wrap: wrap;
  gap: 22px;
  margin-top: 36px;
}

/* Auto-scrolling "belt": viewport clips, the track marquees infinitely.
   The track holds two identical card sets; sliding it left by one set width
   and looping makes a seamless infinite scroll. translate3d keeps it on the
   compositor so the marquee never janks the main thread. */
/* The belt is rotated as a whole so the cards march diagonally off the right
   edge. Rotating the container (not each card) keeps the marquee maths intact
   and costs a single transform. */

/* ========== Services ========== */
.services {
  padding: 110px 0;
}

/* Master/detail: a single-column list of categories on the left, the selected
   category's items on the right. Exactly one is open at all times. */
.service-groups {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 20px;
  /* stretch so the detail panel matches the category rail's height instead of
     leaving a long empty gap beside it */
  align-items: stretch;
}

.service-tabs {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* Inactive rows recede so the open one clearly leads — but every category
   stays visible and clickable, because this rail is navigation. */
.service-tab {
  position: relative;
  display: flex;
  align-items: center;
  gap: 13px;
  width: 100%;
  font-family: inherit;
  font-size: 0.97rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 13px 16px;
  cursor: pointer;
  text-align: left;
  overflow: hidden;
  opacity: 0.45;
  will-change: transform;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease),
    color var(--dur) var(--ease), opacity var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.service-tab > i:first-child {
  font-size: 0.98rem;
  color: var(--primary-light);
  width: 20px;
  text-align: center;
}

.service-tab.is-premium > i:first-child {
  color: var(--gold);
}

.service-tab:hover {
  opacity: 0.85;
  color: var(--text-primary);
  border-color: rgba(0, 196, 140, 0.3);
}

/* accent rail marks the open category and ties it to the panel beside it */
.service-tab::before {
  content: '';
  position: absolute;
  left: 0;
  top: 10px;
  bottom: 10px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary-light);
  transform: scaleY(0);
  transition: transform var(--dur) var(--ease);
}

.service-tab.is-active::before {
  transform: scaleY(1);
}

/* Countdown to the next auto-advance — a hairline sweeping the row's width.
   transform-only so it stays on the compositor; hidden once the user takes
   control (.is-manual), since nothing is advancing then. */
.service-tab::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 2px;
  background: var(--primary-light);
  opacity: 0.6;
  transform: scaleX(0);
  transform-origin: left center;
}

.service-tab.is-premium::after {
  background: var(--gold);
}

.service-tab.is-active::after {
  animation: tabCountdown var(--interval, 3600ms) linear forwards;
}

/* Hovering the tool panel holds the current category open, so hold the
   countdown with it. Scoped to the panel only, matching where the timer
   pauses — :has() lets a hover on the right column reach back to the rail. */
.service-groups:has(.service-panels:hover) .service-tab.is-active::after {
  animation-play-state: paused;
}

.service-tabs.is-manual .service-tab::after {
  display: none;
}

@keyframes tabCountdown {
  from { transform: scaleX(0); }
  to   { transform: scaleX(1); }
}


.service-tab.is-premium::before {
  background: var(--gold);
}

/* the open row comes fully forward and leans toward its panel */
.service-tab.is-active {
  opacity: 1;
  background: var(--bg-card-hover);
  border-color: rgba(0, 196, 140, 0.45);
  color: var(--text-primary);
  transform: translateX(6px);
}

.service-tab.is-premium.is-active {
  border-color: rgba(232, 182, 76, 0.45);
}

/* caret points right and nudges over when the row is selected */
.service-tab-caret {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0;
  transform: translateX(-4px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

.service-tab:hover .service-tab-caret,
.service-tab.is-active .service-tab-caret {
  opacity: 1;
  transform: translateX(0);
  color: var(--primary-light);
}

.service-tab.is-premium.is-active .service-tab-caret {
  color: var(--gold);
}

/* ----- Right: the open category's items ----- */
/* A fixed floor stops the panel from snapping between very different heights
   (Learn & Grow has one item, Stock Scanner has nineteen) — without it the
   whole section jumps every time a category is selected. */
.service-panels {
  position: relative;
}

/* Bubble: the panel points back at whichever category is open. The arrow is
   a rotated square sharing the panel's border, and its vertical position is
   set from JS (--arrow-y) to line up with the active row. */
.service-panel {
  position: relative;
  height: 100%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 26px 26px 28px;
}

.service-panel::before {
  content: '';
  position: absolute;
  left: -8px;
  top: var(--arrow-y, 40px);
  width: 14px;
  height: 14px;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  transform: rotate(45deg);
  border-radius: 0 0 0 3px;
}

.service-panel.is-premium::before {
  border-color: rgba(232, 182, 76, 0.28);
}

.service-panel[hidden] {
  display: none;
}

.service-panel.is-premium {
  border-color: rgba(232, 182, 76, 0.28);
}

/* fade the incoming panel in — opacity only, so switching stays smooth */
.service-panel.is-active {
  animation: panelIn 0.3s var(--ease);
}

/* opacity only — a transform here would drag the bubble's arrow out of line
   with the active row while the panel fades in */
@keyframes panelIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* panel header: category name with a rule separating it from the items */
.service-panel-title {
  display: flex;
  align-items: center;
  gap: 11px;
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text-primary);
  padding-bottom: 16px;
  margin-bottom: 20px;
  border-bottom: 1px solid var(--border);
}

.service-panel-title i {
  font-size: 0.95rem;
  color: var(--primary-light);
}

/* item count badge, pushed to the right of the title */
.service-panel-count {
  margin-left: auto;
  padding: 3px 11px;
  border-radius: 100px;
  background: rgba(0, 196, 140, 0.1);
  color: var(--primary-light);
  font-size: 0.74rem;
  font-weight: 600;
  letter-spacing: 0.02em;
}

.service-panel.is-premium .service-panel-count {
  background: rgba(232, 182, 76, 0.1);
  color: var(--gold);
}

.service-panel.is-premium .service-panel-title i {
  color: var(--gold);
}

/* Items as a responsive card grid — fills the panel evenly instead of leaving
   a few small pills adrift in a large empty box. */
.service-items-inner {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(168px, 1fr));
  align-content: flex-start;
  gap: 10px;
}

.service-item {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 15px;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  font-size: 0.85rem;
  font-weight: 500;
  color: var(--text-secondary);
  will-change: transform;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease),
    color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.service-item:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0, 196, 140, 0.45);
  color: var(--text-primary);
  transform: translateY(-2px);
}

/* icon sits in its own tinted tile, matching the feature cards */
.service-item i {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  border-radius: 9px;
  font-size: 0.8rem;
  background: rgba(0, 196, 140, 0.1);
  color: var(--primary-light);
}

/* premium categories: gold accents to match the app */
.service-panel.is-premium .service-item i {
  background: rgba(232, 182, 76, 0.1);
  color: var(--gold);
}

.service-panel.is-premium .service-item:hover {
  border-color: rgba(232, 182, 76, 0.45);
}

/* ========== Premium ========== */
.premium {
  padding: 110px 0;
  position: relative;
}

.premium-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.premium-card {
  padding: 30px 24px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  position: relative;
  overflow: hidden;
  will-change: transform;
  transition: transform var(--dur) var(--ease), background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease);
}

.premium-card:hover {
  background: var(--bg-card-hover);
  border-color: rgba(0, 196, 140, 0.35);
  transform: translateY(-6px);
}

.premium-icon {
  width: 46px;
  height: 46px;
  border-radius: 13px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.15rem;
  background: rgba(0, 196, 140, 0.12);
  color: var(--primary-light);
  margin-bottom: 18px;
}

.premium-card h3 {
  margin-bottom: 10px;
}

.premium-card p {
  color: var(--text-secondary);
  font-size: 0.88rem;
  line-height: 1.65;
}

/* ========== Stock Detail Tabs ========== */
.stock-detail {
  padding: 110px 0;
}

.tabs-switcher {
  display: grid;
  grid-template-columns: 1fr 0.85fr;
  gap: 56px;
  align-items: center;
}

.tabs-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.tab-row {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  text-align: left;
  padding: 15px 18px;
  background: transparent;
  border: 1px solid transparent;
  border-radius: var(--radius);
  color: inherit;
  cursor: pointer;
  font: inherit;
  position: relative;
  overflow: hidden;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}

.tab-row:hover {
  background: var(--bg-card);
}

.tab-row.is-active {
  background: var(--bg-card);
  border-color: rgba(0, 196, 140, 0.4);
}

/* Accent rail. Always present, scaled to 0 when inactive, so switching tabs
   animates a transform instead of inserting/removing a pseudo-element. */
.tab-row::before {
  content: '';
  position: absolute;
  left: 0;
  top: 13px;
  bottom: 13px;
  width: 3px;
  border-radius: 0 3px 3px 0;
  background: var(--primary-light);
  transform: scaleY(0);
  transform-origin: center;
  transition: transform var(--dur) var(--ease);
}

.tab-row.is-active::before {
  transform: scaleY(1);
}

.tab-row-num {
  font-size: 0.78rem;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  width: 22px;
  flex-shrink: 0;
  transition: color var(--dur) var(--ease);
}

.tab-row.is-active .tab-row-num {
  color: var(--primary-light);
}

.tab-row-icon {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1rem;
  background: rgba(0, 196, 140, 0.1);
  color: var(--primary-light);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease),
    transform var(--dur) var(--ease);
}

.tab-row.is-active .tab-row-icon {
  background: var(--primary-light);
  color: var(--on-accent);
  transform: scale(1.06);
}

.tab-row-text {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.tab-row-title {
  font-size: 0.96rem;
  font-weight: 600;
  color: var(--text-primary);
}

.tab-row-desc {
  font-size: 0.79rem;
  color: var(--text-muted);
  line-height: 1.4;
}

.tab-row-arrow {
  margin-left: auto;
  font-size: 0.72rem;
  color: var(--text-muted);
  opacity: 0;
  transform: translateX(-6px);
  transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease),
    color var(--dur) var(--ease);
}

.tab-row:hover .tab-row-arrow,
.tab-row.is-active .tab-row-arrow {
  opacity: 1;
  transform: translateX(0);
  color: var(--primary-light);
}

.tabs-preview {
  display: flex;
  justify-content: center;
}

.tabs-preview .phone-mockup {
  height: clamp(560px, 82vh, 680px);
}

/* Cross-fade the preview screenshot when a tab changes. script.js toggles
   .is-swapping around the src change; opacity-only, so it stays smooth. */
.tabs-preview .phone-screen img {
  transition: opacity 0.22s var(--ease);
}

.tabs-preview .phone-screen img.is-swapping {
  opacity: 0;
}

/* ========== Paper Trading ========== */
.paper-trading {
  padding: 110px 0;
}

.paper-trading-inner {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 64px;
  align-items: center;
}

.paper-content .section-tag {
  margin-bottom: 16px;
}

.paper-content h2 {
  margin-bottom: 18px;
}

.paper-content > p {
  color: var(--text-secondary);
  font-size: 1rem;
  line-height: 1.75;
  margin-bottom: 30px;
  max-width: 50ch;
}

.paper-features {
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.paper-feature {
  display: flex;
  align-items: center;
  gap: 12px;
  font-size: 0.93rem;
  color: var(--text-secondary);
}

.paper-feature i {
  color: var(--primary-light);
  font-size: 1.05rem;
}

.paper-visual {
  display: flex;
  justify-content: center;
}

.paper-visual .phone-mockup {
  height: clamp(560px, 82vh, 680px);
}

/* ========== Download CTA ========== */
/* The reference closes on a bordered panel over the grid backdrop. */
.download {
  /* extra bottom room so the divider clears the panel and the phone art that
     overflows it, instead of crowding right under the box */
  padding: 110px 0 180px;
  position: relative;
}

/* keep the section (and its popover) above the footer while the help is open */
.download:has(.win-help-toggle[aria-expanded="true"]) {
  z-index: 50;
}

.download-container {
  position: relative;
  z-index: 1;
}

/* Two-column panel: copy on the left, a real app screen filling the right.
   Flat surface — no gradient wash. */
.download-content {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 40px;
  align-items: center;
  max-width: 1160px;
  margin: 0 auto;
  padding: 30px 56px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  position: relative;
  /* visible so the phone can break out past the panel's edges */
  overflow: visible;
  text-align: left;
}

.download-content h2 {
  /* smaller than the page's default h2 — this panel is a narrow column */
  font-size: clamp(1.5rem, 2.4vw, 2rem);
  margin-bottom: 12px;
}

.download-content p {
  color: var(--text-secondary);
  font-size: 0.9rem;
  margin: 0 0 24px;
  line-height: 1.65;
  max-width: 38ch;
}

.download-buttons {
  display: flex;
  gap: 12px;
  justify-content: flex-start;
  flex-wrap: wrap;
}

/* The screen breaks out of the panel — taller than the box and lifted above
   its top edge — so it reads as standing in front of the surface rather than
   sitting inside it. The whole device stays visible; nothing is cut. */
.download-visual {
  position: relative;
  align-self: stretch;
  /* the image is absolutely placed, so this holds the column open */
  min-height: 180px;
}

.download-visual img {
  width: auto;
  height: clamp(390px, 46vw, 540px);
  object-fit: contain;
  /* absolutely placed so its height can't stretch the panel — it overhangs
     the top and bottom edges instead of pushing them apart */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) rotate(11deg);
  border-radius: 24px;
  border: 3px solid #232825;
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.6);
}

.download-buttons .store-btn {
  padding: 13px 20px;
}

/* Windows "blocked app" help — info popover */
.win-download-group {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

/* lift the whole group above sibling sections while the popover is open */
.win-download-group:has(.win-help-toggle[aria-expanded="true"]) {
  z-index: 50;
}

.win-help-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 1rem;
  cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease),
    background-color var(--dur) var(--ease);
}

.win-help-toggle:hover,
.win-help-toggle[aria-expanded="true"] {
  color: var(--primary-light);
  border-color: rgba(0, 196, 140, 0.5);
  background: var(--bg-card-hover);
}

.win-help {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  z-index: 50;
  width: 360px;
  max-width: calc(100vw - 32px);
  text-align: left;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.5);
  padding: 18px 20px;
  animation: winHelpIn 0.18s var(--ease);
}

.win-help[hidden] {
  display: none;
}

@keyframes winHelpIn {
  from { opacity: 0; transform: translate3d(0, -6px, 0); }
  to   { opacity: 1; transform: translate3d(0, 0, 0); }
}

/* little arrow pointing up to the icon */
.win-help::before {
  content: "";
  position: absolute;
  top: -7px;
  right: 12px;
  width: 12px;
  height: 12px;
  background: var(--bg-card);
  border-left: 1px solid var(--border);
  border-top: 1px solid var(--border);
  transform: rotate(45deg);
}

.win-help-title {
  font-size: 0.95rem !important;
  font-weight: 600;
  color: var(--text-primary) !important;
  margin: 0 0 8px !important;
}

.win-help p {
  font-size: 0.9rem;
  line-height: 1.6;
  color: var(--text-secondary);
  margin: 4px 0 0;
}

.win-help ol {
  margin: 12px 0 4px;
  padding-left: 20px;
  display: grid;
  gap: 10px;
}

.win-help ol li {
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--text-secondary);
}

.win-help ol li strong {
  color: var(--text-primary);
  font-weight: 600;
}

.win-help code {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--border);
  border-radius: 5px;
  padding: 1px 6px;
  font-size: 0.85em;
}

.win-help-note {
  margin-top: 14px !important;
  font-size: 0.83rem !important;
  opacity: 0.75;
}

/* ========== Footer ========== */
.footer {
  padding: 64px 0 32px;
  border-top: 1px solid var(--border);
  position: relative;
  overflow: hidden;
}

/* Oversized ghost wordmark anchored to the footer's bottom edge. Purely
   decorative: no text content to read out, and it never animates. */
.footer::after {
  content: 'NEPSE';
  position: absolute;
  left: 50%;
  bottom: -0.22em;
  transform: translateX(-50%);
  font-size: clamp(5rem, 17vw, 15rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1;
  color: rgba(255, 255, 255, 0.032);
  pointer-events: none;
  user-select: none;
  z-index: 0;
}

.footer-container {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 64px;
  /* sits above the ghost wordmark */
  position: relative;
  z-index: 1;
}

.footer-logo {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 12px;
}

.footer-logo img {
  width: 32px;
  height: 32px;
  border-radius: 8px;
}

.footer-brand p {
  color: var(--text-muted);
  font-size: 0.88rem;
  line-height: 1.65;
}

.footer-links {
  display: flex;
  gap: 64px;
}

.footer-col h4 {
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.footer-col a {
  display: block;
  font-size: 0.88rem;
  color: var(--text-muted);
  padding: 4px 0;
  transition: color var(--dur) var(--ease);
}

.footer-col a:hover {
  color: var(--primary-light);
}

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

.footer-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  font-size: 1rem;
  color: var(--text-secondary);
  background: var(--bg-card);
  border: 1px solid var(--border);
  will-change: transform;
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease),
    border-color var(--dur) var(--ease), transform var(--dur) var(--ease);
}

.footer-social a:hover {
  color: var(--primary-light);
  background: var(--bg-card-hover);
  border-color: rgba(0, 196, 140, 0.4);
  transform: translateY(-3px);
}

.footer-bottom {
  grid-column: 1 / -1;
  padding-top: 32px;
  margin-top: 32px;
  border-top: 1px solid var(--border);
}

.footer-bottom p {
  color: var(--text-muted);
  font-size: 0.85rem;
}

/* ========== Responsive ========== */
@media (max-width: 1024px) {
  .section-header {
    grid-template-columns: 1fr;
    gap: 18px;
    align-items: start;
  }

  .features-grid {
    --cards: 2;
  }

  /* narrower category rail at tablet widths */
  .service-groups {
    grid-template-columns: 250px 1fr;
  }

  /* narrower columns make the diagonal cascade too tight — go single-column */
  .screenshots-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .premium-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* ----- Tabs: horizontal pill strip above the phone ----- */
  .tabs-switcher {
    grid-template-columns: 1fr;
    gap: 24px;
    max-width: 560px;
    margin: 0 auto;
  }

  .tabs-list {
    order: -1;
    flex-direction: row;
    gap: 10px;
    overflow-x: auto;
    overflow-y: hidden;
    padding: 4px 4px 12px;
    margin: 0 -4px;
    scroll-snap-type: x proximity;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .tabs-list::-webkit-scrollbar {
    display: none;
  }

  .tab-row {
    flex: 0 0 auto;
    width: auto;
    gap: 10px;
    padding: 10px 16px;
    border: 1px solid var(--border);
    border-radius: 100px;
    scroll-snap-align: center;
  }

  /* compact pill: hide number, description and arrow */
  .tab-row-num,
  .tab-row-desc,
  .tab-row-arrow {
    display: none;
  }

  .tab-row::before {
    display: none; /* no accent rail on pills */
  }

  .tab-row-icon {
    width: 30px;
    height: 30px;
    border-radius: 9px;
    font-size: 0.9rem;
  }

  .tab-row-title {
    font-size: 0.9rem;
    white-space: nowrap;
  }

  .tabs-preview .phone-mockup {
    height: clamp(520px, 70vh, 620px);
  }
}

@media (max-width: 768px) {
  .nav-links {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .hero {
    padding: 118px 0 60px;
    min-height: auto;
  }

  .hero-container {
    grid-template-columns: 1fr;
    gap: 44px;
    text-align: center;
  }

  .hero-content h1 {
    max-width: none;
  }

  /* stacked layout — no phone column to offset against */
  .hero-content {
    transform: none;
  }

  .eyebrow {
    justify-content: center;
  }

  .hero-subtitle {
    margin: 20px auto 0;
  }

  .hero-buttons {
    justify-content: center;
  }

  .hero-stats {
    justify-content: center;
  }

  .hero-visual {
    order: -1;
  }

  /* Single upright phone on mobile: the diagonal pair needs width we don't
     have, so the front device returns to normal flow and centers. */
  .hero-visual {
    height: auto;
    display: flex;
    justify-content: center;
  }

  .hero-visual .phone-front {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
  }

  .hero-visual .phone-back,
  .hero-orbit {
    display: none;
  }

  .phone-mockup,
  .hero-visual .phone-mockup {
    width: 220px;
    height: auto;
  }

  .tabs-preview .phone-mockup {
    width: min(280px, 78vw);
    height: auto;
  }

  .floating-card {
    display: none;
  }

  .features-grid {
    --cards: 1;
  }

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

  /* stack: category list above, the open panel below */
  .service-groups {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .service-items-inner {
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
  }

  /* stacked layout: no rail to the side, so drop the bubble arrow and the
     active row's sideways lean */
  .service-panel::before {
    display: none;
  }

  .service-tab.is-active {
    transform: none;
  }

  .tab-row {
    padding: 9px 14px;
    gap: 8px;
  }

  .paper-trading-inner {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
  }

  .paper-content > p {
    margin-inline: auto;
  }

  .paper-features {
    align-items: center;
  }

  /* CTA panel stacks: copy first, screen below and centered */
  .download-content {
    grid-template-columns: 1fr;
    gap: 8px;
    padding: 48px 24px 0;
    text-align: center;
  }

  .download-content p {
    margin-inline: auto;
  }

  .download-buttons {
    justify-content: center;
  }

  .download-visual img {
    height: clamp(240px, 56vw, 300px);
    transform: translate(-50%, -50%) rotate(5deg);
  }

  .download-visual {
    min-height: 210px;
  }

  .footer-container {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .footer-links {
    gap: 40px;
  }

  /* stack the copy above the phones and ease the slant on small screens */
  .screenshots-layout {
    grid-template-columns: 1fr;
    gap: 36px;
    text-align: center;
  }

  .screenshots-copy p {
    margin-inline: auto;
  }

  .shots {
    transform: translate(-50%, -50%) rotate(10deg);
    gap: 12px;
  }

  .screenshots-stage {
    height: clamp(300px, 42vh, 380px);
  }

  .shots-col {
    gap: 12px;
  }

  /* drop the second phone in each outer column — 2|1|2 is too wide here */
  .shots-col:nth-child(odd) .shot:nth-child(2) {
    display: none;
  }

  .shot,
  .shots-col:nth-child(2) .shot {
    width: clamp(88px, 25vw, 120px);
  }

  .store-btn.large {
    padding: 14px 22px;
  }
}

@media (max-width: 480px) {
  .hero-buttons {
    flex-direction: column;
    align-items: center;
  }

  .store-btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  .hero-stats {
    flex-direction: column;
    gap: 16px;
  }

  .stat-divider {
    width: 40px;
    height: 1px;
  }

  .tab-row-desc {
    font-size: 0.75rem;
  }

  .download-buttons {
    flex-direction: column;
    align-items: center;
  }

  .download-buttons .store-btn {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }

  .win-download-group {
    width: 100%;
    max-width: 280px;
    justify-content: center;
  }
}

/* ========== Scroll Animations ========== */
/* opacity + transform only — both composited, so reveals never cause layout. */
.fade-up {
  opacity: 0;
  transform: translate3d(0, 24px, 0);
  transition: opacity 0.55s var(--ease), transform 0.55s var(--ease);
}

.fade-up.visible {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

/* Drop the promotion hint once the reveal is done so long pages don't hold
   dozens of extra compositor layers alive. */
.fade-up.visible {
  will-change: auto;
}

/* ========== Reduced Motion ========== */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .fade-up {
    opacity: 1;
    transform: none;
  }

  .floating-card {
    animation: none;
  }
}
