:root {
  --bg: #0b1f3a;
  --card: #111d2f;
  --surface: #0f2748;
  --border: #23324d;
  --primary: #3a8dff;
  --success: #22c55e;
  --warning: #f59e0b;
  --error: #ef4444;
  --text: #e5e7eb;
  --muted: #9ca3af;
}

html {
  scroll-behavior: smooth;
}

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

body {
  background: #080818;
  color: var(--text);
  font-family: 'Onest', 'SF Pro Text', system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.6;
  min-height: 100vh;
  scroll-behavior: smooth;
}

body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: -1;
  background: url('/images/main_bg.webp') center top / cover no-repeat;
}

@media (max-width: 63.9375em) {
  body::before {
    background-image: url('/images/main_bg-md.webp');
  }
}

@media (max-width: 47.9375em) {
  body::before {
    background-image: url('/images/main_bg-sm.webp');
  }
}

@property --angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 0deg;
}
@keyframes spin-border {
  to {
    --angle: 360deg;
  }
}

/* Cards */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: 1rem;
  padding: 20px;
  transition: border-color 0.25s;
}
.card:hover {
  border-color: transparent;
  background:
    linear-gradient(var(--card), var(--card)) padding-box,
    conic-gradient(from var(--angle), #22c55e, #3a8dff, #8b5cf6, #22c55e)
      border-box;
  animation: spin-border 3s linear infinite;
}

/* Buttons */
.btn-primary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: #22c55e;
  color: #080818;
  height: 54px;
  border-radius: 14px;
  width: 100%;
  border: none;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
}
.btn-primary:hover {
  opacity: 0.88;
}

.btn-secondary {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  background: var(--card);
  color: var(--text);
  border: 1px solid var(--border);
  height: 46px;
  border-radius: 14px;
  width: 100%;
  font-size: 15px;
  font-weight: 500;
  cursor: pointer;
  text-decoration: none;
  transition: opacity 0.15s;
}
.btn-secondary:hover {
  opacity: 0.8;
}

/* Section label */
.label-section {
  font-size: 11px;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
}

/* Dot indicators */
.dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.dot-success {
  background: var(--success);
}
.dot-primary {
  background: var(--primary);
}
.dot-warning {
  background: var(--warning);
}
.dot-error {
  background: var(--error);
}

/* Icon box */
.icon-box {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 26px;
  flex-shrink: 0;
}
.icon-box-primary {
  background: rgba(58, 141, 255, 0.15);
  color: var(--primary);
}
.icon-box-success {
  background: rgba(34, 197, 94, 0.15);
  color: var(--success);
}
.icon-box-warning {
  background: rgba(245, 158, 11, 0.15);
  color: var(--warning);
}
.icon-box-error {
  background: rgba(239, 68, 68, 0.15);
  color: var(--error);
}

/* Page layout */
.page-wrap {
  max-width: 75rem;
  margin: 0 auto;
  padding: 2rem 2rem 3rem;
}

/* Desktop two-column */
@media (min-width: 860px) {
  .page-wrap .gap-stack {
    max-width: 28rem;
    margin-left: auto;
    margin-right: auto;
  }
  .desktop-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 32px;
  }
}

/* Status badges */
.badge {
  font-size: 12px;
  font-weight: 600;
  padding: 2px 10px;
  border-radius: 20px;
}
.badge-checking {
  background: rgba(245, 158, 11, 0.2);
  color: var(--warning);
}
.badge-available {
  background: rgba(34, 197, 94, 0.2);
  color: var(--success);
}
.badge-unavailable {
  background: rgba(239, 68, 68, 0.2);
  color: var(--error);
}

/* Steps list */
.steps {
  list-style: none;
  counter-reset: step;
}
.steps li {
  counter-increment: step;
  padding: 8px 0 8px 36px;
  position: relative;
  color: var(--muted);
  font-size: 14px;
  border-bottom: 1px solid var(--border);
}
.steps li:last-child {
  border-bottom: none;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 8px;
  width: 22px;
  height: 22px;
  border-radius: 50%;
  background: var(--surface);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* Mirror source row */
.mirror-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border);
}
.mirror-row:last-child {
  border-bottom: none;
}

/* QR container */
#qrcode canvas,
#qrcode img {
  border-radius: 12px;
}

/* Category cards */
.category-card {
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: 12px;
  cursor: pointer;
  font-size: 14px;
  color: var(--text);
  transition:
    border-color 0.15s,
    background 0.15s;
  margin-bottom: 8px;
}
.category-card:hover {
  border-color: var(--success);
}
.category-card.selected {
  border-color: var(--success);
  background: rgba(34, 197, 94, 0.08);
}

/* Helpers */
.text-muted {
  color: var(--muted);
}
.text-sm {
  font-size: 13px;
}
.text-xs {
  font-size: 11px;
}
.gap-stack {
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.gap-stack-sm {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.row-start {
  display: flex;
  align-items: flex-start;
  gap: 10px;
}
.row-center {
  display: flex;
  align-items: center;
  gap: 10px;
}
.mt-8 {
  margin-top: 8px;
}
.mt-12 {
  margin-top: 12px;
}
.mt-16 {
  margin-top: 16px;
}
.mt-24 {
  margin-top: 24px;
}
.mt-32 {
  margin-top: 32px;
}

/* ── Shared container ── */
.container {
  max-width: 75rem;
  margin: 0 auto;
  padding: 0 2rem;
}

/* ── Header ── */
.site-header > .container {
  width: 100%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 200;
  height: 4.5rem;
  display: flex;
  align-items: center;
  background: rgba(8, 8, 24, 0.82);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 0.625rem;
  text-decoration: none;
}
.logo-icon-img {
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 0.5rem;
  flex-shrink: 0;
  display: block;
}
.logo-text {
  line-height: 1;
}
.logo-name {
  font-size: 1.125rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}
.logo-name .capy {
  color: #22c55e;
}
.logo-name .phantom {
  color: #e5e7eb;
}
.logo-sub {
  font-size: 0.6875rem;
  font-weight: 500;
  color: #e5e7eb;
  letter-spacing: 0.18em;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.375rem;
  margin-top: 0.125rem;
}
.logo-sub::before,
.logo-sub::after {
  content: '';
  display: block;
  height: 1px;
  width: 0.875rem;
  background: #22c55e;
}

/* Nav */
.site-nav {
  display: flex;
  gap: 2rem;
  list-style: none;
}
.site-nav a {
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(229, 231, 235, 0.65);
  text-decoration: none;
  transition: color 0.15s;
}
.site-nav a:hover {
  color: #e5e7eb;
}

/* Header right cluster: nav + pill/hamburger */
.header-end {
  display: flex;
  align-items: center;
  gap: 2rem;
}

/* Header right group */
.header-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

/* Hamburger toggle — hidden on desktop */
.nav-toggle {
  display: none;
  width: 2.25rem;
  height: 2.25rem;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 0.5rem;
  cursor: pointer;
  padding: 0;
  flex-shrink: 0;
  transition: background 0.15s, border-color 0.15s;
}
.nav-toggle:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.28);
}

.hamburger-icon {
  position: relative;
  display: block;
  width: 1.125rem;
  height: 1.5px;
  background: #e5e7eb;
  transition: background 0.2s;
}
.hamburger-icon::before,
.hamburger-icon::after {
  content: '';
  position: absolute;
  left: 0;
  width: 100%;
  height: 1.5px;
  background: #e5e7eb;
  transition: transform 0.22s ease, top 0.22s ease;
}
.hamburger-icon::before { top: -5px; }
.hamburger-icon::after  { top:  5px; }
.hamburger-icon.is-open { background: transparent; }
.hamburger-icon.is-open::before { top: 0; transform: rotate(45deg); }
.hamburger-icon.is-open::after  { top: 0; transform: rotate(-45deg); }

/* Mobile dropdown panel */
.nav-dropdown {
  position: absolute;
  top: 4.5rem;
  left: 0;
  right: 0;
  background: rgba(8, 8, 24, 0.97);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  z-index: 190;
  padding: 0.75rem 0 1.375rem;
}

.nav-dropdown-links {
  list-style: none;
  display: flex;
  flex-direction: column;
}
.nav-dropdown-links li {
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}
.nav-dropdown-links a {
  display: block;
  padding: 0.875rem 0;
  font-size: 0.9375rem;
  font-weight: 500;
  color: rgba(229, 231, 235, 0.72);
  text-decoration: none;
  transition: color 0.15s;
}
.nav-dropdown-links a:hover { color: #e5e7eb; }

.nav-dropdown-cta {
  margin-top: 1rem;
  width: 100%;
  justify-content: center;
}

/* Support pill */
.btn-support {
  height: 2.5rem;
  padding: 0 1.25rem;
  border-radius: 1.25rem;
  border: 1px solid rgba(229, 231, 235, 0.22);
  background: transparent;
  color: #e5e7eb;
  font-size: 0.875rem;
  font-weight: 600;
  cursor: pointer;
  text-decoration: none;
  display: flex;
  align-items: center;
  transition:
    background 0.18s,
    border-color 0.18s;
}
.btn-support:hover {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(229, 231, 235, 0.45);
}

/* ── Footer ── */
.site-footer {
  background: rgba(6, 6, 18, 0.98);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  padding: 0;
}

.footer-accent-bar {
  height: 2px;
  background: linear-gradient(
    90deg,
    transparent 0%,
    #22c55e 30%,
    #3a8dff 70%,
    transparent 100%
  );
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr auto;
  gap: 3rem;
  padding: 3rem 0 2.25rem;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}

/* Brand column */
.footer-brand {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.footer-tagline {
  font-size: 0.8125rem;
  line-height: 1.65;
  color: #9ca3af;
  max-width: 22rem;
  margin: 0;
}

.footer-social {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.25rem;
}

.footer-social-link {
  display: inline-flex;
  align-items: center;
  gap: 0.4375rem;
  font-size: 0.8125rem;
  font-weight: 500;
  color: #9ca3af;
  text-decoration: none;
  padding: 0.4375rem 0.875rem;
  border-radius: 0.5rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  transition: color 0.15s, border-color 0.15s, background 0.15s;
}
.footer-social-link:hover {
  color: #e5e7eb;
  border-color: rgba(34, 197, 94, 0.3);
  background: rgba(34, 197, 94, 0.06);
}

/* Nav columns */
.footer-nav {
  display: flex;
  gap: 2.5rem;
  padding-top: 0.125rem;
}

.footer-nav-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
  min-width: 8rem;
}

.footer-nav-heading {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #22c55e;
  margin: 0;
}

.footer-nav-col ul {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.footer-nav-col a {
  font-size: 0.8125rem;
  color: #9ca3af;
  text-decoration: none;
  transition: color 0.15s;
}
.footer-nav-col a:hover {
  color: #e5e7eb;
}

/* CTA column */
.footer-cta-col {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.75rem;
  padding-top: 0.125rem;
}

.footer-cta-label {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: #22c55e;
  margin: 0;
}

.footer-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.6875rem 1.375rem;
  background: #22c55e;
  color: #080818;
  font-size: 0.875rem;
  font-weight: 700;
  border-radius: 0.625rem;
  text-decoration: none;
  white-space: nowrap;
  transition: opacity 0.15s, transform 0.15s;
}
.footer-cta-btn:hover {
  opacity: 0.88;
  transform: translateY(-1px);
}

.footer-cta-note {
  font-size: 0.6875rem;
  color: #6b7280;
  margin: 0;
}

/* Bottom row */
.footer-bottom {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 1.125rem 0 1.375rem;
}

.footer-copy {
  font-size: 0.75rem;
  color: #6b7280;
  margin: 0;
}

.footer-tech {
  font-size: 0.6875rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: rgba(34, 197, 94, 0.4);
  margin: 0;
}

/* ── Alpine cloak ── */
[x-cloak] { display: none !important; }

/* ── Shared keyframes ── */
@keyframes dl-enter {
  from { opacity: 0; transform: translateY(20px); }
  to   { opacity: 1; transform: translateY(0); }
}
@keyframes dot-pulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50%       { opacity: 0.4; transform: scale(0.7); }
}

/* ── Download/Mirror page base ── */
.dl-page {
  background-image: radial-gradient(circle, rgba(58, 141, 255, 0.12) 1px, transparent 1px);
  background-size: 28px 28px;
  padding-top: 2.5rem;
  animation: dl-enter 0.5s cubic-bezier(0.22, 0.68, 0, 1.1) both;
}

/* ── Card border variants ── */
.card--warning        { border-color: rgba(245, 158, 11, 0.3); }
.card--warning-strong { border-color: var(--warning); }
.card--error          { border-color: rgba(239, 68, 68, 0.3); }
.card--success        { border-color: rgba(34, 197, 94, 0.3); }

/* ── Typography utilities ── */
.card-title    { font-size: 14px; font-weight: 600; }
.page-title    { font-size: 28px; font-weight: 700; margin-top: 16px; }
.font-semibold { font-weight: 600; }
.text-warning  { color: var(--warning); }
.text-center   { text-align: center; }
.text-mono     { font-family: monospace; }
.word-break-all { word-break: break-all; }

/* ── Layout utilities ── */
.flex-grow { flex: 1; }
.min-w-0   { min-width: 0; }
.mb-12     { margin-bottom: 12px; }
.list-disc { list-style: disc; padding-left: 16px; }

/* ── Dot alignment in row-start ── */
.row-start .dot { margin-top: 6px; }

/* ── Icon centered in card ── */
.icon-box--centered { margin: 0 auto 12px; }

/* ── Disabled buttons ── */
button:disabled,
.btn-primary:disabled,
.btn-secondary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
}

/* ── Responsive: header/footer/container ── */
@media (max-width: 63.9375em) {
  /* Collapse desktop nav, show hamburger; support btn moves into dropdown */
  .site-nav { display: none; }
  .nav-toggle { display: flex; }
  .header-right .btn-support { display: none; }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
    grid-template-rows: auto auto;
    gap: 2rem;
  }
  .footer-brand {
    grid-column: 1 / -1;
  }
  .footer-cta-col {
    justify-self: start;
  }
}

@media (max-width: 47.9375em) {
  .container {
    padding: 0 1.125rem;
  }
  .page-wrap {
    padding: 2rem 1.125rem 3rem;
  }
  .footer-grid {
    grid-template-columns: 1fr;
    gap: 1.75rem;
    padding: 2rem 0 1.75rem;
  }
  .footer-brand {
    grid-column: auto;
  }
  .footer-nav {
    gap: 1.5rem;
  }
  .footer-bottom {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.375rem;
    padding: 1rem 0 1.25rem;
  }
}

/* ── Form fields ── */
.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-label {
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.form-input {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  color: var(--text);
  font-size: 14px;
  padding: 0.625rem 0.875rem;
  outline: none;
  transition: border-color 0.15s;
  width: 100%;
  box-sizing: border-box;
  font-family: inherit;
}

.form-input::placeholder {
  color: var(--muted);
  opacity: 0.7;
}

.form-input:focus {
  border-color: var(--primary);
}

.form-textarea {
  resize: vertical;
  min-height: 96px;
  line-height: 1.5;
}
