/* ------------------------------------------------------------------
   QueueBuddy Beta — self-contained design system for the beta subdomain
   (index / code / regions). Same visual language as the marketing
   redesign, but standalone so beta.queuebuddy.app carries no cross-
   directory dependency.
------------------------------------------------------------------- */

:root {
  --teal-900: #134E4A;
  --teal-700: #0F766E;
  --teal-600: #0D9488;
  --teal-500: #14B8A6;
  --teal-400: #2DD4BF;
  --teal-100: #CCFBF1;
  --teal-50:  #F0FDFA;

  --ink: #10201E;
  --ink-soft: #46605C;
  --ink-muted: #6E8582;

  --canvas: #FAFCFB;
  --surface: #FFFFFF;
  --surface-tint: #EFF7F5;
  --border: #E3ECE9;

  --good: #10B981;
  --warn: #F59E0B;
  --bad:  #F43F5E;
  --violet: #7C3AED;

  --radius-sm: 12px;
  --radius: 20px;
  --radius-lg: 32px;
  --radius-xl: 44px;

  --shadow-sm: 0 1px 2px rgba(16, 32, 30, .05), 0 1px 1px rgba(16, 32, 30, .03);
  --shadow-md: 0 12px 32px rgba(16, 32, 30, .08), 0 2px 8px rgba(16, 32, 30, .04);
  --shadow-lg: 0 32px 72px rgba(13, 148, 136, .16), 0 12px 32px rgba(16, 32, 30, .08);

  --maxw: 1120px;
  --gutter: clamp(20px, 4vw, 48px);

  --sans: "Instrument Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --serif: "Instrument Serif", Georgia, serif;

  --ease-out: cubic-bezier(.22, 1, .36, 1);
  --ease-spring: cubic-bezier(.34, 1.4, .44, 1);
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
}

body {
  margin: 0;
  font-family: var(--sans);
  color: var(--ink);
  background: var(--canvas);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; }
a { color: var(--teal-600); text-decoration: none; }

h1, h2, h3 {
  margin: 0 0 .5em;
  line-height: 1.06;
  letter-spacing: -0.03em;
  font-weight: 600;
  text-wrap: balance;
}
h1 { font-size: clamp(2.6rem, 6vw + 1rem, 4.6rem); }
h2 { font-size: clamp(2rem, 3.4vw + .8rem, 3.2rem); }
h3 { font-size: 1.3rem; letter-spacing: -0.015em; line-height: 1.25; }
p  { color: var(--ink-soft); }

em {
  font-family: var(--serif);
  font-style: italic;
  font-weight: 400;
  color: var(--teal-600);
  letter-spacing: 0;
}

.visually-hidden {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

::selection { background: var(--teal-100); color: var(--teal-900); }

/* ---- Reveal primitive (driven by beta.js) ---- */

[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  filter: blur(6px);
  transition:
    opacity .9s var(--ease-out),
    transform .9s var(--ease-out),
    filter .9s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
[data-reveal].is-revealing { will-change: opacity, transform, filter; }
[data-reveal].is-visible { opacity: 1; transform: none; filter: blur(0); }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  [data-reveal] {
    opacity: 1 !important;
    transform: none !important;
    filter: none !important;
    transition: none !important;
  }
  .marquee-track, .ribbon-dot, .kicker-pulse, .badge-stage .dot { animation: none !important; }
}

/* ---- Ribbon ---- */

.ribbon {
  background: var(--teal-900);
  color: var(--teal-50);
  font-size: .88rem;
  text-align: center;
  padding: 10px var(--gutter);
}
.ribbon p { margin: 0; color: inherit; }
.ribbon a {
  color: var(--teal-400);
  font-weight: 600;
  margin-left: 8px;
  border-bottom: 1px solid transparent;
  transition: border-color .2s;
}
.ribbon a:hover { border-color: var(--teal-400); }
.ribbon-dot {
  display: inline-block;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--teal-400);
  margin-right: 8px;
  animation: pulse 2.4s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(45, 212, 191, .5); }
  50%      { box-shadow: 0 0 0 6px rgba(45, 212, 191, 0); }
}

/* ---- Nav ---- */

.nav {
  position: sticky;
  top: 12px;
  z-index: 100;
  padding: 0 var(--gutter);
  margin-top: 12px;
}
.nav-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  padding: 12px 14px 12px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, .72);
  border: 1px solid rgba(227, 236, 233, .8);
  backdrop-filter: saturate(160%) blur(18px);
  -webkit-backdrop-filter: saturate(160%) blur(18px);
  box-shadow: var(--shadow-sm);
  transition: box-shadow .4s var(--ease-out), background .4s;
}
.nav.is-scrolled .nav-inner {
  box-shadow: var(--shadow-md);
  background: rgba(255, 255, 255, .88);
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 1.06rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  white-space: nowrap;
}
.brand img { border-radius: 9px; }
.nav-links { display: flex; gap: 4px; }
.nav-links a {
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--ink-soft);
  font-weight: 500;
  font-size: .95rem;
  transition: color .25s, background .25s;
}
.nav-links a:hover { color: var(--ink); background: var(--surface-tint); }

/* ---- Buttons ---- */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 22px;
  border-radius: 999px;
  font-family: var(--sans);
  font-weight: 600;
  font-size: .98rem;
  letter-spacing: -0.01em;
  border: 1px solid transparent;
  cursor: pointer;
  user-select: none;
  text-decoration: none;
  transition:
    transform .35s var(--ease-spring),
    box-shadow .35s var(--ease-out),
    background-color .25s,
    color .25s;
  will-change: transform;
}
.btn-lg { padding: 16px 30px; font-size: 1.05rem; }

.btn-primary {
  background: linear-gradient(135deg, var(--teal-400), var(--teal-600));
  color: #fff;
  box-shadow: 0 10px 26px rgba(13, 148, 136, .32), inset 0 1px 0 rgba(255, 255, 255, .25);
}
.btn-primary:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 18px 40px rgba(13, 148, 136, .4), inset 0 1px 0 rgba(255, 255, 255, .25);
  color: #fff;
}
.btn-primary:active { transform: translateY(0) scale(.99); }

.btn-dark { background: var(--ink); color: #fff; }
.btn-dark:hover {
  background: var(--teal-900); color: #fff;
  transform: translateY(-2px); box-shadow: var(--shadow-md);
}

.btn-plain {
  background: var(--surface);
  color: var(--ink);
  border-color: var(--border);
}
.btn-plain:hover {
  border-color: var(--teal-500); color: var(--teal-700);
  transform: translateY(-2px); box-shadow: var(--shadow-sm);
}

/* ---- Kickers & sections ---- */

.kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 18px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--teal-600);
}
.kicker-pulse {
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--teal-500);
  animation: pulse 2.4s ease-in-out infinite;
}

.section {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(70px, 11vw, 130px) var(--gutter);
}
.section-head { max-width: 780px; margin-bottom: clamp(40px, 6vw, 70px); }
.section-lede { font-size: 1.14rem; max-width: 640px; margin-top: 18px; }

/* ---- Hero ---- */

.hero {
  position: relative;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(48px, 8vw, 100px) var(--gutter) clamp(40px, 6vw, 80px);
}
.hero-copy { max-width: 780px; }
.hero-title { margin-bottom: 24px; }
.hero-lede {
  font-size: clamp(1.05rem, 1.1vw + .8rem, 1.22rem);
  max-width: 600px;
  margin: 0 0 28px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 14px; margin-top: 26px; }

/* ---- Marquee ---- */

.marquee {
  overflow: hidden;
  border-block: 1px solid var(--border);
  background: var(--surface);
  padding: 18px 0;
  mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 8%, #000 92%, transparent);
}
.marquee-track {
  display: flex;
  align-items: center;
  gap: 36px;
  width: max-content;
  animation: marquee 32s linear infinite;
}
.marquee-track span {
  font-family: var(--serif);
  font-style: italic;
  font-size: 1.35rem;
  color: var(--ink-soft);
  white-space: nowrap;
}
.marquee-track i { font-style: normal; color: var(--teal-500); font-size: .8rem; }
@keyframes marquee { to { transform: translateX(-50%); } }
.marquee:hover .marquee-track { animation-play-state: paused; }

/* ---- Bento cards (tester perks) ---- */

.perks {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 18px;
}
.bento-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: clamp(24px, 2.6vw, 34px);
  overflow: hidden;
  transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out), border-color .3s;
}
.bento-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
  border-color: var(--teal-100);
}
.bento-card h3 { margin-bottom: 10px; }
.bento-card p { margin: 0; font-size: .98rem; }
.bento-icon {
  display: grid;
  place-items: center;
  width: 52px; height: 52px;
  border-radius: 16px;
  background: var(--teal-50);
  font-size: 1.5rem;
  margin-bottom: 18px;
  transition: transform .4s var(--ease-spring), background .3s;
}
.bento-card:hover .bento-icon {
  transform: scale(1.08) rotate(-4deg);
  background: var(--teal-100);
}
.perk-pill {
  display: inline-block; margin-top: 14px;
  font-size: .68rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  color: var(--teal-700); background: var(--teal-50);
  padding: 4px 10px; border-radius: 999px;
}

/* ---- Badge (alpha status) ---- */

.badge-stage {
  display: inline-flex; align-items: center; gap: 8px;
  background: #FDEFD3; color: #A16207;
  padding: 7px 14px; border-radius: 999px;
  font-size: .82rem; font-weight: 700;
}
.badge-stage .dot {
  width: 8px; height: 8px; border-radius: 50%; background: var(--warn);
  animation: pulse 2.4s ease-in-out infinite;
}

/* ---- Draw lanes ---- */

.draws {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 18px;
}
.draw {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  overflow: hidden;
  transition: transform .5s var(--ease-out), box-shadow .5s var(--ease-out);
}
.draw:hover { transform: translateY(-6px); box-shadow: var(--shadow-md); }
.draw::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 5px; }
.draw.alpha::before { background: linear-gradient(90deg, var(--violet), #C084FC); }
.draw.beta::before  { background: linear-gradient(90deg, var(--teal-400), var(--teal-600)); }
.draw.wait::before  { background: linear-gradient(90deg, var(--warn), #FBBF24); }
.draw .tag { font-size: .72rem; font-weight: 800; letter-spacing: .1em; text-transform: uppercase; }
.draw.alpha .tag { color: var(--violet); }
.draw.beta  .tag { color: var(--teal-600); }
.draw.wait  .tag { color: #B45309; }
.draw h3 { margin: 10px 0 8px; }
.draw p  { margin: 0 0 12px; font-size: .96rem; }
.draw .prize { font-weight: 800; color: var(--ink); font-size: 1rem; }
.draws-note { margin-top: 20px; font-size: .95rem; color: var(--ink-soft); }
.draws-note strong { color: var(--teal-700); }

/* ---- Dark request card + region form ---- */

.join {
  position: relative;
  background:
    radial-gradient(80% 60% at 85% 0%, rgba(45, 212, 191, .14), transparent 60%),
    var(--ink);
  color: #fff;
  border-radius: var(--radius-xl);
  padding: clamp(30px, 5vw, 56px);
  overflow: hidden;
}
.join .kicker { color: var(--teal-400); }
.join h2 { color: #fff; }
.join .join-sub { color: #B9D4CE; max-width: 560px; margin: 14px 0 26px; font-size: 1.06rem; }
.join form { display: grid; gap: 14px; max-width: 560px; }

.field { display: grid; gap: 6px; }
.field label {
  font-size: .74rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase;
  color: #8FD3C8;
}
.field input {
  padding: 14px 16px; border-radius: 14px;
  border: 1px solid rgba(255,255,255,.16);
  background: rgba(255,255,255,.06);
  color: #fff; font: inherit; font-size: 1rem;
  transition: border-color .2s, background .2s;
}
.field input::placeholder { color: rgba(255,255,255,.5); }
.field input:focus {
  outline: none; border-color: var(--teal-400);
  background: rgba(255,255,255,.1);
}
.row-two { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 520px) { .row-two { grid-template-columns: 1fr; } }

.btn-submit {
  margin-top: 6px; justify-self: start;
  padding: 15px 30px; border: 0; border-radius: 999px;
  background: linear-gradient(135deg, var(--teal-400), var(--teal-600));
  color: #fff; font: inherit; font-weight: 700; font-size: 1.02rem;
  cursor: pointer;
  box-shadow: 0 10px 26px rgba(13,148,136,.35);
  transition: transform .3s var(--ease-spring), box-shadow .3s;
}
.btn-submit:hover { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(13,148,136,.45); }
.btn-submit:disabled { opacity: .65; cursor: progress; transform: none; }

.note { margin: 16px 0 0; font-size: .95rem; min-height: 1.3em; font-weight: 500; }
.note.ok { color: #A7F3D0; }
.note.warn { color: #FDE68A; }
.note.error { color: #FECACA; }
.privacy-line { margin-top: 12px; font-size: .82rem; color: #7FB8AF; }
.privacy-line a { color: #A7F3D0; }
.join-regions { text-align: center; margin-top: 22px; }
.join-regions a {
  color: var(--teal-400); font-weight: 700;
  border-bottom: 1px solid transparent; transition: border-color .2s;
}
.join-regions a:hover { border-color: var(--teal-400); }

/* ---- Footer ---- */

.footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
}
.footer-inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px var(--gutter);
  display: flex;
  align-items: center;
  gap: 24px;
  flex-wrap: wrap;
}
.footer-links { display: flex; gap: 20px; margin-left: auto; }
.footer-links a { color: var(--ink-soft); font-size: .92rem; transition: color .2s; }
.footer-links a:hover { color: var(--teal-700); }
.footer-copy { width: 100%; margin: 8px 0 0; font-size: .85rem; color: var(--ink-muted); }

/* ------------------------------------------------------------------
   Code page — the personal access-code screen
------------------------------------------------------------------- */

.code-wrap {
  min-height: 100dvh;
  display: grid;
  place-items: center;
  padding: 40px var(--gutter);
  background:
    radial-gradient(70% 55% at 85% -5%, rgba(45, 212, 191, .16), transparent 60%),
    var(--canvas);
}
.code-card {
  width: 100%;
  max-width: 540px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-xl);
  padding: clamp(30px, 5vw, 44px);
  box-shadow: var(--shadow-lg);
  text-align: center;
}
.code-badge {
  display: inline-flex; align-items: center; gap: 7px;
  background: var(--teal-50); color: var(--teal-700);
  font-size: .74rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase;
  padding: 6px 13px; border-radius: 999px;
}
.code-card h1 { font-size: clamp(1.9rem, 5vw, 2.6rem); margin: 18px 0 6px; }
.code-card .sub { color: var(--ink-soft); margin: 0 0 26px; }

.code-box {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  background: var(--ink);
  border-radius: 18px;
  padding: 16px 18px;
  margin: 6px 0 8px;
}
.code-text {
  font-family: ui-monospace, "SF Mono", Menlo, Monaco, Consolas, monospace;
  font-size: clamp(1.5rem, 6vw, 2.1rem); font-weight: 800; letter-spacing: .1em;
  color: var(--teal-400); user-select: all;
}
.copy-btn {
  flex-shrink: 0; border: 0; cursor: pointer;
  background: rgba(45, 212, 191, .16); color: var(--teal-400);
  font: inherit; font-weight: 700; font-size: .9rem; padding: 10px 15px; border-radius: 12px;
  transition: background .2s;
}
.copy-btn:hover { background: rgba(45, 212, 191, .28); }
.copy-btn.copied { background: var(--teal-400); color: var(--teal-900); }
.copy-hint { font-size: .82rem; color: var(--ink-soft); margin: 0 0 22px; min-height: 1.1em; }

.save-note {
  background: #FDEFD3; color: #92400e; border-radius: 14px;
  padding: 12px 15px; font-size: .84rem; margin: 0 0 22px; line-height: 1.45; text-align: left;
}
.steps { text-align: left; margin: 0 0 26px; padding: 0; list-style: none; display: grid; gap: 12px; }
.steps li { display: flex; gap: 12px; align-items: flex-start; }
.steps .n {
  flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%;
  background: linear-gradient(135deg, var(--teal-400), var(--teal-600));
  color: #fff; font-weight: 800; font-size: .82rem;
  display: grid; place-items: center; margin-top: 1px;
}
.steps .t { font-size: .95rem; color: var(--ink-soft); }
.steps .t strong { color: var(--ink); }

.cta {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  width: 100%; border: 0; cursor: pointer;
  background: linear-gradient(135deg, var(--teal-400), var(--teal-600)); color: #fff;
  font: inherit; font-weight: 700; font-size: 1.02rem;
  padding: 15px 22px; border-radius: 999px; text-decoration: none;
  box-shadow: 0 10px 26px rgba(13,148,136,.32);
  transition: transform .3s var(--ease-spring), box-shadow .3s, opacity .2s;
}
.cta:hover:not(:disabled) { transform: translateY(-2px); box-shadow: 0 16px 36px rgba(13,148,136,.42); }
.cta:disabled { opacity: .5; cursor: not-allowed; }
.footnote { font-size: .8rem; color: var(--ink-soft); margin: 16px 0 0; }
.footnote a { color: var(--teal-700); }
.code-error { color: #b91c1c; }

/* ------------------------------------------------------------------
   Regions page — public list of open alpha regions
------------------------------------------------------------------- */

.count-pill {
  display: inline-flex; align-items: center; gap: 7px; margin: 8px 0 30px;
  background: var(--teal-50); color: var(--teal-700);
  font-size: .82rem; font-weight: 800; padding: 7px 14px; border-radius: 999px;
}
.regions-list { display: grid; gap: 14px; }
.country-group {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 20px 22px;
  transition: transform .4s var(--ease-out), box-shadow .4s var(--ease-out), border-color .3s;
}
.country-group:hover { transform: translateY(-3px); box-shadow: var(--shadow-sm); border-color: var(--teal-100); }
.country-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.country-name { font-size: 1.15rem; font-weight: 700; letter-spacing: -0.01em; }
.whole-tag {
  font-size: .68rem; font-weight: 800; letter-spacing: .06em; text-transform: uppercase;
  color: var(--violet); background: #EDE9FE; padding: 4px 10px; border-radius: 999px;
}
.cities { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.city-chip {
  font-size: .9rem; font-weight: 600; color: var(--teal-700);
  background: var(--teal-50); padding: 6px 13px; border-radius: 999px;
}
.whole-line { margin-top: 12px; font-size: .92rem; color: var(--ink-soft); }
.state { text-align: center; color: var(--ink-soft); padding: 50px 0; font-size: 1rem; }
.empty-card {
  background: var(--surface); border: 1px dashed var(--border);
  border-radius: var(--radius); padding: 36px 24px; text-align: center; color: var(--ink-soft);
}
.req-note { margin-top: 30px; font-size: .95rem; color: var(--ink-soft); }
.req-note a { color: var(--teal-700); font-weight: 700; }
.back-link { display: inline-block; margin-top: 22px; color: var(--teal-700); font-weight: 700; }

/* ---- Responsive ---- */

@media (max-width: 760px) {
  .nav-links { display: none; }
}
@media (max-width: 560px) {
  .ribbon { font-size: .8rem; }
  .footer-inner { justify-content: flex-start; }
  .footer-links { margin-left: 0; }
}
