/* Trycut — дизайн-система для веба (лендинг и будущая веб-версия приложения).
   Источник — iOS-приложение: Trycut/DesignSystem/Tokens.swift (TCColor, TCFont, TCSpace, TCRadius, TCSize)
   и design/HANDOFF.md, design/HANDOFF-screens.md («Дизайнер», 2–3.11.2026). Значения не менять в обход приложения.
   Правила:
   - золото (--tc-accent, текст чёрный) — только кнопки, которые тратят или покупают образы;
     ещё золото — ручка шторки, рамка выбранного цвета, контур арки;
   - бесплатная главная кнопка — «чернила» (--tc-free-fill);
   - заголовки — системный serif (New York на iPhone/Mac), конец фразы — курсивом цветом --tc-accent-text;
   - фото — в «арке-зеркале» с тонким золотым контуром внутри. */

/* ---------- токены ---------- */
:root {
  /* TCColor, светлая тема */
  --tc-background: #F3EBE1;
  --tc-surface: #FFFFFF;
  --tc-raised: #EAE0D3;
  --tc-text-primary: #1B1A20;
  --tc-text-secondary: #6B6158;
  --tc-divider: #E0D5C7;
  --tc-accent: #D4AF63;
  --tc-accent-pressed: #BF9A4E;
  --tc-accent-text: #7F5C1E;
  --tc-on-accent: #000000;
  --tc-free-fill: #1B1A20;
  --tc-on-free-fill: #FFFFFF;
  --tc-hairline: #CDB27A;
  --tc-emblem: #A07A35;
  --tc-error: #C42B3A;
  --tc-success: #1E7B48;
  --tc-contour: rgba(212, 175, 99, .85);   /* контур арки: accent 85 % */
  /* TCOverlay — подписи и кнопки на фото */
  --tc-overlay-backing: rgba(0, 0, 0, .6);
  --tc-overlay-text: #FFFFFF;
  --tc-scrim: rgba(18, 16, 20, .42);       /* затемнение под листом (пейвол) */

  /* TCFont: заголовки — системный serif medium, текст — системный */
  --tc-font-serif: ui-serif, "New York", "Iowan Old Style", Georgia, "Noto Serif", "Times New Roman", serif;
  --tc-font-text: -apple-system, BlinkMacSystemFont, system-ui, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --tc-weight-serif: 500;
  /* кегли из HANDOFF-screens: экран 36/40, лист 30/36, секция 22–25, текст 17, подпись 13 */
  --tc-size-display: clamp(34px, 8.4vw, 56px);
  --tc-size-sheet: 30px;
  --tc-size-section: clamp(26px, 6vw, 38px);
  --tc-size-body: 17px;
  --tc-size-label: 15px;
  --tc-size-caption: 13px;

  /* TCSpace, TCRadius, TCSize */
  --tc-space-edge: 16px;
  --tc-space-block: 12px;
  --tc-space-section: 24px;
  --tc-radius-card: 16px;
  --tc-radius-chip: 10px;
  --tc-radius-button: 14px;
  --tc-radius-sheet: 30px;
  --tc-button-height: 54px;
  --tc-min-touch: 44px;
  --tc-motion: .25s ease-out;               /* TCMotion.ui */

  color-scheme: light;
}

/* TCColor, тёмная тема — по настройке системы или data-theme="dark" на <html> */
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --tc-background: #121014; --tc-surface: #1C1A1F; --tc-raised: #26232A;
    --tc-text-primary: #F3EBE1; --tc-text-secondary: #A89F95; --tc-divider: #2E2A31;
    --tc-accent-text: #E2C27A; --tc-free-fill: #F3EBE1; --tc-on-free-fill: #121014;
    --tc-hairline: #8C7240; --tc-emblem: #D4AF63; --tc-error: #FF6B6B; --tc-success: #4CD47F;
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --tc-background: #121014; --tc-surface: #1C1A1F; --tc-raised: #26232A;
  --tc-text-primary: #F3EBE1; --tc-text-secondary: #A89F95; --tc-divider: #2E2A31;
  --tc-accent-text: #E2C27A; --tc-free-fill: #F3EBE1; --tc-on-free-fill: #121014;
  --tc-hairline: #8C7240; --tc-emblem: #D4AF63; --tc-error: #FF6B6B; --tc-success: #4CD47F;
  color-scheme: dark;
}

/* ---------- основа ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background: var(--tc-background); color: var(--tc-text-primary);
  font: 400 var(--tc-size-body)/1.45 var(--tc-font-text); -webkit-font-smoothing: antialiased;
}
[hidden] { display: none !important; }
img { display: block; max-width: 100%; height: auto; }
a { color: var(--tc-accent-text); }
p { margin: 0; }
h1, h2, h3 { margin: 0; text-wrap: balance; }
.tc-serif, .tc-display, .tc-title, .tc-sheet-title {
  font-family: var(--tc-font-serif); font-weight: var(--tc-weight-serif); letter-spacing: -.01em;
}
.tc-display { font-size: var(--tc-size-display); line-height: 1.1; }
.tc-title { font-size: var(--tc-size-section); line-height: 1.15; }
.tc-sheet-title { font-size: var(--tc-size-sheet); line-height: 1.2; }
/* конец фразы — курсивом тёмным золотом */
.tc-serif em, .tc-display em, .tc-title em, .tc-sheet-title em { font-style: italic; color: var(--tc-accent-text); }
.tc-muted { color: var(--tc-text-secondary); }
.tc-caption { font-size: var(--tc-size-caption); line-height: 18px; color: var(--tc-text-secondary); }
.tc-dot { color: var(--tc-accent); }
.tc-sr { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0; }
:focus-visible { outline: 2px solid var(--tc-accent-text); outline-offset: 3px; }

/* ---------- кнопки: капсулы 54 ---------- */
.tc-btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: var(--tc-button-height); padding: 0 28px; border: 0; border-radius: 999px;
  font-family: var(--tc-font-text); font-size: 17px; line-height: 22px; font-weight: 600;
  text-decoration: none; cursor: pointer; -webkit-tap-highlight-color: transparent;
  transition: background var(--tc-motion), transform .15s ease-out, box-shadow var(--tc-motion);
}
.tc-btn:active { transform: scale(.98); }
.tc-btn svg { flex: none; }
.tc-btn--ink { background: var(--tc-free-fill); color: var(--tc-on-free-fill); }        /* бесплатная главная */
.tc-btn--ink:hover { box-shadow: 0 8px 22px -10px rgba(27, 26, 32, .6); }
.tc-btn--gold { background: var(--tc-accent); color: var(--tc-on-accent); }             /* тратит или покупает образы */
.tc-btn--gold:hover, .tc-btn--gold:active { background: var(--tc-accent-pressed); }
.tc-btn--line { background: transparent; color: var(--tc-text-primary); box-shadow: inset 0 0 0 1px var(--tc-hairline); } /* второстепенная */
.tc-btn--line:hover { background: var(--tc-surface); }
.tc-btn--cream { background: #F3EBE1; color: #121014; }                                 /* главная на тёмном экране фото */
.tc-btn--wide { width: 100%; }
.tc-btn[disabled] { opacity: .6; cursor: progress; }

/* капсула-плашка «3 free looks» и круглая кнопка шапки 40 */
.tc-pill {
  display: inline-flex; align-items: center; gap: 7px; height: 34px; padding: 0 14px; border: 0; border-radius: 17px;
  background: transparent; box-shadow: inset 0 0 0 1px var(--tc-hairline); color: var(--tc-accent-text);
  font: 600 13px/18px var(--tc-font-text); text-decoration: none; cursor: pointer; white-space: nowrap;
}
.tc-round {
  width: 40px; height: 40px; border: 0; border-radius: 50%; display: inline-flex; align-items: center; justify-content: center;
  background: transparent; box-shadow: inset 0 0 0 1px var(--tc-hairline); color: var(--tc-text-primary); cursor: pointer;
}

/* ---------- арка-зеркало (фото, карточки, миниатюры), пропорция 3:4 ---------- */
/* верхние углы = половина ширины: по горизонтали 50 %, по вертикали 37,5 % высоты (3:4) */
.tc-arch {
  --foot: 22px;
  position: relative; aspect-ratio: 3 / 4; overflow: hidden; background: var(--tc-raised);
  border-radius: 50% 50% var(--foot) var(--foot) / 37.5% 37.5% var(--foot) var(--foot);
  isolation: isolate;
}
.tc-arch > img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.tc-arch::after {   /* тонкий золотой контур внутри: отступ 7, линия 1, accent 85 % */
  content: ""; position: absolute; inset: var(--inset, 7px); z-index: 3; pointer-events: none;
  border-radius: 50% 50% calc(var(--foot) - 6px) calc(var(--foot) - 6px) / 37.3% 37.3% calc(var(--foot) - 6px) calc(var(--foot) - 6px);
  box-shadow: inset 0 0 0 1px var(--tc-contour);
}
.tc-arch--sm { --foot: 14px; --inset: 4px; }

/* подписи на фото: Before / After */
.tc-tag {
  position: absolute; z-index: 4; padding: 4px 10px; border-radius: 999px;
  background: var(--tc-overlay-backing); color: var(--tc-overlay-text); font: 600 12px/16px var(--tc-font-text);
}

/* шторка «до/после»: золотая линия и ручка */
.tc-wipe { touch-action: pan-y; user-select: none; -webkit-user-select: none; cursor: ew-resize; }
.tc-wipe .tc-wipe-after { clip-path: inset(0 0 0 var(--pos, 50%)); }
.tc-wipe .tc-wipe-line { position: absolute; z-index: 2; top: 0; bottom: 0; left: var(--pos, 50%); width: 2px; margin-left: -1px; background: var(--tc-accent); }
.tc-wipe .tc-wipe-knob {
  position: absolute; z-index: 5; top: 58%; left: var(--pos, 50%); width: 40px; height: 40px; margin: -20px 0 0 -20px;
  border-radius: 50%; background: var(--tc-accent); color: #1B1A20; display: grid; place-items: center;
  box-shadow: 0 2px 10px rgba(0, 0, 0, .25);
}

/* ---------- прядь — декоративный разделитель ---------- */
.tc-strand { display: block; width: 132px; height: 16px; color: var(--tc-hairline); }
.tc-strand--short { width: 80px; height: 12px; }

/* ---------- эмблема (рисунок иконки) — цвет из токена через маску ---------- */
.tc-emblem {
  display: inline-block; width: var(--size, 96px); height: var(--size, 96px); flex: none; background: var(--tc-emblem);
  -webkit-mask: url(../img/trycut-art.svg) center / contain no-repeat; mask: url(../img/trycut-art.svg) center / contain no-repeat;
}

/* ---------- карточки, круги со значками, чипы, цвета ---------- */
.tc-card { background: var(--tc-surface); border-radius: var(--tc-radius-card); }
.tc-card--line { background: transparent; box-shadow: inset 0 0 0 1px var(--tc-hairline); }
.tc-icon-circle {
  width: 40px; height: 40px; flex: none; border-radius: 50%; display: grid; place-items: center;
  box-shadow: inset 0 0 0 1px var(--tc-hairline); color: var(--tc-accent-text);
}
.tc-chip {
  display: inline-flex; align-items: center; gap: 6px; min-height: 36px; padding: 0 14px; border-radius: 999px;
  box-shadow: inset 0 0 0 1px var(--tc-hairline); color: var(--tc-text-primary); font: 500 15px/20px var(--tc-font-text);
}
.tc-swatch { display: grid; justify-items: center; gap: 8px; font-size: var(--tc-size-caption); line-height: 16px; text-align: center; }
.tc-swatch i {
  width: 56px; height: 56px; border-radius: 50%; background: var(--c); display: block;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, .08);
}
.tc-swatch.is-on i { box-shadow: 0 0 0 3px var(--tc-background), 0 0 0 5px var(--tc-accent); }   /* выбранный — в золотом кольце */

/* ---------- пакеты (как пейвол) ---------- */
.tc-pack {
  position: relative; display: grid; gap: 4px; padding: 20px 18px 18px; border-radius: 20px;
  background: var(--tc-surface); color: var(--tc-text-primary);
}
.tc-pack.is-top { box-shadow: inset 0 0 0 2px var(--tc-accent); }
.tc-pack-n { font-family: var(--tc-font-serif); font-weight: var(--tc-weight-serif); font-size: 30px; line-height: 34px; }
.tc-pack-n small { font-family: var(--tc-font-text); font-size: 15px; color: var(--tc-text-secondary); margin-left: 4px; }
.tc-pack-price { font-size: 17px; line-height: 22px; font-weight: 600; }
.tc-pack-each { font-size: 12px; line-height: 16px; color: var(--tc-text-secondary); }
.tc-badge {
  position: absolute; right: 18px; top: -11px; height: 22px; padding: 0 10px; border-radius: 11px;
  background: var(--tc-accent); color: #1B1A20; display: inline-flex; align-items: center;
  font: 700 11px/14px var(--tc-font-text); letter-spacing: .04em; text-transform: uppercase;
}

/* ---------- лист (пейвол / окно) ---------- */
.tc-sheet {
  width: min(460px, 100vw); max-width: 100vw; max-height: calc(100dvh - 24px); margin: auto auto 0; padding: 0; border: 0;
  border-radius: var(--tc-radius-sheet) var(--tc-radius-sheet) 0 0; background: var(--tc-background); color: var(--tc-text-primary);
  box-shadow: 0 -20px 60px -20px rgba(0, 0, 0, .35); overflow: auto;
}
.tc-sheet::backdrop { background: var(--tc-scrim); }
.tc-sheet[open] { animation: tc-sheet-in .28s ease-out; }
@keyframes tc-sheet-in { from { transform: translateY(40px); } }
.tc-sheet-grab { display: block; width: 36px; height: 5px; margin: 8px auto 0; border-radius: 3px; background: var(--tc-hairline); }
@media (min-width: 640px) {
  .tc-sheet { margin: auto; border-radius: var(--tc-radius-sheet); box-shadow: 0 30px 80px -20px rgba(0, 0, 0, .45); }
  .tc-sheet-grab { display: none; }
}

/* ---------- поля ---------- */
.tc-field {
  width: 100%; min-height: var(--tc-button-height); padding: 0 18px; border: 0; border-radius: var(--tc-radius-button);
  background: var(--tc-surface); box-shadow: inset 0 0 0 1px var(--tc-hairline); color: var(--tc-text-primary);
  font: 400 17px/22px var(--tc-font-text);
}
.tc-field::placeholder { color: var(--tc-text-secondary); }
.tc-field:focus { outline: none; box-shadow: inset 0 0 0 2px var(--tc-accent); }
.tc-field[aria-invalid="true"] { box-shadow: inset 0 0 0 2px var(--tc-error); }
.tc-check { display: grid; grid-template-columns: 22px 1fr; gap: 10px; align-items: start; font-size: 14px; line-height: 20px; color: var(--tc-text-secondary); cursor: pointer; }
.tc-check input { width: 20px; height: 20px; margin: 0; accent-color: var(--tc-accent-text); }
.tc-error { color: var(--tc-error); font-size: 14px; line-height: 20px; }

@media (prefers-reduced-motion: reduce) {
  .tc-sheet[open] { animation: none; }
  .tc-btn { transition: none; }
}
