/* ===================================================================
   RECOVERY INSIGHTS — STYLESHEET
   Mobile-first methodology:
   - Every base rule below targets the smallest (mobile) viewport.
   - Tablet/desktop refinements are layered on ONLY via min-width
     media queries further down the file.
   - Never use max-width queries to "undo" desktop styles — there
     are no desktop-first styles to undo.
   =================================================================== */

/* -------------------------------------------------------------
   1. DESIGN TOKENS
   ------------------------------------------------------------- */
:root {
  /* Color palette */
  --color-forest: #1B3A2E;
  --color-forest-deep: #102822;
  --color-warm-white: #FBF9F4;
  --color-beige: #EDE6D6;
  --color-beige-deep: #E2D8C2;
  --color-gold: #B8924A;
  --color-gold-bright: #CDA866;
  --color-gray: #6B7268;
  --color-ink: #1F2A24;

  /* Semantic aliases */
  --bg-page: var(--color-warm-white);
  --bg-tinted: var(--color-beige);
  --text-body: var(--color-ink);
  --text-muted: var(--color-gray);
  --accent: var(--color-gold);
  --brand: var(--color-forest);

  /* Typography */
  --font-display: 'Fraunces', Georgia, serif;
  --font-body: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;

  /* Spacing scale (mobile base, rem) */
  --space-xs: 0.5rem;
  --space-sm: 0.875rem;
  --space-md: 1.5rem;
  --space-lg: 2.5rem;
  --space-xl: 3.5rem;
  --space-2xl: 5rem;

  /* Radii & shadow */
  --radius-sm: 10px;
  --radius-md: 18px;
  --radius-lg: 28px;
  --shadow-soft: 0 8px 30px -8px rgba(16, 40, 34, 0.18);
  --shadow-card: 0 4px 18px -6px rgba(16, 40, 34, 0.12);

  /* Motion */
  --ease-calm: cubic-bezier(0.16, 1, 0.3, 1);
  --dur-fast: 220ms;
  --dur-med: 480ms;
  --dur-slow: 900ms;
}

/* -------------------------------------------------------------
   2. RESET & BASE
   ------------------------------------------------------------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font-body);
  background: var(--bg-page);
  color: var(--text-body);
  line-height: 1.6;
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

button {
  font-family: inherit;
  cursor: pointer;
}

ul { margin: 0; padding: 0; }

h1, h2, h3, p { margin: 0; }

/* Respect reduced motion globally */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* Visible keyboard focus, everywhere */
a:focus-visible,
button:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--color-gold);
  outline-offset: 3px;
  border-radius: 4px;
}

/* -------------------------------------------------------------
   3. LAYOUT PRIMITIVES (mobile base)
   ------------------------------------------------------------- */
.container {
  width: 100%;
  max-width: 100%;
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.section {
  padding: var(--space-2xl) 0;
}

.section--tinted { background: var(--bg-tinted); }

.section-head {
  margin-bottom: var(--space-lg);
}

.section-sub {
  margin-top: var(--space-sm);
  color: var(--text-muted);
  font-size: 1rem;
  max-width: 38ch;
}

/* -------------------------------------------------------------
   4. TYPOGRAPHY (mobile base)
   ------------------------------------------------------------- */
.eyebrow {
  font-family: var(--font-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--color-gold);
  margin-bottom: var(--space-xs);
}

.eyebrow--on-dark { color: var(--color-gold-bright); }

.display-xl {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.9rem, 8vw, 2.6rem);
  line-height: 1.15;
  letter-spacing: -0.01em;
  color: var(--brand);
}

.display-lg {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.6rem, 6vw, 2.1rem);
  line-height: 1.2;
  color: var(--brand);
}

.display-md {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.4rem;
  line-height: 1.3;
  color: var(--brand);
}

.lede {
  margin-top: var(--space-sm);
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 34ch;
}

/* -------------------------------------------------------------
   5. LOADER
   ------------------------------------------------------------- */
.loader {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-md);
  background: var(--color-forest);
  z-index: 999;
  transition: opacity var(--dur-slow) var(--ease-calm);
}

.loader[data-hide] {
  opacity: 0;
  pointer-events: none;
}

.loader__ring {
  width: 56px;
  height: 56px;
  transform: rotate(-90deg);
}

.loader__ring-track {
  fill: none;
  stroke: rgba(251, 249, 244, 0.18);
  stroke-width: 3;
}

.loader__ring-progress {
  fill: none;
  stroke: var(--color-gold-bright);
  stroke-width: 3;
  stroke-linecap: round;
  stroke-dasharray: 176;
  stroke-dashoffset: 176;
  animation: loaderSpin 2.4s var(--ease-calm) forwards;
}

@keyframes loaderSpin {
  to { stroke-dashoffset: 30; }
}

.loader__text {
  font-family: var(--font-body);
  font-size: 0.85rem;
  letter-spacing: 0.02em;
  color: var(--color-beige);
  text-align: center;
  min-height: 1.2em;
}

@media (prefers-reduced-motion: reduce) {
  .loader__ring-progress { animation: none; stroke-dashoffset: 60; }
}

/* -------------------------------------------------------------
   6. SCROLL REVEAL (JS toggles .is-visible)
   ------------------------------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease-calm),
              transform var(--dur-slow) var(--ease-calm);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal[data-delay="1"] { transition-delay: 90ms; }
.reveal[data-delay="2"] { transition-delay: 180ms; }
.reveal[data-delay="3"] { transition-delay: 270ms; }
.reveal[data-delay="4"] { transition-delay: 360ms; }

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

/* -------------------------------------------------------------
   7. SECTION 1 — HERO
   ------------------------------------------------------------- */
.section--hero {
  padding-top: var(--space-2xl);
  padding-bottom: var(--space-xl);
  text-align: center;
}

.success-mark {
  display: flex;
  justify-content: center;
  margin-bottom: var(--space-md);
}

.success-mark__svg { width: 64px; height: 64px; }

.success-mark__circle {
  fill: none;
  stroke: var(--color-gold);
  stroke-width: 2.5;
  stroke-dasharray: 164;
  stroke-dashoffset: 164;
  animation: drawCircle 900ms var(--ease-calm) forwards 200ms;
}

.success-mark__check {
  fill: none;
  stroke: var(--brand);
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-linejoin: round;
  stroke-dasharray: 34;
  stroke-dashoffset: 34;
  animation: drawCheck 500ms var(--ease-calm) forwards 1000ms;
}

@keyframes drawCircle { to { stroke-dashoffset: 0; } }
@keyframes drawCheck { to { stroke-dashoffset: 0; } }

@media (prefers-reduced-motion: reduce) {
  .success-mark__circle, .success-mark__check {
    animation: none; stroke-dashoffset: 0;
  }
}

.section--hero .lede { margin-left: auto; margin-right: auto; }

.hero-divider {
  width: 48px;
  height: 2px;
  background: var(--color-gold);
  margin: var(--space-lg) auto 0;
  border-radius: 2px;
  opacity: 0.6;
}

/* -------------------------------------------------------------
   8. SECTION 2 — INSIGHT CARDS
   ------------------------------------------------------------- */
.insight-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.insight-card {
  background: #fff;
  border: 1px solid rgba(27, 58, 46, 0.08);
  border-radius: var(--radius-md);
  padding: var(--space-lg) var(--space-md);
  box-shadow: var(--shadow-card);
  transition: transform var(--dur-med) var(--ease-calm),
              box-shadow var(--dur-med) var(--ease-calm);
}

.insight-card:hover,
.insight-card:focus-within {
  transform: translateY(-4px);
  box-shadow: var(--shadow-soft);
}

.insight-card__icon {
  width: 44px;
  height: 44px;
  margin-bottom: var(--space-md);
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--color-beige);
  border-radius: 50%;
}

.icon-stroke {
  width: 24px;
  height: 24px;
  fill: none;
  stroke: var(--brand);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-stroke--faint { stroke: var(--color-gold); opacity: 0.7; }

.insight-card__title {
  font-family: var(--font-display);
  font-size: 1.15rem;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: var(--space-xs);
}

.insight-card__text {
  color: var(--text-muted);
  font-size: 0.94rem;
}

.confidence {
  margin-top: var(--space-md);
}

.confidence__label {
  font-size: 0.7rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.confidence__track {
  margin-top: 6px;
  height: 5px;
  background: var(--color-beige);
  border-radius: 4px;
  overflow: hidden;
}

.confidence__fill {
  height: 100%;
  width: 0%;
  background: var(--color-gold);
  border-radius: 4px;
  transition: width 1.1s var(--ease-calm);
}

/* -------------------------------------------------------------
   9. SECTION 3 — PATTERN EXPLANATION
   ------------------------------------------------------------- */
.pattern-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
  align-items: center;
  text-align: center;
}

.pattern-visual { width: 100%; max-width: 280px; }

.pattern-rings { width: 100%; height: auto; }

.pattern-rings__track {
  fill: none;
  stroke: rgba(27, 58, 46, 0.08);
  stroke-width: 10;
}

.pattern-rings__protection,
.pattern-rings__recovery {
  fill: none;
  stroke-width: 10;
  stroke-linecap: round;
  transform-origin: 100px 100px;
  transform: rotate(-90deg);
  transition: stroke-dashoffset 1.4s var(--ease-calm);
}

.pattern-rings__protection {
  stroke: var(--color-gold);
  stroke-dasharray: 540.3;
  stroke-dashoffset: 540.3;
}

.pattern-rings__recovery {
  stroke: var(--brand);
  stroke-dasharray: 377;
  stroke-dashoffset: 377;
}

.pattern-rings.is-animated .pattern-rings__protection { stroke-dashoffset: 119; }
.pattern-rings.is-animated .pattern-rings__recovery { stroke-dashoffset: 294; }

.pattern-rings__label-outer,
.pattern-rings__label-inner {
  font-family: var(--font-body);
  font-size: 9px;
  text-anchor: middle;
  fill: var(--text-muted);
  letter-spacing: 0.04em;
}

/* -------------------------------------------------------------
   10. SECTION 4 — BALANCE VISUALIZATION (signature element)
   ------------------------------------------------------------- */
.balance-viz {
  max-width: 560px;
  margin: 0 auto;
  background: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-lg) var(--space-md);
  box-shadow: var(--shadow-soft);
}

.balance-row { margin-bottom: var(--space-lg); }
.balance-row:last-of-type { margin-bottom: var(--space-md); }

.balance-row__label {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: var(--space-xs);
}

.balance-row__name {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.05rem;
  color: var(--brand);
}

.balance-row__value {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.3rem;
  color: var(--color-gold);
}

.balance-row__track {
  height: 14px;
  background: var(--color-beige);
  border-radius: 8px;
  overflow: hidden;
}

.balance-row__fill {
  height: 100%;
  width: 0%;
  border-radius: 8px;
  transition: width 1.6s var(--ease-calm);
}

.balance-row__fill--protection {
  background: linear-gradient(90deg, var(--color-gold) 0%, var(--color-gold-bright) 100%);
}

.balance-row__fill--recovery {
  background: linear-gradient(90deg, var(--brand) 0%, #2C5446 100%);
}

.balance-viz__caption {
  margin-top: var(--space-sm);
  font-size: 0.82rem;
  color: var(--text-muted);
  text-align: center;
}

/* Subtle ambient pulse on the active fills once animated in */
.balance-row__fill.is-filled {
  animation: gentlePulse 4.5s ease-in-out infinite;
}

@keyframes gentlePulse {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.06); }
}

@media (prefers-reduced-motion: reduce) {
  .balance-row__fill.is-filled { animation: none; }
}

/* -------------------------------------------------------------
   11. SECTION 5 — WHY THIS MATTERS
   ------------------------------------------------------------- */
.why-grid {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-md);
}

.why-card {
  padding: var(--space-md) 0;
  border-top: 1px solid rgba(27, 58, 46, 0.12);
}

.why-card__num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--color-beige);
  color: var(--brand);
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 0.85rem;
  margin-bottom: var(--space-sm);
}

.why-card__title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--brand);
  margin-bottom: var(--space-xs);
}

.why-card__text {
  color: var(--text-muted);
  font-size: 0.94rem;
}

/* -------------------------------------------------------------
   12. SECTION 6 — PRICING / RECOVERY BLUEPRINT
   ------------------------------------------------------------- */
.section--pricing {
  background: var(--color-forest);
  background-image: radial-gradient(circle at 20% 0%, rgba(184,146,74,0.18), transparent 55%);
}

.pricing-card {
  background: var(--color-forest-deep);
  border: 1px solid rgba(184, 146, 74, 0.3);
  border-radius: var(--radius-lg);
  padding: var(--space-xl) var(--space-md);
  text-align: center;
  color: var(--color-warm-white);
  box-shadow: 0 20px 60px -20px rgba(0,0,0,0.45);
}

.pricing-card__title {
  color: var(--color-warm-white);
  margin-bottom: var(--space-sm);
}

.pricing-card__sub {
  color: rgba(251, 249, 244, 0.72);
  font-size: 0.96rem;
  max-width: 30ch;
  margin: 0 auto var(--space-lg);
}

.pricing-card__price {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 4px;
  margin-bottom: var(--space-lg);
}

.pricing-card__currency {
  font-family: var(--font-display);
  font-size: 1.6rem;
  color: var(--color-gold-bright);
  font-weight: 600;
}

.pricing-card__amount {
  font-family: var(--font-display);
  font-size: 3.2rem;
  font-weight: 700;
  color: var(--color-warm-white);
  line-height: 1;
}

.pricing-card__duration {
  font-size: 0.85rem;
  color: rgba(251, 249, 244, 0.6);
  margin-left: 4px;
}

.pricing-card__list {
  list-style: none;
  text-align: left;
  max-width: 320px;
  margin: 0 auto var(--space-xl);
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.pricing-card__list li {
  position: relative;
  padding-left: 26px;
  font-size: 0.92rem;
  color: rgba(251, 249, 244, 0.88);
}

.pricing-card__list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 7px;
  width: 14px;
  height: 14px;
  border: 2px solid var(--color-gold-bright);
  border-radius: 50%;
  background: transparent;
}

.pricing-card__note {
  margin-top: var(--space-md);
  font-size: 0.78rem;
  color: rgba(251, 249, 244, 0.55);
}

/* -------------------------------------------------------------
   13. BUTTONS
   ------------------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.98rem;
  border: none;
  border-radius: 999px;
  padding: 1rem 1.8rem;
  position: relative;
  overflow: hidden;
  transition: transform var(--dur-fast) var(--ease-calm),
              box-shadow var(--dur-fast) var(--ease-calm);
}

.btn--primary {
  background: var(--color-gold);
  color: var(--color-forest-deep);
  box-shadow: 0 10px 30px -10px rgba(184, 146, 74, 0.55);
  animation: ctaPulse 3.6s ease-in-out infinite;
}

.btn--primary:hover {
  transform: translateY(-2px);
  background: var(--color-gold-bright);
}

.btn--block { width: 100%; }

.btn--lg {
  padding: 1.1rem 2.2rem;
  font-size: 1.02rem;
}

@keyframes ctaPulse {
  0%, 100% { box-shadow: 0 10px 30px -10px rgba(184, 146, 74, 0.55); }
  50% { box-shadow: 0 10px 36px -8px rgba(184, 146, 74, 0.8); }
}

@media (prefers-reduced-motion: reduce) {
  .btn--primary { animation: none; }
}

/* Ripple effect element injected by JS */
.btn__ripple {
  position: absolute;
  border-radius: 50%;
  background: rgba(255,255,255,0.5);
  transform: scale(0);
  animation: rippleAnim 600ms var(--ease-calm);
  pointer-events: none;
}

@keyframes rippleAnim {
  to { transform: scale(2.6); opacity: 0; }
}

/* -------------------------------------------------------------
   14. SECTION 7 — FAQ ACCORDION
   ------------------------------------------------------------- */
.accordion__item {
  border-bottom: 1px solid rgba(27, 58, 46, 0.12);
}

.accordion__trigger {
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-sm);
  background: none;
  border: none;
  padding: var(--space-md) 0;
  text-align: left;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 600;
  color: var(--brand);
}

.accordion__icon {
  flex-shrink: 0;
  width: 22px;
  height: 22px;
  position: relative;
}

.accordion__icon::before,
.accordion__icon::after {
  content: '';
  position: absolute;
  background: var(--color-gold);
  border-radius: 2px;
  top: 50%;
  left: 50%;
  transition: transform var(--dur-med) var(--ease-calm);
}

.accordion__icon::before {
  width: 14px;
  height: 2px;
  transform: translate(-50%, -50%);
}

.accordion__icon::after {
  width: 2px;
  height: 14px;
  transform: translate(-50%, -50%);
}

.accordion__trigger[aria-expanded="true"] .accordion__icon::after {
  transform: translate(-50%, -50%) rotate(90deg) scaleY(0);
}

.accordion__panel {
  overflow: hidden;
  transition: max-height var(--dur-med) var(--ease-calm);
}

.accordion__panel p {
  padding: 0 0 var(--space-md);
  color: var(--text-muted);
  font-size: 0.94rem;
  max-width: 60ch;
}

/* -------------------------------------------------------------
   15. SECTION 8 — TRUST
   ------------------------------------------------------------- */
.trust-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-size: 0.96rem;
  color: var(--text-body);
  font-weight: 500;
}

.trust-item__mark {
  color: var(--color-gold);
  font-size: 0.7rem;
}

/* -------------------------------------------------------------
   16. SECTION 9 — FINAL CTA
   ------------------------------------------------------------- */
.section--final {
  text-align: center;
}

.final-cta__heading { margin-bottom: var(--space-sm); }

.final-cta__text {
  color: var(--text-muted);
  max-width: 36ch;
  margin: 0 auto var(--space-lg);
}

/* -------------------------------------------------------------
   17. FOOTER
   ------------------------------------------------------------- */
.footer {
  background: var(--color-forest-deep);
  color: rgba(251, 249, 244, 0.6);
  padding: var(--space-lg) 0;
}

.footer__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: var(--space-xs);
  text-align: center;
}

.footer__brand {
  font-family: var(--font-display);
  font-weight: 600;
  color: var(--color-warm-white);
  font-size: 1.05rem;
  letter-spacing: 0.01em;
}

.footer__line { font-size: 0.78rem; }

/* ===================================================================
   TABLET ENHANCEMENTS (≥600px)
   Mobile styles above remain the foundation; these ADD refinements.
   =================================================================== */
@media (min-width: 600px) {
  .container { max-width: 600px; padding: 0 var(--space-lg); }

  :root {
    --space-2xl: 6.5rem;
  }

  .insight-grid { grid-template-columns: repeat(2, 1fr); }

  .why-grid { grid-template-columns: repeat(2, 1fr); }

  .trust-grid {
    flex-direction: row;
    flex-wrap: wrap;
    justify-content: center;
    gap: var(--space-lg);
  }

  .pricing-card { padding: var(--space-2xl) var(--space-xl); }
}

/* ===================================================================
   DESKTOP ENHANCEMENTS (≥1024px)
   =================================================================== */
@media (min-width: 1024px) {
  .container { max-width: 1080px; padding: 0 var(--space-xl); }

  .display-xl { font-size: clamp(2.6rem, 4.2vw, 3.6rem); }
  .display-lg { font-size: clamp(2rem, 3vw, 2.6rem); }
  .display-md { font-size: 1.7rem; }
  .lede { font-size: 1.2rem; }
  .section-sub { font-size: 1.05rem; }

  .section--hero { padding-top: 7rem; }

  .insight-grid { grid-template-columns: repeat(3, 1fr); gap: var(--space-lg); }

  .pattern-layout {
    flex-direction: row;
    text-align: left;
    justify-content: space-between;
    gap: var(--space-2xl);
  }

  .pattern-layout > .reveal:first-child { flex: 1 1 50%; }
  .pattern-visual { flex: 0 0 320px; max-width: 320px; }

  .why-grid { grid-template-columns: repeat(3, 1fr); gap: var(--space-xl); }

  .balance-viz { padding: var(--space-2xl) var(--space-xl); }

  .pricing-card { max-width: 640px; margin: 0 auto; padding: var(--space-2xl) 4.5rem; }

  .btn--block { width: auto; min-width: 340px; }

  .accordion__trigger { font-size: 1.1rem; padding: var(--space-lg) 0; }
}

/* ===================================================================
   LARGE DESKTOP (≥1280px)
   =================================================================== */
@media (min-width: 1280px) {
  .container { max-width: 1180px; }
}
