/* ==========================================================================
   barcodeticket.com — design system
   ========================================================================== */

:root {
  --bg: #ffffff;
  --bg-alt: #f6f7f9;
  --bg-dark: #0b1220;
  --surface: #ffffff;
  --border: #e5e7eb;
  --text: #0f172a;
  --text-muted: #475569;
  --text-inverse: #f8fafc;
  --accent: #1d4ed8;
  --accent-hover: #1e40af;
  --accent-soft: #eff6ff;
  --success: #047857;
  --warning: #b45309;
  --danger: #b91c1c;
  --radius: 10px;
  --radius-sm: 6px;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.06);
  --shadow: 0 4px 16px rgba(15, 23, 42, 0.08);
  --maxw: 1120px;
  --gutter: clamp(16px, 4vw, 32px);
  --font-sans: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --bg-alt: #111a2e;
    --surface: #111a2e;
    --border: #1f2a44;
    --text: #e6ecf5;
    --text-muted: #a3b1c6;
    --accent: #60a5fa;
    --accent-hover: #93c5fd;
    --accent-soft: #18223a;
    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
    --shadow: 0 4px 16px rgba(0, 0, 0, 0.5);
  }
}

*, *::before, *::after { box-sizing: border-box; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, svg { max-width: 100%; height: auto; display: block; }

a {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}
a:hover { color: var(--accent-hover); }

h1, h2, h3, h4 {
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
  margin: 0 0 0.5em;
  letter-spacing: -0.01em;
}
h1 { font-size: clamp(2rem, 1.2rem + 3vw, 3rem); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.5rem, 1rem + 1.5vw, 2rem); }
h3 { font-size: 1.2rem; }

p { margin: 0 0 1em; color: var(--text); }

.muted { color: var(--text-muted); }

/* Skip link */
.skip-link {
  position: absolute; left: -9999px; top: auto;
  background: var(--text); color: var(--text-inverse);
  padding: 10px 14px; border-radius: var(--radius-sm);
  z-index: 1000;
}
.skip-link:focus { left: 12px; top: 12px; }

/* Container */
.container {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  border-bottom: 1px solid var(--border);
}
.nav {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; padding: 14px 0;
}
.brand {
  display: inline-flex; align-items: center; gap: 10px;
  font-weight: 800; font-size: 1.1rem; color: var(--text);
  text-decoration: none; letter-spacing: -0.01em;
}
.brand-mark {
  width: 28px; height: 28px; border-radius: 6px;
  background: linear-gradient(135deg, var(--accent), #6366f1);
  display: grid; place-items: center;
  box-shadow: var(--shadow-sm);
}
.brand-mark::before {
  content: "";
  width: 16px; height: 16px;
  background-image: repeating-linear-gradient(90deg, #fff 0 2px, transparent 2px 4px);
  background-size: 100% 100%;
}
.nav-list {
  display: flex; gap: 8px; list-style: none; margin: 0; padding: 0;
  align-items: center;
}
.nav-list a {
  color: var(--text);
  text-decoration: none;
  padding: 8px 12px; border-radius: var(--radius-sm);
  font-weight: 500;
}
.nav-list a:hover, .nav-list a[aria-current="page"] {
  background: var(--accent-soft); color: var(--accent);
}
.nav-toggle {
  display: none;
  background: transparent; border: 1px solid var(--border);
  padding: 8px 10px; border-radius: var(--radius-sm);
  color: var(--text); cursor: pointer; font: inherit;
}
@media (max-width: 820px) {
  .nav-toggle { display: inline-flex; gap: 8px; align-items: center; }
  .nav-list {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch; gap: 0;
    background: var(--surface); border-bottom: 1px solid var(--border);
    padding: 8px var(--gutter) 14px;
    display: none;
  }
  .nav-list.open { display: flex; }
  .nav-list a { padding: 12px 8px; border-radius: 0; border-bottom: 1px solid var(--border); }
  .nav-list li:last-child a { border-bottom: 0; }
}

/* Hero */
.hero {
  padding: clamp(48px, 6vw, 96px) 0 clamp(32px, 4vw, 64px);
  background:
    radial-gradient(1000px 500px at 85% -10%, color-mix(in srgb, var(--accent) 18%, transparent), transparent 60%),
    linear-gradient(180deg, var(--bg), var(--bg-alt));
}
.hero-grid {
  display: grid; grid-template-columns: 1.1fr 1fr; gap: clamp(24px, 4vw, 56px);
  align-items: center;
}
@media (max-width: 820px) { .hero-grid { grid-template-columns: 1fr; } }
.eyebrow {
  display: inline-block;
  font-size: 0.82rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--accent); font-weight: 700;
  background: var(--accent-soft);
  padding: 4px 10px; border-radius: 999px; margin-bottom: 14px;
}
.hero p.lede {
  font-size: 1.15rem; color: var(--text-muted); max-width: 58ch;
}
.cta-row { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 24px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 18px; border-radius: var(--radius);
  text-decoration: none; font-weight: 600;
  border: 1px solid transparent; cursor: pointer; font: inherit;
  transition: transform .08s ease, background-color .15s ease, border-color .15s ease;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--accent); color: #fff; }
.btn-primary:hover { background: var(--accent-hover); color: #fff; }
.btn-ghost {
  background: transparent; color: var(--text);
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--bg-alt); }

/* Barcode visual */
.hero-visual {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: calc(var(--radius) + 4px);
  padding: 24px;
  box-shadow: var(--shadow);
}
.ticket {
  border: 1px dashed var(--border);
  border-radius: var(--radius);
  padding: 18px;
  background: linear-gradient(180deg, var(--bg), var(--bg-alt));
  font-family: var(--font-mono);
  font-size: 0.9rem;
  color: var(--text-muted);
}
.ticket-header {
  display: flex; justify-content: space-between; align-items: center;
  font-weight: 700; color: var(--text); letter-spacing: 0.02em;
  font-family: var(--font-sans); font-size: 0.95rem;
  margin-bottom: 12px;
}
.ticket-meta { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 18px; margin-bottom: 16px; }
.ticket-meta dt { font-size: 0.72rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--text-muted); }
.ticket-meta dd { margin: 0; color: var(--text); font-weight: 600; }
.barcode {
  height: 72px;
  background-image: repeating-linear-gradient(
    90deg,
    var(--text) 0 2px, transparent 2px 4px,
    var(--text) 4px 7px, transparent 7px 9px,
    var(--text) 9px 10px, transparent 10px 13px,
    var(--text) 13px 16px, transparent 16px 18px
  );
  border-radius: 4px;
}
.barcode-caption {
  text-align: center; margin-top: 8px;
  font-family: var(--font-mono); letter-spacing: 0.2em; color: var(--text);
}

/* Sections */
section { padding: clamp(48px, 6vw, 88px) 0; }
section.alt { background: var(--bg-alt); border-block: 1px solid var(--border); }
.section-head { max-width: 720px; margin-bottom: 36px; }
.section-head p { color: var(--text-muted); font-size: 1.05rem; }

/* Feature grid */
.grid {
  display: grid; gap: 20px;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 22px;
  box-shadow: var(--shadow-sm);
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.card:hover { transform: translateY(-2px); box-shadow: var(--shadow); border-color: color-mix(in srgb, var(--accent) 40%, var(--border)); }
.card h3 { margin-top: 8px; }
.card p { color: var(--text-muted); margin: 0; }
.icon {
  width: 38px; height: 38px; border-radius: 10px;
  background: var(--accent-soft); color: var(--accent);
  display: grid; place-items: center; font-weight: 800;
  font-family: var(--font-mono);
}

/* Format table */
.table-wrap { overflow-x: auto; border: 1px solid var(--border); border-radius: var(--radius); background: var(--surface); }
table { width: 100%; border-collapse: collapse; min-width: 620px; }
thead th {
  text-align: left; font-size: 0.85rem; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--text-muted); padding: 14px 16px; background: var(--bg-alt);
  border-bottom: 1px solid var(--border);
}
tbody td { padding: 14px 16px; border-bottom: 1px solid var(--border); vertical-align: top; }
tbody tr:last-child td { border-bottom: 0; }
tbody td:first-child { font-weight: 700; font-family: var(--font-mono); }

/* Steps */
.steps { counter-reset: step; display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); }
.step {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 22px; position: relative;
}
.step::before {
  counter-increment: step; content: counter(step);
  position: absolute; top: -14px; left: 18px;
  width: 28px; height: 28px; border-radius: 8px;
  background: var(--accent); color: #fff;
  display: grid; place-items: center; font-weight: 800; font-size: 0.95rem;
  box-shadow: var(--shadow-sm);
}
.step h3 { margin-top: 6px; }
.step p { color: var(--text-muted); margin: 0; }

/* FAQ */
.faq details {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 0; margin-bottom: 10px; overflow: hidden;
}
.faq summary {
  cursor: pointer; padding: 16px 20px; font-weight: 600;
  display: flex; justify-content: space-between; align-items: center;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+"; font-weight: 400; font-size: 1.4rem; color: var(--text-muted);
  transition: transform .2s ease;
}
.faq details[open] summary::after { content: "–"; }
.faq details[open] summary { border-bottom: 1px solid var(--border); }
.faq .faq-body { padding: 16px 20px 20px; color: var(--text-muted); }
.faq .faq-body p:last-child { margin-bottom: 0; }

/* Lists */
.checklist { list-style: none; padding: 0; margin: 0; }
.checklist li {
  padding-left: 28px; position: relative; margin-bottom: 10px;
  color: var(--text);
}
.checklist li::before {
  content: ""; position: absolute; left: 4px; top: 8px;
  width: 14px; height: 8px; border-left: 2px solid var(--success); border-bottom: 2px solid var(--success);
  transform: rotate(-45deg);
}

/* CTA band */
.cta-band {
  background: linear-gradient(135deg, var(--accent), #4338ca);
  color: #fff; border-radius: var(--radius); padding: clamp(28px, 4vw, 48px);
  display: flex; flex-wrap: wrap; gap: 20px; justify-content: space-between; align-items: center;
}
.cta-band h2, .cta-band p { color: #fff; margin: 0; }
.cta-band .btn-primary { background: #fff; color: var(--accent); }
.cta-band .btn-primary:hover { background: #f1f5ff; color: var(--accent); }

/* Footer */
.site-footer {
  background: var(--bg-dark); color: #cbd5e1;
  padding: 48px 0 24px; margin-top: 32px;
}
.site-footer a { color: #e2e8f0; text-decoration: none; }
.site-footer a:hover { color: #fff; text-decoration: underline; }
.footer-grid {
  display: grid; gap: 32px; grid-template-columns: 1.4fr repeat(3, 1fr);
}
@media (max-width: 820px) { .footer-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 520px) { .footer-grid { grid-template-columns: 1fr; } }
.site-footer h4 {
  color: #fff; font-size: 0.82rem; letter-spacing: 0.12em;
  text-transform: uppercase; margin: 0 0 12px;
}
.site-footer ul { list-style: none; margin: 0; padding: 0; }
.site-footer li { margin-bottom: 8px; }
.site-footer .brand { color: #fff; }
.legal-bar {
  border-top: 1px solid #1e293b; margin-top: 36px; padding-top: 20px;
  display: flex; flex-wrap: wrap; gap: 12px; justify-content: space-between;
  font-size: 0.88rem; color: #94a3b8;
}

/* Article typography (for sub-pages) */
.prose { max-width: 72ch; }
.prose h2 { margin-top: 2em; }
.prose h3 { margin-top: 1.6em; }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li { margin-bottom: 6px; }
.prose code {
  font-family: var(--font-mono); font-size: 0.92em;
  background: var(--bg-alt); padding: 2px 6px; border-radius: 4px;
}

/* Utilities */
.lead-wrap { padding: clamp(40px, 5vw, 72px) 0 0; }
.page-head h1 { margin-bottom: 8px; }
.page-head p { color: var(--text-muted); font-size: 1.1rem; max-width: 70ch; }

/* Reveal animation (progressive enhancement, safe without JS) */
.reveal { opacity: 1; transform: none; transition: opacity .5s ease, transform .5s ease; }
.js .reveal { opacity: 0; transform: translateY(8px); }
.js .reveal.in { opacity: 1; transform: none; }

/* Print */
@media print {
  .site-header, .site-footer, .cta-band { display: none; }
  a { color: #000; text-decoration: underline; }
  body { background: #fff; color: #000; }
}

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