/* ============================================================
   Clean Skin — landing.css
   Hand-written stylesheet. Mobile-first, breakpoints 768px / 1024px.
   ============================================================ */

/* ---- 1. Onest @font-face ------------------------------------ */

@font-face {
  font-family: "Onest";
  src: url("../fonts/Onest-Regular.ttf") format("truetype");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Onest";
  src: url("../fonts/Onest-Medium.ttf") format("truetype");
  font-weight: 500;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Onest";
  src: url("../fonts/Onest-SemiBold.ttf") format("truetype");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Onest";
  src: url("../fonts/Onest-ExtraBold.ttf") format("truetype");
  font-weight: 800;
  font-style: normal;
  font-display: swap;
}

/* ---- 2. Design tokens --------------------------------------- */

:root {
  --ivory: #faf7f2;
  --ivory-warm: #f3ecdf;
  --ivory-edge: #ebe3d2;
  --ink: #1a2328;
  --ink-soft: #2f3a40;
  --muted: #6b7680;
  --sage: #7c8c65;
  --sage-deep: #5d6b49;
  --coral: #e8a48a;

  --font-sans: "Onest", ui-sans-serif, system-ui, -apple-system, sans-serif;

  --radius-lg: 2rem;
  --radius-md: 1rem;
  --radius-full: 999px;

  --container-max: 1200px;
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-6: 3rem;
  --space-8: 4rem;
  --space-12: 6rem;

  /* depth + accents (redesign 2026-06) */
  --shadow-sm: 0 1px 2px rgba(26,35,40,.06), 0 2px 8px rgba(26,35,40,.05);
  --shadow-md: 0 4px 12px rgba(26,35,40,.07), 0 12px 32px rgba(26,35,40,.08);
  --shadow-lg: 0 8px 24px rgba(26,35,40,.10), 0 30px 60px rgba(26,35,40,.12);
  --shadow-phone: 0 10px 30px rgba(26,35,40,.14), 0 40px 80px rgba(26,35,40,.16);
  --grad-sage: radial-gradient(60% 60% at 70% 30%, rgba(124,140,101,.28), rgba(124,140,101,0) 70%);
  --grad-warm: radial-gradient(50% 50% at 30% 70%, rgba(232,164,138,.22), rgba(232,164,138,0) 70%);
  --accent: var(--sage-deep);
}

/* ---- 3. Reset + base ---------------------------------------- */

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

html, body {
  margin: 0;
  padding: 0;
  background: var(--ivory);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

::selection { background: rgba(124, 140, 101, 0.25); }

/* ---- 4. Typography classes ---------------------------------- */

.kicker {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--sage-deep);
}
.kicker::before { content: "— "; }

.display {
  font-family: var(--font-sans);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.05;
  color: var(--ink);
}

h1.display { font-size: 2.5rem; }
h2.display { font-size: 2rem; }
h3         { font-weight: 800; font-size: 1.25rem; letter-spacing: -0.01em; line-height: 1.2; }

.body { color: var(--ink-soft); line-height: 1.6; }
.muted { color: var(--muted); }
.small { font-size: 0.875rem; line-height: 1.5; }

/* ---- 5. Layout primitives ----------------------------------- */

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

.stack > * + * { margin-top: var(--space-3); }
.stack-lg > * + * { margin-top: var(--space-6); }

.cluster {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  align-items: center;
}

.split {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
}

/* ---- 6. Buttons + lang toggle ------------------------------- */

.btn {
  display: inline-flex;
  align-items: center;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  font-weight: 500;
  font-size: 0.95rem;
  border: 1px solid transparent;
  transition: background-color 0.15s, color 0.15s;
  cursor: pointer;
}
.btn-primary {
  background: var(--ink);
  color: var(--ivory);
}
.btn-primary:hover { background: var(--ink-soft); }
.btn-ghost {
  background: transparent;
  color: var(--ink);
  border-color: rgba(26, 35, 40, 0.15);
}
.btn-ghost:hover { background: var(--ivory-warm); }

/* App Store бейдж (nav, hero, footer) */
.app-store-badge {
  display: inline-flex;
  align-items: center;
  height: 44px;
  transition: transform .15s, box-shadow .15s;
  border-radius: 11px;
}
.app-store-badge img { height: 44px; width: auto; display: block; }
.app-store-badge:hover { transform: translateY(-1px); box-shadow: var(--shadow-md); }
.app-store-badge--sm { height: 38px; }
.app-store-badge--sm img { height: 38px; }

/* Фирменный логотип (nav, footer) */
.brand { display: inline-flex; align-items: center; gap: 0.5rem; }
.brand__logo { height: 28px; width: auto; display: block; }
.site-footer__brand { display: inline-flex; align-items: center; gap: 0.5rem; }
.site-footer__brand .brand__logo { height: 24px; }

.lang-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin: 0;
}
.lang-toggle button {
  background: none;
  border: none;
  padding: 0;
  color: var(--muted);
  font-weight: 500;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}
.lang-toggle button:hover { color: var(--ink); }
.lang-toggle .active {
  color: var(--ink);
  font-weight: 600;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
}
.lang-toggle .divider { color: var(--ivory-edge); font-size: 0.8rem; }

/* ---- 7. Nav + footer ---------------------------------------- */

.site-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid var(--ivory-edge);
}
/* Матовый фон шапки вынесен в ::before: иначе backdrop-filter на самой
   .site-nav создаёт containing block для position:fixed и обрезает
   мобильное меню (drawer) и затемнение до высоты шапки. */
.site-nav::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: rgba(250, 247, 242, 0.85);
  backdrop-filter: saturate(180%) blur(12px);
  -webkit-backdrop-filter: saturate(180%) blur(12px);
}
.site-nav__inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-block: var(--space-2);
  gap: var(--space-3);
}
.brand {
  font-weight: 600;
  font-size: 1.1rem;
  letter-spacing: -0.01em;
  color: var(--ink);
}
.site-nav__links {
  display: flex;
  align-items: center;
  gap: var(--space-3);
}
.site-nav__links a {
  color: var(--ink-soft);
  font-size: 0.9rem;
  font-weight: 500;
  transition: color 0.15s;
}
.site-nav__links a:hover { color: var(--ink); }

/* Бренд: на узких экранах показываем только иконку логотипа,
   текст «Clean Skin» прячем (возвращается на десктопе ≥768px). */
.brand span { display: none; }

/* Гамбургер (по умолчанию виден на мобиле) */
.nav-toggle {
  display: inline-flex;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 44px;
  height: 44px;
  padding: 10px;
  background: none;
  border: none;
  margin-left: -10px; /* оптический сдвиг к краю */
}
.nav-toggle__bar { display: block; height: 2px; width: 100%; background: var(--ink); border-radius: 2px; transition: transform .25s, opacity .25s; }
.site-nav.nav-open .nav-toggle__bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.site-nav.nav-open .nav-toggle__bar:nth-child(2) { opacity: 0; }
.site-nav.nav-open .nav-toggle__bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Бренд прижимает бейдж вправо на мобиле */
.brand { margin-right: auto; }

/* Drawer (мобайл, по умолчанию): ссылки уезжают за левый край */
.site-nav__links {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: min(80vw, 320px);
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-3);
  padding: calc(var(--space-8) + var(--space-2)) var(--space-4) var(--space-4);
  background: var(--ivory);
  border-right: 1px solid var(--ivory-edge);
  box-shadow: var(--shadow-lg);
  transform: translateX(-100%);
  transition: transform .28s ease;
  z-index: 60;
}
.site-nav.nav-open .site-nav__links { transform: none; }
.site-nav__links a { font-size: 1.05rem; }

/* Оверлей */
.nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(26, 35, 40, .35);
  opacity: 0;
  pointer-events: none;
  transition: opacity .28s ease;
  z-index: 55;
}
.site-nav.nav-open .nav-overlay { opacity: 1; pointer-events: auto; }
body.nav-locked { overflow: hidden; }

.site-footer {
  margin-top: var(--space-12);
  border-top: 1px solid var(--ivory-edge);
  padding: var(--space-6) 0;
}
.site-footer__inner {
  display: flex;
  flex-direction: column;
  gap: var(--space-2);
  color: var(--muted);
  font-size: 0.875rem;
}
.site-footer__brand { color: var(--ink); font-weight: 600; font-size: 1rem; }
.site-footer__links {
  display: flex;
  gap: var(--space-3);
  flex-wrap: wrap;
}
.site-footer__links a { color: var(--muted); transition: color 0.15s; }
.site-footer__links a:hover { color: var(--ink); }

/* ---- Device frame ------------------------------------------ */
.device {
  position: relative;
  width: 100%;
  max-width: 280px;
  margin-inline: auto;
  aspect-ratio: 9 / 19.5;
  border-radius: 2.5rem;
  background: var(--ink);
  box-shadow: var(--shadow-phone);
}
/* Экран позиционируется абсолютно с фиксированным inset (тёмный бордюр рамки).
   Абсолютные края дают определённую высоту — в Safari процентная высота внутри
   контейнера с aspect-ratio не разрешается, из-за чего картинка вылезала за рамку. */
.device__screen {
  position: absolute;
  inset: 0.5rem;
  border-radius: 2rem;
  overflow: hidden;
  background: linear-gradient(135deg, var(--ivory-warm), var(--ivory-edge));
}
.device__screen img { width: 100%; height: 100%; object-fit: cover; display: block; }
.device--placeholder .device__screen {
  background: linear-gradient(135deg, var(--ivory-warm), var(--sage) 220%);
}
.device__chip {
  position: absolute;
  bottom: 1.25rem;
  right: -0.75rem;
  background: var(--ivory);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-md);
  padding: 0.6rem 0.9rem;
  display: flex;
  flex-direction: column;
  gap: 0.1rem;
  line-height: 1.1;
}
.device__chip-value { font-weight: 800; font-size: 1.6rem; letter-spacing: -0.02em; color: var(--ink); }
.device__chip-label { font-size: 0.65rem; letter-spacing: 0.15em; text-transform: uppercase; color: var(--sage-deep); }

/* ---- 8. Sections -------------------------------------------- */

.section { padding: var(--space-8) 0; }
.section--warm { background: var(--ivory-warm); }

/* Hero */
.hero { position: relative; overflow: hidden; }
.hero__bg {
  position: absolute;
  inset: -20% -10% auto -10%;
  height: 120%;
  background: var(--grad-sage), var(--grad-warm);
  pointer-events: none;
  z-index: 0;
}
.hero__grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-6);
  align-items: center;
}
.hero h1 { margin: var(--space-2) 0 0; }
.hero__sub {
  margin-top: var(--space-3);
  max-width: 35rem;
  color: var(--ink-soft);
  line-height: 1.6;
  font-size: 1.05rem;
}
.hero__ctas { margin-top: var(--space-4); display: flex; flex-wrap: wrap; gap: var(--space-1); }
.hero__stats {
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid rgba(26, 35, 40, 0.08);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-4);
}
.hero__stat-value { font-weight: 800; font-size: 1.5rem; letter-spacing: -0.02em; }
.hero__stat-label { color: var(--muted); font-size: 0.85rem; }
.hero__media { display: flex; justify-content: center; }

/* How it works */
.how__rows { display: flex; flex-direction: column; gap: var(--space-8); margin-top: var(--space-6); }
.how__row { display: grid; grid-template-columns: 1fr; gap: var(--space-4); align-items: center; }
.how__row .device { max-width: 240px; }
.how__step-number {
  font-weight: 800;
  font-size: 2.5rem;
  color: var(--sage);
  letter-spacing: -0.02em;
  line-height: 1;
}
.how__copy h3 { margin: var(--space-1) 0; }
.how__copy p { color: var(--ink-soft); font-size: 0.95rem; line-height: 1.55; }

/* Features bento */
.bento { display: grid; grid-template-columns: 1fr; gap: var(--space-3); margin-top: var(--space-6); }
.bento__cell {
  background: var(--ivory);
  border: 1px solid var(--ivory-edge);
  border-radius: var(--radius-md);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .2s, transform .2s;
}
.bento__cell:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.bento__cell h3 { margin: 0 0 var(--space-1); font-size: 1.1rem; }
.bento__cell p { margin: 0; color: var(--ink-soft); font-size: 0.9rem; line-height: 1.5; }
.bento__cell--lg { display: flex; flex-direction: column; gap: var(--space-3); }
.bento__cell--lg .device { max-width: 200px; }
.bento__media { display: flex; justify-content: center; }

/* ---- 9. Scoring + demo + privacy + legal -------------------- */

/* Scoring */
.scoring__grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-4);
  margin-top: var(--space-6);
}
.scoring__formula {
  background: var(--ivory-warm);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}
.scoring__formula p { color: var(--ink-soft); line-height: 1.6; margin: 0; }

/* Шкала score 1→10 */
.scale { margin-top: var(--space-3); }
.scale__bar {
  position: relative;
  height: 10px;
  border-radius: var(--radius-full);
  background: linear-gradient(90deg, var(--sage) 0%, #c9b94e 55%, var(--coral) 100%);
}
.scale__marker {
  position: absolute;
  top: 50%;
  width: 18px; height: 18px;
  border-radius: 50%;
  background: var(--ivory);
  border: 3px solid var(--ink);
  transform: translate(-50%, -50%);
  box-shadow: var(--shadow-sm);
}
.scale__labels {
  display: flex;
  justify-content: space-between;
  margin-top: var(--space-1);
  font-size: 0.75rem;
  color: var(--muted);
}
.scoring__not-do { list-style: none; padding: 0; margin: 0; }
.scoring__not-do li {
  padding: var(--space-2) 0;
  border-bottom: 1px solid var(--ivory-edge);
  color: var(--ink-soft);
  font-weight: 500;
}
.scoring__not-do li:last-child { border-bottom: none; }
.scoring__not-do li::before { content: "×  "; color: var(--coral); font-weight: 600; }

/* Ingredient demo */
.demo__card {
  background: var(--ivory-warm);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  margin-top: var(--space-6);
}
.demo__media { display: flex; justify-content: center; align-items: center; padding: var(--space-4); }
.demo__media .device { max-width: 220px; }
.demo__body { padding: var(--space-4); }
.demo__body h3 { margin: 0 0 var(--space-2); font-size: 1.4rem; }
.demo__body p { color: var(--ink-soft); line-height: 1.6; margin: 0 0 var(--space-2); }

/* Privacy section */
.privacy-list { list-style: none; padding: 0; margin: var(--space-6) 0 0; }
.privacy-list li {
  position: relative;
  padding: var(--space-3) 0 var(--space-3) var(--space-4);
  border-top: 1px solid var(--ivory-edge);
  color: var(--ink-soft);
  font-size: 1.05rem;
  line-height: 1.55;
}
.privacy-list li::before {
  content: "✓";
  position: absolute;
  left: 0;
  color: var(--sage-deep);
  font-weight: 800;
}
.privacy-list li:last-child { border-bottom: 1px solid var(--ivory-edge); }

/* Legal article pages */
.legal-article {
  max-width: 42rem;
  margin: 0 auto;
  padding: var(--space-8) var(--space-2);
}
.legal-article h1 { margin: var(--space-2) 0; font-size: 2.25rem; }
.legal-article h2 { margin-top: var(--space-6); font-size: 1.5rem; font-weight: 800; }
.legal-article p { color: var(--ink-soft); line-height: 1.7; }
.legal-article a { color: var(--sage-deep); text-decoration: underline; text-underline-offset: 4px; }
.contact-email { margin-top: var(--space-4); font-size: 1.5rem; font-weight: 600; }
.contact-email a { text-underline-offset: 6px; }

/* ---- 10. Desktop (≥ 768px) ---------------------------------- */

@media (min-width: 768px) {
  .container { padding: 0 var(--space-4); }
  .section { padding: var(--space-12) 0; }

  h1.display { font-size: 4.5rem; }
  h2.display { font-size: 3rem; }

  .split { grid-template-columns: 1fr 1fr; gap: var(--space-8); }

  .hero__grid { grid-template-columns: 1.3fr 1fr; }
  .device { max-width: 300px; }

  .how__row { grid-template-columns: 1.1fr 0.9fr; gap: var(--space-8); }
  .how__row--reverse .how__copy { order: 2; }
  .how__row--reverse .device { order: 1; }
  .how__step-number { font-size: 3rem; }

  .bento { grid-template-columns: repeat(3, 1fr); grid-auto-flow: dense; }
  .bento__cell--lg { grid-row: span 2; }

  .scoring__grid { grid-template-columns: 1fr 1fr; gap: var(--space-6); }

  .demo__card { grid-template-columns: 1fr 1.3fr; }
  .demo__body { padding: var(--space-6); }

  .site-nav__inner { padding-block: var(--space-4); gap: var(--space-6); }
  .brand { font-size: 1.5rem; }
  .nav-toggle { display: none; }
  .brand { margin-right: 0; }
  .brand span { display: inline; white-space: nowrap; }
  .site-nav__links {
    position: static;
    flex-direction: row;
    width: auto;
    padding: 0;
    background: none;
    border: none;
    box-shadow: none;
    transform: none;
    z-index: auto;
    gap: var(--space-4);
  }
  .nav-overlay { display: none; }
  .site-nav__links a { font-size: 1rem; }

  .site-footer__inner { flex-direction: row; align-items: center; justify-content: space-between; }
}

@media (min-width: 1024px) {
  h1.display { font-size: 5.5rem; }
  .hero__stat-value { font-size: 1.75rem; }
}

/* ---- Reveal on scroll -------------------------------------- */
[data-reveal] {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .6s ease, transform .6s ease;
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].in-view { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; transition: none; }
  .site-nav__links, .nav-overlay, .nav-toggle__bar { transition: none; }
}
