:root {
  --paper: #F5F6FA;
  --card: #FFFFFF;
  --ink: #1B1F3B;
  --muted: #5A5F7D;
  --line: #DADDEA;
  --cyan: #00A6D6;
  --magenta: #E5007D;
  --yellow: #FFD200;
  --wa: #1FA855;
  --display: "Bricolage Grotesque", "Segoe UI", system-ui, sans-serif;
  --body: "Instrument Sans", "Segoe UI", system-ui, sans-serif;
  color-scheme: light;
  box-sizing: border-box;
  padding-top: env(safe-area-inset-top, 0px);
  padding-bottom: env(safe-area-inset-bottom, 0px);
}
*, *::before, *::after { box-sizing: inherit; }
html { scroll-behavior: smooth; scroll-padding-top: calc(72px + env(safe-area-inset-top, 0px)); }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 1rem/1.55 var(--body); -webkit-font-smoothing: antialiased; }
img, canvas { max-width: 100%; display: block; }
a { color: inherit; }
h1, h2, h3 { font-family: var(--display); line-height: 1.05; margin: 0; letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 3.5vw, 2.5rem); font-weight: 800; }
h3 { font-size: 1.125rem; font-weight: 700; letter-spacing: -0.01em; }
p { margin: 0; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.center { text-align: center; }
:focus-visible { outline: 3px solid var(--cyan); outline-offset: 2px; }
button { font: inherit; color: inherit; cursor: pointer; }

/* logo: three overlapping process-ink dots */
.logo { display: inline-flex; align-items: center; gap: .55rem; font: 800 1.25rem/1 var(--display); text-decoration: none; letter-spacing: -0.02em; }
.logo-dots { position: relative; width: 26px; height: 22px; flex: none; }
.logo-dots i { position: absolute; width: 14px; height: 14px; border-radius: 50%; mix-blend-mode: multiply; }
.logo-dots i:nth-child(1) { background: var(--cyan); left: 0; top: 0; }
.logo-dots i:nth-child(2) { background: var(--magenta); left: 9px; top: 0; }
.logo-dots i:nth-child(3) { background: var(--yellow); left: 4.5px; top: 8px; }
.logo-dots.big { width: 64px; height: 56px; margin: 0 auto 1rem; }
.logo-dots.big i { width: 36px; height: 36px; }
.logo-dots.big i:nth-child(2) { left: 24px; }
.logo-dots.big i:nth-child(3) { left: 12px; top: 20px; }

/* header */
.top { position: sticky; top: env(safe-area-inset-top, 0px); z-index: 10; display: flex; align-items: center; gap: 1.5rem; padding: .85rem clamp(1rem, 4vw, 3rem); background: rgba(245,246,250,.92); backdrop-filter: blur(10px); border-bottom: 1px solid var(--line); }
.top-nav { display: flex; gap: 1.25rem; margin-left: auto; }
.top-nav a { text-decoration: none; font-weight: 500; color: var(--muted); }
.top-nav a:hover { color: var(--ink); }
.cart-btn { display: inline-flex; align-items: center; gap: .5rem; padding: .55rem .9rem; border: 1.5px solid var(--ink); border-radius: 999px; background: none; font-weight: 600; }
.cart-count { min-width: 1.5rem; height: 1.5rem; padding: 0 .35rem; display: grid; place-items: center; border-radius: 999px; background: var(--ink); color: #fff; font-size: .8rem; }
@media (max-width: 640px) { .top-nav { display: none; } .cart-btn { margin-left: auto; } }

/* buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: .5rem; min-height: 48px; padding: .7rem 1.4rem; border-radius: 999px; border: 1.5px solid transparent; font-weight: 600; text-decoration: none; transition: transform .15s ease, background .15s ease; }
.btn:active { transform: translateY(1px); }
.btn:disabled { opacity: .6; cursor: progress; }
.btn-primary { background: var(--ink); color: #fff; }
.btn-primary:hover { background: #2B3160; }
.btn-ghost { background: #fff; border-color: var(--line); }
.btn-ghost:hover { border-color: var(--ink); }
.btn-wa { background: var(--wa); color: #fff; }
.btn-link { background: none; border: 0; padding: .25rem 0; text-decoration: underline; text-underline-offset: 3px; color: var(--muted); }
.btn-link:hover { color: var(--ink); }
.wide { width: 100%; }
.grow { flex: 1; }
.icon-btn { width: 40px; height: 40px; flex: none; border-radius: 50%; border: 1px solid var(--line); background: #fff; font-size: 1rem; }

.chips { display: flex; flex-wrap: wrap; gap: .5rem; }
.chip { padding: .45rem .95rem; border-radius: 999px; border: 1.5px solid var(--line); background: #fff; font-weight: 500; font-size: .9375rem; }
.chip:hover { border-color: var(--ink); }
.chip[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: #fff; }

/* hero */
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); align-items: center; gap: clamp(1.5rem, 4vw, 4rem); padding: clamp(2rem, 6vw, 5rem) clamp(1rem, 4vw, 3rem) clamp(2.5rem, 6vw, 5rem); max-width: 1280px; margin: 0 auto; }
.hero h1 { font-size: clamp(2.5rem, 6vw, 4.75rem); font-weight: 800; letter-spacing: -0.035em; max-width: 12ch; }
.lede { margin: 1.25rem 0 1.75rem; font-size: 1.125rem; color: var(--muted); max-width: 46ch; }
.field-label { display: block; font-weight: 600; font-size: .9375rem; margin-bottom: .4rem; }
.hero-copy .hero-input { width: 100%; max-width: 26rem; padding: .8rem 1rem; font: 700 1.5rem/1.2 var(--display); color: var(--ink); background: #fff; border: 2px solid var(--ink); border-radius: 14px; margin-bottom: 1rem; }
.hero-copy .chips { margin-bottom: 1.5rem; }

.hero-stage { position: relative; aspect-ratio: 1; width: 100%; max-width: 620px; justify-self: center; }
.hero-stage canvas { position: relative; z-index: 2; width: 100%; height: 100%; }
.ink { position: absolute; width: 58%; aspect-ratio: 1; border-radius: 50%; mix-blend-mode: multiply; opacity: .9; }
.ink-c { background: var(--cyan); left: 6%; top: 8%; }
.ink-m { background: var(--magenta); right: 6%; top: 8%; }
.ink-y { background: var(--yellow); left: 21%; bottom: 4%; }
.reg { position: absolute; width: 34px; z-index: 1; fill: none; stroke: var(--ink); stroke-width: 1.5; opacity: .55; }
.reg-tl { left: 0; top: 0; }
.reg-br { right: 0; bottom: 0; }
@media (prefers-reduced-motion: no-preference) {
  .ink { animation: register 1.1s cubic-bezier(.2,.8,.2,1) both .15s; }
  .ink-c { --dx: -46px; --dy: -18px; }
  .ink-m { --dx: 46px; --dy: -24px; }
  .ink-y { --dx: 8px; --dy: 44px; }
}
@keyframes register { from { transform: translate(var(--dx), var(--dy)); opacity: 0; } to { transform: none; opacity: .9; } }

@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 1.5rem; }
  .hero-stage { order: -1; max-width: min(340px, 80vw); }
  .hero h1 { max-width: 14ch; }
}

/* shop */
.shop, .how { max-width: 1280px; margin: 0 auto; padding: clamp(2.5rem, 6vw, 4.5rem) clamp(1rem, 4vw, 3rem); }
.shop { border-top: 1px solid var(--line); }
.shop-head { display: flex; flex-wrap: wrap; align-items: end; justify-content: space-between; gap: 1rem; margin-bottom: 1.75rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(230px, 1fr)); gap: 1.25rem; }
.card { background: var(--card); border-radius: 20px; overflow: hidden; border: 1px solid var(--line); display: flex; flex-direction: column; }
.card-hit { border: 0; padding: 0; background: #EEF0F6; display: block; width: 100%; }
.card-hit canvas { width: 100%; height: auto; aspect-ratio: 1; }
.card-body { padding: 1rem 1.1rem 1.2rem; display: grid; gap: .2rem; }
.price { font: 700 1.125rem/1.3 var(--display); }
.shop-note { margin-top: 2rem; color: var(--muted); }
@media (max-width: 520px) { .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .75rem; } .card { border-radius: 14px; } .card-body { padding: .7rem .75rem .9rem; } .card-body h3 { font-size: 1rem; } }

/* steps: a real sequence, so numbered */
.how { border-top: 1px solid var(--line); }
.steps { list-style: none; counter-reset: step; padding: 0; margin: 2rem 0 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 1.75rem; }
.steps li { counter-increment: step; }
.steps li::before { content: counter(step); display: grid; place-items: center; width: 2.5rem; height: 2.5rem; border-radius: 50%; margin-bottom: .9rem; font: 800 1.1rem/1 var(--display); color: #fff; background: var(--ink); }
.steps li:nth-child(1)::before { background: var(--cyan); }
.steps li:nth-child(2)::before { background: var(--magenta); }
.steps li:nth-child(3)::before { background: var(--yellow); color: var(--ink); }
.steps p { color: var(--muted); margin-top: .4rem; max-width: 34ch; }

/* footer */
.foot { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 1.5rem; padding: 2.5rem clamp(1rem, 4vw, 3rem) calc(2.5rem + env(safe-area-inset-bottom, 0px)); background: var(--ink); color: #D6D9EA; }
.foot .logo { color: #fff; margin-bottom: .5rem; }
.foot .logo-dots i { mix-blend-mode: screen; }
.foot-links { display: flex; flex-wrap: wrap; gap: 1.25rem; align-items: center; }
.foot-links a { text-decoration: none; }
.foot-links a:hover { text-decoration: underline; }

/* dialogs */
dialog.sheet { border: 0; padding: 0; background: var(--paper); color: var(--ink); max-width: none; max-height: none; }
dialog.sheet::backdrop { background: rgba(27,31,59,.5); }
.editor-head { display: flex; justify-content: space-between; align-items: start; gap: 1rem; margin-bottom: 1.25rem; }
.editor-head h2 { font-size: 1.6rem; }
.editor-head p { margin-top: .35rem; font-size: .9375rem; }

.editor { width: min(1080px, 100vw - 2rem); height: min(760px, 100dvh - 2rem); border-radius: 24px; overflow: hidden; }
.editor-inner { display: grid; grid-template-columns: 1.05fr 1fr; height: 100%; }
.editor-preview { background: #EEF0F6; display: grid; place-items: center; align-content: center; padding: 1.5rem; gap: .5rem; }
.editor-preview canvas { width: 100%; max-width: 520px; aspect-ratio: 1; }
.editor-preview canvas.draggable { cursor: grab; touch-action: none; }
.editor-preview canvas.draggable:active { cursor: grabbing; }
.hint { font-size: .875rem; color: var(--muted); }
.editor-controls { overflow-y: auto; padding: 1.5rem 1.75rem 1.75rem; display: grid; gap: 1.25rem; align-content: start; }
fieldset { border: 0; padding: 0; margin: 0; }
legend { font-weight: 600; font-size: .9375rem; margin-bottom: .5rem; padding: 0; }
#edTextBlock, #edPhotoBlock { display: grid; gap: 1rem; }
#edTextBlock[hidden], #edPhotoBlock[hidden], fieldset[hidden] { display: none; }
textarea, input:not([type]), input[type=text], input[type=email] { width: 100%; font: inherit; padding: .7rem .85rem; border: 1.5px solid var(--line); border-radius: 12px; background: #fff; color: var(--ink); }
textarea:focus, input:focus { border-color: var(--ink); outline: none; }
#edText { font: 600 1.125rem/1.35 var(--body); resize: none; }

.swatches { display: flex; flex-wrap: wrap; gap: .6rem; }
.swatch { width: 38px; height: 38px; border-radius: 50%; border: 1px solid rgba(27,31,59,.25); background: var(--sw); box-shadow: inset 0 0 0 3px var(--paper); padding: 0; }
.swatch[aria-pressed="true"] { outline: 2.5px solid var(--ink); outline-offset: 2px; }
.fonts { display: grid; grid-template-columns: repeat(auto-fill, minmax(56px, 1fr)); gap: .5rem; }
.font-btn { height: 52px; border-radius: 12px; border: 1.5px solid var(--line); background: #fff; font-size: 1.4rem; line-height: 1; }
.font-btn[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: #fff; }
.sliders { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; }
.sliders label, .slider-single { display: grid; gap: .3rem; font-size: .875rem; font-weight: 500; color: var(--muted); }
.slider-single[hidden] { display: none; }
input[type=range] { width: 100%; accent-color: var(--ink); }
.photo-row { display: flex; align-items: center; gap: 1rem; flex-wrap: wrap; }
.file-btn { position: relative; overflow: hidden; }
.file-btn input { position: absolute; inset: 0; opacity: 0; cursor: pointer; }
.file-btn:focus-within { outline: 3px solid var(--cyan); outline-offset: 2px; }

.buy-row { display: flex; gap: .75rem; align-items: center; position: sticky; bottom: -1.75rem; background: var(--paper); padding: .75rem 0 1rem; margin-bottom: -1rem; }
.qty { display: inline-flex; align-items: center; border: 1.5px solid var(--line); border-radius: 999px; background: #fff; }
.qty button { width: 44px; height: 46px; border: 0; background: none; font-size: 1.2rem; }
.qty output { min-width: 1.75rem; text-align: center; font-weight: 600; }
.qty.sm button { width: 34px; height: 34px; }
.error { color: #B00043; font-size: .9375rem; font-weight: 500; }
.error:empty { display: none; }

@media (max-width: 820px) {
  .editor { width: 100vw; height: 100dvh; border-radius: 0; }
  .editor-inner { grid-template-columns: 1fr; grid-template-rows: auto 1fr; overflow-y: auto; }
  .editor-preview { padding: .75rem; position: sticky; top: 0; z-index: 2; padding-top: calc(.75rem + env(safe-area-inset-top, 0px)); }
  .editor-preview canvas { max-width: min(340px, 42dvh); }
  .editor-controls { overflow: visible; padding: 1.25rem 1rem calc(1rem + env(safe-area-inset-bottom, 0px)); }
  .buy-row { bottom: 0; margin-bottom: 0; }
}

/* cart drawer */
.drawer { margin: 0 0 0 auto; width: min(460px, 100vw); height: 100dvh; }
.drawer-inner { padding: calc(1.25rem + env(safe-area-inset-top, 0px)) 1.25rem calc(1.5rem + env(safe-area-inset-bottom, 0px)); }
@media (prefers-reduced-motion: no-preference) { .drawer[open] { animation: slidein .25s ease-out; } }
@keyframes slidein { from { transform: translateX(40px); opacity: 0; } }
.cart-items { display: grid; gap: .75rem; margin-bottom: 1.25rem; }
.cart-row { display: grid; grid-template-columns: 76px 1fr auto; gap: .85rem; align-items: start; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: .6rem; }
.cart-row img { width: 76px; height: 76px; border-radius: 10px; background: #EEF0F6; object-fit: cover; }
.cart-info { display: grid; gap: .2rem; min-width: 0; }
.cart-info .muted { overflow-wrap: anywhere; }
.cart-actions { display: flex; align-items: center; gap: .9rem; margin-top: .3rem; }
.cart-price { font-weight: 700; }
.empty { text-align: center; padding: 3rem 1rem; display: grid; gap: 1rem; justify-items: center; color: var(--muted); }
.totals { margin: 0 0 .25rem; display: grid; gap: .35rem; }
.totals div { display: flex; justify-content: space-between; }
.totals dt { color: var(--muted); }
.totals dd { margin: 0; font-weight: 600; }
.totals .grand { border-top: 1px solid var(--line); padding-top: .5rem; margin-top: .25rem; font-size: 1.125rem; }
.totals .grand dt { color: var(--ink); font-weight: 700; }
.checkout { display: grid; gap: .8rem; margin-top: 1.5rem; }
.checkout label { display: grid; gap: .3rem; font-size: .9375rem; font-weight: 500; }
.checkout .two { display: grid; grid-template-columns: 1fr 1fr; gap: .75rem; }

/* order placed */
.done { width: min(480px, 100vw - 2rem); border-radius: 24px; margin: auto; }
.done-inner { padding: 2.25rem 1.75rem; display: grid; gap: 1rem; text-align: center; }
.done-inner h2 { font-size: 1.6rem; }
.downloads { display: grid; gap: .5rem; }
.downloads[hidden], [hidden] { display: none !important; }


/* UPI payment sheet */
.upi-qr { display: flex; justify-content: center; margin: 14px 0; min-height: 180px; align-items: center; }
.upi-qr svg { width: 200px; height: 200px; background: #fff; padding: 8px; border-radius: 12px; }
.upi-id { font-size: 1.05rem; letter-spacing: .02em; }
