/* ================================================================
   QA.CSS — Scroll-driven Q&A narrative section
   ================================================================ */

#qa {
  position: relative;
  height: calc(100vh + 3700px);
  background: var(--bg-primary);
}

/* ── Entry title — solid "Q&A", scrolls up naturally before sticky kicks in ── */
.qa-entry-title {
  position: absolute;
  top: 50vh;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: clamp(10rem, 28vw, 22rem);
  font-weight: 700;
  letter-spacing: -0.06em;
  color: var(--text-primary);
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
  /* starts solid, then the sticky bg-label (stroke) takes over */
  z-index: 0;
}

/* Sticky viewport */
.qa-sticky {
  position: sticky;
  top: 0;
  height: 100vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}

/* ── Background watermark ── */
.qa-bg-label {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-display);
  font-size: clamp(10rem, 28vw, 22rem);
  font-weight: 700;
  letter-spacing: -0.06em;
  color: transparent;
  -webkit-text-stroke: 1.5px var(--border-color);
  pointer-events: none;
  white-space: nowrap;
  user-select: none;
  opacity: 0;
  transition: opacity 0.8s var(--ease-out);
}
.qa-bg-label.is-visible { opacity: 0.5; }

/* ── Section intro ── */
.qa-intro {
  position: absolute;
  top: clamp(50px, 9vh, 90px);
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.7s var(--ease-out);
  width: max-content;
  max-width: calc(100vw - 4rem);
  white-space: normal;
}
.qa-intro.is-visible { opacity: 1; }

.qa-intro-tag {
  font-family: var(--font-mono);
  font-size: var(--fs-label);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
  display: flex;
  align-items: center;
  gap: 0.6rem;
  justify-content: center;
  margin-bottom: 0.5rem;
}
.qa-intro-tag::before,
.qa-intro-tag::after {
  content: '';
  width: 28px;
  height: 1px;
  background: var(--accent);
  opacity: 0.6;
}

.qa-intro-title {
  font-family: var(--font-display);
  font-size: clamp(1.1rem, 2.5vw, 1.6rem);
  font-weight: 600;
  letter-spacing: -0.02em;
  color: var(--text-primary);
}

.qa-intro-accent {
  color: var(--accent);
  font-style: italic;
}

/* ── Q&A Stage ── */
.qa-stage {
  /* position: static so absolute items inside anchor to .qa-sticky (position:sticky),
     giving true 100vh-based vertical centering */
  position: static;
  width: 100%;
  max-width: 820px;
  padding: 0 var(--container-pad);
}

.qa-item {
  /* Anchors to .qa-sticky (position:sticky, height:100vh) — true vertical center */
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(820px, calc(100% - 4rem));
  pointer-events: none;
  text-align: left;
}

/* ── Q label badge ── */
.qa-q-label {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0;
  margin-bottom: 0.75rem;
  clip-path: inset(0 100% 0 0);
  will-change: clip-path;
}

/* ── Question text ── */
.qa-question {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  color: var(--text-primary);
  line-height: 1.1;
  clip-path: inset(0 100% 0 0);
  will-change: clip-path;
}

/* ── Answer block — quote style ── */
.qa-answer-wrap {
  display: flex;
  align-items: flex-start;
  gap: 1rem;
  margin-top: 1.6rem;
  padding: 1.4rem 1.6rem 1.4rem 1.6rem;
  border-left: 3px solid var(--accent);
  background: var(--bg-secondary);
  border-radius: 0 var(--border-radius) var(--border-radius) 0;
  clip-path: inset(0 100% 0 0);
  will-change: clip-path;
  position: relative;
}

/* Closing quote */
.qa-answer-wrap::after {
  content: '"';
  font-family: Georgia, serif;
  font-size: 3.5rem;
  line-height: 0.8;
  color: var(--accent);
  opacity: 0.4;
  position: absolute;
  bottom: 0.3rem;
  right: 1.2rem;
  user-select: none;
}

.qa-quote-mark {
  font-family: Georgia, serif;
  font-size: 3.5rem;
  line-height: 0.8;
  color: var(--accent);
  opacity: 0.4;
  flex-shrink: 0;
  user-select: none;
  margin-top: 0.15rem;
}

.qa-answer {
  font-family: var(--font-body);
  font-size: clamp(1rem, 2vw, 1.25rem);
  color: var(--text-secondary);
  line-height: 1.65;
}

.qa-answer em {
  color: var(--accent);
  font-style: normal;
  font-weight: 600;
}

/* ── Outro ── */
.qa-outro {
  position: absolute;
  bottom: clamp(80px, 12vh, 120px);
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.4rem;
  opacity: 0;
  transition: opacity 0.7s var(--ease-out);
  white-space: nowrap;
  pointer-events: none;
}
.qa-outro.is-visible { opacity: 1; }

.qa-outro-line {
  font-family: var(--font-display);
  font-size: clamp(1.2rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--text-primary);
}

.qa-outro-cta {
  font-family: var(--font-mono);
  font-size: var(--fs-small);
  color: var(--accent);
  letter-spacing: 0.05em;
  animation: qa-bounce 1.4s ease-in-out infinite;
}

@keyframes qa-bounce {
  0%, 100% { transform: translateY(0); }
  50%       { transform: translateY(5px); }
}

/* ── Progress dots ── */
.qa-dots {
  position: absolute;
  bottom: clamp(30px, 5vh, 50px);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
  opacity: 0;
  transition: opacity 0.5s var(--ease-out);
}
.qa-dots.is-visible { opacity: 1; }

.qa-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--border-color);
  transition: background 0.3s, transform 0.3s, width 0.3s;
}
.qa-dot.active {
  background: var(--accent);
  transform: scale(1.3);
  width: 18px;
  border-radius: 3px;
}

/* Dark mode */
body.dark-mode .qa-bg-label {
  -webkit-text-stroke: 1.5px rgba(184,227,233,0.12);
}
body.dark-mode .qa-answer-wrap {
  background: var(--bg-elevated);
}

@media (max-width: 768px) {
  /* Entry title — smaller and left-aligned on mobile so it doesn't overflow */
  .qa-entry-title {
    font-size: clamp(5rem, 28vw, 9rem);
    top: 40vh;
    left: 1rem;
    transform: none;
    white-space: nowrap;
  }

  /* Watermark — also smaller */
  .qa-bg-label {
    font-size: clamp(5rem, 28vw, 9rem);
  }

  /* Items — full width, centered relative to .qa-sticky on mobile */
  .qa-item {
    width: calc(100% - 2.4rem);
    left: 50%;
    transform: translate(-50%, -50%);
    padding: 0;
  }

  .qa-question     { font-size: clamp(1.5rem, 7vw, 2.5rem); }
  .qa-answer       { font-size: 0.95rem; }
  .qa-quote-mark   { font-size: 2.5rem; }
  .qa-answer-wrap  { padding: 1rem 1.2rem; gap: 0.75rem; }

  /* Outro text size */
  .qa-outro-line { font-size: 1.2rem; }

  /* Dots slightly higher */
  .qa-dots { bottom: 20px; }
}
