/* ============================================================
   RENAP — Landing Page Styles
   Complete responsive rewrite
   ============================================================ */

/* --- Removed Google Fonts in favor of Apple System Fonts --- */

/* ============================================================
   1. DESIGN TOKENS
   ============================================================ */
:root {
  /* Brand Colors */
  --renap-purple: #7B2FBE;
  --renap-purple-bright: #9B4DFF;
  --renap-deep-purple: #7B61FF;
  --renap-moon-blue: #4A90E2;
  --renap-orb-pink: #FF2D9B;
  --renap-orb-blue: #3D5AFE;

  /* Sleep Stage Colors */
  --sleep-awake: #FF6B6B;
  --sleep-rem: #5AC8FA;
  --sleep-core: #007AFF;
  --sleep-deep: #5856D6;

  /* Surfaces */
  --bg: #000000;
  --surface: rgba(28, 28, 30, 0.6);
  --surface-hover: rgba(44, 44, 46, 0.8);
  --surface-border: rgba(155, 77, 255, 0.12);
  --surface-border-hover: rgba(155, 77, 255, 0.3);

  /* Text */
  --text-primary: #FFFFFF;
  --text-secondary: rgba(235, 235, 245, 0.8);

  /* Typography */
  --font-display: -apple-system, BlinkMacSystemFont, "SF Pro Display", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-body: -apple-system, BlinkMacSystemFont, "SF Pro Text", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --font-mono: "SF Mono", ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  /* Spacing */
  --section-padding: 120px 0;
  --container-width: 1600px;
  --card-radius: 24px;
  --btn-radius: 9999px;

  /* Transitions */
  --transition-fast: 200ms ease;
  --transition-card: 250ms ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  overflow-x: hidden;
  height: 100%;
}

body {
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.5;
  color: var(--text-primary);
  background-color: var(--bg);
  overflow-x: hidden;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

main {
  flex: 1 0 auto;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  max-width: 100%;
  display: block;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
}

ul,
ol {
  list-style: none;
}

/* ============================================================
   3. TYPOGRAPHY
   ============================================================ */
.heading-hero {
  font-family: var(--font-display);
  font-size: clamp(44px, 6vw, 110px);
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: -0.04em;
  color: var(--text-primary);
}

.heading-section {
  font-family: var(--font-display);
  font-size: clamp(32px, 4.5vw, 68px);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.heading-feature {
  font-family: var(--font-display);
  font-size: clamp(22px, 2.2vw, 38px);
  font-weight: 600;
  line-height: 1.3;
  color: var(--text-primary);
}

.text-body {
  font-size: clamp(17px, 1.3vw, 22px);
  font-weight: 400;
  line-height: 1.8;
  color: rgba(255, 255, 255, 0.88);
}

.text-caption {
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-secondary);
}

.text-data {
  font-family: var(--font-mono);
  font-size: clamp(36px, 4.5vw, 72px);
  font-weight: 700;
  color: var(--renap-purple-bright);
}

.text-purple {
  color: var(--renap-purple-bright) !important;
}

/* ============================================================
   4. LAYOUT
   ============================================================ */
.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 64px);
}

.section {
  position: relative;
  padding: var(--section-padding);
  overflow: hidden;
  /* Prevent decorative background orbs and glows from causing horizontal overflow */
}

.section-center {
  text-align: center;
}

.section-header {
  max-width: 800px;
  margin: 0 auto 64px;
  text-align: center;
}

.section-header .text-body {
  margin-top: 32px;
  line-height: 1.85;
}

/* ============================================================
   5. GLASSMORPHIC CARDS
   ============================================================ */
.glass-card {
  position: relative;
  overflow: hidden;
  background: var(--surface);
  backdrop-filter: saturate(180%) blur(30px);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  border: 0.5px solid var(--surface-border);
  border-radius: var(--card-radius);
  padding: 32px;
  transition: border-color var(--transition-card),
    background var(--transition-card),
    transform var(--transition-card);
}

.glass-card:hover {
  border-color: var(--surface-border-hover);
  background: var(--surface-hover);
  transform: translateY(-2px);
}

/* Interactive 3D glass card shine reflection */
.glass-card::before,
.feature-info::before {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(circle 240px at var(--mouse-x, -999px) var(--mouse-y, -999px),
      rgba(255, 255, 255, 0.08),
      transparent 80%);
  z-index: 1;
  pointer-events: none;
  transition: opacity 300ms ease;
  opacity: 0;
}

.glass-card:hover::before,
.feature-info:hover::before {
  opacity: 1;
}

/* ============================================================
   6. BUTTONS
   ============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--btn-radius);
  font-size: 16px;
  font-weight: 600;
  transition: transform 150ms cubic-bezier(0.25, 0.46, 0.45, 0.94),
    background 200ms ease,
    box-shadow 200ms ease,
    border-color 200ms ease;
  white-space: nowrap;
}

.btn-primary {
  background: var(--renap-purple);
  color: var(--text-primary);
  box-shadow: 0 8px 24px rgba(123, 47, 190, 0.3);
}

.btn-primary:hover {
  filter: brightness(1.1);
  box-shadow: 0 12px 28px rgba(155, 77, 255, 0.4);
  transform: translateY(-2px) scale(1.02);
}

.btn-primary:active {
  transform: translateY(1px) scale(0.95) !important;
}

.btn-ghost {
  background: transparent;
  color: var(--renap-purple-bright);
  border: 1.5px solid var(--renap-purple-bright);
}

.btn-ghost:hover {
  background: rgba(155, 77, 255, 0.1);
  box-shadow: 0 0 20px rgba(155, 77, 255, 0.2);
  transform: translateY(-2px) scale(1.02);
}

.btn-ghost:active {
  transform: translateY(1px) scale(0.95) !important;
}

/* Focus states for accessibility */
.btn:focus-visible,
a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--renap-purple-bright);
  outline-offset: 3px;
}

/* Cinematic Glassmorphic Highlights */

.interactive-glow-orb {
  position: fixed;
  top: 0;
  left: 0;
  width: 600px;
  height: 600px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(155, 77, 255, 0.08) 0%, rgba(0, 0, 0, 0) 70%);
  filter: blur(80px);
  pointer-events: none;
  z-index: -5;
  /* Behind text but in front of fixed orbs */
  transform: translate3d(-999px, -999px, 0) translate(-50%, -50%);
  will-change: transform;
  display: block;
}

.particle-canvas {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: -8;
  /* Float on top of liquid orbs (-10) but behind everything else */
}

/* Liquid background container and elements */
.liquid-bg-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  z-index: -10;
  pointer-events: none;
  overflow: hidden;
  background-color: #000000;
  /* Removed parent-level filter: blur to prevent full-screen repaint and color banding */
  opacity: 0.85;
}

.liquid-filter-svg {
  position: absolute;
  width: 0;
  height: 0;
  pointer-events: none;
}

.liquid-orb {
  position: absolute;
  border-radius: 50%;
  mix-blend-mode: screen;
  will-change: transform;
  filter: blur(120px);
  /* Applied directly to individual orbs for GPU caching and ultra-smooth animations */
}

.liquid-orb-1 {
  top: -10%;
  left: -10%;
  width: 60vw;
  height: 60vw;
  background: radial-gradient(circle, rgba(123, 47, 190, 0.25) 0%, rgba(123, 47, 190, 0.05) 60%, rgba(0, 0, 0, 0) 100%);
  animation: liquidFloat1 24s ease-in-out infinite;
}

.liquid-orb-2 {
  bottom: -10%;
  right: -10%;
  width: 55vw;
  height: 55vw;
  background: radial-gradient(circle, rgba(123, 47, 190, 0.18) 0%, rgba(123, 47, 190, 0.04) 60%, rgba(0, 0, 0, 0) 100%);
  animation: liquidFloat2 28s ease-in-out infinite;
}

.liquid-orb-3 {
  top: 35%;
  left: 10%;
  width: 50vw;
  height: 50vw;
  background: radial-gradient(circle, rgba(74, 144, 226, 0.18) 0%, rgba(74, 144, 226, 0.04) 60%, rgba(0, 0, 0, 0) 100%);
  animation: liquidFloat3 22s ease-in-out infinite;
}

.liquid-orb-4 {
  top: 20%;
  right: 15%;
  width: 52vw;
  height: 52vw;
  background: radial-gradient(circle, rgba(155, 77, 255, 0.16) 0%, rgba(155, 77, 255, 0.03) 60%, rgba(0, 0, 0, 0) 100%);
  animation: liquidFloat4 26s ease-in-out infinite;
}

/* ============================================================
   7. PURPLE GLOW & ORB BACKGROUNDS
   ============================================================ */
.glow-bg {
  position: absolute;
  top: -300px;
  left: 50%;
  transform: translateX(-50%);
  width: 1200px;
  height: 800px;
  background: radial-gradient(circle at center,
      rgba(155, 77, 255, 0.18) 0%,
      rgba(123, 47, 190, 0.1) 35%,
      rgba(74, 144, 226, 0.04) 65%,
      rgba(123, 47, 190, 0.01) 85%,
      rgba(0, 0, 0, 0) 100%);
  filter: blur(120px);
  pointer-events: none;
  z-index: 0;
  opacity: 0.4;
}

.glow-bg-strong {
  width: 1400px;
  height: 900px;
  background: radial-gradient(circle at center,
      rgba(155, 77, 255, 0.28) 0%,
      rgba(123, 47, 190, 0.14) 35%,
      rgba(61, 90, 254, 0.07) 65%,
      rgba(255, 45, 155, 0.02) 85%,
      rgba(0, 0, 0, 0) 100%);
  filter: blur(140px);
  opacity: 0.5;
}

.orb {
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  z-index: 0;
}

.orb-pink {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 45, 155, 0.08) 0%, rgba(0, 0, 0, 0) 70%);
  filter: blur(80px);
}

.orb-blue {
  width: 450px;
  height: 450px;
  background: radial-gradient(circle, rgba(61, 90, 254, 0.08) 0%, rgba(0, 0, 0, 0) 70%);
  filter: blur(80px);
}

/* ============================================================
   8. NAVIGATION
   ============================================================ */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  transition: background 300ms ease;
  animation: navbarSlideDown 800ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 72px;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 4vw;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 22px;
  color: var(--text-primary);
  z-index: 1001;
}

.nav-brand svg {
  width: 28px;
  height: 28px;
  fill: var(--renap-purple-bright);
}

.nav-logo {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  object-fit: cover;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 32px;
}

.nav-links a {
  font-size: 15px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 2px;
  background: var(--renap-purple-bright);
  border-radius: 1px;
  transition: width 250ms ease;
}

.nav-links a:hover,
.nav-links a.active {
  color: var(--text-primary);
}

.nav-links a.active::after,
.nav-links a:hover::after {
  width: 100%;
}

.nav-cta {
  margin-left: 8px;
}

.nav-cta::after {
  display: none !important;
}

/* Hamburger */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  z-index: 1001;
  padding: 8px;
}

.nav-hamburger span {
  width: 24px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 300ms ease;
}

.nav-hamburger.open span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 5px);
}

.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}

.nav-hamburger.open span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -5px);
}

/* Mobile Nav Overlay */
.mobile-nav-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  opacity: 0;
  visibility: hidden;
  transition: all 300ms ease;
  z-index: 999;
}

.mobile-nav-overlay.open {
  opacity: 1;
  visibility: visible;
}

.mobile-nav {
  position: fixed;
  top: 0;
  right: -100%;
  width: 300px;
  max-width: 85vw;
  height: 100vh;
  height: 100dvh;
  background: rgba(10, 5, 20, 0.95);
  backdrop-filter: blur(24px);
  -webkit-backdrop-filter: blur(24px);
  border-left: 1px solid rgba(255, 255, 255, 0.08);
  padding: 100px 32px 32px;
  display: flex;
  flex-direction: column;
  gap: 28px;
  transition: right 350ms cubic-bezier(0.22, 1, 0.36, 1);
  z-index: 1000;
  overflow-y: auto;
}

.mobile-nav.open {
  right: 0;
}

.mobile-nav a {
  font-size: 20px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.mobile-nav a:hover,
.mobile-nav a.active {
  color: var(--renap-purple-bright);
}

.mobile-nav .btn {
  margin-top: 16px;
  text-align: center;
}

/* ============================================================
   9. HERO SECTION
   ============================================================ */
.hero {
  padding: 160px 0 80px;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  position: relative;
}

.hero-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.hero-text {
  position: relative;
  z-index: 2;
}

.hero-text .heading-hero {
  margin-bottom: 24px;
}

.hero-text .text-body {
  font-size: 18px;
  max-width: 520px;
  margin-bottom: 36px;
}

.hero-ctas {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
}

.hero-visual {
  position: relative;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 2;
}

.hero-visual .phone-frame-real-mockup {
  width: auto;
  height: 560px;
}

.hero .glow-bg {
  animation: breathe 4s ease-in-out infinite;
}

/* Floating stat chips */
.stat-chip {
  position: absolute;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px 16px;
  background: rgba(255, 255, 255, 0.07);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px;
  font-size: 14px;
  font-weight: 500;
  white-space: nowrap;
  z-index: 5;
  animation: floatChip 3.5s ease-in-out infinite;
}

.stat-chip .chip-value {
  font-family: var(--font-mono);
  font-weight: 700;
  color: var(--renap-purple-bright);
}

.stat-chip .chip-arrow {
  color: #4ADE80;
  font-size: 12px;
}

.stat-chip:nth-child(1) {
  top: 5%;
  right: 0%;
  animation-delay: 0s;
}

.stat-chip:nth-child(2) {
  bottom: 20%;
  right: -2%;
  animation-delay: 0.8s;
}

.stat-chip:nth-child(3) {
  bottom: 10%;
  left: 0%;
  animation-delay: 1.5s;
}

.stat-chip:nth-child(4) {
  top: 15%;
  left: -1%;
  animation-delay: 2.2s;
}

/* Social proof bar */
.social-proof {
  margin-top: 36px;
  padding: 20px 0;
  position: relative;
  z-index: 2;
}

.social-proof-inner {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  flex-wrap: wrap;
  font-size: 14px;
  color: var(--text-secondary);
}

.social-proof .stars {
  color: #FFD700;
  letter-spacing: 2px;
}

.social-proof .dot {
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.25);
  display: inline-block;
}

/* ============================================================
   10. iPHONE MOCKUP
   ============================================================ */
.phone-frame {
  position: relative;
  width: 280px;
  /* Fixed width on desktop */
  aspect-ratio: 406 / 839;
  border-radius: 40px;
  background: #000000;
  overflow: hidden;
  box-shadow: 0 0 80px rgba(123, 47, 190, 0.2);
  flex-shrink: 0;
  --phone-scale: 1;
  /* Default scale factor for W=280px */
}

.phone-frame::after {
  content: '';
  position: absolute;
  inset: 0;
  background-image: url('resource/Iphone.png');
  background-size: 100% 100%;
  background-repeat: no-repeat;
  pointer-events: none;
  z-index: 10;
}

.phone-screenshot {
  position: absolute;
  top: 3.2%;
  bottom: 3.2%;
  left: 6.5%;
  right: 6.5%;
  width: 87%;
  height: 93.6%;
  object-fit: cover;
  object-position: top;
  border-radius: 36px;
  display: block;
}

/* Hide fake Dynamic Island as it is built into the official iPhone frame image */
.phone-frame::before {
  display: none;
}

/* Real mockup images that already include the iPhone bezel — hide the ::after overlay */
.phone-frame-real-mockup {
  background: transparent;
  box-shadow: none;
  border-radius: 0;
  overflow: visible;
  /* Override the base width/aspect-ratio — use fixed height as the single sizing anchor */
  width: auto;
  aspect-ratio: unset;
  height: 500px;
  /* Uniform height for all feature mockups */
}

.phone-frame-real-mockup::after {
  display: none;
}

.phone-frame-real-mockup .phone-mockup-img {
  width: auto;
  height: 100%;
  max-width: 100%;
  object-fit: contain;
  display: block;
  border-radius: 0;
  filter: drop-shadow(0 0 60px rgba(123, 47, 190, 0.25));
}

.phone-screen {
  position: absolute;
  top: 0;
  left: 0;
  width: 280px;
  height: 578px;
  transform-origin: top left;
  transform: scale(var(--phone-scale, 1));
  padding: 52px 16px 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-sizing: border-box;
}

/* Sleep Dashboard Screen Content */
.screen-header {
  text-align: center;
  margin-bottom: 4px;
}

.screen-header .screen-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.screen-header .screen-date {
  font-size: 10px;
  color: var(--text-secondary);
}

.screen-score-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--renap-purple-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 4px auto;
  position: relative;
}

.screen-score-ring::before {
  content: '';
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  border: 3px solid transparent;
  border-top-color: var(--renap-deep-purple);
  border-right-color: var(--renap-deep-purple);
}

.screen-score {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  color: var(--renap-purple-bright);
}

.screen-score-label {
  font-size: 8px;
  color: var(--text-secondary);
  text-align: center;
  margin-top: -2px;
}

.screen-card {
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 14px;
  padding: 10px 12px;
}

.screen-card-title {
  font-size: 9px;
  font-weight: 600;
  color: var(--text-secondary);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 6px;
}

/* Hypnogram bars */
.hypnogram {
  display: flex;
  align-items: flex-end;
  gap: 2px;
  height: 40px;
}

.hypnogram-bar {
  flex: 1;
  border-radius: 2px 2px 0 0;
  min-width: 3px;
}

/* Stage legend */
.stage-legend {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 4px;
}

.stage-dot {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 7px;
  color: var(--text-secondary);
}

.stage-dot span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
}

/* Vital row */
.vitals-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}

.vital-item {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 8px;
  text-align: center;
}

.vital-value {
  font-family: var(--font-mono);
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
}

.vital-label {
  font-size: 8px;
  color: var(--text-secondary);
  margin-top: 2px;
}

/* ============================================================
   11. PAIN POINT SECTION
   ============================================================ */
#problem .section-header {
  max-width: 1000px;
}

.problem-layout {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: 80px;
  align-items: center;
}

.problem-left .section-header {
  text-align: left;
  margin: 0;
  max-width: 100%;
}

.problem-left .text-body {
  margin-top: 24px;
}

.problem-right {
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.pain-stat-card {
  display: grid;
  grid-template-columns: 1fr;
  align-items: center;
  padding: 32px;
  background: rgba(28, 28, 30, 0.4);
  border: 1.5px solid rgba(155, 77, 255, 0.12);
  border-radius: 20px;
  text-align: left;
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  position: relative;
  overflow: hidden;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.stat-card-default,
.stat-card-hover {
  grid-area: 1 / 1;
  width: 100%;
  transition: opacity 0.35s cubic-bezier(0.25, 1, 0.5, 1),
    transform 0.35s cubic-bezier(0.25, 1, 0.5, 1),
    filter 0.35s cubic-bezier(0.25, 1, 0.5, 1);
}

.stat-card-default {
  display: flex;
  align-items: center;
  gap: 28px;
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
}

.stat-card-hover {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(12px);
  pointer-events: none;
}

.stat-description {
  font-size: 15px;
  line-height: 1.6;
  color: var(--text-primary);
  margin: 0;
}

.pain-stat-card .stat-icon {
  flex-shrink: 0;
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: rgba(123, 47, 190, 0.15);
  border: 1px solid rgba(155, 77, 255, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.3s ease;
}

.pain-stat-card .stat-info-group {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.pain-stat-card .text-data {
  font-family: var(--font-display);
  font-size: clamp(28px, 3vw, 42px);
  font-weight: 800;
  color: #fff;
  line-height: 1.1;
  transition: all 0.3s ease;
}

.pain-stat-card .stat-label {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Hover effects */
.pain-stat-card:hover {
  transform: translateX(8px);
  background: rgba(28, 28, 30, 0.7);
  border-color: rgba(155, 77, 255, 0.4);
  box-shadow: 0 10px 30px rgba(155, 77, 255, 0.15);
}

.pain-stat-card:hover .stat-card-default {
  opacity: 0;
  filter: blur(8px);
  transform: translateY(-12px);
  pointer-events: none;
}

.pain-stat-card:hover .stat-card-hover {
  opacity: 1;
  filter: blur(0);
  transform: translateY(0);
  pointer-events: auto;
}

.pain-stat-card:hover .stat-icon {
  background: rgba(155, 77, 255, 0.25);
  border-color: var(--renap-purple-bright);
  box-shadow: 0 0 15px rgba(155, 77, 255, 0.4);
}

.pain-stat-card:hover .text-data {
  background: linear-gradient(135deg, var(--renap-purple-bright) 0%, var(--renap-orb-pink) 100%);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

/* ============================================================
   12. FEATURES SECTION
   ============================================================ */
.scroll-line-container {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
}

.scroll-line-svg {
  width: 100%;
  height: 100%;
  display: block;
}

.scroll-line-active,
.scroll-line-glow {
  transition: stroke-dashoffset 120ms cubic-bezier(0.1, 0.8, 0.25, 1);
}

#features .container {
  position: relative;
  z-index: 2;
}

.feature-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
  margin-bottom: 100px;
}

.feature-row:last-child {
  margin-bottom: 0;
}

.feature-row.reverse {
  direction: rtl;
}

.feature-row.reverse>* {
  direction: ltr;
}

.feature-info {
  position: relative;
  z-index: 2;
  overflow: hidden;
  background: var(--surface);
  backdrop-filter: saturate(180%) blur(30px);
  -webkit-backdrop-filter: saturate(180%) blur(30px);
  border: 0.5px solid var(--surface-border);
  border-radius: var(--card-radius);
  padding: 48px;
  max-width: 560px;
  justify-self: center;
  transition: border-color 300ms ease, box-shadow 300ms ease;
  box-shadow: 0 15px 35px rgba(0, 0, 0, 0.2);
}

.feature-info:hover {
  border-color: rgba(155, 77, 255, 0.4);
  box-shadow: 0 30px 60px rgba(0, 0, 0, 0.6),
    0 0 50px rgba(155, 77, 255, 0.18);
}

.feature-icon {
  width: 56px;
  height: 56px;
  border-radius: 16px;
  background: linear-gradient(135deg, rgba(123, 47, 190, 0.25), rgba(123, 47, 190, 0.05));
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border: 1px solid rgba(155, 77, 255, 0.3);
  box-shadow: inset 0 0 20px rgba(155, 77, 255, 0.15), 0 8px 16px rgba(0, 0, 0, 0.2);
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 24px;
}

.feature-icon svg,
.feature-svg-icon {
  width: 26px;
  height: 26px;
  color: var(--renap-purple-bright);
  display: block;
}

.feature-info .heading-feature {
  margin-bottom: 16px;
}

.feature-info .text-body {
  margin-bottom: 20px;
}

.feature-callout {
  display: inline-block;
  padding: 10px 16px;
  background: rgba(123, 47, 190, 0.1);
  border: 1px solid rgba(123, 47, 190, 0.25);
  border-radius: 12px;
  font-size: 14px;
  color: var(--renap-purple-bright);
  font-weight: 500;
  margin-top: 4px;
}

.feature-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.feature-chip {
  padding: 6px 14px;
  background: rgba(155, 77, 255, 0.1);
  border: 1px solid rgba(155, 77, 255, 0.2);
  border-radius: 20px;
  font-size: 13px;
  color: var(--renap-purple-bright);
  font-weight: 500;
}

/* Sleep stage color legend */
.color-legend {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.legend-swatch {
  width: 12px;
  height: 12px;
  border-radius: 4px;
}

/* Genre color swatches */
.genre-swatches {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 16px;
}

.genre-swatch {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-secondary);
}

.genre-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
}

.feature-visual {
  position: relative;
  display: flex;
  justify-content: center;
  z-index: 2;
}

.feature-visual .phone-frame {
  width: 240px;
  --phone-scale: 0.857;
  /* 240px / 280px */
}

.feature-visual .phone-frame-real-mockup {
  width: auto;
  height: 500px;
}

/* Dual phone display */
.dual-phones {
  display: flex;
  gap: 20px;
  justify-content: center;
}

.dual-phones .phone-frame {
  width: 200px;
  border-radius: 36px;
}

/* ============================================================
   13. HOW IT WORKS SECTION
   ============================================================ */
.steps-grid-container {
  position: relative;
  width: 100%;
  margin-top: 80px;
  padding-bottom: 60px;
  /* Space for shifted cards */
}

/* Curved Connecting Line SVG */
.steps-connecting-line {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 250px;
  pointer-events: none;
  z-index: 1;
}

.glowing-path {
  stroke-dasharray: 20;
  stroke-dashoffset: 40;
  animation: stepsLinePulse 15s linear infinite;
}

@keyframes stepsLinePulse {
  to {
    stroke-dashoffset: -400;
  }
}

.steps-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 32px;
  position: relative;
  z-index: 2;
}

.step-card {
  text-align: center;
  padding: 48px 32px 36px;
  background: rgba(28, 28, 30, 0.45);
  border: 1.5px solid rgba(155, 77, 255, 0.12);
  border-radius: 24px;
  transition: all 0.4s cubic-bezier(0.25, 1, 0.5, 1);
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.25);
}

/* Staggered offsets for wave visual */
#step-card-1 {
  transform: translateY(-20px);
}

#step-card-2 {
  transform: translateY(40px);
}

#step-card-3 {
  transform: translateY(-20px);
}

.step-number {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  color: #fff;
  background: rgba(123, 47, 190, 0.2);
  border: 1.5px solid rgba(155, 77, 255, 0.3);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 28px;
  box-shadow: 0 0 10px rgba(155, 77, 255, 0.1);
  transition: all 0.3s ease;
}

.step-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 600;
  margin-bottom: 12px;
  color: #fff;
}

.step-desc {
  font-size: 14.5px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 24px;
}

.step-time {
  display: inline-block;
  padding: 6px 16px;
  background: rgba(155, 77, 255, 0.08);
  border: 1px solid rgba(155, 77, 255, 0.15);
  border-radius: 20px;
  font-size: 11.5px;
  color: var(--renap-purple-bright);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.5px;
  transition: all 0.3s ease;
}

/* Hover States */
.step-card:hover {
  background: rgba(28, 28, 30, 0.7);
  border-color: rgba(155, 77, 255, 0.4);
  box-shadow: 0 12px 30px rgba(155, 77, 255, 0.15);
}

#step-card-1:hover {
  transform: translateY(-28px);
}

#step-card-2:hover {
  transform: translateY(32px);
}

#step-card-3:hover {
  transform: translateY(-28px);
}

.step-card:hover .step-number {
  background: var(--renap-purple-bright);
  border-color: var(--renap-purple-bright);
  box-shadow: 0 0 15px rgba(155, 77, 255, 0.5);
  color: #fff;
}

.step-card:hover .step-time {
  background: rgba(155, 77, 255, 0.15);
  border-color: var(--renap-purple-bright);
  box-shadow: 0 0 10px rgba(155, 77, 255, 0.2);
}

/* ============================================================
   14. ELA AI SECTION
   ============================================================ */
.ela-section {
  background: rgba(123, 47, 190, 0.08);
}

.ela-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 80px;
  align-items: center;
}

.ela-subtitle {
  font-size: 20px;
  color: var(--text-secondary);
  margin-top: 12px;
  margin-bottom: 28px;
  font-weight: 400;
}

.ela-body {
  font-size: 17px;
  color: var(--text-secondary);
  line-height: 1.75;
  margin-bottom: 36px;
}

.ela-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.ela-feature-card {
  padding: 20px;
  border-radius: 18px;
}

.ela-feature-card .emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  background: rgba(123, 47, 190, 0.15);
  border: 1px solid rgba(155, 77, 255, 0.2);
  border-radius: 14px;
  margin-bottom: 16px;
}

.ela-feature-card .emoji svg {
  color: var(--renap-purple-bright);
}

.ela-feature-card .ela-feat-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
}

.ela-feature-card .ela-feat-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.5;
}

.ela-visual {
  display: flex;
  justify-content: center;
  position: relative;
}

/* Waveform decoration */
.waveform-bg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 350px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 3px;
  opacity: 0.15;
  z-index: 1;
}

.waveform-bar {
  width: 3px;
  background: var(--renap-purple-bright);
  border-radius: 2px;
  animation: waveform 1.5s ease-in-out infinite;
}

/* ============================================================
   15. ARTICLES SECTION
   ============================================================ */
.articles-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 24px;
}

.article-card {
  padding: 28px 32px;
}

.article-front-header {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
}

.article-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: rgba(155, 77, 255, 0.12);
  border: 1px solid rgba(155, 77, 255, 0.2);
  font-size: 20px;
  flex-shrink: 0;
}

.article-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 42px;
  padding: 0 16px;
  background: linear-gradient(135deg, rgba(155, 77, 255, 0.2), rgba(123, 47, 190, 0.12));
  color: var(--renap-purple-bright);
  border-radius: 21px;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border: 1px solid rgba(155, 77, 255, 0.18);
}

.article-title {
  font-family: var(--font-display);
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text-primary);
}

.article-preview {
  font-size: 14px;
  color: var(--text-secondary);
  line-height: 1.5;
  margin-bottom: 0;
}

.article-desc {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.65;
}

/* --- Flip Card Animations & Layout (2D Cross-dissolve for zero-flicker stability) --- */
.flip-card {
  height: 240px;
  background-color: transparent;
}

.flip-card .glass-card {
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  background: linear-gradient(160deg, rgba(24, 16, 40, 0.97), rgba(14, 8, 26, 0.98)) !important;
  border: 1.5px solid rgba(155, 77, 255, 0.2) !important;
  transition: border-color 0.3s ease, box-shadow 0.3s ease;
}

.flip-card .glass-card:hover {
  transform: none !important;
  border-color: rgba(155, 77, 255, 0.5) !important;
  box-shadow: 0 8px 32px rgba(155, 77, 255, 0.12), 0 0 0 1px rgba(155, 77, 255, 0.1);
}

.flip-card-inner {
  position: relative;
  width: 100%;
  height: 100%;
  text-align: left;
  transition: transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.flip-card:hover .flip-card-inner {
  transform: translateY(-6px);
}

.flip-card-front,
.flip-card-back {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  margin: 0;
  box-sizing: border-box;
  transition: opacity 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), transform 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94), visibility 0.4s ease;
}

.flip-card-front {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  z-index: 2;
}

.flip-card:hover .flip-card-front {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95);
  z-index: 1;
}

.flip-card-front .learn-more-prompt {
  margin-top: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--renap-purple-bright);
  opacity: 0.7;
  transition: opacity 0.3s ease, letter-spacing 0.3s ease;
  display: flex;
  align-items: center;
  gap: 6px;
}

.flip-card:hover .flip-card-front .learn-more-prompt {
  opacity: 1;
  letter-spacing: 0.02em;
}

.flip-card-back {
  opacity: 0;
  visibility: hidden;
  transform: scale(0.95);
  z-index: 1;
}

.flip-card:hover .flip-card-back {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
  z-index: 2;
}

.article-back-title {
  font-family: var(--font-display);
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 10px;
  color: var(--text-primary);
}

/* ============================================================
   16. DOWNLOAD CTA SECTION
   ============================================================ */
.download-section {
  padding: 160px 0;
  position: relative;
}

.download-content {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 80px;
  align-items: center;
  text-align: left;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 40px;
  position: relative;
  z-index: 2;
}

.download-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  position: relative;
  z-index: 2;
}

.download-visual {
  display: flex;
  justify-content: center;
  align-items: center;
  position: relative;
  z-index: 2;
}

.download-devices {
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 0;
  position: relative;
}

.download-watch {
  position: relative;
  z-index: 1;
  margin-right: 40px;
  margin-top: 80px;
}

.watch-mockup-img {
  height: 300px;
  width: auto;
  display: block;
  filter: drop-shadow(0 20px 40px rgba(0, 0, 0, 0.5));
}

.download-phone {
  position: relative;
  z-index: 2;
}

.download-section .heading-section {
  margin-bottom: 16px;
  text-align: left;
}

.download-section .text-body {
  font-size: 18px;
  max-width: 580px;
  margin: 0 0 32px 0;
  text-align: left;
}

.download-ctas {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
}

.app-store-badge {
  display: inline-block;
  transition: all var(--transition-fast);
}

.app-store-badge:hover {
  transform: scale(1.03);
  filter: brightness(1.1);
}

.app-store-badge img,
.app-store-badge svg {
  height: 54px;
  width: auto;
  display: block;
}

.download-section .app-store-badge img,
.download-section .app-store-badge svg {
  height: 66px;
}

.download-requirements {
  margin-top: 10px;
  font-size: 15px;
  line-height: 1.5;
  color: var(--text-secondary);
}

.trust-signals {
  display: flex;
  justify-content: center;
  gap: 32px;
  flex-wrap: wrap;
  margin-top: 48px;
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 14px;
  color: var(--text-secondary);
}

.trust-item .trust-emoji {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  background: rgba(123, 47, 190, 0.15);
  border: 1px solid rgba(155, 77, 255, 0.2);
  border-radius: 12px;
  color: var(--renap-purple-bright);
  flex-shrink: 0;
}

.download-phone {
  margin: 0;
  display: flex;
  justify-content: center;
  position: relative;
}

.download-phone .phone-frame {
  width: 240px;
  margin: 0 auto;
  box-shadow: 0 0 120px rgba(123, 47, 190, 0.4),
    0 0 60px rgba(155, 77, 255, 0.25);
  --phone-scale: 0.857;
  /* 240px / 280px */
}

.download-phone .phone-frame-real-mockup {
  width: auto;
  height: 480px;
  box-shadow: none;
}

.download-logo-wrap {
  text-align: center;
}

.download-app-logo {
  width: 160px;
  height: 160px;
  border-radius: 36px;
  object-fit: cover;
  margin: 0 auto 20px;
  box-shadow: 0 0 120px rgba(123, 47, 190, 0.4),
    0 0 60px rgba(155, 77, 255, 0.25);
}

/* ============================================================
   17. FOOTER
   ============================================================ */
.footer {
  padding: 50px 0 0;
  position: relative;
  background: linear-gradient(180deg, #0d041a 0%, #150628 50%, #0d041a 100%);
  border-top: 1px solid rgba(155, 77, 255, 0.20);
  overflow: hidden;
  flex-shrink: 0;
}

.footer::before {
  content: '';
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 800px;
  height: 800px;
  background: radial-gradient(circle, rgba(155, 77, 255, 0.25) 0%, rgba(155, 77, 255, 0) 70%);
  z-index: 1;
  pointer-events: none;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1.5fr;
  gap: 48px;
  padding-bottom: 80px;
  position: relative;
  z-index: 2;
}

.footer-brand {
  display: flex;
  align-items: center;
  gap: 14px;
  font-family: var(--font-display);
  font-size: 32px;
  font-weight: 800;
  letter-spacing: -0.02em;
  margin-bottom: 16px;
  color: var(--text-primary);
  text-shadow: 0 0 20px rgba(155, 77, 255, 0.3);
}

.footer-brand svg {
  width: 32px;
  height: 32px;
  fill: var(--renap-purple-bright);
}

.footer-logo {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  object-fit: cover;
  box-shadow: 0 8px 24px rgba(155, 77, 255, 0.25);
  border: 1.5px solid rgba(155, 77, 255, 0.3);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.footer-logo:hover {
  transform: scale(1.05);
  box-shadow: 0 12px 28px rgba(155, 77, 255, 0.4);
}

.footer-tagline {
  font-size: 18px;
  font-weight: 400;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 24px;
  line-height: 1.4;
}

.footer-socials {
  display: flex;
  gap: 12px;
}

.footer-socials a {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  transition: all var(--transition-fast);
}

.footer-socials a:hover {
  background: rgba(155, 77, 255, 0.15);
  border-color: var(--renap-purple-bright);
}

.footer-heading {
  font-size: 14px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--text-primary);
  margin-bottom: 16px;
}

.footer-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.footer-links a {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-secondary);
  transition: color var(--transition-fast);
}

.footer-links a:hover {
  color: var(--renap-purple-bright);
}

.footer-tech {
  font-family: var(--font-body);
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.6;
}

.footer-bottom {
  padding: 20px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
  color: var(--text-secondary);
  text-align: center;
}

/* ============================================================
   18. ANIMATIONS
   ============================================================ */
@keyframes liquidFloat1 {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(10vw, 8vh) scale(1.15);
  }

  66% {
    transform: translate(-5vw, 15vh) scale(0.9);
  }
}

@keyframes liquidFloat2 {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  33% {
    transform: translate(-8vw, -12vh) scale(0.9);
  }

  66% {
    transform: translate(6vw, -5vh) scale(1.1);
  }
}

@keyframes liquidFloat3 {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(12vw, -15vh) scale(1.2) rotate(45deg);
  }
}

@keyframes liquidFloat4 {

  0%,
  100% {
    transform: translate(0, 0) scale(1);
  }

  50% {
    transform: translate(-10vw, 10vh) scale(0.85) rotate(-45deg);
  }
}

@keyframes breathe {

  0%,
  100% {
    transform: translateX(-50%) scale(1);
  }

  50% {
    transform: translateX(-50%) scale(1.05);
  }
}

@keyframes floatChip {

  0%,
  100% {
    transform: translateY(0) rotate(-1deg);
  }

  50% {
    transform: translateY(-15px) rotate(2.5deg);
  }
}

@keyframes waveform {

  0%,
  100% {
    height: 8px;
  }

  50% {
    height: 40px;
  }
}

@keyframes navbarSlideDown {
  from {
    transform: translateY(-100%);
    opacity: 0;
  }

  to {
    transform: translateY(0);
    opacity: 1;
  }
}

/* Scroll reveal */
.reveal {
  opacity: 0;
  transform: translateY(64px) scale(0.95);
  /* Exit transition: smooth, no overshoot bounce */
  transition: opacity 600ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 600ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0) scale(1);
  /* Entry transition: spring-back bounce! */
  transition: opacity 600ms cubic-bezier(0.34, 1.56, 0.64, 1),
    transform 600ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

/* Staggered children */
.reveal-children>* {
  opacity: 0;
  transform: translateY(40px) scale(0.96);
  /* Exit transition: smooth, no overshoot bounce */
  transition: opacity 550ms cubic-bezier(0.16, 1, 0.3, 1),
    transform 550ms cubic-bezier(0.16, 1, 0.3, 1);
}

.reveal-children.visible>* {
  opacity: 1;
  transform: translateY(0) scale(1);
  /* Entry transition: spring-back bounce! */
  transition: opacity 500ms cubic-bezier(0.34, 1.56, 0.64, 1),
    transform 500ms cubic-bezier(0.34, 1.56, 0.64, 1);
}

.reveal-children.visible>*:nth-child(1) {
  transition-delay: 0ms;
}

.reveal-children.visible>*:nth-child(2) {
  transition-delay: 100ms;
}

.reveal-children.visible>*:nth-child(3) {
  transition-delay: 200ms;
}

.reveal-children.visible>*:nth-child(4) {
  transition-delay: 300ms;
}

.reveal-children.visible>*:nth-child(5) {
  transition-delay: 400ms;
}

.reveal-children.visible>*:nth-child(6) {
  transition-delay: 500ms;
}

/* ============================================================
   19. REDUCED MOTION
   ============================================================ */
@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .reveal-children>* {
    opacity: 1;
    transform: none;
  }
}

/* ============================================================
   20. SPECIAL SCREENS (Feature phone mockups)
   ============================================================ */

/* Ela Screen */
.screen-ela {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 100%;
  text-align: center;
}

.ela-mic-btn {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--renap-purple-bright) 0%, var(--renap-purple) 50%, var(--renap-deep-purple) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  box-shadow: 0 0 30px rgba(123, 47, 190, 0.4);
}

.ela-transcript {
  font-size: 11px;
  color: var(--text-secondary);
  line-height: 1.5;
  padding: 0 8px;
}

/* Breathing Screen */
.screen-breathing {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
}

.breath-ring {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  border: 3px solid var(--renap-purple-bright);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: breatheRing 4s ease-in-out infinite;
}

@keyframes breatheRing {

  0%,
  100% {
    transform: scale(0.85);
    opacity: 0.6;
  }

  50% {
    transform: scale(1.1);
    opacity: 1;
  }
}

.breath-label {
  font-size: 12px;
  color: var(--renap-purple-bright);
  font-weight: 600;
}

/* Music Screen */
.screen-music {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}

.music-card {
  border-radius: 12px;
  padding: 12px;
  display: flex;
  align-items: center;
  gap: 10px;
}

.music-dot {
  width: 32px;
  height: 32px;
  border-radius: 10px;
  flex-shrink: 0;
}

.music-info .music-title {
  font-size: 11px;
  font-weight: 600;
}

.music-info .music-genre {
  font-size: 9px;
  color: var(--text-secondary);
}

/* CBT-I Screen */
.screen-cbti {
  display: flex;
  flex-direction: column;
  gap: 10px;
  height: 100%;
}

.cbti-warning {
  margin-top: 8px;
  padding: 10px;
  background: rgba(255, 149, 0, 0.1);
  border: 1px solid rgba(255, 149, 0, 0.2);
  border-radius: 12px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
}

.cbti-icon {
  font-size: 20px;
  margin-bottom: 4px;
}

.cbti-text {
  font-size: 10px;
  color: rgba(255, 165, 0, 0.9);
  line-height: 1.4;
}

/* PDF Report Screen */
.screen-pdf {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  height: 100%;
}

.pdf-doc {
  width: 120px;
  height: 150px;
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 10px;
  padding: 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.pdf-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 8px;
  font-weight: 600;
  color: var(--renap-purple-bright);
}

.pdf-bars {
  display: flex;
  align-items: flex-end;
  gap: 4px;
  height: 30px;
  margin-top: auto;
}

.pdf-bar {
  flex: 1;
  border-radius: 2px;
  background: var(--renap-purple-bright);
  opacity: 0.6;
}

/* Watch Screen */
.screen-watch {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 100%;
}

.watch-icon {
  width: 60px;
  height: 72px;
  border: 2px solid rgba(255, 255, 255, 0.2);
  border-radius: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.watch-icon svg {
  color: var(--renap-purple-bright);
}

.watch-icon::before {
  content: '';
  position: absolute;
  top: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 4px 4px 0 0;
}

.watch-icon::after {
  content: '';
  position: absolute;
  bottom: -10px;
  left: 50%;
  transform: translateX(-50%);
  width: 20px;
  height: 8px;
  background: rgba(255, 255, 255, 0.15);
  border-radius: 0 0 4px 4px;
}

.data-lines {
  display: flex;
  flex-direction: column;
  gap: 6px;
  width: 100%;
  padding: 0 16px;
}

.data-line {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 10px;
  color: var(--text-secondary);
}

.data-line-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.data-line-bar {
  flex: 1;
  height: 3px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.1);
  overflow: hidden;
}

.data-line-fill {
  height: 100%;
  border-radius: 2px;
}

/* Ela History Screen */
.screen-ela-history {
  display: flex;
  flex-direction: column;
  gap: 8px;
  height: 100%;
}

.thought-entry {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 10px;
  padding: 10px;
}

.thought-date {
  font-size: 9px;
  color: var(--renap-purple-bright);
  font-weight: 600;
  margin-bottom: 4px;
}

.thought-text {
  font-size: 10px;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* Download screen (app icon) */
.screen-appicon {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  height: 100%;
}

.app-icon-display {
  width: 80px;
  height: 80px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--renap-purple-bright) 0%, var(--renap-purple) 50%, var(--renap-deep-purple) 100%);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 36px;
  box-shadow: 0 0 40px rgba(123, 47, 190, 0.4);
}

.app-icon-name {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 700;
}

/* ============================================================
   21. RESPONSIVE BREAKPOINTS
   ============================================================ */

/* Desktop ≥ 1280px — default styles above */

/* Laptop 1024–1279px */
@media (max-width: 1279px) {
  .hero-visual .phone-frame {
    width: 260px;
    --phone-scale: 0.928;
    /* 260px / 280px */
  }

  .hero-visual .phone-frame-real-mockup {
    width: auto;
    height: 520px;
  }

  .feature-visual .phone-frame,
  .download-phone .phone-frame {
    width: 220px;
    --phone-scale: 0.785;
    /* 220px / 280px */
  }

  .feature-visual .phone-frame-real-mockup,
  .download-phone .phone-frame-real-mockup {
    width: auto;
    height: 460px;
  }

  .hero-content {
    gap: 40px;
  }

  /* Prevent stat chips from spilling out on laptop borders */
  .stat-chip:nth-child(1) {
    right: 2%;
  }

  .stat-chip:nth-child(2) {
    right: 1%;
  }

  .stat-chip:nth-child(3) {
    left: 2%;
  }

  .stat-chip:nth-child(4) {
    left: 1%;
  }

  .feature-row {
    gap: 48px;
    margin-bottom: 80px;
  }

  .ela-content {
    gap: 48px;
  }
}

/* Tablet 768–1023px */
@media (max-width: 1023px) {
  :root {
    --section-padding: 80px 0;
  }

  /* Hide the scroll connector line on tablet and below to avoid visual clutter */
  .scroll-line-container {
    display: none;
  }

  /* Collapse desktop nav links earlier (at tablet width) to prevent wrapping */
  .nav-links {
    display: none;
  }

  .nav-hamburger {
    display: flex;
  }

  .hero {
    padding: 130px 0 60px;
    min-height: auto;
  }

  .hero-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 48px;
  }

  .hero-text .text-body {
    margin-left: auto;
    margin-right: auto;
  }

  .hero-ctas {
    justify-content: center;
  }

  .hero-visual {
    max-width: 320px;
    margin: 0 auto;
  }

  .hero-visual .phone-frame {
    width: 240px;
    --phone-scale: 0.857;
    /* 240px / 280px */
  }

  .hero-visual .phone-frame-real-mockup {
    width: auto;
    height: 480px;
  }

  /* Safe positions for chips centered around the hero phone */
  .stat-chip:nth-child(1) {
    right: 2%;
    top: 5%;
  }

  .stat-chip:nth-child(2) {
    right: 0%;
    bottom: 18%;
  }

  .stat-chip:nth-child(3) {
    left: 2%;
    bottom: 8%;
  }

  .stat-chip:nth-child(4) {
    left: 0%;
    top: 12%;
  }

  /* Feature rows collapse to stacked vertical layout on tablet (per design prompt) */
  .feature-row {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
    margin-bottom: 80px;
  }

  .feature-row.reverse {
    direction: ltr;
  }

  .feature-info {
    order: 1;
    padding: 32px;
    max-width: 100%;
    margin: 0 auto;
  }

  .feature-visual {
    order: 2;
  }

  .feature-icon {
    margin: 0 auto 20px;
  }

  .feature-chips,
  .color-legend,
  .genre-swatches {
    justify-content: center;
  }

  .feature-callout {
    display: inline-block;
  }

  .feature-visual .phone-frame {
    width: 240px;
    --phone-scale: 0.857;
    /* 240px / 280px */
  }

  .feature-visual .phone-frame-real-mockup,
  .download-phone .phone-frame-real-mockup {
    width: auto;
    height: 480px;
  }

  .ela-content {
    grid-template-columns: 1fr;
    text-align: center;
    gap: 48px;
  }

  .ela-grid {
    max-width: 500px;
    margin: 0 auto;
  }

  /* Pain points & steps grid padding adjustments for tablet */
  .problem-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .problem-left .section-header {
    text-align: center;
  }

  .pain-stat-card {
    padding: 24px 20px;
  }

  .steps-connecting-line {
    display: none;
  }

  .steps-grid-container {
    margin-top: 40px;
    padding-bottom: 0;
  }

  .steps-grid {
    grid-template-columns: repeat(3, 1fr);
    gap: 20px;
  }

  .step-card {
    padding: 32px 16px;
    transform: none !important;
  }

  #step-card-1:hover,
  #step-card-2:hover,
  #step-card-3:hover {
    transform: translateY(-8px) !important;
  }

  .articles-grid {
    grid-template-columns: 1fr 1fr;
  }

  /* Span footer built-with column across both columns for balance on tablet */
  .footer-grid {
    grid-template-columns: 1fr 1fr;
    gap: 36px;
  }

  #footer-col-tech {
    grid-column: span 2;
  }

  .download-section {
    padding: 100px 0;
  }

  .download-content {
    grid-template-columns: 1fr;
    gap: 48px;
    text-align: center;
    padding: 0 24px;
  }

  .download-text {
    align-items: center;
    text-align: center;
  }

  .download-section .heading-section {
    text-align: center;
  }

  .download-section .text-body {
    text-align: center;
    margin: 0 auto 32px;
  }

  .download-ctas {
    align-items: center;
  }

  .download-phone .phone-frame {
    width: 240px;
    --phone-scale: 0.857;
    /* 240px / 280px */
  }

  .watch-mockup-img {
    height: 220px;
  }

  .download-watch {
    margin-right: 28px;
    margin-top: 60px;
  }
}

/* Mobile L 480–767px */
@media (max-width: 767px) {
  :root {
    --section-padding: 64px 0;
  }

  .hero {
    padding: 110px 0 48px;
  }

  .heading-hero {
    font-size: 48px;
  }

  .hero-visual {
    width: 90%;
    max-width: 300px;
    margin: 0 auto;
  }

  .hero-visual .phone-frame {
    width: 220px;
    height: auto;
    aspect-ratio: 406 / 839;
    --phone-scale: 0.785;
    /* 220px / 280px */
  }

  .hero-visual .phone-frame-real-mockup {
    width: auto;
    height: 440px;
  }

  .stat-chip {
    font-size: 11px;
    padding: 7px 12px;
    border-radius: 12px;
  }

  .stat-chip:nth-child(1) {
    right: 8px;
    top: 2%;
  }

  .stat-chip:nth-child(2) {
    right: 4px;
    bottom: 15%;
  }

  .stat-chip:nth-child(3) {
    left: 8px;
    bottom: 5%;
  }

  .stat-chip:nth-child(4) {
    left: 4px;
    top: 10%;
  }

  .pain-stat-card {
    padding: 22px 16px;
    gap: 16px;
  }

  .feature-row {
    grid-template-columns: 1fr;
    gap: 40px;
    text-align: center;
    margin-bottom: 80px;
  }

  .feature-row.reverse {
    direction: ltr;
  }

  .feature-info {
    order: 1;
    padding: 24px;
    /* Reduced padding on mobile to save screen width */
  }

  .feature-visual {
    order: 2;
  }

  .feature-icon {
    margin: 0 auto 20px;
  }

  .feature-chips,
  .color-legend,
  .genre-swatches {
    justify-content: center;
  }

  .feature-callout {
    display: block;
    text-align: center;
  }

  /* Make phone frames and components scale proportionally */
  .feature-visual .phone-frame {
    width: 220px;
    --phone-scale: 0.785;
    /* 220px / 280px */
  }

  .feature-visual .phone-frame-real-mockup,
  .download-phone .phone-frame-real-mockup {
    width: auto;
    height: 420px;
  }

  .watch-mockup-img {
    height: 220px;
  }

  .download-watch {
    margin-right: 20px;
    margin-top: 50px;
  }

  .phone-frame {
    border-radius: 32px;
  }

  .phone-screenshot {
    border-radius: 30px;
  }

  /* Shrink text sizes inside custom drawn screens so they fit perfectly */
  .phone-screen {
    padding: 44px 12px 12px;
  }

  .data-lines {
    padding: 0 8px;
  }

  .data-line {
    gap: 6px;
    font-size: 9px;
  }

  .steps-grid {
    grid-template-columns: 1fr;
    gap: 24px;
  }

  .step-card {
    padding: 28px 20px;
  }

  .ela-grid {
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }

  .ela-subtitle {
    font-size: 17px;
  }

  .ela-body {
    font-size: 15px;
  }

  .articles-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .article-card {
    padding: 24px;
  }

  .flip-card {
    height: 220px;
  }

  .trust-signals {
    gap: 20px;
  }

  .footer-grid {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  #footer-col-links {
    order: 1;
  }

  #footer-col-tech {
    grid-column: span 1;
    order: 2;
  }

  #footer-col-brand {
    order: 3;
    margin-top: 8px;
  }

  .social-proof-inner {
    font-size: 12px;
    gap: 8px;
  }

  .dual-phones {
    gap: 12px;
  }

  .dual-phones .phone-frame {
    width: 140px;
    height: 290px;
    border-radius: 24px;
  }

  .section-header {
    margin-bottom: 40px;
  }

  .download-app-logo {
    width: 120px;
    height: 120px;
    border-radius: 28px;
  }

  .download-section {
    padding: 80px 0;
  }

  .download-phone .phone-frame {
    width: 220px;
    --phone-scale: 0.785;
    /* 220px / 280px */
  }

  .waveform-bg {
    width: 250px;
    height: 80px;
  }
}

/* Mobile S < 480px */
@media (max-width: 479px) {
  .container {
    padding: 0 16px;
  }

  .nav-inner {
    padding: 0 16px;
    height: 64px;
  }

  .nav-brand {
    font-size: 19px;
  }

  .nav-logo {
    width: 30px;
    height: 30px;
  }

  .hero {
    padding: 96px 0 40px;
  }

  .heading-hero {
    font-size: 40px;
  }

  .hero-text .text-body {
    font-size: 15px;
  }

  .hero-ctas {
    flex-direction: column;
    align-items: stretch;
  }

  #hero-cta-primary {
    display: none !important;
  }

  .hero-ctas .btn {
    text-align: center;
    font-size: 15px;
    padding: 12px 20px;
  }

  .hero-visual {
    width: 85%;
    max-width: 275px;
    margin: 0 auto;
  }

  .hero-visual .phone-frame {
    width: 200px;
    height: auto;
    aspect-ratio: 406 / 839;
    --phone-scale: 0.714;
    /* 200px / 280px */
  }

  .hero-visual .phone-frame-real-mockup {
    width: auto;
    height: 400px;
  }

  .stat-chip {
    font-size: 10px;
    padding: 5px 9px;
    border-radius: 10px;
    gap: 5px;
  }

  .stat-chip:nth-child(1) {
    right: 6px;
    top: 0%;
  }

  .stat-chip:nth-child(2) {
    right: 2px;
    bottom: 12%;
  }

  .stat-chip:nth-child(3) {
    left: 6px;
    bottom: 3%;
  }

  .stat-chip:nth-child(4) {
    left: 2px;
    top: 8%;
  }

  .ela-grid {
    grid-template-columns: 1fr;
  }

  .trust-signals {
    flex-direction: column;
    align-items: center;
    gap: 12px;
  }

  .trust-item {
    font-size: 13px;
  }

  .feature-visual .phone-frame {
    width: 200px;
    --phone-scale: 0.714;
    /* 200px / 280px */
  }

  .feature-visual .phone-frame-real-mockup,
  .download-phone .phone-frame-real-mockup {
    width: auto;
    height: 380px;
  }

  .feature-info {
    padding: 20px;
    /* Even tighter padding to preserve text layout on tiny phones */
  }

  .phone-frame {
    border-radius: 24px;
  }

  .phone-screenshot {
    border-radius: 22px;
  }

  .dual-phones .phone-frame {
    width: 140px;
    height: 290px;
    border-radius: 24px;
  }

  .dual-phones .phone-frame::before {
    width: 60px;
    height: 18px;
  }

  .feature-chip {
    font-size: 12px;
    padding: 5px 10px;
  }

  .section-header .text-body {
    font-size: 15px;
    margin-top: 20px;
    line-height: 1.75;
  }

  .social-proof {
    margin-top: 40px;
    padding: 14px 0;
  }

  .social-proof-inner {
    font-size: 11px;
    gap: 6px;
  }

  .social-proof .dot {
    width: 3px;
    height: 3px;
  }

  .download-app-logo {
    width: 100px;
    height: 100px;
    border-radius: 24px;
  }

  .app-store-badge svg {
    height: 46px;
  }

  .glass-card {
    padding: 24px;
    border-radius: 20px;
  }

  .flip-card {
    height: 240px;
  }

  .footer {
    padding: 40px 0 0;
  }

  .footer-brand {
    font-size: 24px;
    gap: 12px;
    margin-bottom: 12px;
  }

  .footer-logo {
    width: 36px;
    height: 36px;
    border-radius: 9px;
  }

  .footer-tagline {
    font-size: 15px;
    margin-bottom: 20px;
  }

  .footer-bottom {
    padding: 16px 0 16px;
    font-size: 13px;
  }

  .download-phone .phone-frame {
    width: 200px;
    --phone-scale: 0.714;
    /* 200px / 280px */
  }

  .watch-mockup-img {
    height: 180px;
  }
}

/* ============================================================
   22. ULTRA-WIDE & LARGE DISPLAYS (Mac Studio, TVs, 4K Monitors)
   ============================================================ */
@media (min-width: 1600px) {
  :root {
    --container-width: 90vw;
    /* Stretch container fluidly according to screen size */
  }

  /* Increase card sizes and spacing to balance widescreen empty space */
  .feature-info {
    max-width: 680px;
    padding: 64px;
  }

  .hero-text .text-body {
    max-width: 680px;
  }

  /* Proportional scale-up of phone mockups via transform to make pictures adaptive */
  .hero-visual .phone-frame {
    transform: scale(1.15);
    transform-origin: center;
  }

  .hero-visual .phone-frame-real-mockup {
    transform: none;
    height: 620px;
  }

  .feature-visual .phone-frame {
    transform: scale(1.15);
    transform-origin: center;
  }

  .feature-visual .phone-frame-real-mockup,
  .download-phone .phone-frame-real-mockup {
    transform: none;
    height: 560px;
  }

  .download-phone .phone-frame {
    transform: scale(1.15);
    transform-origin: center;
  }

  /* Scale up float animation offsets so they feel proportional to larger sizes */
  @keyframes floatChip {

    0%,
    100% {
      transform: translateY(0) rotate(-1deg) scale(1.15);
    }

    50% {
      transform: translateY(-20px) rotate(2.5deg) scale(1.15);
    }
  }
}

@media (min-width: 2200px) {

  /* 4K TVs and Ultra-Wide Mac displays */
  .feature-info {
    max-width: 840px;
    padding: 80px;
  }

  .hero-text .text-body {
    max-width: 840px;
  }

  .hero-visual .phone-frame {
    transform: scale(1.4);
  }

  .hero-visual .phone-frame-real-mockup {
    transform: none;
    height: 720px;
  }

  .feature-visual .phone-frame {
    transform: scale(1.3);
  }

  .feature-visual .phone-frame-real-mockup,
  .download-phone .phone-frame-real-mockup {
    transform: none;
    height: 640px;
  }

  .download-phone .phone-frame {
    transform: scale(1.3);
  }

  @keyframes floatChip {

    0%,
    100% {
      transform: translateY(0) rotate(-1deg) scale(1.35);
    }

    50% {
      transform: translateY(-25px) rotate(2.5deg) scale(1.35);
    }
  }
}

/* ============================================================
   24. LEGAL PAGES (PRIVACY & TERMS)
   ============================================================ */

.legal-section {
  padding: 140px 0 100px;
}

.legal-header {
  margin-bottom: 48px;
  text-align: left;
}

.legal-header h1 {
  margin-bottom: 16px;
  background: linear-gradient(to right, #ffffff, rgba(255, 255, 255, 0.75));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.legal-header .text-caption {
  color: var(--renap-purple-bright);
}

.legal-layout {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  align-items: start;
}

.legal-layout.no-toc {
  grid-template-columns: 1fr;
}

/* Sticky Sidebar Table of Contents */
.legal-toc {
  position: sticky;
  top: 120px;
  background: rgba(28, 28, 30, 0.4);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border: 0.5px solid rgba(255, 255, 255, 0.08);
  border-radius: 16px;
  padding: 24px;
}

.legal-toc-title {
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--text-secondary);
  margin-bottom: 16px;
  padding-bottom: 12px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.legal-toc ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.legal-toc-link {
  font-size: 14px;
  color: var(--text-secondary);
  transition: all var(--transition-fast);
  display: block;
  padding: 8px 16px;
  border-radius: 8px;
  border: 1px solid transparent;
}

.legal-toc-link:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.04);
  padding-left: 20px;
}

.legal-toc-link.active {
  color: #fff;
  font-weight: 600;
  background: rgba(155, 77, 255, 0.12);
  border-color: rgba(155, 77, 255, 0.25);
  padding-left: 20px;
}

/* Content Area */
.legal-content-card {
  padding: 48px;
  cursor: default !important;
}

/* Ensure no hover animation, translate, or highlights on the legal content card */
.legal-content-card:hover {
  transform: none !important;
  background: var(--surface) !important;
  border-color: var(--surface-border) !important;
}

.legal-content-card::before {
  display: none !important;
}

.legal-content h2 {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  margin-top: 36px;
  margin-bottom: 16px;
  color: #fff;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
  padding-bottom: 8px;
}

.legal-content h2:first-of-type {
  margin-top: 0;
}

.legal-content h3 {
  font-family: var(--font-display);
  font-size: 18px;
  font-weight: 600;
  margin-top: 24px;
  margin-bottom: 12px;
  color: rgba(255, 255, 255, 0.9);
}

.legal-content p {
  font-size: 16px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 20px;
}

.legal-content ul,
.legal-content ol {
  margin-bottom: 24px;
  padding-left: 20px;
}

.legal-content ul {
  list-style-type: disc;
}

.legal-content ol {
  list-style-type: decimal;
}

.legal-content li {
  font-size: 16px;
  line-height: 1.75;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 8px;
}

.legal-content strong {
  color: #fff;
}

.legal-content a {
  color: var(--renap-purple-bright);
  text-decoration: underline;
  transition: color var(--transition-fast);
}

.legal-content a:hover {
  color: #fff;
}

.legal-content code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background: rgba(123, 47, 190, 0.15);
  border: 1px solid rgba(155, 77, 255, 0.25);
  padding: 2px 6px;
  border-radius: 6px;
  color: #e0d0ff;
}

.legal-content blockquote,
.legal-content .legal-callout {
  background: rgba(123, 47, 190, 0.08);
  border-left: 3px solid var(--renap-purple-bright);
  border-radius: 0 12px 12px 0;
  padding: 16px 20px;
  margin: 20px 0;
}

.legal-content blockquote p,
.legal-content .legal-callout p {
  margin-bottom: 0;
  color: rgba(255, 255, 255, 0.85);
}

.legal-footer {
  margin-top: 48px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 14px;
  color: var(--text-secondary);
}

/* Back navigation button */
.btn-back {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  border: 1.5px solid rgba(255, 255, 255, 0.1);
  border-radius: 9999px;
  padding: 8px 18px;
  transition: all var(--transition-fast);
  margin-bottom: 32px;
  cursor: pointer;
}

.btn-back:hover {
  color: #fff;
  background: rgba(255, 255, 255, 0.05);
  border-color: rgba(255, 255, 255, 0.25);
  transform: translateX(-2px);
}

/* Responsive Styles for Legal Sections */
@media (max-width: 1023px) {
  .legal-layout {
    grid-template-columns: 1fr;
    gap: 32px;
  }

  .legal-toc {
    position: sticky;
    top: 72px;
    /* stays directly below fixed navbar */
    z-index: 900;
    padding: 12px 4vw;
    margin: 0 -4vw;
    /* bleed to screen edge */
    background: rgba(18, 18, 20, 0.9);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 0;
    border-left: none;
    border-right: none;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .legal-toc::-webkit-scrollbar {
    display: none;
  }

  .legal-toc-title {
    display: none;
  }

  .legal-toc ul {
    flex-direction: row;
    flex-wrap: nowrap;
    gap: 8px;
    width: max-content;
  }

  .legal-toc-link {
    font-size: 13px;
    padding: 6px 14px;
    border-radius: 9999px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.08);
  }

  .legal-toc-link:hover {
    background: rgba(255, 255, 255, 0.1);
    padding-left: 14px;
  }

  .legal-toc-link.active {
    background: var(--renap-purple-bright);
    border-color: transparent;
    padding-left: 14px;
    box-shadow: 0 4px 12px rgba(155, 77, 255, 0.35);
  }
}

@media (max-width: 767px) {
  .legal-section {
    padding: 100px 0 60px;
  }

  .legal-content-card {
    padding: 24px;
  }

  .legal-content h2 {
    font-size: 20px;
    margin-top: 28px;
  }

  .legal-content h3 {
    font-size: 16px;
    margin-top: 20px;
  }

  .legal-content p,
  .legal-content li {
    font-size: 15px;
    line-height: 1.65;
    overflow-wrap: break-word;
  }

  .legal-content blockquote,
  .legal-content .legal-callout {
    padding: 14px 16px;
    margin: 16px 0;
  }

  .legal-content code {
    word-break: break-word;
  }
}

/* ============================================================
   10. CUSTOM COMET STAR CURSOR
   ============================================================ */
@media (hover: hover) and (pointer: fine) {

  html,
  body,
  a,
  button,
  [role="button"],
  input,
  select,
  textarea,
  label {
    cursor: none !important;
  }

  .custom-cursor-container {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 999999999;
    overflow: hidden;
  }

  .comet-head {
    position: absolute;
    width: 32px;
    height: 32px;
    transform: translate3d(-50%, -50%, 0) scale(1);
    pointer-events: none;
    color: #ffffff;
    filter: drop-shadow(0 0 4px var(--renap-purple-bright)) drop-shadow(0 0 10px rgba(155, 77, 255, 0.8)) drop-shadow(0 0 20px rgba(255, 255, 255, 0.5));
    z-index: 1000000000;
    display: flex;
    align-items: center;
    justify-content: center;
    will-change: transform;
    opacity: 0;
    transition: opacity 0.3s ease, transform 0.1s cubic-bezier(0.25, 1, 0.5, 1);
  }

  .comet-head.visible {
    opacity: 1;
  }

  .comet-head.clicking {
    transform: translate3d(-50%, -50%, 0) scale(0.8) !important;
  }

  .comet-head.hovering-link {
    transform: translate3d(15px, -15px, 0) translate(-50%, -50%) scale(0.3) !important;
    filter: drop-shadow(0 0 4px var(--renap-purple-bright)) drop-shadow(0 0 10px rgba(155, 77, 255, 0.8));
  }

  .comet-head svg {
    width: 100%;
    height: 100%;
    display: block;
  }

  .comet-tail-particle {
    position: absolute;
    width: 16px;
    height: 16px;
    transform: translate3d(-50%, -50%, 0);
    pointer-events: none;
    z-index: 999999999;
    will-change: transform, opacity;
    opacity: 1;
    animation: fade-shrink-star 0.7s cubic-bezier(0.1, 0.8, 0.25, 1) forwards;
  }

  .comet-tail-particle svg {
    width: 100%;
    height: 100%;
    display: block;
  }
}

@keyframes fade-shrink-star {
  0% {
    transform: translate3d(-50%, -50%, 0) scale(1) rotate(0deg);
    opacity: 1;
  }

  50% {
    opacity: 0.8;
  }

  100% {
    transform: translate3d(-50%, -50%, 0) scale(0.1) rotate(90deg);
    opacity: 0;
  }
}

/* ============================================================
   11. POPUP MODAL STYLES
   ============================================================ */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  z-index: 10000000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

.modal-card {
  background: rgba(28, 28, 30, 0.7);
  border: 1px solid rgba(155, 77, 255, 0.25);
  border-radius: 24px;
  padding: 40px;
  max-width: 580px;
  width: 90%;
  text-align: center;
  position: relative;
  box-shadow: 0 20px 50px rgba(155, 77, 255, 0.3);
  transform: scale(0.9);
  transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.modal-overlay.open .modal-card {
  transform: scale(1);
}

.modal-close {
  position: absolute;
  top: 20px;
  right: 20px;
  font-size: 24px;
  color: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: color 0.2s ease;
  line-height: 1;
}

.modal-close:hover {
  color: #fff;
}

.modal-icon {
  font-size: 48px;
  margin-bottom: 16px;
}

.modal-title {
  font-family: var(--font-display);
  font-size: 24px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 16px;
}

.modal-text {
  font-size: 15px;
  line-height: 1.6;
  color: rgba(255, 255, 255, 0.88);
  margin-bottom: 24px;
}

.modal-text p {
  margin-bottom: 14px;
}

.modal-text p:last-child {
  margin-bottom: 0;
}

.modal-btn {
  width: 100%;
  padding: 12px 24px;
  font-size: 15px;
  font-weight: 600;
}

/* ============================================================
   12. WORD HOVER HIGHLIGHT STYLES
   ============================================================ */
.hover-word {
  display: inline-block;
  transition: color 0.05s ease-out, transform 0.08s ease-out;
}

.text-purple {
  color: var(--renap-purple-bright);
  font-weight: 600;
}

/* ============================================================
   23. PREMIUM PRELOADER / SPLASH SCREEN
   ============================================================ */
#preloader {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-color: #05020a;
  z-index: 99999;
  display: flex;
  justify-content: center;
  align-items: center;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.6s ease;
  opacity: 1;
  visibility: visible;
}

#preloader.fade-out {
  opacity: 0;
  visibility: hidden;
}

.preloader-content {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 20px;
}

.preloader-logo {
  width: 96px;
  height: 96px;
  border-radius: 24px;
  border: 2px solid rgba(155, 77, 255, 0.4);
  box-shadow: 0 0 40px rgba(155, 77, 255, 0.3);
  animation: preloaderPulse 2s ease-in-out infinite;
}

.preloader-title {
  font-family: var(--font-display);
  font-size: clamp(22px, 4vw, 32px);
  font-weight: 700;
  color: #fff;
  letter-spacing: -0.02em;
  opacity: 0;
  transform: translateY(10px);
  animation: preloaderTextIn 0.8s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: 0.3s;
}

.preloader-spinner-bar {
  width: 120px;
  height: 3px;
  background: rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  overflow: hidden;
}

.preloader-spinner-progress {
  width: 0%;
  height: 100%;
  background: linear-gradient(90deg, var(--renap-purple) 0%, var(--renap-purple-bright) 100%);
  border-radius: 10px;
  animation: preloaderProgress 2.2s cubic-bezier(0.4, 0, 0.2, 1) forwards;
  animation-delay: 0.3s;
}

/* Animations */
@keyframes preloaderPulse {
  0%, 100% {
    transform: scale(1);
    box-shadow: 0 0 30px rgba(155, 77, 255, 0.3);
    border-color: rgba(155, 77, 255, 0.4);
  }
  50% {
    transform: scale(1.04);
    box-shadow: 0 0 50px rgba(155, 77, 255, 0.55), 0 0 20px rgba(155, 77, 255, 0.2);
    border-color: rgba(155, 77, 255, 0.8);
  }
}

@keyframes preloaderTextIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes preloaderProgress {
  to {
    width: 100%;
  }
}