/* QRiffic — "Sticker Press": printed sticker sheet on dotted paper. Thick ink outlines, offset shadows, one pink pop. */
@font-face { font-family: 'Archivo Black'; font-weight: 400; font-display: swap;
  src: url(/fonts/archivo-black-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Archivo Black'; font-weight: 400; font-display: swap;
  src: url(/fonts/archivo-black-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }
@font-face { font-family: 'Work Sans'; font-weight: 400 700; font-display: swap;
  src: url(/fonts/work-sans-latin.woff2) format('woff2');
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD; }
@font-face { font-family: 'Work Sans'; font-weight: 400 700; font-display: swap;
  src: url(/fonts/work-sans-latin-ext.woff2) format('woff2');
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF; }

:root {
  --paper: #FFFAF0;
  --paper-dot: #E9E2CF;
  --ink: #111111;
  --ink-soft: #4A4740;
  --card: #FFFFFF;
  --cobalt: #2F5BFF;
  --pink: #FF5FA2;
  --sun: #FFD23F;
  --good: #1F9D55;
  --bad: #D93025;
  --display: 'Archivo Black', 'Arial Black', Impact, sans-serif;
  --body: 'Work Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --line: 3px solid var(--ink);
  --pop: 4px 4px 0 var(--ink);
  --gutter: clamp(16px, 4vw, 40px);
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
[hidden] { display: none !important; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } *, *::before, *::after { transition: none !important; animation: none !important; } }
body {
  margin: 0; background: var(--paper); color: var(--ink);
  font: 400 16px/1.55 var(--body);
  background-image: radial-gradient(var(--paper-dot) 1.2px, transparent 1.2px);
  background-size: 16px 16px;
}
img, canvas, video { max-width: 100%; display: block; }
a { color: var(--cobalt); text-underline-offset: 3px; text-decoration-thickness: 2px; }
:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 3px; }
h1, h2, h3 { font-family: var(--display); font-weight: 400; line-height: 1.02; margin: 0; text-wrap: balance; }
.fine { font-size: 13px; color: var(--ink-soft); margin: 0; }
.sub { font-size: 14px; color: var(--ink-soft); margin: 4px 0 8px; }
.skip { position: absolute; left: -9999px; }
.skip:focus { left: 16px; top: 16px; z-index: 10; background: var(--sun); padding: 8px 12px; border: var(--line); color: var(--ink); }

/* Header */
.top { border-bottom: var(--line); background: var(--paper); position: sticky; top: 0; z-index: 5; }
.top-in, .foot-in { max-width: 1200px; margin: 0 auto; padding: 12px var(--gutter); display: flex; align-items: center; justify-content: space-between; gap: 12px 20px; flex-wrap: wrap; }
.logo { font-family: var(--display); font-size: 26px; color: var(--ink); text-decoration: none; letter-spacing: -0.01em; white-space: nowrap; }
.logo b { font-weight: 400; background: var(--pink); padding: 0 5px; margin-left: 1px; }
.top nav, .foot nav { display: flex; gap: 6px 20px; flex-wrap: wrap; }
.top nav a, .foot nav a { color: var(--ink); font-weight: 600; text-decoration: none; }
.top nav a:hover, .foot nav a:hover { text-decoration: underline; }
@media (max-width: 600px) {
  .top { position: static; }
  .top-in { padding-block: 10px; }
  .top .logo { font-size: 22px; }
  .top nav { gap: 4px 14px; font-size: 15px; }
}

main { max-width: 1200px; margin: 0 auto; padding-inline: var(--gutter); }

/* Hero */
.hero { padding-block: clamp(28px, 6vw, 64px) 28px; display: grid; gap: 16px; }
.hero h1 { font-size: clamp(38px, 7.2vw, 84px); text-transform: uppercase; max-width: 15ch; }
.hero h1 em { font-style: normal; color: var(--cobalt); position: relative; white-space: nowrap; }
.hero h1 em::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0.04em; height: 0.12em; background: var(--pink); z-index: -1; }
.lede { font-size: clamp(17px, 2vw, 20px); max-width: 52ch; margin: 0; }
.badges { list-style: none; padding: 0; margin: 4px 0 0; display: flex; flex-wrap: wrap; gap: 12px; }
.sticker { display: inline-block; font-family: var(--display); text-transform: uppercase; font-size: 15px; padding: 6px 14px; border: var(--line); box-shadow: 3px 3px 0 var(--ink); margin: 0; }
.badges .sticker:nth-child(1) { transform: rotate(-3deg); }
.badges .sticker:nth-child(2) { transform: rotate(2deg); }
.badges .sticker:nth-child(3) { transform: rotate(-1.5deg); }
.s-sun { background: var(--sun); } .s-pink { background: var(--pink); } .s-blue { background: var(--cobalt); color: #fff; }

/* Studio */
.studio { display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 420px); grid-template-areas: "content preview" "design preview"; gap: 24px 32px; align-items: start; padding-block: 12px 56px; }
.step-content { grid-area: content; } .step-design { grid-area: design; } .preview { grid-area: preview; }
@media (max-width: 880px) { .studio { grid-template-columns: minmax(0, 1fr); grid-template-areas: "content" "preview" "design"; } }
.panel { background: var(--card); border: var(--line); box-shadow: var(--pop); padding: clamp(16px, 3vw, 28px); display: grid; gap: 16px; min-width: 0; }
.panel h2 { font-size: clamp(22px, 3vw, 28px); text-transform: uppercase; display: flex; align-items: center; gap: 12px; }
.num { display: inline-grid; place-items: center; width: 1.5em; height: 1.5em; background: var(--sun); border: var(--line); font-size: 0.8em; flex: none; }
.group-title { font-size: 15px; text-transform: uppercase; letter-spacing: 0.03em; }

.types { display: grid; grid-template-columns: repeat(auto-fill, minmax(118px, 1fr)); gap: 10px; }
.type { font: inherit; text-align: left; background: var(--paper); border: 2px solid var(--ink); padding: 8px 10px; cursor: pointer; display: grid; gap: 0; box-shadow: 2px 2px 0 var(--ink); transition: transform .08s, box-shadow .08s; color: var(--ink); }
.type b { font-weight: 700; font-size: 15px; }
.type span { font-size: 12px; color: var(--ink-soft); line-height: 1.3; }
.type:hover { transform: translate(-1px, -1px); box-shadow: 3px 3px 0 var(--ink); }
.type[aria-selected="true"] { background: var(--sun); }

.form { display: grid; grid-template-columns: 1fr 1fr; gap: 12px 14px; }
.form .full { grid-column: 1 / -1; }
@media (max-width: 520px) { .form { grid-template-columns: 1fr; } }
.field { display: grid; gap: 4px; font-size: 14px; font-weight: 600; min-width: 0; }
.field output { font-weight: 400; color: var(--ink-soft); }
input:not([type]), input[type=text], input[type=url], input[type=email], input[type=tel], input[type=datetime-local], input[type=date], textarea, select {
  font: 400 16px/1.3 var(--body); color: var(--ink); background: var(--paper); border: 2px solid var(--ink); padding: 9px 11px; width: 100%; border-radius: 0; min-width: 0;
}
textarea { min-height: 84px; resize: vertical; }
select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--ink) 50%), linear-gradient(135deg, var(--ink) 50%, transparent 50%); background-position: calc(100% - 17px) 55%, calc(100% - 12px) 55%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 30px; }
input:focus-visible, textarea:focus-visible, select:focus-visible { outline: 3px solid var(--cobalt); outline-offset: 0; }
input[type=color] { width: 52px; height: 40px; padding: 2px; border: 2px solid var(--ink); background: var(--card); cursor: pointer; }
input[type=range] { accent-color: var(--cobalt); width: 100%; }
.check { display: flex; align-items: center; gap: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.check input { width: 20px; height: 20px; accent-color: var(--cobalt); margin: 0; }
.form .check { align-self: end; padding-bottom: 10px; }
.error { grid-column: 1 / -1; margin: 0; background: #FFE4EF; border: 2px solid var(--ink); padding: 8px 12px; font-size: 14px; font-weight: 600; }

.row { display: flex; flex-wrap: wrap; gap: 12px 16px; align-items: end; }
.row .field { flex: 1 1 140px; }
.row .field.color { flex: 0 0 auto; }
.row .grow { flex: 3 1 200px; }

.group { border-top: 2px dashed var(--ink); padding-top: 12px; }
.group summary { font-family: var(--display); text-transform: uppercase; font-size: 16px; cursor: pointer; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.group summary::-webkit-details-marker { display: none; }
.group summary::after { content: "+"; font-size: 22px; line-height: 1; }
.group[open] summary::after { content: "–"; }
.group[open] > summary { margin-bottom: 12px; }
.group > .row + .row, .group > .row + .swatch-row { margin-top: 12px; }

.templates, .shapes { display: grid; grid-template-columns: repeat(auto-fill, minmax(76px, 1fr)); gap: 10px; }
.tile { font: 600 12px/1.2 var(--body); color: var(--ink); background: var(--paper); border: 2px solid var(--ink); padding: 6px; cursor: pointer; display: grid; gap: 4px; justify-items: center; }
.tile canvas { width: 100%; height: auto; aspect-ratio: 1; image-rendering: auto; }
.tile[aria-pressed="true"] { background: var(--sun); box-shadow: 3px 3px 0 var(--ink); transform: translate(-1px, -1px); }
.tile:hover { background: #FFF1C2; }

.swatch-row { display: flex; flex-wrap: wrap; gap: 8px; }
.swatch { width: 34px; height: 34px; border: 2px solid var(--ink); cursor: pointer; padding: 0; position: relative; overflow: hidden; }
.swatch span { position: absolute; inset: 0; }
.swatch span:last-child { clip-path: polygon(100% 0, 100% 100%, 0 100%); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { font: 600 13px var(--body); background: var(--paper); border: 2px solid var(--ink); padding: 4px 10px; cursor: pointer; color: var(--ink); }
.chip:hover { background: var(--sun); }
.reset { justify-self: start; }

/* Preview */
.preview { position: sticky; top: 84px; display: grid; gap: 14px; }
@media (max-width: 880px) { .preview { position: static; } }
.preview-card { background: var(--card); border: var(--line); box-shadow: 8px 8px 0 var(--pink); padding: clamp(14px, 3vw, 24px); transform: rotate(1.2deg); transition: transform .2s; }
.preview-card:hover { transform: rotate(0deg); }
.preview-card canvas { width: 100%; height: auto; margin: 0 auto; }
.status { margin: 6px 0 0; display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 15px; }
.status .dot { width: 12px; height: 12px; border-radius: 50%; border: 2px solid var(--ink); background: var(--paper-dot); flex: none; }
.status.ok .dot { background: var(--good); } .status.bad .dot { background: var(--bad); }
.warnings { margin: 0; padding: 0; list-style: none; display: grid; gap: 6px; }
.warnings li { font-size: 14px; background: #FFF4CC; border: 2px solid var(--ink); padding: 6px 10px; }
.dl { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.dl .size { grid-column: 1 / -1; display: flex; align-items: center; gap: 10px; font-weight: 600; font-size: 14px; }
.dl .size select { width: auto; flex: 1; }
.dl #dl-png { grid-column: 1 / -1; }

.btn { font: 400 15px/1 var(--display); text-transform: uppercase; letter-spacing: 0.02em; background: var(--card); color: var(--ink); border: var(--line); box-shadow: var(--pop); padding: 13px 16px; cursor: pointer; text-align: center; text-decoration: none; display: inline-flex; align-items: center; justify-content: center; gap: 8px; transition: transform .08s, box-shadow .08s; }
.btn:hover { transform: translate(-2px, -2px); box-shadow: 6px 6px 0 var(--ink); }
.btn:active { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.btn-blue { background: var(--cobalt); color: #fff; }
.btn-ghost { box-shadow: none; border-width: 2px; }
.btn-ghost:hover { box-shadow: 3px 3px 0 var(--ink); }
.btn-file { position: relative; overflow: hidden; }
.btn-file input { position: absolute; inset: 0; opacity: 0; cursor: pointer; font-size: 0; }
.btn-file:focus-within { outline: 3px solid var(--cobalt); outline-offset: 3px; }

/* Scan */
.scan { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: 24px 40px; align-items: center; padding-block: 56px; border-top: var(--line); }
@media (max-width: 760px) { .scan { grid-template-columns: minmax(0, 1fr); } }
.scan h2, .app h2, .faq h2 { font-size: clamp(32px, 5vw, 56px); text-transform: uppercase; }
.scan-copy { display: grid; gap: 16px; }
.scan-copy > p { margin: 0; font-size: 18px; max-width: 46ch; }
.scan-box { position: relative; aspect-ratio: 4 / 3; max-width: 100%; background: var(--ink); border: var(--line); box-shadow: 8px 8px 0 var(--cobalt); overflow: hidden; display: grid; place-items: center; color: var(--paper); }
.scan-box.drag { box-shadow: 8px 8px 0 var(--pink); }
.scan-box video { width: 100%; height: 100%; object-fit: cover; }
.scan-empty { display: grid; justify-items: center; gap: 10px; font-weight: 600; }
.scan-empty svg { width: 56px; height: 56px; color: var(--sun); }
.brackets { position: absolute; inset: 14%; pointer-events: none; background:
  linear-gradient(var(--sun), var(--sun)) top left / 36px 5px, linear-gradient(var(--sun), var(--sun)) top left / 5px 36px,
  linear-gradient(var(--sun), var(--sun)) top right / 36px 5px, linear-gradient(var(--sun), var(--sun)) top right / 5px 36px,
  linear-gradient(var(--sun), var(--sun)) bottom left / 36px 5px, linear-gradient(var(--sun), var(--sun)) bottom left / 5px 36px,
  linear-gradient(var(--sun), var(--sun)) bottom right / 36px 5px, linear-gradient(var(--sun), var(--sun)) bottom right / 5px 36px;
  background-repeat: no-repeat; }
.result { grid-column: 1 / -1; background: var(--card); border: var(--line); box-shadow: var(--pop); padding: 20px; display: grid; gap: 12px; min-width: 0; }
.result-kind { margin: 0; font-family: var(--display); text-transform: uppercase; }
.result-text { margin: 0; white-space: pre-wrap; word-break: break-word; font: 14px/1.5 ui-monospace, SFMono-Regular, Menlo, monospace; background: var(--paper); border: 2px solid var(--ink); padding: 10px 12px; max-height: 240px; overflow: auto; }
.result-details { margin: 0; display: grid; grid-template-columns: max-content 1fr; gap: 4px 16px; }
.result-details dt { font-weight: 700; } .result-details dd { margin: 0; word-break: break-word; }

/* Perks */
.perks { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 20px; padding-block: 8px 64px; }
.perk { background: var(--card); border: var(--line); padding: 20px; box-shadow: var(--pop); }
.perk:nth-child(1) { background: var(--sun); } .perk:nth-child(3) { background: #FFD6E7; }
.perk h3 { font-size: 20px; text-transform: uppercase; margin-bottom: 8px; }
.perk p { margin: 0; }

/* App */
.app { display: grid; grid-template-columns: minmax(0, 1.3fr) minmax(0, 1fr); gap: 32px; align-items: center; padding-block: 56px; border-top: var(--line); }
@media (max-width: 760px) { .app { grid-template-columns: minmax(0, 1fr); } }
.app-copy { display: grid; gap: 16px; justify-items: start; }
.app-copy > p:not(.sticker):not(.fine) { margin: 0; font-size: 18px; max-width: 48ch; }
.tilt { transform: rotate(-3deg); }
.phone { justify-self: center; width: min(260px, 100%); aspect-ratio: 9 / 18.5; background: var(--ink); border-radius: 40px; padding: 12px; box-shadow: 10px 10px 0 var(--pink); transform: rotate(4deg); }
.phone-screen { background: var(--paper); border-radius: 30px; height: 100%; display: grid; grid-template-rows: auto 1fr auto; justify-items: center; align-items: center; padding: 28px 18px 22px; gap: 10px; }
.phone-title { font-family: var(--display); font-size: 20px; }
.phone-title b { font-weight: 400; background: var(--pink); padding: 0 4px; }
.phone-screen canvas { width: 100%; height: auto; border: 2px solid var(--ink); }
.phone-btn { font-family: var(--display); text-transform: uppercase; background: var(--cobalt); color: #fff; border: 2px solid var(--ink); padding: 8px 18px; font-size: 13px; }

/* FAQ */
.faq { padding-block: 56px 72px; border-top: var(--line); display: grid; gap: 12px; max-width: 820px; }
.faq h2 { margin-bottom: 12px; }
.faq details { background: var(--card); border: 2px solid var(--ink); padding: 14px 18px; }
.faq summary { font-weight: 700; font-size: 17px; cursor: pointer; }
.faq details p { margin: 10px 0 0; max-width: 65ch; }

/* Footer */
.foot { border-top: var(--line); background: var(--ink); color: var(--paper); }
.foot .logo { color: var(--paper); } .foot .logo b { color: var(--ink); }
.foot nav a { color: var(--paper); }
.foot .fine { color: #CFC8B4; flex-basis: 100%; }
.foot-in { padding-block: 28px; }

/* Toast */
.toast { position: fixed; left: 50%; bottom: calc(20px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%); background: var(--ink); color: var(--paper); font-weight: 700; padding: 12px 18px; border: 2px solid var(--paper); box-shadow: 4px 4px 0 var(--pink); z-index: 20; max-width: calc(100vw - 32px); }

/* Simple content pages */
.doc { max-width: 760px; margin: 0 auto; padding-block: 48px 72px; padding-inline: var(--gutter); }
.doc h1 { font-size: clamp(34px, 6vw, 56px); text-transform: uppercase; margin-bottom: 8px; }
.doc h2 { font-size: 22px; text-transform: uppercase; margin: 32px 0 8px; }
.doc p, .doc li { max-width: 65ch; }
.doc .card { background: var(--card); border: var(--line); box-shadow: var(--pop); padding: clamp(18px, 4vw, 32px); }
