/* moilitaya — art-zine / scrapbook. Ночь, бумага дневника, пыльная роза, вино. */

:root {
  --night: #121214;
  --night-2: #1b1a1e;
  --night-line: #2c2a2f;
  --paper: #f5f2eb;
  --paper-2: #ebe5d8;
  --paper-line: #dcd3c4;
  --pola: #fbf9f4;
  --ink: #121214;
  --ink-2: #3d3639;
  --muted-p: #6a6064;
  --cream: #f5f2eb;
  --muted-n: #aaa3a6;
  --rose: #b85d75;
  --wine: #4a1e2b;

  --f-sans: "Onest", "Segoe UI", system-ui, sans-serif;
  --f-hand: "Bad Script", "Segoe Script", cursive;
  --f-mono: "PT Mono", ui-monospace, "Cascadia Mono", monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --wrap: 1280px;
  --nav-h: 64px;
  --ease: cubic-bezier(.16, 1, .3, 1);

  color-scheme: dark;
}

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

html {
  background: var(--night);
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  scrollbar-color: #3a3539 var(--night);
  scrollbar-width: thin;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--night);
  color: var(--cream);
  font: 400 17px/1.55 var(--f-sans);
  caret-color: var(--rose);
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overflow-x: hidden;
  overflow-x: clip;
}
html { overflow-x: hidden; }

/* Всё содержимое обрезается по ширине экрана: 3D-эффекты не дают телефону
   отдалить страницу и таскать её вбок. translateZ(0) нужен Safari,
   иначе он не обрезает элементы с 3D-трансформами. */
main, .foot {
  position: relative;
  overflow-x: hidden;
  overflow-x: clip;
}
@supports not (overflow: clip) {
  main { transform: translateZ(0); }
}

::selection { background: var(--rose); color: var(--night); }
::-webkit-scrollbar { width: 10px; }
::-webkit-scrollbar-track { background: var(--night); }
::-webkit-scrollbar-thumb { background: #34303a; border: 2px solid var(--night); border-radius: 10px; }
::-webkit-scrollbar-thumb:hover { background: var(--rose); }

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p, ul, ol, figure { margin: 0; }
ul, ol { padding: 0; list-style: none; }
button { font: inherit; color: inherit; }

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

svg { fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.hand { font-family: var(--f-hand); font-weight: 400; }
.label { font: 400 13px/1.4 var(--f-mono); letter-spacing: .02em; }

/* 35mm: зерно поверх всего */
body::after {
  content: "";
  position: fixed;
  inset: -50%;
  z-index: 90;
  pointer-events: none;
  opacity: .11;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .96 0 0 0 0 .93 0 0 0 0 .88 0 0 0 1.5 -.25'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0%, 100% { transform: translate(0, 0); }
  17% { transform: translate(-3%, 2%); }
  33% { transform: translate(2%, -3%); }
  50% { transform: translate(-2%, -1%); }
  67% { transform: translate(3%, 3%); }
  83% { transform: translate(-1%, 4%); }
}

.skip {
  position: fixed; left: var(--gutter); top: 10px; z-index: 200;
  padding: 12px 16px; background: var(--rose); color: var(--night);
  font: 700 14px/1 var(--f-sans);
  transform: translateY(-170%);
}
.skip:focus { transform: none; }

.wrap {
  width: 100%;
  max-width: calc(var(--wrap) + var(--gutter) * 2);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

/* ---------- кнопки и ссылки ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 52px;
  padding: 14px 22px;
  background: var(--rose);
  color: var(--night);
  font: 700 16px/1 var(--f-sans);
  border-radius: 2px;
  transition: background-color .3s var(--ease), color .3s var(--ease), transform .2s var(--ease);
}
.btn svg { width: 18px; height: 18px; stroke-width: 2; transition: transform .4s var(--ease); }
.btn:hover { background: var(--cream); }
.btn:hover svg { transform: translate(2px, -2px); }
.btn:active { transform: scale(.97); }
.btn--small { min-height: 44px; padding: 10px 16px; font-size: 14px; }
.btn--wine { background: var(--wine); color: var(--cream); }
.btn--wine:hover { background: var(--rose); color: var(--night); }
.btn--paper { background: var(--paper); color: var(--night); }
.btn--paper:hover { background: var(--rose); }

.link {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-color: var(--rose);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 6px;
  transition: color .3s var(--ease), text-underline-offset .3s var(--ease);
}
.link:hover { color: var(--rose); text-underline-offset: 9px; }
.link--paper { text-decoration-color: var(--paper); }
.link--paper:hover { color: var(--paper); text-decoration-color: var(--rose); }

/* ---------- скотч ---------- */
.tape {
  position: absolute;
  top: -14px;
  left: 50%;
  z-index: 3;
  width: 104px;
  height: 30px;
  transform: translateX(-50%) rotate(var(--tr, -4deg));
  background: rgba(228, 219, 196, .62);
  box-shadow: 0 1px 2px rgba(0, 0, 0, .15);
  clip-path: polygon(0 8%, 5% 0, 12% 6%, 30% 1%, 55% 5%, 80% 0, 94% 5%, 100% 0, 97% 30%, 100% 55%, 97% 78%, 100% 100%, 88% 95%, 64% 100%, 40% 95%, 18% 100%, 4% 94%, 0 100%, 3% 70%, 0 45%, 3% 22%);
  pointer-events: none;
}
.page .tape { background: rgba(184, 93, 117, .42); }

/* ---------- полароид ---------- */
.pola {
  position: relative;
  display: block;
  margin: 0;
  padding: 12px 12px 0;
  border: 0;
  background: var(--pola);
  color: var(--ink);
  transform: rotate(var(--r, 0deg));
  box-shadow: 0 2px 3px rgba(0, 0, 0, .18), 0 18px 40px rgba(0, 0, 0, .32);
  transition: transform .7s var(--ease), box-shadow .7s var(--ease);
}
.pola img { width: 100%; height: auto; object-fit: cover; background: var(--night-2); }
.pola figcaption {
  padding: 12px 6px 16px;
  font-size: 21px;
  line-height: 1;
  text-align: center;
  color: var(--ink-2);
}
button.pola { width: 100%; padding-bottom: 46px; cursor: zoom-in; text-align: left; }
button.pola:hover,
button.pola:focus-visible {
  transform: rotate(0deg) translateY(-6px);
  box-shadow: 0 3px 5px rgba(0, 0, 0, .16), 0 30px 60px rgba(0, 0, 0, .34);
}

.pola-empty { display: none; }

/* фото ещё не положили — полароид превращается в записку */
.is-missing { cursor: default !important; }
.is-missing img { display: none; }
.is-missing .pola-empty {
  display: grid;
  place-items: center;
  padding: 12%;
  text-align: center;
  font-size: clamp(1.8rem, 3.4vw, 3rem);
  line-height: 1.05;
  color: var(--wine);
  background:
    repeating-linear-gradient(to bottom, transparent 0 31px, var(--paper-line) 31px 32px),
    var(--paper-2);
}

/* ---------- NAV ---------- */
.nav {
  position: fixed;
  inset: 0 0 auto;
  z-index: 50;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-inline: var(--gutter);
  border-bottom: 1px solid transparent;
  transition: background-color .4s var(--ease), border-color .4s var(--ease);
}
.nav.is-solid { background: rgba(18, 18, 20, .95); border-bottom-color: var(--night-line); }
.nav-mark {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font: 800 22px/1 var(--f-sans);
  letter-spacing: -.04em;
}
.nav ul { display: flex; gap: clamp(8px, 2.4vw, 36px); }
.nav ul a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding-inline: 4px;
  font: 400 14px/1 var(--f-mono);
  color: var(--muted-n);
  transition: color .3s var(--ease);
}
.nav ul a:hover { color: var(--cream); }

/* ---------- HERO ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 24px;
  align-items: center;
  min-height: 100svh;
  /* на всю ширину экрана, чтобы засвет не обрезался краем блока */
  padding: calc(var(--nav-h) + 40px) max(var(--gutter), calc((100% - var(--wrap)) / 2)) 72px;
  isolation: isolate;
  overflow-x: clip;
}

/* засвет плёнки */
.leak {
  position: absolute;
  inset: -10% 0 0 auto;
  z-index: -1;
  width: 62vw;
  pointer-events: none;
  background:
    radial-gradient(ellipse 38% 55% at 100% 30%, rgba(214, 130, 84, .26), transparent 75%),
    radial-gradient(ellipse 60% 70% at 88% 42%, rgba(184, 93, 117, .34), transparent 72%),
    radial-gradient(ellipse 50% 45% at 45% 55%, rgba(245, 242, 235, .06), transparent 75%);
  filter: blur(24px);
}
/* царапины на плёнке */
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: .5;
  background:
    linear-gradient(90deg, transparent 17.3%, rgba(245, 242, 235, .07) 17.3% 17.38%, transparent 17.38%),
    linear-gradient(90deg, transparent 63.1%, rgba(245, 242, 235, .05) 63.1% 63.16%, transparent 63.16%),
    linear-gradient(90deg, transparent 88.6%, rgba(245, 242, 235, .06) 88.6% 88.64%, transparent 88.64%);
}

.hero-copy { grid-column: 1 / 7; position: relative; z-index: 2; }

.brand {
  display: block;
  font: 800 clamp(4.2rem, 10.4vw, 10rem)/.84 var(--f-sans);
  letter-spacing: -.04em;
  margin-left: -.04em;
}
.h1-line {
  display: block;
  max-width: 14ch;
  margin-top: clamp(14px, 2vw, 24px);
  font: 500 clamp(1.7rem, 3.1vw, 2.9rem)/1.08 var(--f-sans);
  letter-spacing: -.02em;
  text-wrap: balance;
}
.circled { position: relative; white-space: nowrap; }
.circled svg {
  position: absolute;
  left: -14%;
  top: -34%;
  width: 128%;
  height: 168%;
  color: var(--rose);
  stroke-width: 2.6;
  overflow: visible;
  stroke-dasharray: 560;
  stroke-dashoffset: 0;
  animation: draw 1.1s .9s var(--ease) both;
}
.lead {
  max-width: 44ch;
  margin-top: 28px;
  color: var(--muted-n);
  font-size: 18px;
  text-wrap: pretty;
}
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 16px 28px; margin-top: 36px; }
.hero-quote {
  margin-top: 44px;
  font-size: clamp(1.6rem, 2.4vw, 2.2rem);
  color: var(--rose);
  transform: rotate(-3deg);
  transform-origin: left;
}

/* кровать: вещи брошены как попало */
.bed {
  grid-column: 7 / 13;
  position: relative;
  height: min(76svh, 700px);
  min-height: 520px;
}
.bed .pola { position: absolute; }
.bed .pola img { aspect-ratio: 1 / 1; }
.pola--lily { width: 58%; left: 2%; top: 3%; z-index: 1; animation: drop 1.1s .15s var(--ease) both; }
.pola--lily img { object-position: 55% 45%; }
.pola--cap { width: 34%; right: 0; top: 0; z-index: 2; animation: drop 1.1s .3s var(--ease) both; }
.pola--cap img { object-position: 50% 42%; }
.thrown {
  position: absolute;
  z-index: 3;
}
.thrown img {
  width: 100%;
  height: auto;
  filter: drop-shadow(0 22px 28px rgba(0, 0, 0, .55));
}
.thrown--skirt {
  width: 66%;
  right: 0;
  bottom: 2%;
  transform: rotate(9deg);
  animation: throw 1.2s .45s var(--ease) both;
}
/* Пометка живёт внутри юбки: стрелка всегда упирается в её левый бок */
.note {
  position: absolute;
  z-index: 4;
  font-size: clamp(1.3rem, 1.9vw, 1.75rem);
  line-height: 1;
  color: var(--cream);
  white-space: nowrap;
  text-align: right;
}
.note--skirt {
  right: calc(100% + 4px);
  top: 40%;
  transform: rotate(-12deg);
  transform-origin: 100% 0;
}
/* текст снаружи, внутрь вещи заходит только кончик стрелки */
.note svg {
  display: block;
  width: clamp(64px, 7vw, 92px);
  height: auto;
  aspect-ratio: 90 / 50;
  margin: 6px -34px 0 auto;
  color: var(--rose);
  stroke-width: 2.4;
}

@keyframes drop {
  from { transform: translateY(-34px) rotate(calc(var(--r) - 8deg)); opacity: .15; }
  to   { transform: rotate(var(--r)); opacity: 1; }
}
@keyframes throw {
  from { transform: translate(60px, -40px) rotate(24deg); opacity: .15; }
  to   { transform: rotate(9deg); opacity: 1; }
}
@keyframes draw { from { stroke-dashoffset: 560; } to { stroke-dashoffset: 0; } }

/* ---------- страницы дневника (бумага) ---------- */
.page {
  position: relative;
  z-index: 1;
  background: var(--paper);
  color: var(--ink);
  padding-block: clamp(100px, 11vw, 160px);
}
.page::before,
.page::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 22px;
  background: var(--paper);
  -webkit-mask: url("assets/tear-a.svg") 0 0 / 100% 100% no-repeat;
  mask: url("assets/tear-a.svg") 0 0 / 100% 100% no-repeat;
}
.page::before { top: -21px; }
.page::after {
  bottom: -21px;
  transform: scaleY(-1);
  -webkit-mask-image: url("assets/tear-b.svg");
  mask-image: url("assets/tear-b.svg");
}
.page ::selection { background: var(--wine); color: var(--paper); }

.sec-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 36px;
  margin-bottom: clamp(64px, 7vw, 104px);
}
.sec-head h2 {
  font: 800 clamp(3.2rem, 8vw, 7.4rem)/.9 var(--f-sans);
  letter-spacing: -.04em;
  text-wrap: balance;
}
.sec-note {
  font-size: clamp(1.4rem, 2.2vw, 2rem);
  color: var(--wine);
  transform: rotate(-2deg);
}
.night .sec-note { color: var(--rose); }

/* ---------- доска с вещами ---------- */
.board {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 32px;
  row-gap: clamp(80px, 9vw, 130px);
  align-items: start;
}
.piece { position: relative; }
.piece--skirt  { grid-column: 1 / 7; }
.piece--jacket { grid-column: 8 / 13; margin-top: clamp(40px, 8vw, 120px); }
.piece--cap    { grid-column: 3 / 7; }
.piece--lily   { grid-column: 8 / 13; margin-top: clamp(20px, 4vw, 60px); }

.piece--jacket .pola img { aspect-ratio: 1086 / 985; }
.piece--skirt  .pola img { aspect-ratio: 5 / 4; }
.piece--cap    .pola img { aspect-ratio: 4 / 5; object-position: 50% 42%; }
.piece--lily   .pola img { aspect-ratio: 1199 / 1280; }

/* юбка лежит на винном покрывале */
.pola--cut img {
  object-fit: contain;
  padding: 7% 8%;
  background: var(--wine);
  filter: drop-shadow(0 14px 16px rgba(0, 0, 0, .5));
}

.piece-info { max-width: 440px; margin-top: 30px; padding-left: 12px; }
.piece-info .label { color: var(--muted-p); }
.piece h3 {
  margin-top: 8px;
  font: 700 clamp(1.4rem, 2vw, 1.8rem)/1.15 var(--f-sans);
  letter-spacing: -.015em;
}
.piece-desc { max-width: 40ch; margin-top: 10px; color: var(--ink-2); font-size: 16.5px; text-wrap: pretty; }
.want {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  margin-top: 8px;
  font: 700 15px/1 var(--f-sans);
  color: var(--wine);
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 6px;
  transition: text-underline-offset .3s var(--ease);
}
.want svg { width: 16px; height: 16px; stroke-width: 2; transition: transform .4s var(--ease); }
.want:hover { text-underline-offset: 9px; }
.want:hover svg { transform: translate(2px, -2px); }

.margin-note {
  position: absolute;
  z-index: 4;
  font-size: clamp(1.35rem, 1.9vw, 1.75rem);
  line-height: 1.1;
  color: var(--wine);
  pointer-events: none;
}
.margin-note svg { display: inline-block; color: var(--rose); stroke-width: 2; vertical-align: middle; }
.piece--jacket .margin-note { right: -18px; top: -40px; transform: rotate(5deg); }
.piece--jacket .star { width: 30px; height: 30px; margin-left: 6px; }
.piece--skirt .margin-note { left: 8%; top: -52px; transform: rotate(-4deg); }
/* Пометка внутри полароида кепки: кончик стрелки на кольцах козырька (~12% слева, ~64% сверху) */
.note--rings {
  right: calc(100% + 10px);
  top: calc(66% - 80px);
  width: 160px;
  text-align: right;
  transform: rotate(-4deg);
  transform-origin: 100% 100%;
}
.note--rings .arrow {
  display: block;
  width: 108px;
  height: auto;
  aspect-ratio: 90 / 50;
  margin: 6px -86px 0 auto;
  stroke-width: 2.4;
}

/* арт */
.piece--pumpkin { grid-column: 1 / 8; }
.piece--deer    { grid-column: 8 / 13; margin-top: clamp(60px, 10vw, 150px); }
.piece--sketch  { grid-column: 3 / 7; }
.piece--pumpkin .pola :is(img, .pola-empty) { aspect-ratio: 3 / 2; }
.piece--deer    .pola :is(img, .pola-empty) { aspect-ratio: 1 / 1; }
.piece--sketch  .pola :is(img, .pola-empty) { aspect-ratio: 3 / 4; }

/* ---------- ночь: на заказ ---------- */
.night { position: relative; padding-block: clamp(110px, 12vw, 170px); }

.custom-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 32px;
  row-gap: 64px;
  align-items: start;
}
.offers { grid-column: 1 / 7; }
.offer { padding-block: 28px; border-top: 1px solid var(--night-line); }
.offer:last-child { border-bottom: 1px solid var(--night-line); }
.offer h3 { font: 700 clamp(1.6rem, 2.6vw, 2.3rem)/1.1 var(--f-sans); letter-spacing: -.02em; }
.offer p { max-width: 44ch; margin-top: 10px; color: var(--muted-n); }

/* разлинованный лист с полем */
.diary {
  grid-column: 8 / 13;
  position: relative;
  padding: 52px 32px 40px 76px;
  color: var(--ink);
  background:
    linear-gradient(90deg, transparent 54px, rgba(184, 93, 117, .6) 54px 55.5px, transparent 55.5px),
    repeating-linear-gradient(to bottom, transparent 0 35px, var(--paper-line) 35px 36px),
    var(--paper);
  background-position: 0 0, 0 18px, 0 0;
  transform: rotate(1.4deg);
  box-shadow: 0 2px 3px rgba(0, 0, 0, .2), 0 24px 50px rgba(0, 0, 0, .4);
}
.diary h3 { font-size: 2.1rem; line-height: 36px; color: var(--wine); }
.steps { counter-reset: s; margin-top: 18px; }
.steps li {
  position: relative;
  counter-increment: s;
  font-size: 17px;
  line-height: 36px;
}
.steps li::before {
  content: counter(s) ".";
  position: absolute;
  left: -42px;
  font: 400 22px/36px var(--f-hand);
  color: var(--wine);
}
.diary .btn { margin-top: 32px; }

/* ---------- о ней ---------- */
.about { overflow: hidden; isolation: isolate; }
.about-bg { position: absolute; inset: 0; z-index: -1; }
.about-bg img { width: 100%; height: 100%; object-fit: cover; opacity: .22; filter: grayscale(.6) sepia(.25) contrast(1.05); }
.about-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, var(--night), rgba(18, 18, 20, .3) 30%, rgba(18, 18, 20, .3) 70%, var(--night));
}
.about-bg.is-missing { display: none; }

.about-grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  column-gap: 32px;
  row-gap: 64px;
  align-items: center;
}
.pola--portrait { grid-column: 2 / 6; }
.pola--portrait img,
.pola--portrait .pola-empty { aspect-ratio: 1 / 1; object-position: 50% 20%; }
.pola--portrait.is-missing .pola-empty {
  display: block;
  background:
    radial-gradient(ellipse at 40% 35%, rgba(184, 93, 117, .18), transparent 60%),
    #1c1a1e;
}
.about-text { grid-column: 7 / 13; }
.about-text h2 {
  font: 800 clamp(3.2rem, 7vw, 6.4rem)/.9 var(--f-sans);
  letter-spacing: -.04em;
  margin-bottom: clamp(26px, 3vw, 40px);
}
.manifesto {
  max-width: 28ch;
  font: 400 clamp(1.35rem, 2.1vw, 1.9rem)/1.35 var(--f-sans);
  letter-spacing: -.01em;
  text-wrap: pretty;
}
.about-quote {
  margin-top: 36px;
  font-size: clamp(1.7rem, 2.8vw, 2.5rem);
  line-height: 1.15;
  color: var(--rose);
  transform: rotate(-2deg);
  transform-origin: left;
}
.route {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 40px;
  color: var(--muted-n);
}
.route svg { width: 130px; height: 16px; color: var(--rose); stroke-width: 2; }

/* ---------- финал ---------- */
.closer {
  position: relative;
  background: var(--wine);
  padding-block: clamp(100px, 11vw, 150px);
}
.closer::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: -21px;
  height: 22px;
  background: var(--wine);
  -webkit-mask: url("assets/tear-b.svg") 0 0 / 100% 100% no-repeat;
  mask: url("assets/tear-b.svg") 0 0 / 100% 100% no-repeat;
}
.closer h2 {
  max-width: 15ch;
  font: 800 clamp(2.6rem, 6.4vw, 6rem)/.95 var(--f-sans);
  letter-spacing: -.04em;
  text-wrap: balance;
}
.closer .actions { margin-top: 44px; }

/* ---------- футер ---------- */
.foot { border-top: 1px solid var(--night-line); }
.foot-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px 24px;
  padding-block: 26px calc(26px + env(safe-area-inset-bottom));
  font: 400 13px/1.4 var(--f-mono);
  color: var(--muted-n);
}
.foot .hand { font-size: 20px; color: var(--rose); }

/* ---------- просмотр ---------- */
.viewer {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: rgba(18, 18, 20, .97);
  color: var(--cream);
  overflow: hidden;
}
.viewer[open] {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  animation: viewer-in .4s var(--ease);
}
.viewer::backdrop { background: rgba(0, 0, 0, .8); }
.viewer-stage { display: grid; place-items: center; min-height: 0; padding: clamp(16px, 4vw, 56px); }
.viewer-img {
  max-width: 100%;
  max-height: calc(100dvh - clamp(32px, 8vw, 112px));
  object-fit: contain;
  padding: 10px 10px 40px;
  background: var(--pola);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .5);
  animation: img-in .55s var(--ease);
}
.viewer-info {
  display: grid;
  align-content: end;
  justify-items: start;
  gap: 14px;
  padding: 96px 40px 48px;
  border-left: 1px solid var(--night-line);
}
.viewer-count { color: var(--rose); }
.viewer-title { font: 700 2rem/1.1 var(--f-sans); letter-spacing: -.02em; text-wrap: balance; }
.viewer-desc { color: var(--muted-n); }
.viewer-want { margin-top: 10px; }
.viewer-controls { position: absolute; top: 18px; right: 22px; display: flex; gap: 8px; }
.icon-btn {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid #3a3539;
  border-radius: 2px;
  background: var(--night);
  color: var(--cream);
  cursor: pointer;
  transition: border-color .3s var(--ease), color .3s var(--ease), transform .2s var(--ease);
}
.icon-btn svg { width: 20px; height: 20px; }
.icon-btn:hover { border-color: var(--rose); color: var(--rose); }
.icon-btn:active { transform: scale(.94); }
@keyframes viewer-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes img-in { from { opacity: 0; transform: translateY(10px) rotate(-1deg); } to { opacity: 1; transform: none; } }

/* ---------- адаптив ---------- */
/* Когда слева от кепки нет места, пометка становится подписью на нижнем поле полароида */
@media (max-width: 1180px) {
  .pola .note--rings {
    position: absolute;
    left: 14px;
    right: auto;
    top: auto;
    bottom: 12px;
    width: auto;
    margin: 0;
    font-size: 19px;
    transform: rotate(-1.5deg) !important;
  }
  .note--rings .arrow { display: none; }
}

@media (max-width: 860px) {
  .nav ul { display: none; }

  .hero { grid-template-columns: minmax(0, 1fr); row-gap: 48px; padding-top: calc(var(--nav-h) + 28px); }
  .hero-copy, .bed { grid-column: 1; }
  .bed { height: 118vw; min-height: 0; max-height: 640px; }
  .brand { font-size: clamp(3.6rem, 19vw, 7rem); }
  .hero-quote { margin-top: 32px; }

  .board, .custom-grid, .about-grid { grid-template-columns: minmax(0, 1fr); }
  .board { row-gap: 88px; }
  .piece--jacket, .piece--skirt, .piece--cap, .piece--lily,
  .piece--pumpkin, .piece--deer, .piece--sketch { grid-column: 1; margin-top: 0; }
  .piece--jacket, .piece--lily, .piece--deer { width: 92%; justify-self: end; }
  .piece--cap, .piece--sketch { width: 80%; }
  /* пометки остаются на углу полароида, как надпись ручкой на странице */
  .piece--jacket .margin-note { right: 6px; top: -46px; font-size: 1.4rem; transform: rotate(4deg); }
  .piece--skirt .margin-note { left: 6px; top: -46px; font-size: 1.4rem; transform: rotate(-4deg); }

  .offers, .diary { grid-column: 1; }
  .diary { transform: rotate(.8deg); padding: 48px 22px 32px 66px; }
  .diary::before { left: 46px; }

  .pola--portrait { grid-column: 1; width: min(80%, 420px); justify-self: center; }
  .about-text { grid-column: 1; }

  .viewer[open] { grid-template-columns: minmax(0, 1fr); grid-template-rows: minmax(0, 1fr) auto; }
  .viewer-stage { padding: 76px 14px 12px; }
  .viewer-img { max-height: calc(100dvh - 330px); }
  .viewer-info { padding: 20px var(--gutter) calc(22px + env(safe-area-inset-bottom)); border-left: 0; border-top: 1px solid var(--night-line); gap: 10px; }
  .viewer-title { font-size: 1.6rem; }
  .viewer-controls { top: 14px; right: var(--gutter); }
}

@media (max-width: 480px) {
  body { font-size: 16.5px; }
  .lead { font-size: 17px; }
  .actions .btn { width: 100%; justify-content: center; }
  .piece--jacket, .piece--lily, .piece--deer { width: 96%; }
  .piece--cap, .piece--sketch { width: 86%; }
  .foot-row { flex-direction: column; align-items: flex-start; }
}

/* ---------- 3D: переворот полароида ---------- */
.flip {
  position: relative;
  perspective: 1600px;
  transform: rotate(var(--r, 0deg));
  transition: transform .7s var(--ease);
}
.flip-inner {
  display: grid;
  transform-style: preserve-3d;
  transition: transform 1s cubic-bezier(.3, 1.25, .4, 1);
}
.flip-inner > * {
  grid-area: 1 / 1;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.flip .pola,
.flip button.pola:hover,
.flip button.pola:focus-visible { transform: none; }
.flip:hover { transform: rotate(0deg) translateY(-6px); }
.flip:hover .pola { box-shadow: 0 3px 5px rgba(0, 0, 0, .16), 0 30px 60px rgba(0, 0, 0, .34); }
.flip.is-flipped .flip-inner { transform: rotateY(180deg); }

/* оборот — тёмный, как у настоящего полароида, надпись маркером */
.pola-back {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 26px 24px 70px;
  transform: rotateY(180deg);
  color: var(--cream);
  background:
    radial-gradient(ellipse at 30% 20%, rgba(184, 93, 117, .14), transparent 60%),
    repeating-linear-gradient(90deg, rgba(255, 255, 255, .018) 0 1px, transparent 1px 4px),
    #1c1a1e;
  box-shadow: 0 2px 3px rgba(0, 0, 0, .18), 0 18px 40px rgba(0, 0, 0, .32);
}
.pola-back .label { color: var(--muted-n); }
.back-text {
  font-size: clamp(1.45rem, 2.2vw, 1.95rem);
  line-height: 1.25;
  transform: rotate(-1.5deg);
  text-wrap: pretty;
}
.want--back { margin-top: auto; color: var(--rose); align-self: flex-start; }

.flip-btn {
  position: absolute;
  right: 6px;
  bottom: 1px;
  z-index: 6;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 44px;
  height: 44px;
  padding: 0 8px;
  border: 0;
  background: transparent;
  color: var(--wine);
  cursor: pointer;
  transition: color .3s var(--ease);
}
.flip-word { font-size: 19px; line-height: 1; transform: rotate(-3deg); }
.flip-btn svg {
  width: 22px;
  height: 22px;
  stroke-width: 2;
  transition: transform .9s cubic-bezier(.3, 1.25, .4, 1);
}
.flip-btn:hover svg { transform: rotate(-35deg); }
.flip.is-flipped .flip-btn { color: var(--cream); }
.flip.is-flipped .flip-btn svg { transform: rotate(180deg); }

/* ---------- 3D: глубина вещей на первом экране ---------- */
.bed {
  transform: perspective(1100px) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg));
  transform-style: preserve-3d;
  will-change: transform;
}
.bed .pola--lily { translate: 0 0 0; }
.bed .pola--cap { translate: 0 0 45px; }
.bed .thrown { translate: 0 0 90px; }

/* ---------- 3D-архив ---------- */
.ring { padding-bottom: clamp(40px, 6vw, 90px); overflow: hidden; }
.ring .sec-head { margin-bottom: 0; }
.ring-stage {
  position: relative;
  height: clamp(420px, 74svh, 720px);
  margin-top: clamp(-70px, -4vw, -10px);
}
.ring-stage::before {
  content: "";
  position: absolute;
  inset: 10% 15%;
  z-index: -1;
  background: radial-gradient(ellipse at 50% 55%, rgba(184, 93, 117, .2), transparent 65%);
  filter: blur(20px);
  pointer-events: none;
}
.ring-stage canvas { display: block; width: 100%; height: 100%; }
@media (max-width: 860px) {
  .ring-stage { height: clamp(380px, 60svh, 560px); margin-top: 8px; }

  /* на телефоне слои мельче по глубине и не выходят за край экрана */
  .bed .pola--cap { translate: 0 0 20px; }
  .bed .thrown { translate: 0 0 40px; }
  .thrown--skirt { width: 58%; right: 7%; }
  @keyframes throw {
    from { transform: translate(14px, -30px) rotate(20deg); opacity: .15; }
    to   { transform: rotate(9deg); opacity: 1; }
  }
}

/* ---------- 3D-переходы при прокрутке ---------- */
.js [data-3d] {
  transition: transform 1.1s var(--ease), opacity .8s var(--ease);
  transform-origin: 50% 0;
}
.js [data-3d]:not(.is-in) { opacity: .001; }
/* нижний край уходит от зрителя: карточка становится меньше, а не шире экрана */
.js [data-3d="drop"]:not(.is-in) { transform: perspective(900px) translateY(70px) rotateX(-52deg) rotate(var(--r, 0deg)); }
.js [data-3d="page"]:not(.is-in) { transform: perspective(1200px) rotateX(-38deg) translateY(30px); }
.js [data-3d="rise"]:not(.is-in) { transform: perspective(900px) translateZ(-160px) translateY(40px); }
.js .flip[data-3d].is-in { transform: rotate(var(--r, 0deg)); }
.js .flip[data-3d].is-in:hover { transform: rotate(0deg) translateY(-6px); }

/* ---------- меню и нижняя кнопка (телефон) ---------- */
.nav-right { display: flex; align-items: center; gap: 8px; }
.menu-btn {
  display: none;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid #3a3539;
  border-radius: 2px;
  background: transparent;
  color: var(--cream);
  cursor: pointer;
}
.menu-btn svg { width: 22px; height: 22px; stroke-width: 2; }

.menu {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
  overflow: visible;
}
.menu::backdrop { background: rgba(10, 10, 12, .72); }
.menu-sheet {
  position: relative;
  display: grid;
  align-content: start;
  justify-items: start;
  gap: 0;
  padding: 12px var(--gutter) 40px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 30px 60px rgba(0, 0, 0, .5);
}
.menu-sheet::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -21px;
  height: 22px;
  background: var(--paper);
  transform: scaleY(-1);
  -webkit-mask: url("assets/tear-a.svg") 0 0 / 100% 100% no-repeat;
  mask: url("assets/tear-a.svg") 0 0 / 100% 100% no-repeat;
}
.menu[open] .menu-sheet { animation: sheet-in .55s var(--ease) both; }
.menu-top { display: flex; align-items: center; justify-content: space-between; width: 100%; min-height: 52px; }
.menu-links { margin-top: 18px; }
.menu-links a {
  display: block;
  padding-block: 4px;
  font: 800 clamp(2.6rem, 12vw, 3.6rem)/1.05 var(--f-sans);
  letter-spacing: -.04em;
}
.menu-links a:active { color: var(--rose); }
.menu-note { margin-top: 22px; font-size: 1.45rem; color: var(--wine); transform: rotate(-2deg); }
.menu-cta { margin-top: 18px; width: 100%; justify-content: center; }
.menu-tiktok { margin-top: 6px; text-decoration-color: var(--wine); }
.icon-btn--paper { background: transparent; border-color: var(--paper-line); color: var(--ink); }
@keyframes sheet-in { from { transform: translateY(-104%); } to { transform: none; } }

.dock { display: none; }

@media (max-width: 860px) {
  .menu-btn { display: grid; }
  .nav-right .btn--small { display: none; }
  /* логотип в шапке появляется, когда большой логотип уехал */
  .nav > .nav-mark { opacity: 0; pointer-events: none; transition: opacity .4s var(--ease); }
  .nav.is-solid > .nav-mark { opacity: 1; pointer-events: auto; }

  .dock {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 45;
    display: block;
    padding: 10px var(--gutter) calc(10px + env(safe-area-inset-bottom));
    background: linear-gradient(to top, rgba(18, 18, 20, .96) 60%, rgba(18, 18, 20, 0));
    transform: translateY(110%);
    transition: transform .5s var(--ease);
  }
  .dock.is-on { transform: none; }
  .dock-btn { width: 100%; justify-content: center; min-height: 54px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
  .foot-row { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }

  /* отклик на касание вместо наведения */
  button.pola:active { transform: rotate(0deg) scale(.985); transition-duration: .2s; }
  .btn:active, .want:active, .link:active { opacity: .85; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
