:root {
  --bg: #070707;
  --panel: #111111;
  --panel-soft: #161616;
  --line: rgba(255, 255, 255, 0.08);
  --line-gold: rgba(212, 175, 55, 0.28);
  --gold: #d4af37;
  --gold-soft: #e7d7a7;
  --text: #f5f1e8;
  --muted: #b8b1a3;
  --success: #8fd9b6;
  --danger: #e58c8c;
  --radius: 22px;
  --logo-header-width: 164px;
  --logo-header-width-mobile: 126px;
  --logo-login-width: 280px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
  --shadow-soft: 0 12px 30px rgba(0, 0, 0, 0.24);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Segoe UI Variable Text", "Aptos", "Trebuchet MS", sans-serif;
  color: var(--text);
  background:
    linear-gradient(180deg, #050505 0%, #090909 46%, #0d0d0d 100%);
}

a { color: var(--text); text-decoration: none; transition: color 160ms ease, border-color 160ms ease, background-color 160ms ease, transform 160ms ease, box-shadow 160ms ease; }

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent 22%),
    radial-gradient(circle at top, rgba(212, 175, 55, 0.08), transparent 24%);
  pointer-events: none;
}

.screen-noise {
  position: fixed;
  inset: 0;
  opacity: 0.035;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.08) 1px, transparent 1px);
  background-size: 4px 4px, 4px 4px;
  mix-blend-mode: soft-light;
  pointer-events: none;
}

.bg-glow {
  position: fixed;
  border-radius: 999px;
  filter: blur(120px);
  opacity: 0.26;
  pointer-events: none;
}

.glow-top { width: 28rem; height: 28rem; top: -10rem; right: -6rem; background: rgba(212, 175, 55, 0.12); }
.glow-bottom { width: 26rem; height: 26rem; bottom: -10rem; left: -6rem; background: rgba(255, 245, 215, 0.06); }

.site-header, .site-footer, .page-shell {
  width: min(1220px, calc(100vw - 32px));
  margin: 0 auto;
}

.site-header, .site-footer {
  gap: 1.25rem;
  padding: 1.25rem 0;
}

.site-header {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  position: sticky;
  top: 0;
  z-index: 10;
  padding-top: 1rem;
  overflow: visible;
}

.site-header::before {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) + 4px);
  background: rgba(10, 10, 10, 0.82);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
  z-index: -1;
}

.header-bar {
  display: contents;
}

.brand-lockup {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 0;
}

.brand-logo {
  display: block;
  width: 100%;
  height: auto;
  object-fit: contain;
}

.brand-logo-header {
  width: clamp(132px, 18vw, var(--logo-header-width));
  max-width: 100%;
}

.brand-logo-login {
  width: clamp(220px, 34vw, var(--logo-login-width));
  max-width: 100%;
}

.brand-fallback {
  display: inline-flex;
  align-items: center;
  min-height: 2.5rem;
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 1.7rem;
  font-weight: 700;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.brand-fallback-login {
  justify-content: center;
  width: min(var(--logo-login-width), 78vw);
  padding: 1rem 1.4rem;
  border: 1px solid var(--line-gold);
  border-radius: 20px;
}

.brand-copy { min-width: 0; }
.brand-kicker, .eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.72rem;
  color: var(--gold-soft);
}

.brand-sub, .site-footer, .panel p, label span, th, td, .info-strip span, .table-intro span, .micro-card span, .shell-grid span, .stat-card em {
  color: var(--muted);
}

.top-nav {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.6rem;
}

.nav-toggle,
.nav-backdrop {
  display: none;
}

.nav-toggle {
  align-items: center;
  justify-content: center;
  min-height: 2.85rem;
  padding: 0.78rem 1rem;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.nav-toggle:hover,
.nav-toggle:focus-visible {
  border-color: var(--line-gold);
  color: var(--gold-soft);
  background: rgba(255, 255, 255, 0.07);
}

.top-nav a {
  padding: 0.82rem 1rem;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.03);
  font-size: 0.96rem;
}

.top-nav a:hover,
.top-nav a:focus-visible {
  border-color: var(--line-gold);
  background: rgba(255, 255, 255, 0.06);
  color: var(--gold-soft);
}

.page-shell { padding: 1.35rem 0 3.5rem; }

.panel, .hero, .watermark-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.02), transparent 22%), var(--panel);
  box-shadow: var(--shadow);
}

.panel::after, .hero::after, .watermark-shell::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  border: 1px solid rgba(255, 255, 255, 0.02);
  pointer-events: none;
}

.hero, .panel { padding: 1.7rem; margin-bottom: 1.15rem; }
.hero { display: grid; grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.9fr); gap: 1.5rem; }
.hero.narrow { max-width: 920px; margin-inline: auto; }
h1, h2 { margin: 0.25rem 0 0.85rem; font-weight: 700; line-height: 1.05; font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif; }
h1 { font-size: clamp(2rem, 4vw, 4rem); }
h2 { font-size: 1.45rem; }
strong { color: var(--text); }

.hero-login {
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  align-items: center;
  padding: clamp(1.5rem, 3vw, 2.4rem);
}

.hero-login-copy {
  display: grid;
  gap: 1rem;
  justify-items: center;
  text-align: center;
}

.hero-logo-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  margin-bottom: 0.25rem;
}

.hero-note-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.9rem;
  width: 100%;
}

.hero-side {
  display: grid;
  gap: 1rem;
  align-content: start;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.98rem 1.2rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 14px;
  background: linear-gradient(180deg, #e2c972 0%, #ba9440 100%);
  color: #0c0b08;
  font-weight: 800;
  letter-spacing: 0.02em;
  cursor: pointer;
  box-shadow: 0 14px 26px rgba(0, 0, 0, 0.26);
}

.button:hover,
.button:focus-visible {
  transform: translateY(-1px);
  box-shadow: 0 18px 32px rgba(0, 0, 0, 0.3);
}

.button.ghost {
  background: rgba(255, 255, 255, 0.04);
  color: var(--text);
  border: 1px solid var(--line);
  box-shadow: none;
}

.button.ghost:hover,
.button.ghost:focus-visible {
  border-color: var(--line-gold);
  color: var(--gold-soft);
  background: rgba(255, 255, 255, 0.06);
}

.hero-actions, .section-head, .actions-panel { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex-wrap: wrap; }
.stats-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 1rem; margin-bottom: 1rem; }
.stat-card strong { display: block; margin-top: 0.4rem; font-size: 2.4rem; }
.stat-card em { display: block; margin-top: 0.35rem; font-style: normal; font-size: 0.92rem; }
.form-grid { display: grid; gap: 1rem; }
.form-grid.two-up { grid-template-columns: repeat(2, minmax(0, 1fr)); }
label { display: grid; gap: 0.45rem; }
input, select, textarea {
  width: 100%;
  padding: 0.95rem 1rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  background: rgba(9, 9, 9, 0.92);
  color: var(--text);
  font: inherit;
  outline: none;
}

input:focus,
select:focus,
textarea:focus {
  border-color: var(--line-gold);
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.08);
}

textarea { resize: vertical; }
.wide { grid-column: 1 / -1; }
.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: calc(var(--radius) - 4px);
  background: rgba(255, 255, 255, 0.02);
}

table { width: 100%; border-collapse: collapse; min-width: 720px; }

thead th {
  font-size: 0.76rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  color: var(--gold-soft);
  background: rgba(255, 255, 255, 0.02);
}

tbody tr:nth-child(even) { background: rgba(255, 255, 255, 0.015); }
tbody tr:hover { background: rgba(212, 175, 55, 0.04); }
th, td { text-align: left; padding: 1rem 0.9rem; border-bottom: 1px solid rgba(255, 255, 255, 0.06); vertical-align: top; }
.inline-form { margin: 0; }

.flash {
  margin-bottom: 1rem;
  padding: 1rem 1.1rem;
  border-radius: 14px;
  background: rgba(143, 217, 182, 0.1);
  border: 1px solid rgba(143, 217, 182, 0.24);
}

.flash.error {
  background: rgba(229, 140, 140, 0.1);
  border-color: rgba(229, 140, 140, 0.24);
}

.compact { align-self: start; }
.check-row { grid-template-columns: auto 1fr; align-items: center; }
.check-row input { width: 1.1rem; height: 1.1rem; }
.watermark-shell {
  padding: clamp(1.2rem, 2vw, 2rem);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent 20%),
    rgba(12, 12, 12, 0.92);
}

.watermark-layer {
  position: absolute;
  inset: -8%;
  display: grid;
  align-content: space-between;
  pointer-events: none;
  z-index: 0;
}

.watermark-track {
  display: flex;
  gap: 2.5rem;
  transform: rotate(-17deg) translateX(-8%);
  transform-origin: center;
  white-space: nowrap;
}

.watermark-track span {
  font-size: clamp(0.8rem, 1.2vw, 1.1rem);
  font-weight: 700;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: rgba(212, 175, 55, 0.13);
}

.watermark-track-alt {
  justify-content: flex-end;
  transform: rotate(-17deg) translateX(6%);
}

.shell-panel { min-height: 62vh; }
.shell-hero {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}

.shell-mark {
  flex: 0 0 auto;
  opacity: 0.72;
}

.shell-panel,
.shell-hero,
.shell-grid {
  position: relative;
  z-index: 1;
}

.brand-mark {
  width: clamp(72px, 9vw, 108px);
  height: auto;
  object-fit: contain;
}

.shell-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 1rem; margin-top: 1rem; }
.shell-grid article,
.micro-card,
.feature-card,
.login-form,
.info-strip,
.table-intro {
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 100%), var(--panel-soft);
  box-shadow: var(--shadow-soft);
}

.copy-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 0.75rem;
  align-items: center;
}

.copy-button {
  min-width: 8rem;
}

.result-panel {
  margin-top: 1rem;
}

.mode-panel {
  margin-top: 1rem;
}

.package-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.package-card {
  padding: 1.1rem;
  border-radius: 18px;
  border: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.025), transparent 100%), var(--panel-soft);
  box-shadow: var(--shadow-soft);
}

.package-card h3 {
  margin-bottom: 0.6rem;
}

.state-pill {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  border: 1px solid var(--line-gold);
  margin-bottom: 0.75rem;
}

.state-pill.success {
  color: var(--success);
  border-color: rgba(143, 217, 182, 0.35);
}

.state-pill.danger {
  color: var(--danger);
  border-color: rgba(229, 140, 140, 0.35);
}

.button.disabled {
  opacity: 0.55;
  pointer-events: none;
}

.shell-grid article { padding: 1rem; border-radius: 18px; }
.shell-grid strong { display: block; margin-top: 0.45rem; }
.micro-card {
  padding: 1rem 1.05rem;
  border-radius: 18px;
}

.micro-card strong,
.hero-summary strong {
  display: block;
  margin-top: 0.35rem;
  font-family: "Palatino Linotype", "Book Antiqua", Georgia, serif;
  font-size: 1.05rem;
}

.login-form {
  padding: 1.2rem;
  border-radius: calc(var(--radius) - 2px);
}

.feature-card { padding: 1.25rem; }

.info-strip,
.table-intro {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  padding: 0.9rem 1rem;
  margin: 0 0 1rem;
  border-radius: 18px;
}

.info-strip span,
.table-intro span {
  display: inline-flex;
  align-items: center;
  padding: 0.35rem 0.7rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}

.site-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-bottom: 2rem;
  font-size: 0.95rem;
}

.legal-body {
  max-height: 28rem;
  overflow: auto;
  padding: 1rem;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.02);
}

.legal-body pre {
  margin: 0;
  white-space: pre-wrap;
  font: inherit;
  line-height: 1.65;
  color: var(--text);
}

.invite-filters {
  grid-template-columns: repeat(5, minmax(0, 1fr));
  align-items: end;
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 1rem;
  margin-bottom: 1rem;
}

@media (max-width: 900px) {
  .hero, .stats-grid, .form-grid.two-up, .shell-grid, .package-grid, .invite-filters, .detail-grid {
    grid-template-columns: 1fr;
  }

  .site-footer, .brand-lockup, .shell-hero {
    flex-direction: column;
    align-items: stretch;
  }

  .page-shell, .site-header, .site-footer { width: min(100vw - 18px, 1220px); }
  .site-header {
    grid-template-columns: 1fr;
    gap: 0;
    padding: 0.85rem 0;
  }
  .header-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 0.9rem;
    min-width: 0;
  }
  .nav-toggle {
    display: inline-flex;
    flex: 0 0 auto;
    position: relative;
    z-index: 31;
  }
  .nav-backdrop {
    display: block;
    position: fixed;
    inset: 0;
    border: 0;
    padding: 0;
    margin: 0;
    background: rgba(4, 4, 4, 0.56);
    backdrop-filter: blur(4px);
    opacity: 0;
    pointer-events: none;
    transition: opacity 160ms ease;
    z-index: 20;
  }
  .top-nav {
    position: fixed;
    top: 0;
    right: 0;
    bottom: 0;
    width: min(22rem, 86vw);
    display: grid;
    grid-auto-rows: min-content;
    align-content: start;
    justify-content: stretch;
    gap: 0.7rem;
    padding: 5.4rem 1rem 1rem;
    border-left: 1px solid var(--line);
    background: rgba(10, 10, 10, 0.96);
    box-shadow: var(--shadow);
    overflow-y: auto;
    overscroll-behavior: contain;
    transform: translateX(108%);
    opacity: 0;
    pointer-events: none;
    transition: transform 180ms ease, opacity 180ms ease;
    z-index: 30;
  }
  .site-header[data-drawer-open="true"] .nav-backdrop {
    opacity: 1;
    pointer-events: auto;
  }
  .site-header[data-drawer-open="true"] .top-nav {
    transform: translateX(0);
    opacity: 1;
    pointer-events: auto;
  }
  .top-nav a, .button { width: 100%; }
  .brand-logo-header {
    width: clamp(138px, 42vw, 172px);
    max-width: min(72vw, var(--logo-header-width-mobile));
  }
  .brand-copy { text-align: center; }
  .site-footer { gap: 0.5rem; }
  .hero-note-row { grid-template-columns: 1fr; }
  .watermark-layer { inset: -4%; }
  .watermark-track { gap: 1.2rem; transform: rotate(-15deg) translateX(-4%); }
  .watermark-track-alt { transform: rotate(-15deg) translateX(4%); }
  .watermark-track span { font-size: clamp(0.72rem, 2.2vw, 0.92rem); letter-spacing: 0.16em; }
}

@media (max-width: 640px) {
  .site-header, .site-footer, .page-shell {
    width: min(100vw - 14px, 1220px);
  }

  .site-header, .site-footer, .hero, .panel, .watermark-shell {
    border-radius: 18px;
  }

  .top-nav { width: min(20rem, 92vw); }

  .copy-row {
    grid-template-columns: 1fr;
  }

  .table-wrap {
    border-radius: 16px;
  }

  table {
    min-width: 600px;
  }

  .watermark-shell {
    padding: 0.95rem;
  }

  .watermark-layer {
    inset: -2%;
  }

  .watermark-track,
  .watermark-track-alt {
    transform: rotate(-13deg);
  }

  .watermark-track span {
    font-size: 0.68rem;
    letter-spacing: 0.12em;
  }
}

body.drawer-open {
  overflow: hidden;
}
