:root {
  --bg: #0d0f12;
  --panel: #15181d;
  --panel-2: #1a1e24;
  --text: #f5f7fa;
  --muted: #9ca5b3;
  --line: #2a3039;
  --accent: #a8ff5a;
  --accent-2: #78db2b;
  --danger: #ff6b73;
  --radius: 18px;
  --shadow: 0 18px 70px rgba(0, 0, 0, .28);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 50% -10%, rgba(168,255,90,.08), transparent 35%),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
}
button, input, textarea, select { font: inherit; }
a { color: inherit; text-decoration: none; }
button, a { -webkit-tap-highlight-color: transparent; }

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  max-width: 1180px;
  margin: 0 auto;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: rgba(13,15,18,.78);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255,255,255,.04);
}
.brand { display: inline-flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -.03em; font-size: 1.12rem; }
.brand-mark { width: 32px; height: 32px; border-radius: 9px; display: grid; place-items: center; background: var(--accent); color: #0a0d08; box-shadow: 0 0 28px rgba(168,255,90,.18); }
.nav-links { display: flex; gap: 24px; color: var(--muted); font-size: .94rem; }
.nav-links a:hover { color: var(--text); }

main { max-width: 1180px; margin: 0 auto; padding: 0 24px 70px; }
.hero { padding: 100px 0 72px; max-width: 900px; }
.eyebrow, .kicker { color: var(--accent); font-size: .75rem; letter-spacing: .15em; font-weight: 800; }
.hero h1 { margin: 13px 0 22px; font-size: clamp(3.1rem, 8vw, 6.6rem); line-height: .92; letter-spacing: -.065em; max-width: 960px; }
.hero h1 span { color: var(--muted); }
.hero p { max-width: 650px; color: var(--muted); font-size: 1.12rem; margin: 0 0 30px; }
.hero-actions, .action-row { display: flex; gap: 10px; align-items: center; }
.action-row.wrap { flex-wrap: wrap; }

.button {
  border: 1px solid var(--line);
  border-radius: 12px;
  min-height: 46px;
  padding: 0 18px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-weight: 750;
  transition: transform .16s ease, border-color .16s ease, background .16s ease, color .16s ease, opacity .16s ease;
}
.button:hover { transform: translateY(-2px); }
.button:active { transform: translateY(0) scale(.98); }
.button:disabled { opacity: .42; cursor: not-allowed; transform: none; }
.button.primary { background: var(--accent); color: #0b0e08; border-color: var(--accent); }
.button.primary:hover { background: var(--accent-2); border-color: var(--accent-2); }
.button.ghost { background: #171a1f; color: var(--text); }
.button.ghost:hover { border-color: #454e5c; }
.button.small { min-height: 39px; padding: 0 14px; font-size: .9rem; }
.button.full { width: 100%; }

.ad-slot[hidden] { display: none; }
.ad-slot {
  margin: 0 0 72px;
  min-height: 110px;
  border: 1px dashed #303741;
  border-radius: 14px;
  display: grid;
  place-items: center;
  text-align: center;
  color: #747f8e;
  background: rgba(255,255,255,.015);
}
.ad-slot span { display: block; text-transform: uppercase; font-size: .72rem; letter-spacing: .14em; font-weight: 800; }
.ad-slot small { display: block; margin-top: 5px; }
.ad-slot.compact { min-height: 90px; margin: 72px 0; }

.tool-section { scroll-margin-top: 90px; }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 30px; margin-bottom: 24px; }
.section-heading h2 { margin: 5px 0 0; font-size: clamp(2rem, 5vw, 3.3rem); letter-spacing: -.045em; }
.section-heading > p { color: var(--muted); margin: 0 0 7px; }
.tool-grid { display: grid; gap: 18px; }
.scanner-grid, .generator-grid { grid-template-columns: minmax(0, 1.45fr) minmax(320px, .75fr); }
.panel { background: linear-gradient(180deg, rgba(255,255,255,.025), transparent), var(--panel); border: 1px solid var(--line); border-radius: var(--radius); padding: 22px; box-shadow: var(--shadow); }
.panel-topbar { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 18px; }
.segmented { padding: 4px; border: 1px solid var(--line); border-radius: 11px; background: #0f1114; display: inline-flex; }
.segmented-button { border: 0; background: transparent; color: var(--muted); padding: 8px 13px; border-radius: 8px; cursor: pointer; font-weight: 750; }
.segmented-button.active { background: #242a31; color: var(--text); }
.status-dot { display: inline-flex; align-items: center; gap: 8px; color: var(--muted); font-size: .86rem; }
.status-dot i { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 15px rgba(168,255,90,.45); }
.scan-source { min-height: 390px; }
.scan-source:not(.active) { display: none; }
.reader { min-height: 315px; border-radius: 14px; overflow: hidden; background: #090b0d; border: 1px solid #232931; margin-bottom: 16px; display: grid; place-items: center; position: relative; }
.reader-viewport { width: 100%; min-height: 315px; display: grid; place-items: center; }
.reader-viewport:empty { min-height: 0; }
.reader video, .reader canvas, .reader img { max-width: 100% !important; border-radius: 10px; }
.reader-empty { position: absolute; inset: 0; display: grid; place-items: center; text-align: center; color: var(--muted); gap: 5px; padding: 30px; }
.reader-empty strong { color: var(--text); }
.scan-glyph { font-size: 3.4rem; color: var(--accent); line-height: 1; margin-bottom: 7px; }
.microcopy { color: #7f8997; font-size: .82rem; margin: 12px 0 0; }
.microcopy.centered { text-align: center; }
.dropzone { min-height: 315px; border: 1px dashed #3b4552; border-radius: 14px; background: #101317; display: grid; place-items: center; align-content: center; gap: 7px; text-align: center; padding: 30px; cursor: pointer; transition: border-color .16s ease, background .16s ease; }
.dropzone:hover { border-color: var(--accent); background: #121712; }
.dropzone input { position: absolute; opacity: 0; pointer-events: none; }
.dropzone span { color: var(--muted); }
.drop-icon { width: 54px; height: 54px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 50%; font-size: 1.5rem; margin-bottom: 8px; color: var(--accent) !important; }
.result-panel { min-height: 100%; display: flex; flex-direction: column; }
.result-empty { flex: 1; min-height: 330px; display: grid; place-items: center; align-content: center; gap: 5px; text-align: center; color: var(--muted); }
.result-empty strong { color: var(--text); }
.result-icon { font-size: 3rem; color: var(--accent); margin-bottom: 5px; }
.result-box { margin-top: 25px; }
.result-box label, .field > span { display: block; margin-bottom: 8px; font-size: .87rem; font-weight: 750; color: #cbd2dc; }
.result-box textarea, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 12px; background: #0e1114; color: var(--text); outline: 0; transition: border-color .16s ease, box-shadow .16s ease;
}
.result-box textarea:focus, .field textarea:focus, .field select:focus { border-color: #566171; box-shadow: 0 0 0 3px rgba(168,255,90,.06); }
.result-box textarea { min-height: 180px; resize: vertical; padding: 13px; margin-bottom: 12px; }

.controls-panel { display: flex; flex-direction: column; gap: 18px; }
.field textarea { min-height: 145px; resize: vertical; padding: 14px; }
.field small { display: block; color: #737d8b; text-align: right; margin-top: 6px; }
.field select { min-height: 45px; padding: 0 12px; }
.field-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
.color-field { min-height: 47px; background: #0e1114; border: 1px solid var(--line); border-radius: 12px; padding: 6px 10px; display: flex; align-items: center; gap: 10px; }
.color-field input[type="color"] { width: 35px; height: 31px; padding: 0; border: 0; background: transparent; cursor: pointer; }
.color-field code { color: var(--muted); font-size: .84rem; }
.error-message { color: var(--danger); background: rgba(255,107,115,.07); border: 1px solid rgba(255,107,115,.18); padding: 10px 12px; border-radius: 10px; margin: 0; }
.qr-preview-panel { display: flex; flex-direction: column; }
.qr-stage { background: #fff; border-radius: 16px; aspect-ratio: 1/1; width: 100%; margin: 18px 0 15px; padding: 14px; display: grid; place-items: center; overflow: hidden; }
.qr-stage canvas { width: 100%; height: 100%; display: block; image-rendering: pixelated; }

.info-strip { margin: 72px 0; display: grid; grid-template-columns: repeat(3, 1fr); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--panel); }
.info-strip > div { padding: 22px; border-right: 1px solid var(--line); }
.info-strip > div:last-child { border-right: 0; }
.info-strip strong, .info-strip span { display: block; }
.info-strip span { color: var(--muted); font-size: .9rem; margin-top: 4px; }

.faq { max-width: 850px; padding-top: 10px; }
.faq details { border-top: 1px solid var(--line); padding: 19px 0; }
.faq details:last-child { border-bottom: 1px solid var(--line); }
.faq summary { cursor: pointer; font-weight: 750; list-style-position: outside; }
.faq details p { color: var(--muted); margin: 10px 0 0; }
.site-footer { max-width: 1180px; margin: 0 auto; padding: 30px 24px 45px; border-top: 1px solid var(--line); display: grid; grid-template-columns: 1fr auto auto; align-items: center; gap: 24px; color: var(--muted); }
.footer-brand { color: var(--text); }
.site-footer p { margin: 0; }
.footer-links { display: flex; gap: 18px; }
.footer-links a:hover { color: var(--text); }
.toast { position: fixed; right: 22px; bottom: 22px; background: #f6f8fa; color: #101217; border-radius: 10px; padding: 11px 14px; font-weight: 750; box-shadow: 0 12px 40px rgba(0,0,0,.35); transform: translateY(18px); opacity: 0; pointer-events: none; transition: .2s ease; z-index: 99; }
.toast.show { opacity: 1; transform: translateY(0); }

.simple-page { max-width: 820px; margin: 0 auto; padding: 70px 24px 110px; }
.simple-page h1 { font-size: clamp(2.5rem, 7vw, 4.5rem); letter-spacing: -.05em; margin-bottom: 24px; }
.simple-page h2 { margin-top: 34px; }
.simple-page p, .simple-page li { color: var(--muted); }
.simple-page a { color: var(--accent); }

@media (max-width: 850px) {
  .scanner-grid, .generator-grid { grid-template-columns: 1fr; }
  .section-heading { align-items: start; flex-direction: column; gap: 4px; }
  .result-panel { min-height: 300px; }
  .result-empty { min-height: 230px; }
  .info-strip { grid-template-columns: 1fr; }
  .info-strip > div { border-right: 0; border-bottom: 1px solid var(--line); }
  .info-strip > div:last-child { border-bottom: 0; }
}

@media (max-width: 620px) {
  .site-header { padding: 14px 16px; }
  .nav-links { gap: 14px; font-size: .84rem; }
  main { padding-left: 16px; padding-right: 16px; }
  .hero { padding: 72px 0 52px; }
  .hero h1 { font-size: clamp(3rem, 16vw, 4.7rem); }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .field-grid { grid-template-columns: 1fr; }
  .panel { padding: 16px; }
  .panel-topbar { align-items: flex-start; flex-direction: column; }
  .site-footer { grid-template-columns: 1fr; padding-left: 16px; padding-right: 16px; }
  .footer-links { justify-content: flex-start; }
}
