/* ==========================================================================
   Abji Fatemeh Soft-Luxury Landing & Bridge Page Stylesheet
   Crafted strictly with:
   - web-prototype-taste-soft (Double-bezel, button-in-button, squircle radii)
   - make-interfaces-feel-better (Concentric radii, tabular nums, optical alignment)
   - hughes-behavioral-ui (Internal locus of control, warm psychological safety)
   ========================================================================== */

:root {
  /* The Earthy Mother Palette */
  --canvas-bg: #FAF7F2;
  --canvas-surface: #FFFFFF;
  --canvas-card-outer: rgba(255, 255, 255, 0.65);
  --canvas-card-inner: #FFFFFF;
  
  /* Primary & Accent Accents */
  --terracotta: #D96B43;
  --terracotta-hover: #C55B33;
  --terracotta-glow: rgba(217, 107, 67, 0.28);
  
  --sage: #5E806D;
  --sage-light: #EBF2ED;
  --sage-border: rgba(94, 128, 109, 0.2);
  
  --warm-sand: #EFE8DC;
  --warm-sand-dark: #D4C7B5;
  
  /* Text & Contrast Hierarchy */
  --text-primary: #2C2623;
  --text-secondary: #6B625B;
  --text-muted: #968C83;
  
  /* Radii (Strict concentric math: outer = inner + padding) */
  --card-padding: 10px;
  --card-radius-outer: 34px;
  --card-radius-inner: calc(var(--card-radius-outer) - var(--card-padding)); /* 24px */
  --pill-radius: 9999px;
  
  /* Springs & Bezier Curves */
  --spring-ease: cubic-bezier(0.32, 0.72, 0, 1);
  --duration-normal: 400ms;
}

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

html {
  font-family: 'Vazirmatn', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  background-color: var(--canvas-bg);
  color: var(--text-primary);
  direction: rtl;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.6;
}

body {
  min-height: 100dvh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
  overflow-x: hidden;
  padding: 24px 16px;
}

/* --------------------------------------------------------------------------
   WebGL 3D Interactive Canvas
   -------------------------------------------------------------------------- */
#webgl-canvas {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 0;
}

/* --------------------------------------------------------------------------
   Ambient Warmth Mesh (Slow-Drifting Radial Glows)
   -------------------------------------------------------------------------- */
.ambient-mesh {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
  opacity: 0.7;
}

.mesh-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(80px);
  will-change: transform;
}

.blob-warm {
  width: 380px;
  height: 380px;
  background: radial-gradient(circle, rgba(239, 218, 190, 0.65) 0%, rgba(250, 247, 242, 0) 70%);
  top: -60px;
  right: -60px;
  animation: driftSlow 26s infinite alternate var(--spring-ease);
}

.blob-sage {
  width: 420px;
  height: 420px;
  background: radial-gradient(circle, rgba(212, 228, 218, 0.55) 0%, rgba(250, 247, 242, 0) 70%);
  bottom: -80px;
  left: -80px;
  animation: driftSlow 22s infinite alternate-reverse var(--spring-ease);
}

.blob-clay {
  width: 280px;
  height: 280px;
  background: radial-gradient(circle, rgba(243, 196, 178, 0.45) 0%, rgba(250, 247, 242, 0) 70%);
  top: 40%;
  left: 20%;
  animation: driftSlow 28s infinite alternate var(--spring-ease);
}

@keyframes driftSlow {
  0% {
    transform: translate(0, 0) scale(1);
  }
  50% {
    transform: translate(25px, -35px) scale(1.08);
  }
  100% {
    transform: translate(-30px, 20px) scale(0.95);
  }
}

/* --------------------------------------------------------------------------
   Layout Container
   -------------------------------------------------------------------------- */
.page-container {
  width: 100%;
  max-width: 460px;
  margin: 0 auto;
  position: relative;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
  perspective: 1200px;
  transform-style: preserve-3d;
  animation: enterCascade 800ms var(--spring-ease) backwards;
}

@keyframes enterCascade {
  from {
    opacity: 0;
    transform: translateY(20px) scale(0.98);
    filter: blur(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
    filter: blur(0);
  }
}

/* --------------------------------------------------------------------------
   Top Eyebrow Pill
   -------------------------------------------------------------------------- */
.top-nav-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  background: rgba(255, 255, 255, 0.85);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid var(--sage-border);
  padding: 6px 16px;
  border-radius: var(--pill-radius);
  box-shadow: 0 4px 16px -4px rgba(94, 128, 109, 0.12);
  transition: transform var(--duration-normal) var(--spring-ease);
}

.top-nav-pill:hover {
  transform: translateY(-1px);
}

.pulse-dot {
  width: 8px;
  height: 8px;
  background-color: var(--sage);
  border-radius: 50%;
  display: inline-block;
  box-shadow: 0 0 0 0 rgba(94, 128, 109, 0.7);
  animation: pulseDot 2s infinite cubic-bezier(0.66, 0, 0, 1);
}

@keyframes pulseDot {
  0% {
    box-shadow: 0 0 0 0 rgba(94, 128, 109, 0.7);
  }
  70% {
    box-shadow: 0 0 0 8px rgba(94, 128, 109, 0);
  }
  100% {
    box-shadow: 0 0 0 0 rgba(94, 128, 109, 0);
  }
}

.pill-text {
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--sage);
  letter-spacing: -0.01em;
}

/* --------------------------------------------------------------------------
   Double-Bezel Card (Soft-Luxury Architecture)
   -------------------------------------------------------------------------- */
.double-bezel-outer {
  position: relative;
  width: 100%;
  padding: var(--card-padding);
  background: var(--canvas-card-outer);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border: 1px solid rgba(255, 255, 255, 0.85);
  border-radius: var(--card-radius-outer);
  box-shadow: 
    0 24px 48px -12px rgba(84, 58, 42, 0.08),
    0 4px 12px -2px rgba(84, 58, 42, 0.03),
    inset 0 1px 1px rgba(255, 255, 255, 0.9);
  transform-style: preserve-3d;
  will-change: transform;
  overflow: hidden;
}

/* Dynamic Specular Glass Glare Layer */
.specular-glare {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  background: radial-gradient(
    circle 340px at var(--glare-x, 50%) var(--glare-y, 50%),
    rgba(255, 255, 255, 0.52) 0%,
    rgba(255, 255, 255, 0.12) 45%,
    rgba(255, 255, 255, 0) 75%
  );
  opacity: 0;
  transition: opacity 300ms ease;
  z-index: 10;
  mix-blend-mode: overlay;
}

.double-bezel-inner {
  position: relative;
  background: var(--canvas-card-inner);
  border-radius: var(--card-radius-inner);
  padding: 32px 24px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  border: 1px solid rgba(0, 0, 0, 0.04);
  box-shadow: inset 0 0 20px rgba(250, 247, 242, 0.4);
  transform: translateZ(16px);
  transform-style: preserve-3d;
}

/* --------------------------------------------------------------------------
   Avatar Stage with Subtle Halo
   -------------------------------------------------------------------------- */
.avatar-stage {
  position: relative;
  margin-bottom: 20px;
  transform: translateZ(36px);
  transform-style: preserve-3d;
}

.avatar-halo {
  position: absolute;
  inset: -12px;
  background: radial-gradient(circle, rgba(217, 107, 67, 0.22) 0%, rgba(217, 107, 67, 0) 70%);
  border-radius: 50%;
  animation: haloBreath 4s ease-in-out infinite alternate;
}

@keyframes haloBreath {
  from {
    transform: scale(0.92);
    opacity: 0.6;
  }
  to {
    transform: scale(1.14);
    opacity: 1;
  }
}

.avatar-frame {
  position: relative;
  width: 104px;
  height: 104px;
  border-radius: 50%;
  padding: 4px;
  background: linear-gradient(135deg, #F5E8D8 0%, #E2C9B2 100%);
  box-shadow: 0 10px 24px -6px rgba(138, 79, 61, 0.25);
}

.avatar-img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  outline: 1px solid rgba(0, 0, 0, 0.08);
  outline-offset: -1px;
}

.online-badge {
  position: absolute;
  bottom: 2px;
  left: 6px;
  width: 22px;
  height: 22px;
  background-color: #2ECC71;
  color: #FFFFFF;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 2.5px solid #FFFFFF;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.15);
}

/* --------------------------------------------------------------------------
   Headline & Copywriting (Hughes Behavioral UI)
   -------------------------------------------------------------------------- */
.content-body {
  margin-bottom: 24px;
  transform: translateZ(26px);
  transform-style: preserve-3d;
}

.headline {
  font-size: 1.35rem;
  font-weight: 800;
  color: var(--text-primary);
  letter-spacing: -0.02em;
  line-height: 1.4;
  margin-bottom: 10px;
  text-wrap: balance;
}

.persona-chips {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin-bottom: 14px;
}

.persona-chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: rgba(217, 107, 67, 0.08);
  border: 1px solid rgba(217, 107, 67, 0.18);
  border-radius: 9999px;
  font-size: 0.78rem;
  font-weight: 600;
  color: #8A4F3D;
  line-height: 1.3;
}

.lede {
  font-size: 0.94rem;
  font-weight: 400;
  color: var(--text-secondary);
  line-height: 1.7;
  text-wrap: pretty;
  max-width: 38ch;
  margin: 0 auto;
}

/* --------------------------------------------------------------------------
   Circular Countdown Progress Ring
   -------------------------------------------------------------------------- */
.countdown-section {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  margin-bottom: 26px;
  width: 100%;
  transform: translateZ(22px);
  transform-style: preserve-3d;
}

.countdown-box {
  position: relative;
  width: 88px;
  height: 88px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.progress-ring {
  width: 88px;
  height: 88px;
  transform: rotate(-90deg);
}

.progress-ring-bg {
  fill: none;
  stroke: #F0EAE1;
  stroke-width: 5;
}

.progress-ring-indicator {
  fill: none;
  stroke: var(--terracotta);
  stroke-width: 5;
  stroke-linecap: round;
  /* 2 * PI * r (r=38) -> ~238.76 */
  stroke-dasharray: 238.76;
  stroke-dashoffset: 0;
  transition: stroke-dashoffset 1s linear;
}

.countdown-inner {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.countdown-digits {
  font-size: 1.65rem;
  font-weight: 800;
  color: var(--terracotta);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.countdown-label {
  font-size: 0.65rem;
  font-weight: 500;
  color: var(--text-muted);
  margin-top: 2px;
}

.status-tip {
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--duration-normal) var(--spring-ease);
}

.status-tip.paused {
  color: var(--sage);
  font-weight: 600;
}

/* --------------------------------------------------------------------------
   Action Buttons (Button-in-Button Pattern)
   -------------------------------------------------------------------------- */
.actions-group {
  width: 100%;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-bottom: 20px;
  transform: translateZ(32px);
  transform-style: preserve-3d;
}

/* Primary CTA Button-in-Button */
.btn-primary-pill {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-height: 56px;
  background: linear-gradient(135deg, var(--terracotta) 0%, #C75832 100%);
  color: #FFFFFF;
  text-decoration: none;
  border-radius: var(--pill-radius);
  padding: 6px 20px 6px 8px;
  box-shadow: 
    0 12px 28px -6px var(--terracotta-glow),
    0 4px 10px -2px rgba(217, 107, 67, 0.2),
    inset 0 1px 1px rgba(255, 255, 255, 0.3);
  cursor: pointer;
  border: none;
  outline: none;
  transition-property: transform, box-shadow, filter;
  transition-duration: 200ms;
  transition-timing-function: var(--spring-ease);
}

.btn-primary-pill:hover {
  transform: translateY(-2px);
  box-shadow: 
    0 16px 32px -6px var(--terracotta-glow),
    0 6px 14px -2px rgba(217, 107, 67, 0.25);
  filter: brightness(1.03);
}

.btn-primary-pill:active {
  transform: scale(0.98);
}

.btn-text {
  font-size: 1.02rem;
  font-weight: 700;
  letter-spacing: -0.01em;
}

/* The concentric trailing icon circle flush-left in RTL */
.btn-icon-wrapper {
  width: 42px;
  height: 42px;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  transition-property: transform, background-color;
  transition-duration: 200ms;
  transition-timing-function: var(--spring-ease);
}

.btn-primary-pill:hover .btn-icon-wrapper {
  background: rgba(255, 255, 255, 0.32);
  transform: translateX(-3px) scale(1.05);
}

.icon-eitaa {
  width: 20px;
  height: 20px;
  stroke: #FFFFFF;
  transform: scaleX(-1); /* Points in direction of reading in RTL */
}

/* Secondary Ghost Button (Pause/Resume) */
.btn-secondary-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  background: transparent;
  color: var(--text-secondary);
  border: 1px solid rgba(0, 0, 0, 0.08);
  border-radius: var(--pill-radius);
  font-family: inherit;
  font-size: 0.86rem;
  font-weight: 500;
  cursor: pointer;
  transition-property: background-color, color, border-color, transform;
  transition-duration: 180ms;
  transition-timing-function: var(--spring-ease);
}

.btn-secondary-ghost:hover {
  background-color: var(--canvas-bg);
  color: var(--text-primary);
  border-color: var(--warm-sand-dark);
}

.btn-secondary-ghost:active {
  transform: scale(0.97);
}

.icon-pause {
  color: currentColor;
}

/* --------------------------------------------------------------------------
   Card Footer & Social Trust Signals
   -------------------------------------------------------------------------- */
.card-footer {
  width: 100%;
  border-top: 1px solid rgba(0, 0, 0, 0.05);
  padding-top: 18px;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.community-stats {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 0.84rem;
  font-weight: 600;
  color: var(--sage);
}

.heart-icon {
  font-size: 1rem;
}

.manual-fallback {
  font-size: 0.78rem;
  color: var(--text-muted);
}

.inline-link {
  color: var(--terracotta);
  text-decoration: underline;
  text-underline-offset: 3px;
  font-weight: 600;
  transition: color 150ms ease;
}

.inline-link:hover {
  color: var(--terracotta-hover);
}

/* --------------------------------------------------------------------------
   Page Sub-Footer
   -------------------------------------------------------------------------- */
.page-footer {
  text-align: center;
}

.page-footer p {
  font-size: 0.72rem;
  color: var(--text-muted);
  font-weight: 400;
}

/* --------------------------------------------------------------------------
   Responsive Adjustments
   -------------------------------------------------------------------------- */
@media (max-width: 480px) {
  body {
    padding: 16px 12px;
  }
  
  .double-bezel-inner {
    padding: 24px 18px 22px;
  }
  
  .headline {
    font-size: 1.22rem;
  }
  
  .lede {
    font-size: 0.88rem;
  }
  
  .btn-primary-pill {
    min-height: 52px;
  }
  
  .btn-text {
    font-size: 0.95rem;
  }
}
