/* TrimTime — паспорт клиента v3: «обложка журнала мастера».
   Без голограмм, градиентов и стеклянных плашек: настоящее фото, типографика, бумага. */
:root {
  --ink: #0d0d0f;
  --ink-2: #17171a;
  --line: rgba(243, 239, 230, .12);
  --paper: #f3efe6;
  --paper-2: #e7e1d4;
  --muted: rgba(243, 239, 230, .56);
  --accent: #9a8cff;          /* фирменный индиго TrimTime, светлее — чтобы читался на фото */
  --serif: 'Playfair Display', Georgia, serif;
  --cond: 'Oswald', 'Arial Narrow', sans-serif;
  --sans: 'Golos Text', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { background: var(--ink); color: var(--paper); }
body { font: 400 15px/1.45 var(--sans); -webkit-font-smoothing: antialiased; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { display: block; }

/* ───────── Обложка (масштабируется от ширины контейнера: 1cqw = 1% ширины) ───────── */
.cover {
  container-type: inline-size;
  position: relative;
  aspect-ratio: 9 / 16;
  overflow: hidden;
  background: #0a0a0a;
  isolation: isolate;
}
.cover__layer {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover;
  object-position: var(--px, 50%) 50%;
  transform: scale(var(--s, 1));
  transform-origin: 50% var(--oy, 100%);
}
.cover__shade {
  position: absolute; inset: 0; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(0,0,0,.5) 0%, rgba(0,0,0,0) 26%),
    linear-gradient(0deg, rgba(0,0,0,.78) 0%, rgba(0,0,0,.35) 30%, rgba(0,0,0,0) 52%);
}
.cover__grain {
  position: absolute; inset: -50%; pointer-events: none; z-index: 6;
  opacity: .1; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .5 0 0 0 0 .5 0 0 0 0 .5 0 0 0 1 0'/%3E%3C/filter%3E%3Crect width='160' height='160' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* верхняя строка над названием */
.cover__top {
  position: absolute; left: 5cqw; right: 5cqw; top: 4.6cqw; z-index: 4;
  display: flex; justify-content: space-between; align-items: baseline;
  font: 500 2.5cqw/1 var(--cond); letter-spacing: .16em; text-transform: uppercase;
  color: rgba(243, 239, 230, .86);
}
.cover__top b { font-weight: 600; color: var(--paper); }

/* название журнала = имя мастера; голова клиента стоит ПЕРЕД ним */
.cover__mast {
  position: absolute; left: 0; right: 0; top: var(--mt, 18cqw); z-index: 2;
  text-align: center; white-space: nowrap;
  font: 900 30cqw/.86 var(--serif);
  letter-spacing: -.035em;
  color: var(--paper);
  text-shadow: 0 .4cqw 3cqw rgba(0,0,0,.25);
}
.cover__cut { z-index: 3; }

/* номер клиента — справа под названием */
.cover__no {
  position: absolute; right: 5cqw; top: calc(var(--mt, 18cqw) + 36cqw); z-index: 4;
  text-align: right; font: 500 2.4cqw/1.35 var(--cond); letter-spacing: .14em; text-transform: uppercase;
  color: rgba(243, 239, 230, .82);
}
.cover__no strong {
  display: block; font: 600 9.5cqw/1 var(--cond); letter-spacing: -.01em; color: var(--paper);
  margin-bottom: .8cqw;
}
.cover__no strong span { font-size: .5em; vertical-align: .62em; margin-right: .4cqw; color: var(--accent); }

/* тема номера */
.cover__story { position: absolute; left: 5cqw; right: 26cqw; bottom: 6cqw; z-index: 4; }
.cover__kicker {
  font: 600 2.6cqw/1 var(--cond); letter-spacing: .2em; text-transform: uppercase; color: var(--accent);
  display: flex; align-items: center; gap: 2cqw;
}
.cover__kicker::after { content: ''; height: 1px; width: 10cqw; background: currentColor; opacity: .7; }
.cover__title {
  margin-top: 2cqw;
  font: italic 700 17cqw/.88 var(--serif); letter-spacing: -.02em; color: var(--paper);
}
.cover__lead { margin-top: 3cqw; font: 500 3.7cqw/1.25 var(--sans); color: var(--paper); }
.cover__lead em { font-style: normal; color: var(--muted); }
.cover__spec {
  margin-top: 2.4cqw; font: 500 2.3cqw/1.5 var(--mono); letter-spacing: .02em; text-transform: uppercase;
  color: rgba(243, 239, 230, .7);
}

/* «штрихкод» журнала = QR на запись к мастеру */
.cover__code {
  position: absolute; right: 5cqw; bottom: 6cqw; z-index: 4; width: 19cqw;
  background: var(--paper); color: var(--ink); padding: 1.6cqw 1.6cqw 1.2cqw;
}
.cover__qr { width: 100%; aspect-ratio: 1; }
.cover__qr canvas, .cover__qr img { width: 100% !important; height: 100% !important; image-rendering: pixelated; }
.cover__codeline {
  margin-top: 1cqw; display: flex; justify-content: space-between;
  font: 600 1.7cqw/1 var(--mono); letter-spacing: .02em;
}
.cover__credit {
  position: absolute; right: 5cqw; bottom: 1.8cqw; z-index: 4;
  font: 500 1.9cqw/1 var(--mono); color: rgba(243, 239, 230, .55); letter-spacing: .02em;
}

/* ───────── Режим «до / после»: две половины кадра ───────── */
.cover--ba .cover__half { position: absolute; left: 0; right: 0; overflow: hidden; }
.cover--ba .cover__half--a { top: 0; height: 50%; }
.cover--ba .cover__half--b { bottom: 0; height: 50%; }
/* кадр 2:3 в половине 9:8 — сдвигаем вверх, чтобы в окне была вся голова */
.cover--ba .cover__half img {
  position: absolute; left: 0; top: 0; width: 100%; height: auto;
  transform: translateY(var(--fy, -21%)) scale(1.06); transform-origin: 50% 45%;
}
.cover--ba .cover__half--b img { transform: translateY(-26%) scale(1.06); }
.cover__minimast {
  position: absolute; right: 5cqw; top: 5.4cqw; z-index: 4;
  font: 900 8cqw/1 var(--serif); letter-spacing: -.03em; color: var(--paper);
}
.cover__minimast small {
  display: block; margin-top: 1cqw; text-align: right;
  font: 500 2.1cqw/1 var(--cond); letter-spacing: .16em; text-transform: uppercase; color: rgba(243,239,230,.75);
}
.cover--ba .cover__half--a::after {
  content: ''; position: absolute; inset: 0; background: rgba(0,0,0,.18);
}
.cover__tag {
  position: absolute; left: 5cqw; z-index: 4;
  font: italic 700 13cqw/1 var(--serif); color: var(--paper); text-shadow: 0 .5cqw 4cqw rgba(0,0,0,.45);
}
.cover__tag small {
  display: block; margin-top: 1.4cqw; font: 600 2.4cqw/1 var(--cond); font-style: normal;
  letter-spacing: .2em; text-transform: uppercase; color: var(--accent);
}
.cover__tag--a { top: 5cqw; }
.cover__tag--b { top: calc(88.9cqw + 5cqw); }
.cover__seam {
  position: absolute; left: 0; right: 0; top: 50%; height: .5cqw; margin-top: -.25cqw; z-index: 4;
  background: var(--paper);
}
.cover--ba .cover__shade { background: linear-gradient(0deg, rgba(0,0,0,.75) 0%, rgba(0,0,0,0) 32%); }
.cover--ba .cover__story { right: 30cqw; }

/* ───────── Страница паспорта в приложении ───────── */
.app { max-width: 460px; margin: 0 auto; padding: 14px 16px 48px; }
.bar { display: flex; align-items: center; justify-content: space-between; height: 44px; }
.brand { font: 600 15px/1 var(--cond); letter-spacing: .22em; }
.pill {
  font: 500 11px/1 var(--cond); letter-spacing: .16em; text-transform: uppercase;
  padding: 7px 10px; border: 1px solid var(--line); border-radius: 99px; color: var(--muted);
}
.who { margin: 14px 0 16px; }
.who h1 { font: italic 700 34px/1.02 var(--serif); letter-spacing: -.01em; }
.who p { margin-top: 6px; color: var(--muted); font-size: 14px; }

.switch { display: flex; gap: 6px; margin-bottom: 12px; }
.switch button {
  flex: 1; height: 38px; border-radius: 10px; border: 1px solid var(--line);
  font: 500 12px/1 var(--cond); letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
}
.switch button[aria-pressed="true"] { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.switch button:disabled { opacity: .35; cursor: default; }

.hero { border-radius: 14px; overflow: hidden; box-shadow: 0 30px 60px -30px rgba(0,0,0,.9), 0 0 0 1px rgba(255,255,255,.06); }

.actions { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 14px; }
.btn {
  height: 52px; border-radius: 12px; border: 1px solid var(--line);
  font: 600 15px/1 var(--sans); display: flex; align-items: center; justify-content: center; gap: 8px;
}
.btn--main { grid-column: 1 / -1; background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn svg { width: 18px; height: 18px; }

.stats {
  display: grid; grid-template-columns: repeat(3, 1fr); margin-top: 22px;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.stat { padding: 14px 0 14px 12px; }
.stat + .stat { border-left: 1px solid var(--line); }
.stat:first-child { padding-left: 0; }
.stat b { display: block; font: 600 30px/1 var(--cond); }
.stat span { display: block; margin-top: 6px; font-size: 12px; line-height: 1.3; color: var(--muted); }

.sect { margin-top: 28px; display: flex; align-items: baseline; justify-content: space-between; }
.sect h2 { font: italic 700 24px/1 var(--serif); }
.sect span { font: 500 11px/1 var(--cond); letter-spacing: .16em; text-transform: uppercase; color: var(--muted); }

.archive { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.issue { text-align: left; }
.issue .cover { border-radius: 8px; box-shadow: 0 0 0 1px rgba(255,255,255,.06); transition: transform .2s; }
.issue:active .cover { transform: scale(.98); }
.issue[aria-current="true"] .cover { box-shadow: 0 0 0 2px var(--paper); }
.issue p { margin-top: 8px; font-size: 13px; }
.issue p span { color: var(--muted); }
.issue--next .cover {
  display: grid; place-items: center; text-align: center; background: var(--ink-2);
  border: 1px dashed rgba(243,239,230,.22); box-shadow: none;
}
.issue--next .cover div { padding: 0 10cqw; font: 500 6cqw/1.3 var(--sans); color: var(--muted); }
.issue--next .cover b { display: block; margin-bottom: 4cqw; font: italic 700 12cqw/1 var(--serif); color: var(--paper); }

.foot { margin-top: 30px; font-size: 12px; color: var(--muted); line-height: 1.5; }

/* ───────── Лист «Для мастера» — бумага, крупный шрифт ───────── */
.sheet { position: fixed; inset: 0; z-index: 20; display: none; }
.sheet[open] { display: block; }
.sheet__dim { position: absolute; inset: 0; background: rgba(0,0,0,.6); }
.sheet__paper {
  position: absolute; left: 0; right: 0; bottom: 0; max-width: 460px; margin: 0 auto;
  max-height: 92vh; overflow: auto;
  background: var(--paper); color: var(--ink); border-radius: 18px 18px 0 0;
  padding: 22px 20px 28px;
  animation: up .28s cubic-bezier(.2,.8,.2,1);
}
@keyframes up { from { transform: translateY(40px); opacity: 0; } }
.sheet__head { display: flex; justify-content: space-between; align-items: flex-start; }
.sheet__head small { font: 600 11px/1 var(--cond); letter-spacing: .18em; text-transform: uppercase; color: #6b665c; }
.sheet__head h3 { margin-top: 8px; font: italic 700 44px/1 var(--serif); }
.sheet__close { width: 40px; height: 40px; border-radius: 99px; background: rgba(13,13,15,.07); font-size: 20px; }
.sheet__meta { margin-top: 8px; font-size: 14px; color: #5d584f; }
.spec { margin-top: 18px; border-top: 2px solid var(--ink); }
.spec div { display: flex; justify-content: space-between; gap: 12px; padding: 13px 0; border-bottom: 1px solid rgba(13,13,15,.14); }
.spec dt { font: 600 13px/1.3 var(--cond); letter-spacing: .14em; text-transform: uppercase; color: #5d584f; padding-top: 4px; }
.spec dd { font: 600 22px/1.2 var(--sans); text-align: right; }
.note { margin-top: 16px; padding: 14px 16px; background: var(--paper-2); border-radius: 10px; font-size: 16px; line-height: 1.45; }
.note b { display: block; margin-bottom: 4px; font: 600 11px/1 var(--cond); letter-spacing: .16em; text-transform: uppercase; color: #6b665c; }
.shots { margin-top: 14px; }
.shots img { width: 100%; aspect-ratio: 4/5; object-fit: cover; object-position: 50% 70%; border-radius: 10px; }

.toast {
  position: fixed; left: 50%; bottom: 24px; transform: translateX(-50%); z-index: 30;
  background: var(--paper); color: var(--ink); padding: 12px 16px; border-radius: 10px; font-size: 14px;
  opacity: 0; pointer-events: none; transition: opacity .2s; max-width: calc(100% - 32px);
}
.toast.on { opacity: 1; }

/* отдельная страница для рендера сторис 1080×1920 */
.story-render { width: 1080px; }

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