/* ==========================================================================
   Престиж Мебель - prestijmebel.com
   Palette family: forest green + cool stone. One accent, locked page-wide.
   Corner radius: 0 across the whole page (cabinetry logic).
   Photos sit in an inset mat with a hairline, like a mounted panel.
   Theme: light by default, real dark mode via prefers-color-scheme.
   Motion: entry choreography + scroll-driven parallax, all reduced-motion safe.
   ========================================================================== */

/* ---------- Fonts (self-hosted, variable 300-800) ------------------------ */
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('../fonts/onest-cyrillic.woff2') format('woff2');
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('../fonts/onest-cyrillic-ext.woff2') format('woff2');
  unicode-range: U+0460-052F, U+1C80-1C8A, U+20B4, U+2DE0-2DFF, U+A640-A69F, U+FE2E-FE2F;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('../fonts/onest-latin.woff2') format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA,
    U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193,
    U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: 'Onest';
  font-style: normal;
  font-weight: 300 800;
  font-display: swap;
  src: url('../fonts/onest-latin-ext.woff2') format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF,
    U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020,
    U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}

/* ---------- Tokens ------------------------------------------------------- */
:root {
  --bg:            #F4F6F3;
  --surface:       #FBFCFA;
  --surface-sunk:  #EAEEE9;
  --ink:           #101613;
  --ink-muted:     #59645D;
  --ink-faint:     #64706A;
  --line:          rgba(16, 22, 19, 0.14);
  --line-strong:   rgba(16, 22, 19, 0.28);
  --accent:        #1B5140;
  --accent-hover:  #123A2D;
  --accent-ink:    #FBFCFA;
  --accent-soft:   rgba(27, 81, 64, 0.08);

  /* deep block: the single deliberate theme moment, at the very end */
  --deep-bg:       #101B16;
  --deep-surface:  #16241E;
  --deep-sunk:     #0C1512;
  --deep-ink:      #E9EFEB;
  --deep-muted:    #9CA9A2;
  --deep-line:     rgba(233, 239, 235, 0.16);
  --deep-accent:   #5CB08D;

  /* kept very low: grain sits over the photos too, and anything higher
     reads as noise on flat cabinet fronts rather than as texture */
  --grain:         0.022;

  --container:     1320px;
  --gutter:        clamp(20px, 5vw, 64px);
  --section-y:     clamp(84px, 10vw, 150px);
  --mat:           clamp(7px, 0.7vw, 11px);

  /* one motion curve for the whole page: heavy start, long settle */
  --ease:          cubic-bezier(0.32, 0.72, 0, 1);
  --ease-soft:     cubic-bezier(0.22, 1, 0.36, 1);

  --z-header:      100;
  --z-overlay:     200;
  --z-grain:       300;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg:           #0C100E;
    --surface:      #131A16;
    --surface-sunk: #182119;
    --ink:          #E9EFEB;
    --ink-muted:    #9AA69F;
    --ink-faint:    #8B978F;
    --line:         rgba(233, 239, 235, 0.15);
    --line-strong:  rgba(233, 239, 235, 0.32);
    --accent:       #5CB08D;
    --accent-hover: #7AC7A5;
    --accent-ink:   #08130E;
    --accent-soft:  rgba(92, 176, 141, 0.12);

    --deep-bg:      #080C0A;
    --deep-surface: #101815;
    --deep-sunk:    #060A08;
    --deep-line:    rgba(233, 239, 235, 0.14);

    --grain:        0.03;
  }
}

/* ---------- Reset -------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'Onest', system-ui, -apple-system, 'Segoe UI', sans-serif;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

/* film grain: fixed layer, never attached to a scrolling container */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: var(--grain);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.62' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img, picture, svg { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }

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

::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- Layout primitives -------------------------------------------- */
.wrap {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: var(--z-overlay);
  background: var(--accent);
  color: var(--accent-ink);
  padding: 12px 20px;
}
.skip-link:focus { left: 12px; top: 12px; }

/* ---------- Type --------------------------------------------------------- */
.display {
  font-weight: 600;
  letter-spacing: -0.035em;
  line-height: 1.04;
  font-size: clamp(2.1rem, 1.15rem + 3.1vw, 3.45rem);
}

.h2 {
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.08;
  font-size: clamp(1.85rem, 1rem + 2.8vw, 3.1rem);
  max-width: 21ch;
  text-wrap: balance;
}

.h3 {
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
  font-size: clamp(1.15rem, 0.95rem + 0.7vw, 1.5rem);
}

.lede {
  color: var(--ink-muted);
  font-size: clamp(1.02rem, 0.95rem + 0.35vw, 1.19rem);
  line-height: 1.55;
  max-width: 46ch;
}

.muted { color: var(--ink-muted); }
.small { font-size: 0.9rem; line-height: 1.5; }

.section-head {
  display: flex;
  flex-direction: column;
  gap: 18px;
  margin-bottom: clamp(38px, 5vw, 64px);
}
.section-head .lede { max-width: 52ch; }

/* word-by-word mask reveal for display headings */
.w {
  display: inline-block;
  overflow: hidden;
  vertical-align: bottom;
  /* reserve room so descenders (у р д ц щ) are never clipped by the mask */
  padding-bottom: 0.16em;
  margin-bottom: -0.16em;
}
.w > i {
  display: inline-block;
  font-style: inherit;
  transform: translateY(105%);
  transition: transform 0.95s var(--ease);
  transition-delay: calc(var(--w) * 45ms + var(--reveal-delay, 0ms));
}
.is-in .w > i, .is-in.w > i { transform: none; }

/* ---------- Buttons ------------------------------------------------------ */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  min-height: 54px;
  padding: 0 30px;
  border-radius: 0;
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  border: 1px solid transparent;
  transform: translate(var(--mx, 0px), var(--my, 0px));
  transition: background-color 0.5s var(--ease), color 0.5s var(--ease),
    border-color 0.5s var(--ease), transform 0.6s var(--ease);
}
.btn:active { transform: translate(var(--mx, 0px), var(--my, 0px)) scale(0.985); }

.btn__go {
  width: 8px;
  height: 8px;
  border-top: 1.5px solid currentColor;
  border-right: 1.5px solid currentColor;
  transform: rotate(45deg);
  transition: transform 0.55s var(--ease);
}
.btn:hover .btn__go { transform: rotate(45deg) translate(3px, -3px); }

.btn--primary {
  background: var(--accent);
  color: var(--accent-ink);
}
.btn--primary:hover { background: var(--accent-hover); }

.btn--line {
  border-color: var(--line-strong);
  color: var(--ink);
  background: transparent;
}
.btn--line:hover { border-color: var(--ink); background: var(--accent-soft); }

.btn--sm { min-height: 46px; padding: 0 22px; font-size: 0.94rem; }

.btn--on-deep {
  background: var(--deep-accent);
  color: #06110C;
}
.btn--on-deep:hover { background: #7FCBA8; }

.btn[aria-busy='true'] { opacity: 0.72; pointer-events: none; }

/* ---------- Header ------------------------------------------------------- */
.header {
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  height: 80px;
  display: flex;
  align-items: center;
  background: color-mix(in srgb, var(--bg) 84%, transparent);
  border-bottom: 1px solid transparent;
  transition: height 0.6s var(--ease), border-color 0.5s var(--ease),
    background-color 0.5s var(--ease);
}
.header.is-stuck {
  height: 64px;
  border-bottom-color: var(--line);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
}
@supports not (backdrop-filter: blur(2px)) {
  .header.is-stuck { background: var(--bg); }
}

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

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}
.brand__mark {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  transition: transform 0.7s var(--ease);
}
.is-stuck .brand__mark { transform: scale(0.88); }
.brand:hover .brand__mark { transform: rotate(-8deg) scale(1.04); }
.brand__name {
  display: flex;
  flex-direction: column;
  line-height: 1.05;
}
.brand__name b {
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: -0.02em;
}
.brand__name span {
  font-size: 0.7rem;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

.nav {
  display: flex;
  align-items: center;
  gap: 28px;
  margin-left: auto;
}
.nav a {
  position: relative;
  font-size: 0.95rem;
  color: var(--ink-muted);
  padding-block: 6px;
  transition: color 0.4s var(--ease);
}
.nav a::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: right;
  transition: transform 0.55s var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a:hover::after { transform: scaleX(1); transform-origin: left; }

.header__cta { display: flex; align-items: center; gap: 16px; flex: none; }
.header__phone {
  font-weight: 500;
  font-size: 1rem;
  letter-spacing: -0.01em;
  white-space: nowrap;
  transition: color 0.4s var(--ease);
}
.header__phone:hover { color: var(--accent); }

/* Burger and close are built from CSS rules, not drawn SVG paths. */
.burger {
  display: none;
  width: 46px;
  height: 46px;
  margin-left: auto;
  align-items: center;
  justify-content: center;
}
.icon-bars, .icon-cross {
  position: relative;
  width: 22px;
  height: 14px;
  display: block;
}
.icon-bars::before, .icon-bars::after,
.icon-cross::before, .icon-cross::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  background: currentColor;
  transition: transform 0.5s var(--ease), top 0.5s var(--ease);
}
.icon-bars::before { top: 0; }
.icon-bars::after { bottom: 0; }
.icon-cross { height: 22px; }
.icon-cross::before, .icon-cross::after { top: 10px; }
.icon-cross::before { transform: rotate(45deg); }
.icon-cross::after { transform: rotate(-45deg); }

@media (max-width: 1023px) {
  .nav, .header__cta .btn { display: none; }
  .burger { display: inline-flex; }
  .header__cta { margin-left: auto; }
}
@media (max-width: 620px) {
  .header__phone { display: none; }
}

/* mobile menu */
.menu {
  position: fixed;
  inset: 0;
  z-index: var(--z-overlay);
  background: color-mix(in srgb, var(--bg) 94%, transparent);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  padding: 24px var(--gutter) 40px;
  display: flex;
  flex-direction: column;
  gap: 8px;
  clip-path: inset(0 0 100% 0);
  visibility: hidden;
  transition: clip-path 0.8s var(--ease), visibility 0.8s;
}
.menu.is-open { clip-path: inset(0 0 0 0); visibility: visible; }
.menu__top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 48px;
  margin-bottom: 20px;
}
.menu a[data-menu-link] {
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  font-size: 1.4rem;
  font-weight: 500;
  letter-spacing: -0.025em;
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease), transform 0.7s var(--ease);
}
.menu.is-open a[data-menu-link] {
  opacity: 1;
  transform: none;
  transition-delay: calc(var(--i, 0) * 70ms + 120ms);
}
.menu__foot { margin-top: auto; display: grid; gap: 14px; }

/* ---------- Hero (asymmetric split) -------------------------------------- */
.hero {
  padding-top: clamp(28px, 4vw, 56px);
  padding-bottom: clamp(56px, 7vw, 100px);
}
.hero__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.16fr) minmax(0, 0.84fr);
  gap: clamp(28px, 4vw, 68px);
  align-items: center;
}
.hero__copy { display: flex; flex-direction: column; gap: clamp(20px, 2.4vw, 30px); }
.hero__title { max-width: 20ch; text-wrap: balance; }
.hero__title em {
  font-style: normal;
  color: var(--accent);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 12px; }

.hero__media {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--surface-sunk);
  padding: var(--mat);
  border: 1px solid var(--line);
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.25s var(--ease);
}
.hero__media.is-in { clip-path: inset(0 0 0 0); }
.hero__media > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

@media (max-width: 899px) {
  .hero__grid { grid-template-columns: 1fr; gap: 30px; }
  .hero__media { aspect-ratio: 4 / 3; order: -1; }
  .hero__title { max-width: none; }
}

/* ---------- Facts band --------------------------------------------------- */
.facts {
  border-top: 1px solid var(--line);
  padding-block: clamp(44px, 5.5vw, 72px);
}
.facts__grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 48px);
}
.fact { position: relative; padding-top: 22px; }
.fact::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 1s var(--ease) var(--reveal-delay, 0ms);
}
.fact.is-in::before { transform: scaleX(1); }
.fact__num {
  font-size: clamp(2.1rem, 1.2rem + 2.6vw, 3.3rem);
  font-weight: 600;
  letter-spacing: -0.04em;
  line-height: 1;
  font-variant-numeric: tabular-nums;
}
.fact__label {
  margin-top: 12px;
  color: var(--ink-muted);
  font-size: 0.95rem;
  line-height: 1.4;
  max-width: 22ch;
}
@media (max-width: 767px) {
  .facts__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 30px 20px; }
}

/* ---------- Categories (asymmetric photo grid, 5 cells) ------------------ */
.cats {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  gap: clamp(16px, 1.8vw, 26px);
}
.cat {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 18px;
  isolation: isolate;
}

/* the photo sits in an inset mat with a hairline, like a mounted panel */
.cat__frame {
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: var(--mat);
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.1s var(--ease) var(--reveal-delay, 0ms),
    background-color 0.6s var(--ease), border-color 0.6s var(--ease);
}
.cat.is-in .cat__frame { clip-path: inset(0 0 0 0); }
.cat__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.75s var(--ease);
}
.cat:hover .cat__frame { border-color: var(--line-strong); }
.cat:hover .cat__frame img { transform: scale(1.05); }

.cat__body {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
.cat__note { color: var(--ink-muted); font-size: 0.95rem; }

.cat a::after { content: ''; position: absolute; inset: 0; z-index: 1; }
.cat .h3 { transition: color 0.4s var(--ease); }
.cat:hover .h3 { color: var(--accent); }

.cat--a { grid-column: span 7; }
.cat--a .cat__frame { aspect-ratio: 16 / 11; }
.cat--b { grid-column: span 5; }
.cat--b .cat__frame { aspect-ratio: 4 / 5; }
.cat--c { grid-column: span 5; }
.cat--c .cat__frame { aspect-ratio: 5 / 4; }
.cat--d { grid-column: span 3; }
.cat--d .cat__frame { aspect-ratio: 3 / 4; }
.cat--e { grid-column: span 4; }
.cat--e .cat__frame { aspect-ratio: 3 / 4; }

@media (max-width: 1023px) {
  .cat--a, .cat--b, .cat--c { grid-column: span 12; }
  .cat--d, .cat--e { grid-column: span 6; }
  .cat--a .cat__frame, .cat--c .cat__frame { aspect-ratio: 4 / 3; }
  .cat--b .cat__frame { aspect-ratio: 4 / 3; }
}
@media (max-width: 639px) {
  .cats { gap: 34px; }
  .cat--d, .cat--e { grid-column: span 12; }
  .cat__frame { aspect-ratio: 4 / 3 !important; }
}

/* ---------- Process (sticky heading + stepped rows) ---------------------- */
.process { background: var(--surface); border-block: 1px solid var(--line); }
.process__grid {
  display: grid;
  grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr);
  gap: clamp(32px, 5vw, 90px);
  align-items: start;
}
.process__aside { position: sticky; top: 116px; display: grid; gap: 24px; }

.steps { position: relative; display: grid; }
/* the rail behind the step numbers, plus a line that fills as you scroll */
.steps::before, .steps::after {
  content: '';
  position: absolute;
  top: 0;
  bottom: 0;
  left: 21px;
  width: 1px;
}
.steps::before { background: var(--line); }
.steps::after { background: var(--accent); transform-origin: top; }

.step {
  display: grid;
  grid-template-columns: 60px minmax(0, 1fr);
  gap: clamp(16px, 2vw, 32px);
  padding-block: clamp(26px, 2.8vw, 40px);
  border-top: 1px solid var(--line);
}
.step:last-child { border-bottom: 1px solid var(--line); }
.step__idx {
  position: relative;
  z-index: 1;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--accent);
  font-variant-numeric: tabular-nums;
  padding-top: 4px;
}
.step__body { display: grid; gap: 10px; }
.step__body p { color: var(--ink-muted); max-width: 52ch; }

@media (max-width: 899px) {
  .process__grid { grid-template-columns: 1fr; gap: 32px; }
  .process__aside { position: static; }
  .step { grid-template-columns: 44px minmax(0, 1fr); }
  .steps::before, .steps::after { left: 15px; }
}

/* ---------- Works (horizontal rail, wheel + drag + swipe) ---------------- */
.works__head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: clamp(30px, 4vw, 48px);
}
.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: clamp(240px, 30vw, 400px);
  gap: clamp(16px, 1.8vw, 26px);
  overflow-x: auto;
  padding-inline: var(--gutter);
  /* no scroll snapping: the rail must stop exactly where it is let go */
  overscroll-behavior-x: contain;
  cursor: grab;
  user-select: none;
  -webkit-user-select: none;
  /* the native bar is replaced by the thin custom one below */
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.rail::-webkit-scrollbar { display: none; }
.rail.is-dragging { cursor: grabbing; }
/* stops the browser from picking a photo up as a drag ghost */
.rail img { -webkit-user-drag: none; user-drag: none; }

/* custom scroll indicator: a hairline with a thin moving thumb */
.rail-bar {
  position: relative;
  height: 2px;
  margin-top: 22px;
  background: var(--line);
  overflow: hidden;
}
.rail-bar span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 100%;
  background: var(--line-strong);
  transform-origin: left center;
  transform: scaleX(0.2);
  will-change: transform;
}

.rail__item { display: grid; gap: 16px; }
.rail__item figure { display: grid; gap: 16px; margin: 0; }
.rail__frame {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--line);
  padding: var(--mat);
  transition: border-color 0.6s var(--ease);
}
.rail__frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.75s var(--ease);
}
.rail__item:hover .rail__frame { border-color: var(--line-strong); }
.rail__item:hover .rail__frame img { transform: scale(1.04); }
.rail__item figcaption { color: var(--ink-muted); font-size: 0.95rem; }
.rail__item figcaption b {
  display: block;
  color: var(--ink);
  font-weight: 500;
  letter-spacing: -0.01em;
}

/* ---------- FAQ ---------------------------------------------------------- */
.acc { border-top: 1px solid var(--line); max-width: 960px; }
.acc__item { border-bottom: 1px solid var(--line); }
.acc__btn {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  text-align: left;
  padding: clamp(22px, 2.4vw, 30px) 0;
  font-size: clamp(1.02rem, 0.95rem + 0.4vw, 1.2rem);
  font-weight: 500;
  letter-spacing: -0.015em;
  transition: color 0.4s var(--ease);
}
.acc__btn:hover { color: var(--accent); }
.acc__sign {
  flex: none;
  width: 20px;
  height: 20px;
  position: relative;
  transition: transform 0.6s var(--ease);
}
.acc__btn[aria-expanded='true'] .acc__sign { transform: rotate(180deg); }
.acc__sign::before, .acc__sign::after {
  content: '';
  position: absolute;
  background: currentColor;
  inset: 50% 0 auto 0;
  height: 1.5px;
  transition: transform 0.6s var(--ease);
}
.acc__sign::after { transform: rotate(90deg); }
.acc__btn[aria-expanded='true'] .acc__sign::after { transform: rotate(0deg); }

.acc__panel {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 0.65s var(--ease);
}
.acc__panel[data-open='true'] { grid-template-rows: 1fr; }
.acc__panel > div { overflow: hidden; }
.acc__panel p {
  color: var(--ink-muted);
  max-width: 62ch;
  padding-bottom: clamp(22px, 2.4vw, 30px);
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.6s var(--ease) 0.1s, transform 0.6s var(--ease) 0.1s;
}
.acc__panel[data-open='true'] p { opacity: 1; transform: none; }

/* ---------- Deep block: request + contacts ------------------------------- */
.deep {
  background: var(--deep-bg);
  color: var(--deep-ink);
}
.deep .h2, .deep .display, .deep .h3 { color: var(--deep-ink); }
.deep .lede, .deep .muted { color: var(--deep-muted); }

.deep__grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(40px, 5vw, 90px);
  align-items: start;
}

/* the form sits in its own tray, same mat logic as the photos */
.form-panel {
  background: var(--deep-surface);
  border: 1px solid var(--deep-line);
  padding: clamp(22px, 3vw, 40px);
}
.form { display: grid; gap: 20px; }
/* start-aligned so a field with a hint does not push its input out of line
   with the field next to it */
.field { display: grid; gap: 8px; align-content: start; }
.field label { font-size: 0.92rem; color: var(--deep-muted); }
.field input, .field select, .field textarea {
  width: 100%;
  min-height: 54px;
  padding: 14px 16px;
  border-radius: 0;
  background: var(--deep-sunk);
  border: 1px solid var(--deep-line);
  color: var(--deep-ink);
  transition: border-color 0.4s var(--ease), background-color 0.4s var(--ease),
    box-shadow 0.4s var(--ease);
}
.field textarea { min-height: 112px; resize: vertical; }
.field select {
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--deep-muted) 50%),
    linear-gradient(135deg, var(--deep-muted) 50%, transparent 50%);
  background-position: calc(100% - 21px) 25px, calc(100% - 15px) 25px;
  background-size: 6px 6px, 6px 6px;
  background-repeat: no-repeat;
}
.field input::placeholder, .field textarea::placeholder { color: #93A099; }
.field input:focus, .field select:focus, .field textarea:focus {
  border-color: var(--deep-accent);
  outline: none;
  background: #16241E;
  box-shadow: 0 0 0 3px rgba(92, 176, 141, 0.16);
}
.field[data-invalid='true'] input,
.field[data-invalid='true'] select { border-color: #E88A6B; }
.field__error {
  display: none;
  font-size: 0.86rem;
  color: #F0A183;
}
.field[data-invalid='true'] .field__error { display: block; }
.field__hint { font-size: 0.86rem; color: #98A59D; }

.form__row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
  align-items: start;
}
@media (max-width: 599px) { .form__row { grid-template-columns: 1fr; } }

.form__consent { font-size: 0.84rem; color: #98A59D; max-width: 46ch; }
.form__consent a { text-decoration: underline; text-underline-offset: 3px; }

.form__status {
  display: none;
  padding: 16px 18px;
  border: 1px solid var(--deep-line);
  background: var(--deep-sunk);
  font-size: 0.95rem;
}
.form__status[data-state='ok'],
.form__status[data-state='fail'] { display: block; }
.form__status[data-state='ok'] { border-color: var(--deep-accent); }
.form__status[data-state='fail'] { border-color: #C2704F; }
.form__status a { color: var(--deep-accent); text-decoration: underline; }

/* no top padding: the first hairline lines up with the form panel's top edge */
.contacts { display: grid; align-content: start; }
.contacts__lines { display: grid; }
.contact-row {
  display: grid;
  grid-template-columns: 128px minmax(0, 1fr);
  gap: 16px;
  padding-block: 20px;
  border-top: 1px solid var(--deep-line);
  align-items: center;
  transition: border-color 0.5s var(--ease);
}
.contact-row:last-child { border-bottom: 1px solid var(--deep-line); }
.contact-row:hover { border-color: var(--deep-accent); }
.contact-row dt { color: var(--deep-muted); font-size: 0.92rem; }
.contact-row dd { margin: 0; font-size: 1.06rem; font-weight: 500; letter-spacing: -0.01em; }
.contact-row dd small { display: block; font-weight: 400; font-size: 0.88rem; color: var(--deep-muted); letter-spacing: 0; margin-top: 2px; }
.contact-row a { transition: color 0.4s var(--ease); }
.contact-row a:hover { color: var(--deep-accent); }
/* keep the visual rhythm, widen the touch target to 44px */
.contact-row dd > a {
  display: inline-block;
  padding-block: 11px;
  margin-block: -11px;
}

@media (max-width: 899px) {
  .deep__grid { grid-template-columns: 1fr; gap: 46px; }
}
@media (max-width: 479px) {
  .contact-row { grid-template-columns: 1fr; gap: 4px; align-items: start; }
}

/* ---------- Legal document page ------------------------------------------ */
.doc__head { max-width: 760px; }
.doc__head .h2 { max-width: none; }
.doc__head .lede { max-width: none; margin-top: 22px; }
.doc__body {
  max-width: 760px;
  margin-top: clamp(40px, 5vw, 64px);
  display: grid;
  gap: clamp(30px, 3.4vw, 44px);
}
.doc__body section { display: grid; gap: 12px; }
.doc__body p { color: var(--ink-muted); }
.doc__body a { color: var(--ink); text-decoration: underline; text-underline-offset: 3px; }
.doc__body a:hover { color: var(--accent); }
.doc__list { margin: 0; padding-left: 20px; color: var(--ink-muted); display: grid; gap: 6px; }
.doc__list li::marker { color: var(--ink-faint); }
.doc__back { margin-top: clamp(44px, 5vw, 70px); }

/* honeypot: off-screen, never shown, never announced */
.hp {
  position: absolute;
  left: -9999px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Footer ------------------------------------------------------- */
.foot {
  background: var(--deep-bg);
  color: var(--deep-muted);
  border-top: 1px solid var(--deep-line);
  padding-block: 34px;
  font-size: 0.9rem;
}
.foot__inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px 28px;
  justify-content: space-between;
}
.foot a { transition: color 0.4s var(--ease); }
.foot a:hover { color: var(--deep-ink); }
.foot__links { display: flex; flex-wrap: wrap; gap: 0 22px; }
.foot__links a { display: inline-block; padding-block: 11px; }

/* ---------- Reveal motion ------------------------------------------------ */
[data-reveal] {
  opacity: 0;
  transform: translateY(24px);
  filter: blur(6px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease),
    filter 0.9s var(--ease);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-in { opacity: 1; transform: none; filter: none; }
/* headings animate their own words, so the block itself only fades */
[data-reveal].has-words { transform: none; filter: none; }

/* ---------- Scroll-driven layer (progressive enhancement) ---------------- */
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    /* Slow vertical drift inside the hero mat only. Tiles that zoom on hover
       do NOT get this: an animation always beats a transition on the same
       property, so the two would fight and the zoom would snap back. */
    .hero__media > img {
      animation: pan linear both;
      animation-timeline: view();
      animation-range: entry 0% exit 100%;
    }
    /* the scale is only the headroom the drift needs, kept small so the
       photo is never magnified beyond its own pixels */
    @keyframes pan {
      from { transform: scale(1.05) translateY(-1.8%); }
      to   { transform: scale(1.05) translateY(1.8%); }
    }

    /* the process line fills as the steps pass through the viewport */
    .steps::after {
      transform: scaleY(0);
      animation: fill linear both;
      animation-timeline: view();
      animation-range: cover 12% cover 72%;
    }
    @keyframes fill {
      to { transform: scaleY(1); }
    }
  }
}

@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1; transform: none; filter: none; transition: none; }
  .w > i { transform: none; transition: none; }
  .hero__media, .cat__frame { clip-path: none; transition: none; }
  .fact::before { transform: scaleX(1); transition: none; }
  .steps::after { transform: scaleY(1); }
  .cat__frame img, .rail__frame img, .btn, .menu, .menu a[data-menu-link],
  .acc__panel, .acc__panel p, .header, .brand__mark { transition: none !important; }
  .menu a[data-menu-link] { opacity: 1; transform: none; }
  .cat__go { opacity: 1; transform: rotate(45deg); }
}
