/* ============================================================
   ШЛЕЙФ — дом ароматов
   Дизайн-система: холодная «аптечная» палитра от материалов,
   Cormorant (дисплей) + IBM Plex Sans (текст) + IBM Plex Mono (этикетки)
   ============================================================ */

:root {
  /* палитра от материалов */
  --paper: #f1f1ed;        /* матовое стекло */
  --paper-2: #e8e9e3;      /* плита под флаконом */
  --ink: #17191b;          /* чернила */
  --ink-soft: #43474a;
  --smoke: #a2a59e;        /* дым */
  --iris: #8b7fa3;         /* пыльный ирис — акцент */
  --iris-deep: #675d80;
  --vetiver: #232820;      /* тёмная пауза */
  --amber: #8f5b2a;        /* амбра, точечно */
  --line: rgba(23, 25, 27, 0.14);

  /* типографика */
  --f-display: "Cormorant", "Times New Roman", serif;
  --f-body: "IBM Plex Sans", -apple-system, sans-serif;
  --f-mono: "IBM Plex Mono", monospace;

  --pad: clamp(20px, 6vw, 96px);
  --gap: clamp(16px, 2vw, 32px);
}

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

html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  font-family: var(--f-body);
  font-size: 16px;
  line-height: 1.6;
  color: var(--ink);
  background: var(--paper);
  -webkit-font-smoothing: antialiased;
}

::selection { background: var(--iris); color: var(--paper); }

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

:focus-visible {
  outline: 2px solid var(--iris-deep);
  outline-offset: 3px;
}

/* ---------- служебная типографика ---------- */

.mono {
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-soft);
}

.display {
  font-family: var(--f-display);
  font-weight: 300;
  line-height: 1.05;
  letter-spacing: -0.02em;
}

/* ---------- каркас ---------- */

.wrap { padding-inline: var(--pad); max-width: 1680px; margin-inline: auto; }

.section { padding-block: clamp(72px, 10vw, 160px); }
.section--tight { padding-block: clamp(48px, 6vw, 96px); }

.section-head {
  display: flex;
  align-items: baseline;
  gap: 24px;
  margin-bottom: clamp(40px, 5vw, 80px);
}
.section-head::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--line);
  align-self: center;
}

/* ---------- шапка ---------- */

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--paper) 88%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.header-in {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}
.logo {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 21px;
  letter-spacing: 0.30em;
  text-transform: uppercase;
}
.logo span:last-child { opacity: 0.35; } /* хвост шлейфа и в логотипе */

.nav { display: flex; gap: clamp(16px, 3vw, 40px); }
.nav a {
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-soft);
  transition: color 0.25s;
}
.nav a:hover { color: var(--ink); }

.cart-btn {
  display: flex;
  align-items: center;
  gap: 8px;
  background: none;
  border: 1px solid var(--line);
  padding: 8px 14px;
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink);
  cursor: pointer;
  transition: border-color 0.25s;
}
.cart-btn:hover { border-color: var(--ink); }
.cart-count {
  min-width: 18px;
  height: 18px;
  display: grid;
  place-items: center;
  background: var(--ink);
  color: var(--paper);
  font-size: 9px;
  border-radius: 50%;
}

/* ---------- герой ---------- */

.hero {
  min-height: calc(100svh - 64px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
  overflow: hidden;
}

.hero-word {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(88px, 17.5vw, 300px);
  line-height: 0.94;
  letter-spacing: -0.015em;
  text-transform: uppercase;
  /* хвост слова растворяется — образ шлейфа */
  background: linear-gradient(90deg, var(--ink) 0%, var(--ink) 58%, transparent 98%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  user-select: none;
}

.hero-sub {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-top: clamp(24px, 4vw, 56px);
}

.hero-thesis {
  font-family: var(--f-display);
  font-size: clamp(22px, 2.6vw, 34px);
  font-weight: 400;
  line-height: 1.25;
  max-width: 17em;
}
.hero-thesis em { font-style: italic; color: var(--iris-deep); }

.hero-meta { text-align: right; line-height: 2.1; }

/* последовательность появления (только при работающем JS) */
body.js .hero .rise {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.9s cubic-bezier(0.2, 0.6, 0.2, 1), transform 0.9s cubic-bezier(0.2, 0.6, 0.2, 1);
}
body.loaded .hero .rise { opacity: 1; transform: none; }
body.loaded .hero .rise:nth-child(2) { transition-delay: 0.15s; }
.hero-sub.rise { transition-delay: 0.3s; }

/* ---------- манифест ---------- */

.intro {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
}
.intro .mono { grid-column: 1 / 4; padding-top: 8px; }
.intro-text {
  grid-column: 5 / 12;
  font-family: var(--f-display);
  font-size: clamp(24px, 2.8vw, 40px);
  font-weight: 400;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

/* ---------- витрина: редакционная раскладка ---------- */

.catalog { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); row-gap: clamp(48px, 6vw, 96px); }

.product { display: flex; flex-direction: column; gap: 20px; }
.product-visual {
  background: var(--paper-2);
  display: grid;
  place-items: center;
  padding: clamp(32px, 4vw, 64px);
  transition: background 0.4s;
}
.product:hover .product-visual { background: #e2e3dc; }
.product-visual svg {
  width: clamp(90px, 40%, 150px);
  height: auto;
  transition: transform 0.45s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.product:hover .product-visual svg { transform: translateY(-8px); }

/* флагман — крупно и асимметрично */
.product--lead { grid-column: 1 / 8; flex-direction: row; align-items: stretch; gap: var(--gap); }
.product--lead .product-visual { flex: 1.2; min-height: clamp(360px, 44vw, 620px); }
.product--lead .product-info { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; gap: 16px; padding-bottom: 8px; }
.product--side { grid-column: 9 / 13; justify-content: flex-end; }
.product--side .product-visual { min-height: clamp(240px, 26vw, 380px); }

.product--a { grid-column: 1 / 5; }
.product--b { grid-column: 6 / 9; margin-top: clamp(32px, 4vw, 72px); }
.product--c { grid-column: 10 / 13; }
.product--d { grid-column: 3 / 7; }

.product-num { color: var(--smoke); }
.product-name {
  font-family: var(--f-display);
  font-size: clamp(24px, 2.2vw, 34px);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 1.1;
}
.product--lead .product-name { font-size: clamp(34px, 3.6vw, 56px); }
.product-family { color: var(--ink-soft); font-size: 14px; max-width: 30em; }
.product-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 4px;
}
.price { font-family: var(--f-mono); font-size: 13px; letter-spacing: 0.06em; }

/* ---------- кнопки ---------- */

.btn {
  display: inline-block;
  border: 1px solid var(--ink);
  background: none;
  color: var(--ink);
  font-family: var(--f-mono);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  padding: 12px 24px;
  cursor: pointer;
  transition: background 0.3s, color 0.3s;
}
.btn:hover { background: var(--ink); color: var(--paper); }
.btn--solid { background: var(--ink); color: var(--paper); }
.btn--solid:hover { background: var(--iris-deep); border-color: var(--iris-deep); }
.btn--ghost { border-color: var(--line); }
.btn--ghost:hover { border-color: var(--ink); background: none; color: var(--ink); }

/* ---------- тёмная пауза ---------- */

.pause {
  background: var(--vetiver);
  color: var(--paper);
  padding-block: clamp(96px, 14vw, 220px);
}
.pause-quote {
  font-family: var(--f-display);
  font-style: italic;
  font-weight: 300;
  font-size: clamp(30px, 4.6vw, 72px);
  line-height: 1.18;
  letter-spacing: -0.015em;
  max-width: 18em;
}
.pause .mono { color: rgba(241, 241, 237, 0.5); margin-top: 40px; display: block; }

/* ---------- материалы ---------- */

.materials { display: grid; grid-template-columns: repeat(4, 1fr); gap: var(--gap); }
.material-swatch { height: clamp(120px, 12vw, 180px); margin-bottom: 20px; }
.material-name {
  font-family: var(--f-display);
  font-size: clamp(20px, 1.8vw, 26px);
  font-weight: 400;
  margin-bottom: 6px;
}
.material-origin { display: block; margin-bottom: 12px; color: var(--smoke); }
.material p { font-size: 13.5px; color: var(--ink-soft); line-height: 1.65; }

.sw-iris    { background: linear-gradient(160deg, #c5bdd4, #8b7fa3 65%, #675d80); }
.sw-amber   { background: linear-gradient(160deg, #d8c3a2, #a9743c 70%, #8f5b2a); }
.sw-vetiver { background: linear-gradient(160deg, #8e9a83, #4a5442 70%, #232820); }
.sw-suede   { background: linear-gradient(160deg, #d9d4c8, #b0a795 70%, #8e8674); }

/* ---------- парфюмер ---------- */

.perfumer { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); align-items: start; }
.perfumer .mono { grid-column: 1 / 4; padding-top: 12px; }
.perfumer-quote {
  grid-column: 5 / 12;
  font-family: var(--f-display);
  font-size: clamp(26px, 3.2vw, 46px);
  font-weight: 300;
  font-style: italic;
  line-height: 1.28;
}
.perfumer-sign {
  grid-column: 5 / 12;
  margin-top: 32px;
  display: flex;
  align-items: baseline;
  gap: 20px;
}
.perfumer-sign .name { font-family: var(--f-display); font-size: 20px; }

/* ---------- библиотека проб ---------- */

.discovery {
  background: var(--paper-2);
  padding: clamp(48px, 6vw, 96px);
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--gap);
  align-items: center;
}
.discovery-text { grid-column: 1 / 8; }
.discovery-title {
  font-family: var(--f-display);
  font-size: clamp(28px, 3.4vw, 52px);
  font-weight: 400;
  letter-spacing: -0.015em;
  line-height: 1.1;
  margin: 12px 0 16px;
}
.discovery-note { color: var(--ink-soft); font-size: 14.5px; max-width: 34em; }
.discovery-cta { grid-column: 9 / 13; display: flex; flex-direction: column; gap: 14px; align-items: flex-start; }

/* ---------- журнал ---------- */

.journal { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.journal-item { border-top: 1px solid var(--line); padding-top: 20px; display: block; }
.journal-item .mono { display: block; margin-bottom: 14px; }
.journal-title {
  font-family: var(--f-display);
  font-size: clamp(22px, 2vw, 30px);
  font-weight: 400;
  line-height: 1.18;
  transition: color 0.25s;
}
.journal-item:hover .journal-title { color: var(--iris-deep); }
.journal-item p { margin-top: 10px; font-size: 13.5px; color: var(--ink-soft); }

/* ---------- футер ---------- */

.footer { background: var(--ink); color: var(--paper); padding-block: clamp(56px, 7vw, 96px) 32px; }
.footer-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); margin-bottom: 64px; }
.footer-brand { grid-column: 1 / 5; }
.footer-brand .logo { font-size: 26px; }
.footer-col { display: flex; flex-direction: column; gap: 10px; font-size: 13.5px; color: rgba(241, 241, 237, 0.72); }
.footer-col .mono { color: rgba(241, 241, 237, 0.4); margin-bottom: 6px; }
.footer-col a:hover { color: var(--paper); }
.footer-col:nth-of-type(2) { grid-column: 6 / 9; }
.footer-col:nth-of-type(3) { grid-column: 9 / 11; }
.footer-col:nth-of-type(4) { grid-column: 11 / 13; }
.footer-legal {
  border-top: 1px solid rgba(241, 241, 237, 0.14);
  padding-top: 24px;
  display: flex;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.footer-legal .mono { color: rgba(241, 241, 237, 0.4); }

/* ---------- страница аромата ---------- */

.crumbs { padding-top: 24px; }
.crumbs a:hover { color: var(--ink); }

.pdp { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); padding-block: clamp(32px, 4vw, 64px) clamp(72px, 8vw, 128px); }
.pdp-visual {
  grid-column: 1 / 7;
  background: var(--paper-2);
  display: grid;
  place-items: center;
  min-height: clamp(420px, 52vw, 680px);
  padding: clamp(40px, 5vw, 80px);
}
.pdp-visual svg { width: clamp(140px, 42%, 220px); height: auto; }
.pdp-info { grid-column: 8 / 13; display: flex; flex-direction: column; justify-content: center; gap: 18px; }
.pdp-title {
  font-family: var(--f-display);
  font-size: clamp(40px, 4.6vw, 72px);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.02;
}
.pdp-desc { color: var(--ink-soft); font-size: 15px; max-width: 30em; }

.volume-row { display: flex; gap: 10px; margin-top: 8px; }
.volume {
  border: 1px solid var(--line);
  background: none;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  padding: 10px 18px;
  cursor: pointer;
  color: var(--ink);
  transition: border-color 0.25s;
}
.volume[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--paper); }
.volume:hover { border-color: var(--ink); }

.pdp-price { font-family: var(--f-mono); font-size: 18px; letter-spacing: 0.04em; margin-top: 4px; }
.pdp-actions { display: flex; gap: 12px; margin-top: 8px; flex-wrap: wrap; }
.pdp-facts { margin-top: 20px; line-height: 2.2; }

/* ---------- подписной элемент: раскрытие ---------- */

.unfold { background: var(--vetiver); color: var(--paper); padding-block: clamp(72px, 9vw, 140px); }
.unfold .section-head::after { background: rgba(241, 241, 237, 0.16); }
.unfold .section-head .mono { color: rgba(241, 241, 237, 0.55); }

.unfold-phase {
  font-family: var(--f-display);
  font-weight: 300;
  font-style: italic;
  font-size: clamp(24px, 3vw, 42px);
  line-height: 1.25;
  min-height: 2.6em;
  max-width: 24em;
  transition: opacity 0.3s;
}

.unfold-time {
  display: flex;
  align-items: baseline;
  gap: 20px;
  margin: clamp(32px, 4vw, 56px) 0 16px;
}
.time-value {
  font-family: var(--f-mono);
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 400;
  letter-spacing: 0.02em;
  min-width: 5.2em;
}
.time-presets { display: flex; gap: 8px; flex-wrap: wrap; }
.preset {
  border: 1px solid rgba(241, 241, 237, 0.25);
  background: none;
  color: rgba(241, 241, 237, 0.75);
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  padding: 8px 14px;
  cursor: pointer;
  transition: border-color 0.25s, color 0.25s;
}
.preset:hover, .preset[aria-pressed="true"] { border-color: var(--paper); color: var(--paper); }

.timeline { position: relative; margin-bottom: clamp(40px, 5vw, 64px); }
.timeline input[type="range"] {
  width: 100%;
  appearance: none;
  -webkit-appearance: none;
  height: 28px;
  background: transparent;
  cursor: pointer;
}
.timeline input[type="range"]::-webkit-slider-runnable-track {
  height: 1px;
  background: rgba(241, 241, 237, 0.3);
}
.timeline input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--paper);
  margin-top: -8px;
  border: none;
  transition: transform 0.2s;
}
.timeline input[type="range"]::-webkit-slider-thumb:hover { transform: scale(1.25); }
.timeline input[type="range"]::-moz-range-track {
  height: 1px;
  background: rgba(241, 241, 237, 0.3);
}
.timeline input[type="range"]::-moz-range-thumb {
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: var(--paper);
  border: none;
}
.timeline-ticks {
  display: flex;
  justify-content: space-between;
  margin-top: 10px;
  font-family: var(--f-mono);
  font-size: 9px;
  letter-spacing: 0.14em;
  color: rgba(241, 241, 237, 0.4);
}

.notes-groups { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--gap); }
.notes-group .mono { display: block; color: rgba(241, 241, 237, 0.45); margin-bottom: 18px; }
.note { margin-bottom: 16px; transition: opacity 0.4s; }
.note-name { font-size: 13.5px; margin-bottom: 6px; display: flex; justify-content: space-between; gap: 12px; }
.note-name .state { font-family: var(--f-mono); font-size: 9px; letter-spacing: 0.12em; text-transform: uppercase; color: rgba(241, 241, 237, 0.45); }
.note-bar { height: 2px; background: rgba(241, 241, 237, 0.12); position: relative; overflow: hidden; }
.note-bar i {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: var(--paper);
  transition: width 0.45s cubic-bezier(0.2, 0.6, 0.2, 1);
}
.notes-group--heart .note-bar i { background: #b3a7cc; }
.notes-group--base .note-bar i { background: #c79c6a; }

/* ---------- ритуал ---------- */

.ritual { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); }
.ritual .mono { grid-column: 1 / 4; padding-top: 6px; }
.ritual-list { grid-column: 5 / 12; list-style: none; }
.ritual-list li {
  border-top: 1px solid var(--line);
  padding: 20px 0;
  font-family: var(--f-display);
  font-size: clamp(19px, 1.9vw, 27px);
  font-weight: 400;
  line-height: 1.3;
  display: flex;
  gap: 24px;
  align-items: baseline;
}
.ritual-list li:last-child { border-bottom: 1px solid var(--line); }
.ritual-list .mono { padding: 0; color: var(--smoke); grid-column: auto; }

/* ---------- прочие ароматы ---------- */

.related { display: grid; grid-template-columns: repeat(12, 1fr); gap: var(--gap); }
.related .product:nth-child(1) { grid-column: 1 / 5; }
.related .product:nth-child(2) { grid-column: 5 / 9; }
.related .product:nth-child(3) { grid-column: 9 / 13; }
.related .product-visual { min-height: clamp(220px, 24vw, 340px); }

/* ---------- toast ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 20px);
  background: var(--ink);
  color: var(--paper);
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  padding: 14px 24px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s, transform 0.35s;
  z-index: 100;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- появление при скролле ---------- */

body.js .reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.8s cubic-bezier(0.2, 0.6, 0.2, 1), transform 0.8s cubic-bezier(0.2, 0.6, 0.2, 1);
}
body.js .reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .hero .rise { opacity: 1 !important; transform: none !important; transition: none !important; }
  .product-visual svg, .note-bar i { transition: none !important; }
}

/* ---------- адаптив ---------- */

@media (max-width: 1100px) {
  .product--lead { grid-column: 1 / 13; }
  .product--side { grid-column: 1 / 7; }
  .product--a { grid-column: 7 / 13; margin-top: 0; }
  .product--b { grid-column: 1 / 7; margin-top: 0; }
  .product--c { grid-column: 7 / 13; }
  .product--d { grid-column: 1 / 7; }
  .materials { grid-template-columns: repeat(2, 1fr); }
  .pdp-visual { grid-column: 1 / 13; }
  .pdp-info { grid-column: 1 / 13; }
}

@media (max-width: 760px) {
  .nav { display: none; }
  .hero-word { font-size: clamp(72px, 19vw, 120px); }
  .intro .mono, .perfumer .mono, .ritual .mono { grid-column: 1 / 13; padding: 0 0 16px; }
  .intro-text, .perfumer-quote, .perfumer-sign, .ritual-list { grid-column: 1 / 13; }
  .product--lead { flex-direction: column; }
  .product--lead .product-visual { min-height: 320px; }
  .catalog .product { grid-column: 1 / 13 !important; margin-top: 0 !important; }
  .materials { grid-template-columns: 1fr; }
  .journal { grid-template-columns: 1fr; }
  .discovery-text, .discovery-cta { grid-column: 1 / 13; }
  .notes-groups { grid-template-columns: 1fr; }
  .related .product { grid-column: 1 / 13 !important; }
  .footer-brand, .footer-col { grid-column: 1 / 13 !important; }
}
