/* Self-hosted fonts (Fontshare — free for commercial use, no CDN at runtime). */
@font-face { font-family: "Clash Display"; src: url("lib/fonts/clash-display-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }
@font-face { font-family: "Clash Display"; src: url("lib/fonts/clash-display-600.woff2") format("woff2"); font-weight: 600; font-style: normal; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("lib/fonts/switzer-300.woff2") format("woff2"); font-weight: 300; font-style: normal; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("lib/fonts/switzer-400.woff2") format("woff2"); font-weight: 400; font-style: normal; font-display: swap; }
@font-face { font-family: "Switzer"; src: url("lib/fonts/switzer-500.woff2") format("woff2"); font-weight: 500; font-style: normal; font-display: swap; }

/* Visual language adapted from incredibles.dev:
   light editorial ground (#f1f1f1), ink #2b2b2b, hot-pink accent #fc4778,
   an oversized display face with tight tracking, and easeOutQuint motion.
   Fonts are free look-alikes (Clash Display ~ Frama, Switzer ~ Neue Montreal). */
:root {
  --bg: #f1f1f1;
  --surface: #ffffff;
  --surface-2: #fafafa;
  --ink: #2b2b2b;
  --muted: #656565;
  --faint: #a2a2a2;
  --line: #dedede;
  --line-2: #eaeaea;
  --accent: #fc4778;
  --accent-ink: #ffffff;
  --ok: #1f9d55;
  --bad: #e0245e;
  --radius: 14px;
  --ease: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-expo: cubic-bezier(0.19, 1, 0.22, 1);

  --font-head: "Clash Display", "Frama", system-ui, sans-serif;
  --font-body: "Switzer", "Neue Montreal", system-ui, -apple-system, sans-serif;
  --font-mono: "Supply Mono", ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  font-family: var(--font-body);
}

* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 300;
  line-height: 1.35;
  min-height: 100vh;
  padding: 40px 20px 56px;
  -webkit-font-smoothing: antialiased;
}

/* Motion: staggered fade-up reveal on load, easeOutQuint */
@keyframes fadeUp { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }
.hero, .grid > .panel, .foot { animation: fadeUp .9s var(--ease) both; }
.hero { animation-delay: .04s; }
.hero-title { animation: fadeUp 1s var(--ease) both; animation-delay: .1s; }
.hero-sub { animation: fadeUp 1s var(--ease) both; animation-delay: .18s; }
.hero-cta { animation: fadeUp 1s var(--ease) both; animation-delay: .26s; }
.grid > .panel:nth-child(1) { animation-delay: .14s; }
.grid > .panel:nth-child(2) { animation-delay: .22s; }
.foot { animation-delay: .3s; }

/* Hero */
.hero { max-width: 1040px; margin: 0 auto; padding: clamp(36px, 8vh, 92px) 0 clamp(30px, 6vh, 64px); }
.eyebrow { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-mono); font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--muted); margin: 0 0 22px; }
.eyebrow .dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); }
.hero-title {
  font-family: var(--font-head); font-weight: 600;
  font-size: clamp(48px, 11vw, 132px); line-height: .86; letter-spacing: -.045em;
  margin: 0; text-wrap: balance;
}
.hero-title em { font-style: normal; color: var(--accent); }
.hero-sub { max-width: 560px; margin: 26px 0 0; font-size: clamp(16px, 2.3vw, 20px); line-height: 1.5; color: var(--muted); }
.hero-cta { display: inline-flex; width: auto; margin-top: 30px; padding: 14px 26px; text-decoration: none; }
.tool-heading { max-width: 1040px; margin: 0 auto 14px; font-family: var(--font-head); font-weight: 500; font-size: clamp(22px, 3vw, 30px); letter-spacing: -.02em; }

/* Layout */
.grid {
  max-width: 1040px; margin: 0 auto;
  display: grid; grid-template-columns: 400px 1fr; gap: 20px; align-items: start;
}
@media (max-width: 820px) { .grid { grid-template-columns: 1fr; } }

.panel {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 18px; padding: 22px;
}

/* Dropzone */
.drop {
  display: block; border: 1.5px dashed var(--line); border-radius: var(--radius);
  padding: 30px; text-align: center; cursor: pointer; background: var(--surface-2);
  transition: border-color .4s var(--ease), background .4s var(--ease), transform .4s var(--ease);
}
.drop:hover, .drop.over { border-color: var(--accent); background: #fff5f8; transform: translateY(-2px); }
.drop-inner { display: grid; gap: 5px; }
.drop-ico { font-size: 26px; color: var(--accent); }
.drop-inner strong { font-family: var(--font-head); font-weight: 500; letter-spacing: -.01em; font-size: 20px; }
.muted { color: var(--muted); font-size: 13px; }

/* "or" divider + link input */
.or { display: flex; align-items: center; gap: 12px; margin: 16px 0; color: var(--faint); font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .12em; }
.or::before, .or::after { content: ""; flex: 1; height: 1px; background: var(--line); }
.linkrow { display: flex; gap: 10px; }
.linkrow input { flex: 1; min-width: 0; }
.linkrow .btn { flex: 0 0 auto; white-space: nowrap; }

/* Banner */
.banner { margin-top: 16px; padding: 12px 14px; border-radius: var(--radius); font-size: 13.5px; line-height: 1.45; border: 1px solid var(--line); background: var(--surface-2); }
.banner.ok { background: #eefaf1; border-color: #bfe6cb; color: #1a6d3a; }
.banner.warn { background: #fff7e8; border-color: #f0dca6; color: #8a6414; }
.banner.bad { background: #fdeef2; border-color: #f3c2ce; color: #9c2444; }

/* Controls */
#controls { margin-top: 18px; display: grid; gap: 16px; }
.field { display: grid; gap: 8px; }
.field > label { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .1em; color: var(--muted); }
.row { display: flex; gap: 10px; align-items: center; }

input[type="text"] {
  width: 100%; background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  border-radius: 10px; padding: 11px 12px; font-size: 14px; font-family: var(--font-body);
  transition: border-color .3s var(--ease), box-shadow .3s var(--ease);
}
input[type="text"]::placeholder { color: var(--faint); }
input[type="text"]:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(252, 71, 120, .15); }
input[type="color"] { width: 100%; height: 42px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; padding: 3px; cursor: pointer; }
.color-row { display: flex; gap: 10px; align-items: center; }
.color-row input[type="color"] { flex: 0 0 52px; width: 52px; }
.hex { flex: 1; text-transform: uppercase; font-family: var(--font-mono); letter-spacing: .03em; }
.hex.invalid { border-color: var(--bad); box-shadow: 0 0 0 3px rgba(224, 36, 94, .15); }
input[type="range"] { width: 100%; accent-color: var(--accent); }
.check { display: flex; align-items: center; gap: 9px; font-size: 14px; color: var(--ink); cursor: pointer; }
.check input { accent-color: var(--accent); width: 16px; height: 16px; }

/* Style presets */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 999px; padding: 7px 14px; font-size: 13px; font-weight: 500; font-family: var(--font-body);
  cursor: pointer; transition: border-color .3s var(--ease), color .3s var(--ease), background .3s var(--ease), transform .2s var(--ease);
}
.chip:hover { border-color: var(--ink); transform: translateY(-1px); }
.chip.surprise { border-color: var(--accent); color: var(--accent); }
.chip.surprise:hover { background: var(--accent); color: #fff; border-color: var(--accent); }

/* Segmented control */
.seg { display: inline-flex; border: 1px solid var(--line); border-radius: 10px; overflow: hidden; background: var(--surface); }
.seg button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  padding: 9px 16px; font-size: 13.5px; font-weight: 500; font-family: var(--font-body);
  border-right: 1px solid var(--line); transition: background .25s var(--ease), color .25s var(--ease);
}
.seg button:last-child { border-right: 0; }
.seg button:hover { color: var(--ink); }
.seg button.on { background: var(--accent); color: #fff; }

/* Buttons */
.btn {
  border: 1px solid var(--line); background: var(--surface); color: var(--ink);
  border-radius: 10px; padding: 11px 15px; font-size: 14px; font-weight: 500; font-family: var(--font-body);
  cursor: pointer; transition: background .3s var(--ease), color .3s var(--ease), border-color .3s var(--ease), transform .3s var(--ease);
}
.btn:hover { border-color: var(--ink); transform: translateY(-1px); }
.btn.ghost { background: transparent; color: var(--muted); border-color: transparent; }
.btn.ghost:hover { color: var(--accent); transform: none; }
.btn.primary {
  width: 100%; margin-top: 18px; background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  padding: 14px; font-size: 15px; letter-spacing: .01em;
}
.btn.primary:hover { background: #e23568; border-color: #e23568; transform: translateY(-2px); }
.btn.primary:disabled { opacity: .4; cursor: not-allowed; transform: none; }
.btn:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* Preview */
.preview { display: flex; flex-direction: column; align-items: center; min-height: 440px; justify-content: center; }
#canvas { max-width: 100%; height: auto; border-radius: 14px; box-shadow: 0 20px 50px rgba(43, 43, 43, .14); transition: transform .6s var(--ease); }
#canvas[width="0"], #canvas:not([width]) { display: none; }
.empty { text-align: center; color: var(--faint); display: grid; gap: 14px; justify-items: center; padding: 40px; }
.empty-qr {
  width: 92px; height: 92px; border-radius: 12px; opacity: .8; border: 2px solid var(--line);
  background:
    linear-gradient(var(--line), var(--line)) 0 0 / 30px 30px no-repeat,
    linear-gradient(var(--line), var(--line)) 62px 0 / 30px 30px no-repeat,
    linear-gradient(var(--line), var(--line)) 0 62px / 30px 30px no-repeat,
    linear-gradient(var(--line), var(--line)) 40px 40px / 14px 14px no-repeat;
}
.verify { margin-top: 16px; font-size: 13px; font-weight: 500; text-align: center; font-family: var(--font-mono); letter-spacing: .01em; }
.verify.ok { color: var(--ok); }
.verify.bad { color: var(--bad); }

/* Export row */
.export { display: flex; gap: 10px; width: 100%; margin-top: 16px; }
.export select {
  flex: 0 0 128px; background: var(--surface); border: 1px solid var(--line); color: var(--ink);
  border-radius: 10px; padding: 0 12px; font-size: 14px; font-weight: 500; font-family: var(--font-body); cursor: pointer;
}
.export select:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px rgba(252, 71, 120, .15); }
.export .btn.primary { flex: 1; margin-top: 0; }
.export-note { margin: 10px 0 0; font-size: 11.5px; color: var(--faint); font-family: var(--font-mono); letter-spacing: .02em; text-align: center; }

.foot { max-width: 1040px; margin: 30px auto 0; text-align: center; color: var(--faint); font-size: 12.5px; line-height: 1.5; display: grid; gap: 8px; }
.foot p { margin: 0; }
.foot .credit a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); transition: color .3s var(--ease), border-color .3s var(--ease); }
.foot .credit a:hover { color: var(--accent); border-color: var(--accent); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

/* ============================================================
   Landing sections
   Same language as the tool: 1040px column, white surfaces on the
   grey ground, hot-pink accent used sparingly, easeOutQuint motion.
   ============================================================ */

html { scroll-behavior: smooth; }
:target { scroll-margin-top: 92px; }

/* Skip link, visible only when focused */
.skip {
  position: absolute; left: 12px; top: -60px; z-index: 60;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 10px;
  font-size: 14px; text-decoration: none; transition: top .18s var(--ease);
}
.skip:focus { top: 12px; }

/* Sticky nav */
.nav {
  position: sticky; top: 0; z-index: 50;
  margin: -40px -20px 0; padding: 12px 20px;
  background: rgba(241, 241, 241, .82);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .25s var(--ease);
}
.nav.stuck { border-bottom-color: var(--line); }
.nav-inner { max-width: 1040px; margin: 0 auto; display: flex; align-items: center; gap: 18px; }
.brand { display: inline-flex; align-items: center; gap: 9px; text-decoration: none; color: var(--ink); font-family: var(--font-head); font-weight: 600; letter-spacing: -.02em; font-size: 16px; }
.brand img { width: 26px; height: 26px; border-radius: 7px; display: block; }
.nav-links { margin-left: auto; display: flex; align-items: center; gap: 22px; }
.nav-links a { color: var(--muted); text-decoration: none; font-size: 14.5px; transition: color .18s var(--ease); }
.nav-links a:hover { color: var(--ink); }
.nav-links .btn { padding: 9px 18px; font-size: 14px; }
@media (max-width: 720px) { .nav-links a:not(.btn) { display: none; } }

/* Shared section furniture */
.section { max-width: 1040px; margin: 0 auto; padding: clamp(48px, 8vw, 88px) 0 0; }
.section-head { max-width: 620px; margin-bottom: 34px; }
.kicker { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--accent); margin: 0 0 12px; }
.section h2 { font-family: var(--font-head); font-weight: 600; letter-spacing: -.025em; font-size: clamp(26px, 4vw, 40px); line-height: 1.1; margin: 0; }
.section h2 em { font-style: normal; color: var(--accent); }
.section-head p { color: var(--muted); font-size: clamp(15px, 2vw, 17px); line-height: 1.55; margin: 14px 0 0; }

.cards { display: grid; gap: 16px; grid-template-columns: repeat(3, 1fr); }
@media (max-width: 860px) { .cards { grid-template-columns: 1fr; } }
.card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 24px; transition: transform .35s var(--ease-expo), box-shadow .35s var(--ease-expo), border-color .25s var(--ease);
}
.card:hover { transform: translateY(-3px); border-color: var(--ink); box-shadow: 0 14px 34px -22px rgba(0,0,0,.4); }
.card .num { font-family: var(--font-mono); font-size: 11px; letter-spacing: .14em; color: var(--accent); }
.card h3 { font-family: var(--font-head); font-weight: 500; letter-spacing: -.015em; font-size: 19px; margin: 12px 0 8px; }
.card p { color: var(--muted); font-size: 14.5px; line-height: 1.55; margin: 0; }

/* Trust strip under the hero */
.trust { max-width: 1040px; margin: 34px auto 0; display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
@media (max-width: 720px) { .trust { grid-template-columns: repeat(2, 1fr); } }
.trust div { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 16px 18px; }
.trust b { display: block; font-family: var(--font-head); font-weight: 600; font-size: 21px; letter-spacing: -.02em; }
.trust span { display: block; color: var(--muted); font-size: 13px; margin-top: 3px; }

/* Safety block, the differentiator */
.safety { background: var(--ink); color: #f4f4f4; border-radius: 18px; padding: clamp(26px, 4vw, 44px); }
.safety .kicker { color: #ff85a8; }
.safety h2 { color: #fff; }
.safety h2 em { color: #ff85a8; }
.safety p { color: #c9c9c9; }
.safety .steps { display: grid; gap: 14px; grid-template-columns: repeat(3, 1fr); margin-top: 30px; }
@media (max-width: 860px) { .safety .steps { grid-template-columns: 1fr; } }
.safety .steps div { background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.12); border-radius: var(--radius); padding: 20px; }
.safety .steps b { display: block; font-family: var(--font-head); font-weight: 500; font-size: 16px; color: #fff; margin-bottom: 7px; }
.safety .steps p { font-size: 14px; margin: 0; }

/* Use cases */
.uses { display: flex; flex-wrap: wrap; gap: 10px; }
.uses span {
  background: var(--surface); border: 1px solid var(--line); border-radius: 999px;
  padding: 10px 18px; font-size: 14.5px; color: var(--ink);
  transition: border-color .2s var(--ease), transform .2s var(--ease);
}
.uses span:hover { border-color: var(--accent); transform: translateY(-2px); }

/* FAQ, native disclosure so it works without JS */
.faq { display: grid; gap: 10px; }
.faq details {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 4px 20px; transition: border-color .2s var(--ease);
}
.faq details[open] { border-color: var(--ink); }
.faq summary {
  list-style: none; cursor: pointer; padding: 16px 0; font-size: 16px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  font-family: var(--font-head); font-weight: 500; letter-spacing: -.01em;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; color: var(--accent); font-size: 22px; line-height: 1; flex: none; transition: transform .25s var(--ease); }
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 6px; }
.faq p { color: var(--muted); font-size: 14.5px; line-height: 1.6; margin: 0 0 18px; max-width: 68ch; }

/* Closing call to action */
.cta-band {
  max-width: 1040px; margin: clamp(48px, 8vw, 88px) auto 0; text-align: center;
  background: var(--surface); border: 1px solid var(--line); border-radius: 18px;
  padding: clamp(30px, 5vw, 52px);
}
.cta-band h2 { font-family: var(--font-head); font-weight: 600; letter-spacing: -.025em; font-size: clamp(24px, 3.6vw, 34px); margin: 0; }
.cta-band p { color: var(--muted); margin: 12px auto 26px; max-width: 46ch; font-size: 16px; }

/* Footer links */
.foot .links { display: flex; flex-wrap: wrap; gap: 16px; justify-content: center; }
.foot a { color: var(--muted); }
.foot a:hover { color: var(--accent); }

/* Legal pages */
.legal { max-width: 720px; margin: 0 auto; padding: clamp(30px, 6vw, 64px) 0 0; }
.legal h1 { font-family: var(--font-head); font-weight: 600; letter-spacing: -.03em; font-size: clamp(30px, 5vw, 46px); line-height: 1.05; margin: 0 0 10px; }
.legal h1 em { font-style: normal; color: var(--accent); }
.legal .updated { font-family: var(--font-mono); font-size: 11px; text-transform: uppercase; letter-spacing: .14em; color: var(--faint); margin: 0 0 30px; }
.legal h2 { font-family: var(--font-head); font-weight: 500; letter-spacing: -.02em; font-size: clamp(18px, 2.6vw, 23px); margin: 34px 0 10px; padding-top: 24px; border-top: 1px solid var(--line); }
.legal h2:first-of-type { border-top: 0; padding-top: 0; }
.legal p, .legal li { color: var(--muted); font-size: 15.5px; line-height: 1.65; }
.legal p { margin: 0 0 13px; }
.legal ul { margin: 0 0 16px; padding-left: 20px; }
.legal li { margin-bottom: 8px; }
.legal strong { color: var(--ink); font-weight: 500; }
.legal .callout { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; margin: 0 0 26px; }
.legal .callout b { display: block; font-family: var(--font-head); font-weight: 500; font-size: 16px; color: var(--ink); margin-bottom: 8px; }
.legal .callout p:last-child { margin-bottom: 0; }

/* ---- Landing polish -------------------------------------------------
   .btn.primary is full-width by design for the tool's Download button, and
   it out-specifies .hero-cta, so every marketing button was stretching to
   the full 1040px column. These hug their label instead. */
.btn.primary.hero-cta { width: auto; margin-top: 30px; }
.nav-links .btn.primary { width: auto; margin-top: 0; }
.cta-band .btn.primary { width: auto; margin-top: 4px; }

/* The tool heading sat flush against the trust strip */
.tool-heading { margin-top: clamp(44px, 7vw, 76px); }

/* Nav: keep labels on one line and stop the row wrapping at middling widths */
.nav-inner { flex-wrap: nowrap; }
.nav-links a { white-space: nowrap; }
@media (max-width: 940px) { .nav-links { gap: 16px; } }

/* Headings had a 620px cap that broke short lines awkwardly */
.section-head { max-width: 700px; }

/* Wayfinding: mark the section currently in view */
.nav-links a[aria-current="true"] { color: var(--accent); }

/* Respect reduced motion for the new sections too */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .card, .uses span, .faq details { transition: none; }
}
