:root {
  --blue: #3a5bd9;
  --green: #2e9e6b;
  --yellow: #f5b62a;
  --red: #f2543d;
  --ink: #1f1b16;
  --cream: #f6efe4;
  --stone: #e4dccd;
  --white: #fff;
  --muted: rgba(31, 27, 22, .7);
  --display: 'Bricolage Grotesque', system-ui, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, monospace;
  --gutter: clamp(16px, 4vw, 48px);
  --radius: clamp(24px, 2.6vw, 36px);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; scroll-padding-top: 96px; }
body { margin: 0; background: var(--cream); color: var(--ink); font-family: var(--display); font-size: 16px; line-height: 1.5; }
a { color: inherit; }
p { margin: 0; text-wrap: pretty; }
h1, h2, h3 { margin: 0; font-weight: 800; line-height: 1; letter-spacing: -.04em; text-wrap: balance; }
h1 { font-size: clamp(38px, 6vw, 80px); letter-spacing: -.05em; margin-block: clamp(28px, 4vw, 56px) clamp(20px, 3vw, 36px); max-width: 14em; }
h2 { font-size: clamp(22px, 2.2vw, 30px); }
button, input, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 3px solid var(--blue); outline-offset: 3px; border-radius: 8px; }
.wrap { max-width: 1320px; margin: 0 auto; padding: 0 var(--gutter) 96px; }
.mono { font-family: var(--mono); font-weight: 500; font-size: 13px; }
.note { font-size: 14px; color: var(--muted); }

/* Elty Stickers mark: only the blue pill is lit. */
.mark { display: grid; flex: none; grid-template-columns: repeat(3, 8px); grid-template-rows: 8px 13px 8px; gap: 2px; }
.mark i { border-radius: 999px; background: var(--stone); }
.mark i:nth-child(1), .mark i:nth-child(4) { grid-column: 1 / 4; }
.mark i:nth-child(4) { background: var(--blue); }
.sublogo { display: inline-flex; align-items: center; gap: 8px; font-weight: 800; font-size: 22px; line-height: 1; letter-spacing: -.03em; text-decoration: none; white-space: nowrap; }
.sublogo span span { font-weight: 400; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  height: 52px; padding: 0 26px; border: 0; border-radius: 999px;
  background: var(--ink); color: var(--white); font-weight: 600; font-size: 16px;
  text-decoration: none; white-space: nowrap; cursor: pointer; transition: transform .15s ease;
}
.btn:hover:not(:disabled) { transform: translateY(-2px); }
.btn:disabled { opacity: .4; cursor: not-allowed; }
.btn--blue { background: var(--blue); }
.btn--small { height: 42px; padding: 0 18px; font-size: 15px; }
.count { display: inline-grid; place-items: center; min-width: 22px; height: 22px; padding: 0 6px; border-radius: 999px; background: var(--white); color: var(--ink); font-family: var(--mono); font-size: 12px; font-weight: 800; }
.link { padding: 0; border: 0; background: none; text-decoration: underline; cursor: pointer; font-size: 14px; }
.close { width: 40px; height: 40px; border: 0; border-radius: 50%; background: var(--stone); font-size: 22px; line-height: 1; cursor: pointer; }

/* Top bar */
.bar {
  position: sticky; top: 0; z-index: 5;
  display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 10px 20px;
  padding: 12px var(--gutter); background: rgba(246, 239, 228, .92); backdrop-filter: blur(12px);
  border-bottom: 2px solid var(--stone);
}
.tabs { display: flex; gap: 4px; padding: 4px; border-radius: 999px; background: var(--stone); font-weight: 600; font-size: 15px; }
.tabs a { padding: 8px 16px; border-radius: 999px; text-decoration: none; white-space: nowrap; }
.tabs a[aria-current] { background: var(--white); }

/* The sticker itself: white die-cut edge is in the SVG, the hard shadow is here. */
.stk { display: block; width: 100%; height: auto; filter: drop-shadow(3px 6px 0 rgba(31, 27, 22, .14)); transition: transform .25s cubic-bezier(.2, 1.4, .4, 1); }

/* Three ways to buy */
.ways { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(12px, 1.4vw, 20px); }
.way { display: flex; flex-direction: column; gap: 8px; padding: clamp(20px, 2.4vw, 32px); border-radius: var(--radius); text-decoration: none; }
.way p { opacity: .85; }
.way--white { background: var(--white); }
.way--blue { background: var(--blue); color: var(--white); }
.way--ink { background: var(--ink); color: var(--white); }
.way__art { display: flex; height: 150px; margin-bottom: 12px; }
.way__art .stk { width: 120px; margin-right: -34px; }
.way__art .stk:nth-child(1) { transform: rotate(-8deg); }
.way__art .stk:nth-child(2) { transform: rotate(5deg) translateY(10px); }
.way__art .stk:nth-child(3) { transform: rotate(-3deg) translateY(-4px); }
.way:hover .stk:nth-child(1) { transform: rotate(-14deg) translateY(-6px); }
.way:hover .stk:nth-child(3) { transform: rotate(6deg) translateY(-10px); }

/* Catalogue */
.grid-head { display: flex; align-items: center; justify-content: space-between; flex-wrap: wrap; gap: 16px; margin-block: clamp(40px, 5vw, 72px) 20px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: clamp(10px, 1.2vw, 16px); }
.card { display: flex; flex-direction: column; gap: 4px; padding: 18px; border: 0; border-radius: 28px; background: var(--white); text-align: left; cursor: pointer; }
.card .stk { margin-bottom: 10px; }
.card:hover .stk, .card:focus-visible .stk { transform: rotate(-5deg) scale(1.04); }
.card strong { font-weight: 600; font-size: 17px; letter-spacing: -.02em; }
.card .mono { color: var(--muted); }

/* Option chips and swatches */
.opt { display: flex; flex-direction: column; gap: 10px; margin: 0; padding: 0; border: 0; min-width: 0; }
.opt legend, .opt > label, .opt > .label { padding: 0; font-weight: 600; font-size: 15px; }
.opt legend { margin-bottom: 10px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chips label { cursor: pointer; }
.chips input { position: absolute; opacity: 0; pointer-events: none; }
.chips span, .chips button { display: inline-flex; align-items: center; height: 40px; padding: 0 16px; border: 2px solid var(--stone); border-radius: 999px; background: var(--white); font-weight: 600; font-size: 15px; cursor: pointer; }
.chips input:checked + span, .chips button[aria-pressed="true"] { border-color: var(--ink); background: var(--ink); color: var(--white); }
.chips input:focus-visible + span { outline: 3px solid var(--blue); outline-offset: 3px; }
.swatches { display: flex; flex-wrap: wrap; gap: 10px; }
.swatches button { width: 40px; height: 40px; border: 2px solid var(--stone); border-radius: 50%; cursor: pointer; }
.swatches button[aria-pressed="true"] { box-shadow: 0 0 0 3px var(--cream), 0 0 0 6px var(--ink); }
.field { width: 100%; padding: 12px 16px; border: 2px solid var(--stone); border-radius: 16px; background: var(--white); }
.field:focus { outline: none; border-color: var(--ink); }
.upload { display: flex; flex-wrap: wrap; align-items: center; gap: 12px; font-size: 14px; }
.placeholder { padding: 16px; border: 2px dashed var(--stone); border-radius: 16px; color: var(--muted); font-size: 14px; }

/* Builder layouts: preview mat + option panel */
.builder { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(16px, 2vw, 28px); align-items: start; }
.panel { display: flex; flex-direction: column; gap: 24px; padding: clamp(20px, 2.6vw, 36px); border-radius: var(--radius); background: var(--white); }
.panel > div[id$="config"] { display: flex; flex-direction: column; gap: 24px; }
.mat {
  display: grid; place-items: center; aspect-ratio: 1; border-radius: var(--radius);
  background-color: var(--stone); background-image: radial-gradient(rgba(31, 27, 22, .13) 1.5px, transparent 1.5px); background-size: 22px 22px;
  position: sticky; top: 96px;
}
.mat .stk { width: 68%; }
.mat--small { position: static; width: 180px; }
.price { display: flex; flex-direction: column; gap: 4px; padding-top: 20px; border-top: 2px solid var(--stone); }
.price strong { font-family: var(--mono); font-weight: 800; font-size: 30px; }
.price span { font-family: var(--mono); font-weight: 500; font-size: 13px; color: var(--muted); }

/* AI results */
.results { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-bottom: 12px; }
.results:empty { display: none; }
.results button { padding: 18px; border: 3px solid transparent; border-radius: 28px; background: var(--white); cursor: pointer; }
.results button[aria-pressed="true"] { border-color: var(--ink); }
.results .ghost { aspect-ratio: 1; border-radius: 28px; background: var(--stone); animation: pulse 1s ease-in-out infinite alternate; }
@keyframes pulse { to { opacity: .45; } }
#ai-config-wrap { margin-top: 16px; }

/* Product dialog */
dialog { width: min(920px, calc(100vw - 24px)); max-height: calc(100dvh - 24px); padding: clamp(16px, 2.4vw, 28px); border: 0; border-radius: var(--radius); background: var(--cream); color: var(--ink); overflow: auto; }
dialog::backdrop { background: rgba(31, 27, 22, .5); }
dialog .close { position: absolute; top: 14px; right: 14px; z-index: 1; }
.builder--dialog .mat { position: static; }
.builder--dialog h2 { font-size: clamp(28px, 3vw, 40px); margin-bottom: 6px; padding-right: 44px; }
.builder--dialog #pd-config { display: flex; flex-direction: column; gap: 22px; margin-top: 22px; }

/* Cart lines (drawer + checkout summary) */
.lines { display: flex; flex-direction: column; gap: 16px; margin: 0; padding: 0; list-style: none; }
.line { display: grid; grid-template-columns: 72px minmax(0, 1fr) auto; gap: 4px 14px; align-items: center; }
.line .stk { grid-row: span 2; }
.line strong { font-weight: 600; letter-spacing: -.02em; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.line .amount { font-family: var(--mono); font-weight: 800; font-size: 14px; text-align: right; }
.line .mono { color: var(--muted); font-size: 12px; }
.line .tools { display: flex; align-items: center; gap: 6px; justify-content: flex-end; }
.step { width: 30px; height: 30px; border: 2px solid var(--stone); border-radius: 50%; background: var(--white); font-weight: 800; line-height: 1; cursor: pointer; }
.step:disabled { opacity: .35; cursor: default; }
.empty { padding: 24px 0; color: var(--muted); }
.total { display: flex; align-items: baseline; justify-content: space-between; padding-top: 16px; border-top: 2px solid var(--stone); font-weight: 600; }
.total strong { font-family: var(--mono); font-weight: 800; font-size: 22px; }

.scrim { position: fixed; inset: 0; z-index: 8; background: rgba(31, 27, 22, .5); }
.drawer {
  position: fixed; inset: 0 0 0 auto; z-index: 9; width: min(440px, 100vw);
  display: flex; flex-direction: column; gap: 20px; padding: 20px;
  background: var(--cream); transform: translateX(100%); transition: transform .3s cubic-bezier(.3, .9, .3, 1); visibility: hidden;
}
.drawer.is-open { transform: none; visibility: visible; }
.drawer__head { display: flex; align-items: center; justify-content: space-between; }
.drawer .lines { flex: 1; overflow: auto; padding: 4px 4px 4px 0; }
.drawer__foot { display: flex; flex-direction: column; gap: 16px; }

.done { display: flex; flex-direction: column; align-items: center; gap: 14px; padding-block: clamp(40px, 8vw, 96px); text-align: center; }
.done h1 { margin: 0; }

@media (max-width: 860px) {
  .tabs { order: 3; width: 100%; overflow-x: auto; }
  .tabs a { flex: 1; text-align: center; padding-inline: 10px; }
  .ways, .builder { grid-template-columns: 1fr; }
  .way__art { height: 120px; }
  .way__art .stk { width: 96px; }
  .mat { position: static; aspect-ratio: 4 / 3; }
  .mat .stk { width: 48%; }
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .builder--checkout aside { order: -1; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition: none !important; animation: none !important; }
}
