/* Home Page Styles - Stone Theme */

/* ============================================
   Typography — Display Font
   ============================================ */
.home-display-font {
  font-weight: 600;
  letter-spacing: -0.04em;
}

/* ============================================
   Hero Section
   ============================================ */
.home-hero {
  min-height: calc(100vh - 64px);
}

/* Hero staggered entrance */
@keyframes hero-fade-up {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.home-hero h1,
.home-hero h1 + p,
.home-hero .hero-ctas,
.home-hero .hero-proof {
  opacity: 0;
  animation: hero-fade-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.home-hero .hero-proof {
  animation-delay: 0s;
}

.home-hero h1 {
  animation-delay: 0.15s;
}

.home-hero h1 + p {
  animation-delay: 0.35s;
}

.home-hero .hero-ctas {
  animation-delay: 0.5s;
}

.home-hero .builder-demo-container {
  animation-delay: 0.7s;
}

@media (prefers-reduced-motion: reduce) {
  .home-hero h1,
  .home-hero h1 + p,
  .home-hero .hero-ctas {
    opacity: 1;
    animation: none;
  }
}

/* Builder demo — taller on mobile to show content, 16:9 on desktop */
.builder-demo-container {
  aspect-ratio: 3/4;
}

@media (min-width: 480px) {
  .builder-demo-container {
    aspect-ratio: 4/5;
  }
}

@media (min-width: 640px) {
  .builder-demo-container {
    aspect-ratio: 1/1;
  }
}

@media (min-width: 768px) {
  .builder-demo-container {
    aspect-ratio: 4/3;
  }
}

@media (min-width: 1024px) {
  .builder-demo-container {
    aspect-ratio: 16/9;
  }
}

/* ============================================
   Problem Section — Editorial Pain Points
   ============================================ */
.problem-pain-item {
  position: relative;
}

.problem-pain-item::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  width: 24px;
  height: 1px;
  background-color: #d6d3d1;
}

.problem-pain-item {
  padding-top: 1rem;
}

/* ============================================
   Simulated Research — Dark Section
   ============================================ */
/* HUD annotation labels on simulation visual */
.sim-hud-label {
  opacity: 0;
}

/* Boot-in: staggered flicker entry */
.sim-visual.visible .sim-hud-label {
  animation: hud-boot 0.3s ease-out forwards;
}

.sim-visual.visible .sim-hud-label:nth-child(1) {
  animation-delay: 0.3s;
}
.sim-visual.visible .sim-hud-label:nth-child(2) {
  animation-delay: 0.7s;
}
.sim-visual.visible .sim-hud-label:nth-child(3) {
  animation-delay: 1.1s;
}
.sim-visual.visible .sim-hud-label:nth-child(4) {
  animation-delay: 1.5s;
}

@keyframes hud-boot {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 0.9;
  }
  35% {
    opacity: 0.1;
  }
  50% {
    opacity: 0.7;
  }
  65% {
    opacity: 0.2;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 1;
  }
}

/* Post-entry glitch — each label gets its own timing, no waiting for others */
.sim-visual.visible .sim-hud-label:nth-child(1) .sim-hud-text {
  animation: hud-glitch-1 0.5s steps(2) 0.8s 1 forwards;
}
.sim-visual.visible .sim-hud-label:nth-child(2) .sim-hud-text {
  animation: hud-glitch-2 0.35s steps(2) 1s 1 forwards;
}
.sim-visual.visible .sim-hud-label:nth-child(3) .sim-hud-text {
  animation: hud-glitch-3 0.55s steps(3) 1.5s 1 forwards;
}
.sim-visual.visible .sim-hud-label:nth-child(4) .sim-hud-text {
  animation: hud-glitch-4 0.4s steps(2) 1.8s 1 forwards;
}

/* Each glitch baked into one animation: multiple flickers then settle at full */
@keyframes hud-glitch-1 {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  10% {
    opacity: 0.3;
    transform: translateX(2px);
  }
  20% {
    opacity: 1;
    transform: translateX(0);
  }
  40% {
    opacity: 0.2;
    transform: translateX(-1px);
  }
  50% {
    opacity: 0.9;
    transform: translateX(1px);
  }
  60% {
    opacity: 0.3;
    transform: translateX(-2px);
  }
  70% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes hud-glitch-2 {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  15% {
    opacity: 0.2;
    transform: translateX(1px);
  }
  30% {
    opacity: 1;
    transform: translateX(0);
  }
  50% {
    opacity: 0.4;
    transform: translateX(-2px);
  }
  65% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes hud-glitch-3 {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  8% {
    opacity: 0.3;
    transform: translateX(2px);
  }
  16% {
    opacity: 0.8;
    transform: translateX(0);
  }
  30% {
    opacity: 0.15;
    transform: translateX(-1px);
  }
  40% {
    opacity: 1;
    transform: translateX(1px);
  }
  55% {
    opacity: 0.3;
    transform: translateX(-2px);
  }
  65% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@keyframes hud-glitch-4 {
  0% {
    opacity: 1;
    transform: translateX(0);
  }
  12% {
    opacity: 0.2;
    transform: translateX(-1px);
  }
  25% {
    opacity: 1;
    transform: translateX(0);
  }
  35% {
    opacity: 0.4;
    transform: translateX(2px);
  }
  45% {
    opacity: 0.15;
    transform: translateX(-2px);
  }
  55% {
    opacity: 0.9;
    transform: translateX(1px);
  }
  65% {
    opacity: 1;
    transform: translateX(0);
  }
  100% {
    opacity: 1;
    transform: translateX(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .sim-hud-label {
    opacity: 1;
  }
  .sim-visual.visible .sim-hud-label,
  .sim-visual.visible .sim-hud-label .sim-hud-text {
    animation: none;
  }
}

.sim-hud-dot {
  display: block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #fafaf9;
  box-shadow:
    0 0 8px 3px rgba(250, 250, 249, 0.4),
    0 0 2px 1px rgba(250, 250, 249, 0.7);
  animation: hud-dot-pulse 2s ease-in-out infinite;
}

@keyframes hud-dot-pulse {
  0%,
  100% {
    box-shadow:
      0 0 8px 3px rgba(250, 250, 249, 0.3),
      0 0 2px 1px rgba(250, 250, 249, 0.5);
  }
  50% {
    box-shadow:
      0 0 12px 5px rgba(250, 250, 249, 0.5),
      0 0 3px 2px rgba(250, 250, 249, 0.8);
  }
}

.sim-hud-connector {
  pointer-events: none;
}

.sim-hud-text {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: #fafaf9;
  white-space: nowrap;
  background: rgba(28, 25, 23, 0.65);
  padding: 4px 10px;
  border-left: 2px solid rgba(250, 250, 249, 0.5);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

@media (prefers-reduced-motion: reduce) {
  .sim-hud-label {
    opacity: 1;
    animation: none;
  }
}

.sim-tier {
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

.sim-tier:hover {
  border-color: rgba(168, 162, 158, 0.3);
}

.sim-tier-active {
  box-shadow:
    0 0 0 1px rgba(168, 162, 158, 0.1),
    0 8px 40px rgba(0, 0, 0, 0.3);
}

/* ============================================
   Proof Metrics — Counter Animation
   ============================================ */
.proof-metric {
  position: relative;
}

.proof-metric:not(:last-child)::after {
  content: '';
  position: absolute;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  width: 1px;
  height: 48px;
  background: #e7e5e4;
}

@media (max-width: 767px) {
  .proof-metric:not(:last-child)::after {
    display: none;
  }
}

/* ============================================
   Method Tab Styles
   ============================================ */
.method-tab {
  position: relative;
}

.method-tab.active {
  color: #1c1917;
  border-bottom: 2px solid #1c1917;
}

.method-tab:not(.active) {
  color: #78716c;
  border-bottom: 2px solid transparent;
}

.method-tab:not(.active):hover {
  color: #44403c;
}

/* Methods Content Animation */
.method-content-item {
  transition:
    opacity 0.3s ease,
    transform 0.3s ease;
}

.method-content-item.active {
  opacity: 1;
  position: relative;
  pointer-events: auto;
}

.method-content-item:not(.active) {
  opacity: 0;
  position: absolute;
  inset: 0;
  pointer-events: none;
}

/* ============================================
   Capability Cards (AI Builder Section)
   ============================================ */

.capabilities-grid {
  display: flex;
  flex-direction: column;
  gap: 5rem;
}

.capability-card {
  opacity: 0;
  transform: translateY(80px);
  transition:
    opacity 1s cubic-bezier(0.4, 0, 0.2, 1),
    transform 1s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity, transform;
  border: 1px solid #e7e5e4;
  background: white;
  border-radius: 1rem;
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.05);
}

.capability-card.animate-in {
  opacity: 1;
  transform: translateY(0);
}

.capability-content {
  display: grid;
  grid-template-columns: 1fr;
}

@media (min-width: 1024px) {
  .capability-content {
    grid-template-columns: 1fr 1fr;
  }

  .capability-card:nth-child(even) .capability-text {
    order: 2;
  }

  .capability-card:nth-child(even) .capability-visual {
    order: 1;
  }
}

.capability-text {
  padding: 2rem;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

@media (min-width: 1024px) {
  .capability-text {
    padding: 3rem;
  }
}

/* ============================================
   Platform Cards
   ============================================ */
.platform-card {
  transition: all 0.3s ease;
}

.platform-card:hover {
  box-shadow:
    0px 2px 12px 0px #3c3c3c0f,
    0px 12px 24px 0px #3c3c3c0a;
}

/* ============================================
   Scroll Animations — Staggered
   ============================================ */
.scroll-animate {
  opacity: 0.15;
  transform: translateY(12px);
  transition:
    opacity 0.7s cubic-bezier(0.16, 1, 0.3, 1),
    transform 0.7s cubic-bezier(0.16, 1, 0.3, 1);
}

.scroll-animate.visible {
  opacity: 1;
  transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
  .scroll-animate {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

/* Staggered Animation Delays */
.scroll-animate:nth-child(1) {
  transition-delay: 0ms;
}
.scroll-animate:nth-child(2) {
  transition-delay: 100ms;
}
.scroll-animate:nth-child(3) {
  transition-delay: 200ms;
}
.scroll-animate:nth-child(4) {
  transition-delay: 300ms;
}

/* Stagger children within sections */
.how-it-works-section .grid > div:nth-child(1) {
  transition-delay: 0ms;
}
.how-it-works-section .grid > div:nth-child(2) {
  transition-delay: 120ms;
}
.how-it-works-section .grid > div:nth-child(3) {
  transition-delay: 240ms;
}

/* ============================================
   Responsive Adjustments
   ============================================ */
@media screen and (max-width: 1024px) {
  .methods-content {
    position: relative;
  }

  .method-content-item:not(.active) {
    display: none;
  }
}

@media screen and (max-width: 768px) {
  .home-hero {
    min-height: auto;
  }
}
