:root {
  --paper: #fff8ef;
  --ink: #2b1b0e;
  --muted: #7a6656;
  --line: #ecdcc8;
  --marigold: #e85d04;
  --marigold-dark: #c44d00;
  --leaf: #2d6a4f;
  --wa: #1fa855;
  --card: #ffffff;
  --radius: 18px;
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, 'Noto Sans', 'Noto Sans Devanagari', 'Nirmala UI', sans-serif;
  --t-accent: var(--marigold);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; font-family: var(--font); background: var(--paper); color: var(--ink); line-height: 1.5; }
a { color: var(--marigold-dark); }
h1, h2, h3 { line-height: 1.2; margin: 0; }
.muted { color: var(--muted); }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
[hidden] { display: none !important; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 13px 20px; border-radius: 999px; border: 2px solid var(--line); background: var(--card);
  color: var(--ink); font: inherit; font-weight: 650; text-decoration: none; cursor: pointer; min-height: 48px;
}
.btn:active { transform: scale(0.98); }
.btn-primary { background: var(--marigold); border-color: var(--marigold); color: #fff; }
.btn-primary:hover { background: var(--marigold-dark); border-color: var(--marigold-dark); }
.btn-primary:disabled { opacity: 0.6; cursor: progress; }
.btn-big { width: 100%; font-size: 18px; padding: 16px; }
.btn-wa { background: var(--wa); border-color: var(--wa); color: #fff; }

.topbar {
  position: sticky; top: 0; z-index: 10; display: flex; justify-content: space-between; align-items: center;
  padding: 12px 16px; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}
.brand { font-weight: 800; font-size: 19px; color: var(--ink); text-decoration: none; letter-spacing: -0.2px; }
.brand span { color: var(--marigold); }
.back { text-decoration: none; font-weight: 600; color: var(--ink); }
.lang { border: 1.5px solid var(--line); background: var(--card); border-radius: 999px; padding: 7px 14px; font: inherit; font-weight: 600; cursor: pointer; }

/* ---------- landing ---------- */
.hero { max-width: 980px; margin: 0 auto; padding: 36px 20px 18px; display: grid; gap: 24px; align-items: center; }
.hero h1 { font-size: clamp(32px, 8vw, 54px); letter-spacing: -0.8px; }
.hero h1 em { font-style: normal; color: var(--marigold); }
.hero p.lead { font-size: 18px; margin: 12px 0 18px; color: var(--muted); max-width: 34ch; }
.hero .fineprint { font-size: 14px; color: var(--muted); margin-top: 10px; }
.hero-art { display: grid; place-items: center; }
.hero-art .mini {
  width: 220px; aspect-ratio: 9 / 16; border-radius: 28px; overflow: hidden; border: 8px solid #1d1209;
  box-shadow: 0 24px 60px #2b1b0e33; background: #140b26;
}
.hero-art iframe { width: 360px; height: 640px; border: 0; transform: scale(0.567); transform-origin: 0 0; pointer-events: none; }
.steps { max-width: 980px; margin: 0 auto; padding: 8px 20px 10px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.step { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px; text-align: center; font-weight: 600; font-size: 15px; }
.step b { display: block; font-size: 24px; color: var(--marigold); }
.gallery { max-width: 980px; margin: 0 auto; padding: 18px 20px 40px; }
.gallery h2 { font-size: 22px; margin: 26px 0 12px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.tile {
  display: flex; flex-direction: column; gap: 10px; padding: 18px; border-radius: var(--radius);
  background: var(--card); border: 1px solid var(--line); box-shadow: 0 2px 0 #ecdcc866;
}
.tile-top { display: flex; gap: 12px; align-items: center; }
.tile-emoji { width: 52px; height: 52px; flex: none; display: grid; place-items: center; font-size: 28px; border-radius: 14px; }
.tile h3 { font-size: 18px; }
.tile p { margin: 0; color: var(--muted); font-size: 15px; flex: 1; }
.tile-actions { display: flex; gap: 8px; }
.tile-actions .btn { flex: 1; min-height: 44px; padding: 10px 14px; }
.site-footer { text-align: center; padding: 26px 20px 40px; color: var(--muted); font-size: 14px; }
.site-footer a { color: inherit; margin: 0 8px; }

/* ---------- creator ---------- */
.create-layout { max-width: 1040px; margin: 0 auto; padding: 18px 16px 120px; display: grid; gap: 22px; }
.t-head { display: flex; gap: 14px; align-items: center; margin-bottom: 16px; }
.t-emoji { width: 60px; height: 60px; flex: none; display: grid; place-items: center; font-size: 34px; border-radius: 16px; background: color-mix(in srgb, var(--t-accent) 18%, white); }
.t-head h1 { font-size: 26px; }
.t-head p { margin: 4px 0 0; font-size: 15px; }
.panel { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; }
.field { margin-bottom: 18px; }
.label { display: block; font-weight: 700; margin: 0 0 6px; font-size: 16px; }
.label .opt, .opt-line { font-weight: 500; color: var(--muted); font-size: 14px; }
.opt-line { display: block; margin: -4px 0 8px; }
.input {
  width: 100%; font: inherit; font-size: 17px; padding: 13px 14px; border-radius: 12px;
  border: 1.5px solid var(--line); background: #fffdf9; color: var(--ink);
}
textarea.input { resize: vertical; min-height: 104px; }
.input:focus { outline: 3px solid color-mix(in srgb, var(--marigold) 35%, transparent); border-color: var(--marigold); }
.input.bad { border-color: #c1121f; }
.meta { display: flex; justify-content: space-between; gap: 10px; min-height: 18px; }
.counter { font-size: 12px; color: var(--muted); margin-top: 4px; flex: none; }
.error { margin: 4px 0 0; color: #c1121f; font-size: 14px; font-weight: 600; }
.suggest { margin: 6px 0 0; font-size: 14px; color: var(--muted); background: #fff3e2; padding: 8px 10px; border-radius: 10px; white-space: pre-line; }
.suggest-k { font-weight: 700; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  font: inherit; font-size: 15px; padding: 10px 14px; border-radius: 999px; border: 1.5px solid var(--line);
  background: #fffdf9; color: var(--ink); cursor: pointer; text-align: left;
}
.chip[aria-checked='true'] { border-color: var(--marigold); background: #ffe8d1; font-weight: 700; }
.photo-btn {
  width: 100%; display: flex; align-items: center; justify-content: center; gap: 10px; padding: 22px;
  border: 2px dashed #e0c7a8; border-radius: 16px; background: #fffaf3; font: inherit; font-weight: 700; color: var(--ink); cursor: pointer;
}
.photo-plus { font-size: 26px; color: var(--marigold); }
.photo-has { display: flex; align-items: center; gap: 14px; }
.thumb { width: 92px; height: 92px; object-fit: cover; border-radius: 14px; border: 1px solid var(--line); }
.photo-actions { display: flex; gap: 14px; }
.link-btn { background: none; border: 0; font: inherit; font-weight: 700; color: var(--marigold-dark); cursor: pointer; padding: 8px 0; }
.consent { display: flex; gap: 8px; align-items: flex-start; margin-top: 10px; font-size: 14px; color: var(--muted); }
.consent input { width: 20px; height: 20px; margin: 1px 0 0; flex: none; accent-color: var(--marigold); }
.submit-bar {
  position: sticky; bottom: 0; margin: 4px -18px -18px; padding: 12px 18px max(14px, env(safe-area-inset-bottom));
  background: linear-gradient(180deg, #ffffff00, #ffffff 30%); border-radius: 0 0 var(--radius) var(--radius);
}
.status { margin: 8px 0 0; min-height: 1.4em; font-size: 15px; text-align: center; color: var(--muted); }
.status.is-error { color: #c1121f; font-weight: 600; }

.share h2 { font-size: 24px; margin-bottom: 10px; }
.share-url { word-break: break-all; background: #fff3e2; padding: 10px 12px; border-radius: 12px; margin: 0 0 14px; }
.share-buttons { display: grid; gap: 10px; }
.share-more { margin-top: 12px; text-align: center; }

.create-preview { position: relative; }
.preview-label { font-weight: 700; margin: 0 0 10px; text-align: center; }
.phone {
  width: 300px; height: 600px; margin: 0 auto; border-radius: 36px; overflow: hidden;
  border: 10px solid #1d1209; box-shadow: 0 24px 60px #2b1b0e33; background: #000;
}
.phone iframe { width: 100%; height: 100%; border: 0; display: block; background: #fff; }

@media (min-width: 860px) {
  .hero { grid-template-columns: 1.2fr 1fr; padding-top: 56px; }
  .create-layout { grid-template-columns: minmax(0, 1fr) 340px; align-items: start; }
  .create-preview { position: sticky; top: 76px; }
  .submit-bar { position: static; background: none; margin: 4px 0 0; padding: 0; }
}
@media (max-width: 380px) {
  .phone { width: 270px; height: 540px; }
  .steps { grid-template-columns: 1fr; }
}
