/* ═══════════════════════════════════════════════════
   Statement — Hero with Morphing Typewriter
   Portfolio v3 · 2026
   CSS scroll-driven entry + blur-out
   ═══════════════════════════════════════════════════ */

/* Pure typography. No background gfx, no cursor spotlight, no breathing bloom.
   The thesis is the visual. Ref: craigmod.com, robinrendle.com. */
.statement {
  min-height: 100svh;
  display: flex;
  align-items: center;
  justify-content: flex-start;
  padding: clamp(6rem, 14vh, 10rem) clamp(1.5rem, 6vw, 6rem);
  background: var(--surface-statement);
  position: relative;
}

/* ═══ Layout ═══ */
.statement__layout {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 1300px;
}

/* ── Lead line ── */
.statement__lead {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-faint);
  margin-bottom: clamp(1rem, 3vh, 2rem);
}

.statement__lead em {
  font-style: italic;
  color: var(--text-muted);
  display: block;
  font-size: 0.85em;
  margin-bottom: 0.35em;
  opacity: 0.6;
}

/* ── Bold morph row ── */
.statement__bold {
  display: flex;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 0.1em 0.4em;
  margin-bottom: clamp(1rem, 3vh, 2rem);
}

/* Static words — same visual weight, no animation */
.statement__static {
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  font-size: clamp(3.8rem, 11vw, 10rem);
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--text-primary);
  display: inline-block;
  vertical-align: bottom;
  padding-bottom: 0.06em;
}

/* The morphing word — items stacked in grid, crossfade between them. No typewriter, no caret. */
.statement__morph {
  display: inline-block;
  vertical-align: bottom;
  font-size: clamp(3.8rem, 11vw, 10rem);
}

.statement__morph-track {
  display: inline-grid;
  grid-template-columns: 1fr;
  grid-template-rows: 1fr;
}

.statement__morph-item {
  grid-column: 1;
  grid-row: 1;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 400;
  line-height: 1;
  letter-spacing: -0.03em;
  color: var(--accent);
  white-space: nowrap;
  padding-bottom: 0.06em;
  opacity: 0;
}

/* Pre-JS / no-JS fallback: the first item is visible so the hero isn't blank */
.statement__morph-item:first-child {
  opacity: 1;
}

/* JS hands off to crossfade: items fade by opacity class */
.statement__morph.is-crossfade .statement__morph-item {
  opacity: 0;
  transition: opacity 0.9s var(--ease-out);
}

.statement__morph.is-crossfade .statement__morph-item.is-active {
  opacity: 1;
}

/* Reading mode: morph pins to the first word — the cycle still runs in
   JS, but visually nothing performs. The hero sentence has settled. */
[data-theme="light"] .statement__morph.is-crossfade .statement__morph-item {
  opacity: 0;
}
[data-theme="light"] .statement__morph.is-crossfade .statement__morph-item:first-child {
  opacity: 1;
}

/* Dot separator */
.statement__sep {
  font-family: var(--font-display);
  font-size: clamp(3.8rem, 11vw, 10rem);
  line-height: 1;
  color: var(--border-light);
  display: inline-block;
  vertical-align: bottom;
  padding-bottom: 0.06em;
  user-select: none;
}

/* ── Trail line ── */
.statement__trail {
  font-family: var(--font-display);
  font-size: clamp(1rem, 2vw, 1.5rem);
  font-weight: 400;
  line-height: 1.5;
  color: var(--text-faint);
}

.statement__trail em {
  font-style: italic;
  color: var(--text-secondary);
}

/* Layout positioned for z-index */

/* ═══ Responsive ═══ */
@media (max-width: 900px) {
  .statement {
    padding: 5rem 1.5rem;
    align-items: flex-start;
    min-height: auto;
  }
  .statement__layout { max-width: 100%; }
  .statement__bold {
    flex-direction: column;
    align-items: flex-start;
    gap: 0.05em;
  }
  .statement__sep { display: none; }
  .statement__static,
  .statement__morph {
    font-size: clamp(3rem, 17vw, 6rem);
  }
  .statement__lead,
  .statement__trail { font-size: clamp(1rem, 2.5vw, 1.4rem); }
}

@media (max-width: 480px) {
  .statement { padding: 3rem 1.25rem; }
  .statement__static,
  .statement__morph { font-size: clamp(2.2rem, 14vw, 4rem); }
  .statement__lead,
  .statement__trail { font-size: clamp(0.9rem, 4vw, 1.2rem); }
}

@media (max-width: 360px) {
  .statement__static,
  .statement__morph { font-size: clamp(1.8rem, 13vw, 3rem); }
}

@media (prefers-reduced-motion: reduce) {
  .statement__morph.is-crossfade .statement__morph-item { transition: none; }
  .statement::after { animation: none; }
}

/* Bridge line — "Three beliefs. Twenty-one years of proof." */
.statement__bridge {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  color: var(--text-faint);
  margin-top: 2rem;
  border-left: 1px solid var(--border-faint);
  padding-left: 1.25rem;
  line-height: 1.6;
}

[data-theme="light"] .statement__bridge {
  border-left-color: var(--ink-faint);
}

@media (max-width: 600px) {
  .statement__bridge {
    font-size: 0.65rem;
    letter-spacing: 0.06em;
    margin-top: 1.5rem;
  }
}
