:root {
  --ink: #211d36;
  --muted: #706a80;
  --paper: #fbfaf7;
  --surface: #ffffff;
  --night: #19152f;
  --violet: #5f4a91;
  --violet-soft: #eee9f8;
  --gold: #c99b43;
  --gold-soft: #f6ead1;
  --rose: #b9637c;
  --line: #ded9e6;
  --shadow: 0 18px 50px rgba(38, 29, 67, .10);
  --radius: 28px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 15% 0%, rgba(201,155,67,.12), transparent 34rem),
    radial-gradient(circle at 100% 22%, rgba(95,74,145,.10), transparent 30rem),
    var(--paper);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.55;
}
button, input { font: inherit; }
button { cursor: pointer; }

.topbar {
  max-width: 1180px;
  margin: 0 auto;
  padding: 24px 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}
.brand { color: var(--ink); text-decoration: none; font-weight: 760; display: flex; align-items: center; gap: 10px; }
.brand-mark { display: grid; place-items: center; width: 34px; height: 34px; border-radius: 50%; color: var(--night); background: var(--gold-soft); }
.author { color: var(--muted); font-size: .9rem; }

main { overflow: hidden; }
.calculator-shell {
  max-width: 1180px;
  margin: 28px auto 72px;
  padding: 54px;
  border-radius: 38px;
  background: var(--night);
  color: white;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, .8fr);
  gap: 70px;
  align-items: center;
  box-shadow: 0 28px 70px rgba(25,21,47,.22);
  position: relative;
}
.calculator-shell::after { content: ""; position: absolute; width: 280px; height: 280px; border: 1px solid rgba(217,182,111,.25); transform: rotate(45deg); right: 27%; top: -190px; }
.eyebrow { margin: 0 0 12px; text-transform: uppercase; letter-spacing: .14em; font-weight: 750; font-size: .76rem; color: var(--gold); }
h1, h2, h3, p { text-wrap: pretty; }
h1, h2 { font-family: Georgia, "Times New Roman", serif; font-weight: 500; line-height: 1.05; margin: 0; }
h1 { font-size: clamp(3rem, 7vw, 5.8rem); max-width: 760px; }
h2 { font-size: clamp(2rem, 4vw, 3.4rem); }
.lead { max-width: 660px; margin: 28px 0 0; color: #d5d1df; font-size: 1.14rem; }

.date-card { position: relative; z-index: 1; padding: 28px; background: white; color: var(--ink); border-radius: var(--radius); box-shadow: var(--shadow); display: grid; gap: 10px; }
.date-card label { margin-top: 8px; font-size: .92rem; font-weight: 750; }
.date-card label span { font-weight: 400; color: var(--muted); }
.date-card input { width: 100%; min-height: 54px; padding: 0 16px; border: 1px solid var(--line); border-radius: 14px; background: #fff; color: var(--ink); outline: none; }
.date-card input:focus { border-color: var(--violet); box-shadow: 0 0 0 4px rgba(95,74,145,.12); }
.date-hint { margin-top: -3px; color: var(--muted); font-size: .82rem; }
.primary-button, .secondary-button { border: 0; border-radius: 15px; min-height: 56px; padding: 0 22px; font-weight: 760; }
.primary-button { margin-top: 12px; background: var(--gold); color: #201a0f; }
.primary-button:hover { background: #dbae54; }
.privacy-note, .launch-note { color: var(--muted); font-size: .82rem; margin: 4px 0 0; }
.form-error { margin: 3px 0 0; color: #a62f4a; font-size: .88rem; }

.results { max-width: 1180px; margin: 0 auto; padding: 0 28px 90px; }
.results-heading { display: flex; align-items: end; justify-content: space-between; gap: 24px; margin-bottom: 30px; }
.text-button { color: var(--violet); background: transparent; border: 0; border-bottom: 1px solid currentColor; padding: 4px 0; }
.matrix-layout { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(280px, .55fr); gap: 24px; }
.matrix-card, .summary-card { background: var(--surface); border: 1px solid rgba(95,74,145,.12); border-radius: var(--radius); box-shadow: var(--shadow); }
.matrix-card { padding: 30px; }
#matrix-svg { display: block; width: 100%; max-height: 660px; }
.matrix-lines polygon, .matrix-lines line { fill: none; stroke: #c8bddb; stroke-width: 2; }
.matrix-lines polygon:first-child { stroke: var(--gold); stroke-width: 3; }
.node circle { fill: white; stroke: var(--violet); stroke-width: 3; filter: drop-shadow(0 4px 6px rgba(50,39,76,.12)); }
.node.core circle { fill: var(--violet-soft); }
.node.center circle { fill: var(--night); stroke: var(--gold); stroke-width: 4; }
.node text { text-anchor: middle; dominant-baseline: central; font-size: 21px; font-weight: 800; fill: var(--ink); pointer-events: none; }
.node.center text { fill: white; }
.central-program-node text { font-size: 17px; }
.purchase-box select { width: 100%; padding: 14px 16px; border: 1px solid var(--line); border-radius: 12px; background: white; color: var(--ink); font: inherit; }
.matrix-legend { display: flex; flex-wrap: wrap; gap: 14px 22px; justify-content: center; color: var(--muted); font-size: .82rem; }
.legend-dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 7px; background: white; border: 2px solid var(--violet); }
.legend-dot.core { background: var(--violet-soft); }
.legend-dot.center { background: var(--night); border-color: var(--gold); }
.summary-card { padding: 32px; align-self: start; position: sticky; top: 20px; }
.summary-kicker { margin: 0; color: var(--muted); }
.program { margin: 12px 0 22px; font-family: Georgia, serif; color: var(--violet); font-size: clamp(2.2rem, 4vw, 3.4rem); }
.summary-card > p:not(.summary-kicker) { color: var(--muted); }
.core-list { margin: 28px 0 0; display: grid; gap: 12px; }
.core-list div { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 14px 0; border-top: 1px solid var(--line); }
.core-list dt { color: var(--muted); }
.core-list dd { margin: 0; font-weight: 850; color: var(--violet); font-size: 1.3rem; }

.section-heading { max-width: 760px; margin: 90px 0 30px; }
.section-heading > p:last-child { color: var(--muted); font-size: 1.06rem; }
.portrait-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 14px; }
.portrait-card { border: 1px solid var(--line); border-radius: 20px; background: rgba(255,255,255,.78); overflow: hidden; }
.portrait-card button { width: 100%; border: 0; background: transparent; padding: 20px; display: grid; grid-template-columns: 48px 1fr 28px; text-align: left; align-items: center; gap: 14px; color: var(--ink); }
.portrait-card button:hover { background: rgba(238,233,248,.55); }
.energy-badge { width: 48px; height: 48px; display: grid; place-items: center; border-radius: 50%; background: var(--violet-soft); color: var(--violet); font-weight: 850; font-size: 1.15rem; }
.portrait-label { font-weight: 760; }
.toggle-icon { color: var(--muted); font-size: 1.4rem; transition: transform .2s; }
.portrait-card.open .toggle-icon { transform: rotate(45deg); }
.portrait-detail { padding: 0 20px 20px 82px; color: var(--muted); }
.portrait-detail h3 { margin: 0 0 12px; color: var(--ink); font-family: Georgia, "Times New Roman", serif; font-size: 1.25rem; }
.portrait-detail p { margin: 0 0 12px; }
.portrait-detail p:last-child { margin-bottom: 0; }

.extended-section { margin-top: 90px; padding: 54px; border-radius: 34px; background: linear-gradient(135deg, var(--night), #332756); color: white; }
.extended-copy { max-width: 760px; }
.extended-copy > p:last-child { color: #d6d0e3; font-size: 1.06rem; }
.topic-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin: 36px 0; }
.topic-grid article { padding: 22px; border: 1px solid rgba(255,255,255,.13); border-radius: 18px; background: rgba(255,255,255,.055); }
.topic-grid span { color: var(--gold); font-size: .78rem; }
.topic-grid h3 { margin: 8px 0; }
.topic-grid p { margin: 0; color: #cfc9dc; font-size: .9rem; }
.secondary-button { background: var(--gold); color: #201a0f; }
.secondary-button:disabled { cursor: not-allowed; opacity: .7; }
.extended-section .launch-note { color: #aaa3bb; max-width: 620px; }
.purchase-box { max-width: 680px; display: grid; gap: 10px; padding: 24px; border: 1px solid rgba(255,255,255,.13); border-radius: 20px; background: rgba(255,255,255,.055); }
.purchase-box > div p { margin: 4px 0 10px; color: #cfc9dc; }
.purchase-box > label:not(.consent-row) { font-size: .9rem; font-weight: 700; }
.purchase-box > input { min-height: 52px; padding: 0 15px; border: 1px solid rgba(255,255,255,.2); border-radius: 13px; background: #fff; color: var(--ink); }
.consent-row { display: flex; gap: 10px; align-items: flex-start; color: #cfc9dc; font-size: .82rem; }
.consent-row input { margin-top: 4px; }
.purchase-error { margin: 2px 0; color: #ffd0d8; font-size: .88rem; }

.method-section { max-width: 1180px; margin: 0 auto 90px; padding: 0 28px; display: grid; grid-template-columns: 1fr 1fr; gap: 60px; align-items: end; }
.method-section > p { margin: 0; color: var(--muted); font-size: 1.06rem; }
footer { padding: 32px 28px; background: #f0edf2; color: var(--muted); font-size: .8rem; }
footer p { margin: 0; }
.copyright-note { max-width: 1180px; margin: 0 auto 22px; padding-bottom: 22px; border-bottom: 1px solid #dcd5e1; color: var(--ink); font-size: 1rem; text-align: center; }
.footer-meta { max-width: 1180px; margin: 0 auto; display: flex; justify-content: space-between; gap: 30px; }
.footer-meta p:last-child { max-width: 760px; }

@media (max-width: 850px) {
  .calculator-shell { margin: 12px 16px 60px; padding: 34px 24px; border-radius: 28px; grid-template-columns: 1fr; gap: 36px; }
  .matrix-layout, .method-section { grid-template-columns: 1fr; }
  .summary-card { position: static; }
  .topic-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 580px) {
  .topbar { padding: 18px; }
  .author { display: none; }
  .calculator-shell { padding: 28px 18px; }
  h1 { font-size: 3.15rem; }
  .date-card { padding: 20px; }
  .results { padding-inline: 16px; }
  .results-heading { align-items: start; flex-direction: column; }
  .matrix-card { padding: 12px; }
  .matrix-legend { display: none; }
  .portrait-grid, .topic-grid { grid-template-columns: 1fr; }
  .portrait-detail { padding-left: 20px; }
  .extended-section { padding: 34px 20px; }
  .method-section { padding-inline: 18px; gap: 20px; }
  footer { padding: 24px 18px; }
  .footer-meta { flex-direction: column; }
}

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } * { transition: none !important; } }
.payment-result { max-width: 760px; margin: 12vh auto; padding: 48px 28px; text-align: center; }
.payment-result h1 { color: var(--night); }
.payment-result > p:not(.eyebrow) { margin: 24px auto 32px; max-width: 620px; color: var(--muted); font-size: 1.08rem; }
.result-link { display: inline-flex; align-items: center; text-decoration: none; }
