/* story2clip · "Premiere night"
   Every clip is a tiny film where someone gets top billing: velvet house lights,
   a champagne spotlight, and their name set in a warm, soft serif. */

/* --- Fonts (self-hosted, latin + latin-ext so Đorđe and Čedomir look right) ------------- */
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url("fonts/fraunces-latin-opsz-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fraunces"; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url("fonts/fraunces-latin-ext-opsz-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 300 900; font-display: swap;
  src: url("fonts/fraunces-latin-opsz-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Fraunces"; font-style: italic; font-weight: 300 900; font-display: swap;
  src: url("fonts/fraunces-latin-ext-opsz-italic.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url("fonts/figtree-latin-wght-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: "Figtree"; font-style: normal; font-weight: 300 900; font-display: swap;
  src: url("fonts/figtree-latin-ext-wght-normal.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+1E00-1E9F, U+20A0-20AB, U+20AD-20C0, U+2C60-2C7F, U+A720-A7FF; }

/* --- Tokens -------------------------------------------------------------------------------- */
:root {
  --velvet: #1A0D22;        /* house lights down */
  --velvet-deep: #12081A;
  --plum: #26142F;          /* surfaces */
  --plum-hi: #321B3D;       /* raised / hover */
  --line: rgba(255, 228, 240, .10);
  --line-strong: rgba(255, 228, 240, .20);
  --ivory: #FFF5E8;         /* text */
  --mauve: #BFA9C8;         /* secondary text */
  --mauve-dim: #8E7A9A;
  --gold: #F3CF8E;          /* champagne: the one accent that means "you" */
  --gold-hi: #FFE9BE;
  --gold-lo: #E2A35C;
  --rose: #FF6A95;          /* spotlight warmth */
  --rose-deep: #E8467A;
  --mint: #7CE3B9;
  --danger: #FF8A8A;
  --gold-grad: linear-gradient(135deg, var(--gold-hi) 0%, var(--gold) 46%, var(--gold-lo) 100%);
  --serif: "Fraunces", "Iowan Old Style", Georgia, serif;
  --sans: "Figtree", ui-sans-serif, system-ui, -apple-system, "Segoe UI", sans-serif;
  --r-phone: 30px;
  --r-panel: 28px;
  --r-card: 18px;
  --r-input: 14px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --wrap: 1180px;
  color-scheme: dark;
}

/* --- Base ---------------------------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-padding-top: 96px; -webkit-text-size-adjust: 100%; background: var(--velvet-deep); }
body {
  margin: 0;
  min-height: 100vh;
  overflow-x: clip; /* decorative glows may extend past narrow screens */
  color: var(--ivory);
  font: 400 17px/1.55 var(--sans);
  background:
    radial-gradient(900px 560px at 78% -6%, rgba(255, 106, 149, .20), transparent 62%),
    radial-gradient(760px 520px at 8% -10%, rgba(243, 207, 142, .10), transparent 60%),
    linear-gradient(180deg, var(--velvet) 0, var(--velvet-deep) 1400px);
  -webkit-font-smoothing: antialiased;
}
/* film grain */
body::before {
  content: ""; position: fixed; inset: 0; pointer-events: none; z-index: 100; opacity: .07; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}
a { color: inherit; }
img { display: block; max-width: 100%; }
button, input, textarea { font: inherit; color: inherit; }
h1, h2, h3, p { margin: 0; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 3px; border-radius: 8px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.wrap { width: 100%; max-width: var(--wrap); margin-inline: auto; padding-inline: 20px; }
.icon { width: 1.2em; height: 1.2em; flex: none; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.icon .fill, svg .fill { fill: currentColor; stroke: none; }

/* --- Buttons ------------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 20px; border-radius: 999px; border: 1px solid transparent; cursor: pointer;
  font: 600 16px/1.2 var(--sans); text-decoration: none; white-space: nowrap;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), background-color .2s, border-color .2s, color .2s;
}
.btn:active { transform: translateY(1px) scale(.99); }
.btn-lg { padding: 15px 26px; font-size: 17px; }
.btn-xl { width: 100%; padding: 20px 28px; font-size: 19px; border-radius: 20px; }
.btn-gold {
  color: #2A1418; background: var(--gold-grad);
  box-shadow: 0 1px 0 rgba(255, 255, 255, .55) inset, 0 14px 34px -14px rgba(243, 182, 110, .75);
  position: relative; overflow: hidden; isolation: isolate;
}
.btn-gold::after { /* a slow glint across the gold */
  content: ""; position: absolute; inset: -40% auto -40% -30%; width: 30%; z-index: -1;
  background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .7), transparent);
  transform: translateX(-120%) skewX(-18deg); transition: transform .8s var(--ease);
}
.btn-gold:hover::after { transform: translateX(520%) skewX(-18deg); }
.btn-gold:hover { box-shadow: 0 1px 0 rgba(255, 255, 255, .55) inset, 0 18px 40px -12px rgba(243, 182, 110, .9); }
.btn-gold .icon { width: 1.15em; height: 1.15em; }
.btn-gold:disabled { opacity: .65; cursor: progress; }
.btn-ghost { background: rgba(255, 245, 232, .04); border-color: var(--line-strong); color: var(--ivory); }
.btn-ghost:hover { border-color: var(--gold); background: rgba(243, 207, 142, .08); }
.btn-quiet { background: none; color: var(--mauve); padding-left: 0; padding-right: 0; }
.btn-quiet:hover { color: var(--ivory); }
.link { background: none; border: 0; padding: 4px 0; cursor: pointer; color: var(--gold); font-weight: 600; font-size: 15px; text-decoration: underline; text-decoration-color: rgba(243, 207, 142, .35); text-underline-offset: 4px; }
.link:hover { text-decoration-color: var(--gold); }

/* --- Header -------------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: linear-gradient(180deg, rgba(26, 13, 34, .92), rgba(26, 13, 34, .72));
  backdrop-filter: blur(14px) saturate(1.3); -webkit-backdrop-filter: blur(14px) saturate(1.3);
  border-bottom: 1px solid var(--line);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand img { height: 36px; width: auto; }
.header-cta {
  font-weight: 600; font-size: 15px; text-decoration: none; padding: 9px 16px; border-radius: 999px;
  border: 1px solid rgba(243, 207, 142, .45); color: var(--gold);
  transition: background-color .2s, color .2s;
}
.header-cta:hover { background: var(--gold); color: #2A1418; }

/* --- Hero ---------------------------------------------------------------------------------- */
.hero { display: grid; gap: 40px; align-items: center; padding-top: 48px; padding-bottom: 24px; position: relative; }
.hero-title {
  font-family: var(--serif); font-weight: 480; font-variation-settings: "opsz" 144;
  font-size: clamp(46px, 11vw, 96px); line-height: .98; letter-spacing: -.025em;
}
.hero-name {
  font-style: italic; font-weight: 420;
  background: var(--gold-grad); -webkit-background-clip: text; background-clip: text; color: transparent;
  padding-right: .06em; /* italic overhang */
}
.hero-name.typing { border-right: 3px solid var(--gold); animation: caret 1s steps(1) infinite; }
@keyframes caret { 50% { border-right-color: transparent; } }
.hero-dot { color: var(--rose); }
.lead { color: var(--mauve); font-size: clamp(17px, 2.2vw, 20px); line-height: 1.55; max-width: 34em; margin-top: 24px; }
.hero-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 14px; align-items: center; }

/* Poster stack: the clip as a film poster with credits */
.hero-stage { --pw: 150px; position: relative; height: 300px; margin-top: -8px; }
.spotlight {
  position: absolute; left: 50%; top: -120px; width: calc(var(--pw) * 2.4); height: calc(var(--pw) * 2.7); transform: translateX(-50%);
  background:
    radial-gradient(closest-side at 50% 72%, rgba(255, 233, 190, .30), transparent 72%),
    conic-gradient(from 180deg at 50% 0%, transparent 160deg, rgba(255, 233, 190, .10) 172deg, rgba(255, 233, 190, .16) 180deg, rgba(255, 233, 190, .10) 188deg, transparent 200deg);
  filter: blur(6px); pointer-events: none;
}
.poster {
  position: absolute; left: 50%; top: 14px; width: var(--pw); aspect-ratio: 9 / 16; border-radius: calc(var(--pw) * .12);
  overflow: hidden; background: linear-gradient(160deg, #3b2148, #1f1027);
  box-shadow: 0 40px 80px -30px rgba(0, 0, 0, .8), 0 0 0 1px rgba(255, 245, 232, .10);
}
.poster img { width: 100%; height: 100%; object-fit: cover; }
.poster img:not([src]) { visibility: hidden; }
.poster-front { transform: translateX(-50%) rotate(-2deg); z-index: 3; box-shadow: 0 50px 90px -30px rgba(0, 0, 0, .9), 0 0 0 1px rgba(255, 233, 190, .35), 0 0 60px -10px rgba(255, 106, 149, .35); }
.poster-back-l { transform: translateX(-112%) translateY(14%) rotate(-11deg) scale(.86); z-index: 1; filter: saturate(.8) brightness(.72); }
.poster-back-r { transform: translateX(12%) translateY(15%) rotate(9deg) scale(.86); z-index: 2; filter: saturate(.8) brightness(.72); }
.credits {
  position: absolute; inset: auto 0 0 0; padding: 40% 8% 11%; text-align: center;
  background: linear-gradient(180deg, transparent, rgba(18, 8, 26, .88) 55%);
}
.credits-kicker { display: block; font: italic 400 calc(var(--pw) * .068)/1 var(--serif); color: var(--mauve); }
.credits-name {
  display: block; margin-top: 6px; font: 600 calc(var(--pw) * .145)/1.05 var(--serif); font-variation-settings: "opsz" 144;
  letter-spacing: -.01em; color: var(--gold-hi); text-shadow: 0 0 24px rgba(243, 207, 142, .45);
}
.poster-play {
  position: absolute; top: 7%; right: 7%; width: calc(var(--pw) * .17); height: calc(var(--pw) * .17); border-radius: 50%;
  display: grid; place-items: center; background: rgba(26, 13, 34, .55); backdrop-filter: blur(6px);
  border: 1px solid rgba(255, 245, 232, .25);
}
.poster-play svg { width: 50%; height: 50%; fill: var(--ivory); }
.star { position: absolute; color: var(--gold-hi); z-index: 4; }
.star-a { width: calc(var(--pw) * .14); height: calc(var(--pw) * .14); top: 4px; left: calc(50% + var(--pw) * .47); }
.star-b { width: calc(var(--pw) * .085); height: calc(var(--pw) * .085); top: calc(var(--pw) * 1.27); left: calc(50% - var(--pw) * .76); color: var(--rose); }

/* --- Steps --------------------------------------------------------------------------------- */
.step { padding-top: 56px; }
.step-head { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 16px 24px; margin-bottom: 20px; }
.step h2 {
  display: flex; align-items: center; gap: 14px;
  font: 500 clamp(30px, 5vw, 42px)/1.1 var(--serif); font-variation-settings: "opsz" 96; letter-spacing: -.015em;
}
.step-no {
  display: inline-grid; place-items: center; width: 42px; height: 42px; border-radius: 50%; flex: none;
  font: italic 500 22px/1 var(--serif); color: var(--gold);
  border: 1px solid rgba(243, 207, 142, .5); background: rgba(243, 207, 142, .06);
}

.search { position: relative; display: flex; align-items: center; width: 100%; }
.search .icon { position: absolute; left: 16px; color: var(--mauve-dim); pointer-events: none; }
.search input {
  width: 100%; padding: 12px 16px 12px 46px; border-radius: 999px; border: 1px solid var(--line-strong);
  background: rgba(255, 245, 232, .04); font-size: 16px; transition: border-color .2s, background-color .2s;
}
.search input::placeholder { color: var(--mauve-dim); }
.search input:focus { outline: none; border-color: var(--gold); background: rgba(255, 245, 232, .07); }

.tabs { display: flex; gap: 8px; overflow-x: auto; padding: 2px 2px 10px; margin: 0 -20px 14px; padding-left: 20px; padding-right: 20px; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  flex: none; display: inline-flex; align-items: center; gap: 8px; padding: 9px 16px; border-radius: 999px; cursor: pointer;
  border: 1px solid var(--line-strong); background: transparent; color: var(--mauve); font-weight: 600; font-size: 15px;
  transition: color .2s, background-color .2s, border-color .2s;
}
.tab:hover { color: var(--ivory); border-color: rgba(255, 228, 240, .35); }
.tab[aria-selected="true"] { background: var(--ivory); border-color: var(--ivory); color: var(--velvet); }
.tab .count { font-size: 13px; font-weight: 600; opacity: .6; }

/* --- Template grid ------------------------------------------------------------------------- */
.templates { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 22px 14px; }
.tpl {
  display: flex; flex-direction: column; gap: 10px; padding: 0; border: 0; background: none; text-align: left; cursor: pointer;
  border-radius: var(--r-card);
}
.tpl-media {
  position: relative; display: block; aspect-ratio: 9 / 13; border-radius: var(--r-card); overflow: hidden;
  background: linear-gradient(160deg, var(--plum-hi), var(--plum));
  box-shadow: 0 0 0 1px var(--line), 0 18px 36px -24px rgba(0, 0, 0, .9);
  transition: box-shadow .25s var(--ease), transform .25s var(--ease);
}
.tpl-media img, .tpl-media video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform .5s var(--ease); }
.tpl:hover .tpl-media img { transform: scale(1.04); }
.tpl:hover .tpl-media { transform: translateY(-3px); box-shadow: 0 0 0 1px var(--line-strong), 0 26px 40px -22px rgba(0, 0, 0, .95); }
.tpl-tags {
  position: absolute; left: 0; right: 0; bottom: 0; display: flex; flex-wrap: wrap; gap: 6px; padding: 40px 10px 10px;
  background: linear-gradient(180deg, transparent, rgba(18, 8, 26, .75));
}
.tag {
  display: inline-flex; align-items: center; gap: 5px; padding: 4px 9px 4px 7px; border-radius: 999px;
  font-size: 12.5px; font-weight: 600; line-height: 1.2; color: var(--ivory);
  background: rgba(26, 13, 34, .6); border: 1px solid rgba(255, 245, 232, .16); backdrop-filter: blur(6px);
}
.tag .icon { width: 14px; height: 14px; stroke-width: 2; }
.tpl-check {
  position: absolute; top: 10px; right: 10px; width: 32px; height: 32px; border-radius: 50%; display: grid; place-items: center;
  background: var(--gold-grad); color: #2A1418; transform: scale(.4); opacity: 0; transition: transform .3s var(--ease), opacity .2s;
  box-shadow: 0 6px 16px -4px rgba(0, 0, 0, .6);
}
.tpl-check .icon { width: 18px; height: 18px; stroke-width: 2.6; }
.tpl[aria-checked="true"] .tpl-media { box-shadow: 0 0 0 2px var(--gold), 0 0 0 6px rgba(243, 207, 142, .18), 0 26px 44px -20px rgba(243, 182, 110, .45); }
.tpl[aria-checked="true"] .tpl-check { transform: none; opacity: 1; }
.tpl-title { font-weight: 650; font-size: 16px; line-height: 1.3; padding: 0 2px; }
.tpl[aria-checked="true"] .tpl-title { color: var(--gold-hi); }
.tpl-teaser { color: var(--mauve); font-size: 14px; line-height: 1.4; padding: 0 2px; margin-top: -6px; }
.slot { font-family: var(--serif); font-style: italic; font-weight: 550; color: var(--gold); }
.slot.blank { color: var(--mauve-dim); font-style: normal; }
.empty { text-align: center; padding: 48px 16px; color: var(--mauve); display: grid; justify-items: center; gap: 16px; }

/* --- Details: preview + fields ------------------------------------------------------------- */
.details {
  display: grid; gap: 24px; padding: 18px; border-radius: var(--r-panel);
  background: linear-gradient(180deg, rgba(50, 27, 61, .7), rgba(38, 20, 47, .7));
  border: 1px solid var(--line); box-shadow: 0 40px 80px -50px rgba(0, 0, 0, .9);
}
.preview { display: flex; align-items: center; gap: 16px; }
.phone {
  position: relative; aspect-ratio: 9 / 16; border-radius: var(--r-phone); overflow: hidden; background: #000;
  box-shadow: 0 0 0 1px rgba(255, 245, 232, .14), 0 30px 60px -30px rgba(0, 0, 0, .9);
}
.phone > img:first-child { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.preview .phone { width: 92px; flex: none; border-radius: 16px; }
.pv-text, .pv-face { display: none; }
.preview-meta { min-width: 0; display: grid; gap: 4px; justify-items: start; }
.preview-name { font: 500 20px/1.25 var(--serif); }

.fields { display: grid; gap: 22px; align-content: start; }
.field-title { font-weight: 650; }
.optional { font-weight: 500; font-size: 13px; color: var(--mauve-dim); margin-left: 4px; }
.hint { color: var(--mauve); font-size: 14.5px; line-height: 1.45; margin-top: 2px; }
.fine { color: var(--mauve-dim); font-size: 14px; text-align: center; margin-top: -8px; }

.names { display: grid; gap: 14px; }
.names.two { grid-template-columns: 1fr; }
.field { display: grid; gap: 8px; }
.field-label-row { display: flex; justify-content: space-between; align-items: baseline; gap: 12px; }
.field label, .name-field label { color: var(--mauve); font-size: 14.5px; font-weight: 600; }
.name-field { display: grid; gap: 8px; }
.name-field input, .field textarea {
  width: 100%; border-radius: var(--r-input); border: 1px solid var(--line-strong); background: rgba(18, 8, 26, .55);
  padding: 15px 18px; transition: border-color .2s, box-shadow .2s, background-color .2s;
}
.name-field input { font: 500 24px/1.2 var(--serif); font-variation-settings: "opsz" 48; letter-spacing: -.005em; }
.field textarea { font: 400 20px/1.45 var(--serif); font-variation-settings: "opsz" 36; resize: vertical; min-height: 112px; }
.name-field input::placeholder, .field textarea::placeholder { color: rgba(191, 169, 200, .45); font-style: italic; }
.name-field input:focus, .field textarea:focus { outline: none; border-color: var(--gold); box-shadow: 0 0 0 4px rgba(243, 207, 142, .14); background: rgba(18, 8, 26, .75); }
.name-field input[aria-invalid="true"], .field textarea[aria-invalid="true"] { border-color: var(--danger); box-shadow: 0 0 0 4px rgba(255, 138, 138, .14); }
.counter { color: var(--mauve-dim); font-size: 13px; font-variant-numeric: tabular-nums; }
.counter.near { color: var(--gold); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 7px 13px; border-radius: 999px; border: 1px dashed rgba(255, 228, 240, .28); background: none; cursor: pointer;
  color: var(--mauve); font-size: 14px; transition: color .2s, border-color .2s;
}
.chip:hover { color: var(--ivory); border-color: var(--gold); border-style: solid; }

.photo-row { display: flex; gap: 16px; align-items: center; padding-bottom: 22px; border-bottom: 1px solid var(--line); }
.avatar {
  position: relative; width: 92px; height: 92px; border-radius: 50%; flex: none; padding: 0; overflow: hidden; cursor: pointer;
  border: 1.5px dashed rgba(243, 207, 142, .55); background: rgba(243, 207, 142, .05); color: var(--gold);
  display: grid; place-items: center; transition: background-color .2s, border-color .2s;
}
.avatar:hover { background: rgba(243, 207, 142, .12); border-color: var(--gold); }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-hint { display: grid; justify-items: center; gap: 4px; font-size: 13px; font-weight: 600; }
.avatar-hint .icon { width: 26px; height: 26px; }
.avatar.cutout { border-style: solid; border-color: var(--gold); background: radial-gradient(circle at 50% 35%, #5a3170, var(--plum) 72%); }
.avatar.cutout img { object-fit: contain; }
.avatar.busy img { opacity: .4; }
.avatar.busy::after { content: ""; position: absolute; inset: 6px; border-radius: 50%; border: 2px solid var(--gold); border-right-color: transparent; animation: spin .9s linear infinite; }

/* --- Progress ------------------------------------------------------------------------------ */
.stage-panel {
  margin: 40px auto 0; max-width: 860px; padding: 28px 22px; border-radius: var(--r-panel);
  background: linear-gradient(180deg, rgba(50, 27, 61, .7), rgba(38, 20, 47, .7)); border: 1px solid var(--line);
}
.making { display: grid; gap: 28px; justify-items: center; }
.phone-making { width: 200px; }
.phone-making > img:first-child { filter: blur(3px) saturate(.9) brightness(.6); transform: scale(1.08); }
.phone-making > img:not([src]) { display: none; }
.phone-making .scan {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, transparent 0%, rgba(255, 233, 190, .0) 40%, rgba(255, 233, 190, .28) 50%, rgba(255, 233, 190, 0) 60%, transparent 100%);
  background-size: 100% 220%; animation: scan 2.4s var(--ease) infinite;
}
@keyframes scan { from { background-position: 0 120%; } to { background-position: 0 -120%; } }
.reel { position: absolute; inset: 0; display: grid; place-items: center; }
.reel span { width: 64px; height: 64px; border-radius: 50%; border: 3px solid rgba(255, 245, 232, .18); border-top-color: var(--gold); animation: spin 1.1s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.making-copy { width: 100%; max-width: 420px; }
.making-copy h2 { font: 500 34px/1.1 var(--serif); font-variation-settings: "opsz" 96; letter-spacing: -.015em; }
.making-title { margin-top: 8px; font: italic 400 19px/1.4 var(--serif); color: var(--gold-hi); }
.bar { margin: 22px 0 6px; height: 6px; border-radius: 99px; background: rgba(255, 245, 232, .08); overflow: hidden; }
.bar span { display: block; height: 100%; width: 3%; border-radius: inherit; background: linear-gradient(90deg, var(--rose), var(--gold)); transition: width .8s var(--ease); }
.progress-steps { list-style: none; padding: 0; margin: 14px 0 0; display: grid; gap: 2px; }
.progress-steps li { display: flex; align-items: center; gap: 12px; padding: 8px 0; color: var(--mauve-dim); transition: color .3s; }
.progress-steps li::before { content: ""; width: 20px; height: 20px; border-radius: 50%; border: 1.5px solid rgba(255, 228, 240, .22); flex: none; box-sizing: border-box; }
.progress-steps li.active { color: var(--ivory); font-weight: 600; }
.progress-steps li.active::before { border-color: var(--gold); border-right-color: transparent; animation: spin .8s linear infinite; }
.progress-steps li.done { color: var(--mauve); }
.progress-steps li.done::before {
  border: 0; background: var(--mint) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%231A0D22' stroke-width='3.2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m6 12.5 4 4 8-8.5'/%3E%3C/svg%3E") center / 14px no-repeat;
}
.elapsed { color: var(--mauve-dim); font-size: 14px; margin-top: 10px; font-variant-numeric: tabular-nums; }

/* --- Result -------------------------------------------------------------------------------- */
.result { display: grid; gap: 32px; padding-top: 36px; justify-items: center; }
.result-video { position: relative; width: min(100%, 320px); isolation: isolate; }
.result-video .glow {
  position: absolute; inset: -18% -30%; z-index: -1; pointer-events: none;
  background: radial-gradient(closest-side, rgba(243, 207, 142, .34), rgba(255, 106, 149, .14) 55%, transparent 78%);
  filter: blur(10px);
}
video { display: block; width: 100%; aspect-ratio: 9 / 16; border-radius: var(--r-phone); background: #000; box-shadow: 0 0 0 1px rgba(255, 233, 190, .3), 0 50px 90px -40px rgba(0, 0, 0, .95); }
.result-copy { width: 100%; max-width: 480px; }
.ready { display: inline-flex; align-items: center; gap: 8px; color: var(--mint); font-weight: 600; font-size: 15px; }
.ready .icon { stroke-width: 2.4; }
.result-title { margin-top: 10px; font: 500 clamp(32px, 6vw, 46px)/1.06 var(--serif); font-variation-settings: "opsz" 144; letter-spacing: -.02em; text-wrap: balance; }
.meta { color: var(--mauve); font-size: 15px; margin-top: 10px; }
.share-main { display: grid; gap: 10px; margin: 26px 0 14px; }
.share-main .btn { width: 100%; }
.share-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.share {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 8px; border-radius: 14px; cursor: pointer;
  border: 1px solid var(--line); background: rgba(255, 245, 232, .035); color: var(--ivory); text-decoration: none;
  font-weight: 600; font-size: 14.5px; transition: border-color .2s, background-color .2s;
}
.share:not(button)::before { content: ""; width: 9px; height: 9px; border-radius: 50%; background: var(--c); box-shadow: 0 0 10px var(--c); flex: none; }
.share:hover { border-color: var(--line-strong); background: rgba(255, 245, 232, .07); }
.share .icon { width: 16px; height: 16px; color: var(--gold); }
.tip { margin: 18px 0 8px; padding: 14px 16px; border-radius: 16px; border: 1px solid var(--line); color: var(--mauve); font-size: 14.5px; line-height: 1.5; }
.tip strong { color: var(--ivory); font-weight: 650; }

.error { text-align: center; display: grid; justify-items: center; gap: 6px; max-width: 560px; }
.error-icon { width: 44px; height: 44px; color: var(--danger); margin-bottom: 6px; }
.error h2 { font: 500 32px/1.15 var(--serif); }
.error .btn { margin-top: 16px; }

/* --- Footer -------------------------------------------------------------------------------- */
.site-footer { margin-top: 96px; border-top: 1px solid var(--line); }
.footer-inner { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 14px; padding-top: 28px; padding-bottom: 36px; color: var(--mauve); font-size: 15px; }
.footer-inner p:first-of-type { font-family: var(--serif); font-style: italic; font-size: 17px; color: var(--ivory); }
.copyright { margin-left: auto; color: var(--mauve-dim); font-size: 14px; }

/* --- Cropper ------------------------------------------------------------------------------- */
dialog {
  width: calc(100% - 32px); max-width: 380px; padding: 24px; border: 1px solid var(--line-strong); border-radius: var(--r-panel);
  background: var(--plum); color: var(--ivory); box-shadow: 0 50px 100px -30px rgba(0, 0, 0, .9);
}
dialog::backdrop { background: rgba(10, 4, 14, .78); backdrop-filter: blur(4px); }
dialog h2 { font: 500 28px/1.15 var(--serif); }
dialog .hint { margin-top: 6px; }
.crop-area { position: relative; width: 300px; height: 300px; max-width: 100%; margin: 18px auto; touch-action: none; }
.crop-area canvas { display: block; width: 300px; height: 300px; border-radius: 18px; cursor: grab; }
.crop-area canvas:active { cursor: grabbing; }
.crop-area::after {
  content: ""; position: absolute; inset: 0; border-radius: 18px; pointer-events: none;
  background: radial-gradient(circle at center, transparent 0 45.6%, var(--gold) 46%, rgba(18, 8, 26, .74) 46.6%);
}
.zoom { display: flex; align-items: center; gap: 12px; color: var(--mauve); font-size: 14.5px; font-weight: 600; }
.zoom input { flex: 1; accent-color: var(--gold); }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 20px; }

/* --- Toast & confetti ---------------------------------------------------------------------- */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 120; transform: translate(-50%, 12px);
  padding: 12px 20px; border-radius: 999px; background: var(--ivory); color: var(--velvet); font-weight: 650; font-size: 15px;
  box-shadow: 0 20px 40px -16px rgba(0, 0, 0, .8); opacity: 0; pointer-events: none; transition: opacity .2s, transform .3s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.confetti { position: fixed; inset: 0; z-index: 110; pointer-events: none; }

/* --- Larger screens ------------------------------------------------------------------------ */
@media (min-width: 560px) {
  .templates { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .names.two { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 760px) {
  .wrap { padding-inline: 32px; }
  .tabs { margin: 0 0 18px; padding-left: 2px; padding-right: 2px; flex-wrap: wrap; overflow: visible; }
  .search { width: 300px; }
  .templates { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 30px 20px; }
  .details { grid-template-columns: 280px minmax(0, 1fr); gap: 40px; padding: 32px; }
  .preview { display: block; position: sticky; top: 96px; align-self: start; }
  .preview .phone { width: 100%; border-radius: var(--r-phone); }
  .pv-text { display: block; position: absolute; inset: auto 0 0 0; padding: 90px 22px 26px; text-align: center; background: linear-gradient(180deg, transparent, rgba(18, 8, 26, .9) 50%); }
  .pv-title { font: 600 26px/1.12 var(--serif); font-variation-settings: "opsz" 144; letter-spacing: -.01em; text-wrap: balance; overflow-wrap: anywhere; }
  .pv-title .slot { color: var(--gold-hi); text-shadow: 0 0 20px rgba(243, 207, 142, .4); }
  .pv-message { margin-top: 10px; font: italic 400 16px/1.4 var(--serif); color: var(--ivory); opacity: .9; overflow-wrap: anywhere; }
  .pv-face:not([hidden]) {
    display: block; position: absolute; top: 18%; left: 50%; width: 46%; aspect-ratio: 1; transform: translateX(-50%);
    border-radius: 50%; object-fit: contain; background: radial-gradient(circle, rgba(255, 233, 190, .35), transparent 70%);
    filter: drop-shadow(0 10px 20px rgba(0, 0, 0, .6));
  }
  .preview-meta { margin-top: 16px; text-align: left; }
  .preview-name { display: none; }
  .stage-panel { padding: 40px; }
  .making { grid-template-columns: 220px minmax(0, 1fr); align-items: center; gap: 48px; justify-items: stretch; }
  .phone-making { width: 220px; }
  .result { grid-template-columns: minmax(0, 340px) minmax(0, 480px); justify-content: center; align-items: center; gap: 64px; padding-top: 56px; }
  .result-video { width: 100%; }
  .share-main { grid-template-columns: 1fr 1fr; }
}
@media (min-width: 1000px) {
  .hero { grid-template-columns: minmax(0, 1.15fr) minmax(0, .85fr); padding-top: 72px; padding-bottom: 40px; }
  .hero-stage { --pw: 236px; height: 470px; margin-top: 0; }
  .poster { top: 30px; }
}

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

/* --- Account, sign-in, My clips -------------------------------------------------------------- */
.account { position: relative; display: flex; align-items: center; }
.account-in { display: flex; align-items: center; gap: 10px; }
.header-link { display: inline-flex; align-items: center; gap: 8px; padding: 9px 14px; border: 1px solid var(--line-strong); border-radius: 99px; background: none; color: var(--ivory); font: 600 15px/1 var(--sans); cursor: pointer; }
.header-link:hover { border-color: var(--gold); color: var(--gold-hi); }
.header-link .icon { width: 18px; height: 18px; }
.avatar-btn { width: 40px; height: 40px; padding: 0; border-radius: 50%; border: 1px solid var(--line-strong); background: var(--plum-hi); color: var(--gold-hi); font: 600 16px/1 var(--sans); cursor: pointer; overflow: hidden; display: grid; place-items: center; }
.avatar-btn img { width: 100%; height: 100%; object-fit: cover; }
.avatar-btn:hover, .avatar-btn[aria-expanded="true"] { border-color: var(--gold); }
.menu { position: absolute; right: 0; top: calc(100% + 10px); z-index: 60; min-width: 250px; padding: 8px; border-radius: 18px; background: var(--plum); border: 1px solid var(--line-strong); box-shadow: 0 24px 60px -20px rgba(0, 0, 0, .9); }
.menu-who { margin: 0; padding: 10px 12px 4px; display: grid; gap: 2px; }
.menu-who strong { font-weight: 650; }
.menu-who span { color: var(--mauve); font-size: 14px; overflow-wrap: anywhere; }
.menu-quota { margin: 0 0 6px; padding: 0 12px 10px; border-bottom: 1px solid var(--line); color: var(--gold); font-size: 14px; }
.menu button { display: flex; align-items: center; gap: 10px; width: 100%; padding: 11px 12px; border: 0; border-radius: 12px; background: none; color: var(--ivory); font: 500 15px/1.2 var(--sans); cursor: pointer; text-align: left; }
.menu button:hover { background: var(--plum-hi); }
.menu .icon { width: 18px; height: 18px; color: var(--mauve); }
.signin-google { display: flex; justify-content: center; min-height: 44px; margin-top: 22px; }
.signin-dev { width: 100%; margin-top: 12px; }
.signin-error { margin: 12px 0 0; color: var(--danger); font-size: 14px; text-align: center; }
.fine.warn { color: var(--gold); }
.library-quota { margin: -8px 0 22px; color: var(--mauve); }
.library-quota b { color: var(--gold); font-weight: 600; }
.library-grid .tpl-media { aspect-ratio: 9 / 16; }
.lib-status { position: absolute; inset: 0; display: grid; place-items: center; padding: 16px; text-align: center; color: var(--mauve); font-size: 14px; background: linear-gradient(180deg, var(--plum), var(--velvet-deep)); }
.lib-play { position: absolute; left: 50%; top: 50%; width: 52px; height: 52px; margin: -26px 0 0 -26px; border-radius: 50%; display: grid; place-items: center; background: rgba(18, 8, 26, .55); backdrop-filter: blur(6px); opacity: .9; }
.lib-play svg { width: 22px; height: 22px; fill: var(--ivory); margin-left: 3px; }
.library-more { display: flex; margin: 28px auto 0; }
.result-more { display: flex; flex-wrap: wrap; gap: 4px 22px; }
@media (max-width: 559px) {
  .header-link span { display: none; }
  .header-link { padding: 10px; }
}
