/* ============================================================
   HERO SECTION - Production Styles
   Mobile-first, optimized, accessible
   ============================================================ */

/* === 1. CSS VARIABLES === */
:root {
  --hero-gold: #cfa84f;
  --hero-gold-light: #e7c77a;
  --hero-brown: #8b5e3c;
  --hero-ink: #0b0b0b;
  --hero-grey: #3a3a3a;
  --hero-muted: #777b80;
  --hero-bg: #faf8f4;
  
  --hero-ease: cubic-bezier(0.22, 0.9, 0.32, 1);
  --hero-duration: 420ms;
  
  --hero-space-xs: 0.5rem;
  --hero-space-sm: 0.75rem;
  --hero-space-md: 1.25rem;
  --hero-space-lg: 2rem;
  --hero-space-xl: 3rem;
  
  --hero-font-system: system-ui, -apple-system, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  --hero-font-serif: Georgia, 'Times New Roman', serif;
}

/* === 2. BASE RESET === */
.hero,
.hero * {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

/* === 3. HERO CONTAINER === */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  padding: clamp(2rem, 8vw, 6rem) clamp(1rem, 5vw, 4rem);
  background: 
    linear-gradient(180deg, rgba(255,255,255,0.96), var(--hero-bg)),
    radial-gradient(ellipse at 10% 10%, rgba(207,168,79,0.04) 0%, transparent 50%);
  font-family: var(--hero-font-system);
  color: var(--hero-ink);
  overflow: hidden;
}

.hero__overlay {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 85% 80%, rgba(58,58,58,0.02) 0%, transparent 40%);
  pointer-events: none;
  z-index: 1;
}

.hero__container {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1200px;
  margin: 0 auto;
}

.hero__content {
  text-align: center;
  animation: heroFadeIn 0.8s var(--hero-ease) both;
}

@keyframes heroFadeIn {
  from {
    opacity: 0;
    transform: translateY(1.5rem);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* === 4. HERO DISPLAY (Name area) === */
.hero__display {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: clamp(0.5rem, 2vw, 1.5rem);
  margin-bottom: var(--hero-space-lg);
  min-height: clamp(4rem, 15vw, 10rem);
}

/* Prefix (Mr) */
.hero__prefix {
  font-size: clamp(1.5rem, 5vw, 3.5rem);
  font-weight: 900;
  color: var(--hero-grey);
  line-height: 1;
  transition: opacity var(--hero-duration) var(--hero-ease);
  user-select: none;
}

.hero__prefix.hidden {
  opacity: 0;
  pointer-events: none;
}

/* Morphing pill button */
.hero__pill {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: clamp(14rem, 50vw, 30rem);
  padding: clamp(0.75rem, 2vw, 1.5rem) clamp(1.5rem, 4vw, 3rem);
  font-size: clamp(1.8rem, 6vw, 5rem);
  font-weight: 900;
  line-height: 1;
  color: var(--hero-ink);
  background: linear-gradient(180deg, #fffaf4, #f6f0e8);
  border: none;
  border-radius: 999px;
  box-shadow: 
    0 1rem 3rem rgba(11, 11, 11, 0.08),
    0 0.5rem 1.5rem rgba(11, 11, 11, 0.05);
  cursor: pointer;
  transition: 
    transform var(--hero-duration) var(--hero-ease),
    box-shadow var(--hero-duration) var(--hero-ease);
  will-change: transform;
}

.hero__pill:hover,
.hero__pill:focus {
  transform: translateY(-0.25rem) scale(1.02);
  box-shadow: 
    0 2rem 5rem rgba(11, 11, 11, 0.12),
    0 0 0 4px rgba(207, 168, 79, 0.15);
  outline: none;
}

.hero__pill:focus-visible {
  box-shadow: 
    0 2rem 5rem rgba(11, 11, 11, 0.12),
    0 0 0 4px var(--hero-gold);
}

/* Morph container */
.hero__morph {
  position: relative;
  display: inline-block;
  min-height: 1em;
}

.morph-layer {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  opacity: 0;
  white-space: nowrap;
  transition: opacity 0.4s var(--hero-ease);
  will-change: opacity;
}

.morph-layer.is-active {
  opacity: 1;
  animation: morphPulse 0.6s var(--hero-ease);
}

@keyframes morphPulse {
  0%, 100% {
    transform: translate(-50%, -50%) scale(1);
  }
  50% {
    transform: translate(-50%, -50%) scale(1.05);
  }
}

/* Final state */
.hero__pill.final {
  background: linear-gradient(180deg, #fffaf3, #fff4e6);
  box-shadow: 
    0 3rem 6rem rgba(11, 11, 11, 0.15),
    0 1rem 3rem rgba(207, 168, 79, 0.1);
  animation: pillFinalPulse 0.8s var(--hero-ease);
}

@keyframes pillFinalPulse {
  0% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.05);
  }
  100% {
    transform: scale(1.02);
  }
}

.hero__pill.final .morph-layer {
  display: none;
}

.hero__pill.final .final-content {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.hero__pill.final .final-subtitle {
  position: absolute;
  right: 1.5rem;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.35em;
  font-weight: 600;
  color: var(--hero-muted);
  opacity: 0.85;
  white-space: nowrap;
}

/* === 5. ROLE TYPEWRITER === */
.hero__role-container {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--hero-space-sm);
  margin-bottom: var(--hero-space-lg);
  min-height: 3rem;
}

.hero__role-prefix {
  font-family: var(--hero-font-serif);
  font-size: clamp(0.875rem, 2vw, 1.25rem);
  color: var(--hero-muted);
  opacity: 0.9;
}

.hero__role {
  display: inline-flex;
  align-items: center;
  font-family: var(--hero-font-serif);
  font-size: clamp(1.5rem, 4vw, 3.5rem);
  font-weight: 700;
  line-height: 1.2;
}

.typewriter {
  background: linear-gradient(90deg, var(--hero-gold), var(--hero-brown));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  min-width: 1ch;
}

.typewriter__cursor {
  display: inline-block;
  width: 0.15em;
  height: 0.9em;
  margin-left: 0.25rem;
  background: var(--hero-gold);
  border-radius: 2px;
  animation: cursorBlink 1s steps(2) infinite;
}

@keyframes cursorBlink {
  50% {
    opacity: 0;
  }
}

/* === 6. LEAD TEXT === */
.hero__lead {
  max-width: 42rem;
  margin: 0 auto var(--hero-space-xl);
  font-size: clamp(1rem, 2.5vw, 1.25rem);
  line-height: 1.6;
  color: var(--hero-grey);
  opacity: 0.95;
}

.hero__lead strong {
  color: var(--hero-gold);
  font-weight: 700;
}

/* === 7. ACTIONS === */
.hero__actions {
  display: flex;
  gap: var(--hero-space-md);
  justify-content: center;
  flex-wrap: wrap;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 1.75rem;
  font-size: 1rem;
  font-weight: 700;
  line-height: 1;
  text-decoration: none;
  border-radius: 0.75rem;
  transition: 
    transform var(--hero-duration) var(--hero-ease),
    box-shadow var(--hero-duration) var(--hero-ease);
  cursor: pointer;
}

.btn:focus-visible {
  outline: 2px solid var(--hero-gold);
  outline-offset: 3px;
}

.btn--primary {
  color: var(--hero-ink);
  background: linear-gradient(180deg, var(--hero-gold-light), var(--hero-gold));
  box-shadow: 0 0.5rem 1.5rem rgba(11, 11, 11, 0.1);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 1rem 2.5rem rgba(11, 11, 11, 0.15);
}

.btn--secondary {
  color: var(--hero-grey);
  background: #fff;
  border: 1px solid rgba(207, 168, 79, 0.25);
  box-shadow: 0 0.25rem 1rem rgba(11, 11, 11, 0.05);
}

.btn--secondary:hover {
  transform: translateY(-2px);
  border-color: var(--hero-gold);
  box-shadow: 0 0.75rem 2rem rgba(11, 11, 11, 0.1);
}

/* === 8. ACCESSIBILITY === */
.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

/* === 9. RESPONSIVE (Mobile enhancements) === */
@media (max-width: 768px) {
  .hero {
    min-height: 90vh;
    padding: 3rem 1.5rem;
  }
  
  .hero__display {
    flex-direction: column;
    gap: 0.75rem;
  }
  
  .hero__prefix {
    order: -1;
  }
  
  .hero__pill {
    min-width: auto;
    width: 90%;
    max-width: 24rem;
  }
  
  .hero__role-container {
    flex-wrap: wrap;
  }
  
  .hero__actions {
    flex-direction: column;
    width: 100%;
    max-width: 20rem;
    margin: 0 auto;
  }
  
  .btn {
    width: 100%;
  }
  
  .hero__pill.final .final-subtitle {
    display: none;
  }
}

@media (max-width: 480px) {
  .hero__pill {
    font-size: clamp(1.25rem, 8vw, 2.5rem);
    padding: 0.75rem 1.25rem;
  }
  
  .morph-layer {
    white-space: normal;
    max-width: 90%;
    text-align: center;
    word-break: break-word;
  }
}

/* === 10. REDUCED MOTION === */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  
  .typewriter__cursor {
    animation: none;
    opacity: 1;
  }
}

/* === 11. PRINT === */
@media print {
  .hero {
    min-height: auto;
    background: white;
  }
  
  .hero__overlay,
  .typewriter__cursor,
  .hero__actions {
    display: none;
  }
}