/* ===== QR Puppy — styles ===== */
:root {
  --cream: #fff8ef;
  --cream-2: #fdeedd;
  --ink: #2e2118;
  --ink-soft: #6b5b4d;
  --brown: #cf8a47;
  --brown-dk: #a9682f;
  --orange: #f08a3c;
  --berry: #e36464;
  --green: #5fa86a;
  --card: #ffffff;
  --line: #efdcc6;
  --shadow: 0 10px 30px rgba(120, 78, 35, 0.12);
  --shadow-sm: 0 4px 14px rgba(120, 78, 35, 0.10);
  --r: 18px;
  --r-sm: 12px;
  --maxw: 1080px;
  --font: "Nunito", ui-rounded, "Segoe UI", system-ui, -apple-system, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background:
    radial-gradient(1200px 600px at 80% -10%, #ffe9cf 0%, transparent 60%),
    radial-gradient(900px 500px at -10% 10%, #ffe0d3 0%, transparent 55%),
    var(--cream);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
h1, h2, h3 { line-height: 1.15; margin: 0 0 .4em; font-weight: 800; }
a { color: var(--brown-dk); }
.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }

/* ===== Header ===== */
.site-header {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: blur(10px);
  background: rgba(255, 248, 239, 0.82);
  border-bottom: 1px solid var(--line);
}
.site-header .wrap { display: flex; align-items: center; gap: 14px; height: 66px; }
.brand { display: flex; align-items: center; gap: 10px; text-decoration: none; color: var(--ink); cursor: pointer; }
.brand svg, .brand img { width: 42px; height: 42px; display: block; }
.brand b { font-size: 1.3rem; font-weight: 900; letter-spacing: -.02em; }
.brand b span { color: var(--orange); }
.header-spacer { flex: 1; }
.pill {
  font-size: .8rem; font-weight: 800; color: var(--green);
  background: #e9f6ea; border: 1px solid #cdebcf;
  padding: 5px 12px; border-radius: 999px; white-space: nowrap;
}
.nav-link {
  background: none; border: 0; font: inherit; font-weight: 800; color: var(--ink-soft);
  cursor: pointer; padding: 8px 12px; border-radius: 10px;
}
.nav-link:hover { background: var(--cream-2); color: var(--ink); }

/* ===== Buttons ===== */
.btn {
  font: inherit; font-weight: 800; cursor: pointer;
  border: 0; border-radius: 999px; padding: 13px 26px;
  background: var(--orange); color: #fff;
  box-shadow: var(--shadow-sm); transition: transform .12s ease, box-shadow .12s ease, background .12s;
  display: inline-flex; align-items: center; gap: 8px;
}
.btn:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.btn:active { transform: translateY(0); }
.btn.ghost { background: #fff; color: var(--brown-dk); border: 2px solid var(--line); box-shadow: none; }
.btn.ghost:hover { border-color: var(--brown); }
.btn.small { padding: 9px 16px; font-size: .9rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

/* ===== Views ===== */
.view { display: none; }
.view.active { display: block; animation: fade .35s ease; }
@keyframes fade { from { opacity: 0; transform: translateY(8px);} to { opacity: 1; transform: none; } }

/* ===== Hero ===== */
.hero { padding: 56px 0 28px; }
.hero-grid { display: grid; grid-template-columns: 1.1fr .9fr; gap: 40px; align-items: center; }
.hero h1 { font-size: clamp(2.2rem, 5vw, 3.4rem); letter-spacing: -.03em; }
.hero h1 span { color: var(--orange); }
.hero p.lead { font-size: 1.15rem; color: var(--ink-soft); max-width: 30em; }
.hero-cta { display: flex; gap: 14px; flex-wrap: wrap; margin-top: 26px; }
.hero-badges { display: flex; gap: 18px; flex-wrap: wrap; margin-top: 28px; }
.hero-badge { display: flex; align-items: center; gap: 8px; font-weight: 800; color: var(--brown-dk); font-size: .95rem; }
.hero-badge svg { width: 22px; height: 22px; }
.hero-art { display: flex; justify-content: center; }
.hero-art .blob {
  background: #fff; border-radius: 30px; padding: 26px; box-shadow: var(--shadow);
  position: relative; transform: rotate(-3deg);
}
.hero-art .blob img.bigpup { width: 200px; height: 200px; }
.hero-art .blob .mini-qr {
  position: absolute; right: -22px; bottom: -22px; background: #fff; border-radius: 14px;
  padding: 8px; box-shadow: var(--shadow); transform: rotate(7deg); border: 1px solid var(--line);
}
.hero-art .blob .mini-qr canvas { display: block; width: 84px; height: 84px; image-rendering: pixelated; }

/* ===== Quick generator (hero) ===== */
.quick-card {
  background: #fff; border: 1px solid var(--line); border-radius: 24px; padding: 20px;
  box-shadow: var(--shadow); width: 100%; max-width: 380px;
}
.quick-head { display: flex; align-items: center; gap: 8px; margin-bottom: 14px; }
.quick-head b { font-size: 1.05rem; }
.quick-head .quick-tag { margin-left: auto; font-size: .72rem; font-weight: 800; color: var(--green); background: #e9f6ea; border: 1px solid #cdebcf; padding: 3px 9px; border-radius: 999px; }
.quick-switch { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 12px; }
.qchip {
  font: inherit; font-weight: 800; font-size: .82rem; cursor: pointer;
  border: 2px solid var(--line); background: var(--cream); color: var(--ink-soft);
  padding: 6px 11px; border-radius: 999px; transition: border-color .12s, background .12s, color .12s;
}
.qchip:hover { border-color: var(--brown); }
.qchip.active { border-color: var(--orange); background: #fff6ee; color: var(--ink); }
.quick-fields .field { margin-bottom: 10px; }
.quick-fields textarea { min-height: 60px; }
.quick-stage { display: grid; place-items: center; background: var(--cream); border: 1px solid var(--line); border-radius: 16px; padding: 14px; min-height: 200px; margin-bottom: 14px; }
.quick-stage canvas { width: 190px; height: 190px; image-rendering: pixelated; border-radius: 8px; }
.quick-empty { color: var(--ink-soft); font-weight: 700; text-align: center; padding: 26px 10px; }
.quick-actions { display: flex; gap: 10px; }
.quick-actions .btn { flex: 1; justify-content: center; }

/* ===== Chooser (Create | Scan) ===== */
.chooser { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; margin: 14px 0 10px; }
.choice {
  text-align: left; background: var(--card); border: 2px solid var(--line); border-radius: var(--r);
  padding: 28px; cursor: pointer; font: inherit; transition: transform .15s, border-color .15s, box-shadow .15s;
  box-shadow: var(--shadow-sm);
}
.choice:hover { transform: translateY(-4px); border-color: var(--brown); box-shadow: var(--shadow); }
.choice .ico { width: 56px; height: 56px; border-radius: 16px; display: grid; place-items: center; margin-bottom: 14px; }
.choice .ico.c { background: #ffe7d2; }
.choice .ico.s { background: #dcefff; }
.choice .ico svg { width: 30px; height: 30px; }
.choice h3 { font-size: 1.4rem; margin-bottom: 4px; }
.choice p { color: var(--ink-soft); margin: 0; }

/* ===== Section ===== */
.section { padding: 48px 0; }
.section h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); text-align: center; }
.section .sub { text-align: center; color: var(--ink-soft); max-width: 38em; margin: 0 auto 8px; }

/* ===== Philosophy ===== */
.philo { background: linear-gradient(180deg, #fff 0%, var(--cream) 100%); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.philo-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-top: 26px; }
.philo-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 24px; box-shadow: var(--shadow-sm); }
.philo-card .emoji { font-size: 1.8rem; }
.philo-card h3 { margin: 8px 0 6px; font-size: 1.15rem; }
.philo-card p { margin: 0; color: var(--ink-soft); font-size: .98rem; }
.philo-vow { text-align: center; margin-top: 30px; font-size: 1.1rem; font-weight: 800; color: var(--brown-dk); }

/* ===== Type grid ===== */
.type-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 14px; }
.type-card {
  background: #fff; border: 2px solid var(--line); border-radius: var(--r-sm); padding: 18px 14px;
  cursor: pointer; font: inherit; text-align: center; transition: transform .12s, border-color .12s, background .12s;
}
.type-card:hover { transform: translateY(-3px); border-color: var(--brown); }
.type-card.active { border-color: var(--orange); background: #fff6ee; }
.type-card .t-ico { font-size: 1.7rem; }
.type-card .t-name { font-weight: 800; margin-top: 6px; font-size: .95rem; }

/* ===== Builder layout ===== */
.builder { display: grid; grid-template-columns: 1fr 380px; gap: 28px; align-items: start; margin-top: 8px; }
.panel { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow-sm); }
.panel h3 { font-size: 1.05rem; display: flex; align-items: center; gap: 8px; }
.panel h3 .step { background: var(--orange); color: #fff; width: 24px; height: 24px; border-radius: 50%; display: grid; place-items: center; font-size: .85rem; }

.field { margin-bottom: 14px; }
.field label { display: block; font-weight: 800; font-size: .9rem; margin-bottom: 5px; color: var(--ink); }
.field .hint { font-weight: 600; color: var(--ink-soft); font-size: .8rem; }
input[type=text], input[type=url], input[type=email], input[type=tel], input[type=number], input[type=password], textarea, select {
  width: 100%; font: inherit; padding: 11px 13px; border: 2px solid var(--line); border-radius: 10px;
  background: var(--cream); color: var(--ink); transition: border-color .12s, background .12s;
}
input:focus, textarea:focus, select:focus { outline: none; border-color: var(--brown); background: #fff; }
textarea { resize: vertical; min-height: 84px; }
.row2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.check { display: flex; align-items: center; gap: 8px; font-weight: 700; }
.check input { width: auto; }

/* ===== Design Studio ===== */
.studio-toggle { display: flex; align-items: center; gap: 12px; margin-bottom: 6px; }
.studio-switch { display: flex; align-items: center; gap: 10px; cursor: pointer; font-weight: 800; }
.studio-switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.studio-slider { position: relative; width: 44px; height: 26px; background: var(--line); border-radius: 999px; transition: background .15s; flex: 0 0 auto; }
.studio-slider::after { content: ""; position: absolute; top: 3px; left: 3px; width: 20px; height: 20px; border-radius: 50%; background: #fff; box-shadow: var(--shadow-sm); transition: transform .15s; }
.studio-switch input:checked + .studio-slider { background: var(--orange); }
.studio-switch input:checked + .studio-slider::after { transform: translateX(18px); }
.studio-switch input:focus-visible + .studio-slider { box-shadow: 0 0 0 3px rgba(240,138,60,.35); }
.studio-toggle #studio-reset { margin-left: auto; }
.studio-off-hint { color: var(--ink-soft); font-size: .95rem; margin: 12px 0 0; }
#studio-body { margin-top: 8px; }
.cust-group { border-top: 1px dashed var(--line); padding-top: 14px; margin-top: 14px; }
.cust-group:first-child { border-top: 0; padding-top: 0; margin-top: 0; }
.cust-h { font-weight: 900; font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; color: var(--brown-dk); margin-bottom: 10px; }
.design-chips { display: flex; flex-wrap: wrap; gap: 7px; }
.dchip { font: inherit; font-weight: 800; font-size: .82rem; cursor: pointer; border: 2px solid var(--line); background: #fff; color: var(--ink); padding: 6px 11px; border-radius: 999px; transition: border-color .12s, transform .1s; }
.dchip:hover { border-color: var(--brown); transform: translateY(-1px); }
.swatches { display: flex; gap: 7px; flex-wrap: wrap; }
.swatch { width: 28px; height: 28px; border-radius: 8px; border: 2px solid rgba(0,0,0,.08); cursor: pointer; }
.swatch.sel { box-shadow: 0 0 0 3px var(--orange); }
.color-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.color-row input[type=color] { width: 44px; height: 38px; padding: 2px; border-radius: 8px; border: 2px solid var(--line); background: #fff; cursor: pointer; }
.color-row input[type=color]:disabled { opacity: .4; cursor: not-allowed; }
.seg { display: flex; flex-wrap: wrap; gap: 6px; }
.seg-btn { font: inherit; font-weight: 800; font-size: .82rem; cursor: pointer; border: 2px solid var(--line); background: #fff; color: var(--ink-soft); padding: 7px 12px; border-radius: 10px; transition: border-color .12s, background .12s, color .12s; }
.seg-btn:hover { border-color: var(--brown); }
.seg-btn.sel { border-color: var(--orange); background: #fff6ee; color: var(--ink); }
.slider-row { display: flex; align-items: center; gap: 12px; }
.slider-row input[type=range] { flex: 1; accent-color: var(--orange); }
.slider-row output { font-weight: 800; min-width: 46px; text-align: right; }
input[type=file] { font: inherit; font-size: .85rem; }

/* ===== Preview ===== */
.preview { position: sticky; top: 86px; }
.preview .qr-stage {
  background: #fff; border-radius: var(--r); padding: 20px; display: grid; place-items: center;
  border: 1px solid var(--line); min-height: 300px;
}
.preview canvas { width: auto; height: auto; max-width: 100%; max-height: 320px; border-radius: 8px; }
.preview .dl-row { display: flex; gap: 10px; margin-top: 16px; }
.preview .dl-row .btn { flex: 1; justify-content: center; }
.preview .empty { color: var(--ink-soft); text-align: center; padding: 30px; }
.preview .empty img { width: 90px; height: 90px; opacity: .9; }
.preview-note { font-size: .8rem; color: var(--ink-soft); text-align: center; margin: 12px 0 0; font-weight: 700; }

/* ===== Scan health (Paw Score) ===== */
.scan-health { margin-top: 14px; border-radius: 14px; padding: 14px 16px; border: 1px solid var(--line); background: var(--cream); }
.scan-health.tone-good { background: #e9f6ea; border-color: #cdebcf; }
.scan-health.tone-warn { background: #fff6e6; border-color: #f4e2b8; }
.scan-health.tone-bad { background: #fdeaea; border-color: #f3caca; }
.sh-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.sh-paws { font-size: 1.05rem; letter-spacing: 1px; }
.sh-paws .paws-off { filter: grayscale(1); opacity: .35; }
.sh-level { font-weight: 900; }
.tone-good .sh-level { color: #2f7a4d; }
.tone-warn .sh-level { color: #a9682f; }
.tone-bad .sh-level { color: #c0392b; }
.sh-reasons { list-style: none; padding: 0; margin: 8px 0 0; }
.sh-reasons li { font-size: .86rem; color: var(--ink-soft); padding: 3px 0 3px 18px; position: relative; }
.sh-reasons li::before { content: "•"; position: absolute; left: 4px; color: var(--brown); }

/* ===== Scan ===== */
.scan-wrap { max-width: 620px; margin: 0 auto; }
.scan-stage {
  position: relative; background: #1c140d; border-radius: var(--r); overflow: hidden; aspect-ratio: 1; display: grid; place-items: center;
}
.scan-stage video, .scan-stage canvas { width: 100%; height: 100%; object-fit: cover; display: block; }
.scan-stage .scan-frame {
  position: absolute; inset: 16%; border: 3px solid rgba(255,255,255,.85); border-radius: 18px; pointer-events: none;
  box-shadow: 0 0 0 2000px rgba(0,0,0,.28);
}
.scan-stage .scan-msg { position: absolute; color: #fff; font-weight: 800; text-align: center; padding: 20px; }
.scan-controls { display: flex; gap: 12px; justify-content: center; margin-top: 16px; flex-wrap: wrap; }
.scan-result { margin-top: 18px; background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 20px; display: none; }
.scan-result.show { display: block; animation: fade .3s; }
.scan-result h3 { margin: 0 0 6px; }
.scan-result .decoded { background: var(--cream); border: 1px solid var(--line); border-radius: 10px; padding: 12px; word-break: break-all; font-weight: 700; margin: 8px 0; }
.scan-result .safety { font-size: .9rem; color: var(--ink-soft); display: flex; gap: 8px; align-items: flex-start; }
.scan-result .actions { display: flex; gap: 10px; margin-top: 12px; flex-wrap: wrap; }

/* ===== Manifesto ===== */
.mani-hero { padding: 60px 0 30px; text-align: center; background: linear-gradient(180deg, #fff 0%, var(--cream) 100%); border-bottom: 1px solid var(--line); }
.mani-hero .mani-pup { filter: drop-shadow(0 8px 16px rgba(120,78,35,.18)); }
.mani-kicker { font-weight: 900; letter-spacing: .12em; text-transform: uppercase; color: var(--orange); font-size: .85rem; margin: 14px 0 6px; }
.mani-hero h1 { font-size: clamp(1.9rem, 4.6vw, 3rem); letter-spacing: -.02em; max-width: 16em; margin: 0 auto .3em; }
.mani-hero h1 span { color: var(--orange); }
.mani-lead { color: var(--ink-soft); font-size: 1.12rem; max-width: 38em; margin: 14px auto 0; }

.mani-body { max-width: 880px; }
.mani-block { margin: 6px 0 30px; }
.mani-block h2 { font-size: 1.7rem; }
.mani-block p { color: var(--ink); font-size: 1.05rem; }
.mani-block p + p { margin-top: 12px; }

.mani-cards { display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px; margin: 28px 0 40px; }
.mani-card { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 22px; box-shadow: var(--shadow-sm); }
.mani-card .mc-ico { font-size: 1.9rem; }
.mani-card h3 { margin: 8px 0 6px; font-size: 1.18rem; }
.mani-card p { margin: 0; color: var(--ink-soft); }

.mani-belief { background: #fff; border: 1px solid var(--line); border-radius: var(--r); padding: 28px 30px; box-shadow: var(--shadow-sm); margin-bottom: 40px; }
.mani-belief h2 { font-size: 1.6rem; }
.belief-list { list-style: none; padding: 0; margin: 14px 0 0; }
.belief-list li { padding: 12px 0 12px 34px; position: relative; border-top: 1px solid var(--line); color: var(--ink-soft); }
.belief-list li:first-child { border-top: 0; }
.belief-list li::before { content: "🐾"; position: absolute; left: 0; top: 11px; }
.belief-list li b { color: var(--ink); }

.mani-bill { background: linear-gradient(160deg, #fff6ee 0%, #ffe9d6 100%); border: 1px solid var(--line); border-radius: 22px; padding: 32px; box-shadow: var(--shadow-sm); margin-bottom: 40px; }
.bill-kicker { font-weight: 900; color: var(--brown-dk); letter-spacing: .04em; margin: 0 0 4px; }
.mani-bill h2 { font-size: 2rem; margin: 0 0 10px; }
.bill-intro { color: var(--ink); font-size: 1.05rem; max-width: 42em; }
.bill-list { counter-reset: bill; list-style: none; padding: 0; margin: 20px 0 0; }
.bill-list li { counter-increment: bill; position: relative; padding: 14px 0 14px 48px; border-top: 1px dashed rgba(169,104,47,.35); color: var(--ink-soft); }
.bill-list li b { color: var(--ink); }
.bill-list li::before {
  content: counter(bill); position: absolute; left: 0; top: 12px;
  width: 30px; height: 30px; border-radius: 50%; background: var(--orange); color: #fff;
  display: grid; place-items: center; font-weight: 900; font-size: .9rem;
}
.bill-note { margin-top: 22px; font-weight: 700; color: var(--brown-dk); }
.bill-note a { cursor: pointer; }

.mani-open { display: grid; grid-template-columns: 1.4fr 1fr; gap: 24px; align-items: stretch; }
.mo-left h2 { font-size: 1.6rem; }
.mo-left p { color: var(--ink-soft); font-size: 1.05rem; }
.mo-left p + p { margin-top: 12px; }
.mo-pledge { background: var(--ink); color: #fff; border-radius: var(--r); padding: 26px; }
.mo-pledge h3 { font-size: 1.3rem; margin-bottom: 6px; }
.mo-pledge p { color: #f6e2c4; margin: 0 0 12px; }
.mo-pledge ul { list-style: none; padding: 0; margin: 0 0 18px; }
.mo-pledge li { padding: 6px 0; font-weight: 800; border-bottom: 1px solid rgba(255,255,255,.12); }
.mo-pledge li:last-child { border-bottom: 0; }
.mo-pledge .btn { width: 100%; justify-content: center; }

/* ===== Footer ===== */
.site-footer { border-top: 1px solid var(--line); padding: 34px 0; margin-top: 30px; color: var(--ink-soft); }
.site-footer .wrap { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; }
.site-footer .brand b { font-size: 1.05rem; }
.site-footer .foot-note { flex: 1; min-width: 200px; font-size: .92rem; }
.site-footer a { font-weight: 800; }

/* ===== Toast ===== */
.toast {
  position: fixed; left: 50%; bottom: 26px; transform: translateX(-50%) translateY(20px);
  background: var(--ink); color: #fff; padding: 12px 20px; border-radius: 999px; font-weight: 800;
  opacity: 0; pointer-events: none; transition: opacity .25s, transform .25s; z-index: 100;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ===== Responsive ===== */
@media (max-width: 880px) {
  .hero-grid { grid-template-columns: 1fr; text-align: center; }
  .hero p.lead { margin-left: auto; margin-right: auto; }
  .hero-cta, .hero-badges { justify-content: center; }
  .hero-art { order: -1; }
  .builder { grid-template-columns: 1fr; }
  .preview { position: static; }
  .philo-grid { grid-template-columns: 1fr; }
  .chooser { grid-template-columns: 1fr; }
  .quick-card { max-width: 100%; }
  .mani-cards { grid-template-columns: 1fr; }
  .mani-open { grid-template-columns: 1fr; }
}
@media (max-width: 480px) {
  .row2 { grid-template-columns: 1fr; }
  .nav-link.hide-sm { display: none; }
}
