:root {
  --bg: #faf6f1;
  --surface: #ffffff;
  --ink: #1f1a17;
  --muted: #6f655e;
  --line: #e8dfd5;
  --accent: #c8102e;
  --accent-ink: #ffffff;
  --accent-soft: #fbe4e7;
  --radius: 18px;
  --shadow: 0 10px 30px rgba(31, 26, 23, 0.08);
  font-family: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
/* Elements with display rules (modal, buttons, drop text) must still hide when [hidden] is set. */
[hidden] { display: none !important; }
body { margin: 0; background: var(--bg); line-height: 1.5; }
img { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2 { font-family: ui-serif, Georgia, "Times New Roman", serif; letter-spacing: -0.02em; line-height: 1.1; margin: 0 0 12px; }
h1 { font-size: clamp(2.4rem, 9vw, 4rem); }
h2 { font-size: clamp(1.6rem, 6vw, 2.2rem); }

main, .top, .foot { max-width: 720px; margin: 0 auto; padding-inline: 18px; }
section { padding-block: 40px; }

.top { display: flex; align-items: center; justify-content: space-between; padding-block: 14px; position: sticky; top: 0; background: rgba(250, 246, 241, 0.92); backdrop-filter: blur(8px); z-index: 5; }
.logo { display: inline-flex; align-items: center; gap: 9px; font-weight: 800; font-size: 1.25rem; text-decoration: none; letter-spacing: -0.02em; }
.logo-mark { width: 34px; height: 34px; flex: none; }
.logo-text span { color: var(--accent); }
.credits { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 8px 14px; font: inherit; font-size: 0.9rem; font-weight: 600; cursor: pointer; }

.hero { text-align: center; padding-top: 28px; }
.eyebrow { text-transform: uppercase; letter-spacing: 0.14em; font-size: 0.75rem; font-weight: 700; color: var(--accent); margin: 0 0 10px; }
.lede { font-size: 1.1rem; color: var(--muted); max-width: 30em; margin: 0 auto 22px; }
.fine { font-size: 0.85rem; color: var(--muted); margin: 10px 0 0; }
.sub { color: var(--muted); margin: 0 0 20px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; border: 0; border-radius: 999px; padding: 12px 20px; font: inherit; font-weight: 700; cursor: pointer; text-decoration: none; }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: 0 8px 20px rgba(200, 16, 46, 0.28); }
.btn-primary:disabled { opacity: 0.45; box-shadow: none; cursor: not-allowed; }
.btn-ghost { background: transparent; border: 1px solid var(--line); color: var(--ink); }
.btn-lg { padding: 16px 26px; font-size: 1.05rem; }
.btn-block { width: 100%; }

.compare { position: relative; overflow: hidden; border-radius: var(--radius); box-shadow: var(--shadow); background: #eee; margin-top: 26px; aspect-ratio: 4 / 3; }
.compare img { width: 100%; height: 100%; object-fit: cover; }
.compare-before-wrap { position: absolute; inset: 0; width: 50%; overflow: hidden; border-right: 3px solid #fff; }
.compare-before-wrap img { width: auto; max-width: none; height: 100%; }
.compare-range { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: ew-resize; margin: 0; }
.tag { position: absolute; top: 12px; background: rgba(31, 26, 23, 0.7); color: #fff; font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; pointer-events: none; }
.tag-before { left: 12px; }
.tag-after { right: 12px; }
.watermark { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.watermark span { transform: rotate(-18deg); font-size: clamp(1.1rem, 5vw, 1.8rem); font-weight: 800; color: rgba(255, 255, 255, 0.75); text-shadow: 0 2px 10px rgba(0, 0, 0, 0.35); border: 2px solid rgba(255, 255, 255, 0.6); padding: 6px 14px; border-radius: 10px; }

.studio { background: var(--surface); border-radius: 26px; box-shadow: var(--shadow); padding: 24px 18px; margin-block: 10px; }
.drop { display: grid; place-items: center; min-height: 200px; border: 2px dashed var(--line); border-radius: var(--radius); cursor: pointer; overflow: hidden; text-align: center; margin-bottom: 18px; background: var(--bg); }
.drop img { width: 100%; max-height: 360px; object-fit: cover; }
.drop-empty { display: grid; gap: 6px; padding: 24px; }
.drop-empty small { color: var(--muted); }
.field { margin-bottom: 18px; }
.field label, .label { display: block; font-weight: 700; margin-bottom: 8px; }
select { width: 100%; font: inherit; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 9px 14px; font: inherit; font-size: 0.95rem; cursor: pointer; }
.chip[aria-checked="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.chip-custom { border-style: dashed; }
.custom-box { margin-top: 12px; }
.custom-box input { width: 100%; font: inherit; padding: 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--surface); color: var(--ink); }
.error { color: #b3261e; font-weight: 600; margin: 12px 0 0; }
.working { text-align: center; padding: 24px 0 8px; }
.working p { color: var(--muted); margin: 12px 0 0; }
.spinner { width: 42px; height: 42px; border-radius: 50%; border: 4px solid var(--accent-soft); border-top-color: var(--accent); margin: 0 auto; animation: spin 0.9s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.result-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; }
.result-actions .btn { flex: 1 1 auto; }

.steps { list-style: none; padding: 0; margin: 0; display: grid; gap: 12px; counter-reset: s; }
.steps li { background: var(--surface); border-radius: var(--radius); padding: 16px 18px; display: grid; gap: 2px; counter-increment: s; }
.steps li strong::before { content: counter(s) ". "; color: var(--accent); }
.steps span { color: var(--muted); }

.packs { display: grid; gap: 12px; }
.pack { position: relative; display: flex; align-items: center; justify-content: space-between; gap: 12px; background: var(--surface); border: 2px solid var(--line); border-radius: var(--radius); padding: 16px 18px; text-align: left; font: inherit; color: var(--ink); cursor: pointer; width: 100%; }
.pack.featured { border-color: var(--accent); }
.pack .badge { position: absolute; top: -11px; left: 16px; background: var(--accent); color: #fff; font-size: 0.72rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; }
.pack-name { font-weight: 800; }
.pack-per { color: var(--muted); font-size: 0.85rem; }
.pack-price { font-weight: 800; font-size: 1.3rem; }

.pack[aria-checked="true"] { border-color: var(--ink); box-shadow: 0 0 0 2px var(--ink) inset; }
.paybox { display: grid; gap: 10px; margin-top: 16px; }
#express:empty { display: none; }
.or-divider { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: 0.85rem; }
.or-divider::before, .or-divider::after { content: ""; flex: 1; border-top: 1px solid var(--line); }
#paymentElement:empty { display: none; }
.inapp-tip { background: var(--accent-soft); border-radius: 12px; padding: 10px 12px; font-size: 0.9rem; margin: 0; }

.faq details { background: var(--surface); border-radius: 14px; padding: 14px 16px; margin-bottom: 10px; }
.faq summary { font-weight: 700; cursor: pointer; }
.faq p { color: var(--muted); margin: 8px 0 0; }

.foot { text-align: center; color: var(--muted); font-size: 0.9rem; padding-block: 30px 40px; }

.modal { position: fixed; inset: 0; background: rgba(31, 26, 23, 0.55); display: grid; place-items: center; z-index: 20; padding: 12px; }
.modal-card { position: relative; background: var(--bg); border-radius: 26px; padding: 26px 18px 20px; width: min(520px, 100%); max-height: 92vh; max-height: 92dvh; overflow: auto; }
.modal-x { position: absolute; top: 10px; right: 14px; border: 0; background: none; font-size: 1.8rem; cursor: pointer; color: var(--muted); }

.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: #fff; padding: 12px 18px; border-radius: 999px; font-weight: 600; z-index: 30; width: max-content; max-width: 90vw; text-align: center; }

.legal { max-width: 720px; margin: 0 auto; padding: 30px 18px 60px; }
.legal h1 { font-size: 2rem; }
.legal h2 { font-size: 1.25rem; margin-top: 28px; }
.legal p, .legal li { color: #3b342f; }

/* Checkout */
.checkout h2 { margin-bottom: 8px; padding-right: 30px; }
.perks { list-style: none; padding: 0; margin: 0 0 16px; display: grid; gap: 4px; color: var(--muted); font-size: 0.95rem; }
.perks li::before { content: "✓ "; color: var(--accent); font-weight: 800; }
.checkout .packs { gap: 8px; }
.checkout .pack { padding: 12px 14px; }
.checkout .pack-name { font-size: 0.98rem; }
.checkout .pack-price { font-size: 1.15rem; }
.link-btn { background: none; border: 0; color: var(--ink); font: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 3px; cursor: pointer; padding: 6px; justify-self: center; }
.card-form { display: grid; gap: 12px; }
.trust { text-align: center; color: var(--muted); font-size: 0.82rem; margin: 14px 0 0; line-height: 1.5; }
.trust a { color: inherit; }
.save { color: var(--accent); }

.pay-email { width: 100%; font: inherit; font-size: 16px; padding: 12px 14px; border-radius: 14px; border: 1px solid #e0d8cf; background: #fff; color: var(--ink); }
.pe-loading { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 120px; color: var(--muted); font-size: 0.92rem; border: 1px dashed var(--line); border-radius: 14px; }
.spinner-sm { width: 22px; height: 22px; border-width: 3px; margin: 0; }
.btn.is-busy { opacity: 0.85; cursor: progress; }
.btn.is-busy::before { content: ""; width: 16px; height: 16px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, 0.5); border-top-color: #fff; animation: spin 0.8s linear infinite; }
.pay-success { text-align: center; display: grid; gap: 12px; }
.success-mark { font-size: 2.6rem; }
.restore-box { background: var(--surface); border-radius: 14px; padding: 12px; text-align: left; font-size: 0.9rem; }
.restore-box p { margin: 0 0 8px; color: var(--muted); }
.restore-row { display: flex; gap: 8px; }
.restore-row input { flex: 1; min-width: 0; font: inherit; font-size: 0.85rem; padding: 10px; border-radius: 10px; border: 1px solid var(--line); background: var(--bg); color: var(--ink); }
.pay-email:focus { outline: none; border-color: #1f1a17; box-shadow: 0 0 0 3px rgba(31, 26, 23, 0.08); }

.hero-compare { aspect-ratio: 1200 / 896; }
.drag-hint { position: absolute; left: 50%; bottom: 12px; transform: translateX(-50%); background: rgba(31, 26, 23, 0.7); color: #fff; font-size: 0.75rem; font-weight: 700; padding: 4px 10px; border-radius: 999px; pointer-events: none; }
.hero-caption { font-size: 0.85rem; color: var(--muted); margin: 10px 0 0; }
.pe-loading-sm { min-height: 52px; }

/* Taps: no blue browser highlight; buttons press in slightly instead. Keyboard users still get a clear outline. */
.btn, .chip, .pack, .credits, .thumb, .link-btn { transition: transform 0.12s ease, filter 0.12s ease; }
.btn:active:not(:disabled), .chip:active, .pack:active, .credits:active, .thumb:active { transform: scale(0.97); filter: brightness(0.96); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }
.compare-range:focus-visible { outline: none; }

/* Seasonal styles */
.limited { display: inline-block; margin-left: 6px; background: var(--accent); color: #fff; font-size: 0.66rem; font-weight: 800; text-transform: uppercase; letter-spacing: 0.06em; padding: 2px 7px; border-radius: 999px; vertical-align: 1px; }
.chip[aria-checked="true"] .limited { background: #fff; color: var(--ink); }

/* My designs */
.gallery { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.thumb { position: relative; display: block; padding: 0; border: 0; border-radius: 14px; overflow: hidden; background: #eee; cursor: pointer; aspect-ratio: 4 / 3; box-shadow: var(--shadow); }
.thumb img { width: 100%; height: 100%; object-fit: cover; }
.thumb-label { position: absolute; left: 8px; bottom: 8px; background: rgba(31, 26, 23, 0.7); color: #fff; font: inherit; font-size: 0.72rem; font-weight: 700; padding: 3px 9px; border-radius: 999px; }
.viewer-img { position: relative; border-radius: var(--radius); overflow: hidden; background: #eee; }
.viewer-img img { width: 100%; }

/* Popups: scrolling inside them never moves the page behind. */
.modal, .modal-card { overscroll-behavior: contain; }
html.modal-open, html.modal-open body { overflow: hidden; }

/* Seasonal banner above the headline */
.season { display: inline-block; margin: 0 0 16px; padding: 7px 14px; border-radius: 999px; background: #fbe7ea; color: #a50d26; font-size: 0.9rem; font-weight: 700; text-decoration: none; border: 1px solid #f3c4cc; }

/* Email error, styled like Stripe's card field errors */
.pay-email.invalid, .pay-email.invalid:focus { border-color: #df1b41; box-shadow: 0 0 0 1px #df1b41; }
.field-error { color: #df1b41; font-size: 0.85rem; margin: -6px 0 0 2px; }

/* One-tap buttons render invisibly behind the loader, then fade in together (no jumping). */
.paybox { position: relative; }
#express { transition: opacity 0.25s ease; }
#express.pending { position: absolute; top: 0; left: 0; right: 0; opacity: 0; pointer-events: none; }

/* Checkout being prepared in the background: laid out (Stripe needs that) but invisible and click-through. */
.modal.preload { opacity: 0; pointer-events: none; }
.modal.preload * { pointer-events: none !important; }

/* <picture> wrappers (WebP with JPEG fallback) shouldn't change the layout. */
picture { display: contents; }
