:root {
  --font: "Helvetica Neue", Helvetica, Arial, system-ui, sans-serif;
  --bg: #f7f6f2; --card: #ffffff; --ink: #15171c; --muted: #5d6270; --line: #e4e2da;
  --brand: #0f766e; --brand-ink: #ffffff; --accent: #ff6b4a; --soft: #e6f2f0; --warn-bg: #fff4dd; --warn-ink: #6b4a00;
  --radius: 14px; --shadow: 0 1px 2px rgba(20,20,30,.06), 0 8px 24px rgba(20,20,30,.06);
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #12141a; --card: #1b1e27; --ink: #eef0f4; --muted: #a2a8b6; --line: #2c303c;
    --brand: #2bb3a6; --brand-ink: #06201d; --soft: #15302e; --warn-bg: #3a2e12; --warn-ink: #f3d58a;
    --shadow: 0 1px 2px rgba(0,0,0,.4), 0 8px 24px rgba(0,0,0,.35);
  }
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 76px; }
body { margin: 0; background: var(--bg); color: var(--ink); font: 16px/1.5 var(--font); -webkit-font-smoothing: antialiased; }
h1, h2, h3 { line-height: 1.15; margin: 0 0 .5em; letter-spacing: -.01em; }
h1 { font-size: clamp(2rem, 5.2vw, 3.4rem); max-width: 18ch; margin-inline: auto; }
h1 em { font-style: normal; color: var(--brand); }
h2 { font-size: clamp(1.5rem, 3.4vw, 2.1rem); text-align: center; }
h3 { font-size: 1rem; }
a { color: var(--brand); }
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); }
[hidden] { display: none !important; }
:focus-visible { outline: 3px solid var(--accent); outline-offset: 2px; border-radius: 6px; }

.top { position: sticky; top: 0; z-index: 20; display: flex; align-items: center; gap: 18px; padding: 10px 16px; background: color-mix(in srgb, var(--bg) 88%, transparent); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.logo { display: flex; align-items: center; gap: 8px; text-decoration: none; color: var(--ink); font-weight: 800; font-size: 1.15rem; }
.logo b { color: var(--accent); }
.top nav { display: flex; gap: 16px; margin-left: auto; }
.top nav a { color: var(--ink); text-decoration: none; font-weight: 600; font-size: .95rem; }
.top nav a:hover { color: var(--brand); }
.usage { display: flex; flex-direction: column; gap: 3px; border: 1px solid var(--line); background: var(--card); color: var(--ink); border-radius: 10px; padding: 5px 10px; font: 600 .78rem/1.2 var(--font); cursor: pointer; min-width: 112px; }
.meter { display: block; height: 4px; background: var(--line); border-radius: 4px; overflow: hidden; }
.meter i { display: block; height: 100%; width: 0; background: var(--brand); transition: width .3s; }

.hero { text-align: center; padding: 56px 16px 28px; max-width: 880px; margin: 0 auto; }
.eyebrow { color: var(--brand); font-weight: 700; font-size: .85rem; text-transform: uppercase; letter-spacing: .06em; margin: 0 0 14px; }
.lede { font-size: 1.12rem; color: var(--muted); max-width: 60ch; margin: 16px auto 24px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin: 0; }
.privacy { color: var(--muted); font-size: .85rem; margin-top: 14px; }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; border: 1px solid transparent; border-radius: 999px; padding: 12px 22px; font: 700 1rem/1 var(--font); cursor: pointer; text-decoration: none; transition: transform .08s, background .15s; }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--brand); color: var(--brand-ink); }
.btn.primary:hover { filter: brightness(1.08); }
.btn.ghost { background: transparent; color: var(--ink); border-color: var(--line); }
.btn.ghost:hover { background: var(--soft); }
.btn.small { padding: 9px 16px; font-size: .9rem; }
.btn.wide { width: 100%; margin-top: 10px; }
.btn[disabled] { opacity: .55; cursor: progress; }

.studio { max-width: 1180px; margin: 0 auto; padding: 8px 16px 56px; }
.steps { display: flex; gap: 6px; list-style: none; padding: 0; margin: 0 0 14px; overflow-x: auto; }
.steps li { flex: 1 0 auto; }
.steps button { width: 100%; display: flex; align-items: center; justify-content: center; gap: 8px; padding: 11px 14px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); color: var(--muted); font: 700 .95rem/1 var(--font); cursor: pointer; white-space: nowrap; }
.steps button span { display: inline-grid; place-items: center; width: 22px; height: 22px; border-radius: 50%; background: var(--line); color: var(--ink); font-size: .78rem; }
.steps button[aria-selected="true"] { color: var(--ink); border-color: var(--brand); box-shadow: inset 0 -3px 0 var(--brand); }
.steps button[aria-selected="true"] span { background: var(--brand); color: var(--brand-ink); }

.step { display: grid; grid-template-columns: minmax(280px, 360px) 1fr; gap: 18px; align-items: start; }
.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.controls label { display: block; font-weight: 600; font-size: .9rem; margin-bottom: 12px; }
.controls label small { font-weight: 400; color: var(--muted); }
.controls input[type="text"], .controls input[type="number"], .controls select, .controls textarea {
  display: block; width: 100%; margin-top: 5px; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: 400 1rem/1.3 var(--font); }
.controls textarea { resize: vertical; }
.controls input[type="color"] { margin-left: 8px; width: 48px; height: 32px; border: 1px solid var(--line); border-radius: 8px; background: none; padding: 2px; }
.two { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.group { margin-top: 18px; padding-top: 4px; border-top: 1px solid var(--line); }
.group h3 { margin: 14px 0 8px; }
.row { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 4px 8px; }
.row input[type="range"] { grid-column: 1 / -1; width: 100%; accent-color: var(--brand); }
.check { display: flex !important; gap: 8px; align-items: center; font-weight: 500 !important; }
.check input { width: 18px; height: 18px; accent-color: var(--brand); }
.hint { color: var(--muted); font-size: .84rem; margin: 2px 0 12px; }
.notice { background: var(--warn-bg); color: var(--warn-ink); border-radius: 10px; padding: 10px 12px; font-size: .88rem; margin: 12px 0 0; }

.drop { display: grid; gap: 4px; text-align: center; padding: 26px 14px; border: 2px dashed var(--line); border-radius: var(--radius); cursor: pointer; background: var(--bg); margin: 0 !important; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--brand); background: var(--soft); }
.drop input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.drop span { color: var(--muted); font-weight: 400; font-size: .85rem; }

.swatches { display: grid; grid-template-columns: repeat(5, 1fr); gap: 8px; }
.swatches button { aspect-ratio: 1; border-radius: 12px; border: 2px solid var(--line); cursor: pointer; padding: 0; position: relative; }
.swatches button[aria-checked="true"] { border-color: var(--brand); box-shadow: 0 0 0 3px color-mix(in srgb, var(--brand) 30%, transparent); }
.swatches button span { position: absolute; inset: auto 0 -1px 0; font-size: .6rem; font-weight: 700; padding: 2px 0; background: rgba(255,255,255,.82); color: #222; border-radius: 0 0 10px 10px; text-align: center; }

.stage { position: relative; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); min-height: 320px; display: grid; place-items: center; }
.stage canvas { width: 100%; max-width: 640px; height: auto; border-radius: 10px; display: block; }
.stage canvas.checker { background: conic-gradient(#ddd 25%, #fff 0 50%, #ddd 0 75%, #fff 0) 0 0 / 24px 24px; }
.empty { text-align: center; color: var(--muted); padding: 40px 10px; }
.busy { position: absolute; inset: 0; display: grid; place-content: center; justify-items: center; gap: 8px; background: color-mix(in srgb, var(--card) 80%, transparent); border-radius: var(--radius); font-weight: 700; }
.spin { width: 28px; height: 28px; border-radius: 50%; border: 3px solid var(--line); border-top-color: var(--brand); animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.stage-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.stage-actions .primary { margin-left: auto; }

.out-title { font-size: 1.1rem; }
.field { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; margin-bottom: 12px; box-shadow: var(--shadow); }
.field header { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.field header h3 { margin: 0; flex: 1; }
.count { font-size: .78rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.count.over { color: #c0392b; font-weight: 700; }
.field textarea { width: 100%; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); padding: 10px 12px; font: 400 .95rem/1.5 var(--font); resize: vertical; }
.copy { border: 1px solid var(--line); background: var(--bg); color: var(--ink); border-radius: 999px; padding: 6px 12px; font: 700 .8rem/1 var(--font); cursor: pointer; }
.copy:hover { background: var(--soft); }
.tips { background: var(--soft); border-radius: var(--radius); padding: 12px 16px 12px 34px; font-size: .88rem; }
.tips li { margin: 4px 0; }

.promo-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 14px; }
.promo { margin: 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px; box-shadow: var(--shadow); display: flex; flex-direction: column; gap: 8px; }
.promo canvas { width: 100%; height: auto; border-radius: 8px; background: #eee; }
.promo figcaption { font-size: .85rem; }
.promo figcaption b { display: block; }
.promo figcaption small { color: var(--muted); display: block; margin: 2px 0 8px; }
.promo .dl { display: flex; gap: 6px; }
.promo .dl button { flex: 1; }

#videoOut { width: 100%; max-height: 520px; margin-top: 12px; border-radius: 12px; background: #000; }
.concepts { display: grid; gap: 14px; }
.concept { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; box-shadow: var(--shadow); }
.concept h4 { margin: 0 0 2px; font-size: 1.05rem; }
.concept .meta { color: var(--muted); font-size: .82rem; margin: 0 0 8px; }
.concept ol { list-style: none; padding: 0; margin: 10px 0; display: grid; gap: 8px; }
.concept li { display: grid; grid-template-columns: 62px 1fr; gap: 10px; font-size: .9rem; }
.concept li time { font-weight: 800; color: var(--brand); font-variant-numeric: tabular-nums; }
.concept li q { display: block; font-weight: 700; quotes: "“" "”"; }
.concept .foot-row { display: flex; gap: 8px; align-items: center; justify-content: space-between; flex-wrap: wrap; font-size: .85rem; color: var(--muted); }

.how, .pricing { max-width: 1080px; margin: 0 auto; padding: 40px 16px; }
.cards3 { list-style: none; padding: 0; margin: 24px 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 16px; }
.cards3 b { display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: 50%; background: var(--brand); color: var(--brand-ink); margin-bottom: 10px; }
.cards3 p { color: var(--muted); margin: 0; }
.sub { text-align: center; color: var(--muted); margin-top: -.2em; }
.plans { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 16px; margin-top: 24px; align-items: stretch; }
.plan { display: flex; flex-direction: column; position: relative; }
.plan.featured { border: 2px solid var(--brand); }
.plan .tag { position: absolute; top: -12px; left: 18px; background: var(--accent); color: #fff; font-size: .72rem; font-weight: 800; padding: 3px 10px; border-radius: 999px; text-transform: uppercase; letter-spacing: .04em; }
.plan .price { font-size: 2.4rem; font-weight: 800; margin: 4px 0; }
.plan .price small { font-size: .9rem; font-weight: 500; color: var(--muted); }
.plan ul { padding-left: 20px; margin: 10px 0 18px; flex: 1; }
.plan li { margin: 5px 0; }
.plan .btn { width: 100%; }
.demo-note { text-align: center; color: var(--muted); font-size: .85rem; margin-top: 18px; }

.foot { border-top: 1px solid var(--line); padding: 22px 16px; text-align: center; color: var(--muted); font-size: .82rem; }
.foot p { max-width: 760px; margin: 0 auto; }
.toast { position: fixed; left: 50%; bottom: 22px; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 11px 18px; border-radius: 999px; font-weight: 700; font-size: .9rem; z-index: 50; box-shadow: var(--shadow); max-width: calc(100vw - 32px); }

@media (max-width: 860px) {
  .step { grid-template-columns: 1fr; }
  .top nav { display: none; }
  .usage { margin-left: auto; }
  .stage-actions .primary { margin-left: 0; width: 100%; }
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .spin { animation-duration: 2s; } }

.styles { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.styles button { padding: 10px 8px; border-radius: 10px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); font: 700 .85rem/1.2 var(--font); cursor: pointer; }
.styles button[aria-checked="true"] { border-color: var(--brand); background: var(--soft); }
.themes { display: grid; grid-template-columns: repeat(6, 1fr); gap: 8px; }
.themes button { aspect-ratio: 1; border-radius: 50%; border: 3px solid var(--card); outline: 2px solid var(--line); cursor: pointer; padding: 0; }
.themes button[aria-checked="true"] { outline: 3px solid var(--brand); }
.moods { display: flex; flex-wrap: wrap; gap: 8px; }
.moods button { padding: 8px 12px; border-radius: 999px; border: 2px solid var(--line); background: var(--bg); color: var(--ink); font: 700 .82rem/1.2 var(--font); cursor: pointer; }
.moods button[aria-checked="true"] { border-color: var(--brand); background: var(--soft); }
.grid-title { grid-column: 1 / -1; margin: 6px 0 0; font-size: 1.05rem; }
.grid-title small { font-weight: 400; color: var(--muted); }
.stage canvas { max-width: 560px; }

.camera { display: inline-flex; position: relative; cursor: pointer; margin-bottom: 10px; }
.camera input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.promo .dl { flex-wrap: wrap; }
.promo .dl .primary { flex-basis: 100%; }

@media (max-width: 860px) {
  body { padding-bottom: env(safe-area-inset-bottom); }
  .top { padding: 8px 12px; padding-top: calc(8px + env(safe-area-inset-top)); }
  .hero { padding: 26px 16px 10px; }
  h1 { font-size: 1.95rem; }
  .lede { font-size: 1rem; margin: 12px auto 16px; }
  .btn, .copy, .steps button, .styles button, .usage { min-height: 46px; }
  .btn.small { padding: 10px 16px; }
  .steps { margin-inline: -16px; padding-inline: 16px; }
  .studio { padding-inline: 16px; }
  .step { gap: 12px; }
  .card { padding: 14px; }
  .swatches { grid-template-columns: repeat(5, 1fr); }
  .themes button { min-height: 0; }
  /* preview stays pinned while you change style and theme */
  #step-photo.has-photo .output { order: -1; position: sticky; top: calc(54px + env(safe-area-inset-top)); z-index: 6; background: var(--bg); padding: 6px 0; margin: 0 -16px; padding-inline: 16px; }
  #step-photo.has-photo .stage { min-height: 0; padding: 6px; }
  #step-photo.has-photo .stage canvas { width: auto; max-width: 100%; max-height: 40vh; margin: 0 auto; }
  /* thumb-reach action bar */
  #step-photo .stage-actions { position: fixed; left: 0; right: 0; bottom: 0; z-index: 30; margin: 0; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); background: color-mix(in srgb, var(--card) 94%, transparent); backdrop-filter: blur(10px); border-top: 1px solid var(--line); flex-wrap: nowrap; }
  #step-photo .stage-actions .btn { flex: 1; padding-inline: 8px; white-space: nowrap; }
  #step-photo .stage-actions .primary { flex: 1.6; margin: 0; width: auto; }
  #step-photo { padding-bottom: 76px; }
  .promo-grid { grid-template-columns: 1fr; }
  .promo { padding: 12px; }
  .promo canvas { max-height: 70vh; object-fit: contain; }
  .promo .dl .btn { min-height: 48px; }
  .toast { bottom: calc(86px + env(safe-area-inset-bottom)); }
}

.feed { width: 100%; display: grid; justify-items: center; }
.feed-head, .feed-cta, .feed-foot { display: none; }
.stage.mock { background: #fff; color: #111; padding: 0; overflow: hidden; }
.stage.mock .feed { max-width: 380px; margin: 0 auto; background: #fff; color: #111; text-align: left; justify-items: stretch; }
.stage.mock .feed-head { display: flex; align-items: center; gap: 10px; padding: 10px 12px; font-size: .85rem; }
.stage.mock .feed-head div { flex: 1; line-height: 1.15; }
.stage.mock .feed-head small { display: block; color: #6b7280; font-size: .72rem; }
.avatar { width: 32px; height: 32px; border-radius: 50%; background: conic-gradient(#f9ce34, #ee2a7b, #6228d7, #f9ce34); display: block; }
.stage.mock .feed canvas { max-width: 100%; max-height: none; border-radius: 0; width: 100%; }
.stage.mock .feed-cta { display: flex; justify-content: space-between; padding: 11px 12px; background: #0095f6; color: #fff; font-weight: 700; font-size: .9rem; }
.stage.mock .feed-foot { display: block; padding: 8px 12px 14px; font-size: .84rem; line-height: 1.35; }
.feed-icons { display: flex; gap: 14px; margin-bottom: 6px; }
.feed-icons svg { width: 24px; height: 24px; fill: none; stroke: #111; stroke-width: 1.7; stroke-linejoin: round; }
.feed-icons .push { margin-left: auto; }
#feedCaption { margin: 0; white-space: pre-line; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.feed-toggle { position: absolute; bottom: 14px; right: 14px; width: 40px; height: 40px; padding: 0; font-size: 1.1rem; z-index: 3; border: 1px solid var(--line); background: color-mix(in srgb, var(--card) 92%, transparent); color: var(--ink); border-radius: 999px; padding: 7px 12px; font: 700 .78rem/1 var(--font); cursor: pointer; }
@media (max-width: 860px) { #step-photo.has-photo .stage.mock canvas { max-height: none; } .feed-toggle { min-height: 36px; } }

.stage.mock .feed-toggle { top: 8px; bottom: auto; right: 8px; background: #fff; color: #111; }
@media (max-width: 860px) { .hide-sm { display: none; } .feed-toggle { min-height: 40px; } }

.inapp { position: sticky; top: 0; z-index: 40; display: flex; gap: 10px; align-items: flex-start; padding: 10px 14px; padding-top: calc(10px + env(safe-area-inset-top)); background: #fff4dd; color: #5b4200; font-size: .85rem; line-height: 1.35; border-bottom: 1px solid #f0dca8; }
.inapp span { flex: 1; }
.inapp button { border: 0; background: none; font-size: 1.1rem; color: inherit; cursor: pointer; min-width: 32px; min-height: 32px; }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .inapp { background: #3a2e12; color: #f3d58a; border-color: #5a4720; } }
