:root {
  --bg: #020706;
  --panel: rgba(7, 20, 17, .88);
  --panel-strong: rgba(9, 30, 25, .96);
  --text: #eafff7;
  --muted: #9ccabd;
  --line: rgba(93, 255, 196, .22);
  --neon: #5dffc4;
  --neon-2: #78a7ff;
  --warn: #ffd166;
  --danger: #ff6b6b;
  --shadow: 0 22px 80px rgba(0, 0, 0, .48);
  --radius: 24px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 10% 0%, rgba(93, 255, 196, .18), transparent 30%),
    radial-gradient(circle at 90% 10%, rgba(120, 167, 255, .14), transparent 28%),
    linear-gradient(145deg, #020706 0%, #06120f 45%, #020706 100%);
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(93, 255, 196, .05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(93, 255, 196, .045) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0,0,0,.7), transparent 80%);
}

button, input, textarea, select { font: inherit; }
a { color: inherit; }
img { max-width: 100%; display: block; }

.page-shell {
  width: min(1180px, calc(100% - 28px));
  margin: 0 auto;
  padding: 18px 0 28px;
}

.hero, .panel, .info-card, .site-footer {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(10, 32, 27, .83), rgba(4, 14, 12, .84));
  box-shadow: var(--shadow), inset 0 1px 0 rgba(255,255,255,.05);
  backdrop-filter: blur(18px);
}

.hero {
  border-radius: 32px;
  overflow: hidden;
  position: relative;
}
.hero::after {
  content: "";
  position: absolute;
  inset: auto -20% 0 -20%;
  height: 1px;
  box-shadow: 0 0 80px 24px rgba(93,255,196,.35);
}

.topbar, .site-footer {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  padding: 18px 22px;
}

.brand {
  display: inline-flex;
  gap: 12px;
  align-items: center;
  text-decoration: none;
}
.brand small { display: block; color: var(--muted); margin-top: 2px; }
.brand-orb {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: radial-gradient(circle, #fff 0 8%, var(--neon) 10% 34%, rgba(93,255,196,.18) 35% 100%);
  box-shadow: 0 0 24px rgba(93,255,196,.75), inset 0 0 14px #fff;
}

.top-actions, .footer-links, .hero-badges, .type-tabs, .action-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.ghost-link, .hero-badges span, .footer-links a {
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  text-decoration: none;
  padding: 9px 13px;
  background: rgba(255,255,255,.04);
}
.ghost-link:hover, .footer-links a:hover { border-color: rgba(93,255,196,.75); }

.main-home-link {
  border-color: rgba(93,255,196,.55);
  background: linear-gradient(135deg, rgba(93,255,196,.16), rgba(120,167,255,.08));
  font-weight: 900;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: 20px;
  align-items: start;
  padding: 20px 22px 28px;
}
.eyebrow {
  color: var(--neon);
  font-weight: 800;
  letter-spacing: .12em;
  text-transform: uppercase;
  font-size: .76rem;
  margin: 0 0 8px;
}
h1, h2 { margin: 0; line-height: 1.04; }
h1 { font-size: clamp(2.15rem, 7vw, 5rem); max-width: 880px; }
h2 { font-size: clamp(1.35rem, 3vw, 2.1rem); }
.lead { color: var(--muted); font-size: clamp(1rem, 2.5vw, 1.2rem); line-height: 1.65; max-width: 760px; }
.hero-copy {
  max-width: 920px;
}
.hero-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 12px;
  background: radial-gradient(circle at center, rgba(93,255,196,.12), rgba(255,255,255,.03));
}
.cover-card {
  overflow: hidden;
  width: 100%;
}
.cover-card picture {
  display: block;
}
.cover-image {
  width: 100%;
  height: auto;
  aspect-ratio: auto;
  object-fit: contain;
  border-radius: 20px;
  box-shadow: 0 0 32px rgba(93,255,196,.18);
}

.app-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(340px, 440px);
  gap: 18px;
  margin-top: 18px;
  align-items: start;
}
.panel { border-radius: var(--radius); padding: 20px; }
.preview-panel { position: sticky; top: 14px; }
.panel-head { margin-bottom: 16px; }
.panel-head.compact { margin-bottom: 12px; }

.type-tabs { margin-bottom: 18px; }
.type-tab {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255,255,255,.04);
  border-radius: 16px;
  padding: 11px 14px;
  cursor: pointer;
  min-height: 44px;
}
.type-tab.active {
  color: #00100b;
  background: linear-gradient(135deg, var(--neon), #c9fff0);
  box-shadow: 0 0 22px rgba(93,255,196,.35);
  border-color: transparent;
  font-weight: 900;
}

.qr-form { display: grid; gap: 14px; }
.fieldset { display: none; gap: 14px; }
.fieldset.active { display: grid; }
.two-col { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
label { display: grid; gap: 7px; color: var(--muted); font-weight: 700; }
input, textarea, select {
  width: 100%;
  color: var(--text);
  background: rgba(0, 0, 0, .28);
  border: 1px solid var(--line);
  border-radius: 16px;
  min-height: 48px;
  padding: 12px 13px;
  outline: none;
}
textarea { resize: vertical; line-height: 1.45; }
input:focus, textarea:focus, select:focus {
  border-color: rgba(93,255,196,.82);
  box-shadow: 0 0 0 4px rgba(93,255,196,.09);
}
input[type="color"] { padding: 5px; min-height: 48px; }
input[type="range"] { padding: 0; accent-color: var(--neon); }
.check-row { display: flex; align-items: center; gap: 10px; }
.check-row input { width: 18px; min-height: 18px; accent-color: var(--neon); }

.advanced-box {
  border: 1px solid var(--line);
  background: rgba(255,255,255,.035);
  border-radius: 18px;
  padding: 14px;
}
.advanced-box summary { cursor: pointer; font-weight: 900; color: var(--text); }
.advanced-box[open] summary { margin-bottom: 14px; }
.hint { color: var(--muted); line-height: 1.5; margin: 4px 0 0; }

.qr-stage {
  position: relative;
  display: grid;
  place-items: center;
  padding: 18px;
  border-radius: 24px;
  background:
    linear-gradient(45deg, rgba(255,255,255,.045) 25%, transparent 25% 50%, rgba(255,255,255,.045) 50% 75%, transparent 75%),
    rgba(255,255,255,.04);
  background-size: 28px 28px;
  border: 1px solid var(--line);
  overflow: hidden;
}
#qrCanvas, .qr-fallback img {
  width: min(100%, 360px);
  aspect-ratio: 1 / 1;
  height: auto;
  border-radius: 18px;
  background: #fff;
  padding: 10px;
  box-shadow: 0 0 28px rgba(0,0,0,.42);
}
.qr-fallback { display: grid; place-items: center; }
.fallback-wrap {
  position: relative;
  display: grid;
  place-items: center;
}
.fallback-logo {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 18%;
  aspect-ratio: 1 / 1;
  object-fit: contain;
  border-radius: 16px;
  padding: 8px;
  background: rgba(255,255,255,.92);
  box-shadow: 0 0 18px rgba(0,0,0,.28);
  pointer-events: none;
}
.scan-ring {
  position: absolute;
  inset: 11px;
  border: 1px solid rgba(93,255,196,.15);
  border-radius: 24px;
  pointer-events: none;
}

.status-box, .payload-box {
  margin-top: 12px;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  background: rgba(0,0,0,.22);
  line-height: 1.45;
}
.status-box.ok { color: var(--neon); }
.status-box.warn { color: var(--warn); }
.status-box.error { color: var(--danger); }

.action-grid { margin-top: 12px; }
.primary-btn, .secondary-btn {
  min-height: 48px;
  border: 0;
  border-radius: 16px;
  padding: 12px 15px;
  cursor: pointer;
  font-weight: 900;
}
.primary-btn {
  flex: 1 1 170px;
  color: #00100b;
  background: linear-gradient(135deg, var(--neon), #c9fff0);
  box-shadow: 0 0 24px rgba(93,255,196,.28);
}
.secondary-btn {
  flex: 1 1 140px;
  color: var(--text);
  background: rgba(255,255,255,.055);
  border: 1px solid var(--line);
}
.primary-btn:hover, .secondary-btn:hover { transform: translateY(-1px); }

.info-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}
.info-card { border-radius: 20px; padding: 16px; }
.info-card strong { color: var(--neon); }
.info-card p { color: var(--muted); line-height: 1.5; margin-bottom: 0; }

.site-footer {
  margin-top: 18px;
  border-radius: 22px;
  align-items: flex-start;
}
.site-footer p { color: var(--muted); margin: 6px 0 0; line-height: 1.5; }
.site-footer code { color: var(--neon); }
.footer-links { justify-content: flex-end; }

@media (max-width: 920px) {
  .app-layout { grid-template-columns: 1fr; }
  .preview-panel { position: static; }
  .hero-grid { gap: 16px; }
}

@media (max-width: 640px) {
  .page-shell { width: min(100% - 18px, 1180px); padding-top: 9px; }
  .topbar, .site-footer { flex-direction: column; align-items: stretch; }
  .top-actions, .footer-links { display: grid; grid-template-columns: 1fr 1fr; }
  .ghost-link, .footer-links a { text-align: center; }
  .hero { border-radius: 22px; }
  .hero-grid { padding: 14px; }
  .hero-card { padding: 8px; border-radius: 20px; }
  .cover-image { border-radius: 14px; }
  .panel { padding: 14px; border-radius: 20px; }
  .type-tabs { display: grid; grid-template-columns: 1fr 1fr; }
  .two-col, .info-grid { grid-template-columns: 1fr; }
  .action-grid { display: grid; grid-template-columns: 1fr; }
  h1 { font-size: clamp(2rem, 13vw, 3.2rem); }
}

@media (prefers-reduced-motion: no-preference) {
  .brand-orb { animation: pulseOrb 3.8s ease-in-out infinite; }
  @keyframes pulseOrb { 0%,100% { transform: scale(1); } 50% { transform: scale(1.06); } }
}


/* Legal pages */
.legal-page .hero-grid { grid-template-columns: 1fr; }
.legal-layout { margin-top: 18px; }
.legal-card { max-width: 960px; margin: 0 auto; }
.legal-content { display: grid; gap: 18px; }
.legal-content h2 { margin-top: 8px; color: var(--neon); }
.legal-content h3 { margin: 8px 0 0; color: var(--text); }
.legal-content p, .legal-content li { color: var(--muted); line-height: 1.72; }
.legal-content ul { margin: 0; padding-left: 1.25rem; }
.legal-content .legal-meta { color: var(--neon); font-weight: 800; }
.legal-nav { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 18px; }
.legal-nav a { border: 1px solid var(--line); border-radius: 999px; padding: 10px 13px; text-decoration: none; background: rgba(255,255,255,.045); }
.legal-nav a:hover { border-color: rgba(93,255,196,.75); }
.legal-box { border: 1px solid var(--line); border-radius: 18px; padding: 14px; background: rgba(0,0,0,.2); }
.fallback-note { color: var(--warn); line-height: 1.5; margin: 0; text-align: center; }
