/* rootfor.me - The Midnight Call */
/* Late-night radio meets analog warmth */

/* ===== CSS VARIABLES ===== */
:root {
  /* Backgrounds */
  --bg-void: #0a0908;
  --bg-surface: #141210;
  --bg-elevated: #1c1a17;
  --bg-hover: #252320;

  /* Amber Glow Spectrum */
  --amber-dim: #92400e;
  --amber-core: #f59e0b;
  --amber-bright: #fbbf24;
  --amber-flare: #fcd34d;

  /* Text */
  --text-primary: #faf7f2;
  --text-muted: #a8a29e;
  --text-dim: #57534e;

  /* Functional */
  --border: rgba(250, 247, 242, 0.08);
  --border-focus: rgba(245, 158, 11, 0.4);

  /* Typography */
  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'DM Sans', -apple-system, sans-serif;
  --font-mono: 'JetBrains Mono', 'SF Mono', monospace;

  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2.5rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
}

/* ===== RESET & BASE ===== */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-primary);
  background-color: var(--bg-void);
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== GRAIN OVERLAY ===== */
.grain {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 9999;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
}

.grain::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 0%, var(--bg-void) 70%);
}

/* ===== AMBIENT BACKGROUND ===== */
.ambient {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  overflow: hidden;
}

.ambient::before {
  content: '';
  position: absolute;
  top: -20%;
  left: 50%;
  transform: translateX(-50%);
  width: 140%;
  height: 80%;
  background: radial-gradient(ellipse at center, rgba(245, 158, 11, 0.06) 0%, transparent 60%);
  animation: ambient-pulse 8s ease-in-out infinite;
}

@keyframes ambient-pulse {
  0%, 100% { opacity: 0.6; transform: translateX(-50%) scale(1); }
  50% { opacity: 1; transform: translateX(-50%) scale(1.05); }
}

/* ===== THE ORB - Hero Element ===== */
.orb-container {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 200px;
  height: 200px;
}

.orb {
  position: relative;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  background: radial-gradient(circle at 30% 30%, var(--amber-flare), var(--amber-core) 50%, var(--amber-dim) 100%);
  box-shadow:
    0 0 20px rgba(245, 158, 11, 0.4),
    0 0 40px rgba(245, 158, 11, 0.3),
    0 0 60px rgba(245, 158, 11, 0.2),
    0 0 100px rgba(245, 158, 11, 0.15),
    inset 0 -10px 20px rgba(146, 64, 14, 0.4),
    inset 0 10px 20px rgba(253, 211, 77, 0.3);
  animation: orb-glow 3s ease-in-out infinite;
}

.orb::before {
  content: '';
  position: absolute;
  top: 15%;
  left: 20%;
  width: 25%;
  height: 25%;
  background: radial-gradient(circle, rgba(255, 255, 255, 0.8), transparent 70%);
  border-radius: 50%;
  filter: blur(2px);
}

.orb::after {
  content: '';
  position: absolute;
  inset: -20px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(245, 158, 11, 0.15), transparent 70%);
  animation: orb-ring 3s ease-in-out infinite;
}

/* Outer rings */
.orb-ring {
  position: absolute;
  border-radius: 50%;
  border: 1px solid rgba(245, 158, 11, 0.25);
  animation: ring-expand 4s ease-out infinite;
}

.orb-ring:nth-child(1) { width: 120px; height: 120px; animation-delay: 0s; }
.orb-ring:nth-child(2) { width: 160px; height: 160px; animation-delay: 1s; }
.orb-ring:nth-child(3) { width: 200px; height: 200px; animation-delay: 2s; }

@keyframes orb-glow {
  0%, 100% {
    transform: scale(1);
    box-shadow:
      0 0 20px rgba(245, 158, 11, 0.4),
      0 0 40px rgba(245, 158, 11, 0.3),
      0 0 60px rgba(245, 158, 11, 0.2),
      0 0 100px rgba(245, 158, 11, 0.15),
      inset 0 -10px 20px rgba(146, 64, 14, 0.4),
      inset 0 10px 20px rgba(253, 211, 77, 0.3);
  }
  50% {
    transform: scale(1.05);
    box-shadow:
      0 0 30px rgba(245, 158, 11, 0.5),
      0 0 60px rgba(245, 158, 11, 0.4),
      0 0 90px rgba(245, 158, 11, 0.3),
      0 0 140px rgba(245, 158, 11, 0.2),
      inset 0 -10px 20px rgba(146, 64, 14, 0.4),
      inset 0 10px 20px rgba(253, 211, 77, 0.4);
  }
}

@keyframes orb-ring {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.1); opacity: 0.6; }
}

@keyframes ring-expand {
  0% { transform: scale(0.8); opacity: 0.8; }
  100% { transform: scale(1.3); opacity: 0; }
}

/* Large orb variant for calling page */
.orb-container.orb-lg {
  width: 300px;
  height: 300px;
}

.orb-lg .orb {
  width: 120px;
  height: 120px;
}

.orb-lg .orb-ring:nth-child(1) { width: 180px; height: 180px; }
.orb-lg .orb-ring:nth-child(2) { width: 240px; height: 240px; }
.orb-lg .orb-ring:nth-child(3) { width: 300px; height: 300px; }

/* ===== TYPOGRAPHY ===== */
h1, h2, h3, .headline {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h1, .headline-xl {
  font-size: clamp(2.5rem, 8vw, 4.5rem);
  color: var(--text-primary);
}

h2, .headline-lg {
  font-size: clamp(1.75rem, 5vw, 2.5rem);
}

.subhead {
  font-family: var(--font-body);
  font-size: clamp(1.125rem, 2.5vw, 1.375rem);
  color: var(--text-muted);
  font-weight: 400;
  line-height: 1.5;
}

.mono {
  font-family: var(--font-mono);
  font-size: 0.875rem;
  letter-spacing: 0.02em;
}

.label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-dim);
}

/* ===== LAYOUT ===== */
.container {
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--space-lg);
}

.container-sm {
  max-width: 480px;
}

.page {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: var(--space-2xl) var(--space-lg);
  text-align: center;
}

/* ===== HEADER ===== */
.header {
  padding: var(--space-lg);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo {
  font-family: var(--font-display);
  font-size: 1.25rem;
  color: var(--text-primary);
  text-decoration: none;
  display: flex;
  align-items: center;
  gap: var(--space-sm);
}

.logo-dot {
  width: 8px;
  height: 8px;
  background: var(--amber-core);
  border-radius: 50%;
  box-shadow: 0 0 10px rgba(245, 158, 11, 0.5);
  animation: logo-pulse 2s ease-in-out infinite;
}

@keyframes logo-pulse {
  0%, 100% { opacity: 0.7; }
  50% { opacity: 1; }
}

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-sm);
  padding: var(--space-md) var(--space-xl);
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  text-decoration: none;
  border: none;
  border-radius: 100px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.btn-primary {
  background: var(--amber-core);
  color: var(--bg-void);
  box-shadow:
    0 4px 20px rgba(245, 158, 11, 0.3),
    inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.btn-primary:hover {
  background: var(--amber-bright);
  transform: translateY(-2px);
  box-shadow:
    0 8px 30px rgba(245, 158, 11, 0.4),
    inset 0 1px 0 rgba(255, 255, 255, 0.3);
}

.btn-primary:active {
  transform: translateY(0);
}

.btn-secondary {
  background: var(--bg-elevated);
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn-secondary:hover {
  background: var(--bg-hover);
  border-color: var(--border-focus);
}

.btn-google {
  background: var(--bg-surface);
  color: var(--text-primary);
  border: 1px solid var(--border);
  padding: var(--space-md) var(--space-lg);
}

.btn-google:hover {
  background: var(--bg-elevated);
  border-color: rgba(250, 247, 242, 0.15);
}

.btn-google svg {
  width: 20px;
  height: 20px;
}

/* ===== FORMS ===== */
.form {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
  text-align: left;
}

.form-label {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-muted);
}

.form-input {
  width: 100%;
  padding: var(--space-md) var(--space-lg);
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--text-primary);
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  outline: none;
  transition: all 0.2s ease;
}

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

.form-input:focus {
  border-color: var(--amber-core);
  box-shadow: 0 0 0 3px rgba(245, 158, 11, 0.15);
}

.form-input:hover:not(:focus) {
  border-color: rgba(250, 247, 242, 0.15);
}

/* Phone input with country code feel */
.form-input-phone {
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
}

/* ===== HERO SECTION ===== */
.hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
  max-width: 600px;
}

.hero-content {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.hero-actions {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

/* ===== CALLING PAGE ===== */
.calling-status {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xl);
}

.status-text {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 4vw, 2rem);
  color: var(--text-primary);
}

.status-subtext {
  color: var(--text-muted);
  font-size: 1rem;
}

/* Waveform visualization */
.waveform {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 40px;
  margin-top: var(--space-lg);
}

.waveform-bar {
  width: 3px;
  background: var(--amber-core);
  border-radius: 2px;
  animation: wave 1s ease-in-out infinite;
}

.waveform-bar:nth-child(1) { height: 20%; animation-delay: 0s; }
.waveform-bar:nth-child(2) { height: 40%; animation-delay: 0.1s; }
.waveform-bar:nth-child(3) { height: 70%; animation-delay: 0.2s; }
.waveform-bar:nth-child(4) { height: 100%; animation-delay: 0.3s; }
.waveform-bar:nth-child(5) { height: 70%; animation-delay: 0.4s; }
.waveform-bar:nth-child(6) { height: 40%; animation-delay: 0.5s; }
.waveform-bar:nth-child(7) { height: 20%; animation-delay: 0.6s; }

@keyframes wave {
  0%, 100% { transform: scaleY(1); opacity: 0.5; }
  50% { transform: scaleY(1.5); opacity: 1; }
}

/* Active call state */
.calling-status.connected .waveform-bar {
  animation-duration: 0.5s;
}

.calling-status.connected .orb {
  animation-duration: 1.5s;
}

/* ===== CARDS ===== */
.card {
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: var(--space-xl);
}

/* ===== FOOTER ===== */
.footer {
  padding: var(--space-lg);
  text-align: center;
}

.footer-text {
  font-size: 0.875rem;
  color: var(--text-dim);
}

/* ===== UTILITIES ===== */
.text-amber {
  color: var(--amber-core);
}

.text-muted {
  color: var(--text-muted);
}

.mt-sm { margin-top: var(--space-sm); }
.mt-md { margin-top: var(--space-md); }
.mt-lg { margin-top: var(--space-lg); }
.mt-xl { margin-top: var(--space-xl); }

.mb-sm { margin-bottom: var(--space-sm); }
.mb-md { margin-bottom: var(--space-md); }
.mb-lg { margin-bottom: var(--space-lg); }
.mb-xl { margin-bottom: var(--space-xl); }

/* ===== ANIMATIONS ===== */
.fade-in {
  animation: fadeIn 0.6s ease-out forwards;
}

.fade-in-up {
  animation: fadeInUp 0.6s ease-out forwards;
}

.fade-in-delay-1 { animation-delay: 0.1s; opacity: 0; }
.fade-in-delay-2 { animation-delay: 0.2s; opacity: 0; }
.fade-in-delay-3 { animation-delay: 0.3s; opacity: 0; }
.fade-in-delay-4 { animation-delay: 0.4s; opacity: 0; }

@keyframes fadeIn {
  from { opacity: 0; }
  to { opacity: 1; }
}

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

/* ===== RESPONSIVE ===== */
@media (max-width: 640px) {
  .header {
    padding: var(--space-md);
  }

  .main {
    padding: var(--space-xl) var(--space-md);
  }

  .orb-container {
    width: 160px;
    height: 160px;
  }

  .orb {
    width: 60px;
    height: 60px;
  }

  .orb-ring:nth-child(1) { width: 100px; height: 100px; }
  .orb-ring:nth-child(2) { width: 130px; height: 130px; }
  .orb-ring:nth-child(3) { width: 160px; height: 160px; }

  .orb-container.orb-lg {
    width: 240px;
    height: 240px;
  }

  .orb-lg .orb {
    width: 100px;
    height: 100px;
  }

  .orb-lg .orb-ring:nth-child(1) { width: 150px; height: 150px; }
  .orb-lg .orb-ring:nth-child(2) { width: 195px; height: 195px; }
  .orb-lg .orb-ring:nth-child(3) { width: 240px; height: 240px; }
}
