:root {
  --bg: #ffffff;
  --bg-soft: #f8fafc;
  --bg-card: #ffffff;
  --ink: #0f172a;
  --muted: #475569;
  --line: #e2e8f0;
  --accent: #be123c;
  --accent-ink: #ffffff;
  --accent-soft: #fff1f3;
  --shadow: 0 10px 30px -12px rgba(2, 6, 23, .18);
  --radius: 14px;
}
[data-theme="dark"] {
  --bg: #0b1120;
  --bg-soft: #0f172a;
  --bg-card: #111c33;
  --ink: #f1f5f9;
  --muted: #94a3b8;
  --line: #1e2a44;
  --accent: #fb7185;
  --accent-ink: #1a0a10;
  --accent-soft: #1e1417;
  --shadow: 0 12px 36px -14px rgba(0, 0, 0, .6);
}
* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Inter, Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--ink);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; }
img { max-width: 100%; display: block; }
.container { width: min(1120px, 92vw); margin: 0 auto; }

/* Header */
header.nav {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; padding: 14px 0; }
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; letter-spacing: -.02em; font-size: 1.15rem; }
.brand .dot { width: 22px; height: 22px; border-radius: 6px; background: var(--accent); display: grid; place-items: center; color: var(--accent-ink); font-size: 13px; }
.nav-links { display: flex; align-items: center; gap: 20px; }
.nav-links a { text-decoration: none; color: var(--muted); font-size: .92rem; font-weight: 600; }
.nav-links a:hover { color: var(--ink); }
.icon-btn { background: none; border: 1px solid var(--line); color: var(--ink); width: 38px; height: 38px; border-radius: 10px; cursor: pointer; font-size: 1rem; }
@media (max-width: 720px) { .nav-links a.hide-sm { display: none; } }

/* Buttons */
.btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 700; font-size: .95rem; border-radius: 11px; padding: 12px 20px; border: 1px solid transparent; cursor: pointer; text-decoration: none; transition: transform .06s ease, box-shadow .2s; }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: var(--accent-ink); box-shadow: var(--shadow); }
.btn-primary:hover { filter: brightness(1.05); }
.btn-ghost { background: var(--bg-card); color: var(--ink); border-color: var(--line); }
.btn-block { width: 100%; justify-content: center; }
.btn:disabled { opacity: .55; cursor: not-allowed; }

/* Hero */
.hero { padding: 72px 0 40px; text-align: center; }
.eyebrow { display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); background: var(--accent-soft); padding: 6px 12px; border-radius: 999px; margin-bottom: 18px; }
.hero h1 { font-size: clamp(2rem, 5vw, 3.3rem); line-height: 1.07; letter-spacing: -.03em; margin: 0 0 16px; }
.hero p.sub { font-size: clamp(1.05rem, 2.2vw, 1.28rem); color: var(--muted); max-width: 640px; margin: 0 auto 28px; }
.hero-cta { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.trust { margin-top: 22px; color: var(--muted); font-size: .88rem; }

/* Tool */
.tool { padding: 28px 0 56px; }
.tool-card { background: var(--bg-card); border: 1px solid var(--line); border-radius: 20px; box-shadow: var(--shadow); overflow: hidden; }
.tool-grid { display: grid; grid-template-columns: 360px 1fr; }
@media (max-width: 860px) { .tool-grid { grid-template-columns: 1fr; } }
.panel { padding: 22px; }
.panel.controls { border-right: 1px solid var(--line); }
@media (max-width: 860px) { .panel.controls { border-right: none; border-bottom: 1px solid var(--line); } }
.field { margin-bottom: 16px; }
.field label { display: block; font-size: .82rem; font-weight: 700; color: var(--muted); margin-bottom: 7px; }
.drop { border: 1.5px dashed var(--line); border-radius: 12px; padding: 16px; text-align: center; cursor: pointer; font-size: .88rem; color: var(--muted); transition: border-color .15s, background .15s; background: var(--bg-soft); }
.drop:hover, .drop.drag { border-color: var(--accent); background: var(--accent-soft); }
.drop.has { border-style: solid; border-color: var(--accent); color: var(--ink); }
.drop small { display: block; margin-top: 4px; }
.materials { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.mat { border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: .82rem; font-weight: 600; cursor: pointer; background: var(--bg-soft); text-align: left; color: var(--ink); }
.mat.active { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); }
input[type=range] { width: 100%; accent-color: var(--accent); }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input[type=text], input[type=email], input[type=number], textarea {
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px; background: var(--bg); color: var(--ink); font: inherit; font-size: .92rem;
}
input:focus, textarea:focus, .mat:focus-visible, .drop:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }

.preview { padding: 22px; display: flex; flex-direction: column; }
.canvas-wrap { flex: 1; min-height: 320px; border-radius: 14px; background: var(--bg-soft); border: 1px solid var(--line); display: grid; place-items: center; overflow: hidden; position: relative; }
.canvas-wrap img { width: 100%; height: 100%; object-fit: contain; }
.canvas-empty { color: var(--muted); font-size: .92rem; text-align: center; padding: 30px; }
.spinner { width: 34px; height: 34px; border: 3px solid var(--line); border-top-color: var(--accent); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.preview-actions { display: flex; gap: 10px; margin-top: 14px; flex-wrap: wrap; }

/* Sections */
section.block { padding: 60px 0; }
section.block.alt { background: var(--bg-soft); }
.h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); letter-spacing: -.02em; text-align: center; margin: 0 0 8px; }
.lead { text-align: center; color: var(--muted); max-width: 600px; margin: 0 auto 40px; }
.features { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; }
@media (max-width: 760px) { .features { grid-template-columns: 1fr; } }
.feature { background: var(--bg-card); border: 1px solid var(--line); border-radius: var(--radius); padding: 24px; }
.feature .ic { width: 42px; height: 42px; border-radius: 11px; background: var(--accent-soft); color: var(--accent); display: grid; place-items: center; font-size: 20px; margin-bottom: 14px; }
.feature h3 { margin: 0 0 6px; font-size: 1.08rem; }
.feature p { margin: 0; color: var(--muted); font-size: .94rem; }

/* Pricing */
.pricing { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; align-items: stretch; }
@media (max-width: 820px) { .pricing { grid-template-columns: 1fr; } }
.plan { background: var(--bg-card); border: 1px solid var(--line); border-radius: 16px; padding: 26px; display: flex; flex-direction: column; }
.plan.pop { border-color: var(--accent); box-shadow: var(--shadow); position: relative; }
.plan .tag { position: absolute; top: -12px; left: 50%; transform: translateX(-50%); background: var(--accent); color: var(--accent-ink); font-size: .72rem; font-weight: 800; padding: 4px 12px; border-radius: 999px; }
.plan h3 { margin: 0 0 4px; }
.price { font-size: 2.1rem; font-weight: 800; letter-spacing: -.02em; }
.price small { font-size: .9rem; font-weight: 600; color: var(--muted); }
.price .usd { display: block; font-size: .85rem; color: var(--muted); font-weight: 600; }
.plan ul { list-style: none; padding: 0; margin: 18px 0 22px; flex: 1; }
.plan li { padding: 7px 0; font-size: .92rem; color: var(--ink); display: flex; gap: 9px; }
.plan li::before { content: "✓"; color: var(--accent); font-weight: 800; }

/* FAQ */
.faq { max-width: 720px; margin: 0 auto; }
details { border-bottom: 1px solid var(--line); padding: 16px 0; }
summary { cursor: pointer; font-weight: 700; list-style: none; }
summary::-webkit-details-marker { display: none; }
details p { color: var(--muted); margin: 10px 0 0; }

/* Footer */
footer { border-top: 1px solid var(--line); padding: 40px 0; color: var(--muted); font-size: .88rem; }
.foot-inner { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }

/* Modal */
.modal-bg { position: fixed; inset: 0; background: rgba(2,6,23,.55); display: none; place-items: center; z-index: 100; padding: 20px; }
.modal-bg.open { display: grid; }
.modal { background: var(--bg-card); border-radius: 16px; padding: 26px; width: min(440px, 100%); box-shadow: var(--shadow); }
.modal h3 { margin: 0 0 6px; }
.modal p { color: var(--muted); margin: 0 0 18px; font-size: .92rem; }
.toast { position: fixed; bottom: 22px; left: 50%; transform: translateX(-50%); background: var(--ink); color: var(--bg); padding: 12px 20px; border-radius: 12px; font-size: .9rem; font-weight: 600; z-index: 200; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(-4px); }
.muted-note { font-size: .8rem; color: var(--muted); margin-top: 8px; }
