:root {
  --purple: #7f6894;
  --purple-dark: #513768;
  --purple-deep: #3f2855;
  --purple-pale: #f4eff7;
  --purple-line: #d9cce1;
  --gold: #d7a43e;
  --gold-light: #f4d88e;
  --ink: #211c25;
  --muted: #62596a;
  --paper: #ffffff;
  --paper-warm: #fdfbf9;
  --line: #e8e0eb;
  --shadow: 0 24px 70px rgba(71, 45, 88, 0.1);
  --serif: "Cormorant Garamond", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --sans: Inter, "Avenir Next", Avenir, "Segoe UI", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  color-scheme: light;
  min-height: 0;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 0;
  min-width: 320px;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

button,
input {
  font: inherit;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
input:focus-visible,
a:focus-visible {
  outline: 3px solid rgba(215, 164, 62, 0.45);
  outline-offset: 3px;
}

[hidden] {
  display: none !important;
}

.site-shell {
  display: flow-root;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  padding: 80px 0 110px;
}

.hero {
  max-width: 900px;
  margin: 0 auto 54px;
  background: var(--paper);
  text-align: center;
}

.eyebrow {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--gold);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.4;
  text-transform: uppercase;
}

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

h1,
h2,
h3 {
  color: var(--purple-deep);
  font-family: var(--serif);
  font-weight: 600;
  line-height: 1.08;
}

h1 {
  margin-bottom: 22px;
  font-size: clamp(2.8rem, 5.8vw, 4.9rem);
  letter-spacing: -0.04em;
}

h2 {
  margin-bottom: 16px;
  font-size: clamp(2rem, 4.3vw, 3.35rem);
  letter-spacing: -0.025em;
}

h3 {
  font-size: clamp(1.45rem, 2vw, 1.8rem);
}

.hero-copy {
  max-width: 700px;
  margin: 0 auto 28px;
  color: var(--muted);
  font-size: clamp(1.05rem, 2vw, 1.25rem);
}

.gold-thread {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 170px;
  height: 22px;
  margin: 0 auto;
}

.gold-thread::before,
.gold-thread::after {
  width: 68px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--gold));
  content: "";
}

.gold-thread::after {
  background: linear-gradient(90deg, var(--gold), transparent);
}

.gold-thread > span {
  width: 8px;
  height: 8px;
  margin: 0 10px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  background: var(--paper);
  box-shadow: 0 0 0 4px rgba(215, 164, 62, 0.1);
}

.gold-thread.small {
  width: 120px;
  margin-bottom: 18px;
}

.calculator-card {
  overflow: hidden;
  border: 1px solid var(--purple-line);
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.tabs {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  padding: 10px;
  border-bottom: 1px solid var(--line);
  background: var(--purple-pale);
}

.tab-button {
  min-height: 58px;
  padding: 13px 22px;
  border: 0;
  border-radius: 20px;
  color: var(--purple-dark);
  background: transparent;
  cursor: pointer;
  font-weight: 700;
  transition: color 180ms ease, background 180ms ease, box-shadow 180ms ease;
}

.tab-button:hover {
  background: rgba(255, 255, 255, 0.55);
}

.tab-button.is-active {
  color: #fff;
  background: var(--purple);
  box-shadow: 0 9px 24px rgba(81, 55, 104, 0.2);
}

.tab-panel {
  padding: clamp(30px, 6vw, 68px);
}

.panel-intro {
  max-width: 720px;
  margin: 0 auto 36px;
  text-align: center;
}

.panel-intro h2 {
  margin-bottom: 12px;
}

.panel-intro p,
.section-heading p {
  margin-bottom: 0;
  color: var(--muted);
}

.calculator-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 18px;
  align-items: start;
  max-width: 920px;
  margin: 0 auto;
}

.compatibility-form {
  display: block;
  max-width: 900px;
}

.person-fieldset {
  margin: 0;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--paper-warm);
}

.person-fieldset legend {
  padding: 0 10px;
  color: var(--purple-dark);
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 600;
}

.field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.field-group {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.field-group label {
  color: var(--purple-dark);
  font-size: 0.92rem;
  font-weight: 700;
}

.optional {
  color: #8a8290;
  font-size: 0.76rem;
  font-weight: 500;
}

.field-group input {
  width: 100%;
  min-height: 54px;
  padding: 12px 16px;
  border: 1px solid #cfc4d5;
  border-radius: 14px;
  color: var(--ink);
  background: #fff;
  transition: border-color 160ms ease, box-shadow 160ms ease;
}

.field-group input:hover {
  border-color: var(--purple);
}

.field-group input:focus {
  border-color: var(--purple);
  outline: 0;
  box-shadow: 0 0 0 4px rgba(127, 104, 148, 0.12);
}

.field-group input::placeholder {
  color: #a29aa8;
}

.field-error,
.form-error {
  min-height: 1.4em;
  margin: 0;
  color: #a73f4a;
  font-size: 0.82rem;
}

.form-error {
  margin-top: 14px;
  text-align: center;
}

.form-action {
  display: flex;
  justify-content: center;
}

.calculator-form:not(.compatibility-form) .form-action {
  margin-top: calc(0.92rem * 1.65 + 8px);
}

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 54px;
  padding: 13px 25px;
  border-radius: 999px;
  cursor: pointer;
  font-weight: 750;
  line-height: 1.2;
  text-align: center;
  text-decoration: none;
  transition: transform 160ms ease, box-shadow 160ms ease, background 160ms ease;
}

.primary-button {
  border: 1px solid var(--purple);
  color: #fff;
  background: var(--purple);
  box-shadow: 0 12px 28px rgba(81, 55, 104, 0.2);
}

#personalForm .primary-button {
  font-family: var(--serif);
  font-size: 1.2rem;
  font-weight: 600;
  letter-spacing: 0.025em;
}

.primary-button:hover {
  background: var(--purple-dark);
  box-shadow: 0 14px 33px rgba(81, 55, 104, 0.27);
  transform: translateY(-2px);
}

.secondary-button {
  border: 1px solid var(--gold);
  color: var(--purple-dark);
  background: #fff;
}

.secondary-button:hover {
  background: #fffaf0;
  box-shadow: 0 11px 25px rgba(178, 129, 34, 0.15);
  transform: translateY(-2px);
}

.relationship-mark {
  display: flex;
  align-items: center;
  gap: 14px;
  justify-content: center;
  margin: 16px 0;
  color: var(--gold);
}

.relationship-mark span {
  width: 48px;
  height: 1px;
  background: var(--gold-light);
}

.relationship-mark b {
  font-family: var(--serif);
  font-size: 1.25rem;
  font-style: italic;
  font-weight: 500;
}

.compatibility-form .form-action {
  margin-top: 26px;
}

.result-section {
  margin-top: 110px;
}

.section-heading {
  max-width: 780px;
  margin: 0 auto 44px;
  text-align: center;
}

.section-heading.compact {
  margin-bottom: 34px;
}

.result-identity {
  color: var(--purple-dark) !important;
  font-weight: 650;
}

.matrix-frame {
  width: min(100%, 900px);
  margin: 0 auto;
  padding: clamp(12px, 3vw, 30px);
  border: 1px solid var(--purple-line);
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--shadow);
}

.matrix-svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 1;
  overflow: visible;
}

.matrix-line,
.matrix-axis,
.matrix-diagonal,
.generation-line,
.relation-line {
  fill: none;
  vector-effect: non-scaling-stroke;
}

.matrix-line {
  stroke-linejoin: round;
}

.matrix-line-outer {
  stroke: #4d3a59;
  stroke-width: 2.2;
}

.matrix-line-gold {
  stroke: rgba(215, 164, 62, 0.78);
  stroke-width: 1.8;
}

.matrix-line-soft {
  stroke: rgba(77, 58, 89, 0.9);
  stroke-width: 1.8;
}

.matrix-axis {
  stroke: rgba(65, 45, 76, 0.82);
  stroke-width: 1.5;
}

.matrix-diagonal {
  stroke: rgba(65, 45, 76, 0.82);
  stroke-width: 1.7;
}

.generation-line {
  stroke-width: 2.3;
  opacity: 0.95;
}

.generation-line-male {
  stroke: var(--purple);
}

.generation-line-female {
  stroke: #e04a4a;
}

.generation-label {
  font-family: var(--serif);
  font-size: 15px;
  font-style: italic;
  text-anchor: middle;
  paint-order: stroke;
  stroke: rgba(255, 255, 255, 0.94);
  stroke-width: 4px;
  stroke-linejoin: round;
}

.relation-line {
  stroke: #4d4850;
  stroke-width: 1.7;
  stroke-dasharray: 10 14;
}

.node-value {
  fill: var(--purple-deep);
  font-family: var(--serif);
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: middle;
}

.node-value-light {
  fill: #fff;
}

.matrix-symbol {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 700;
  text-anchor: middle;
  dominant-baseline: middle;
}

.matrix-symbol-money {
  fill: #4f9845;
}

.matrix-symbol-heart {
  fill: #c94d61;
}

.age-anchor-label,
.age-energy,
.age-interval,
.age-milestone-label {
  font-variant-numeric: tabular-nums;
  text-anchor: middle;
  dominant-baseline: middle;
}

.age-anchor-label {
  fill: var(--purple-dark);
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
}

.age-energy {
  fill: var(--purple-deep);
  font-size: 12px;
  font-weight: 700;
}

.age-interval {
  fill: #786f7d;
  font-size: 9px;
  font-weight: 600;
}

.age-milestone-label {
  fill: var(--purple-dark);
  font-family: var(--serif);
  font-size: 10px;
  font-weight: 700;
}

.age-milestone {
  fill: #fff;
  stroke: var(--purple);
  stroke-width: 1.6;
  vector-effect: non-scaling-stroke;
}

.age-tick {
  fill: var(--purple-deep);
}

.result-actions {
  display: flex;
  justify-content: center;
  margin: 28px 0 0;
}

.health-section,
.initiatic-section {
  margin-top: 110px;
}

.table-wrap {
  overflow-x: auto;
  width: min(100%, 900px);
  margin: 0 auto;
  border: 1px solid var(--purple-line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 20px 55px rgba(71, 45, 88, 0.07);
}

.health-table {
  width: 100%;
  border-collapse: collapse;
  font-variant-numeric: tabular-nums;
}

.health-table th,
.health-table td {
  padding: 17px 24px;
  border-bottom: 1px solid var(--line);
  text-align: center;
}

.health-table thead th {
  color: #fff;
  background: var(--purple);
  font-size: 0.82rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.health-table thead th:first-child {
  text-align: left;
}

.health-table tbody th,
.health-table tfoot th {
  color: var(--purple-dark);
  font-family: var(--serif);
  font-size: 1.17rem;
  font-weight: 600;
  text-align: left;
  white-space: nowrap;
}

.health-table tbody td,
.health-table tfoot td {
  color: var(--ink);
  font-weight: 650;
}

.health-table tbody tr:hover {
  background: #fcf9fd;
}

.health-table tfoot th,
.health-table tfoot td {
  border-bottom: 0;
  background: var(--purple-pale);
  font-weight: 800;
}

.chakra-dot {
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 12px;
  border-radius: 50%;
  box-shadow: 0 0 0 3px rgba(127, 104, 148, 0.08);
}

.chakra-violet { background: #7650a8; }
.chakra-indigo { background: #3f52a8; }
.chakra-blue { background: #27a2c7; }
.chakra-green { background: #64a84d; }
.chakra-yellow { background: #e4b62f; }
.chakra-orange { background: #e68b27; }
.chakra-red { background: #c84b4b; }

.initiatic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.initiatic-grid.is-compatibility {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.initiatic-card {
  position: relative;
  min-height: 270px;
  padding: 32px;
  overflow: hidden;
  border: 1px solid var(--purple-line);
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 17px 45px rgba(71, 45, 88, 0.06);
}

.initiatic-card::after {
  position: absolute;
  right: -50px;
  bottom: -55px;
  width: 140px;
  height: 140px;
  border: 1px solid rgba(215, 164, 62, 0.25);
  border-radius: 50%;
  content: "";
}

.initiatic-card-featured {
  border-color: rgba(215, 164, 62, 0.7);
  background: linear-gradient(145deg, #fffdf8, #fff);
}

.initiatic-card-gift {
  border-color: rgba(127, 104, 148, 0.38);
  background: linear-gradient(145deg, #fbf8fd, #fff 68%);
}

.card-number {
  display: block;
  margin-bottom: 27px;
  color: var(--gold);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.14em;
}

.initiatic-card h3 {
  margin-bottom: 16px;
}

.initiatic-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.initiatic-card .cultivation-line {
  position: relative;
  z-index: 1;
  margin-top: 24px;
  padding-top: 16px;
  border-top: 1px solid rgba(215, 164, 62, 0.42);
  color: var(--purple-dark);
  font-size: 0.9rem;
  line-height: 1.55;
}

.cultivation-line strong {
  color: var(--gold);
  font-weight: 750;
}

.disclaimer {
  width: min(100%, 900px);
  margin: 70px auto 0;
  padding: 22px 26px;
  border-left: 3px solid var(--gold);
  border-radius: 0 16px 16px 0;
  color: #625a65;
  background: #fcfaf6;
  font-size: 0.9rem;
}

.disclaimer p {
  margin: 0;
}

.closing-invitation {
  max-width: 820px;
  margin: 110px auto 0;
  padding: clamp(44px, 7vw, 72px);
  border: 1px solid var(--purple-line);
  border-radius: 30px;
  background: linear-gradient(150deg, var(--purple-pale), #fff 65%);
  text-align: center;
}

.closing-invitation h2 {
  font-size: clamp(2rem, 4vw, 3rem);
}

.closing-invitation p {
  max-width: 610px;
  margin: 0 auto 28px;
  color: var(--muted);
}

.link-button {
  width: fit-content;
}

@media (max-width: 900px) {
  .site-shell {
    width: min(100% - 28px, 1180px);
    padding-top: 55px;
  }

  .calculator-form:not(.compatibility-form) {
    grid-template-columns: 1fr 1fr;
  }

  .calculator-form:not(.compatibility-form) .form-action {
    grid-column: 1 / -1;
    margin-top: 4px;
  }

  .initiatic-grid {
    grid-template-columns: 1fr;
  }

  .initiatic-grid.is-compatibility {
    grid-template-columns: 1fr;
  }

  .initiatic-card {
    min-height: 0;
  }
}

@media (max-width: 650px) {
  .site-shell {
    width: min(100% - 20px, 1180px);
    padding: 42px 0 80px;
  }

  .hero {
    margin-bottom: 38px;
  }

  h1 {
    font-size: clamp(2.3rem, 11.5vw, 3.3rem);
  }

  .tabs {
    gap: 8px;
  }

  .tab-button {
    min-height: 52px;
    padding: 10px 12px;
    font-size: 0.88rem;
  }

  .calculator-card {
    border-radius: 22px;
  }

  .tab-panel {
    padding: 30px 18px 34px;
  }

  .calculator-form:not(.compatibility-form),
  .field-grid {
    grid-template-columns: 1fr;
  }

  .person-fieldset {
    padding: 22px 16px;
  }

  .primary-button,
  .secondary-button {
    width: 100%;
  }

  .result-section,
  .health-section,
  .initiatic-section,
  .closing-invitation {
    margin-top: 80px;
  }

  .matrix-frame {
    padding: 4px;
    border-radius: 18px;
  }

  .health-table th,
  .health-table td {
    padding: 14px 12px;
  }

  .health-table tbody th,
  .health-table tfoot th {
    font-size: 1rem;
  }

  .chakra-dot {
    margin-right: 7px;
  }

  .initiatic-card {
    padding: 26px;
  }

  .closing-invitation {
    padding: 42px 22px;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}

@media print {
  body {
    background: #fff;
  }

  .site-shell {
    width: 100%;
    padding: 0;
  }

  .hero,
  .calculator-card,
  .result-actions,
  .closing-invitation {
    display: none !important;
  }

  .result-section,
  .health-section,
  .initiatic-section {
    margin-top: 32px;
  }

  .matrix-frame,
  .table-wrap,
  .initiatic-card {
    box-shadow: none;
  }
}
