/* ==========================================================================
   efsanenine.com — styles, on the AIVINIR design system.
   Tokens + components (buttons, cards, eyebrow, chips, the video carousel) are
   ported from site/css/styles.css — the official brandbook palette (v1.0, 2026),
   dark-ONLY, single family Inter (display = heavier weight). The carousel CSS is
   verbatim: it is half of the tuned loop/lazy-video machinery (js/carousel.js
   is the other half) — change the aivinir source first, then re-port.
   ========================================================================== */

:root {
  /* --- raw brandbook tokens --- */
  --aivinir-bg: #030811;        /* MIDNIGHT  — фон ~70%      */
  --aivinir-surface: #071523;   /* SURFACE   — карточки      */
  --aivinir-deep: #0D2530;      /* DEEP SURF — выделения     */
  --aivinir-aqua: #14D9D4;      /* AQUA      — AI-акцент      */
  --aivinir-blue: #3152FF;      /* ELECTRIC  — digital        */
  --aivinir-text: #F4F7F8;      /* CLOUD     — текст/свет     */
  --aivinir-muted: #95A6AE;     /* SLATE     — вторичный      */
  --aivinir-human: #E08A2E;     /* HUMAN AMBER — тепло        */

  /* --- semantic map --- */
  --background: var(--aivinir-bg);
  --foreground: var(--aivinir-text);
  --card: var(--aivinir-surface);
  --card-foreground: var(--aivinir-text);
  --deep-surface: var(--aivinir-deep);
  --primary: var(--aivinir-aqua);
  --primary-foreground: var(--aivinir-bg);
  --secondary: var(--aivinir-deep);
  --secondary-foreground: var(--aivinir-text);
  --muted-foreground: var(--aivinir-muted);
  --accent: var(--aivinir-deep);
  --brand-amber: var(--aivinir-human);
  --border: #173043;
  --input-fill: #0a1a28;

  --radius-sm: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;

  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  --shadow-card: 0 1px 2px rgba(0,0,0,0.45), 0 14px 36px rgba(0,0,0,0.34);
}

/* ---- Reset / base ------------------------------------------------------ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
/* Author display rules (flex/block on cards etc.) would silently defeat the [hidden]
 * attribute the JS toggles — author CSS always beats the UA's [hidden]{display:none}. */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--font-sans);
  background: var(--background);
  color: var(--foreground);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
h1, h2, h3 { letter-spacing: -0.02em; line-height: 1.15; font-weight: 800; }
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button { font-family: inherit; cursor: pointer; }
svg.ic { width: 1.5rem; height: 1.5rem; flex: none; }

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 28px 20px 40px;
  text-align: center;
}

.eyebrow {
  display: inline-block;
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--primary);
  margin-bottom: 0.75rem;
}

/* ---- Brand pattern (placeholder tiles, verbatim) ----------------------- */
.brand-pattern {
  background-image:
    radial-gradient(circle at 26px 26px, color-mix(in oklab, var(--primary) 70%, transparent) 0 1.6px, transparent 2.4px),
    radial-gradient(circle at 26px 26px, color-mix(in oklab, var(--brand-amber) 60%, transparent) 0 1px, transparent 7px);
  background-size: 52px 52px;
}

/* ------------------------------- hero ------------------------------- */
.hero__media { margin: 0 0 18px; }
.hero__media-frame { position: relative; }
.hero__video,
.hero__placeholder {
  width: 100%;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-2xl);
  border: 1px solid var(--border);
  box-shadow: var(--shadow-card);
  background: var(--deep-surface);
  object-fit: cover;
  display: block;
}
.hero__placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: var(--deep-surface);
}
.hero__placeholder-emoji { font-size: 96px; filter: drop-shadow(0 6px 18px rgba(0,0,0,.5)); }
.hero__video-note { margin: 8px 0 0; font-size: 13px; color: var(--muted-foreground); }
.hero__title { margin: 18px 0 10px; font-size: clamp(1.65rem, 6.5vw, 2.1rem); }
.hero__subtitle { margin: 0; color: var(--muted-foreground); font-size: 16px; }

/* ------------------------------- value ------------------------------- */
.value { margin: 26px 0 6px; }
.value__title { margin: 0 0 12px; font-size: 1.15rem; }
.value__list { list-style: none; margin: 0; padding: 0; text-align: left; }
.value__list li {
  margin: 8px 0;
  padding: 12px 14px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  font-size: 15px;
  box-shadow: var(--shadow-card);
}

/* ------------------------------- buttons ------------------------------- */
.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  padding: 1rem 1.5rem;
  border: 1px solid transparent;
  border-radius: var(--radius-xl);
  font-size: 1.05rem;
  font-weight: 700;
  line-height: 1.2;
  text-decoration: none;
  transition: filter .15s, background .15s, transform .05s;
}
.btn:active { transform: translateY(1px); }
.btn--cta {
  background: var(--primary);
  color: var(--primary-foreground);
  min-height: 52px;
  font-size: 1.15rem;
  box-shadow: 0 8px 26px color-mix(in oklab, var(--primary) 35%, transparent);
}
.btn--cta:hover { filter: brightness(1.07); }
.cta { margin: 22px 0 6px; }
.cta__hint { margin: 8px 0 0; font-size: 13px; color: var(--muted-foreground); }

/* --------------------- «Videolarım» — the reels carousel --------------------- */
/* Ported verbatim from aivinir (site/css/styles.css). NOTE: no `scroll-behavior:smooth`
   on .hero-carousel — it makes init-centering + the recenter writes animate, which
   fights into a runaway auto-scroll on load. Arrows pass {behavior:"smooth"} to scrollBy. */
.videos { margin: 34px 0 0; padding-top: 26px; border-top: 1px solid var(--border); }
.videos__title { margin: 0 0 6px; font-size: 1.35rem; }
.videos__sub { margin: 0 0 14px; font-size: 14px; color: var(--muted-foreground); }
.hero-carousel-wrap { position: relative; }
.hero-carousel {
  display: flex; gap: 1rem; overflow-x: auto;
  scroll-snap-type: x mandatory;   /* momentum settles per card — no runaway fling */
  scrollbar-width: none; -webkit-overflow-scrolling: touch;
  padding-block: 0.5rem; margin-inline: -20px; padding-inline: 20px; /* bleed to edges */
}
.hero-carousel::-webkit-scrollbar { display: none; }
.hero-card { flex: 0 0 auto; width: 62vw; max-width: 14rem; margin: 0; scroll-snap-align: center; }
@media (min-width: 768px) { .hero-card { width: 13rem; } }
.video-card__media { position: relative; aspect-ratio: 9 / 16; border-radius: var(--radius-2xl); overflow: hidden; border: 1px solid var(--border); background: var(--deep-surface); box-shadow: var(--shadow-card); }
.video-card__poster, .video-card__media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
/* Tap-to-play affordance — shown ONLY in data-saver mode, hidden once a card plays */
.video-card__play { display: none; }
.hero-carousel.is-saver .video-card__media:not(.is-playing) .video-card__play { display: flex; position: absolute; inset: 0; align-items: center; justify-content: center; background: color-mix(in oklab, var(--deep-surface) 30%, transparent); cursor: pointer; }
.video-card__play-ic { width: 2.5rem; height: 2.5rem; fill: #fff; opacity: 0.95; filter: drop-shadow(0 1px 5px rgba(0, 0, 0, 0.45)); }
.video-card__media--placeholder { aspect-ratio: 9 / 16; background-color: var(--deep-surface); }

/* Sound toggle — this landing's addition: the clips carry audio (autoplay stays muted). */
.video-card__sound {
  position: absolute; right: 0.5rem; bottom: 0.5rem; z-index: 2;
  display: flex; align-items: center; justify-content: center;
  width: 2.4rem; height: 2.4rem; border-radius: 999px; border: 1px solid var(--border);
  background: color-mix(in oklab, var(--aivinir-bg) 62%, transparent);
  color: #fff; backdrop-filter: blur(4px);
}
.video-card__sound .ic { width: 1.15rem; height: 1.15rem; }
.video-card__sound-on { display: none; }
.video-card__media.has-sound .video-card__sound-on { display: block; }
.video-card__media.has-sound .video-card__sound-off { display: none; }
.video-card__media.has-sound .video-card__sound { border-color: var(--primary); color: var(--primary); }

/* Stats caption — the case-handle pattern, counters instead of a handle. */
.video-card__stats {
  margin-top: 0.6rem; display: flex; justify-content: center; gap: 0.9rem;
  font-weight: 600; font-size: 0.92rem; color: var(--primary);
  user-select: none; -webkit-user-select: none;
}
.video-card__stats .video-card__stat + .video-card__stat { color: var(--muted-foreground); }

/* Carousel arrows — desktop only (mobile uses native swipe). Verbatim. */
.carousel-arrow { display: none; }
@media (min-width: 768px) {
  .carousel-arrow {
    display: flex; align-items: center; justify-content: center;
    position: absolute; top: 50%; transform: translateY(-50%); z-index: 3;
    width: 2.75rem; height: 2.75rem; border-radius: 999px; cursor: pointer;
    background: color-mix(in oklab, var(--card) 88%, transparent);
    border: 1px solid var(--border); color: var(--foreground);
    box-shadow: var(--shadow-card); transition: background .15s, transform .15s;
  }
  .carousel-arrow:hover { background: var(--card); transform: translateY(-50%) scale(1.06); }
  .carousel-arrow .ic { width: 1.25rem; height: 1.25rem; }
  .carousel-arrow--prev { left: -0.5rem; }
  .carousel-arrow--next { right: -0.5rem; }
}

/* ------------------------------- install ------------------------------- */
.install { margin: 30px 0 0; padding-top: 22px; border-top: 1px solid var(--border); }
.install__title { margin: 0 0 8px; font-size: 1.1rem; }
.install__text { margin: 0 0 12px; font-size: 14px; color: var(--muted-foreground); }
.install__stores { display: grid; gap: 10px; }
.btn--store {
  background: var(--secondary);
  color: var(--secondary-foreground);
  border-color: var(--border);
  font-size: 1rem;
  padding: 0.8rem 1.5rem;
}
.btn--store:hover { background: var(--accent); }

/* ------------------------------ fallback ------------------------------ */
.fallback {
  margin: 30px 0 0;
  padding: 18px 16px;
  text-align: left;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card);
  font-size: 15px;
}
.fallback.hide { display: none; }
.fallback__title { margin: 0 0 10px; font-size: 1.1rem; }
.fallback__input {
  width: 100%;
  padding: 10px;
  margin: 8px 0;
  font-size: 13px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  background: var(--input-fill);
  color: inherit;
}
.btn--copy {
  background: var(--brand-amber);
  color: var(--aivinir-bg);
  font-size: 1rem;
  padding: 0.8rem 1.5rem;
  margin-bottom: 6px;
}
.btn--copy:hover { filter: brightness(1.07); }

/* ------------------------------- footer ------------------------------- */
.footer { margin-top: 36px; padding-top: 18px; border-top: 1px solid var(--border); font-size: 13px; color: var(--muted-foreground); }
.footer__support a { color: var(--primary); }
.footer__lang { margin-top: 10px; }
.lang-btn {
  background: none;
  border: 0;
  padding: 2px 4px;
  font: inherit;
  color: var(--muted-foreground);
  cursor: pointer;
}
.lang-btn.is-active { color: var(--foreground); font-weight: 700; }

/* ----------------------------- exit popup ----------------------------- */
.overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(3, 8, 17, 0.72);
  z-index: 50;
}
.overlay[hidden] { display: none; }
.modal {
  position: relative;
  width: 100%;
  max-width: 380px;
  padding: 26px 20px 20px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-card);
  text-align: center;
}
.modal h2 { margin: 0 0 10px; font-size: 1.3rem; }
.modal p { margin: 0 0 16px; color: var(--muted-foreground); font-size: 15px; }
.modal__close {
  position: absolute;
  top: 8px;
  right: 12px;
  background: none;
  border: 0;
  font-size: 26px;
  line-height: 1;
  color: var(--muted-foreground);
  cursor: pointer;
}
.modal__dismiss {
  margin-top: 10px;
  background: none;
  border: 0;
  font-size: 14px;
  color: var(--muted-foreground);
  cursor: pointer;
  text-decoration: underline;
}
