/* ==========================================================================
   THE BEACON FORGE — MOBILE-PERFECT SINGLE SCREEN COMING SOON
   Aesthetic: Modern & Classic Editorial Atelier (Anti-AI Bento Grid)
   ========================================================================== */

:root {
  /* Atelier Color Palette */
  --bg-primary: #0A0B0E;
  --bg-secondary: #121318;
  --bg-card: rgba(18, 19, 25, 0.8);

  /* Ink & Typography */
  --text-primary: #F8F6F0;
  --text-secondary: #D4D0C5;
  --text-muted: #8E8A80;
  --text-dim: #5E5B55;

  /* Metallurgy */
  --gold-primary: #D4AF37;
  --gold-light: #F4D69B;
  --gold-bright: #FFE8B8;
  --gold-dark: #9A7B2C;
  --bronze: #C89666;
  --border-gold: rgba(212, 175, 55, 0.28);
  --border-gold-strong: rgba(212, 175, 55, 0.6);
  --border-subtle: rgba(248, 246, 240, 0.08);

  /* Fonts */
  --font-serif: 'Cormorant Garamond', Georgia, serif;
  --font-sans: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
  --font-mono: 'Space Mono', Menlo, Monaco, Consolas, monospace;
}

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

html {
  font-size: 16px;
  background-color: var(--bg-primary);
  color: var(--text-primary);
  -webkit-text-size-adjust: 100%;
}

body {
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  position: relative;
  overflow-x: hidden;
  font-family: var(--font-sans);
  background: radial-gradient(circle at 50% 15%, #181922 0%, var(--bg-primary) 70%);
  display: flex;
  flex-direction: column;
  -webkit-font-smoothing: antialiased;
}

/* Analog Grain Overlay */
.grain-overlay {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 99;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noiseFilter'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.8' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noiseFilter)'/%3E%3C/svg%3E");
}

/* Embers Canvas */
#ambient-canvas {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.65;
}

/* Beacon Spotlight Cursor */
.beacon-torch {
  position: fixed;
  top: 0;
  left: 0;
  width: 500px;
  height: 500px;
  border-radius: 50%;
  pointer-events: none;
  z-index: 1;
  transform: translate(-50%, -50%);
  background: radial-gradient(circle, rgba(212, 175, 55, 0.07) 0%, rgba(200, 150, 102, 0.02) 40%, transparent 70%);
  will-change: left, top;
}

/* Viewport Frame */
.viewport-frame {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100vh;
  min-height: 100dvh;
  padding: 2rem 2.5rem 1.5rem;
  max-width: 1100px;
  margin: 0 auto;
  width: 100%;
}

/* Typography Accents */
.serif-italic {
  font-family: var(--font-serif);
  font-style: italic;
  font-weight: 400;
}

.gold-gradient {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-primary) 50%, var(--bronze) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* Masthead */
.masthead {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  width: 100%;
}

.brand-crest {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.crest-symbol {
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #1C1E26, #101116);
  border: 1px solid var(--border-gold);
  border-radius: 6px;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.5);
}

.crest-symbol svg {
  width: 24px;
  height: 24px;
}

.brand-typography {
  display: flex;
  flex-direction: column;
}

.brand-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  color: var(--text-primary);
  line-height: 1.1;
}

.brand-subtitle {
  font-family: var(--font-mono);
  font-size: 0.6rem;
  letter-spacing: 0.2em;
  color: var(--text-muted);
}

.masthead-meta {
  display: flex;
  align-items: center;
  gap: 1rem;
}

.status-indicator {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.75rem;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 100px;
  font-family: var(--font-mono);
  font-size: 0.65rem;
  color: var(--text-secondary);
}

.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background-color: var(--gold-light);
  box-shadow: 0 0 8px var(--gold-primary);
  animation: pulse-glow 2.5s infinite ease-in-out;
}

.clock-display {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
}

/* Center Hero */
.hero-stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  margin: auto 0;
  padding: 2.5rem 0;
  max-width: 780px;
  width: 100%;
  align-self: center;
}

.editorial-badge {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.35rem 0.9rem;
  background: rgba(212, 175, 55, 0.06);
  border: 1px solid var(--border-gold);
  border-radius: 100px;
  margin-bottom: 1.5rem;
  color: var(--gold-light);
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.14em;
  max-width: 100%;
}

.badge-dot {
  color: var(--gold-dark);
  font-size: 0.55rem;
}

.hero-headline {
  font-family: var(--font-serif);
  font-size: clamp(2.2rem, 5vw, 3.8rem);
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.015em;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  word-break: break-word;
}

.hero-subtext {
  font-size: clamp(0.95rem, 1.6vw, 1.12rem);
  font-weight: 300;
  line-height: 1.65;
  color: var(--text-secondary);
  max-width: 620px;
  margin-bottom: 2.25rem;
}

/* Early Access Reservation Box */
.reservation-box {
  width: 100%;
  max-width: 520px;
}

.dispatch-form {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
  width: 100%;
}

.form-input-group {
  display: flex;
  gap: 0.4rem;
  background: rgba(14, 15, 20, 0.85);
  border: 1px solid var(--border-gold);
  border-radius: 6px;
  padding: 0.35rem;
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.5);
  width: 100%;
}

.form-input-group input {
  flex: 1;
  padding: 0.75rem 1rem;
  background: transparent;
  border: none;
  font-family: var(--font-sans);
  font-size: 16px; /* Prevents auto-zoom on mobile Safari / Firefox */
  color: var(--text-primary);
  outline: none;
  min-width: 0;
}

.form-input-group input::placeholder {
  color: var(--text-dim);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.75rem 1.25rem;
  font-family: var(--font-sans);
  font-size: 0.84rem;
  font-weight: 600;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  border: none;
}

.btn svg {
  width: 13px;
  height: 13px;
}

.btn-gold {
  background: linear-gradient(135deg, var(--gold-primary) 0%, var(--gold-dark) 100%);
  color: #0B0C0E;
  border: 1px solid var(--gold-light);
}

.btn-gold:hover {
  background: linear-gradient(135deg, var(--gold-light) 0%, var(--gold-primary) 100%);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(212, 175, 55, 0.35);
}

.form-micro-note {
  font-size: 0.72rem;
  color: var(--text-dim);
  line-height: 1.4;
}

/* Success Slate */
.success-slate {
  display: none;
  background: rgba(18, 19, 25, 0.9);
  border: 1px solid var(--border-gold);
  border-radius: 6px;
  padding: 1.5rem;
  text-align: center;
  animation: fadeIn 0.3s ease-out forwards;
}

.success-slate.active {
  display: block;
}

.success-badge {
  width: 36px;
  height: 36px;
  margin: 0 auto 0.75rem;
  border-radius: 50%;
  background: rgba(212, 175, 55, 0.12);
  border: 1px solid var(--gold-primary);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--gold-light);
  font-size: 1.1rem;
}

.success-slate h3 {
  font-family: var(--font-serif);
  font-size: 1.3rem;
  color: var(--gold-bright);
  margin-bottom: 0.35rem;
}

.token-code {
  font-family: var(--font-mono);
  color: var(--gold-light);
  background: rgba(212, 175, 55, 0.15);
  padding: 0.1rem 0.4rem;
  border-radius: 3px;
}

.success-slate p {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

/* Footer Colophon Bar */
.colophon-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding-top: 1rem;
  border-top: 1px solid var(--border-subtle);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  gap: 0.75rem;
  width: 100%;
}

.colophon-left, .colophon-right {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.divider {
  color: var(--border-subtle);
}

.email-link {
  color: var(--gold-light);
  text-decoration: none;
  cursor: pointer;
  transition: color 0.2s ease;
}

.email-link:hover {
  color: var(--gold-bright);
  text-decoration: underline;
}

.legal-link-btn {
  background: transparent;
  border: none;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  color: var(--text-dim);
  cursor: pointer;
  text-decoration: underline;
  text-underline-offset: 3px;
  transition: color 0.2s ease;
}

.legal-link-btn:hover {
  color: var(--gold-light);
}

.sound-btn {
  background: transparent;
  border: 1px solid var(--border-subtle);
  color: var(--text-dim);
  padding: 0.2rem 0.5rem;
  border-radius: 4px;
  cursor: pointer;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  transition: all 0.2s ease;
}

.sound-btn:hover, .sound-btn.active {
  color: var(--gold-light);
  border-color: var(--border-gold);
}

/* Modal Overlay & Charter */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1.25rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.active {
  opacity: 1;
  pointer-events: auto;
}

.modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(6, 7, 9, 0.85);
  backdrop-filter: blur(8px);
}

.modal-container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 520px;
  background: #13141A;
  border: 1px solid var(--border-gold);
  border-radius: 8px;
  padding: 2rem 1.75rem;
  box-shadow: 0 25px 60px rgba(0, 0, 0, 0.8);
  transform: translateY(15px);
  transition: transform 0.3s ease;
}

.modal-overlay.active .modal-container {
  transform: translateY(0);
}

.modal-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: transparent;
  border: none;
  color: var(--text-muted);
  font-size: 1.6rem;
  cursor: pointer;
  line-height: 1;
  padding: 0.25rem;
}

.modal-close:hover {
  color: var(--text-primary);
}

.modal-header h3 {
  font-family: var(--font-serif);
  font-size: 1.5rem;
  color: var(--gold-bright);
  margin: 0.2rem 0 0.4rem;
}

.modal-header p {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.kicker {
  font-family: var(--font-mono);
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  color: var(--gold-primary);
}

.privacy-body {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  margin: 1.25rem 0;
  max-height: 48vh;
  overflow-y: auto;
  padding-right: 0.5rem;
}

.legal-section h4 {
  font-family: var(--font-serif);
  font-size: 1.02rem;
  color: var(--gold-light);
  margin-bottom: 0.2rem;
}

.legal-section p {
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.5;
}

.btn-block {
  width: 100%;
}

/* Toast */
.toast-container {
  position: fixed;
  bottom: 1.5rem;
  right: 1.5rem;
  z-index: 2000;
  pointer-events: none;
}

.toast {
  background: #191B22;
  border-left: 3px solid var(--gold-primary);
  border: 1px solid var(--border-gold);
  border-radius: 4px;
  padding: 0.75rem 1rem;
  font-size: 0.8rem;
  color: var(--text-primary);
  box-shadow: 0 10px 30px rgba(0,0,0,0.5);
  animation: fadeIn 0.3s ease-out;
}

@keyframes pulse-glow {
  0%, 100% { opacity: 0.8; box-shadow: 0 0 6px var(--gold-primary); }
  50% { opacity: 1; box-shadow: 0 0 12px var(--gold-bright); }
}

@keyframes fadeIn {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ==========================================================================
   FIREFOX & MOBILE SPECIFIC OPTIMIZATIONS
   ========================================================================== */
@media (max-width: 768px) {
  .viewport-frame {
    padding: 1.25rem 1.25rem 1rem;
    min-height: 100vh;
    min-height: 100dvh;
    justify-content: space-between;
  }

  .status-indicator {
    display: none;
  }

  .brand-title {
    font-size: 0.98rem;
    letter-spacing: 0.08em;
  }

  .brand-subtitle {
    font-size: 0.52rem;
    letter-spacing: 0.14em;
  }

  .hero-stage {
    padding: 1.5rem 0;
    margin: auto 0;
  }

  .editorial-badge {
    font-size: 0.58rem;
    letter-spacing: 0.1em;
    padding: 0.3rem 0.7rem;
    margin-bottom: 1.2rem;
    line-height: 1.3;
  }

  .hero-headline {
    font-size: clamp(1.85rem, 7.5vw, 2.6rem);
    line-height: 1.16;
    margin-bottom: 1rem;
  }

  .hero-subtext {
    font-size: 0.9rem;
    line-height: 1.55;
    margin-bottom: 1.75rem;
    padding: 0 0.25rem;
  }

  .form-input-group {
    flex-direction: column;
    padding: 0.45rem;
    gap: 0.5rem;
    background: rgba(14, 15, 20, 0.95);
  }

  .form-input-group input {
    font-size: 16px; /* Prevents auto-zoom on mobile */
    padding: 0.8rem 0.9rem;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .btn {
    width: 100%;
    padding: 0.85rem 1rem;
    font-size: 0.88rem;
  }

  .form-micro-note {
    font-size: 0.68rem;
    text-align: center;
  }

  .colophon-bar {
    flex-direction: column;
    text-align: center;
    gap: 0.5rem;
    padding-top: 0.75rem;
  }

  .colophon-left, .colophon-right {
    justify-content: center;
    font-size: 0.65rem;
  }

  .modal-container {
    padding: 1.5rem 1.25rem;
  }
}

@media (max-height: 650px) and (orientation: landscape) {
  .viewport-frame {
    height: auto;
    min-height: 100vh;
    padding: 1rem;
  }
  .hero-stage {
    padding: 1rem 0;
  }
}
