:root {
  --bg: #f5f6f8;
  --surface: #ffffff;
  --surface-2: #fafbfc;
  --border: rgba(17, 24, 39, 0.08);
  --border-strong: rgba(17, 24, 39, 0.14);
  --text: #11151c;
  --muted: #5b6472;
  --faint: #8a92a0;
  --prism: linear-gradient(120deg, #ff5d73, #ffb04c, #ffe14c, #4cd98b, #4cb8ff, #9b6bff);
  --prism-2: linear-gradient(120deg, #9b6bff, #4cb8ff, #4cd98b);
  --accent: #4f46e5;
  --accent-ink: #3730a3;
  --live: #0f6e56;
  --live-soft: #e3f5ee;
  --danger: #b42318;
  --r-sm: 10px;
  --r: 16px;
  --r-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, 0.06);
  --shadow: 0 6px 24px rgba(16, 24, 40, 0.08);
  --shadow-lg: 0 18px 50px rgba(16, 24, 40, 0.12);
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "PingFang SC", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }

.container { max-width: 1120px; margin: 0 auto; padding: 0 24px; }

/* ---------- Typography helpers ---------- */
.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: var(--prism);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin: 0 0 10px;
}
.section-title { font-size: clamp(24px, 3.4vw, 34px); line-height: 1.2; letter-spacing: -0.02em; margin: 0 0 10px; font-weight: 700; }
.section-sub { color: var(--muted); max-width: 620px; margin: 0; font-size: 16px; }
.muted { color: var(--muted); }
.small { font-size: 13px; }

/* ---------- Buttons ---------- */
.btn {
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  padding: 11px 20px;
  border-radius: 999px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  transition: transform 0.15s ease, box-shadow 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-1px); border-color: var(--accent); color: var(--accent); }
.btn:disabled { opacity: 0.45; cursor: not-allowed; }
.btn-primary {
  background: var(--prism);
  background-size: 160% 160%;
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 22px rgba(120, 90, 255, 0.28);
}
.btn-primary:hover:not(:disabled) { background-position: 100% 0; color: #fff; transform: translateY(-1px); box-shadow: 0 12px 28px rgba(120, 90, 255, 0.34); }
.btn-dark { background: var(--text); color: #fff; border-color: var(--text); }
.btn-dark:hover:not(:disabled) { background: #000; color: #fff; border-color: #000; }
.btn-ghost { background: transparent; border-color: transparent; color: var(--muted); }
.btn-ghost:hover:not(:disabled) { color: var(--text); background: rgba(17,24,39,0.04); }
.btn-sm { padding: 7px 13px; font-size: 13.5px; }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(245, 246, 248, 0.78);
  backdrop-filter: saturate(140%) blur(12px);
  -webkit-backdrop-filter: saturate(140%) blur(12px);
  border-bottom: 1px solid var(--border);
}
.site-header .container { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 17px; letter-spacing: -0.01em; }
.nav-links { display: flex; gap: 26px; }
.nav-links a { color: var(--muted); font-size: 14.5px; font-weight: 500; transition: color 0.15s ease; }
.nav-links a:hover { color: var(--text); }
.header-actions { display: flex; align-items: center; gap: 10px; }
.beta-badge {
  font-size: 11.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  padding: 4px 10px; border-radius: 999px; color: var(--live); background: var(--live-soft);
}
@media (max-width: 760px) { .nav-links { display: none; } }

/* ---------- Hero ---------- */
.hero { padding: 64px 0 40px; }
.hero-grid { display: grid; grid-template-columns: 1.05fr 0.95fr; gap: 48px; align-items: center; }
.hero h1 { font-size: clamp(34px, 5vw, 52px); line-height: 1.05; letter-spacing: -0.03em; margin: 8px 0 16px; font-weight: 800; }
.hero p.lede { font-size: 18px; color: var(--muted); margin: 0 0 26px; max-width: 480px; }
.hero-cta { display: flex; gap: 12px; flex-wrap: wrap; }
.hero-trust { margin-top: 22px; display: flex; gap: 18px; flex-wrap: wrap; color: var(--faint); font-size: 13.5px; }
.hero-trust span { display: inline-flex; align-items: center; gap: 6px; }
.dot { width: 7px; height: 7px; border-radius: 50%; background: var(--live); display: inline-block; }

/* Hero visual: before/after card */
.hero-visual { position: relative; }
.compare-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-lg);
  padding: 14px;
}
.compare-card .frames { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.compare-card figure { margin: 0; }
.compare-card .frame {
  aspect-ratio: 3 / 4;
  border-radius: var(--r-sm);
  overflow: hidden;
  background: var(--surface-2);
  position: relative;
  border: 1px solid var(--border);
}
.compare-card .frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.compare-card .frame.person { background: linear-gradient(160deg, #eef1f6, #e3e8f0); display: flex; align-items: center; justify-content: center; color: var(--faint); font-size: 13px; text-align: center; padding: 12px; }
.compare-card figcaption { font-size: 12px; color: var(--muted); margin-top: 8px; text-align: center; font-weight: 500; }
.compare-card .tag {
  position: absolute; top: 8px; left: 8px; font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em;
  text-transform: uppercase; padding: 3px 8px; border-radius: 999px; color: #fff; background: rgba(17,24,39,0.7);
}
.compare-card .tag.ai { background: var(--prism); }
.compare-divider { position: absolute; top: 14px; bottom: 38px; left: 50%; width: 2px; background: var(--surface); transform: translateX(-1px); box-shadow: 0 0 0 1px var(--border); }

@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; gap: 36px; }
  .hero-visual { max-width: 420px; }
}

/* ---------- Sections ---------- */
section.block { padding: 56px 0; }
.section-head { margin-bottom: 32px; }

/* Steps */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
.step {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 24px;
  box-shadow: var(--shadow-sm);
}
.step .num {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  font-weight: 700; color: #fff; background: var(--prism); margin-bottom: 14px; font-size: 15px;
}
.step h3 { margin: 0 0 6px; font-size: 17px; letter-spacing: -0.01em; }
.step p { margin: 0; color: var(--muted); font-size: 14.5px; }
@media (max-width: 760px) { .steps { grid-template-columns: 1fr; } }

/* ---------- Dropzone ---------- */
.dropzone {
  border: 1.5px dashed var(--border-strong);
  border-radius: var(--r);
  background: var(--surface-2);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  min-height: 280px;
  transition: border-color 0.15s ease, background 0.15s ease;
}
.dropzone.dragover { border-color: var(--accent); background: rgba(79, 70, 229, 0.05); }
.dz-empty { flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; text-align: center; cursor: pointer; padding: 10px; }
.dz-empty .ico { width: 44px; height: 44px; border-radius: 12px; display: grid; place-items: center; background: var(--prism); color: #fff; font-size: 22px; margin-bottom: 4px; }
.dz-empty strong { font-size: 15px; }
.dz-empty span { font-size: 13px; color: var(--muted); max-width: 240px; }
.dz-preview { position: relative; border-radius: var(--r-sm); overflow: hidden; background: #eef1f6; height: 150px; display: flex; align-items: center; justify-content: center; }
.dz-preview img { max-width: 100%; max-height: 100%; width: auto; height: auto; object-fit: contain; display: block; cursor: zoom-in; }
.dz-remove { position: absolute; top: 8px; right: 8px; }
.dz-label { font-size: 13px; font-weight: 600; color: var(--muted); }
.dz-label b { color: var(--text); }

.studio-actions { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; margin-top: 18px; }
.mock-toggle { font-size: 13.5px; color: var(--muted); display: inline-flex; align-items: center; gap: 7px; cursor: pointer; user-select: none; }
.hint { font-size: 13.5px; color: var(--muted); margin: 12px 0 0; }

/* Result */
.result-panel { margin-top: 20px; }
.result-card { background: var(--surface-2); border: 1px solid var(--border); border-radius: var(--r); padding: 18px; }
.compare { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.compare figure { margin: 0; }
.compare .shot { border-radius: var(--r-sm); overflow: hidden; border: 1px solid var(--border); background: #fff; aspect-ratio: 3/4; }
.compare .shot img { width: 100%; height: 100%; object-fit: contain; display: block; }
.compare figcaption { font-size: 12.5px; color: var(--muted); margin-top: 8px; text-align: center; }
.result-actions { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-top: 16px; }
.meta { font-size: 13px; color: var(--muted); }
.disclaimer { font-size: 12.5px; color: var(--muted); margin-top: 12px; }
.spinner { width: 22px; height: 22px; border: 2px solid rgba(79,70,229,0.2); border-top-color: var(--accent); border-radius: 50%; animation: spin 0.9s linear infinite; margin-bottom: 12px; }
@keyframes spin { to { transform: rotate(360deg); } }
.state p { margin: 0 0 12px; }
.error { color: var(--danger); }
@media (max-width: 640px) { .compare { grid-template-columns: 1fr; } }

/* ---------- Examples ---------- */
.examples-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.example {
  border: 1px solid var(--border); border-radius: var(--r); overflow: hidden; background: var(--surface);
  box-shadow: var(--shadow-sm); transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.example:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.example .shot { aspect-ratio: 3/4; overflow: hidden; position: relative; background: var(--surface-2); }
.example .shot img { width: 100%; height: 100%; object-fit: cover; display: block; }
.example .shot::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 56px; background: linear-gradient(to top, rgba(17,24,39,0.55), rgba(17,24,39,0)); }
.example .sample-tag { position: absolute; left: 10px; bottom: 10px; z-index: 2; font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #fff; background: rgba(17,24,39,0.55); padding: 3px 8px; border-radius: 999px; }
.example .body { padding: 14px 16px; }
.example .body h4 { margin: 0 0 4px; font-size: 15px; }
.example .body p { margin: 0; font-size: 13px; color: var(--muted); }
@media (max-width: 760px) { .examples-grid { grid-template-columns: 1fr; } }

/* ---------- Pricing ---------- */
.packs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; align-items: stretch; }
.pack {
  border: 1px solid var(--border); border-radius: var(--r); padding: 24px; background: var(--surface);
  display: flex; flex-direction: column; gap: 8px; box-shadow: var(--shadow-sm);
}
.pack.featured { border: 2px solid transparent; background:
  linear-gradient(var(--surface), var(--surface)) padding-box,
  var(--prism) border-box; box-shadow: var(--shadow); position: relative; }
.pack .ribbon { position: absolute; top: -11px; left: 50%; transform: translateX(-50%); font-size: 11px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: #fff; background: var(--prism); padding: 4px 12px; border-radius: 999px; }
.pack .p-name { font-size: 15px; font-weight: 700; }
.pack .p-price { font-size: 30px; font-weight: 800; letter-spacing: -0.02em; }
.pack .p-price small { font-size: 14px; font-weight: 500; color: var(--muted); }
.pack .p-note { font-size: 13px; color: var(--muted); }
.pack .btn { margin-top: auto; justify-content: center; }
.pricing-note { margin-top: 18px; font-size: 13.5px; color: var(--muted); text-align: center; }
@media (max-width: 760px) { .packs { grid-template-columns: 1fr; } }

/* ---------- FAQ ---------- */
.faq { display: grid; gap: 12px; max-width: 820px; }
.faq details { background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-sm); padding: 4px 18px; box-shadow: var(--shadow-sm); }
.faq summary { cursor: pointer; font-weight: 600; padding: 14px 0; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; font-size: 20px; color: var(--faint); font-weight: 400; }
.faq details[open] summary::after { content: "−"; }
.faq .answer { color: var(--muted); font-size: 14.5px; padding: 0 0 16px; margin: 0; }

/* ---------- Footer ---------- */
.site-footer { border-top: 1px solid var(--border); background: var(--surface); margin-top: 40px; }
.site-footer .container { padding: 36px 24px; display: flex; flex-wrap: wrap; gap: 18px; justify-content: space-between; align-items: center; }
.site-footer .f-brand { display: flex; align-items: center; gap: 10px; font-weight: 700; }
.site-footer .f-links { display: flex; gap: 20px; flex-wrap: wrap; font-size: 14px; color: var(--muted); }
.site-footer .f-links a:hover { color: var(--text); }
.site-footer .copy { width: 100%; color: var(--faint); font-size: 12.5px; border-top: 1px solid var(--border); padding-top: 16px; margin-top: 4px; }

/* visually hidden */
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

/* ---------- Features ---------- */
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 18px; }
.feature {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r);
  padding: 22px; box-shadow: var(--shadow-sm);
}
.feature .ico {
  width: 40px; height: 40px; border-radius: 11px; display: grid; place-items: center;
  background: var(--prism); color: #fff; margin-bottom: 14px;
}
.feature h3 { margin: 0 0 6px; font-size: 16px; letter-spacing: -0.01em; }
.feature p { margin: 0; color: var(--muted); font-size: 14px; }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; } }

/* ---------- Studio app frame ---------- */
body.studio-page .site-header .container { max-width: none; padding: 0 24px; }
.app-shell {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  min-height: calc(100vh - 64px);
  align-items: stretch;
}
.app-side {
  position: sticky;
  top: 64px;
  align-self: start;
  height: calc(100vh - 64px);
  overflow-y: auto;
  padding: 22px 12px;
  background: var(--surface);
  border-right: 1px solid var(--border);
}
.side-section { margin-top: 20px; }
.side-section:first-child { margin-top: 2px; }
.side-label {
  font-size: 11px; font-weight: 700; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--faint); padding: 0 10px 8px;
}
.tool-list { display: flex; flex-direction: column; gap: 2px; }
.tool-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: 9px;
  font-size: 14px; color: var(--muted); text-decoration: none;
  transition: background 0.12s ease, color 0.12s ease;
}
.ti-ico { width: 18px; height: 18px; flex: none; display: grid; place-items: center; }
.ti-ico svg { width: 18px; height: 18px; }
.ti-name { flex: 1; }
.tool-item:hover { background: rgba(17,24,39,0.05); color: var(--text); }
.tool-item.active { background: rgba(79,70,229,0.09); color: var(--accent-ink); font-weight: 600; }
.tool-item.soon { opacity: 0.55; }
.tool-item.soon:hover { background: transparent; color: var(--muted); }
.tool-soon { font-size: 10.5px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase; color: var(--faint); background: rgba(17,24,39,0.05); padding: 3px 8px; border-radius: 999px; }
.app-main {
  width: 100%;
  max-width: 1160px;
  margin: 0 auto;
  padding: 36px 40px 72px;
  min-width: 0;
}
@media (max-width: 1120px) {
  .app-shell { grid-template-columns: 216px minmax(0, 1fr); }
  .app-side { padding: 20px 10px; }
  .app-main { padding: 30px 26px 64px; }
}
@media (max-width: 640px) {
  .app-shell { grid-template-columns: 1fr; min-height: 0; }
  .app-side {
    position: static; height: auto; overflow: visible;
    border-right: none; border-bottom: 1px solid var(--border);
    padding: 14px 12px;
  }
  .side-section { margin-top: 12px; }
  .side-section:first-child { margin-top: 0; }
  .app-main { padding: 22px 18px 56px; }
}

/* ---------- Workbench layout: left inputs, right preview ---------- */
.studio-layout {
  display: grid;
  grid-template-columns: minmax(330px, 440px) 1fr;
  gap: 22px;
  align-items: start;
}
.studio-input { display: flex; flex-direction: column; gap: 16px; min-width: 0; }

.io-block {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  box-shadow: var(--shadow-sm);
}
.io-block .dropzone { min-height: 196px; padding: 14px; }
.io-block .dz-empty { gap: 6px; }
.io-block .dz-empty span { max-width: 280px; }

.studio-output {
  background: var(--surface-2);
  border: 1px solid var(--border);
  border-radius: var(--r);
  padding: 16px;
  min-height: 540px;
  position: sticky;
  top: 84px;
  display: flex;
}
.studio-output .result-panel { flex: 1; margin-top: 0; }
.studio-output .result-card { height: 100%; }
.studio-output .compare .shot { aspect-ratio: 4 / 5; }

.output-placeholder {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  text-align: center;
  padding: 32px;
}
.output-placeholder .ico {
  width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center;
  background: var(--prism);
  box-shadow: 0 10px 26px rgba(120, 90, 255, 0.22);
}
.output-placeholder p { margin: 0; font-size: 15px; font-weight: 600; color: var(--text); }
.output-placeholder .muted { font-size: 13px; font-weight: 400; max-width: 260px; }

@media (max-width: 980px) {
  .studio-layout { grid-template-columns: 1fr; }
  .studio-output { position: static; min-height: 420px; }
}

/* ---------- Result: single image + lightbox ---------- */
.result-single {
  display: flex; align-items: center; justify-content: center;
  border-radius: var(--r-sm); overflow: hidden;
  border: 1px solid var(--border); background: #fff;
}
.result-single img { max-width: 100%; max-height: 68vh; width: auto; height: auto; object-fit: contain; display: block; cursor: zoom-in; }

.lightbox {
  position: fixed; inset: 0; z-index: 200;
  background: rgba(10, 12, 16, 0.82);
  display: flex; align-items: center; justify-content: center;
  padding: 24px; cursor: zoom-out;
}
.lightbox[hidden] { display: none; }
.lightbox img { max-width: 94vw; max-height: 92vh; object-fit: contain; border-radius: 8px; box-shadow: 0 24px 70px rgba(0,0,0,0.55); }
