/* MAISON CRASSE — DROP 001
   Ne pas laver. Jamais. */

:root {
  --paper: #F5F3EE;
  --ink:   #111111;
  --bone:  #E7E2D7;
  --soot:  #2B2927;
  --rust:  #B5532A;

  --brand:  "Archivo", "Arial Black", Arial, sans-serif;           /* лише латиниця */
  --serif:  "Cormorant Garamond", Garamond, "Times New Roman", serif; /* кирилиця + латиниця */
  --script: "Pinyon Script", "Snell Roundhand", cursive;            /* лише «Club Privé» */
  --mono:   "IBM Plex Mono", ui-monospace, Menlo, Consolas, monospace; /* текст бирок */

  --g: clamp(16px, 4.2vw, 56px);  /* бокове поле */
  --bar-h: 56px;
  --grime: 0;
}

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

html {
  background: var(--paper);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  position: relative;
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: clamp(18px, 1rem + .3vw, 22px);
  line-height: 1.5;
  font-kerning: normal;
  font-variant-numeric: lining-nums;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

/* Зернистість газетного паперу */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  background: url("/assets/tex/grain.svg") 0 0 / 260px 260px;
  opacity: .24;
}

p, h1, h2, h3, ul { margin: 0; }
ul { padding: 0; list-style: none; }
a { color: inherit; }
img, svg, canvas { display: block; }
button, input { font: inherit; color: inherit; }

::selection { background: var(--soot); color: var(--bone); }

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

.brand {
  font-family: var(--brand);
  font-stretch: 125%;
  font-weight: 800;
  letter-spacing: -.015em;
  font-synthesis: none;
}

.tag {
  font-family: var(--mono);
  font-size: 12px;
  line-height: 1.6;
  letter-spacing: 0;
}

.script { font-family: var(--script); font-weight: 400; }

.sr-only {
  position: absolute !important;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
}

.skip {
  position: fixed;
  left: var(--g);
  top: 8px;
  z-index: 200;
  padding: 10px 14px;
  background: var(--ink);
  color: var(--paper);
  transform: translateY(-160%);
}
.skip:focus { transform: none; }

/* ─────────────────────────── Верхня смуга */

.bar {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 12px;
  height: calc(var(--bar-h) + env(safe-area-inset-top));
  padding: env(safe-area-inset-top) var(--g) 0;
  background: var(--paper);
  transition: box-shadow .4s;
}
.bar.is-scrolled { box-shadow: 0 1px 0 rgba(17, 17, 17, .12); }

.bar__count {
  font-size: 11px;
  white-space: nowrap;
  color: var(--soot);
}

.bar__logo {
  font-size: 12px;
  line-height: 1;
  text-decoration: none;
  white-space: nowrap;
  opacity: 0;
  visibility: hidden;
  transition: opacity .4s, visibility .4s;
}
.bar.is-scrolled .bar__logo { opacity: 1; visibility: visible; }

.wash {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  background: transparent;
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
}
.wash:hover { background: var(--ink); color: var(--paper); }
.wash__icon { fill: none; stroke: currentColor; stroke-width: 1.4; }
.wash__x { opacity: 0; }
.wash__stack { display: grid; }
.wash__stack > * { grid-area: 1 / 1; text-align: center; }
.wash__no { visibility: hidden; }
.wash.is-refusing { background: var(--ink); color: var(--paper); }
.wash.is-refusing .wash__label { visibility: hidden; }
.wash.is-refusing .wash__no { visibility: visible; }
.wash.is-refusing .wash__x { opacity: 1; }
.wash.is-refusing .wash__icon { animation: refuse .5s cubic-bezier(.3, 0, .2, 1); }
@keyframes refuse {
  20% { transform: rotate(-14deg); }
  45% { transform: rotate(11deg); }
  70% { transform: rotate(-6deg); }
}

@media (max-width: 380px) {
  .bar { grid-template-columns: 1fr auto; }
  .bar__logo { display: none; }
}

/* ─────────────────────────── 1. Перший екран */

.hero {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(var(--bar-h) + env(safe-area-inset-top) + 24px) var(--g) clamp(20px, 3vw, 36px);
}

.hero__main { margin-block: auto; padding-block: 6vh 4vh; }

.hero__top {
  display: flex;
  justify-content: space-between;
  margin-bottom: clamp(10px, 1.4vw, 22px);
  font-style: italic;
  font-size: clamp(18px, 1.7vw, 26px);
  line-height: 1;
  color: var(--soot);
}

.logo {
  font-family: var(--brand);
  font-stretch: 125%;
  font-weight: 800;
  letter-spacing: -.015em;
  line-height: .84;
  font-synthesis: none;
  /* до завантаження шрифту — оцінка; точний розмір підганяє main.js */
  font-size: calc((100vw - 2 * var(--g)) / 4.9);
}
.fit { display: inline-block; white-space: nowrap; }
.logo__line { display: block; overflow: hidden; padding: .03em 0; margin: -.03em 0; }
.logo__line > span { display: block; animation: rise 1.25s cubic-bezier(.16, .84, .22, 1) both; }
.logo__line + .logo__line > span { animation-delay: .09s; }
@keyframes rise { from { transform: translateY(104%); } }

@media (min-width: 720px) {
  .logo { font-size: calc((100vw - 2 * var(--g)) / 9.9); }
  .logo__line { display: inline-block; vertical-align: top; }
}

.hero__drop {
  display: grid;
  gap: 18px;
  margin-top: clamp(22px, 3.4vw, 48px);
}

.drop-title {
  font-size: clamp(14px, 1.25vw, 19px);
  line-height: 1.2;
}
.when-now, .drop-live, .drop-never { display: none; }

.count {
  display: grid;
  grid-template-columns: repeat(4, auto);
  justify-content: start;
  column-gap: clamp(18px, 3.4vw, 56px);
}
.count__cell { display: grid; gap: 6px; }
.count__n {
  font-family: var(--brand);
  font-stretch: 125%;
  font-weight: 300;
  font-size: clamp(40px, 10.5vw, 104px);
  line-height: .9;
  letter-spacing: -.02em;
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
}
.count__u {
  font-style: italic;
  font-size: 16px;
  line-height: 1;
  color: var(--soot);
}

@media (min-width: 720px) {
  .hero__drop { grid-template-columns: 1fr auto; align-items: end; }
  .drop-title { padding-bottom: 28px; }
}

.is-dropped .when-soon,
.is-dropped .count { display: none; }
.is-dropped .when-now { display: inline; }
.is-dropped .drop-live {
  display: inline-block;
  font-size: clamp(24px, 3vw, 40px);
  font-style: italic;
  text-underline-offset: .18em;
  text-decoration-thickness: 1px;
}
.no-date .count { display: none; }
.no-date .drop-never { display: block; font-style: italic; font-size: clamp(22px, 2.4vw, 32px); }

.hero__hint {
  max-width: 30ch;
  font-style: italic;
  font-size: 16px;
  line-height: 1.35;
  color: var(--soot);
}

/* ─────────────────────────── 2. Тизер */

.teaser { padding: clamp(96px, 16vw, 220px) var(--g) clamp(96px, 14vw, 200px); }

.teaser__head {
  display: grid;
  gap: 24px;
  margin-bottom: clamp(56px, 9vw, 130px);
}
.teaser__title {
  max-width: 11ch;
  font-weight: 400;
  font-size: clamp(44px, 7vw, 112px);
  line-height: .96;
  letter-spacing: -.02em;
}
.teaser__lede {
  max-width: 34ch;
  font-size: clamp(19px, 1.45vw, 23px);
  line-height: 1.45;
  color: var(--soot);
}
@media (min-width: 960px) {
  .teaser__head { grid-template-columns: 1.5fr 1fr; align-items: end; column-gap: 48px; }
  .teaser__lede { padding-bottom: .5em; }
}

.rack { display: grid; gap: 72px; }
.piece { width: 86%; max-width: 520px; }
.piece:nth-child(even) { margin-left: auto; }

@media (min-width: 760px) {
  .rack {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    column-gap: clamp(16px, 2.2vw, 36px);
    align-items: start;
  }
  .piece, .piece:nth-child(even) { width: auto; max-width: none; margin-left: 0; }
  .piece:nth-child(2) { margin-top: clamp(72px, 11vw, 180px); }
  .piece:nth-child(3) { margin-top: clamp(24px, 4vw, 64px); }
}

.piece__glass {
  position: relative;
  isolation: isolate;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: var(--soot);
  touch-action: pan-y;
  cursor: crosshair;
}
.piece__img {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(13px) grayscale(.6);
  transform: scale(1.12);
}
/* брудне скло */
.piece__glass::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: url("/assets/tex/haze.svg") center / cover, rgba(43, 41, 39, .12);
  pointer-events: none;
}
.piece__wipe { position: absolute; inset: 0; z-index: 2; width: 100%; height: 100%; }
.piece__stamp {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 3;
  transform: translate(-50%, -50%);
  font-size: clamp(15px, 1.5vw, 22px);
  color: var(--bone);
  pointer-events: none;
}

/* підвісна бирка */
.piece__tag {
  position: relative;
  z-index: 4;
  width: 76%;
  margin: -30px 0 0 14px;
  padding: 28px 18px 16px;
  background: var(--bone);
  box-shadow: inset 0 0 0 1px rgba(17, 17, 17, .07);
  transform: rotate(-1.4deg);
  transform-origin: 50% 0;
}
.piece:nth-child(2) .piece__tag { transform: rotate(1deg); margin-left: auto; margin-right: 14px; }
.piece:nth-child(3) .piece__tag { transform: rotate(-.6deg); }
.piece__tag::before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  width: 9px;
  height: 9px;
  margin-left: -4.5px;
  border-radius: 50%;
  background: var(--paper);
  box-shadow: inset 0 1px 1px rgba(17, 17, 17, .25);
}
.piece__name {
  margin-bottom: 10px;
  font-weight: 400;
  font-size: 17px;
  line-height: 1.2;
}
.piece__name .brand { font-size: 15px; }
.piece__title { font-style: italic; font-size: 19px; white-space: nowrap; }
.piece__tag .tag { color: var(--soot); }

.is-dropped .piece__img { filter: none; transform: none; }
.is-dropped .piece__glass { cursor: auto; }
.is-dropped .piece__glass::before,
.is-dropped .piece__wipe,
.is-dropped .piece__stamp { display: none; }

/* ─────────────────────────── Потрісканий принт */

.print {
  padding: clamp(80px, 13vw, 190px) var(--g) clamp(64px, 10vw, 150px);
  background: var(--soot);
  color: var(--bone);
}
.print__type {
  line-height: .86;
  -webkit-mask-image: url("/assets/tex/crack.svg");
          mask-image: url("/assets/tex/crack.svg");
  -webkit-mask-size: 520px 520px;
          mask-size: 520px 520px;
}
.print__line { display: block; font-size: calc((100vw - 2 * var(--g)) / 9.9); }
.print__line + .print__line { margin-top: .04em; }
@media (min-width: 900px) {
  .print__type { -webkit-mask-size: 760px 760px; mask-size: 760px 760px; }
}
.print__note {
  margin-top: clamp(32px, 5vw, 64px);
  font-style: italic;
  font-size: clamp(20px, 1.8vw, 28px);
  color: var(--bone);
  opacity: .78;
}

/* ─────────────────────────── 3. Club Privé */

.club {
  display: grid;
  gap: clamp(40px, 6vw, 64px);
  padding: clamp(96px, 16vw, 220px) var(--g);
}
.club__title {
  margin-left: -.04em;
  font-family: var(--script);
  font-weight: 400;
  font-size: clamp(84px, 19vw, 260px);
  line-height: .95;
  letter-spacing: 0;
}
.club__lede {
  max-width: 30ch;
  margin-top: clamp(18px, 2.4vw, 32px);
  font-size: clamp(21px, 1.8vw, 27px);
  line-height: 1.4;
}

@media (min-width: 980px) {
  .club { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); column-gap: clamp(48px, 7vw, 140px); align-items: start; }
  .club__join { padding-top: clamp(24px, 5vw, 96px); }
}

.club__join { max-width: 520px; }

.field { display: grid; gap: 4px; margin-bottom: 28px; }
.field label { font-style: italic; font-size: 17px; color: var(--soot); }
.field input {
  width: 100%;
  padding: 8px 0 10px;
  font-size: 22px;
  line-height: 1.3;
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--ink);
  border-radius: 0;
  -webkit-appearance: none;
  appearance: none;
}
.field input:focus { outline: none; border-bottom: 2px solid var(--ink); padding-bottom: 9px; }
.field input:focus-visible { outline: 2px solid var(--rust); outline-offset: 6px; }

.hp { position: absolute; left: -9999px; width: 1px; height: 1px; opacity: 0; }

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .35em;
  width: 100%;
  min-height: 60px;
  padding: 6px 28px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 21px;
  line-height: 1;
  text-decoration: none;
  border: 1px solid var(--ink);
  border-radius: 0;
  cursor: pointer;
  transition: background-color .2s, color .2s;
}
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--soot); }
.btn--ink:disabled { cursor: progress; background: var(--soot); }
.btn--line { background: transparent; color: var(--ink); }
.btn--line:hover { background: var(--ink); color: var(--paper); }
.btn .script { font-size: 1.5em; line-height: .8; padding-top: .08em; }
@media (min-width: 560px) { .btn { width: auto; } }

.form__status { min-height: 1.5em; margin-top: 14px; font-style: italic; font-size: 18px; }
.form__status[data-kind="error"] { color: var(--rust); }
.form__fine { max-width: 40ch; margin-top: 6px; font-size: 15px; line-height: 1.45; color: var(--soot); }

.club__tg { margin-top: clamp(40px, 5vw, 56px); }
.club__tg p { margin-bottom: 14px; font-style: italic; font-size: 18px; color: var(--soot); }

/* ─────────────────────────── 4. Футер-бірка */

.foot {
  display: grid;
  gap: 48px;
  padding: clamp(24px, 6vw, 80px) var(--g) calc(28px + env(safe-area-inset-bottom));
}

.label {
  position: relative;
  max-width: 560px;
  padding: 36px 30px 30px;
  background-color: var(--ink);
  background-image: url("/assets/tex/weave.svg");
  background-size: 6px 4px;
  color: var(--bone);
}
.label__stitch {
  position: absolute;
  inset: 9px;
  pointer-events: none;
  opacity: .8;
  background:
    url("/assets/tex/stitch-h.svg") left top    / 12px 2px repeat-x,
    url("/assets/tex/stitch-h.svg") left bottom / 12px 2px repeat-x,
    url("/assets/tex/stitch-v.svg") left top    / 2px 12px repeat-y,
    url("/assets/tex/stitch-v.svg") right top   / 2px 12px repeat-y;
}
.label__logo { font-size: clamp(22px, 5.6vw, 34px); line-height: .95; }
.label__lines { margin-top: 20px; font-size: 13px; line-height: 1.75; }
.care { display: flex; gap: 16px; margin-top: 22px; }
.care svg { width: 30px; height: 30px; fill: none; stroke: var(--bone); stroke-width: 1.4; stroke-linejoin: round; }
.care .x { stroke-width: 1.2; }
.label__unwashed { margin-top: 22px; font-size: 11px; color: var(--bone); opacity: .7; }

.foot__links { display: grid; align-content: end; }
.foot__link {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
  padding: 16px 0 12px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.1;
  text-decoration: none;
  border-bottom: 1px solid rgba(17, 17, 17, .85);
}
.foot__link:hover > span:first-child { font-style: italic; }
.foot__handle { font-style: italic; font-size: 18px; color: var(--soot); white-space: nowrap; }

.foot__legal { font-style: italic; font-size: 15px; color: var(--soot); }

@media (min-width: 880px) {
  .foot { grid-template-columns: minmax(0, 560px) minmax(0, 1fr); column-gap: clamp(48px, 8vw, 140px); align-items: end; }
  .foot__legal { grid-column: 1 / -1; }
}

/* ─────────────────────────── Відбитки, плями, бруд */

.marks {
  position: absolute;
  inset: 0;
  z-index: 40;
  overflow: hidden;
  pointer-events: none;
}
.marks::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("/assets/tex/grime.svg") 0 0 / 900px 900px;
  opacity: calc(var(--grime) * .9);
}
.mark {
  position: absolute;
  height: auto;
  max-width: none;
  transform: translate(-50%, -50%) rotate(var(--r, 0deg));
  user-select: none;
  -webkit-user-select: none;
}
.mark.is-fresh { animation: press .6s cubic-bezier(.2, .7, .2, 1) both; }
@keyframes press {
  from { opacity: 0; transform: translate(-50%, -50%) rotate(var(--r, 0deg)) scale(1.07); }
}

/* ─────────────────────────── 404 */

.lost {
  display: grid;
  align-content: center;
  gap: 28px;
  min-height: 100svh;
  padding: calc(var(--bar-h) + 24px) var(--g) 48px;
}
.lost__code { font-size: clamp(88px, 26vw, 360px); line-height: .82; }
.lost__text { max-width: 28ch; font-size: clamp(22px, 2vw, 30px); line-height: 1.35; }
.lost__back { font-style: italic; font-size: 20px; text-underline-offset: .2em; text-decoration-thickness: 1px; }

/* ─────────────────────────── Без руху */

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

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
  }
}
