:root {
  --ink: #1d1a18;
  --dark: #211c1b;
  --curtain: #a3242f;
  --curtain-2: #7f1a24;
  --gold: #c9a24a;
  --cream: #faf6ef;
  --paper: #ffffff;
  --muted: #625b53;
  --line: #e8dfd1;
  --ok: #1d5a45;
  --radius: 16px;
  --shadow: 0 10px 30px rgba(33, 28, 27, 0.12);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  color: var(--ink);
  background: var(--cream);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--curtain); }
h1, h2, h3 { font-family: Fraunces, Georgia, serif; line-height: 1.15; color: var(--ink); }
h1 { font-size: clamp(1.55rem, 3.6vw, 2.5rem); margin: 0 0 0.35em; }
h2 { font-size: clamp(1.3rem, 2.4vw, 1.7rem); margin: 0 0 0.6em; }
h3 { font-size: 1.12rem; margin: 0 0 0.6em; }
[hidden] { display: none !important; }

.top {
  display: flex; justify-content: space-between; align-items: center;
  max-width: 1120px; margin: 0 auto; padding: 14px 16px;
}
.brand { font-family: Fraunces, Georgia, serif; font-weight: 700; font-size: 1.1rem; color: var(--ink); text-decoration: none; }
.brand-mark { color: var(--curtain); }
.top-nav { display: flex; gap: 18px; }
.top-nav a { font-weight: 600; text-decoration: none; color: var(--curtain); font-size: 0.95rem; }

/* The page is a column so a landing page can move its own tool to the top (see the data-tool rules below). */
main { display: flex; flex-direction: column; }
.hero { order: -3; max-width: 860px; margin: 0 auto; padding: 4px 16px 14px; text-align: center; }
.lead { font-size: 1.02rem; color: var(--muted); margin: 0 auto; max-width: 44em; }
.fine { font-size: 0.85rem; color: var(--muted); margin: 0.6em 0 0; }
.center { text-align: center; }
body[data-tool="ai"] #ai { order: -2; }
body[data-tool="booth"] #booth { order: -2; }
.trend { order: -1; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  font: inherit; font-weight: 600; border: 0; border-radius: 999px; cursor: pointer;
  padding: 12px 22px; text-decoration: none; transition: transform 0.08s ease, background 0.2s ease;
}
.btn:active { transform: translateY(1px); }
.btn[disabled] { opacity: 0.55; cursor: not-allowed; }
.btn-primary { background: var(--curtain); color: #fff; }
.btn-primary:hover { background: var(--curtain-2); }
.btn-dark { background: var(--dark); color: #fff; }
.btn-ghost { background: transparent; color: var(--ink); border: 1.5px solid var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-lg { padding: 15px 28px; font-size: 1.05rem; }
.btn-block { width: 100%; margin-top: 10px; }
.btn-block:first-child { margin-top: 0; }
.btn-mini { font: inherit; font-size: 0.85rem; font-weight: 600; padding: 7px 13px; border-radius: 999px; border: 1px solid var(--curtain); background: var(--curtain); color: #fff; cursor: pointer; white-space: nowrap; }
.btn-mini:hover { background: var(--curtain-2); border-color: var(--curtain-2); }
.btn-mini-ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn-mini-ghost:hover { background: var(--cream); border-color: var(--ink); }
.card-panel { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow); }
.visually-hidden { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---- Free camera booth ---- */
.booth, .ai, .gallery, .how, .faq, .trend { width: 100%; max-width: 1120px; margin: 0 auto; padding: 0 16px 48px; }
.machine { display: grid; grid-template-columns: 1.25fr 1fr; gap: 22px; align-items: start; }
.screen {
  position: relative; aspect-ratio: 4 / 3; border-radius: 14px; overflow: hidden; background: var(--dark);
  box-shadow: inset 0 0 0 6px #37302e;
}
.screen video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transform: scaleX(-1); display: none; }
/* Rendered (under the idle card) from the moment the camera starts: some browsers deliver no frames to a display:none video. */
.screen[data-state="starting"] video, .screen[data-state="counting"] video { display: block; }
.screen-idle {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; gap: 18px; padding: 18px;
  color: #f3ece4; text-align: left;
  background: repeating-linear-gradient(90deg, #7f1a24 0 26px, #8d1f2a 26px 52px);
}
.screen[data-state="counting"] .screen-idle { display: none; }
.screen-idle p { margin: 0; max-width: 15em; font-size: 1rem; text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35); }
.screen-idle strong { display: block; font-family: Fraunces, Georgia, serif; font-size: 1.35rem; margin-bottom: 4px; }
.idle-strip { height: 82%; width: auto; border-radius: 3px; box-shadow: 0 8px 22px rgba(0, 0, 0, 0.4); transform: rotate(-4deg); }
.count {
  position: absolute; inset: 0; display: grid; place-items: center; font-family: Fraunces, Georgia, serif; font-weight: 700;
  font-size: clamp(5rem, 22vw, 10rem); color: #fff; text-shadow: 0 4px 24px rgba(0, 0, 0, 0.55); pointer-events: none;
}
.flash { position: absolute; inset: 0; background: #fff; opacity: 0; pointer-events: none; }
.flash.on { animation: flash 0.45s ease-out; }
@keyframes flash { 0% { opacity: 0.95; } 100% { opacity: 0; } }
.dots { position: absolute; left: 0; right: 0; bottom: 10px; display: flex; justify-content: center; gap: 8px; margin: 0; padding: 0; list-style: none; }
.dots li { width: 11px; height: 11px; border-radius: 50%; background: rgba(255, 255, 255, 0.35); }
.dots li.done { background: #fff; }
.screen[data-state="idle"] .dots, .screen[data-state="error"] .dots { display: none; }
.booth-msg { margin: 12px 0 0; padding: 10px 12px; border-radius: 10px; background: #fdf1e7; border: 1px solid #f0d3b6; font-size: 0.92rem; }
.opts { margin-top: 16px; display: grid; gap: 10px; }
.opt { display: grid; grid-template-columns: 58px 1fr; gap: 8px; align-items: center; }
.opt-name { font-size: 0.82rem; font-weight: 600; color: var(--muted); }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font: inherit; font-size: 0.85rem; font-weight: 600; padding: 6px 12px; border-radius: 999px; border: 1.5px solid var(--line); background: var(--paper); color: var(--ink); cursor: pointer; }
.chip[aria-checked="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.swatch { width: 30px; height: 30px; padding: 0; border-radius: 50%; border: 2px solid var(--line); cursor: pointer; }
.swatch[aria-checked="true"] { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }

.strip-result { margin-top: 20px; display: grid; grid-template-columns: auto 1fr; gap: 24px; align-items: start; }
#stripImg { max-height: 78vh; width: auto; border-radius: 4px; box-shadow: var(--shadow); background: var(--cream); }
.strip-actions { max-width: 360px; }
.invite { margin-top: 18px; padding-top: 14px; border-top: 1px solid var(--line); }
.invite p { margin: 0 0 8px; }

/* ---- AI booth ---- */
.section-head { max-width: 760px; margin: 0 0 18px; }
.section-head p { color: var(--muted); margin: 0; }
.maker { display: grid; grid-template-columns: 1.2fr 1fr; gap: 24px; align-items: start; }
.looks { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.look {
  position: relative; border: 2px solid var(--line); border-radius: 12px; padding: 0; overflow: hidden;
  background: var(--cream); cursor: pointer; text-align: left; font: inherit; color: inherit;
}
.look img { aspect-ratio: 3 / 4; object-fit: cover; object-position: top; width: 100%; }
.look span { display: block; padding: 6px 8px; font-size: 0.8rem; font-weight: 600; line-height: 1.25; }
.look[aria-checked="true"] { border-color: var(--curtain); box-shadow: 0 0 0 3px rgba(163, 36, 47, 0.15); }
.look[aria-checked="true"]::after {
  content: "✓"; position: absolute; top: 6px; right: 6px; width: 22px; height: 22px; border-radius: 50%;
  background: var(--curtain); color: #fff; display: grid; place-items: center; font-size: 0.8rem;
}
.look-blurb { margin: 8px 0 20px; }
.photo-row { display: grid; grid-template-columns: 132px 132px 1fr; gap: 12px; align-items: start; }
.photo-row.one { grid-template-columns: 132px 1fr; }
.photo-slot { display: grid; gap: 6px; justify-items: start; }
.photo-pick {
  display: grid; place-items: center; width: 100%; aspect-ratio: 1; border: 2px dashed var(--gold); border-radius: 14px;
  background: var(--cream); cursor: pointer; text-align: center; overflow: hidden; color: var(--muted); font-size: 0.8rem; line-height: 1.3; padding: 8px;
}
.photo-pick:hover, input:focus-visible + .photo-pick { border-color: var(--curtain); }
.photo-pick strong { display: block; color: var(--curtain); font-size: 0.95rem; margin-bottom: 3px; }
.photo-pick.has-photo { border-style: solid; border-color: var(--ok); padding: 0; }
.photo-pick img { width: 100%; height: 100%; object-fit: cover; }
.photo-side .fine:first-child { margin-top: 0; }
.photo-side .btn-mini { margin-top: 6px; }
.consent { margin: 14px 0; }
.form-error { color: var(--curtain); font-weight: 600; margin: 0 0 12px; }
.human-check:empty { display: none; }
.human-check { display: flex; justify-content: center; margin: 0 0 0.8em; }

.maker-result { position: sticky; top: 16px; text-align: center; }
.empty-sample { max-height: 520px; width: auto; margin: 0 auto 4px; border-radius: 6px; box-shadow: var(--shadow); }
.spinner { font-size: 2.4rem; color: var(--curtain); animation: spin 5s linear infinite; display: inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }
.bar { height: 10px; border-radius: 999px; background: var(--cream); border: 1px solid var(--line); overflow: hidden; margin: 14px 0 6px; }
.bar-fill { height: 100%; width: 2%; background: linear-gradient(90deg, var(--curtain), var(--gold)); transition: width 0.8s ease; }
#previewImg { max-height: 80vh; width: auto; margin: 0 auto; border-radius: 6px; background: var(--cream); box-shadow: var(--shadow); }
.ai-note { margin: 10px 0 12px; }
.share-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; margin-bottom: 14px; }
.share-row .btn { padding: 10px 16px; font-size: 0.92rem; }
.actions { margin-top: 4px; }
.paid-note { font-weight: 600; color: var(--ok); margin: 0 0 10px; }

/* ---- Gallery, steps, FAQ ---- */
.gallery-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 12px; align-items: start; }
.g-card { display: block; background: var(--paper); border: 1px solid var(--line); border-radius: 12px; overflow: hidden; text-decoration: none; color: var(--ink); }
.g-card:hover { border-color: var(--ink); }
.g-card img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; }
.g-card span { display: block; padding: 9px 10px 11px; font-size: 0.8rem; color: var(--muted); line-height: 1.35; }
.g-card strong { display: block; color: var(--ink); font-size: 0.9rem; margin-bottom: 2px; }
#galleryNote { margin-top: 12px; }
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; padding: 0; margin: 0; list-style: none; counter-reset: s; }
.steps li { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 18px 58px; position: relative; counter-increment: s; }
.steps li::before {
  content: counter(s); position: absolute; left: 16px; top: 16px; width: 30px; height: 30px; border-radius: 50%;
  background: var(--ink); color: #fff; display: grid; place-items: center; font-weight: 700;
}
.faq details { background: var(--paper); border: 1px solid var(--line); border-radius: 12px; padding: 14px 18px; margin-bottom: 10px; }
.faq summary { cursor: pointer; font-weight: 600; color: var(--ink); }
.faq p { margin: 10px 0 2px; color: var(--muted); }

/* ---- Landing-page text block ---- */
.trend { display: grid; grid-template-columns: 1fr 300px; gap: 20px 36px; align-items: start; }
.trend-text p { color: var(--muted); margin: 0 0 1em; }
.trend-text h2 { margin-top: 0.6em; }
.trend-text h2:first-child { margin-top: 0; }
.trend-sample { margin: 0; }
.trend-sample img { width: 100%; border-radius: 8px; box-shadow: var(--shadow); }
.before-row { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.before-row img { width: 64px; height: 64px; border-radius: 10px; object-fit: cover; box-shadow: var(--shadow); }
.before-row span { font-size: 0.8rem; color: var(--muted); line-height: 1.3; }
.trend-sample figcaption { font-size: 0.8rem; color: var(--muted); margin-top: 8px; text-align: center; }
.trend-faq { grid-column: 1 / -1; padding: 0; }
.prompt-box { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-top: 8px; }
.prompt-box pre { white-space: pre-wrap; word-break: break-word; font: 0.9rem/1.5 ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: var(--cream); border: 1px solid var(--line); border-radius: 10px; padding: 12px; margin: 0 0 12px; color: var(--ink); }

/* ---- Share page, legal pages, 404 ---- */
.share { max-width: 560px; margin: 0 auto; padding: 8px 16px 56px; text-align: center; }
.share .eyebrow, .eyebrow { text-transform: uppercase; letter-spacing: 0.12em; font-size: 0.78rem; font-weight: 600; color: var(--curtain); margin: 0 0 6px; }
.share-img { margin: 14px auto; border-radius: 8px; box-shadow: var(--shadow); max-height: 78vh; width: auto; }
.share .btn { margin-top: 14px; }
.legal { max-width: 760px; margin: 0 auto; padding: 8px 16px 56px; }
.legal h1 { font-size: 2rem; }
.legal h2 { font-size: 1.2rem; margin-top: 1.6em; }
.notfound { max-width: 560px; margin: 0 auto; padding: 48px 16px 72px; text-align: center; }
.notfound .btn { margin: 8px 4px 0; }
.foot { text-align: center; padding: 28px 16px 40px; border-top: 1px solid var(--line); color: var(--muted); }
.foot a { color: var(--muted); }

@media (max-width: 900px) {
  .machine { grid-template-columns: 1fr; gap: 14px; }
  .maker { grid-template-columns: 1fr; }
  .maker-result { position: static; }
  .maker-result.is-empty { display: none; }
  .steps { grid-template-columns: 1fr; }
  .gallery-grid { grid-template-columns: repeat(3, 1fr); }
  .strip-result { grid-template-columns: 1fr; justify-items: center; }
  .strip-actions { max-width: none; width: 100%; }
  #stripImg { max-height: 70vh; }
  .trend { grid-template-columns: 1fr; }
  .trend-sample { max-width: 300px; margin: 0 auto; }
}
@media (max-width: 520px) {
  .top { padding: 10px 14px; }
  .top-nav { gap: 12px; }
  .top-nav a { font-size: 0.85rem; }
  .hero { padding-bottom: 10px; }
  .lead { font-size: 0.93rem; }
  .card-panel { padding: 14px; }
  .booth, .ai, .gallery, .how, .faq, .trend { padding-left: 12px; padding-right: 12px; }
  .screen-idle { gap: 12px; padding: 12px; }
  .screen-idle p { font-size: 0.88rem; }
  .screen-idle strong { font-size: 1.1rem; }
  .looks { grid-template-columns: repeat(3, 1fr); }
  .photo-row, .photo-row.one { grid-template-columns: 1fr 1fr; }
  .photo-side { grid-column: 1 / -1; }
  .gallery-grid { grid-template-columns: repeat(2, 1fr); }
}
