/* ==========================================================================
   QRScanner.in — design system
   Palette : Frost / Azure / Sky / Ink / Signal
   Type    : Bricolage Grotesque (display) · Inter Tight (body) · JetBrains Mono (data)
   Motif   : the QR finder pattern — concentric squares — used for eyebrows,
             card corners and section markers.
   Anjok Technologies
   ========================================================================== */

/* ---------- 1. Tokens ---------------------------------------------------- */
:root {
  /* colour */
  --ink:        #061A33;
  --ink-2:      #17395E;
  --ink-soft:   #4B6B90;
  --ink-faint:  #7E99B8;

  --azure:      #1668F0;
  --azure-deep: #0B4CC0;
  --azure-soft: #DCEBFF;
  --sky:        #59B7FF;
  --sky-soft:   #E6F3FF;

  --frost:      #EEF6FF;
  --frost-2:    #F7FBFF;
  --paper:      #FFFFFF;

  --signal:     #0FA97F;
  --signal-soft:#DCF7EE;
  --warn:       #E8890C;
  --danger:     #E23D4E;
  --danger-soft:#FDE7E9;

  --grid:       #D5E6F9;
  --grid-soft:  #E9F2FC;

  /* type */
  --font-display: 'Bricolage Grotesque', 'Segoe UI', system-ui, sans-serif;
  --font-body:    'Inter Tight', system-ui, -apple-system, 'Segoe UI', sans-serif;
  --font-mono:    'JetBrains Mono', ui-monospace, 'SF Mono', Menlo, monospace;

  /* scale */
  --step--1: clamp(.78rem, .76rem + .1vw, .84rem);
  --step-0:  clamp(.95rem, .92rem + .15vw, 1.02rem);
  --step-1:  clamp(1.12rem, 1.05rem + .35vw, 1.3rem);
  --step-2:  clamp(1.4rem, 1.25rem + .7vw, 1.85rem);
  --step-3:  clamp(1.8rem, 1.5rem + 1.4vw, 2.7rem);
  --step-4:  clamp(2.3rem, 1.7rem + 2.8vw, 4.1rem);

  /* space */
  --sp-1: .25rem; --sp-2: .5rem;  --sp-3: .75rem; --sp-4: 1rem;
  --sp-5: 1.5rem; --sp-6: 2rem;   --sp-7: 3rem;   --sp-8: 4.5rem;

  /* shape */
  --r-sm: 8px; --r-md: 14px; --r-lg: 20px; --r-xl: 28px; --r-pill: 999px;

  /* elevation — blue-tinted, never grey */
  --sh-1: 0 1px 2px rgba(6,26,51,.05), 0 2px 6px rgba(22,104,240,.05);
  --sh-2: 0 2px 6px rgba(6,26,51,.05), 0 10px 24px rgba(22,104,240,.08);
  --sh-3: 0 8px 20px rgba(6,26,51,.07), 0 24px 56px rgba(22,104,240,.13);
  --sh-glow: 0 10px 34px rgba(22,104,240,.28);

  --header-h: 68px;
  --ease: cubic-bezier(.32, .72, 0, 1);
}

[data-theme="dark"] {
  --ink:#EAF3FF; --ink-2:#C9DEF7; --ink-soft:#9BB6D6; --ink-faint:#6E88A8;
  --azure:#4E92FF; --azure-deep:#7FB0FF; --azure-soft:#14294A; --sky:#6FC0FF; --sky-soft:#122540;
  --frost:#060F1D; --frost-2:#0A1728; --paper:#0E1E33;
  --grid:#1C3355; --grid-soft:#152841; --signal-soft:#0C2F27; --danger-soft:#331520;
  --sh-1: 0 1px 2px rgba(0,0,0,.4);
  --sh-2: 0 4px 18px rgba(0,0,0,.45);
  --sh-3: 0 18px 50px rgba(0,0,0,.55);
}

/* ---------- 2. Reset ----------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }

body {
  font-family: var(--font-body);
  font-size: var(--step-0);
  line-height: 1.6;
  color: var(--ink);
  background: var(--frost);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

img, svg, canvas, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--azure); text-decoration: none; }
a:hover { color: var(--azure-deep); }
ul[class], ol[class] { list-style: none; padding: 0; }

:focus-visible {
  outline: 3px solid var(--sky);
  outline-offset: 2px;
  border-radius: 4px;
}

::selection { background: var(--azure); color: #fff; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- 3. Typography ------------------------------------------------ */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.08;
  letter-spacing: -.03em;
  color: var(--ink);
  font-variation-settings: 'wdth' 100, 'opsz' 24;
}
h1 { font-size: var(--step-4); }
h2 { font-size: var(--step-3); }
h3 { font-size: var(--step-2); }
h4 { font-size: var(--step-1); letter-spacing: -.02em; }

p { color: var(--ink-soft); }
strong { color: var(--ink); font-weight: 650; }

.lede { font-size: var(--step-1); color: var(--ink-soft); line-height: 1.55; max-width: 56ch; }
.muted { color: var(--ink-faint); }
.mono { font-family: var(--font-mono); font-size: .82em; letter-spacing: -.02em; }
.text-center { text-align: center; }
.mx-auto { margin-inline: auto; }

/* Signature: the finder-pattern eyebrow ---------------------------------- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: .6rem;
  font-family: var(--font-mono);
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--azure);
  margin-bottom: var(--sp-4);
}
.eyebrow::before {
  content: '';
  width: 14px; height: 14px;
  flex: none;
  border: 2.5px solid currentColor;
  border-radius: 4px;
  box-shadow: inset 0 0 0 2.5px transparent, inset 0 0 0 5px currentColor;
}
.eyebrow--center { justify-content: center; }

/* ---------- 4. Layout ---------------------------------------------------- */
.wrap { width: min(1240px, 100% - 2.5rem); margin-inline: auto; }
.wrap-tight { width: min(880px, 100% - 2.5rem); margin-inline: auto; }
@media (max-width: 640px) { .wrap, .wrap-tight { width: min(100% - 1.75rem, 100%); } }

.section { padding-block: clamp(3.5rem, 8vw, 7rem); }
.section--tint { background: var(--frost-2); }
.section--paper { background: var(--paper); }
.section-head { max-width: 64ch; margin-bottom: var(--sp-7); }
.section-head--center { margin-inline: auto; text-align: center; }

.grid { display: grid; gap: var(--sp-5); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(268px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fit, minmax(212px, 1fr)); }
.row { display: flex; gap: var(--sp-3); flex-wrap: wrap; align-items: center; }
.row--between { justify-content: space-between; }
.stack > * + * { margin-top: var(--sp-4); }

/* ---------- 5. Buttons --------------------------------------------------- */
.btn {
  --btn-bg: var(--azure);
  --btn-fg: #fff;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: .55rem;
  padding: .78rem 1.35rem;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-weight: 600;
  font-size: var(--step-0);
  letter-spacing: -.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease);
}
.btn:hover { color: var(--btn-fg); transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn:disabled { opacity: .5; cursor: not-allowed; transform: none; }

.btn--primary { box-shadow: var(--sh-glow); }
.btn--primary:hover { background: var(--azure-deep); }

.btn--ghost {
  --btn-bg: transparent; --btn-fg: var(--ink);
  border-color: var(--grid);
  background: var(--paper);
}
.btn--ghost:hover { border-color: var(--azure); color: var(--azure); }

.btn--quiet { --btn-bg: transparent; --btn-fg: var(--ink-soft); padding-inline: .8rem; }
.btn--quiet:hover { --btn-fg: var(--azure); background: var(--azure-soft); }

.btn--dark { --btn-bg: var(--ink); }
.btn--dark:hover { --btn-bg: var(--ink-2); }

.btn--danger { --btn-bg: var(--danger-soft); --btn-fg: var(--danger); }

.btn--sm { padding: .5rem .95rem; font-size: var(--step--1); }
.btn--lg { padding: 1rem 1.9rem; font-size: var(--step-1); }
.btn--block { width: 100%; }
.btn--icon { padding: .55rem; width: 2.4rem; height: 2.4rem; border-radius: var(--r-md); }

/* ---------- 6. Badges / chips ------------------------------------------- */
.badge {
  display: inline-flex; align-items: center; gap: .4rem;
  padding: .3rem .7rem;
  border-radius: var(--r-pill);
  background: var(--azure-soft);
  color: var(--azure-deep);
  font-size: .74rem; font-weight: 650; letter-spacing: .01em;
}
.badge--free { background: var(--signal-soft); color: var(--signal); }
.badge--warn { background: #FFF1DC; color: var(--warn); }
.badge--dot::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; box-shadow: 0 0 0 3px color-mix(in srgb, currentColor 22%, transparent);
}

/* ---------- 7. Cards ----------------------------------------------------- */
.card {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--grid);
  border-radius: var(--r-lg);
  padding: var(--sp-5);
  box-shadow: var(--sh-1);
  transition: transform .25s var(--ease), box-shadow .25s var(--ease), border-color .25s var(--ease);
}
.card--hover:hover { transform: translateY(-4px); box-shadow: var(--sh-3); border-color: var(--azure-soft); }
.card--flat { box-shadow: none; }

/* Finder-pattern corner — the motif that ties the whole product together */
.card--finder::after {
  content: '';
  position: absolute; top: 14px; right: 14px;
  width: 16px; height: 16px;
  border: 2px solid var(--grid);
  border-radius: 5px;
  box-shadow: inset 0 0 0 4px transparent, inset 0 0 0 7px var(--grid-soft);
  transition: border-color .25s var(--ease), box-shadow .25s var(--ease);
}
.card--finder:hover::after {
  border-color: var(--azure);
  box-shadow: inset 0 0 0 4px transparent, inset 0 0 0 7px var(--azure-soft);
}

.card-icon {
  display: grid; place-items: center;
  width: 46px; height: 46px;
  border-radius: var(--r-md);
  background: linear-gradient(150deg, var(--sky-soft), var(--azure-soft));
  color: var(--azure-deep);
  margin-bottom: var(--sp-4);
}
.card-icon svg { width: 22px; height: 22px; }
.card h4 + p { margin-top: .5rem; }

/* ---------- 8. Header ---------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 60;
  height: var(--header-h);
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  backdrop-filter: saturate(180%) blur(18px);
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  border-bottom: 1px solid var(--grid-soft);
}
.site-header.is-stuck { box-shadow: var(--sh-2); border-color: transparent; }
.header-inner { display: flex; align-items: center; gap: var(--sp-5); height: 100%; }

.brand { display: inline-flex; align-items: center; gap: .6rem; color: var(--ink); }
.brand:hover { color: var(--ink); }
.brand-mark { width: 34px; height: 34px; flex: none; }
.brand-name {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.16rem; letter-spacing: -.035em;
}
.brand-name span { color: var(--azure); }

.nav { display: flex; align-items: center; gap: .15rem; margin-left: auto; }
.nav a {
  padding: .5rem .8rem;
  border-radius: var(--r-sm);
  color: var(--ink-soft);
  font-weight: 550; font-size: .93rem;
  transition: color .16s, background .16s;
}
.nav a:hover { color: var(--azure); background: var(--azure-soft); }
.nav a.is-active { color: var(--azure); font-weight: 650; }
.header-cta { display: flex; align-items: center; gap: .5rem; margin-left: .6rem; }

.nav-toggle { display: none; }

@media (max-width: 1000px) {
  .nav-toggle {
    display: grid; place-items: center; margin-left: auto;
    width: 42px; height: 42px; border-radius: var(--r-md);
    background: var(--paper); border: 1px solid var(--grid); cursor: pointer;
  }
  .nav-toggle span {
    width: 18px; height: 2px; background: var(--ink); border-radius: 2px;
    position: relative; transition: transform .25s var(--ease), background .2s;
  }
  .nav-toggle span::before, .nav-toggle span::after {
    content: ''; position: absolute; left: 0; width: 18px; height: 2px;
    background: var(--ink); border-radius: 2px; transition: transform .25s var(--ease);
  }
  .nav-toggle span::before { top: -6px; }
  .nav-toggle span::after  { top: 6px; }
  .nav-toggle[aria-expanded="true"] span { background: transparent; }
  .nav-toggle[aria-expanded="true"] span::before { transform: translateY(6px) rotate(45deg); }
  .nav-toggle[aria-expanded="true"] span::after  { transform: translateY(-6px) rotate(-45deg); }

  .nav {
    position: fixed; inset: var(--header-h) 0 auto 0;
    flex-direction: column; align-items: stretch; gap: .1rem;
    margin: 0; padding: var(--sp-4) 1.25rem calc(var(--sp-5) + env(safe-area-inset-bottom));
    background: var(--paper);
    border-bottom: 1px solid var(--grid);
    box-shadow: var(--sh-3);
    max-height: calc(100dvh - var(--header-h));
    overflow-y: auto;
    transform: translateY(-12px);
    opacity: 0; visibility: hidden;
    transition: opacity .22s var(--ease), transform .22s var(--ease), visibility .22s;
  }
  .nav.is-open { opacity: 1; visibility: visible; transform: translateY(0); }
  .nav a { padding: .85rem .75rem; font-size: 1.02rem; }
  .header-cta { margin: var(--sp-3) 0 0; flex-direction: column; align-items: stretch; }
  .header-cta .btn { width: 100%; }
}

/* ---------- 9. Hero ------------------------------------------------------ */
.hero {
  position: relative;
  padding-block: clamp(2.5rem, 6vw, 5rem) clamp(3rem, 7vw, 6rem);
  overflow: hidden;
  background:
    radial-gradient(900px 520px at 88% -8%, var(--sky-soft), transparent 62%),
    radial-gradient(720px 460px at 4% 8%, #E4EFFF, transparent 60%),
    var(--frost);
}
[data-theme="dark"] .hero {
  background:
    radial-gradient(900px 520px at 88% -8%, #10294B, transparent 62%),
    radial-gradient(720px 460px at 4% 8%, #0C1E36, transparent 60%),
    var(--frost);
}

/* the module field — QR squares fading in behind the hero */
.module-field {
  position: absolute; inset: 0;
  pointer-events: none;
  opacity: .5;
  mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
  -webkit-mask-image: linear-gradient(180deg, #000 0%, transparent 78%);
}
.module-field rect { animation: modIn .9s var(--ease) both; }
@keyframes modIn { from { opacity: 0; transform: scale(.4); } to { opacity: 1; transform: scale(1); } }

.hero-inner {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, .95fr);
  gap: clamp(2rem, 5vw, 4.5rem);
  align-items: center;
}
@media (max-width: 940px) { .hero-inner { grid-template-columns: 1fr; } }

.hero h1 { margin-bottom: var(--sp-4); }
.hero h1 em {
  font-style: normal;
  color: var(--azure);
  position: relative;
  white-space: nowrap;
}
.hero h1 em::after {
  content: '';
  position: absolute; left: 0; right: 0; bottom: .08em; height: .16em;
  background: var(--sky); opacity: .35; border-radius: 3px;
}
.hero-actions { margin-top: var(--sp-5); }

.hero-proof {
  display: flex; flex-wrap: wrap; gap: 1.6rem;
  margin-top: var(--sp-6); padding-top: var(--sp-5);
  border-top: 1px solid var(--grid);
}
.proof-item .proof-num {
  font-family: var(--font-display); font-size: 1.5rem; font-weight: 700;
  letter-spacing: -.03em; color: var(--ink); line-height: 1;
}
.proof-item .proof-label {
  font-family: var(--font-mono); font-size: .7rem; text-transform: uppercase;
  letter-spacing: .1em; color: var(--ink-faint); margin-top: .35rem;
}

/* ---------- 10. Live generator panel (hero + studio) --------------------- */
.qr-panel {
  background: var(--paper);
  border: 1px solid var(--grid);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  overflow: hidden;
}
.qr-panel-head {
  display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3);
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--grid-soft);
  background: linear-gradient(180deg, var(--frost-2), var(--paper));
}
.qr-panel-title {
  font-family: var(--font-display); font-weight: 650; font-size: 1rem; letter-spacing: -.02em;
}
.qr-panel-body { padding: var(--sp-5); }

.qr-stage {
  display: grid; place-items: center;
  padding: var(--sp-5);
  border-radius: var(--r-lg);
  background:
    linear-gradient(var(--frost-2), var(--frost-2)) padding-box,
    repeating-linear-gradient(45deg, var(--grid-soft) 0 6px, transparent 6px 12px) border-box;
  border: 1px solid var(--grid);
  min-height: 268px;
}
.qr-stage canvas, .qr-stage svg { border-radius: 10px; }
#qr-render, .qr-render { display: grid; place-items: center; }

.qr-tabs { display: flex; gap: .25rem; padding: .25rem; background: var(--frost); border-radius: var(--r-pill); overflow-x: auto; scrollbar-width: none; }
.qr-tabs::-webkit-scrollbar { display: none; }
.qr-tab {
  flex: 1 0 auto; padding: .55rem 1rem; border: 0; border-radius: var(--r-pill);
  background: transparent; color: var(--ink-soft); font-weight: 600; font-size: .88rem;
  cursor: pointer; white-space: nowrap; transition: background .2s, color .2s;
}
.qr-tab:hover { color: var(--azure); }
.qr-tab.is-active { background: var(--paper); color: var(--azure); box-shadow: var(--sh-1); }

/* ---------- 11. Forms ---------------------------------------------------- */
.field { display: block; margin-bottom: var(--sp-4); }
.field-label {
  display: block; margin-bottom: .4rem;
  font-size: .82rem; font-weight: 620; color: var(--ink-2); letter-spacing: -.005em;
}
.field-hint { display: block; margin-top: .35rem; font-size: .76rem; color: var(--ink-faint); }

.input, .select, .textarea {
  width: 100%;
  padding: .8rem 1rem;
  background: var(--paper);
  border: 1.5px solid var(--grid);
  border-radius: var(--r-md);
  color: var(--ink);
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.input::placeholder, .textarea::placeholder { color: var(--ink-faint); }
.input:hover, .select:hover, .textarea:hover { border-color: var(--sky); }
.input:focus, .select:focus, .textarea:focus {
  outline: none;
  border-color: var(--azure);
  box-shadow: 0 0 0 4px color-mix(in srgb, var(--azure) 14%, transparent);
}
.textarea { min-height: 108px; resize: vertical; }
.select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='%234B6B90' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right .9rem center;
  background-size: 16px;
  padding-right: 2.6rem;
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-3); }
@media (max-width: 520px) { .field-row { grid-template-columns: 1fr; } }

.switch { display: inline-flex; align-items: center; gap: .65rem; cursor: pointer; user-select: none; }
.switch input { position: absolute; opacity: 0; width: 0; height: 0; }
.switch-track {
  width: 42px; height: 24px; flex: none;
  background: var(--grid); border-radius: var(--r-pill);
  position: relative; transition: background .2s var(--ease);
}
.switch-track::after {
  content: ''; position: absolute; top: 3px; left: 3px;
  width: 18px; height: 18px; border-radius: 50%; background: #fff;
  box-shadow: var(--sh-1); transition: transform .22s var(--ease);
}
.switch input:checked + .switch-track { background: var(--azure); }
.switch input:checked + .switch-track::after { transform: translateX(18px); }
.switch input:focus-visible + .switch-track { outline: 3px solid var(--sky); outline-offset: 2px; }
.switch-label { font-size: .88rem; font-weight: 550; }

/* colour input */
.colour-field { display: flex; align-items: center; gap: .6rem; }
.colour-field input[type="color"] {
  width: 44px; height: 40px; padding: 0; border: 1.5px solid var(--grid);
  border-radius: var(--r-sm); background: none; cursor: pointer;
}
.colour-field .input { flex: 1; font-family: var(--font-mono); font-size: .82rem; text-transform: uppercase; }

/* range */
input[type="range"] { -webkit-appearance: none; appearance: none; width: 100%; height: 6px; border-radius: 3px; background: var(--grid); cursor: pointer; }
input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none; width: 20px; height: 20px; border-radius: 50%;
  background: var(--azure); border: 3px solid var(--paper); box-shadow: var(--sh-1);
}
input[type="range"]::-moz-range-thumb {
  width: 20px; height: 20px; border: 3px solid var(--paper); border-radius: 50%;
  background: var(--azure); box-shadow: var(--sh-1);
}

/* option tiles (dot style, eye shape, presets) */
.option-set { display: grid; grid-template-columns: repeat(auto-fill, minmax(78px, 1fr)); gap: .5rem; }
.option {
  display: grid; place-items: center; gap: .35rem;
  padding: .7rem .4rem;
  border: 1.5px solid var(--grid); border-radius: var(--r-md);
  background: var(--paper); cursor: pointer;
  font-size: .72rem; font-weight: 600; color: var(--ink-soft);
  transition: border-color .18s, background .18s, color .18s, transform .18s var(--ease);
}
.option:hover { border-color: var(--sky); transform: translateY(-2px); }
.option.is-active { border-color: var(--azure); background: var(--azure-soft); color: var(--azure-deep); }
.option svg { width: 26px; height: 26px; }

.swatches { display: flex; flex-wrap: wrap; gap: .45rem; }
.swatch {
  width: 30px; height: 30px; border-radius: 9px; cursor: pointer;
  border: 2px solid var(--paper); box-shadow: 0 0 0 1.5px var(--grid);
  transition: transform .18s var(--ease), box-shadow .18s;
}
.swatch:hover { transform: scale(1.12); }
.swatch.is-active { box-shadow: 0 0 0 2.5px var(--azure); }

/* ---------- 12. Type picker --------------------------------------------- */
.type-groups { display: flex; flex-direction: column; gap: var(--sp-5); }
.type-group-label {
  font-family: var(--font-mono); font-size: .68rem; text-transform: uppercase;
  letter-spacing: .14em; color: var(--ink-faint); margin-bottom: .6rem;
}
.type-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(148px, 1fr)); gap: .5rem; }
.type-btn {
  display: flex; align-items: center; gap: .55rem;
  padding: .6rem .7rem; text-align: left;
  border: 1.5px solid var(--grid); border-radius: var(--r-md);
  background: var(--paper); cursor: pointer;
  transition: border-color .18s, background .18s, transform .18s var(--ease);
}
.type-btn:hover { border-color: var(--sky); transform: translateY(-2px); }
.type-btn.is-active { border-color: var(--azure); background: var(--azure-soft); }
.type-btn svg { width: 18px; height: 18px; flex: none; color: var(--azure); }
.type-btn-name { font-size: .84rem; font-weight: 620; color: var(--ink); line-height: 1.25; }
.type-btn-desc { font-size: .72rem; color: var(--ink-faint); }

/* ---------- 13. Studio layout ------------------------------------------- */
.studio {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr) 348px;
  gap: var(--sp-5);
  align-items: start;
}
.studio-col { min-width: 0; }
.studio-col--preview { position: sticky; top: calc(var(--header-h) + 1.25rem); }
.studio-panel {
  background: var(--paper); border: 1px solid var(--grid);
  border-radius: var(--r-lg); box-shadow: var(--sh-1); overflow: hidden;
}
.studio-panel-head {
  padding: var(--sp-4) var(--sp-5);
  border-bottom: 1px solid var(--grid-soft);
  font-family: var(--font-display); font-weight: 650; font-size: .96rem; letter-spacing: -.02em;
}
.studio-panel-body { padding: var(--sp-5); }
.studio-scroll { max-height: 62vh; overflow-y: auto; }

@media (max-width: 1180px) {
  .studio { grid-template-columns: minmax(0, 1fr) 330px; }
  .studio-col--types { grid-column: 1 / -1; }
  .studio-scroll { max-height: none; }
}
@media (max-width: 860px) {
  .studio { grid-template-columns: 1fr; }
  .studio-col--preview { position: static; }
}

/* scrollbars */
.studio-scroll::-webkit-scrollbar, .table-wrap::-webkit-scrollbar { width: 8px; height: 8px; }
.studio-scroll::-webkit-scrollbar-thumb, .table-wrap::-webkit-scrollbar-thumb { background: var(--grid); border-radius: 4px; }
.studio-scroll::-webkit-scrollbar-thumb:hover, .table-wrap::-webkit-scrollbar-thumb:hover { background: var(--sky); }

/* ---------- 14. Feature / solution cards -------------------------------- */
.feature-card { height: 100%; }
.feature-list { margin-top: var(--sp-3); display: grid; gap: .4rem; }
.feature-list li {
  display: flex; gap: .5rem; align-items: flex-start;
  font-size: .87rem; color: var(--ink-soft);
}
.feature-list li::before {
  content: ''; flex: none; margin-top: .45em;
  width: 7px; height: 7px; border-radius: 2px; background: var(--sky);
}

.solution-card { display: flex; flex-direction: column; height: 100%; }
.solution-tag {
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .12em;
  text-transform: uppercase; color: var(--azure); margin-bottom: .5rem;
}

/* ---------- 15. Stats band ---------------------------------------------- */
.stat-band {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr));
  border: 1px solid var(--grid); border-radius: var(--r-lg);
  background: var(--paper); overflow: hidden;
}
.stat-cell { padding: var(--sp-5); border-right: 1px solid var(--grid-soft); }
.stat-cell:last-child { border-right: 0; }
.stat-value {
  font-family: var(--font-display); font-size: var(--step-2); font-weight: 700;
  letter-spacing: -.035em; line-height: 1;
}
.stat-label {
  font-family: var(--font-mono); font-size: .69rem; text-transform: uppercase;
  letter-spacing: .11em; color: var(--ink-faint); margin-top: .5rem;
}
.stat-delta { font-size: .78rem; font-weight: 600; color: var(--signal); margin-top: .35rem; }
@media (max-width: 720px) { .stat-cell { border-right: 0; border-bottom: 1px solid var(--grid-soft); } }

/* ---------- 16. Tables --------------------------------------------------- */
.table-wrap { overflow-x: auto; border-radius: var(--r-lg); border: 1px solid var(--grid); background: var(--paper); }
table.data { width: 100%; border-collapse: collapse; min-width: 640px; }
table.data th {
  text-align: left; padding: .85rem 1rem;
  font-family: var(--font-mono); font-size: .68rem; letter-spacing: .1em;
  text-transform: uppercase; color: var(--ink-faint);
  background: var(--frost-2); border-bottom: 1px solid var(--grid);
  white-space: nowrap;
}
table.data td { padding: .9rem 1rem; border-bottom: 1px solid var(--grid-soft); font-size: .9rem; vertical-align: middle; }
table.data tr:last-child td { border-bottom: 0; }
table.data tbody tr { transition: background .15s; }
table.data tbody tr:hover { background: var(--frost-2); }
.cell-title { font-weight: 620; color: var(--ink); }
.cell-sub { font-size: .76rem; color: var(--ink-faint); }

/* ---------- 17. Dashboard ------------------------------------------------ */
.dash { display: grid; grid-template-columns: 236px minmax(0, 1fr); gap: var(--sp-5); align-items: start; }
@media (max-width: 900px) { .dash { grid-template-columns: 1fr; } }

.side-nav {
  position: sticky; top: calc(var(--header-h) + 1.25rem);
  background: var(--paper); border: 1px solid var(--grid);
  border-radius: var(--r-lg); padding: var(--sp-3);
}
@media (max-width: 900px) { .side-nav { position: static; display: flex; gap: .35rem; overflow-x: auto; } }
.side-nav a {
  display: flex; align-items: center; gap: .6rem;
  padding: .62rem .8rem; border-radius: var(--r-md);
  color: var(--ink-soft); font-weight: 570; font-size: .9rem; white-space: nowrap;
  transition: background .16s, color .16s;
}
.side-nav a:hover { background: var(--frost); color: var(--azure); }
.side-nav a.is-active { background: var(--azure-soft); color: var(--azure-deep); font-weight: 650; }
.side-nav svg { width: 17px; height: 17px; flex: none; }

.qr-tile { display: flex; gap: var(--sp-4); align-items: center; }
.qr-thumb {
  width: 66px; height: 66px; flex: none;
  border-radius: var(--r-md); border: 1px solid var(--grid);
  background: var(--frost-2); display: grid; place-items: center; overflow: hidden;
}
.qr-thumb img { width: 100%; height: 100%; object-fit: contain; padding: 5px; }

/* ---------- 18. Charts (pure CSS) --------------------------------------- */
.chart-bars { display: flex; align-items: flex-end; gap: 6px; height: 168px; padding-top: var(--sp-4); }
.chart-bars .bar { flex: 1; display: flex; flex-direction: column; justify-content: flex-end; height: 100%; }
.chart-bars .bar i {
  display: block; width: 100%; min-height: 3px;
  background: linear-gradient(180deg, var(--sky), var(--azure));
  border-radius: 5px 5px 2px 2px;
  transition: height .6s var(--ease), filter .2s;
}
.chart-bars .bar:hover i { filter: brightness(1.12); }
.chart-bars .bar b {
  font-family: var(--font-mono); font-size: .62rem; font-weight: 500;
  color: var(--ink-faint); text-align: center; margin-top: .45rem;
}

.meter-row { display: grid; gap: .8rem; }
.meter { display: grid; grid-template-columns: 88px 1fr 44px; align-items: center; gap: .7rem; font-size: .82rem; }
.meter-track { height: 8px; border-radius: 4px; background: var(--grid-soft); overflow: hidden; }
.meter-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--sky), var(--azure)); transition: width .7s var(--ease); }
.meter b { font-family: var(--font-mono); font-size: .76rem; text-align: right; color: var(--ink-soft); font-weight: 500; }

/* ---------- 19. Scanner -------------------------------------------------- */
.scan-frame {
  position: relative; border-radius: var(--r-lg); overflow: hidden;
  background: var(--ink); aspect-ratio: 4 / 3; display: grid; place-items: center;
}
.scan-frame video, .scan-frame canvas { width: 100%; height: 100%; object-fit: cover; }
.scan-reticle {
  position: absolute; inset: 50% auto auto 50%; transform: translate(-50%, -50%);
  width: min(58%, 240px); aspect-ratio: 1; pointer-events: none;
}
.scan-reticle span { position: absolute; width: 30px; height: 30px; border: 3px solid var(--sky); }
.scan-reticle span:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; border-radius: 8px 0 0 0; }
.scan-reticle span:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; border-radius: 0 8px 0 0; }
.scan-reticle span:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; border-radius: 0 0 0 8px; }
.scan-reticle span:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; border-radius: 0 0 8px 0; }
.scan-line {
  position: absolute; left: 6%; right: 6%; height: 2px;
  background: linear-gradient(90deg, transparent, var(--sky), transparent);
  animation: sweep 2.4s ease-in-out infinite;
}
@keyframes sweep { 0%, 100% { top: 8%; } 50% { top: 92%; } }

.dropzone {
  border: 2px dashed var(--grid); border-radius: var(--r-lg);
  padding: var(--sp-7) var(--sp-5); text-align: center;
  background: var(--frost-2); cursor: pointer;
  transition: border-color .2s, background .2s, transform .2s var(--ease);
}
.dropzone:hover, .dropzone.is-over { border-color: var(--azure); background: var(--azure-soft); transform: scale(1.005); }

.result-card { border-left: 4px solid var(--signal); }
.result-value {
  font-family: var(--font-mono); font-size: .86rem; word-break: break-all;
  background: var(--frost-2); border: 1px solid var(--grid-soft);
  border-radius: var(--r-md); padding: .8rem 1rem; color: var(--ink-2);
}

/* ---------- 20. CTA band ------------------------------------------------- */
.cta-band {
  position: relative; overflow: hidden;
  border-radius: var(--r-xl);
  padding: clamp(2.2rem, 5vw, 3.6rem);
  background:
    radial-gradient(600px 300px at 88% 10%, rgba(89,183,255,.35), transparent 65%),
    linear-gradient(140deg, var(--ink), #0C3A78 78%);
  color: #fff;
}
.cta-band h2, .cta-band h3 { color: #fff; }
.cta-band p { color: #BDD6F5; }
.cta-band .eyebrow { color: var(--sky); }
.cta-band .btn--ghost { background: rgba(255,255,255,.08); border-color: rgba(255,255,255,.28); --btn-fg: #fff; }
.cta-band .btn--ghost:hover { background: rgba(255,255,255,.16); color: #fff; }
.cta-band::after {
  content: ''; position: absolute; right: -60px; bottom: -70px;
  width: 240px; height: 240px; border-radius: 32px;
  border: 24px solid rgba(255,255,255,.05);
  box-shadow: inset 0 0 0 24px rgba(255,255,255,.04);
  transform: rotate(12deg);
}

/* ---------- 21. Footer --------------------------------------------------- */
.site-footer { background: var(--ink); color: #A8C4E6; padding-block: var(--sp-8) var(--sp-5); margin-top: var(--sp-7); }
[data-theme="dark"] .site-footer { background: #030B16; }
.site-footer h5 {
  font-family: var(--font-mono); font-size: .69rem; letter-spacing: .13em;
  text-transform: uppercase; color: #6E93C4; margin-bottom: var(--sp-3); font-weight: 600;
}
.site-footer a { color: #C9DEF7; font-size: .89rem; display: block; padding: .28rem 0; }
.site-footer a:hover { color: #fff; }
.footer-grid { display: grid; grid-template-columns: 1.6fr repeat(4, 1fr); gap: var(--sp-5); }
@media (max-width: 900px) { .footer-grid { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 460px) { .footer-grid { grid-template-columns: 1fr; } }
.footer-brand .brand-name { color: #fff; }
.footer-brand p { color: #8FB0D8; font-size: .89rem; margin-top: var(--sp-3); max-width: 34ch; }
.footer-bottom {
  display: flex; flex-wrap: wrap; gap: var(--sp-3); justify-content: space-between; align-items: center;
  margin-top: var(--sp-6); padding-top: var(--sp-4);
  border-top: 1px solid rgba(255,255,255,.09);
  font-size: .82rem; color: #7E9EC6;
}
.built-by { display: inline-flex; align-items: center; gap: .45rem; }
.built-by strong { color: #fff; font-weight: 600; }

/* ---------- 22. Auth ----------------------------------------------------- */
.auth-shell { display: grid; grid-template-columns: 1fr 1fr; min-height: calc(100dvh - var(--header-h)); }
@media (max-width: 900px) { .auth-shell { grid-template-columns: 1fr; } .auth-aside { display: none; } }
.auth-form-col { display: grid; place-items: center; padding: var(--sp-7) var(--sp-5); }
.auth-card { width: min(420px, 100%); }
.auth-aside {
  padding: var(--sp-7);
  display: flex; flex-direction: column; justify-content: center;
  background:
    radial-gradient(600px 340px at 78% 16%, rgba(89,183,255,.3), transparent 65%),
    linear-gradient(160deg, var(--ink), #0C3A78);
  color: #fff;
}
.auth-aside h2, .auth-aside h3 { color: #fff; }
.auth-aside p, .auth-aside li { color: #BDD6F5; }
.auth-aside .feature-list li { color: #BDD6F5; }
.auth-aside .feature-list li::before { background: var(--sky); }

/* ---------- 23. Alerts, toasts, empty states ---------------------------- */
.alert {
  display: flex; gap: .7rem; align-items: flex-start;
  padding: .85rem 1.05rem; border-radius: var(--r-md);
  font-size: .89rem; border: 1px solid transparent; margin-bottom: var(--sp-4);
}
.alert--error   { background: var(--danger-soft); color: #A32332; border-color: #F6C9CE; }
.alert--success { background: var(--signal-soft); color: #0A6E54; border-color: #B7EBDA; }
.alert--info    { background: var(--azure-soft); color: var(--azure-deep); border-color: #BFDCFF; }

.toast-stack {
  position: fixed; z-index: 200;
  right: 1rem; bottom: 1rem;
  display: flex; flex-direction: column; gap: .5rem;
  max-width: min(360px, calc(100vw - 2rem));
}
.toast {
  display: flex; align-items: center; gap: .6rem;
  padding: .8rem 1rem;
  background: var(--ink); color: #fff;
  border-radius: var(--r-md); box-shadow: var(--sh-3);
  font-size: .88rem;
  animation: toastIn .3s var(--ease) both;
}
.toast--ok   { background: #0A6E54; }
.toast--bad  { background: #A32332; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.97); } to { opacity: 1; transform: none; } }

.empty { text-align: center; padding: var(--sp-7) var(--sp-4); }
.empty-mark {
  width: 62px; height: 62px; margin: 0 auto var(--sp-4);
  border: 3px solid var(--grid); border-radius: 14px;
  box-shadow: inset 0 0 0 6px transparent, inset 0 0 0 12px var(--grid-soft);
}
.empty h4 { margin-bottom: .4rem; }

/* ---------- 24. Misc ----------------------------------------------------- */
.divider { height: 1px; background: var(--grid); border: 0; margin-block: var(--sp-5); }
.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;
}
.skip-link {
  position: absolute; left: .5rem; top: -60px; z-index: 200;
  padding: .6rem 1rem; background: var(--azure); color: #fff; border-radius: var(--r-md);
  transition: top .2s var(--ease);
}
.skip-link:focus { top: .5rem; color: #fff; }

.code-block {
  font-family: var(--font-mono); font-size: .8rem; line-height: 1.7;
  background: var(--ink); color: #C9DEF7;
  border-radius: var(--r-md); padding: 1rem 1.15rem; overflow-x: auto;
}
.code-block .k { color: var(--sky); }
.code-block .s { color: #7DE0BC; }

.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s var(--ease), transform .6s var(--ease); }
.reveal.is-in { opacity: 1; transform: none; }

.marquee-strip {
  display: flex; gap: .5rem; flex-wrap: wrap; justify-content: center;
}
.marquee-strip span {
  padding: .38rem .8rem; border: 1px solid var(--grid); border-radius: var(--r-pill);
  background: var(--paper); font-size: .78rem; color: var(--ink-soft); font-weight: 550;
}

@media print {
  .site-header, .site-footer, .btn, .toast-stack { display: none !important; }
  body { background: #fff; }
}

/* ---------- 25. Prose — rendered CMS content ---------------------------- */
.prose { font-size: 1.05rem; line-height: 1.75; color: var(--ink); }
.prose > * + * { margin-top: 1.15rem; }
.prose h2 { font-size: var(--step-2); margin-top: 2.4rem; }
.prose h3 { font-size: var(--step-1); margin-top: 2rem; }
.prose h4 { font-size: 1.05rem; margin-top: 1.6rem; }
.prose p { color: var(--ink-2); }
.prose a { color: var(--azure); text-decoration: underline; text-underline-offset: 2px; }
.prose a:hover { color: var(--azure-deep); }
.prose ul, .prose ol { padding-left: 1.4rem; }
.prose ul li { list-style: disc; }
.prose ol li { list-style: decimal; }
.prose li { margin-top: .45rem; color: var(--ink-2); }
.prose li::marker { color: var(--sky); }
.prose img {
  width: 100%;
  border-radius: var(--r-lg);
  border: 1px solid var(--grid);
  margin-block: 1.75rem;
}
.prose figure { margin-block: 1.75rem; }
.prose figcaption {
  font-size: .82rem;
  color: var(--ink-faint);
  text-align: center;
  margin-top: .6rem;
}
.prose blockquote {
  border-left: 4px solid var(--sky);
  background: var(--frost-2);
  border-radius: 0 var(--r-md) var(--r-md) 0;
  padding: 1rem 1.25rem;
  font-size: 1.06rem;
  color: var(--ink-2);
}
.prose pre {
  background: var(--ink);
  color: #C9DEF7;
  padding: 1.1rem 1.3rem;
  border-radius: var(--r-md);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: .85rem;
  line-height: 1.65;
}
.prose code {
  font-family: var(--font-mono);
  font-size: .88em;
  background: var(--azure-soft);
  color: var(--azure-deep);
  padding: .12em .4em;
  border-radius: 5px;
}
.prose pre code { background: none; color: inherit; padding: 0; }
.prose hr { border: 0; border-top: 1px solid var(--grid); margin-block: 2.25rem; }
.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: .92rem;
  display: block;
  overflow-x: auto;
}
.prose th, .prose td { border: 1px solid var(--grid); padding: .65rem .85rem; text-align: left; }
.prose th { background: var(--frost-2); font-weight: 650; }
