/* ═══════════════════════════════════════════
   CHAIMAE'S BUDGET PLANNER — STYLE SYSTEM
   ═══════════════════════════════════════════ */

/* ── Design Tokens ── */
:root {
  --gold:        #C9973A;
  --gold-light:  #F9F0E0;
  --teal:        #0D7C7C;
  --teal-light:  #E6F4F4;
  --rose:        #C24D5A;
  --rose-light:  #FAEAEC;
  --sage:        #4A7C59;
  --sage-light:  #EBF3EE;
  --ink:         #1A1A2E;
  --mid:         #5A5A72;
  --pale:        #FAFAFA;
  --white:       #FFFFFF;

  --ff-serif:    'DM Serif Display', Georgia, serif;
  --ff-body:     'Inter', system-ui, sans-serif;
  --ff-quote:    'Playfair Display', Georgia, serif;

  --ease-out:    cubic-bezier(0.22, 1, 0.36, 1);
  --radius:      12px;
  --radius-sm:   8px;
  --shadow-card: 0 2px 12px rgba(0,0,0,0.06);
  --shadow-hover:0 8px 28px rgba(0,0,0,0.10);
}

/* ── Reset ── */
*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  font-family: var(--ff-body);
  font-weight: 400;
  color: var(--ink);
  line-height: 1.6;
  background: var(--white);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }
input { font-family: inherit; }

/* ── Utilities ── */
.container {
  max-width: 880px;
  margin: 0 auto;
  padding: 0 24px;
}
.section-label {
  font-family: var(--ff-body);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 8px;
}
.section-title {
  font-family: var(--ff-serif);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  color: var(--ink);
  margin-bottom: 12px;
  line-height: 1.2;
}
.section-body {
  color: var(--mid);
  max-width: 560px;
  margin-bottom: 40px;
  font-size: 1.05rem;
  line-height: 1.7;
}

/* ── Scroll‑reveal ── */
.reveal {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity 0.7s var(--ease-out), transform 0.7s var(--ease-out);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ═══════════ HERO ═══════════ */
.hero {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  background: linear-gradient(135deg, #0D1B2A 0%, #1A3A3A 55%, #0D2B1A 100%);
  overflow: hidden;
  padding: 60px 24px;
}

/* Ambient orbs */
.hero__orb {
  position: absolute;
  border-radius: 50%;
  filter: blur(100px);
  opacity: 0.35;
  pointer-events: none;
}
.hero__orb--teal {
  width: 500px; height: 500px;
  background: radial-gradient(circle, #0D7C7C, transparent 70%);
  top: -120px; right: -80px;
}
.hero__orb--gold {
  width: 420px; height: 420px;
  background: radial-gradient(circle, #C9973A, transparent 70%);
  bottom: -100px; left: -60px;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 640px;
}
.hero__eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gold);
  margin-bottom: 20px;
}
.hero__title {
  font-family: var(--ff-serif);
  font-size: clamp(2.4rem, 7vw, 4.2rem);
  color: var(--white);
  line-height: 1.15;
  margin-bottom: 20px;
}
.hero__title em {
  color: var(--gold);
  font-style: italic;
}
.hero__sub {
  color: rgba(255,255,255,0.72);
  font-size: 1.1rem;
  max-width: 480px;
  margin: 0 auto 36px;
  line-height: 1.7;
}

/* CTA Button */
.btn {
  display: inline-block;
  padding: 14px 36px;
  border-radius: 100px;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: transform 0.3s var(--ease-out), box-shadow 0.3s var(--ease-out);
  border: none;
}
.btn--gold {
  background: var(--gold);
  color: var(--ink);
}
.btn--gold:hover {
  transform: translateY(-3px);
  box-shadow: 0 8px 24px rgba(201,151,58,0.35);
}

/* ═══════════ STRATEGY ═══════════ */
.strategy {
  padding: 100px 0;
  background: var(--white);
  text-align: center;
}

.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  max-width: 780px;
  margin: 0 auto;
}
.pillar {
  padding: 36px 24px;
  border-radius: var(--radius);
  text-align: center;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
  cursor: default;
}
.pillar:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.pillar--teal { background: var(--teal-light); }
.pillar--rose { background: var(--rose-light); }
.pillar--sage { background: var(--sage-light); }

.pillar__pct {
  font-family: var(--ff-serif);
  font-size: 2.6rem;
  display: block;
  margin-bottom: 4px;
  line-height: 1;
}
.pillar--teal .pillar__pct { color: var(--teal); }
.pillar--rose .pillar__pct { color: var(--rose); }
.pillar--sage .pillar__pct { color: var(--sage); }

.pillar__name {
  font-weight: 600;
  font-size: 1.05rem;
  display: block;
  margin-bottom: 8px;
}
.pillar__desc {
  color: var(--mid);
  font-size: 0.92rem;
  line-height: 1.55;
}

/* ═══════════ CALCULATOR ═══════════ */
.calculator {
  padding: 100px 0 80px;
  background: var(--pale);
  text-align: center;
}

/* Salary input */
.salary-input-wrap {
  max-width: 420px;
  margin: 0 auto 56px;
}
.salary-input-box {
  position: relative;
  display: flex;
  align-items: center;
  background: var(--white);
  border: 2px solid #ddd;
  border-radius: var(--radius);
  padding: 12px 20px;
  transition: border-color 0.3s, box-shadow 0.3s;
}
.salary-input-box:focus-within {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(201,151,58,0.18);
}
.salary-input {
  flex: 1;
  border: none;
  outline: none;
  background: transparent;
  font-family: var(--ff-serif);
  font-size: 2.1rem;
  color: var(--ink);
  min-width: 0;
}
.salary-input::placeholder { color: #c0c0c0; }
/* hide number spinners */
.salary-input::-webkit-inner-spin-button,
.salary-input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.salary-input { -moz-appearance: textfield; }

.salary-input-suffix {
  font-size: 0.95rem;
  color: var(--mid);
  font-weight: 500;
  white-space: nowrap;
  margin-left: 12px;
}

/* Results area */
.results {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
  pointer-events: none;
}
.results.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

/* ── Donut Chart ── */
.donut-wrap {
  position: relative;
  width: 220px;
  height: 220px;
  margin: 0 auto 12px;
}
.donut {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}
.donut__track {
  fill: none;
  stroke: #e8e8ee;
  stroke-width: 18;
}
.donut__seg {
  fill: none;
  stroke-width: 18;
  stroke-linecap: butt;
  transition: stroke-dasharray 0.8s var(--ease-out), stroke-dashoffset 0.8s var(--ease-out);
}
.donut__seg--teal  { stroke: var(--teal); }
.donut__seg--rose  { stroke: var(--rose); }
.donut__seg--sage  { stroke: var(--sage); }

.donut__center {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.donut__total {
  font-family: var(--ff-serif);
  font-size: 1.85rem;
  color: var(--ink);
  line-height: 1;
}
.donut__unit {
  font-size: 0.78rem;
  color: var(--mid);
  margin-top: 2px;
}

.donut-legend {
  display: flex;
  gap: 18px;
  justify-content: center;
  font-size: 0.82rem;
  color: var(--mid);
  margin-bottom: 48px;
  flex-wrap: wrap;
}
.legend-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  margin-right: 4px;
  vertical-align: middle;
}
.legend-dot--teal { background: var(--teal); }
.legend-dot--rose { background: var(--rose); }
.legend-dot--sage { background: var(--sage); }

/* ── Budget Cards ── */
.budget-cards {
  display: flex;
  flex-direction: column;
  gap: 28px;
  text-align: left;
  max-width: 640px;
  margin: 0 auto;
}

.bcard {
  background: var(--white);
  border-radius: var(--radius);
  padding: 28px 28px 24px;
  box-shadow: var(--shadow-card);
  border-left: 5px solid transparent;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
}
.bcard:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.bcard--teal { border-left-color: var(--teal); }
.bcard--rose { border-left-color: var(--rose); }
.bcard--sage { border-left-color: var(--sage); }

.bcard__header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 18px;
}
.bcard__icon { font-size: 1.5rem; }
.bcard__titles { flex: 1; }
.bcard__name { font-weight: 600; font-size: 1.1rem; display: block; }
.bcard__pct { font-size: 0.78rem; color: var(--mid); }
.bcard__total {
  font-family: var(--ff-serif);
  font-size: 1.35rem;
  font-weight: 400;
}
.bcard__total--teal { color: var(--teal); }
.bcard__total--rose { color: var(--rose); }
.bcard__total--sage { color: var(--sage); }

.bcard__list li {
  display: flex;
  justify-content: space-between;
  padding: 9px 0;
  border-bottom: 1px solid #f0f0f4;
  font-size: 0.95rem;
}
.bcard__list li:last-child { border-bottom: none; }
.bcard__list li span:last-child {
  font-weight: 500;
  color: var(--ink);
  white-space: nowrap;
}

/* Progress bar */
.bcard__bar {
  height: 5px;
  background: #f0f0f4;
  border-radius: 100px;
  margin-top: 18px;
  overflow: hidden;
}
.bcard__bar-fill {
  height: 100%;
  border-radius: 100px;
  transition: width 0.9s var(--ease-out);
}
.bcard__bar-fill--teal { background: var(--teal); }
.bcard__bar-fill--rose { background: var(--rose); }
.bcard__bar-fill--sage { background: var(--sage); }

/* Warning & tip */
.bcard__warning {
  margin-top: 14px;
  color: #c0392b;
  font-size: 0.88rem;
  background: #fef2f2;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
}
.bcard__tip {
  margin-top: 10px;
  color: var(--mid);
  font-size: 0.85rem;
  font-style: italic;
}
.bcard__joy-note {
  margin-top: 14px;
  color: var(--mid);
  font-size: 0.88rem;
  font-style: italic;
}

/* ── Projection Table ── */
.projection {
  margin-top: 20px;
  border-top: 1px solid #f0f0f4;
  padding-top: 18px;
}
.projection__title {
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--sage);
  margin-bottom: 10px;
}
.projection__table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}
.projection__table th {
  text-align: left;
  color: var(--mid);
  font-weight: 500;
  padding: 6px 0;
  border-bottom: 1px solid #f0f0f4;
  font-size: 0.8rem;
}
.projection__table td {
  padding: 8px 0;
  border-bottom: 1px solid #f7f7fa;
}
.projection__table td:nth-child(2) {
  font-weight: 600;
  color: var(--sage);
  white-space: nowrap;
}
.proj-note {
  color: var(--mid);
  font-style: italic;
  font-size: 0.82rem;
}

/* ── Love Note ── */
.love-note {
  margin-top: 56px;
  background: linear-gradient(135deg, #0D1B2A 0%, #1A3A3A 55%, #0D2B1A 100%);
  border-radius: var(--radius);
  padding: 52px 36px;
  text-align: center;
  position: relative;
  overflow: hidden;
}
.love-note::before {
  content: '';
  position: absolute;
  width: 300px; height: 300px;
  background: radial-gradient(circle, rgba(201,151,58,0.12), transparent 70%);
  top: -80px; right: -60px;
  border-radius: 50%;
  pointer-events: none;
}
.love-note__quote {
  font-family: var(--ff-quote);
  font-style: italic;
  font-size: clamp(1.15rem, 2.5vw, 1.45rem);
  color: var(--gold);
  line-height: 1.6;
  max-width: 540px;
  margin: 0 auto 28px;
  border: none;
  position: relative;
}
.love-note__body {
  color: rgba(255,255,255,0.8);
  font-size: 0.98rem;
  line-height: 1.8;
  max-width: 520px;
  margin: 0 auto 24px;
  position: relative;
}
.love-note__now {
  color: var(--gold);
  font-weight: 700;
}
.love-note__sign {
  font-family: var(--ff-quote);
  font-style: italic;
  color: rgba(255,255,255,0.5);
  font-size: 0.95rem;
  position: relative;
}

/* ═══════════ TIPS ═══════════ */
.tips {
  padding: 100px 0;
  background: var(--white);
  text-align: center;
}
.tips-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  text-align: left;
  margin-top: 8px;
}

.tip-card {
  background: var(--pale);
  border-radius: var(--radius);
  padding: 32px 24px;
  position: relative;
  overflow: hidden;
  transition: transform 0.35s var(--ease-out), box-shadow 0.35s var(--ease-out);
  cursor: default;
}
.tip-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-hover);
}
.tip-card__num {
  font-family: var(--ff-serif);
  font-size: 3.8rem;
  color: var(--gold);
  opacity: 0.15;
  position: absolute;
  top: 10px;
  right: 18px;
  line-height: 1;
  pointer-events: none;
}
.tip-card__title {
  font-family: var(--ff-serif);
  font-size: 1.15rem;
  color: var(--ink);
  margin-bottom: 10px;
}
.tip-card__body {
  color: var(--mid);
  font-size: 0.92rem;
  line-height: 1.6;
}

/* ═══════════ FOOTER ═══════════ */
.footer {
  background: var(--ink);
  padding: 60px 24px;
  text-align: center;
}
.footer__main {
  font-family: var(--ff-serif);
  font-size: 1.25rem;
  color: var(--gold);
  margin-bottom: 10px;
}
.footer__note {
  color: rgba(255,255,255,0.4);
  font-size: 0.85rem;
  max-width: 420px;
  margin: 0 auto;
  line-height: 1.6;
}

/* ═══════════ RESPONSIVE ═══════════ */

/* Tablet */
@media (max-width: 1024px) {
  .pillars { grid-template-columns: repeat(3, 1fr); gap: 16px; }
  .tips-grid { grid-template-columns: repeat(2, 1fr); }
}

/* Mobile */
@media (max-width: 640px) {
  .pillars { grid-template-columns: 1fr; gap: 16px; max-width: 360px; }
  .tips-grid { grid-template-columns: 1fr; }
  .salary-input { font-size: 1.6rem; }
  .bcard { padding: 22px 18px 20px; }
  .love-note { padding: 40px 22px; }
  .donut-wrap { width: 180px; height: 180px; }
  .donut__total { font-size: 1.5rem; }
  .hero { padding: 40px 20px; }
  .strategy, .calculator, .tips { padding: 72px 0; }
}

/* ═══════════ REDUCED MOTION ═══════════ */
@media (prefers-reduced-motion: reduce) {
  .reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .donut__seg { transition: none; }
  .bcard__bar-fill { transition: none; }
  .results { transition: none; }
  .bcard,
  .pillar,
  .tip-card,
  .btn { transition: none; }
}
