/* ============================================================
   STEDWYN — animations.css
   Section-specific animation styles
   ============================================================ */

/* ---------- LOADER ---------- */
#loader {
  position: fixed;
  inset: 0;
  z-index: 1000;
  background: var(--midnight);
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}

.loader-wordmark {
  display: flex;
  align-items: center;
  gap: 0;
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2.5rem, 7vw, 5rem);
  letter-spacing: 0.14em;
  overflow: visible;
}

.loader-letter {
  display: inline-block;
  opacity: 0;
  transform: translateY(24px);
  will-change: transform, opacity;
}

/* ---------- HERO ---------- */
#hero-section {
  position: relative;
  height: 500vh;
}

.hero-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero-center {
  position: relative;
  z-index: 10;
  text-align: center;
  pointer-events: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0;
}

.hero-wordmark {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(64px, 9.5vw, 128px);
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--white);
  line-height: 1;
  will-change: transform, opacity;
  position: relative;
  z-index: 10;
}

.hero-tag {
  font-family: var(--font-body);
  font-size: 0.6875rem;
  letter-spacing: 0.28em;
  text-transform: uppercase;
  color: var(--muted);
  margin-top: 20px;
  opacity: 0;
  will-change: opacity;
}

.hero-sub {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.72);
  max-width: 460px;
  margin-top: 18px;
  opacity: 0;
  will-change: opacity;
}

.hero-ctas {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 36px;
  opacity: 0;
  pointer-events: none;
  will-change: opacity;
}

.hero-ctas.is-visible {
  pointer-events: all;
}

/* ---------- STACK SECTION ---------- */
#stack-section {
  background: var(--midnight);
  height: 250vh; /* tall section — inner .stack-sticky pins while scrolling */
}

.stack-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 0 48px;
  text-align: center;
}

.stack-headline {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2rem, 4.5vw, 3.5rem);
  line-height: 1.15;
  margin-bottom: 12px;
}

.stack-sub {
  color: var(--muted);
  font-size: 1rem;
  margin-bottom: 56px;
}

.stack-area {
  position: relative;
  width: 100%;
  max-width: 680px;
  height: 520px;
  margin: 0 auto;
  overflow: hidden;
}

.task-card {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 340px;
  padding: 14px 18px;
  border-radius: 6px;
  background: var(--slate);
  border: 1px solid rgba(255, 255, 255, 0.07);
  font-family: var(--font-body);
  font-size: 0.8125rem;
  line-height: 1.45;
  color: var(--muted);
  opacity: 0;
  will-change: transform, opacity;
  transform-origin: center center;
  box-shadow: 0 4px 24px rgba(0, 0, 0, 0.35);
}

.task-card.urgent {
  border-left: 3px solid var(--coral);
  color: var(--peach);
}

.stack-result {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  z-index: 60;
  text-align: center;
  opacity: 0;
  will-change: opacity;
  pointer-events: none;
}

.stack-result-handled {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2.5rem, 6vw, 5rem);
  color: var(--white);
  line-height: 1;
}

.stack-result-sub {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2rem, 5vw, 4rem);
  color: var(--coral);
  line-height: 1;
  margin-top: 8px;
}

/* ---------- COMMITMENT SECTION ---------- */
#commitment-section {
  background: var(--slate);
  padding: 100px 48px;
}

.commitment-quote {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.5rem, 3vw, 2.25rem);
  max-width: 680px;
  line-height: 1.25;
  margin-bottom: 72px;
  opacity: 0;
  will-change: opacity;
}

.commitment-rows {
  display: flex;
  flex-direction: column;
  gap: 56px;
  max-width: 900px;
}

.commitment-row {
  display: grid;
  grid-template-columns: 32px 220px 1fr;
  gap: 0 32px;
  align-items: start;
}

.commitment-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--coral);
  margin-top: 14px;
  flex-shrink: 0;
  position: relative;
}

.commitment-dot::after {
  content: '';
  position: absolute;
  inset: -4px;
  border-radius: 50%;
  background: rgba(201, 78, 48, 0.25);
  animation: pulse-dot 2.4s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.6); opacity: 0; }
}

.commitment-metric-block {
  will-change: transform, opacity;
  opacity: 0;
}

.commitment-metric {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(2rem, 4vw, 3rem);
  color: var(--white);
  line-height: 1;
  margin-bottom: 4px;
}

.commitment-label {
  font-family: var(--font-body);
  font-size: 0.8125rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--coral);
}

.commitment-desc {
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  color: rgba(255, 255, 255, 0.65);
  padding-top: 10px;
  opacity: 0;
  will-change: opacity;
}

/* ---------- MANIFESTO SECTION ---------- */
#manifesto-section {
  position: relative;
  min-height: 160vh;
  background: var(--midnight);
}

.manifesto-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

.manifesto-rings {
  position: absolute;
  inset: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}

.manifesto-ring {
  position: absolute;
  border-radius: 50%;
  border: 1.5px solid rgba(201, 78, 48, 0.18);
  will-change: transform, opacity;
}

.manifesto-ring-1 {
  width: 380px;
  height: 380px;
  animation: breathe 4s ease-in-out infinite;
}

.manifesto-ring-2 {
  width: 580px;
  height: 580px;
  animation: breathe 4s ease-in-out infinite 0.8s;
}

@keyframes breathe {
  0%, 100% { transform: scale(1);    opacity: 0.5; }
  50%       { transform: scale(1.06); opacity: 1; }
}

.manifesto-lines {
  position: relative;
  z-index: 10;
  max-width: 820px;
  padding: 0 48px;
  text-align: center;
}

.manifesto-line {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.25rem, 3vw, 2.125rem);
  line-height: 1.3;
  color: var(--white);
  opacity: 0.14;
  transform: scale(0.96);
  transition: opacity 0.5s ease, transform 0.5s ease, color 0.5s ease;
  will-change: transform, opacity;
  margin-bottom: 24px;
}

.manifesto-line.is-active {
  opacity: 1;
  transform: scale(1);
}

.manifesto-line.is-past {
  opacity: 0.14;
  transform: scale(0.96);
}

.manifesto-final {
  font-size: clamp(1.75rem, 5vw, 3.5rem);
  color: var(--coral);
}

/* ---------- CTA BAND ---------- */
#cta-band {
  background: var(--coral);
  padding: 120px 48px;
  text-align: center;
}

.cta-band-headline {
  font-family: var(--font-head);
  font-weight: 700;
  font-size: clamp(1.75rem, 4vw, 3rem);
  color: var(--white);
  max-width: 680px;
  margin: 0 auto 40px;
  line-height: 1.2;
}

/* ============================================================
   RESPONSIVE — animations
   ============================================================ */

/* ---- Mobile ≤ 768px ---- */
@media (max-width: 768px) {
  /* Reduce hero scroll distance: 500vh → 300vh on mobile */
  #hero-section {
    height: 300vh;
  }

  .hero-tag {
    font-size: 0.5625rem;
    letter-spacing: 0.2em;
  }

  .hero-sub {
    max-width: 92%;
    font-size: 0.9375rem;
    padding: 0 8px;
  }

  .hero-ctas {
    flex-direction: column;
    width: 100%;
    max-width: 320px;
    padding: 0 20px;
    gap: 12px;
  }

  .hero-ctas .btn {
    width: 100%;
  }

  #stack-section {
    height: 220vh;
  }

  .stack-sticky {
    padding: 0 20px;
  }

  .stack-area {
    height: 420px;
    max-width: 100%;
  }

  /* Cards use viewport-aware width so they never overflow on small screens */
  .task-card {
    width: min(290px, calc(100vw - 48px));
  }

  .commitment-row {
    grid-template-columns: 20px 1fr;
    grid-template-rows: auto auto;
  }

  .commitment-metric-block {
    grid-column: 2 / 3;
  }

  .commitment-desc {
    grid-column: 1 / -1;
    padding-left: 28px;
    padding-top: 12px;
  }

  #commitment-section {
    padding: 56px 20px;
  }

  .commitment-rows {
    gap: 40px;
  }

  .commitment-quote {
    margin-bottom: 52px;
  }

  .manifesto-lines {
    padding: 0 20px;
  }

  .manifesto-line {
    font-size: clamp(1.0625rem, 4vw, 1.375rem);
    margin-bottom: 20px;
  }

  .manifesto-final {
    font-size: clamp(1.375rem, 5.5vw, 2rem);
  }

  /* Rings scaled to fit within mobile viewport */
  .manifesto-ring-1 {
    width: min(260px, 70vw);
    height: min(260px, 70vw);
  }

  .manifesto-ring-2 {
    width: min(400px, 108vw);
    height: min(400px, 108vw);
  }

  #cta-band {
    padding: 80px 20px;
  }

  .cta-band-headline {
    margin-bottom: 32px;
  }
}

/* ---- Small phone ≤ 480px ---- */
@media (max-width: 480px) {
  #hero-section {
    height: 280vh;
  }

  .hero-wordmark {
    font-size: clamp(44px, 13vw, 80px);
  }

  .hero-tag {
    font-size: 0.5rem;
    letter-spacing: 0.16em;
    margin-top: 14px;
  }

  .hero-sub {
    font-size: 0.875rem;
    max-width: 96%;
    padding: 0 4px;
    margin-top: 14px;
  }

  .hero-ctas {
    padding: 0 16px;
    max-width: 100%;
    margin-top: 28px;
    gap: 10px;
  }

  #stack-section {
    height: 200vh;
  }

  .stack-sticky {
    padding: 0 16px;
  }

  .stack-headline {
    font-size: clamp(1.75rem, 7vw, 2.5rem);
  }

  .stack-sub {
    font-size: 0.9375rem;
    margin-bottom: 40px;
  }

  .stack-area {
    height: 380px;
  }

  .task-card {
    width: calc(100vw - 40px);
    font-size: 0.75rem;
    padding: 12px 14px;
  }

  #commitment-section {
    padding: 44px 16px;
  }

  .commitment-rows {
    gap: 32px;
  }

  .commitment-quote {
    font-size: clamp(1.25rem, 4vw, 1.625rem);
    margin-bottom: 40px;
  }

  .commitment-desc {
    padding-left: 24px;
    font-size: 0.9375rem;
  }

  .manifesto-lines {
    padding: 0 16px;
  }

  .manifesto-line {
    font-size: clamp(0.9375rem, 4.5vw, 1.25rem);
    margin-bottom: 16px;
  }

  .manifesto-final {
    font-size: clamp(1.25rem, 6vw, 1.75rem);
  }

  .manifesto-ring-1 {
    width: 180px;
    height: 180px;
  }

  .manifesto-ring-2 {
    width: 280px;
    height: 280px;
  }

  #cta-band {
    padding: 64px 16px;
  }

  .cta-band-headline {
    font-size: clamp(1.375rem, 5vw, 1.75rem);
    margin-bottom: 28px;
  }
}

/* ---- Landscape mobile: very short viewport ---- */
@media (max-height: 500px) and (orientation: landscape) {
  #hero-section {
    height: 250vh;
  }

  #stack-section {
    height: 200vh;
  }

  .stack-area {
    height: 280px;
  }

  .stack-sub {
    margin-bottom: 20px;
  }

  .manifesto-ring-1 {
    width: min(180px, 45vmin);
    height: min(180px, 45vmin);
  }

  .manifesto-ring-2 {
    width: min(280px, 70vmin);
    height: min(280px, 70vmin);
  }

  #cta-band {
    padding: 56px 20px;
  }
}
