/**
 * Calculator Result Stage — Phase F of /root/COMAU_AWARD_DESIGN_PLAN.md.
 *
 * Wraps the existing #full-results region so when the user clears the
 * email gate, the result lands as a designed moment rather than just
 * unhiding a div. The stage is opt-in: a wizard adds class
 * "calc-stage" to its full-results section and the CSS + JS apply.
 *
 * Choreography (the actual reveals are GSAP-driven from
 * /js/components/calc-result-stage.js — these are the layout +
 * starting states only):
 *   .stage-headline → number first (visible at t=0)
 *   .stage-summary  → +300ms
 *   .stage-breakdown rows → +500ms staggered
 *
 * Sage ring around the headline number is an SVG drawn via the
 * stage component; this CSS positions it.
 */

.calc-stage {
  position: relative;
}

.calc-stage[data-stage-state="pending"] .stage-reveal {
  opacity: 0;
  transform: translateY(14px);
}
.calc-stage[data-stage-state="playing"] .stage-reveal {
  /* GSAP timeline takes over from here */
}

/* === Headline + ring === */
.calc-stage .stage-headline {
  position: relative;
  text-align: center;
  margin: 8px 0 28px;
}
.calc-stage .stage-headline-number {
  display: inline-block;
  position: relative;
  font-family: var(--font-display);
  font-size: clamp(2.4rem, 6vw, 3.5rem);
  font-weight: 600;
  letter-spacing: -0.025em;
  line-height: 1;
  color: var(--ink);
  font-variant-numeric: tabular-nums;
  padding: 18px 28px;
  z-index: 2;
}
.calc-stage .stage-headline-label {
  display: block;
  font-family: var(--font-display);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  color: var(--ink-soft);
  text-transform: lowercase;
  margin-bottom: 6px;
}
.calc-stage .stage-headline-context {
  display: block;
  font-family: var(--font-display);
  font-size: 0.95rem;
  color: var(--ink-soft);
  margin-top: 8px;
}

/* SVG ring — drawn via JS using stroke-dasharray/dashoffset.
   Positioned to wrap the headline number block. */
.calc-stage .stage-ring {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 1;
  display: block;
}
.calc-stage .stage-ring rect {
  fill: none;
  stroke: var(--sage-600);
  stroke-width: 2;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

/* === Summary band (the "what does the number actually mean" line) === */
.calc-stage .stage-summary {
  text-align: center;
  font-family: var(--font-serif);
  font-style: italic;
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  line-height: 1.5;
  color: var(--ink-soft);
  max-width: 56ch;
  margin: 0 auto 36px;
}

/* === "How we got this" disclosure === */
.calc-stage .stage-how {
  background: var(--paper-soft);
  border: 1px solid var(--paper-edge);
  border-left: 3px solid var(--sage-600);
  border-radius: var(--radius);
  padding: 18px 22px;
  margin: 0 0 28px;
  font-size: 0.94rem;
}
.calc-stage .stage-how summary {
  cursor: pointer;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.95rem;
  color: var(--ink);
  list-style: none;
  display: flex;
  align-items: center;
  gap: 8px;
  user-select: none;
}
.calc-stage .stage-how summary::-webkit-details-marker { display: none; }
.calc-stage .stage-how summary::before {
  content: '';
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--sage-600);
  border-bottom: 2px solid var(--sage-600);
  transform: rotate(-45deg);
  transition: transform 200ms var(--ease-default);
  flex-shrink: 0;
}
.calc-stage .stage-how[open] summary::before {
  transform: rotate(45deg);
}
.calc-stage .stage-how-body {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--paper-edge);
  color: var(--ink-soft);
  line-height: 1.65;
}
.calc-stage .stage-how-body p { margin: 0 0 10px; }
.calc-stage .stage-how-body p:last-child { margin-bottom: 0; }
.calc-stage .stage-how-body ul {
  margin: 6px 0 10px;
  padding-left: 18px;
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.7;
}
.calc-stage .stage-how-body li {
  margin: 2px 0;
  font-variant-numeric: tabular-nums;
}
.calc-stage .stage-how-body li strong {
  color: var(--ink);
  font-weight: 600;
}

/* === CTA pair === */
.calc-stage .stage-cta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
  justify-content: center;
  margin: 28px 0 12px;
}
.calc-stage .stage-cta-primary,
.calc-stage .stage-cta-secondary {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  border-radius: var(--radius-md);
  padding: 14px 22px;
  transition: background 200ms var(--ease-default), border-color 200ms var(--ease-default), transform 120ms var(--ease-default);
  cursor: pointer;
  border: 1px solid transparent;
}
.calc-stage .stage-cta-primary {
  background: var(--sage-600);
  color: #FFF;
}
.calc-stage .stage-cta-primary:hover {
  background: var(--sage-800);
  transform: translateY(-1px);
}
.calc-stage .stage-cta-secondary {
  background: transparent;
  color: var(--ink);
  border-color: var(--paper-edge);
}
.calc-stage .stage-cta-secondary:hover {
  border-color: var(--sage-600);
  color: var(--sage-600);
}
.calc-stage .stage-cta .arrow {
  transition: transform 120ms var(--ease-default);
}
.calc-stage .stage-cta-primary:hover .arrow,
.calc-stage .stage-cta-secondary:hover .arrow {
  transform: translateX(2px);
}

/* === Mobile === */
@media (max-width: 600px) {
  .calc-stage .stage-headline-number {
    font-size: clamp(2.0rem, 9vw, 2.6rem);
    padding: 14px 20px;
  }
  .calc-stage .stage-cta {
    flex-direction: column;
    align-items: stretch;
  }
  .calc-stage .stage-cta-primary,
  .calc-stage .stage-cta-secondary {
    justify-content: center;
  }
}
