/* Self-hosted Inter (OFL licensed). One variable woff2 covers the whole 100–900
   weight range, so no third-party font requests are made. */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("fonts/inter-latin.woff2") format("woff2");
}

:root {
  --bg: #fff8ef;
  --panel: rgba(255, 255, 255, 0.86);
  --ink: #2b2430;
  --muted: #716879;
  --line: #f0dcc5;
  --blue: #77c8f2;
  --blue-dark: #1d79a9;
  --peach: #ffb78d;
  --green: #64bc8d;
  --cream: #fff3df;
  --shadow: 0 24px 70px rgba(128, 91, 55, 0.16);
}

html {
  scroll-behavior: smooth;
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at 14% 10%, rgba(119, 200, 242, 0.38), transparent 28rem),
    radial-gradient(circle at 88% 12%, rgba(255, 183, 141, 0.34), transparent 24rem),
    radial-gradient(circle at 50% 100%, rgba(100, 188, 141, 0.18), transparent 30rem),
    linear-gradient(145deg, #fffdf8, var(--bg));
}

/* ── Site nav ── */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  justify-content: center;
  gap: 2px;
  padding: 8px 20px;
  background: rgba(255, 248, 236, 0.97);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid #f0dcc5;
  box-shadow: 0 1px 12px rgba(128, 91, 55, 0.08);
}

.site-nav a {
  font-size: 12px;
  font-weight: 700;
  color: #a05f28;
  text-decoration: none;
  padding: 5px 14px;
  border-radius: 20px;
  transition: all 0.18s;
  letter-spacing: 0.2px;
  -webkit-tap-highlight-color: transparent;
  touch-action: manipulation;
}

.site-nav a:hover {
  color: #7a4518;
  background: rgba(255, 183, 141, 0.28);
}

.site-nav a.active {
  color: white;
  background: linear-gradient(135deg, #ff9f64, #319c6c);
}

button,
input,
select {
  font: inherit;
}

.page {
  display: grid;
  min-height: 100vh;
  place-items: center;
  padding: clamp(18px, 4vw, 52px);
}

.calculator {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 0.92fr);
  gap: clamp(18px, 3vw, 30px);
  width: min(1120px, 100%);
  align-items: stretch;
}

.intro {
  grid-column: 1 / -1;
  max-width: 760px;
}

.eyebrow {
  margin: 0 0 10px;
  color: #a05f28;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

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

h1 {
  max-width: 760px;
  margin-bottom: 14px;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 0.95;
  letter-spacing: 0;
}

.intro p:not(.eyebrow) {
  max-width: 650px;
  margin-bottom: 0;
  color: var(--muted);
  font-size: 18px;
  line-height: 1.55;
}

.form-panel,
.result-panel {
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 26px;
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.form-panel {
  display: grid;
  gap: 18px;
  padding: clamp(18px, 3vw, 28px);
}

.segmented {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff0dc;
}

.segmented label {
  display: block;
}

.segmented input {
  position: absolute;
  width: 1px;
  height: 1px;
  opacity: 0;
}

.segmented span {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  min-height: 46px;
  border-radius: 13px;
  color: #65452d;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.18s, color 0.18s, box-shadow 0.18s;
}

.pet-emoji {
  font-size: 18px;
  line-height: 1;
}

.segmented input:checked + span {
  color: white;
  background: linear-gradient(135deg, #ff9f64, #319c6c);
  box-shadow: 0 12px 28px rgba(255, 159, 100, 0.28);
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(130px, 0.62fr);
  gap: 14px;
}

label {
  display: grid;
  gap: 8px;
  color: #5b412d;
  font-size: 13px;
  font-weight: 800;
}

input,
select {
  width: 100%;
  min-height: 50px;
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 0 14px;
  color: var(--ink);
  background: rgba(255, 253, 249, 0.94);
  outline: none;
  font-size: 16px; /* prevent iOS auto-zoom on focus */
}

input:focus,
select:focus {
  border-color: var(--peach);
  box-shadow: 0 0 0 4px rgba(255, 183, 141, 0.22);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  padding-top: 4px;
}

.primary,
.ghost {
  min-height: 52px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.primary {
  border: 0;
  color: white;
  background: linear-gradient(135deg, #ee8f51, #2f9f70);
}

.ghost {
  border: 1px solid var(--line);
  color: #63462f;
  background: white;
}

.primary:hover,
.ghost:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 38px rgba(238, 143, 81, 0.24);
}

.primary:active,
.ghost:active {
  transform: translateY(0);
  box-shadow: 0 6px 16px rgba(238, 143, 81, 0.2);
}

.result-panel {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  min-height: 100%;
  padding: clamp(20px, 3vw, 30px);
  background:
    linear-gradient(rgba(255, 255, 255, 0.84), rgba(255, 255, 255, 0.84)),
    radial-gradient(circle at 90% 8%, rgba(119, 200, 242, 0.56), transparent 10rem),
    radial-gradient(circle at 8% 92%, rgba(100, 188, 141, 0.28), transparent 12rem);
}

h2 {
  margin-bottom: 22px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1;
}

.result-grid {
  display: grid;
  gap: 12px;
}

.result-grid div {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  min-height: 68px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(255, 253, 249, 0.78);
}

.result-grid span {
  color: var(--muted);
  font-weight: 700;
}

.result-grid strong {
  color: #2f8b64;
  font-size: clamp(20px, 3vw, 30px);
  text-align: right;
  transition: color 0.2s;
}

/* Empty state: muted, awaiting input. */
.result-panel.is-empty .result-grid strong {
  color: #c3b6ac;
}

.result-panel.is-empty .result-grid div {
  opacity: 0.85;
}

/* Reveal animation when a fresh result is rendered. */
.result-panel.just-updated .result-grid div {
  animation: result-pop 0.45s cubic-bezier(0.22, 1, 0.36, 1) backwards;
}

.result-panel.just-updated .result-grid div:nth-child(1) { animation-delay: 0s; }
.result-panel.just-updated .result-grid div:nth-child(2) { animation-delay: 0.06s; }
.result-panel.just-updated .result-grid div:nth-child(3) { animation-delay: 0.12s; }
.result-panel.just-updated .result-grid div:nth-child(4) { animation-delay: 0.18s; }

@keyframes result-pop {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.note {
  margin: 24px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.content-section {
  grid-column: 1 / -1;
  max-width: 920px;
  margin-top: 8px;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 18px 48px rgba(128, 91, 55, 0.1);
}

.content-section h2 {
  margin: 30px 0 12px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.08;
}

.content-section h2:first-child {
  margin-top: 0;
}

.content-section p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.7;
}

.formula-box {
  display: grid;
  gap: 10px;
  max-width: 760px;
  margin: 16px 0 4px;
}

.formula-box span {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 16px;
  color: #5b412d;
  font-weight: 800;
  background: var(--cream);
}

.faq-list {
  display: grid;
  gap: 10px;
  max-width: 760px;
}

.faq-list details {
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 253, 249, 0.82);
}

.faq-list summary {
  padding: 16px;
  color: #5b412d;
  font-weight: 800;
  cursor: pointer;
}

.faq-list p {
  margin: 0;
  padding: 0 16px 16px;
}

/* ── Tips section ── */
.tips-section {
  grid-column: 1 / -1;
  max-width: 920px;
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.74);
  box-shadow: 0 18px 48px rgba(128, 91, 55, 0.1);
}

.tips-section h2 {
  margin: 0 0 20px;
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.08;
}

.tips-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
}

.tip-card {
  padding: 20px 18px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--cream);
  transition: border-color 0.18s;
}

.tip-card:hover {
  border-color: var(--peach);
}

.tip-icon {
  font-size: 24px;
  margin-bottom: 10px;
}

.tip-card h3 {
  margin: 0 0 6px;
  font-size: 14px;
  font-weight: 800;
  color: #5b412d;
}

.tip-card p {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
  line-height: 1.65;
}

/* ── Footer ── */
.site-footer {
  grid-column: 1 / -1;
  padding: 8px 0 16px;
  font-size: 12px;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
  opacity: 0.7;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .primary, .ghost { transition: none; }
  .result-panel.just-updated .result-grid div { animation: none; }
}

@media (max-width: 820px) {
  .page {
    place-items: start;
  }

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

  .field-row {
    grid-template-columns: 1fr;
  }

  .tips-grid {
    gap: 10px;
  }

  .tip-card {
    padding: 14px 12px;
  }

  .tip-icon {
    font-size: 20px;
    margin-bottom: 7px;
  }
}

/* ── Content / legal pages ── */
.doc-page {
  width: min(820px, 100%);
  margin: 0 auto;
}
.doc-page h1 {
  font-size: clamp(34px, 5vw, 52px);
  margin-bottom: 10px;
}
.doc-card {
  padding: clamp(22px, 4vw, 38px);
  border: 1px solid rgba(255, 255, 255, 0.82);
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.78);
  box-shadow: 0 18px 48px rgba(128, 91, 55, 0.1);
}
.doc-body h2 {
  margin: 26px 0 10px;
  font-size: clamp(20px, 2.5vw, 26px);
  line-height: 1.15;
}
.doc-body h2:first-child { margin-top: 0; }
.doc-body p,
.doc-body li {
  color: var(--muted);
  line-height: 1.75;
  font-size: 15px;
}
.doc-body p + p { margin-top: 12px; }
.doc-body ul { margin: 10px 0 0 20px; }
.doc-body li { margin-top: 6px; }
.doc-body a { color: var(--blue-dark); }
.doc-body strong { color: var(--ink); }
.doc-lead {
  font-size: 16px !important;
  color: #5b412d !important;
  margin-bottom: 4px;
}
.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 16px;
  justify-content: center;
  margin-bottom: 10px;
}
.footer-links a {
  color: #a05f28;
  text-decoration: none;
  font-weight: 700;
  font-size: 13px;
}
.footer-links a:hover { color: #7a4518; }
