:root {
  --paper: #f6f1e7; --card: #fffdf8; --ink: #1c1a17; --muted: #7d7568; --line: #e3dccd; --line-strong: #cfc6b4;
  --accent: #ff4f1a; --accent-ink: #fff; --ok: #1f8a4c; --err: #c0341d;
  --radius: 14px; --shadow: 0 14px 40px -24px rgba(40, 28, 10, .45);
  --sans: 'Archivo', system-ui, -apple-system, sans-serif; --display: 'Archivo Black', 'Archivo', system-ui, sans-serif;
  --prism: linear-gradient(90deg, #ff4f1a, #ffb31a, #3fc46b, #1aa3ff, #7a4dff, #ff4fb0, #ff4f1a);
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; }
body { font: 400 16px/1.5 var(--sans); color: var(--ink); background: var(--paper); }
a { color: inherit; }
img { display: block; max-width: 100%; }
.wrap { max-width: 1180px; margin: 0 auto; padding: 0 20px; }

/* header */
.top { position: sticky; top: 0; z-index: 10; background: rgba(246, 241, 231, .92); backdrop-filter: blur(8px); border-bottom: 1px solid var(--line); }
.top::before { content: ''; display: block; height: 4px; background: var(--prism); background-size: 200% 100%; animation: shimmer 8s linear infinite; }
@keyframes shimmer { to { background-position: -200% 0; } }
.top .wrap { display: flex; align-items: center; gap: 16px; height: 60px; }
.logo { font: 400 21px/1 var(--display); text-decoration: none; letter-spacing: -.01em; display: flex; align-items: center; gap: 10px; }
.logo-mark { width: 26px; height: 26px; border-radius: 6px; background: repeating-linear-gradient(90deg, var(--ink) 0 3px, transparent 3px 6px), var(--prism); background-blend-mode: normal; }
.top nav { margin-left: auto; display: flex; gap: 18px; font-size: 14px; color: var(--muted); }

/* buttons + inputs */
.btn { font: 600 15px/1 var(--sans); border: 1px solid var(--line-strong); background: var(--card); color: var(--ink); border-radius: 10px; padding: 11px 16px; cursor: pointer; display: inline-flex; align-items: center; justify-content: center; gap: 8px; text-decoration: none; transition: transform .08s, background .15s, border-color .15s; }
.btn:hover { border-color: var(--ink); }
.btn:active { transform: translateY(1px); }
.btn.primary { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }
.btn.primary:hover { background: #e9400e; }
.btn.big { padding: 16px 22px; font-size: 17px; border-radius: 12px; width: 100%; }
.btn.small { padding: 7px 10px; font-size: 13px; border-radius: 8px; }
.btn:disabled { opacity: .5; cursor: default; }
.btn.on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
input, select, textarea { font: 400 15px/1.3 var(--sans); color: var(--ink); background: var(--card); border: 1px solid var(--line-strong); border-radius: 8px; padding: 10px 12px; width: 100%; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 79, 26, .15); }
input[type=range] { padding: 0; border: 0; background: none; accent-color: var(--accent); box-shadow: none; }
label.f { display: block; font-size: 13px; font-weight: 600; margin-bottom: 10px; }
label.f > span { display: block; margin-bottom: 4px; }
.seg { display: inline-flex; border: 1px solid var(--line-strong); border-radius: 9px; overflow: hidden; background: var(--card); }
.seg button { font: 600 13px/1 var(--sans); border: 0; background: none; padding: 9px 12px; cursor: pointer; color: var(--muted); }
.seg button + button { border-left: 1px solid var(--line-strong); }
.seg button.on { background: var(--ink); color: var(--paper); }
.muted { color: var(--muted); }
.err { color: var(--err); font-size: 14px; }
.kbd { font: 600 11px/1 ui-monospace, monospace; border: 1px solid var(--line-strong); border-bottom-width: 2px; border-radius: 4px; padding: 2px 5px; background: var(--card); }

/* home */
.hero { display: grid; grid-template-columns: 1.05fr 1fr; gap: 48px; align-items: center; padding: 56px 0 40px; }
.hero h1 { font: 400 clamp(38px, 5.2vw, 64px)/1.0 var(--display); letter-spacing: -.02em; margin: 0 0 18px; }
.hero h1 em { font-style: normal; background: var(--prism); background-size: 200% 100%; -webkit-background-clip: text; background-clip: text; color: transparent; animation: shimmer 6s linear infinite; }
.hero p.lede { font-size: 19px; color: #4a453c; max-width: 34em; margin: 0 0 22px; }
.drop { display: grid; place-items: center; gap: 10px; text-align: center; min-height: 340px; padding: 32px; border: 2px dashed var(--line-strong); border-radius: 20px; background: var(--card); cursor: pointer; transition: border-color .15s, background .15s, transform .15s; box-shadow: var(--shadow); position: relative; overflow: hidden; }
.drop:hover, .drop.over { border-color: var(--accent); background: #fff8f0; }
.drop.over { transform: scale(1.01); }
.drop b { font: 400 24px/1.1 var(--display); }
.drop .icon { width: 64px; height: 64px; border-radius: 14px; background: repeating-linear-gradient(90deg, rgba(0,0,0,.85) 0 4px, transparent 4px 8px), var(--prism); }
.progress { width: 100%; max-width: 320px; height: 8px; border-radius: 99px; background: var(--line); overflow: hidden; }
.progress > i { display: block; height: 100%; width: 0; background: var(--prism); background-size: 200% 100%; animation: shimmer 2s linear infinite; transition: width .2s; }
.steps { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; padding: 10px 0 60px; counter-reset: s; list-style: none; margin: 0; }
.steps li { counter-increment: s; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 20px; }
.steps li::before { content: counter(s); font: 400 28px/1 var(--display); display: block; margin-bottom: 8px; color: var(--accent); }
.steps b { display: block; margin-bottom: 4px; }
.steps span { color: var(--muted); font-size: 14.5px; }
.foot { border-top: 1px solid var(--line); padding: 24px 0 40px; color: var(--muted); font-size: 14px; }

/* editor */
.ed { display: grid; grid-template-columns: minmax(0, 1fr) 330px; gap: 24px; padding: 24px 0 40px; align-items: start; }
.stage { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 18px; box-shadow: var(--shadow); }
.stage-head { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 14px; }
.stage-head h1 { font: 400 22px/1.1 var(--display); margin: 0 auto 0 0; }
.canvas-wrap { display: grid; place-items: center; background: repeating-conic-gradient(#ece5d6 0 25%, #f4eee2 0 50%) 0 0 / 22px 22px; border-radius: 12px; padding: 20px; }
.canvas-box { position: relative; width: 100%; }
.canvas-box canvas { display: block; width: 100%; height: 100%; border-radius: 3px; box-shadow: 0 10px 30px -10px rgba(0,0,0,.45); cursor: grab; touch-action: none; background: #fff; }
.canvas-box canvas.drag { cursor: grabbing; }
.canvas-box .size-tag { position: absolute; right: 8px; bottom: 8px; font: 600 11px/1 var(--sans); background: rgba(0,0,0,.6); color: #fff; padding: 5px 7px; border-radius: 6px; pointer-events: none; }
.canvas-box .lens { position: absolute; inset: 0; pointer-events: none; border-radius: 3px; opacity: .10; mix-blend-mode: multiply; }
.tools { display: grid; grid-template-columns: auto 1fr auto; gap: 10px 16px; align-items: center; margin-top: 14px; }
.tools .lbl { font-size: 13px; font-weight: 600; color: var(--muted); }
.tools .row { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.swatch { width: 28px; height: 28px; border-radius: 8px; border: 1px solid var(--line-strong); cursor: pointer; padding: 0; }
.swatch.on { box-shadow: 0 0 0 2px var(--paper), 0 0 0 4px var(--ink); }
.swatch input { opacity: 0; width: 100%; height: 100%; cursor: pointer; }
.swatch.custom { background: conic-gradient(red, yellow, lime, cyan, blue, magenta, red); position: relative; overflow: hidden; }

.frames { margin-top: 22px; }
.frames-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 10px; margin-bottom: 10px; }
.frames-head h2 { font: 400 18px/1.1 var(--display); margin: 0 auto 0 0; }
.strip { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 10px; }
@media (max-width: 520px) { .strip { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.slot { background: var(--paper); border: 1px solid var(--line); border-radius: 10px; padding: 6px; cursor: pointer; transition: border-color .12s, box-shadow .12s; min-width: 0; }
.slot:hover { border-color: var(--line-strong); }
.slot.on { border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent); }
.slot .th { position: relative; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: #ddd; }
.slot .th img { width: 100%; height: 100%; object-fit: cover; }
.slot .num { position: absolute; left: 4px; top: 4px; font: 400 12px/1 var(--display); background: rgba(0,0,0,.65); color: #fff; padding: 3px 5px; border-radius: 4px; }
.slot .shift { position: absolute; right: 4px; top: 4px; font: 700 10.5px/1 var(--sans); background: var(--accent); color: #fff; padding: 3px 5px; border-radius: 4px; }
.slot .meta { font-size: 11px; color: var(--muted); text-align: center; margin: 4px 0 3px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.slot .nudge { display: grid; grid-template-columns: 1fr 1fr; gap: 4px; }
.slot .nudge button { font: 700 13px/1 var(--sans); border: 1px solid var(--line-strong); background: var(--card); border-radius: 6px; padding: 6px 0; cursor: pointer; }
.slot .nudge button:hover { border-color: var(--ink); }
.range2 { display: grid; grid-template-columns: auto 1fr auto; gap: 6px 12px; align-items: center; margin-top: 16px; font-size: 13px; }
.range2 output { font: 600 12px/1 ui-monospace, monospace; color: var(--muted); min-width: 5.5em; text-align: right; }

.panel { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 20px; box-shadow: var(--shadow); position: sticky; top: 84px; }
.panel h2 { font: 400 20px/1.1 var(--display); margin: 0 0 4px; }
.price-big { font: 400 40px/1 var(--display); margin: 14px 0 4px; }
.lines { font-size: 14px; border-top: 1px solid var(--line); margin: 14px 0; padding-top: 10px; }
.lines div { display: flex; justify-content: space-between; padding: 3px 0; }
.lines .tot { font-weight: 700; border-top: 1px solid var(--line); margin-top: 6px; padding-top: 8px; }
.qty { display: flex; align-items: center; gap: 8px; }
.qty input { width: 70px; text-align: center; }
.specs { font-size: 13px; color: var(--muted); margin: 14px 0 0; padding: 0; list-style: none; }
.specs li { padding: 3px 0; display: flex; gap: 8px; }
.specs li::before { content: '▸'; color: var(--accent); }
.saved { font-size: 12px; color: var(--muted); min-height: 1.2em; margin-top: 8px; text-align: center; }

.processing { display: grid; place-items: center; gap: 14px; min-height: 60vh; text-align: center; }
.processing b { font: 400 26px/1.1 var(--display); }

/* dialog — same checkout form as crashprints */
dialog { border: 0; border-radius: 16px; padding: 0; width: min(560px, calc(100vw - 32px)); background: var(--card); color: var(--ink); box-shadow: 0 30px 80px -20px rgba(0,0,0,.45); }
dialog::backdrop { background: rgba(28, 26, 23, .5); backdrop-filter: blur(2px); }
dialog form, .dlg-body { padding: 22px 24px 24px; max-height: calc(100vh - 60px); overflow: auto; }
.dlg-head { display: flex; align-items: center; margin-bottom: 6px; }
.dlg-head h2 { font: 400 22px/1.1 var(--display); margin: 0 auto 0 0; }
.x { border: 0; background: none; font-size: 26px; line-height: 1; cursor: pointer; color: var(--muted); padding: 4px 8px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 0 12px; }
.grid3 { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 0 12px; }
fieldset { border: 0; padding: 0; margin: 14px 0 0; }
legend { font: 700 14px/1 var(--sans); margin-bottom: 10px; padding: 0; }
legend small { font-weight: 400; color: var(--muted); }
.card-box { min-height: 50px; margin-bottom: 8px; }
.card-field { border: 1px solid var(--line-strong); border-radius: 8px; padding: 13px 12px; background: #fff; }
.card-field.StripeElement--focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(255, 79, 26, .15); }
.card-err { color: var(--err); font-size: 13px; margin: 6px 0 0; min-height: 1em; }
.sandbox { font-size: 12.5px; background: #fff4d6; border: 1px solid #f1d58a; border-radius: 8px; padding: 8px 10px; margin: 0 0 10px; }
.secure { font-size: 12.5px; color: var(--muted); display: flex; gap: 6px; align-items: center; margin: 0 0 12px; }
.form-err { background: #fdecea; color: var(--err); border-radius: 8px; padding: 10px 12px; font-size: 14px; margin: 12px 0 0; }
.dlg-summary { font-size: 14px; color: var(--muted); margin: 0 0 6px; }
.done { text-align: center; padding: 10px 0; }
.done .mark { display: inline-grid; place-items: center; width: 56px; height: 56px; border-radius: 50%; background: var(--ok); color: #fff; font-size: 30px; margin-bottom: 10px; }

/* order page */
.order-page { max-width: 760px; margin: 40px auto; }
.order-card { background: var(--card); border: 1px solid var(--line); border-radius: 18px; padding: 26px; box-shadow: var(--shadow); }
.order-card h1 { font: 400 28px/1.1 var(--display); margin: 0 0 6px; }
.timeline { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin: 22px 0; }
.timeline div { border-top: 4px solid var(--line); padding-top: 8px; font-size: 13px; color: var(--muted); font-weight: 600; }
.timeline div.on { border-color: var(--accent); color: var(--ink); }
.thumbs { display: grid; grid-template-columns: repeat(12, 1fr); gap: 4px; margin: 12px 0 18px; }
.thumbs img { aspect-ratio: 1; object-fit: cover; border-radius: 4px; width: 100%; }
dl.kv { display: grid; grid-template-columns: max-content 1fr; gap: 6px 18px; font-size: 15px; margin: 0; }
dl.kv dt { color: var(--muted); }
dl.kv dd { margin: 0; }

@media (max-width: 900px) {
  .hero { grid-template-columns: 1fr; gap: 28px; padding-top: 32px; }
  .steps { grid-template-columns: 1fr 1fr; }
  .ed { grid-template-columns: 1fr; }
  .panel { position: static; }
  .tools { grid-template-columns: 1fr; }
  .thumbs { grid-template-columns: repeat(6, 1fr); }
}
@media (prefers-reduced-motion: reduce) { *, *::before { animation: none !important; } }
