:root {
  --bg-void: #0B0812;
  --bg-surface: #130F1E;
  --bg-input: #0D0A16;
  --ink-primary: #F7F4FA;
  --ink-secondary: #C5BBD2;
  --ink-muted: #9387A4;
  --accent-coral: #DF215E;
  --accent-coral-hover: #F12D6B;
  --accent-amber: #FFB13B;
  --accent-success: #3DD68C;
  --accent-danger: #FF6B7F;
  --border-subtle: rgba(255, 255, 255, 0.11);
  --border-strong: rgba(255, 255, 255, 0.22);
  --font-display: 'Barlow Condensed', 'Impact', 'Arial Narrow', sans-serif;
  --font-ui: 'Plus Jakarta Sans', system-ui, -apple-system, 'Segoe UI', sans-serif;
}

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

[hidden] {
  display: none !important;
}

html,
body {
  margin: 0;
  padding: 0;
  min-height: 100%;
  background-color: var(--bg-void);
  color: var(--ink-primary);
  font-family: var(--font-ui);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body.modal-open {
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Full-Viewport Leonida / Vice City Coastal Twilight Backdrop
   -------------------------------------------------------------------------- */
.scene {
  position: fixed;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
  background-color: var(--bg-void);
}

.scene-sky {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    #090611 0%,
    #140C24 28%,
    #2E143F 50%,
    #722052 63%,
    #C4425F 71%,
    #180C24 73%,
    #0B0812 100%
  );
}

.scene-horizon-glow {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      52% 42% at 74% 66%,
      rgba(255, 166, 84, 0.42) 0%,
      rgba(241, 66, 114, 0.24) 44%,
      rgba(90, 24, 94, 0.08) 72%,
      transparent 100%
    ),
    radial-gradient(
      40% 34% at 18% 82%,
      rgba(121, 40, 202, 0.16) 0%,
      transparent 70%
    );
}

.scene-haze {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(9, 6, 17, 0.45) 0%,
    transparent 35%,
    transparent 65%,
    rgba(11, 8, 18, 0.65) 100%
  );
}

.scene-art {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.scene-scrim {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    90deg,
    rgba(11, 8, 18, 0.84) 0%,
    rgba(11, 8, 18, 0.64) 38%,
    rgba(11, 8, 18, 0.18) 68%,
    rgba(11, 8, 18, 0.06) 100%
  );
}

.scene-grain {
  position: absolute;
  inset: 0;
  opacity: 0.04;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='1'/%3E%3C/svg%3E");
}

.palm-cluster {
  transform-origin: 1460px 900px;
  animation: palm-breeze 12s ease-in-out infinite;
}

.beacon {
  animation: beacon-pulse 3.2s ease-in-out infinite;
}

.beacon-delay {
  animation-delay: 1.4s;
}

@keyframes palm-breeze {
  0%, 100% { transform: rotate(0deg); }
  50% { transform: rotate(-0.65deg); }
}

@keyframes beacon-pulse {
  0%, 70%, 100% { opacity: 0.95; }
  85% { opacity: 0.18; }
}

/* --------------------------------------------------------------------------
   Single-Viewport Shell Layout
   -------------------------------------------------------------------------- */
.shell {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100dvh;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 clamp(20px, 5vw, 64px);
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow-x: clip;
}

/* Header */
.topbar {
  height: 84px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--ink-primary);
  text-decoration: none;
}

.brand-mark {
  display: block;
  width: 38px;
  height: 38px;
  border-radius: 9px;
}

.brand-name {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  color: var(--ink-primary);
}

.topnav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link,
.nav-action {
  appearance: none;
  border: none;
  background: transparent;
  color: var(--ink-secondary);
  font-family: var(--font-ui);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 9px 14px;
  border-radius: 7px;
  text-decoration: none;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}

.nav-link:hover,
.nav-action:hover {
  color: var(--ink-primary);
  background-color: rgba(255, 255, 255, 0.06);
}

.nav-action {
  color: var(--ink-primary);
  border: 1px solid var(--border-subtle);
  background-color: rgba(19, 15, 30, 0.65);
}

.nav-action:hover {
  border-color: var(--border-strong);
  background-color: rgba(31, 24, 48, 0.85);
}

/* Hero Editorial Lockup */
.hero {
  flex: 1;
  display: flex;
  align-items: center;
  padding: clamp(32px, 6vh, 72px) 0;
}

.hero-content {
  width: 100%;
  max-width: 740px;
  animation: hero-enter 560ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes hero-enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.hero-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3.9rem, 8.6vw, 6.9rem);
  font-weight: 800;
  line-height: 0.88;
  letter-spacing: -0.012em;
  text-transform: uppercase;
  color: var(--ink-primary);
  text-shadow: 0 12px 36px rgba(8, 4, 15, 0.55);
}

.hero-lead {
  margin: 22px 0 0;
  max-width: 48ch;
  font-size: clamp(1rem, 1.3vw, 1.12rem);
  line-height: 1.6;
  color: var(--ink-secondary);
}

/* Action Controls */
.cta-row {
  margin-top: 34px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.btn {
  appearance: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 8px;
  border: 1px solid transparent;
  font-family: var(--font-ui);
  font-size: 0.94rem;
  font-weight: 600;
  line-height: 1;
  text-decoration: none;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 150ms ease, border-color 150ms ease, color 150ms ease, transform 120ms ease;
}

.btn:active {
  transform: translateY(1px);
}

.btn:disabled {
  opacity: 0.6;
  cursor: not-allowed;
  transform: none;
}

.btn-icon {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
}

.btn-icon-fill {
  fill: currentColor;
  stroke: none;
}

.btn-primary {
  background-color: var(--accent-coral);
  color: #FFFFFF;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  background-color: var(--accent-coral-hover);
}

.btn-download {
  background-color: rgba(18, 14, 29, 0.82);
  border-color: var(--border-subtle);
  color: var(--ink-secondary);
  padding-right: 14px;
}

.btn-download:hover {
  background-color: rgba(27, 21, 42, 0.9);
  border-color: var(--border-strong);
  color: var(--ink-primary);
}

.soon-tag {
  display: inline-flex;
  align-items: center;
  padding: 4px 8px;
  border-radius: 5px;
  background-color: rgba(255, 177, 59, 0.14);
  border: 1px solid rgba(255, 177, 59, 0.28);
  color: #FFD085;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.btn-discord {
  background-color: rgba(18, 14, 29, 0.72);
  border-color: var(--border-subtle);
  color: var(--ink-primary);
}

.btn-discord:hover {
  background-color: rgba(88, 101, 242, 0.22);
  border-color: rgba(126, 137, 255, 0.55);
}

.btn-ghost {
  background-color: transparent;
  border-color: var(--border-subtle);
  color: var(--ink-secondary);
}

.btn-ghost:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--border-strong);
  color: var(--ink-primary);
}

.btn-full {
  width: 100%;
}

/* Inline feedback when clicking Coming Soon Download */
.download-note {
  margin: 16px 0 0;
  max-width: 56ch;
  padding: 12px 15px;
  border-radius: 8px;
  background-color: rgba(19, 15, 30, 0.88);
  border: 1px solid rgba(255, 177, 59, 0.26);
  font-size: 0.88rem;
  line-height: 1.5;
  color: var(--ink-secondary);
}

.inline-link {
  appearance: none;
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  font-weight: 600;
  color: #FFD085;
  text-decoration: underline;
  text-underline-offset: 3px;
  cursor: pointer;
}

.inline-link:hover {
  color: #FFFFFF;
}

/* Footer */
.bottombar {
  padding: 20px 0 26px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
  font-size: 0.82rem;
  color: var(--ink-muted);
}

.legal {
  margin: 0;
  max-width: 68ch;
  line-height: 1.45;
}

.bottom-links {
  display: flex;
  align-items: center;
  gap: 18px;
}

.bottom-links a {
  color: var(--ink-secondary);
  text-decoration: none;
  transition: color 150ms ease;
}

.bottom-links a:hover {
  color: var(--ink-primary);
}

.platform-note {
  color: var(--ink-muted);
}

/* --------------------------------------------------------------------------
   Early Registration Modal
   -------------------------------------------------------------------------- */
.modal-backdrop[hidden] {
  display: none;
}

.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 40;
  background-color: rgba(7, 5, 13, 0.82);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  animation: backdrop-fade 160ms ease both;
}

@keyframes backdrop-fade {
  from { opacity: 0; }
  to { opacity: 1; }
}

.modal-dialog {
  position: relative;
  width: 100%;
  max-width: 448px;
  background-color: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 12px;
  overflow: hidden;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.65);
  animation: dialog-rise 180ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes dialog-rise {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.modal-accent-bar {
  height: 3px;
  width: 100%;
  background: linear-gradient(90deg, #FFB13B 0%, #FF3872 52%, #7928CA 100%);
}

.modal-head {
  padding: 22px 24px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.modal-title-group {
  display: flex;
  align-items: center;
  gap: 11px;
}

.modal-mark {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 6px;
}

.modal-head h2 {
  margin: 0;
  font-size: 1.2rem;
  font-weight: 700;
  letter-spacing: -0.015em;
  color: var(--ink-primary);
}

.modal-close {
  appearance: none;
  width: 34px;
  height: 34px;
  border-radius: 7px;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: color 150ms ease, background-color 150ms ease;
}

.modal-close:hover {
  color: var(--ink-primary);
  background-color: rgba(255, 255, 255, 0.06);
}

.modal-close svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  fill: none;
}

.modal-body {
  padding: 14px 24px 26px;
}

.modal-copy {
  margin: 0 0 22px;
  font-size: 0.9rem;
  line-height: 1.55;
  color: var(--ink-muted);
}

/* Form Fields */
.field {
  margin-bottom: 18px;
}

.field-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 7px;
}

.field label {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--ink-secondary);
}

.field-status {
  font-size: 0.78rem;
  font-weight: 600;
}

.field-status.is-ok {
  color: var(--accent-success);
}

.field-status.is-taken,
.field-status.is-error {
  color: var(--accent-danger);
}

.field-status.is-checking {
  color: var(--ink-muted);
}

.input-wrap {
  position: relative;
  display: flex;
  align-items: center;
}

.input-prefix {
  position: absolute;
  left: 14px;
  font-size: 0.94rem;
  font-weight: 600;
  color: var(--ink-muted);
  pointer-events: none;
}

.input {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border-radius: 8px;
  border: 1px solid var(--border-subtle);
  background-color: var(--bg-input);
  color: var(--ink-primary);
  font-family: var(--font-ui);
  font-size: 0.94rem;
  transition: border-color 150ms ease, box-shadow 150ms ease;
}

.input::placeholder {
  color: #5D536D;
}

.input:hover {
  border-color: var(--border-strong);
}

.input:focus {
  outline: none;
  border-color: var(--accent-coral);
  box-shadow: 0 0 0 3px rgba(223, 33, 94, 0.22);
}

.input.is-invalid {
  border-color: var(--accent-danger);
}

.input.is-valid {
  border-color: rgba(61, 214, 140, 0.55);
}

.input-with-prefix {
  padding-left: 32px;
}

.input-with-suffix {
  padding-right: 44px;
}

.input-toggle {
  position: absolute;
  right: 6px;
  width: 34px;
  height: 34px;
  border-radius: 6px;
  border: none;
  background: transparent;
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
}

.input-toggle:hover {
  color: var(--ink-primary);
}

.input-toggle svg {
  width: 18px;
  height: 18px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.9;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.field-hint,
.field-error {
  margin: 6px 0 0;
  font-size: 0.79rem;
  line-height: 1.4;
}

.field-hint {
  color: var(--ink-muted);
}

.field-hint.is-error,
.field-error {
  color: var(--accent-danger);
}

.field-error:empty {
  display: none;
}

/* Password Strength Track */
.strength-track {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 5px;
  margin-top: 8px;
  opacity: 0;
  transition: opacity 150ms ease;
}

.strength-track.is-visible {
  opacity: 1;
}

.strength-seg {
  height: 3px;
  border-radius: 99px;
  background-color: rgba(255, 255, 255, 0.1);
  transition: background-color 180ms ease;
}

.strength-track[data-score="1"] .strength-seg:nth-child(1) {
  background-color: var(--accent-danger);
}

.strength-track[data-score="2"] .strength-seg:nth-child(-n+2) {
  background-color: var(--accent-amber);
}

.strength-track[data-score="3"] .strength-seg:nth-child(-n+3) {
  background-color: #9EE37D;
}

.strength-track[data-score="4"] .strength-seg {
  background-color: var(--accent-success);
}

.form-banner-error {
  margin: 0 0 16px;
  padding: 10px 13px;
  border-radius: 8px;
  background-color: rgba(255, 107, 127, 0.12);
  border: 1px solid rgba(255, 107, 127, 0.34);
  color: #FFB4BF;
  font-size: 0.85rem;
  line-height: 1.45;
}

/* Confirmation Receipt View */
.success-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  padding: 6px 11px;
  border-radius: 6px;
  background-color: rgba(61, 214, 140, 0.12);
  border: 1px solid rgba(61, 214, 140, 0.32);
  color: var(--accent-success);
  font-size: 0.84rem;
  font-weight: 600;
}

.success-badge svg {
  width: 15px;
  height: 15px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2.4;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.receipt {
  margin: 0 0 22px;
  padding: 4px 16px;
  border-radius: 9px;
  background-color: var(--bg-input);
  border: 1px solid var(--border-subtle);
}

.receipt-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  font-size: 0.88rem;
}

.receipt-row:last-child {
  border-bottom: none;
}

.receipt dt {
  color: var(--ink-muted);
}

.receipt dd {
  margin: 0;
  color: var(--ink-primary);
  font-weight: 600;
  text-align: right;
  word-break: break-word;
}

.receipt-handle {
  color: #FFD085;
}

.receipt-status {
  color: var(--accent-success);
}

.success-actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* Accessible Keyboard Focus */
:focus-visible {
  outline: 2px solid var(--accent-amber);
  outline-offset: 2px;
}

.input:focus-visible {
  outline: none;
}

/* --------------------------------------------------------------------------
   Responsive Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 780px) {
  .topbar {
    height: 70px;
    gap: 12px;
  }

  .brand {
    gap: 10px;
    min-width: 0;
  }

  .brand-mark {
    width: 34px;
    height: 34px;
    flex-shrink: 0;
  }

  .brand-name {
    font-size: 0.86rem;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .nav-link {
    display: none;
  }

  .nav-action {
    font-size: 0.82rem;
    padding: 8px 11px;
    white-space: nowrap;
    flex-shrink: 0;
  }

  .scene-scrim {
    background: linear-gradient(
      180deg,
      rgba(11, 8, 18, 0.72) 0%,
      rgba(11, 8, 18, 0.52) 55%,
      rgba(11, 8, 18, 0.88) 100%
    );
  }

  .hero {
    align-items: flex-end;
    padding-bottom: 32px;
  }

  .cta-row {
    flex-direction: column;
    align-items: stretch;
  }

  .btn {
    width: 100%;
  }

  .bottombar {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .palm-cluster,
  .beacon,
  .hero-content,
  .modal-backdrop,
  .modal-dialog {
    animation: none;
  }
}
