/* Тема «Тушкийиз»: изумрудный бархат, цветная вышивка, лента-тасма с кисточками, пайетки.
   Подключается ПОСЛЕ invitation.css; имена переменных — от тёмной темы (--wine = фон страницы и т.д.).
   Правила для общих элементов привязаны к детали (конструктор): [data-base=tush] — страница, [data-cover=tush] —
   обложка, [data-env=tush] — конверт, [data-deco=tush] — украшения. Свои классы (.flora, .tasma, .sequins…) — без привязки.
   Анимации — transform / opacity; «прошивка» медальона — stroke-dashoffset, один раз. */

[data-base=tush] {
  --wine: #13352e;                       /* бархат */
  --deep: #0c2521;
  --gold: #d8b46a;
  --gold-soft: rgba(216, 180, 106, .5);
  --milk: #f6efe2;
  --milk-soft: rgba(246, 239, 226, .74);
  --paper: #f4ead6;
  --ink: #6a231c;                        /* на бумажной карточке — «красная нить» */
}
[data-deco=tush] { --glint: #e6c77f; }
html[data-base=tush] { background: var(--deep); }
[data-base=tush] main { background: var(--wine) url("/assets/velvet-904504a810aadb1d508d6d0341105013.webp") 0 0 / 256px; }
/* анкета и финал — тот же бархат, притенённый (не multiply: он уводит зелень в черноту) */
[data-base=tush] :is(.rsvp, .final:not(.has-photo)) { background: linear-gradient(rgba(5, 22, 18, .38), rgba(5, 22, 18, .38)), var(--wine) url("/assets/velvet-904504a810aadb1d508d6d0341105013.webp") 0 0 / 256px !important; }
[data-base=tush] :is(.snd, .scroll-cue, .lang-switch)::before { background: rgba(12, 37, 33, .75); }

/* ---------- Обложка ---------- */
[data-cover=tush] .cover { --milk: #f6efe2; --milk-soft: rgba(246, 239, 226, .74); --gold: #d8b46a; --gold-soft: rgba(216, 180, 106, .5); --glint: #e6c77f;  color: var(--milk); }
[data-cover=tush] { --cover-end: #13352e; }
/* бархат — своим цветом: обложка бывает и на странице другого оформления */
[data-cover=tush] .cover {
  background:
    radial-gradient(80% 55% at 50% 45%, rgba(40, 96, 80, .55), transparent 72%),
    #13352e url("/assets/velvet-904504a810aadb1d508d6d0341105013.webp") 0 0 / 256px;
}
[data-cover=tush] .cover.has-photo {
  background:
    linear-gradient(to bottom, rgba(12, 37, 33, .7) 0%, rgba(12, 37, 33, .4) 28%, rgba(12, 37, 33, .58) 58%, var(--wine) 100%),
    var(--photo) var(--photo-pos, center 30%) / var(--photo-size, cover) no-repeat;
}
.cover.has-photo .medallion { opacity: .55; }

/* стежки: светлая пунктирная «нить» поверх лепестков */
.st { fill: none; stroke: #f4e6c8; stroke-width: .9; stroke-dasharray: 2 1.6; opacity: .7; }

/* букеты по углам */
.flora { position: absolute; pointer-events: none; overflow: visible; width: calc(150px * var(--s)); height: calc(150px * var(--s)); z-index: 1; }
/* на обложке букет ограничен и высотой экрана: на коротких телефонах иначе заходит на подпись и дату */
.cover .flora { width: min(calc(150px * var(--s)), 18svh); height: min(calc(150px * var(--s)), 18svh); }
.cover .flora.tl { left: calc(-12px * var(--s)); top: calc(-12px * var(--s)); }
.cover .flora.br { right: calc(-12px * var(--s)); bottom: calc(-12px * var(--s)); transform: rotate(180deg); }
.flora.sm { width: calc(96px * var(--s)); height: calc(96px * var(--s)); opacity: .9; }
.flora.tr { right: calc(-10px * var(--s)); top: calc(10px * var(--s)); transform: scaleX(-1); }
.flora.bl { left: calc(-10px * var(--s)); bottom: calc(10px * var(--s)); transform: scaleY(-1); }
.final .flora.tl { left: calc(-22px * var(--s)); top: calc(-22px * var(--s)); width: calc(96px * var(--s)); height: calc(96px * var(--s)); }
/* нижний букет финала меньше и глубже в углу — не заходит на подпись */
.final .flora.br { right: calc(-22px * var(--s)); bottom: calc(-26px * var(--s)); width: calc(96px * var(--s)); height: calc(96px * var(--s)); transform: rotate(180deg); }
/* в секциях букет появляется целиком (html.io .a), на обложке — распускается по лепестку */
.cover .flora .p, .medallion .p {
  transform-box: fill-box; transform-origin: 50% 50%;
  animation: bloom .7s cubic-bezier(.34, 1.56, .64, 1) calc(.5s + var(--i) * .035s) both;
}
@keyframes bloom { from { opacity: 0; transform: scale(.2) rotate(-25deg); } to { opacity: 1; transform: none; } }

/* медальон: двойной круг «прошивается» по часовой стрелке */
.medallion { overflow: visible; }
.medallion .ring { fill: none; stroke: var(--gold); stroke-width: 1.6; stroke-dasharray: 1; stroke-dashoffset: 1; opacity: .8;
  transform: rotate(-90deg); animation: sew 2.6s cubic-bezier(.45, .05, .3, 1) .3s forwards; }
.medallion .ring.thin { stroke-width: .9; opacity: .5; animation-delay: .6s; }
@keyframes sew { to { stroke-dashoffset: 0; } }
/* поверх сплошного круга — пунктир стежков (маска не нужна: круг рисуется, стежки видны сквозь фон) */
.medallion .thread { stroke-dasharray: 3 1.4; }
.medallion .p { animation-delay: calc(1.2s + var(--i) * .03s); }
html.env-wait .flora .p, html.env-wait .medallion .p, html.env-wait .medallion .ring { animation-play-state: paused; }

/* ---------- Конверт: бархат с золотой строчкой ---------- */
/* клапаны — переменными: «Тёмный цвет» и «Акцент» из админки перекрашивают конверт (invitation.css) */
[data-env=tush] .flaps { --flap-side: #183f36; --flap-bottom: #1d493e; --flap-top1: #265a4c; --flap-top2: #1f4c40; --flap-line: #d8b46a; }
[data-env=tush] .flaps { --milk: #f6efe2; --milk-soft: rgba(246, 239, 226, .74); --gold: #d8b46a; --gold-soft: rgba(216, 180, 106, .5);  color: var(--milk); }
[data-env=tush] .f-side   { filter: drop-shadow(0 0 10px rgba(2, 12, 10, .45)); }
[data-env=tush] .f-bottom { filter: drop-shadow(0 -6px 14px rgba(2, 12, 10, .5)); }
[data-env=tush] .f-top    { filter: drop-shadow(0 10px 18px rgba(2, 12, 10, .6)); }
[data-env=tush] .flap-cast { background: linear-gradient(to bottom, rgba(2, 12, 10, .6), rgba(2, 12, 10, 0) 70%); }

/* ---------- Лента-тасма с кисточками ---------- */
.tasma { position: relative; z-index: 2; pointer-events: none; height: calc(80px * var(--s)); }
.tasma svg { display: block; width: 100%; height: 100%; overflow: visible; }
.tasma .stitch { fill: none; stroke: #f4e6c8; stroke-width: 1; stroke-dasharray: 3 2.5; opacity: .6; }
.tasma.to-deep { background: linear-gradient(transparent 0 30%, rgba(5, 22, 18, .38) 30%); }
.tasma.deep { background: rgba(5, 22, 18, .38); }
.tasma.from-deep { background: linear-gradient(var(--cover-end) 0 30%, transparent 30%); }
.tassel { transform-box: fill-box; transform-origin: 50% 0; animation: swing 3.4s ease-in-out var(--dl) infinite alternate; }
@keyframes swing { from { transform: rotate(-7deg); } to { transform: rotate(7deg); } }

/* ---------- Пайетки вместо искр: круглые, с бликом ---------- */
.sequins i { clip-path: none; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6d8, #d8b46a 55%, #8a6424); }
.sequins i:nth-child(3n) { background: radial-gradient(circle at 35% 30%, #ffd9cf, #c4493a 55%, #6e1f16); }
.sequins i:nth-child(4n) { background: radial-gradient(circle at 35% 30%, #e6f1ff, #6f95b8 55%, #2d4a66); }
.sequins i { animation-name: sequin; }
.sequins i::before { display: none; }
/* пайетки не гаснут до конца — поэтому только по краям, иначе лежат на тексте */
.sequins i:nth-child(3n+1) { display: none; }            /* пайетка — круг, без звёздочки общих искр */
@keyframes sequin {
  0%, 100% { opacity: .35; transform: scale(.55); }
  45%      { opacity: 1; transform: scale(1); }
  60%      { opacity: .5; transform: scale(.7); }
}
/* всплеск при открытии конверта — пайетками трёх цветов */
[data-env=tush] .burst { clip-path: none; border-radius: 50%; background: radial-gradient(circle at 35% 30%, #fff6d8, #d8b46a 55%, #8a6424); }
[data-env=tush] .burst:nth-child(3n) { background: radial-gradient(circle at 35% 30%, #ffd9cf, #c4493a 55%, #6e1f16); }
[data-env=tush] .burst:nth-child(4n) { background: radial-gradient(circle at 35% 30%, #e6f1ff, #6f95b8 55%, #2d4a66); }

/* ---------- Календарь, отсчёт ---------- */
html.io[data-base=tush] .cal .mark svg path { stroke-dasharray: 1; stroke-dashoffset: 1; }
html.io[data-base=tush] .a.in .cal .mark svg path { stroke-dashoffset: 0; transition: stroke-dashoffset 1.6s var(--ease-out) .7s; }
[data-base=tush] .circle { border-style: dashed; }

/* ---------- Карточка адреса: бумага с красной вышивкой ---------- */
[data-base=tush] .card { box-shadow: 0 24px 48px rgba(0, 0, 0, .45), 0 2px 6px rgba(0, 0, 0, .3); }
[data-base=tush] .card::before { border: 1px dashed rgba(106, 35, 28, .45); }
[data-base=tush] .pill { border-color: rgba(106, 35, 28, .55); }
[data-base=tush] .sw i { box-shadow: 0 0 0 1px var(--gold-soft), 0 0 0 5px var(--wine), 0 0 0 6px rgba(216, 180, 106, .3); }

[data-base=tush] .final.has-photo {
  background:
    linear-gradient(to bottom, rgba(12, 37, 33, .96) 0%, rgba(12, 37, 33, .55) 45%, rgba(12, 37, 33, .92) 100%),
    var(--photo) var(--photo-pos, center) / var(--photo-size, cover) no-repeat !important;
}

@media (prefers-reduced-motion: reduce) {
  .cover .flora .p, .medallion .p, .medallion .ring { animation: none !important; opacity: 1; transform: none; stroke-dashoffset: 0; }
  .medallion .ring { transform: rotate(-90deg); }
  .tassel { animation: none; }
  html.io[data-base=tush] .cal .mark svg path { stroke-dashoffset: 0 !important; transition: none !important; }
}
