/*
Theme Name: OnePage Theme
Text Domain: onepage-theme
Version: 1.0.0
Description: Clean, responsive one-page WordPress theme for Eve Coaching.
Author: You
*/

:root {
  /* Colors from source site */
  --color-base: #ffffff; /* base */
  --color-contrast: #111111; /* contrast */
  --color-accent-1: #273347; /* accent yellow */
  --color-accent-2: #f6cff4; /* accent light magenta */
  --color-accent-3: #503aa8; /* primary purple */
  --color-accent-4: #686868; /* subtle gray for outlines/focus */
  --color-accent-5: #fbfaf3; /* light background */
  --color-muted: #5f5f5f;

  /* Fluid Layout Variables */
  --container: clamp(20rem, 90vw, 75rem);
  --gap: clamp(1rem, 2.5vw, 2rem);
  --radius: clamp(0.5rem, 1.5vw, 1rem);
  --shadow: 0 clamp(0.5rem, 2vw, 1.5rem) clamp(1rem, 4vw, 2rem)
    rgba(0, 0, 0, 0.06);
  --header-offset: clamp(4rem, 8vh, 6rem);

  /* Fluid Typography */
  --text-xs: clamp(0.75rem, 1.5vw, 0.875rem);
  --text-sm: clamp(0.875rem, 2vw, 1rem);
  --text-base: clamp(1rem, 2.5vw, 1.125rem);
  --text-lg: clamp(1.125rem, 3vw, 1.25rem);
  --text-2xl: clamp(1.5rem, 4vw, 2rem);
  --text-3xl: clamp(1.875rem, 5vw, 2.5rem);

  /* Fluid Spacing */
  --space-xs: clamp(0.25rem, 1vw, 0.5rem);
  --space-sm: clamp(0.5rem, 2vw, 1rem);
  --space-md: clamp(1rem, 3vw, 1.5rem);
  --space-lg: clamp(1.5rem, 4vw, 2.5rem);
  --space-xl: clamp(2rem, 5vw, 4rem);
  --space-2xl: clamp(3rem, 8vw, 6rem);
}

/* iPad-only: stack actions and keep bio inline to fix vertical overlay */
@media (min-width: 769px) and (max-width: 1024px) {
  .hero-actions {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-sm);
    width: 100%;
  }
  .bio-panel {
    position: static;
    max-width: 100%;
    width: 100%;
    margin: 0;
    margin-top: var(--space-sm);
  }
  .bio-panel[open] {
    position: static;
    max-height: none;
    overflow: visible;
  }
  .bio-summary {
    position: static;
  }
}

/* FINAL OVERRIDES: Desktop (≥1025px) restore canonical layout */
@media (min-width: 1025px) {
  .hero-image-container {
    aspect-ratio: 16/9 !important;
    height: auto !important;
  }
  .hero-image-overlay {
    position: absolute !important;
    top: 0; left: 0; right: 0; bottom: 0;
    display: flex !important;
    align-items: center !important;
    justify-content: space-between !important;
    padding: var(--space-lg) !important;
  }
  .dynamic-text-container {
    max-width: clamp(520px, 45vw, 680px) !important;
  }
  .hero-actions {
    display: flex !important;
    flex-direction: row !important;
    align-items: center !important;
    justify-content: space-between !important;
    gap: var(--space-sm) !important;
    width: auto !important;
    margin-top: 0 !important;
  }
  .bio-panel,
  .bio-panel[open] {
    position: static !important;
    max-width: min(520px, 42vw) !important;
    width: auto !important;
    align-self: auto !important;
    margin: 0 !important;
    max-height: clamp(220px, 40vh, 420px) !important;
    overflow: auto !important;
    padding-top: 0 !important;
  }
  .bio-summary {
    position: sticky !important;
    top: 0 !important; /* sticky within panel only */
  }
}

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

html {
  scroll-behavior: smooth;
}

body {
  font-family: system-ui, -apple-system, sans-serif;
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-contrast);
  background-color: transparent;
}

/* Container */
.container {
  width: var(--container);
  margin: 0 auto;
  padding: 0 var(--gap);
}

/* Typography */
h1 { font-size: var(--text-4xl); margin-bottom: var(--space-lg); }
h2 { font-size: var(--text-3xl); margin-bottom: var(--space-md); }
h3 { font-size: var(--text-2xl); margin-bottom: var(--space-md); }
h4 { font-size: var(--text-xl); margin-bottom: var(--space-sm); }
h5 { font-size: var(--text-lg); margin-bottom: var(--space-sm); }
h6 { font-size: var(--text-base); margin-bottom: var(--space-sm); }

p { margin-bottom: var(--space-md); }
small { font-size: var(--text-sm); }

/* Layout Components */
.section {
  padding: var(--space-xl) 0;
}

.card {
  background: var(--color-base);
  border-radius: var(--radius);
  padding: var(--space-lg);
  box-shadow: var(--shadow);
}

.grid {
  display: grid;
  gap: var(--gap);
}

.grid-2 { grid-template-columns: repeat(auto-fit, minmax(20rem, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }

.flex {
  display: flex;
  gap: var(--gap);
}

.flex-center { align-items: center; justify-content: center; }
.flex-between { justify-content: space-between; }
.flex-wrap { flex-wrap: wrap; }

/* Buttons */
.btn {
  display: inline-block;
  padding: var(--space-sm) var(--space-lg);
  border: none;
  border-radius: var(--radius);
  font-size: var(--text-base);
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn-primary {
  background: var(--color-accent-3);
  color: var(--color-base);
}

.btn-primary:hover {
  background: var(--color-accent-1);
  color: var(--color-contrast);
}

.btn-secondary {
  background: var(--color-accent-5);
  color: var(--color-contrast);
  border: 1px solid var(--color-accent-4);
}

/* Utilities */
.text-center { text-align: center; }
.text-muted { color: var(--color-muted); }
.bg-light { background-color: var(--color-accent-5); }
.bg-accent { background-color: var(--color-accent-2); }

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

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

/* Responsive Images */
img {
  max-width: 100%;
  height: auto;
}

/* Focus States */
*:focus-visible {
  outline: 2px solid var(--color-accent-3);
  outline-offset: 2px;
}

/* Header */
.site-header {
  width: 100%;
  background: var(--color-accent-1);
  border-bottom: 0 !important;
  position: sticky;
  top: 0;
  z-index: 100;
  box-shadow: 
    0 4px 12px rgba(0, 0, 0, 0.15),
    0 2px 4px rgba(0, 0, 0, 0.1);
  position: relative;
  margin-bottom: 0; /* prevent gap under sticky header */
}

/* Solid extension to cover any subpixel seam while scrolling */
/* Remove solid extension to avoid color seam with hero gradient */
.site-header::before { display: none; }

.site-header::after {
  content: '';
  position: absolute;
  bottom: -6px;
  left: 0;
  right: 0;
  height: 6px;
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0.8) 0%,
    rgba(255, 255, 255, 0.4) 50%,
    transparent 100%
  );
  border-radius: 0 0 clamp(0.5rem, 1vw, 1rem) clamp(0.5rem, 1vw, 1rem);
}

/* Desktop: remove decorative underline and border to avoid visible gap */
@media (min-width: 769px) {
  .site-header {
    border-bottom: none;
    box-shadow: none; /* remove shadow that can appear as a thin line */
  }
  .site-header::after {
    display: none;
  }

  /* Desktop/tablet: when bio is open, keep controls visible under sticky header */
  .bio-panel[open] {
    padding-top: calc(var(--header-offset) + env(safe-area-inset-top));
  }
  .bio-summary {
    position: sticky;
    top: calc(var(--header-offset) + env(safe-area-inset-top));
    z-index: 2;
    padding: 0 env(safe-area-inset-left) 0 env(safe-area-inset-right);
  }
}

.site-header .container {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-sm) var(--gap);
  min-height: 0;
  position: relative;
}

.site-branding {
  flex-shrink: 0;
}

.site-branding img {
  height: clamp(9.5rem, 24vw, 15rem);
  width: auto;
  max-width: 850px;
  background: rgba(255, 255, 255, 0.95);
  padding: clamp(0.0625rem, 0.25vw, 0.125rem);
  border-radius: clamp(0.25rem, 0.5vw, 0.5rem);
  box-shadow: 
    inset 0 2px 4px rgba(0, 0, 0, 0.2),
    inset 0 -1px 2px rgba(255, 255, 255, 0.3),
    inset 2px 0 4px rgba(0, 0, 0, 0.1),
    inset -2px 0 4px rgba(0, 0, 0, 0.1);
  transition: all 0.3s ease;
  filter: contrast(1.1) brightness(1.05);
  border: 1px solid rgba(0, 0, 0, 0.1);
}

.site-branding img:hover {
  background: rgba(255, 255, 255, 1);
  box-shadow: 
    inset 0 3px 6px rgba(0, 0, 0, 0.25),
    inset 0 -1px 3px rgba(255, 255, 255, 0.4),
    inset 3px 0 6px rgba(0, 0, 0, 0.15),
    inset -3px 0 6px rgba(0, 0, 0, 0.15);
  transform: scale(1.01);
  border: 1px solid rgba(0, 0, 0, 0.15);
}

@media (max-width: 480px) {
  .site-branding img {
    min-height: 8.5rem;
    background: rgba(255, 255, 255, 0.98);
    padding: clamp(0.0625rem, 0.5vw, 0.125rem);
  }
}

.primary-nav {
  flex-shrink: 1;
  min-width: 0;
  position: absolute;
  right: var(--gap);
  top: 50%;
  transform: translateY(-50%);
}

.primary-nav .menu {
  display: flex;
  list-style: none;
  gap: var(--space-sm);
  flex-wrap: wrap;
  justify-content: flex-end;
}

.primary-nav .menu a {
  color: var(--color-contrast);
  text-decoration: none;
  font-size: var(--text-sm);
  transition: color 0.2s ease;
  white-space: nowrap;
}

.primary-nav .menu a:hover {
  color: var(--color-accent-3);
}

@media (max-width: 768px) {
  .site-header .container {
    flex-wrap: wrap;
    gap: var(--space-sm);
  }
  
  .site-branding {
    order: 1;
  }
  
  .primary-nav {
    order: 2;
    width: 100%;
  }
  
  .primary-nav .menu {
    justify-content: center;
    gap: var(--space-xs);
  }
}

/* Video Section */
.hero-video-section {
  padding: var(--space-lg) 0;
  scroll-margin-top: calc(var(--header-offset) + var(--space-md));
}

.hero-video-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

/* Ensure video never exceeds viewport */
@media (max-width: 768px) {
  .hero-video-container {
    aspect-ratio: 16/9;
    max-height: 50vh;
  }
}

@media (max-height: 600px) {
  .hero-video-container {
    max-height: 40vh;
  }
}

/* Services Section */
.service-icon-wrapper {
  width: 100%;
  height: 200px;
  overflow: hidden;
  border-radius: var(--radius);
  display: flex;
  align-items: center;
  justify-content: center;
}

.service-icon {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: var(--radius);
}

@media (max-width: 768px) {
  .service-icon-wrapper {
    height: 150px;
  }
}

/* Large desktop: slightly taller service images to reduce cropping */
@media (min-width: 992px) {
  .service-icon-wrapper {
    /* Responsive 16:9 ratio on large screens */
    aspect-ratio: 16 / 9;
    height: auto;
    background: transparent;
  }
  .service-icon {
    /* Full-bleed cover with safer focal point (centered, slightly higher) */
    object-fit: cover;
    object-position: 50% 30%;
  }
}

/* Service Animation */
.service-section {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.6s ease-out, transform 0.6s ease-out;
}

.service-section.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.service-section:nth-child(even) {
  transform: translateY(30px) translateX(-20px);
}

.service-section:nth-child(odd) {
  transform: translateY(30px) translateX(20px);
}

.service-section.animate-in:nth-child(even),
.service-section.animate-in:nth-child(odd) {
  transform: translateY(0) translateX(0);
}

/* Staggered animation delay */
.service-section:nth-child(1) { transition-delay: 0.1s; }
.service-section:nth-child(2) { transition-delay: 0.2s; }
.service-section:nth-child(3) { transition-delay: 0.3s; }
.service-section:nth-child(4) { transition-delay: 0.4s; }
.service-section:nth-child(5) { transition-delay: 0.5s; }

/* Partners Section */
.partners-section {
  padding: var(--space-2xl) 0;
  background: var(--color-base);
}

.partners-logos {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: var(--space-lg);
  row-gap: var(--space-md);
}

.partner-logo {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 80px;
  padding: var(--space-sm);
  background: var(--color-base);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.partner-logo img {
  max-height: clamp(50px, 8vw, 80px);
  max-width: clamp(120px, 20vw, 200px);
  width: auto;
  height: auto;
  object-fit: contain;
  transition: all 0.3s ease;
}

.partner-logo img:hover {
  transform: translateY(-3px) scale(1.05);
}

@media (max-width: 768px) {
  .partners-logos {
    gap: var(--space-md);
    row-gap: var(--space-sm);
  }
  
  .partner-logo {
    min-height: 60px;
    padding: var(--space-xs);
  }
  
  .partner-logo img {
    max-height: clamp(40px, 10vw, 60px);
    max-width: clamp(100px, 25vw, 150px);
  }
}

@media (max-width: 480px) {
  .partners-logos {
    flex-direction: column;
    gap: var(--space-sm);
  }
  
  .partner-logo img {
    max-height: 50px;
    max-width: 140px;
  }
}

/* Hero Section */
.hero-section {
  height: calc(100vh - var(--header-offset));
  max-height: calc(100vh - var(--header-offset));
  display: flex;
  align-items: center;
  position: relative;
  overflow: hidden;
  box-sizing: border-box;
  padding-top: 0; /* remove top spacing under header */
  margin-top: -1px; /* hairline fix for subpixel gaps on some browsers */
  background-clip: padding-box; /* avoid background bleeding causing a seam */
}

/* Hero-side seam mask (covers any dynamic gap while scrolling) */
.hero-section::before {
  content: '';
  position: absolute;
  top: -2px;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--color-accent-1); /* match header color */
  z-index: 2; /* above hero background (z-index:1), below header */
  pointer-events: none;
}

.hero-content {
  width: 100%;
  position: relative;
  z-index: 2;
}

/* Ensure no top margin collapses create a gap */
.hero-section > .container,
.hero-section .hero-title {
  margin-top: 0;
}

/* Hero Background */
.hero-background-animated {
  position: absolute;
  top: -2px; /* extend under header to avoid seam */
  left: 0;
  width: 100%;
  height: calc(100% + 2px);
  z-index: 1;
}

.gradient-overlay {
  position: absolute;
  top: -2px; /* extend under header to avoid seam */
  left: 0;
  width: 100%;
  height: calc(100% + 2px);
  background: #503AA8;
  background: linear-gradient(90deg, rgba(80, 58, 168, 1) 0%, rgba(87, 89, 199, 1) 50%, rgba(214, 83, 237, 1) 100%);
  z-index: 1;
}

/* Hero Title Styling */
.hero-title {
  font-size: clamp(3rem, 8vw, 5rem) !important;
  font-weight: 800;
  color: var(--color-base);
  text-shadow: 
    0 2px 8px rgba(0, 0, 0, 0.8),
    0 4px 16px rgba(0, 0, 0, 0.5);
  letter-spacing: -0.02em;
  line-height: 1.1;
  margin-bottom: var(--space-lg) !important;
}

@media (max-width: 768px) {
  .hero-title {
    font-size: clamp(2.5rem, 10vw, 3.5rem) !important;
  }
}

/* Hero Button Styling */
.hero-buttons .btn {
  font-size: var(--text-lg);
  font-weight: 600;
  padding: var(--space-md) var(--space-xl);
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-accent-3);
  border: 2px solid rgba(255, 255, 255, 0.3);
  text-shadow: none;
  box-shadow: 
    0 4px 16px rgba(0, 0, 0, 0.2),
    0 0 0 1px rgba(255, 255, 255, 0.1);
  transition: all 0.3s ease;
  backdrop-filter: blur(10px);
}

.hero-buttons .btn:hover {
  background: var(--color-base);
  color: var(--color-accent-3);
  border-color: rgba(255, 255, 255, 0.5);
  transform: translateY(-2px);
  box-shadow: 
    0 8px 24px rgba(0, 0, 0, 0.3),
    0 0 0 1px rgba(255, 255, 255, 0.2);
}

/* Hero Image Section */
.hero-image-section {
  padding: var(--space-lg) 0;
  scroll-margin-top: calc(var(--header-offset) + var(--space-md));
}

.hero-image-container {
  position: relative;
  width: 100%;
  max-width: 100%;
  aspect-ratio: 16/9;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: var(--color-accent-1);
  background: linear-gradient(135deg, var(--color-accent-1) 0%, var(--color-accent-3) 100%);
}

/* Dynamic Text Overlay */
.hero-image-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  z-index: 2;
}

.dynamic-text-container {
  text-align: left;
  color: var(--color-base);
  max-width: 600px;
  padding: var(--space-lg);
}

/* Center CTA and tighten spacing under the text */
.dynamic-cta {
  display: flex;
  justify-content: center;
  margin-top: 0; /* pull CTA closer to text */
}

/* Desktop: nudge CTA a bit higher to make room for bio button */
@media (min-width: 769px) {
  /* Desktop layout: space items across and align to bottom */
  .hero-image-overlay {
    position: relative;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
    padding: var(--space-lg);
  }
  /* Make text block a column so CTA can sit at the bottom */
  .dynamic-text-container {
    position: static;
    display: flex;
    flex-direction: column;
    max-width: clamp(520px, 45vw, 680px);
  }
  /* New actions row: CTA (left) + Bio (right) */
  .hero-actions {
    display: flex;
    justify-content: space-between;
    align-items: center; /* centers vertically both controls */
    gap: var(--space-lg);
    width: 100%;
    margin-top: auto; /* push to bottom of overlay */
  }
  .dynamic-cta {
    margin-top: auto;               /* push CTA to bottom of text column */
    position: static;               /* reset absolute */
    left: auto;
    bottom: auto;
    justify-content: flex-start;    /* align left within its column */
  }
  .typewriter-container {
    margin-bottom: 0; /* remove gap under typewriter on desktop */
  }
  .dynamic-subtitle { margin-bottom: 0.15rem; }
  .typewriter-description { margin-top: 0.15rem; }

  /* Bio trigger participates in flex layout on the right */
  .bio-panel {
    position: static;      /* reset absolute */
    margin: 0;
    align-self: auto;      /* baseline controlled by hero-actions */
    max-width: min(520px, 42vw);
  }
}
/* Bio Panel (collapsible details) */
.bio-panel {
  position: absolute;
  right: var(--space-lg);
  bottom: var(--space-2xl); /* default for non-desktop contexts where not overridden */
  max-width: min(520px, 42vw);
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-contrast);
  border: 1px solid rgba(255, 255, 255, 0.55);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(0,0,0,0.25), 0 2px 8px rgba(0,0,0,0.15);
  backdrop-filter: blur(10px);
  overflow: hidden;
  z-index: 10; /* ensure above overlay text for click */
}

/* Ensure opening the panel scrolls it below sticky header */
.bio-panel {
  scroll-margin-top: calc(var(--header-offset) + var(--space-sm));
}

.bio-summary {
  list-style: none;
  cursor: pointer;
  padding: var(--space-sm) var(--space-md);
  display: flex;
  align-items: center;
}

/* Ensure the entire summary area is clickable and not blocked */
.bio-summary,
.bio-summary * {
  pointer-events: auto;
}

.bio-summary::-webkit-details-marker { display: none; }
.bio-summary::marker { display: none; }

.bio-summary-content {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: var(--space-sm);
  align-items: center;
}

.bio-avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-weight: 700;
  color: #fff;
  background: linear-gradient(135deg, var(--color-accent-3), #d653ed);
  box-shadow: 0 4px 12px rgba(0,0,0,0.2);
}

.bio-meta {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.bio-name { font-size: var(--text-base); }
.bio-time { color: var(--color-muted); }

.bio-toggle {
  font-size: var(--text-sm);
  color: var(--color-accent-3);
  white-space: nowrap;
}

/* Replace visible label text using a pseudo-element so it can change on open */
.bio-summary .bio-toggle {
  position: relative;
  color: transparent; /* hide original text, aria-hidden already set in markup */
}
.bio-summary .bio-toggle::after {
  content: attr(data-read);
  color: var(--color-accent-3);
}
.bio-panel[open] .bio-summary .bio-toggle::after {
  content: attr(data-close);
}

.bio-content {
  padding: 0 var(--space-md) var(--space-md);
  border-top: 1px solid rgba(0,0,0,0.06);
  max-height: clamp(220px, 40vh, 420px);
  overflow: auto;
}

.bio-content p { margin: var(--space-sm) 0; }

.bio-list {
  margin: var(--space-sm) 0 0 1.25rem;
  padding: 0;
}

.bio-list li {
  margin-bottom: 0.35rem;
}

/* Dynamic Title Animation */
.dynamic-title {
  font-size: clamp(2.5rem, 6vw, 4rem);
  font-weight: 800;
  margin-bottom: var(--space-md);
  line-height: 1.2;
}

.text-line {
  display: block;
  opacity: 0;
  transform: translateY(30px);
  animation: slideInUp 0.8s ease-out forwards;
}

.text-line:nth-child(1) {
  animation-delay: 0.3s;
}

.text-line:nth-child(2) {
  animation-delay: 0.6s;
}

.text-line.highlight {
  background: linear-gradient(45deg, #f6cff4, #503aa8);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* Typewriter Effect */
.typewriter {
  font-size: var(--text-lg);
  margin-bottom: var(--space-lg);
  opacity: 0;
}

/* Desktop typewriter effect */
@media (min-width: 769px) {
  .typewriter {
    /* Disable any cursor line and allow wrapping */
    border-right: none !important;
    white-space: normal;
  }
  
  .typewriter.typing-complete {
    border-right: none;
  }
}

/* Fade in up animation for CTA */
.fade-in-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeInUp 0.6s ease-out 2s forwards;
}

/* Desktop CTA timing - after typewriter completes */
@media (min-width: 769px) {
  .fade-in-up {
    animation: fadeInUp 0.6s ease-out 6.5s forwards;
  }
}

.btn-overlay {
  background: rgba(255, 255, 255, 0.9);
  color: var(--color-accent-3);
  border: 2px solid rgba(255, 255, 255, 0.3);
  backdrop-filter: blur(10px);
  font-weight: 600;
  padding: var(--space-md) var(--space-xl);
  transition: all 0.3s ease;
}

.btn-overlay:hover {
  background: var(--color-base);
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
}

/* Keyframe Animations */
@keyframes slideInUp {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@keyframes typing {
  from {
    width: 0;
  }
  to {
    width: 100%;
  }
}

@keyframes blink {
  0%, 50% {
    border-color: var(--color-base);
  }
  51%, 100% {
    border-color: transparent;
  }
}

/* Typewriter container and text styling */
.dynamic-text-container {
    text-align: left;
    z-index: 2;
    position: relative;
}

.typewriter-container {
    margin-bottom: var(--space-sm); /* reduce gap so CTA sits higher */
}

/* Layout row for avatar + typewriter text */
.typewriter-row {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-rows: auto auto;
  column-gap: clamp(0.75rem, 2vw, 1rem);
  row-gap: 0.25rem;
  align-items: start;
}

/* Eve avatar styling */
.typewriter-avatar {
  width: clamp(56px, 8vw, 76px);
  height: clamp(56px, 8vw, 76px);
  border-radius: 50%;
  object-fit: cover;
  flex-shrink: 0;
  border: 3px solid rgba(255,255,255,0.85);
  box-shadow: 0 6px 18px rgba(0,0,0,0.25);
  grid-row: 1 / span 2; /* occupy top-left next to both lines */
}

.dynamic-subtitle {
    font-size: clamp(1.2rem, 3vw, 1.8rem);
    color: var(--text-light);
    margin-bottom: 0.25rem; /* tighter spacing between lines */
    opacity: 0;
    line-height: 1.3;
}

.typewriter-description {
  font-size: clamp(0.85rem, 2.2vw, 1rem);
  font-style: italic;
  color: rgba(255,255,255,0.9);
  opacity: 0.95;
  margin-top: 0.25rem;
}

/* Disable cursor entirely for dynamic subtitles */
.dynamic-subtitle::after,
.dynamic-subtitle.typing::after {
    display: none !important;
    content: none !important;
}

/* Removed blink-cursor animation as cursor is disabled */

/* Mobile responsive adjustments */
@media (max-width: 768px) {
    .dynamic-subtitle {
        white-space: normal;
        word-wrap: break-word;
        margin-bottom: 0.4rem; /* tighter spacing on mobile */
        font-size: clamp(1rem, 4.5vw, 1.25rem);
        line-height: 1.25;
    }
    
    .typewriter-container {
        margin-bottom: 1rem;
    }
    
    .typewriter-row {
      grid-template-columns: auto 1fr;
      align-items: start;
    }
    
    .typewriter-avatar {
      width: 44px;
      height: 44px;
      border-width: 2px;
    }

    .typewriter-description {
      font-size: clamp(0.8rem, 3.5vw, 0.95rem);
      margin-top: 0.15rem;
    }
}

/* Mobile Responsiveness */
@media (max-width: 768px) {
  .hero-image-container {
    aspect-ratio: auto; /* allow natural height based on content */
    max-height: none;   /* remove height cap to avoid clipping */
    min-height: auto;   /* let content define height to avoid cutting off bio */
    overflow: visible;  /* ensure children can extend if needed */
  }
  
  /* Stack overlay content vertically so bio panel doesn't split viewport */
  .hero-image-overlay {
    position: static;   /* participate in normal flow on mobile */
    height: auto;       /* grow with content */
    flex-direction: column;
    align-items: stretch;
    justify-content: flex-start;
    padding: var(--space-sm);
    padding-bottom: calc(var(--space-xl) + env(safe-area-inset-bottom)); /* ensure space for bio trigger */
    overflow-y: visible; /* allow page to scroll instead of inner container */
    gap: 0; /* no spacing between blocks */
  }
  
  .dynamic-text-container {
    padding: var(--space-sm); /* base */
    padding-top: 0; /* move text higher */
    margin-top: -0.125rem; /* tiny nudge upward */
    text-align: left;
    width: 100%;
    max-width: 100%;
  }
  
  /* Pull CTA even closer to text on mobile */
  .dynamic-cta { margin-top: calc(-1 * var(--space-xs)); margin-bottom: 0; }
  .typewriter-container { margin-bottom: var(--space-xs); }
  .dynamic-subtitle { margin-bottom: 0.1rem; }
  .typewriter-description { margin-top: 0.1rem; }
  
  /* Pull bio summary closer to CTA */
  .bio-summary { padding-top: 0; }
  
  /* Bio panel becomes inline and full-width on mobile */
  .bio-panel {
    position: static;
    max-width: 100%;
    width: 100%;
    margin: 0; /* base */
    margin-top: -0.125rem; /* tiny nudge closer to CTA */
    scroll-margin-top: env(safe-area-inset-top);
  }
  /* When opened, stretch to edge-to-edge (full-bleed) */
  .bio-panel[open] {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100vw;
    max-width: 100vw;
    margin: 0;
    border-radius: var(--radius) var(--radius) 0 0;
    border-left: 0;
    border-right: 0;
    z-index: 1000; /* above hero */
    /* Constrain height by viewport
       On mobile, do NOT subtract sticky header offset to avoid large top gap */
    max-height: calc(100vh - env(safe-area-inset-top));
    overflow: auto;
    /* Ensure content is not hidden behind device UI */
    padding-bottom: env(safe-area-inset-bottom);
    padding-top: env(safe-area-inset-top);
  }
  .bio-summary {
    position: sticky;
    /* On mobile, stick directly under safe area (no header offset) */
    top: env(safe-area-inset-top);
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(10px);
    border-bottom: 1px solid rgba(0,0,0,0.06);
    z-index: 1;
  }
  .bio-content {
    max-height: none;
  }
  .bio-summary { padding: var(--space-sm); }
  .bio-content { max-height: none; }
  
  .dynamic-title {
    font-size: clamp(2rem, 8vw, 2.5rem);
  }
  
  .typewriter {
    font-size: var(--text-base);
    white-space: normal;
    border-right: none;
    width: auto;
    overflow: visible;
    animation: fadeIn 0.5s ease-out 0.5s forwards;
  }
}

@media (max-height: 600px) {
  .hero-image-container {
    max-height: 50vh;
  }
}

/* FINAL OVERRIDES: iPad (769–1024px) must behave like mobile for the bio panel */
@media (min-width: 769px) and (max-width: 1024px) {
  /* Let the card grow with its content */
  .hero-image-container {
    aspect-ratio: auto !important;
    height: auto !important;
    min-height: auto !important;
  }
  /* Stack the overlay like mobile so children take full width */
  .hero-image-overlay {
    position: static !important; /* participate in normal flow */
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;   /* top-left, not bottom */
    justify-content: flex-start !important;
  }
  /* Allow text block to fill width */
  .dynamic-text-container {
    max-width: 100% !important;
    width: 100% !important;
  }
  /* Stack actions vertically */
  .hero-actions {
    display: flex !important;
    flex-direction: column !important;
    align-items: flex-start !important;   /* don't center; stay under text */
    gap: var(--space-sm) !important;
    width: 100% !important;
    margin-top: 0 !important;            /* pull panel closer under CTA */
  }
  /* Keep bio inline, not fixed */
  .bio-panel,
  .bio-panel[open] {
    position: static !important;
    max-width: 100% !important;
    width: 100% !important;
    align-self: stretch !important;
    box-sizing: border-box !important; /* respect inner padding, no overflow */
    margin: 0 !important;
    max-height: none !important;
    overflow: visible !important;
    padding-top: 0 !important;          /* cancel desktop header offset padding */
  }
  /* Ensure content starts at the very top of the panel */
  .bio-panel[open] .bio-content { padding-top: 0 !important; }
  .bio-summary { margin-top: 0 !important; }
}
