/* ===========================================================
   mebelnw.ru — Design System
   Palette, typography, layout primitives
   =========================================================== */

:root {
  /* Palette (per TZ §4) */
  --c-paper: #F5F1EA;
  --c-graphite: #1F1B16;
  --c-muted: #6B6B6B;
  --c-line: #D9D2C4;
  --c-accent: #A7885C;
  --c-accent-ink: #1F1B16;
  --c-dark: #2A2520;
  --c-dark-2: #1A1612;

  /* Type */
  --f-display: 'Cormorant Garamond', 'EB Garamond', Georgia, serif;
  --f-text: 'Inter', 'Golos Text', system-ui, -apple-system, sans-serif;
  --f-label: 'Inter', system-ui, sans-serif;

  /* Scale (desktop) */
  --t-h1: clamp(64px, 9vw, 148px);
  --t-h2: clamp(40px, 5.2vw, 84px);
  --t-h3: clamp(28px, 3vw, 44px);
  --t-lead: clamp(18px, 1.4vw, 22px);
  --t-body: 17px;
  --t-small: 14px;
  --t-label: 12px;

  /* Layout */
  --wrap: 1280px;
  --gutter: 32px;
  --pad-x: clamp(20px, 4vw, 56px);
  --sec-gap: clamp(80px, 12vw, 160px);

  /* Motion */
  --ease: cubic-bezier(.2,.6,.2,1);
}

/* -------- Reset -------- */
*,*::before,*::after { box-sizing: border-box; }
html { margin:0; padding:0; overflow-x: clip; }
body { margin:0; padding:0; }
body {
  font-family: var(--f-text);
  color: var(--c-graphite);
  background: var(--c-paper);
  font-size: var(--t-body);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "ss01","kern","liga";
}
img, svg { display:block; max-width:100%; }
button { font: inherit; cursor: pointer; background: none; border: 0; color: inherit; padding: 0;}
a { color: inherit; text-decoration: none; }
input, select, textarea { font: inherit; color: inherit; }

/* -------- Typography primitives -------- */
.h-display {
  font-family: var(--f-display);
  font-weight: 400;
  font-style: italic;
  letter-spacing: -0.01em;
  line-height: 0.95;
}
.h-display-upright {
  font-family: var(--f-display);
  font-weight: 400;
  letter-spacing: -0.01em;
  line-height: 0.98;
}
.eyebrow {
  font-family: var(--f-label);
  font-size: var(--t-label);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--c-muted);
}
.eyebrow .dot {
  display: inline-block;
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--c-accent);
  margin-right: 10px; transform: translateY(-2px);
}
.lead {
  font-size: var(--t-lead);
  line-height: 1.5;
  color: var(--c-graphite);
  font-weight: 400;
}
.muted { color: var(--c-muted); }

/* -------- Layout -------- */
.wrap {
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}
.section {
  padding: var(--sec-gap) 0;
  position: relative;
}
.section--dark {
  background: var(--c-dark);
  color: var(--c-paper);
}
.section--dark .muted { color: #A49C90; }
.section--dark .eyebrow { color: #A49C90; }

.grid-12 {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  column-gap: var(--gutter);
}

/* -------- Divider -------- */
.rule {
  height: 1px;
  background: var(--c-line);
  border: 0;
  margin: 0;
}
.section--dark .rule { background: rgba(255,255,255,0.12); }

/* -------- Buttons -------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  padding: 18px 28px;
  border: 1px solid var(--c-graphite);
  background: var(--c-graphite);
  color: var(--c-paper);
  font-family: var(--f-label);
  font-size: 14px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background .25s var(--ease), color .25s var(--ease), border-color .25s var(--ease);
}
.btn:hover { background: var(--c-accent); border-color: var(--c-accent); color: var(--c-accent-ink); }
.btn .arrow { width: 18px; height: 10px; }
.btn--accent { background: var(--c-accent); border-color: var(--c-accent); color: var(--c-accent-ink); }
.btn--accent:hover { background: var(--c-graphite); border-color: var(--c-graphite); color: var(--c-paper); }
.btn--ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn--ghost:hover { background: var(--c-accent); border-color: var(--c-accent); color: var(--c-accent-ink); }
.btn--lg { padding: 22px 34px; font-size: 14px; }

/* -------- Header -------- */
.hdr {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--c-paper) 85%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid transparent;
  transition: padding .25s var(--ease), border-color .25s var(--ease), background .25s var(--ease);
}
.hdr--scrolled { border-bottom-color: var(--c-line); }
.hdr__row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  padding-top: 22px;
  padding-bottom: 22px;
  transition: padding .25s var(--ease);
}
.hdr--scrolled .hdr__row { padding-top: 14px; padding-bottom: 14px; }
.hdr__logo { display: flex; align-items: baseline; gap: 10px; }
.hdr__logo .mark {
  font-family: var(--f-display);
  font-size: 26px;
  letter-spacing: -0.01em;
  color: var(--c-graphite);
}
.hdr__logo .sub {
  font-family: var(--f-label);
  font-size: 10px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--c-muted);
}
.hdr__nav { display: flex; gap: 28px; justify-content: center; }
.hdr__nav a {
  font-family: var(--f-label);
  font-size: 13px;
  color: var(--c-graphite);
  padding: 6px 0;
  position: relative;
}
.hdr__nav a::after {
  content: "";
  position: absolute; left: 0; right: 100%;
  bottom: 0; height: 1px;
  background: var(--c-accent);
  transition: right .3s var(--ease);
}
.hdr__nav a:hover::after { right: 0; }
.hdr__right { display: flex; align-items: center; gap: 20px; }
.hdr__phone {
  font-family: var(--f-label);
  font-size: 14px;
  font-variant-numeric: tabular-nums;
  color: var(--c-graphite);
}
.hdr__phone:hover { color: var(--c-accent); }
.hdr__cta {
  padding: 12px 20px;
  border: 1px solid var(--c-graphite);
  font-family: var(--f-label);
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  transition: background .25s var(--ease), color .25s var(--ease);
}
.hdr__cta:hover { background: var(--c-graphite); color: var(--c-paper); }
.hdr__burger { display: none; }

/* -------- Back-to-top -------- */
.to-top {
  position: fixed;
  right: 28px; bottom: 28px;
  width: 52px; height: 52px;
  border: 1px solid var(--c-graphite);
  background: var(--c-paper);
  color: var(--c-graphite);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden;
  transition: opacity .3s var(--ease), visibility .3s, background .25s var(--ease), color .25s var(--ease);
  z-index: 40;
}
.to-top.is-visible { opacity: 1; visibility: visible; }
.to-top:hover { background: var(--c-graphite); color: var(--c-paper); }

/* -------- Scroll reveal -------- */
.reveal {
  opacity: 0;
  transform: translateY(12px);
  transition: opacity .6s var(--ease), transform .6s var(--ease);
}
.reveal.is-in {
  opacity: 1;
  transform: translateY(0);
}

/* -------- Mobile nav -------- */
@media (max-width: 900px) {
  .hdr__nav, .hdr__phone, .hdr__cta { display: none; }

  .hdr__row {
    grid-template-columns: 1fr auto;
    align-items: center;
    padding-top: 20px;
    padding-bottom: 20px;
  }
  .hdr--scrolled .hdr__row { padding-top: 14px; padding-bottom: 14px; }

  /* Логотип — одна строка, всё по baseline */
  .hdr__logo {
    flex-direction: row;
    align-items: baseline;
    gap: 8px;
  }
  .hdr__logo .mark {
    font-size: 20px;
    letter-spacing: -0.01em;
  }
  .hdr__logo .sub {
    font-size: 9px;
    letter-spacing: 0.24em;
    color: var(--c-muted);
    opacity: 0.7;
  }

  /* Бургер */
  .hdr__burger {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    gap: 7px;
    width: 40px; height: 40px;
  }
  .hdr__burger span {
    display: block; height: 1px; background: var(--c-graphite);
    transition: width .25s var(--ease);
  }
  .hdr__burger span:nth-child(1) { width: 20px; }
  .hdr__burger span:nth-child(2) { width: 12px; }

  .m-menu {
    position: fixed; inset: 0;
    width: 100%; max-width: 100%;
    background: var(--c-paper);
    z-index: 100;
    transform: translateX(100%);
    transition: transform .35s var(--ease);
    padding: 80px 28px 40px;
    display: flex; flex-direction: column;
    overflow: hidden;
    will-change: transform;
  }
  .m-menu.is-open { transform: translateX(0); }
  .m-menu__close {
    position: absolute; top: 20px; right: 20px;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    font-size: 24px;
  }
  .m-menu a {
    font-family: var(--f-display);
    font-size: 34px;
    padding: 14px 0;
    border-bottom: 1px solid var(--c-line);
  }
  .m-menu__foot {
    margin-top: auto;
    padding-top: 32px;
    display: flex; flex-direction: column; gap: 8px;
  }
  .m-menu__foot .phone {
    font-family: var(--f-display);
    font-size: 28px;
  }
}
@media (min-width: 901px) { .m-menu { display: none; } }

/* -------- Section utilities -------- */
.sec-head {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: var(--gutter);
  margin-bottom: 72px;
  align-items: end;
}
.sec-head__title {
  font-family: var(--f-display);
  font-size: var(--t-h2);
  line-height: 0.98;
  letter-spacing: -0.01em;
  font-weight: 400;
  margin: 0;
}
.sec-head__title em {
  font-style: italic;
  color: var(--c-accent);
}
.sec-head__intro {
  max-width: 52ch;
  color: var(--c-muted);
  font-size: var(--t-lead);
  line-height: 1.5;
}

@media (max-width: 800px) {
  .sec-head { grid-template-columns: 1fr; gap: 24px; margin-bottom: 44px; }
  :root { --sec-gap: 72px; }
}
