/* ==========================================================================
   DEERA — Modern Minimalist Coming Soon Experience
   Inspired by direction, orientation, and subtle cosmic illumination.
   ========================================================================== */

/* --- Custom Properties & Design Tokens --- */
:root {
  --bg-color: #06050a;
  --bg-surface: rgba(12, 11, 18, 0.7);
  
  --text-primary: #ffffff;
  --text-secondary: #9496a8;
  --text-muted: #5e6175;
  
  --border-subtle: rgba(255, 255, 255, 0.08);
  --border-hover: rgba(255, 255, 255, 0.22);
  --border-focus: rgba(255, 255, 255, 0.4);
  
  --btn-bg: #ffffff;
  --btn-text: #06050a;
  --btn-hover-bg: #f3f4f6;
  
  --glow-primary: rgba(126, 87, 219, 0.15);
  --glow-secondary: rgba(67, 43, 133, 0.1);
  --glow-highlight: rgba(255, 255, 255, 0.05);

  /* Mouse tracking variables updated by script via lerp */
  --mouse-x: 50vw;
  --mouse-y: 50vh;
  --mouse-tilt-x: 0deg;
  --mouse-tilt-y: 0deg;

  --font-main: 'Plus Jakarta Sans', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --font-mono: 'Space Grotesk', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --ease-fluid: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-soft: cubic-bezier(0.4, 0, 0.2, 1);
}

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

html {
  font-size: 16px;
  background-color: var(--bg-color);
  color: var(--text-primary);
  font-family: var(--font-main);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
  height: 100%;
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  width: 100%;
  background-color: var(--bg-color);
  color: var(--text-primary);
  display: flex;
  flex-direction: column;
  position: relative;
  overflow-x: hidden;
}

::selection {
  background: rgba(168, 85, 247, 0.3);
  color: #ffffff;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* ==========================================================================
   Background System: Layered Ambient & Interactive Lighting
   ========================================================================== */
.bg-wrapper {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  background: #050509;
}

.bg-base {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 50%, #0c0a14 0%, #06050a 100%);
}

/* Ambient Floating Glow Orbs (Subtle deep plum & indigo) */
.bg-ambient-orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.6;
  will-change: transform;
}

.orb-primary {
  top: -15%;
  right: -10%;
  width: 75vw;
  height: 75vw;
  max-width: 900px;
  max-height: 900px;
  background: radial-gradient(circle, rgba(93, 38, 117, 0.22) 0%, rgba(42, 19, 68, 0.08) 55%, transparent 80%);
  animation: ambientFloat1 28s ease-in-out infinite alternate;
}

.orb-secondary {
  bottom: -20%;
  left: -15%;
  width: 80vw;
  height: 80vw;
  max-width: 950px;
  max-height: 950px;
  background: radial-gradient(circle, rgba(58, 25, 105, 0.2) 0%, rgba(20, 24, 60, 0.08) 50%, transparent 75%);
  animation: ambientFloat2 32s ease-in-out infinite alternate;
}

.orb-tertiary {
  top: 40%;
  left: 30%;
  width: 50vw;
  height: 50vw;
  max-width: 600px;
  max-height: 600px;
  background: radial-gradient(circle, rgba(120, 60, 160, 0.1) 0%, transparent 65%);
  animation: ambientFloat3 22s ease-in-out infinite alternate;
}

/* Mouse-Driven Interactive Glow Layer (Lerped via JS) */
.bg-interactive-glow {
  position: absolute;
  inset: 0;
  background: 
    radial-gradient(850px circle at var(--mouse-x) var(--mouse-y), rgba(125, 75, 205, 0.14) 0%, rgba(68, 38, 130, 0.06) 40%, transparent 75%),
    radial-gradient(420px circle at var(--mouse-x) var(--mouse-y), rgba(255, 255, 255, 0.045) 0%, rgba(160, 140, 240, 0.03) 45%, transparent 70%);
  will-change: background;
  transition: opacity 1s var(--ease-soft);
}

/* Subtle Tactile Film Grain (Eliminates color banding, feels cinematic) */
.bg-grain {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.028;
  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");
  mix-blend-mode: overlay;
  pointer-events: none;
}

/* ==========================================================================
   Main Layout & Content Composition
   ========================================================================== */
.page-container {
  position: relative;
  z-index: 1;
  width: 100%;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 3rem 1.5rem 2.25rem;
}

.content-wrapper {
  margin: auto 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  max-width: 580px;
  width: 100%;
  transform: perspective(1000px) rotateX(var(--mouse-tilt-x)) rotateY(var(--mouse-tilt-y));
  transition: transform 0.25s cubic-bezier(0.2, 0.8, 0.4, 1);
  will-change: transform;
}

/* --- Compass Emblem --- */
.brand-symbol {
  margin-bottom: 2.25rem;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.compass-svg {
  width: 56px;
  height: 56px;
  filter: drop-shadow(0 0 25px rgba(168, 85, 247, 0.45));
  transition: transform 0.6s var(--ease-fluid), filter 0.6s var(--ease-fluid);
}

.brand-symbol:hover .compass-svg {
  transform: scale(1.08) rotate(45deg);
  filter: drop-shadow(0 0 32px rgba(192, 132, 252, 0.65));
}

.aura-pulse {
  animation: auraPulse 6s ease-in-out infinite alternate;
}

/* --- Brand Typography --- */
.brand-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 2.5rem;
}

.brand-name {
  font-family: var(--font-main);
  font-size: clamp(2.8rem, 6.5vw, 4.8rem);
  font-weight: 700;
  line-height: 1.05;
  letter-spacing: 0.22em;
  margin-right: -0.22em; /* Offsets tracking to achieve exact geometric centering */
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  user-select: none;
  background: linear-gradient(180deg, #ffffff 30%, rgba(255, 255, 255, 0.72) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  text-shadow: 0 4px 30px rgba(0, 0, 0, 0.5);
  transition: letter-spacing 0.5s var(--ease-fluid);
}

.coming-soon-label {
  display: inline-block;
  font-family: var(--font-main);
  font-size: clamp(0.75rem, 1.1vw, 0.9rem);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.3em;
  margin-right: -0.3em; /* Offsets tracking to achieve exact geometric centering */
  color: #e2e8f0;
  margin-bottom: 1.15rem;
  opacity: 0.95;
  user-select: none;
}

.brand-tagline {
  font-family: var(--font-main);
  font-size: clamp(0.95rem, 1.8vw, 1.15rem);
  font-weight: 400;
  line-height: 1.6;
  color: var(--text-secondary);
  max-width: 440px;
  margin: 0 auto;
}

/* ==========================================================================
   Waitlist / Notify Form
   ========================================================================== */
.action-section {
  width: 100%;
  max-width: 480px;
  margin-bottom: 2.5rem;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.notify-form {
  width: 100%;
  display: flex;
  align-items: stretch;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 4px;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  box-shadow: 0 4px 24px -1px rgba(0, 0, 0, 0.35);
  transition: border-color 0.3s var(--ease-soft), box-shadow 0.3s var(--ease-soft), background-color 0.3s var(--ease-soft);
}

.notify-form:focus-within {
  border-color: var(--border-focus);
  background: rgba(255, 255, 255, 0.05);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.2), 0 8px 30px rgba(120, 80, 200, 0.18);
}

.input-wrapper {
  flex: 1;
  display: flex;
  align-items: center;
}

.notify-form input[type="email"] {
  width: 100%;
  background: transparent;
  border: none;
  outline: none;
  padding: 0.85rem 1.25rem;
  font-family: var(--font-main);
  font-size: 0.95rem;
  color: var(--text-primary);
  caret-color: #c084fc;
}

.notify-form input[type="email"]::placeholder {
  color: var(--text-muted);
  font-weight: 400;
  transition: color 0.2s ease;
}

.notify-form input[type="email"]:focus::placeholder {
  color: #7b8098;
}

.notify-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: var(--btn-bg);
  color: var(--btn-text);
  border: none;
  border-radius: 6px;
  padding: 0.85rem 1.6rem;
  font-family: var(--font-main);
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  cursor: pointer;
  white-space: nowrap;
  transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
  user-select: none;
  position: relative;
}

.notify-btn:hover {
  background-color: var(--btn-hover-bg);
  transform: translateY(-1px);
  box-shadow: 0 4px 16px rgba(255, 255, 255, 0.2);
}

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

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

/* Spinner for submit loading state */
.btn-spinner {
  display: none;
  width: 14px;
  height: 14px;
  border: 2px solid rgba(6, 5, 10, 0.3);
  border-radius: 50%;
  border-top-color: #06050a;
  animation: spin 0.8s linear infinite;
  margin-left: 8px;
}

.notify-btn.loading .btn-spinner {
  display: inline-block;
}

/* Feedback messages */
.form-feedback {
  margin-top: 0.85rem;
  font-size: 0.85rem;
  line-height: 1.4;
  opacity: 0;
  transform: translateY(-4px);
  transition: all 0.3s var(--ease-fluid);
  pointer-events: none;
  min-height: 1.2rem;
}

.form-feedback.visible {
  opacity: 1;
  transform: translateY(0);
}

.form-feedback.success {
  color: #a7f3d0;
  text-shadow: 0 0 12px rgba(52, 211, 153, 0.25);
}

.form-feedback.error {
  color: #fca5a5;
  text-shadow: 0 0 12px rgba(248, 113, 113, 0.25);
}

/* ==========================================================================
   Social Navigation
   ========================================================================== */
.social-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
}

.social-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  color: rgba(255, 255, 255, 0.45);
  border-radius: 50%;
  transition: color 0.25s ease, transform 0.25s var(--ease-fluid), background-color 0.25s ease;
  position: relative;
}

.social-link svg {
  width: 18px;
  height: 18px;
  transition: transform 0.25s var(--ease-fluid);
}

.social-link:hover {
  color: #ffffff;
  background-color: rgba(255, 255, 255, 0.05);
  transform: translateY(-2px);
}

.social-link:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.4);
  outline-offset: 3px;
  color: #ffffff;
}

/* ==========================================================================
   Site Footer
   ========================================================================== */
.site-footer {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  padding-top: 1.5rem;
  user-select: none;
}

.footer-meta {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  opacity: 0.7;
}

.arabic-concept {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: 0.95rem;
  color: rgba(255, 255, 255, 0.7);
  font-weight: 500;
  transition: color 0.25s ease;
}

.arabic-concept:hover {
  color: #ffffff;
}

.meta-separator {
  opacity: 0.4;
}

.footer-copy {
  font-size: 0.75rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  opacity: 0.6;
}

/* ==========================================================================
   Keyframe Animations
   ========================================================================== */
@keyframes ambientFloat1 {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(-5vw, 6vh) scale(1.08);
  }
  100% {
    transform: translate(-10vw, -4vh) scale(0.95);
  }
}

@keyframes ambientFloat2 {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(6vw, -5vh) scale(1.06);
  }
  100% {
    transform: translate(12vw, 4vh) scale(0.92);
  }
}

@keyframes ambientFloat3 {
  0% {
    transform: translate(0, 0);
  }
  50% {
    transform: translate(-3vw, -4vh);
  }
  100% {
    transform: translate(4vw, 3vh);
  }
}

@keyframes auraPulse {
  0% {
    transform: scale(0.92);
    opacity: 0.6;
  }
  100% {
    transform: scale(1.1);
    opacity: 1;
  }
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* ==========================================================================
   Responsive & Adaptive Media Queries
   ========================================================================== */
@media (max-width: 640px) {
  .page-container {
    padding: 2.5rem 1.25rem 1.75rem;
  }

  .content-wrapper {
    transform: none !important; /* Disable 3D tilt on mobile for crisp, stable layout */
  }

  .brand-symbol {
    margin-bottom: 1.75rem;
  }

  .compass-svg {
    width: 48px;
    height: 48px;
  }

  .brand-header {
    margin-bottom: 2rem;
  }

  .brand-name {
    margin-bottom: 1rem;
  }

  .action-section {
    max-width: 100%;
    margin-bottom: 2.25rem;
  }

  .notify-form {
    flex-direction: column;
    padding: 6px;
    gap: 8px;
  }

  .input-wrapper {
    width: 100%;
  }

  .notify-form input[type="email"] {
    padding: 0.85rem 1rem;
    text-align: center;
    font-size: 0.95rem;
  }

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

  .social-nav {
    gap: 1.25rem;
  }
}

/* Accessibility: Respect Reduced Motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  
  .content-wrapper {
    transform: none !important;
  }
  
  .orb-primary,
  .orb-secondary,
  .orb-tertiary {
    animation: none !important;
  }
}
