@import url('https://fonts.googleapis.com/css2?family=Cormorant+Garamond:wght@500;600&family=Inter:wght@400;500;600&display=swap');

:root {
  --forest: #17382f;
  --forest-soft: #244b40;
  --cream: #f6f0e5;
  --sand: #e8dcc8;
  --gold: #a98b53;
  --ink: #1f2925;
  --white: #fffdf8;
  --error: #8b2e2e;
  --shadow: 0 18px 55px rgba(23, 56, 47, .12);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at top left, rgba(169,139,83,.16), transparent 34rem),
    var(--cream);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

.page {
  width: min(1080px, calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0 80px;
}

.hero {
  max-width: 820px;
  margin-bottom: 34px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--gold);
  font-size: .75rem;
  font-weight: 600;
  letter-spacing: .19em;
}

h1, h2, h3 {
  font-family: "Cormorant Garamond", Georgia, serif;
  color: var(--forest);
}

h1 {
  margin: 0;
  font-size: clamp(3rem, 8vw, 6.2rem);
  line-height: .91;
  font-weight: 600;
  letter-spacing: -.035em;
}

.intro {
  max-width: 700px;
  margin: 24px 0 0;
  font-size: 1.08rem;
  line-height: 1.75;
}

.card, .results {
  border: 1px solid rgba(169,139,83,.34);
  border-radius: 26px;
  background: rgba(255,253,248,.9);
  box-shadow: var(--shadow);
}

.form-card, .results {
  padding: clamp(24px, 5vw, 52px);
}

.section-heading {
  display: flex;
  gap: 18px;
  align-items: flex-start;
  margin-bottom: 32px;
}

.section-heading > span {
  display: grid;
  place-items: center;
  min-width: 42px;
  height: 42px;
  border: 1px solid var(--gold);
  border-radius: 50%;
  color: var(--gold);
  font-size: .75rem;
}

.section-heading h2 {
  margin: -5px 0 3px;
  font-size: clamp(2rem, 5vw, 3.3rem);
}

.section-heading p { margin: 0; line-height: 1.55; }

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

label > span {
  display: block;
  margin-bottom: 8px;
  font-size: .88rem;
  font-weight: 600;
}

input {
  width: 100%;
  border: 1px solid #ccbfa9;
  border-radius: 14px;
  padding: 15px 16px;
  background: var(--white);
  color: var(--ink);
  font: inherit;
  outline: none;
}

input:focus {
  border-color: var(--gold);
  box-shadow: 0 0 0 4px rgba(169,139,83,.13);
}

small { display: block; margin-top: 7px; color: #6c746f; }

.privacy {
  display: flex;
  gap: 12px;
  align-items: flex-start;
  margin: 25px 0;
  line-height: 1.5;
}

.privacy input {
  width: 19px;
  height: 19px;
  margin-top: 2px;
  accent-color: var(--forest);
}

.privacy span { margin: 0; font-weight: 400; }

button, .reading-box a {
  display: inline-flex;
  justify-content: center;
  align-items: center;
  min-height: 54px;
  border: 0;
  border-radius: 999px;
  padding: 14px 25px;
  background: var(--forest);
  color: white;
  font: 600 .95rem Inter, sans-serif;
  text-decoration: none;
  cursor: pointer;
  transition: .2s ease;
}

button:hover, .reading-box a:hover {
  transform: translateY(-2px);
  background: var(--forest-soft);
}

button[disabled] { opacity: .65; cursor: wait; transform: none; }

.form-note {
  margin: 13px 0 0;
  color: #6c746f;
  font-size: .8rem;
}

.status {
  margin: 24px 0;
  min-height: 1px;
  line-height: 1.55;
}

.status.loading, .status.error, .status.success {
  padding: 16px 19px;
  border-radius: 14px;
}

.status.loading { background: #ece6d8; }
.status.error { background: #f8e7e4; color: var(--error); }
.status.success { background: #e3eee8; color: var(--forest); }

.results { margin-top: 28px; }

.bodygraph-wrap {
  margin: 18px auto 30px;
  padding: 24px;
  border-radius: 18px;
  background: white;
  text-align: center;
  overflow: auto;
}

.bodygraph-wrap svg, .bodygraph-wrap img {
  max-width: 100%;
  height: auto;
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 13px;
}

.result-card {
  min-height: 150px;
  padding: 20px;
  border-radius: 18px;
  background: var(--forest);
}

.result-label {
  margin: 0 0 18px;
  color: #d8c79f;
  font-size: .73rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: .14em;
}

.result-card h3 {
  margin: 0;
  color: white;
  font-size: 1.7rem;
  line-height: 1.05;
}

.interpretation {
  margin-top: 28px;
  padding: 25px;
  border-left: 3px solid var(--gold);
  background: #f1eadc;
  line-height: 1.7;
}

.interpretation h3 { margin-top: 0; font-size: 1.8rem; }

.reading-box {
  margin-top: 38px;
  padding: clamp(25px, 5vw, 46px);
  border-radius: 22px;
  background: #ede4d3;
  text-align: center;
}

.reading-box h2 {
  max-width: 750px;
  margin: 0 auto 12px;
  font-size: clamp(2rem, 5vw, 3.25rem);
}

.reading-box p:not(.eyebrow) {
  max-width: 690px;
  margin: 0 auto 24px;
  line-height: 1.65;
}

.debug {
  margin-top: 25px;
  color: #59635e;
  font-size: .82rem;
}

.debug pre {
  overflow: auto;
  max-height: 380px;
  padding: 16px;
  border-radius: 12px;
  background: #111816;
  color: #d9e5df;
  white-space: pre-wrap;
}

@media (max-width: 850px) {
  .result-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 650px) {
  .page { width: min(100% - 20px, 1080px); padding-top: 34px; }
  .grid, .result-grid { grid-template-columns: 1fr; }
  .form-card, .results { padding: 22px 17px; border-radius: 20px; }
  h1 { font-size: clamp(3.2rem, 17vw, 5rem); }
}


.custom-bodygraph {
  width: min(100%, 620px);
  height: auto;
  margin: 0 auto;
  display: block;
}

.bodygraph-title {
  margin-bottom: 10px;
  text-align: center;
}

.bodygraph-title p:last-child {
  margin: 0 auto;
  max-width: 620px;
  line-height: 1.55;
}

.mini-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 13px;
  margin-top: 13px;
}

.mini-card {
  padding: 20px;
  border: 1px solid rgba(169,139,83,.35);
  border-radius: 18px;
  background: #f7f1e6;
}

.mini-card h3 {
  margin: 0;
  font-size: 1.45rem;
}

.details-section {
  margin-top: 48px;
}

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

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

.detail-card {
  padding: 22px;
  border: 1px solid rgba(169,139,83,.32);
  border-radius: 18px;
  background: #fffdf8;
}

.detail-card-head {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: flex-start;
}

.detail-card h3 {
  margin: 0;
  font-size: 1.65rem;
}

.detail-card p {
  line-height: 1.65;
}

.pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 7px 10px;
  font-size: .68rem;
  font-weight: 700;
  letter-spacing: .06em;
  text-transform: uppercase;
  white-space: nowrap;
}

.pill.defined {
  background: var(--forest);
  color: white;
}

.pill.open {
  border: 1px solid var(--gold);
  color: var(--forest);
  background: transparent;
}

@media (max-width: 760px) {
  .mini-grid, .details-grid {
    grid-template-columns: 1fr;
  }
}
