/* ============================================================
   Nowts Landing — styles from Figma (node 1304-2382)
   Tokens
   ============================================================ */
:root {
  --bg-primary: #0e0e10;
  --bg-primary-alt: #ffffff;
  --text-primary: #f5f5f5;
  --text-secondary: #8a8a8a;
  --text-primary-invert: #0e0e10;
  --stroke-primary: #373737;
  --stroke-device: #404041;

  --font-display: "Fraunces", serif;
  --font-mono: "JetBrains Mono", monospace;

  --size-12: 12px;
  --size-24: 24px;
  --size-32: 32px;
  --size-40: 40px;
  --size-44: 44px;
  --size-48: 48px;
  --size-72: 72px;
}

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

::selection {
  /* alpha 0.99 — иначе Safari примешивает свою прозрачность к непрозрачному цвету */
  background: rgba(233, 228, 255, 0.99);
  color: #0e0e10;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg-primary);
  color: var(--text-primary);
  font-family: var(--font-mono);
  font-size: 18px;
  line-height: 24px;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img { display: block; }

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

button { font: inherit; }

/* текстовые ссылки: белые с подчёркиванием, на ховер — без */
.link {
  color: var(--text-primary);
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.15s ease;
}

.link:hover {
  text-decoration: none;
  color: #e9e4ff;
}

/* ============================================================
   Starfield на всём фоне страницы
   ============================================================ */
.starfield {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
}

/* ============================================================
   Typography
   ============================================================ */
.display {
  font-family: var(--font-display);
  font-weight: 400;
  font-size: 64px;
  line-height: 0.9;
  letter-spacing: -1.92px;
  color: var(--text-primary);
  font-optical-sizing: auto;
  font-variation-settings: "SOFT" 0, "WONK" 1;
}

.display em {
  font-style: italic;
  font-weight: 400;
}

.section__subline {
  color: var(--text-secondary);
  font-size: 18px;
  line-height: 24px;
}

/* ============================================================
   Buttons
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--size-12);
  height: 56px;
  padding: 16px 24px 16px 20px;
  border: 0;
  border-radius: 20px;
  background: var(--bg-primary-alt);
  color: var(--text-primary-invert);
  white-space: nowrap;
  transition: border-radius 0.15s ease, transform 0.25s ease, background 0.25s ease;
}

.btn:hover {
  border-radius: 100px;
  transform: scale(0.96);
  background: #e9e4ff;
}

.btn:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.btn:disabled:hover {
  border-radius: 20px;
  transform: none;
  background: var(--bg-primary-alt);
}

.btn__apple {
  width: 32px;
  height: 32px;
  flex-shrink: 0;
  transform: translateY(-2px); /* яблоко на 2px выше, текст не двигается */
}

.btn__label {
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 18px; /* как у подзаголовков */
  line-height: 24px;
}

.btn--footer {
  max-width: 100%;
  padding-right: 26px;
}

.btn--hero-mobile { display: none; }

/* ============================================================
   Hero
   ============================================================ */
.hero {
  max-width: 1440px;
  margin: 0 auto;
  padding: 32px 48px 0;
  display: flex;
  flex-direction: column;
  gap: 24px;
}

.header {
  display: flex;
  align-items: center;
  gap: 32px;
  width: 100%;
}

.header__left,
.header__center,
.header__right {
  flex: 1 0 0;
  min-width: 1px;
  display: flex;
  align-items: center;
}

.header__center { justify-content: center; }

.header__right { justify-content: flex-end; }

.logo-box {
  width: 64px;
  height: 64px;
  border: 1px solid var(--stroke-device);
  border-radius: 20px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.logo-box__img { width: 40px; height: 40px; }

.brand-name {
  font-size: 18px;
  line-height: 24px;
  letter-spacing: 18px;
  margin-right: -18px; /* компенсация трекинга последней буквы */
  color: var(--text-secondary);
  white-space: nowrap;
}

.hero__text {
  padding: 16px 200px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
  text-align: center;
}

.hero__subline {
  color: var(--text-secondary);
}

.hero__tags {
  color: var(--text-primary);
}

/* ============================================================
   Video hero (giant wordmark + video placeholder)
   ============================================================ */
.video-hero {
  position: relative;
  max-width: 1440px;
  margin: 72px auto 0;
  height: 916px; /* видео 812 + 104 отступа до контента */
}

.wordmark {
  width: 100%;
}

.wordmark img {
  display: block;
  width: 100%;
  height: auto;
}

.video-hero .wordmark {
  position: absolute;
  top: 222px;
  left: 0;
}

.video-frame {
  background: var(--bg-primary);
  border: 1px solid rgb(255 255 255 / 16%);
  corner-shape: squircle;
  overflow: hidden;
}

.video-frame--hero {
  --video-radius: 84px;
  --video-fallback-radius: 46px;
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 375px;
  aspect-ratio: 576 / 1280;
  border-radius: var(--video-radius);
}

.video-frame__video {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

/* ============================================================
   Content sections
   ============================================================ */
.content {
  max-width: 1440px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  gap: 100px;
}

.section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 40px;
  padding: 0 112px;
}

.section--cta { gap: 48px; }

.section--transcript,
.section--faq { padding: 0 200px; }

.section--footer-cta {
  padding: 0 206px;
  scroll-margin-top: 48px;
}

.section__head {
  display: flex;
  flex-direction: column;
  gap: 32px;
  width: 100%;
  text-align: center;
}

/* ---------- Features cards ---------- */
.features {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  column-gap: 24px;
  row-gap: 0;
  width: 100%;
}

.feature-card {
  grid-row: span 3;
  display: grid;
  grid-template-rows: subgrid;
  align-items: start;
  justify-items: center;
  gap: 0;
  padding: 32px;
  border: 1px dashed var(--stroke-primary);
  border-radius: 32px;
  text-align: center;
}

.feature-card__icon {
  width: 64px;
  height: 64px;
  flex-shrink: 0;
  margin-bottom: 24px;
}

.feature-card__icon img {
  width: 100%;
  height: 100%;
}

.feature-card__title {
  width: 100%;
  margin-bottom: 16px;
  color: var(--text-primary);
}

.feature-card__text {
  width: 100%;
  color: var(--text-secondary);
}

/* Fallback for browsers without subgrid: preserve the same three zones. */
@supports not (grid-template-rows: subgrid) {
  .feature-card { grid-template-rows: 88px minmax(64px, auto) auto; }

  .feature-card__icon,
  .feature-card__title { margin-bottom: 0; }
}

/* ---------- CTA screens ---------- */
.screens {
  display: flex;
  gap: 64px;
  align-items: center;
  width: 100%;
  overflow-x: auto;
  overscroll-behavior-inline: contain;
  scrollbar-width: none;
}

.screens::-webkit-scrollbar { display: none; }

/* центрирование, которое не ломает скролл при переполнении */
.phone:first-child { margin-left: auto; }
.phone:last-child { margin-right: auto; }

/* края растворяются в фон, если телефоны не влезают */
.screens.is-clipped {
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 64px, #000 calc(100% - 64px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 64px, #000 calc(100% - 64px), transparent 100%);
}

@media (hover: hover) and (pointer: fine) {
  .screens.is-clipped { cursor: grab; }

  .screens.is-clipped.is-dragging {
    cursor: grabbing;
    scroll-snap-type: none;
    user-select: none;
  }
}

.phone {
  --video-radius: 64px;
  --video-fallback-radius: 35px;
  flex-shrink: 0;
  width: 300px;
  aspect-ratio: 576 / 1280;
  background: var(--bg-primary);
  border: 1px solid rgb(255 255 255 / 16%);
  border-radius: var(--video-radius);
  corner-shape: squircle;
  overflow: hidden;
}

/* Safari versions without corner-shape use a smaller circular radius that
   matches the visual corner size of Chrome's squircle. */
@supports not (corner-shape: squircle) {
  .video-frame--hero,
  .phone { border-radius: var(--video-fallback-radius); }
}

.phone__video,
.phone__image {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: fill;
}

/* ---------- Tags / pills ---------- */
.tags-scroll { max-width: 100%; }

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

.tag-row {
  display: flex;
  gap: 16px;
  align-items: center;
}

.tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 16px 32px;
  border: 1px solid var(--stroke-primary);
  border-radius: 100px;
  color: #ffffff;
  white-space: nowrap;
}

/* ---------- Marquee для чипсов ---------- */
.tags-scroll.has-marquee {
  overflow: hidden;
  width: 100%;
  -webkit-mask-image: linear-gradient(to right, transparent 0, #000 64px, #000 calc(100% - 64px), transparent 100%);
  mask-image: linear-gradient(to right, transparent 0, #000 64px, #000 calc(100% - 64px), transparent 100%);
}

.tags-scroll.has-marquee .tag-rows { width: 100%; }

.tag-row.marquee {
  width: 100%;
  gap: 0;
  flex-wrap: nowrap;
  justify-content: flex-start;
  overflow: hidden;
}

.marquee-group {
  display: flex;
  align-items: center;
  gap: 16px;
  padding-right: 16px;
  flex-shrink: 0;
  animation: marquee-slide var(--marquee-dur, 40s) linear infinite;
}

.marquee--right .marquee-group { animation-direction: reverse; }

@keyframes marquee-slide {
  to { transform: translateX(-100%); }
}

@media (prefers-reduced-motion: reduce) {
  .marquee-group { animation: none; }
}

/* ---------- AI section ---------- */
.ai-box {
  width: 100%;
  padding: var(--size-44) var(--size-32) 52px;
  border: 1px dashed var(--stroke-primary);
  border-radius: var(--size-40);
}

.ai-list {
  display: flex;
  gap: var(--size-32);
  align-items: flex-start;
  width: 100%;
}

.ai-block {
  flex: 1 0 0;
  min-width: 1px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 24px;
}

.ai-block__circle {
  width: 100px;
  height: 100px;
  border: 1px solid var(--stroke-primary);
  border-radius: 200px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  flex-shrink: 0;
}

.ai-block__icon {
  width: 64px;
  height: 64px;
}

.ai-block__icon img {
  width: 100%;
  height: 100%;
}

.ai-block__text {
  font-family: var(--font-display);
  font-size: 28px;
  line-height: 30px;
  text-align: center;
  color: var(--text-primary);
  font-variation-settings: "SOFT" 0, "WONK" 1;
}

/* ---------- Footer CTA ---------- */
.footer-cta {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--size-40);
  padding: var(--size-72) 112px;
  border: 1px dashed var(--stroke-primary);
  border-radius: var(--size-48);
}

.footer-cta__logo {
  width: 300px;
  height: 300px;
}

.footer-cta__logo img {
  width: 100%;
  height: 100%;
}

.footer-cta__desc {
  font-size: 18px; /* как у саблайнов секций */
  line-height: 24px;
  color: var(--text-secondary);
  text-align: center;
  max-width: 804px;
}

/* ---------- FAQ ---------- */
.section--faq { gap: 32px; }

.faq__title { text-align: center; }

.faq-list {
  width: 800px;
  max-width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--size-24);
}

.faq-item {
  width: 100%;
  border-bottom: 1px solid var(--stroke-primary);
  padding-bottom: var(--size-24);
}

.faq-item__q {
  display: flex;
  align-items: center;
  gap: var(--size-12);
  width: 100%;
  cursor: pointer;
  text-align: left;
  font-family: var(--font-mono);
  font-size: 18px;
  line-height: 24px;
  color: #ffffff;
  list-style: none; /* прячем нативный маркер details */
}

.faq-item__q::-webkit-details-marker { display: none; }

.faq-item__icon {
  width: 40px;
  height: 40px;
  color: var(--text-secondary);
  flex-shrink: 0;
  order: 1;           /* иконка в конце строки */
  margin-left: auto;
}

/* вертикальная палочка плюса: в открытом состоянии складывается в минус */
.faq-item__icon-v {
  transform-origin: center;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.faq-item[open] .faq-item__icon-v {
  transform: rotate(90deg);
  opacity: 0;
}

.faq-item__a {
  padding: 0 52px 0 0;
  margin-top: var(--size-24);
  color: var(--text-secondary);
}

/* ---------- Footer ---------- */
.footer {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: 100%;
}

.footer__text {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 72px 200px;
  text-align: center;
  white-space: nowrap;
  font-size: 16px;
  line-height: 22px;
}

.footer__center { color: var(--text-secondary); }

.footer__left,
.footer__right { color: var(--text-primary); }

.footer__links,
.privacy-footer__links {
  display: flex;
  align-items: center;
  gap: 24px;
}

/* ============================================================
   Privacy policy
   ============================================================ */
.privacy-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(100%, 1040px);
  margin: 0 auto;
  padding: 32px 40px;
}

.privacy-main {
  width: min(100%, 920px);
  margin: 0 auto;
  padding: 72px 40px 120px;
}

.privacy-hero {
  display: flex;
  flex-direction: column;
  gap: 24px;
  margin-bottom: 72px;
}

.privacy-title {
  font-family: var(--font-display);
  font-size: clamp(56px, 9vw, 96px);
  font-weight: 400;
  line-height: 0.9;
  letter-spacing: -0.03em;
}

.privacy-title em {
  font-style: italic;
  font-weight: 400;
}

.privacy-lead {
  max-width: 720px;
  color: var(--text-secondary);
  font-size: 20px;
  line-height: 28px;
}

.privacy-updated {
  color: var(--text-secondary);
  font-size: 14px;
  line-height: 20px;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.privacy-section {
  display: flex;
  flex-direction: column;
  gap: 20px;
  padding: 48px 0;
  border-top: 1px solid var(--stroke-primary);
}

.privacy-section h2 {
  font-family: var(--font-display);
  font-size: 36px;
  font-weight: 400;
  line-height: 1;
}

.privacy-section h3 {
  margin-top: 8px;
  font-size: 18px;
  line-height: 24px;
}

.privacy-section p,
.privacy-section li {
  color: var(--text-secondary);
}

.privacy-section strong { color: var(--text-primary); }

.privacy-section ul {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-left: 24px;
}

.privacy-footer {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding-top: 48px;
  border-top: 1px solid var(--stroke-primary);
  color: var(--text-secondary);
}

/* ============================================================
   Mobile (макет Landing Mobile, 375px)
   ============================================================ */
@media (max-width: 767px) {
  body {
    font-size: 16px;
    line-height: 19px;
  }

  /* На мобильных текст переносится только естественно, по доступной ширине. */
  .hero__text br,
  .content br { display: none; }

  .display {
    font-size: 48px;
    letter-spacing: -1.44px;
  }

  .section__subline,
  .hero__subline,
  .hero__tags,
  .tag,
  .feature-card__title,
  .feature-card__text,
  .footer-cta__desc {
    font-size: 16px;
    line-height: 19px;
  }

  /* Hero: только логотип по центру, кнопка под текстом */
  .hero { padding: 24px 24px 0; gap: 32px; }

  .header { justify-content: center; }

  .header__left { justify-content: center; }

  .header__center,
  .header__right { display: none; }

  .hero__text { padding: 0; gap: 32px; }

  /* заголовок всегда в 2 строки, как на десктопе: кегль подстраивается под ширину */
  .hero__text .display {
    font-size: min(48px, calc((100vw - 48px) / 8.35));
    letter-spacing: -0.03em;
  }

  .btn--hero-mobile {
    display: inline-flex;
    margin-top: 24px;
  }

  .btn__label { font-size: 16px; } /* как у подзаголовков на мобильном */

  /* Video */
  .video-hero {
    height: auto;
    margin-top: 64px;
    display: flex;
    justify-content: center;
    padding-bottom: 64px;
  }

  .video-hero .wordmark { display: none; }

  .video-frame--hero {
    --video-radius: 32px;
    --video-fallback-radius: 32px;
    position: relative;
    left: auto;
    transform: none;
    width: 277px;
  }

  .content { margin-top: 0; gap: 64px; }

  .section,
  .section--transcript,
  .section--faq,
  .section--footer-cta { padding: 0 24px; }

  /* Features: две карточки в ряд, как на планшете */
  .features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    column-gap: 16px;
  }

  .feature-card {
    padding: 24px 16px;
    margin-bottom: 16px;
  }

  .feature-card:nth-last-child(-n + 2) { margin-bottom: 0; }

  /* Screens: свайп по одному экрану, крайние останавливаются в 64px от края */
  .screens {
    --screens-edge-space: 64px;
    gap: 16px;
    width: calc(100% + 48px);
    margin-inline: -24px;
    padding-inline: var(--screens-edge-space);
    scroll-padding-inline: var(--screens-edge-space);
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
  }

  .screens.is-clipped {
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 32px, #000 calc(100% - 32px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 32px, #000 calc(100% - 32px), transparent 100%);
  }

  .phone {
    --video-radius: 32px;
    --video-fallback-radius: 32px;
    flex: 0 0 230px;
    width: 230px;
    scroll-snap-align: center;
    scroll-snap-stop: always;
  }

  /* Match the feature-card corner shape on phones instead of using squircle. */
  .video-frame,
  .phone { corner-shape: initial; }

  .phone:first-child {
    margin-left: 0;
    scroll-snap-align: start;
  }

  .phone:last-child {
    margin-right: 0;
    scroll-snap-align: end;
  }

  /* Tags: горизонтальный скролл */
  .tags-scroll {
    overflow-x: auto;
    scrollbar-width: none;
    margin: 0 -24px;
    padding: 0 24px;
  }

  .tags-scroll::-webkit-scrollbar { display: none; }

  .tags-scroll.has-marquee {
    padding: 0;
    -webkit-mask-image: linear-gradient(to right, transparent 0, #000 32px, #000 calc(100% - 32px), transparent 100%);
    mask-image: linear-gradient(to right, transparent 0, #000 32px, #000 calc(100% - 32px), transparent 100%);
  }

  .tag-rows { align-items: flex-start; width: max-content; }

  /* AI: два блока в ряд */
  .ai-box { padding: 32px 16px 40px; }

  .ai-list {
    flex-wrap: wrap;
    gap: 56px 16px;
  }

  .ai-block { flex: 0 0 calc(50% - 8px); }

  .ai-block__text { font-size: 24px; line-height: 26px; }

  /* Footer CTA */
  .footer-cta { padding: 40px 24px; gap: 32px; }

  .footer-cta__logo { width: 160px; height: 160px; }

  .btn--footer {
    gap: 8px;
    padding: 12px 16px 12px 14px;
  }

  .btn--footer .btn__apple { width: 28px; height: 28px; }

  .btn--footer .btn__label { font-size: 14px; line-height: 18px; }

  /* FAQ */
  .faq-list { width: 100%; }

  .faq-item__q { font-size: 16px; }

  .faq-item__icon { width: 32px; height: 32px; }

  .faq-item__a { padding: 0 44px 0 0; font-size: 16px; line-height: 19px; }

  /* Footer */
  .footer__text {
    flex-direction: column;
    gap: 24px;
    padding: 40px 24px;
    white-space: normal;
  }

  /* порядок как в макете: описание, автор, privacy policy */
  .footer__center { order: 1; }
  .footer__right { order: 2; }
  .footer__left { order: 3; }

  .privacy-header { padding: 24px; }

  .privacy-main { padding: 48px 24px 80px; }

  .privacy-hero { margin-bottom: 56px; }

  .privacy-title { font-size: 56px; }

  .privacy-lead { font-size: 18px; line-height: 24px; }

  .privacy-section { padding: 40px 0; }

  .privacy-section h2 { font-size: 32px; }

  .privacy-footer { flex-direction: column; }

  .privacy-footer__links { flex-wrap: wrap; }

}

/* Карточки фич раньше встают по две в ряд */
@media (min-width: 768px) and (max-width: 1359px) {
  .features { grid-template-columns: repeat(2, minmax(0, 1fr)); }

  .feature-card { margin-bottom: 24px; }

  .feature-card:nth-last-child(-n + 2) { margin-bottom: 0; }
}

/* Планшет: между 768 и 1200 — колонки уже, карточки в 2 ряда */
@media (min-width: 768px) and (max-width: 1199px) {
  .section,
  .section--transcript,
  .section--faq,
  .section--footer-cta { padding: 0 48px; }

  .hero__text { padding: 16px 48px 0; }

  .ai-list { flex-wrap: wrap; gap: 56px 32px; }

  .ai-block { flex: 0 0 calc(50% - 16px); }

  .screens { gap: 32px; }

  .video-frame--hero {
    --video-radius: 72px;
    --video-fallback-radius: 40px;
  }

  .phone {
    --video-radius: 56px;
    --video-fallback-radius: 31px;
    width: 240px;
  }

  .tag-row { flex-wrap: wrap; justify-content: center; }

  .footer__text { padding: 72px 48px; }

  .footer-cta { padding: 48px 40px; }
}
