:root {
  --bg: #fbfaf7;
  --surface: #ffffff;
  --surface-alt: #f3f2ee;
  --border: #e2e0d9;
  --text: #1c1917;
  --muted: #57534e;
  --accent: #0f766e;
  --accent-strong: #115e59;
  --accent-soft: #e6f2f0;
  --danger: #b91c1c;
  --radius: 12px;
  --wrap: 1080px;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0b1220;
    --surface: #111a2b;
    --surface-alt: #16203a;
    --border: #243049;
    --text: #e8eef7;
    --muted: #a3b1c6;
    --accent: #2dd4bf;
    --accent-strong: #5eead4;
    --accent-soft: #10312f;
    --danger: #f87171;
    color-scheme: dark;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
  * {
    transition: none !important;
  }
}

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

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 2px;
}

a:hover {
  color: var(--accent-strong);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: 4px;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.skip-link {
  position: absolute;
  left: 12px;
  top: -48px;
  z-index: 10;
  padding: 10px 14px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
}

.skip-link:focus {
  top: 12px;
}

/* header */

.site-header {
  border-bottom: 1px solid var(--border);
  background: var(--surface);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px 24px;
  padding-top: 12px;
  padding-bottom: 12px;
}

.brand {
  color: var(--text);
  font-weight: 700;
  font-size: 1.0625rem;
  letter-spacing: -0.01em;
  text-decoration: none;
}

.brand:hover {
  color: var(--accent);
}

.nav-list {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.9375rem;
}

.nav-list a {
  color: var(--muted);
  text-decoration: none;
}

.nav-list a:hover {
  color: var(--accent);
}

/* crumbs */

.crumbs {
  padding-top: 16px;
  font-size: 0.8125rem;
  color: var(--muted);
}

.crumbs ol {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.crumbs li + li::before {
  content: "/";
  margin-right: 6px;
  color: var(--border);
}

/* type */

.hero {
  padding: 32px 0 4px;
}

h1,
h2,
h3 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 12px;
}

h1 {
  font-size: clamp(1.75rem, 4.4vw, 2.5rem);
  max-width: 24ch;
}

h2 {
  font-size: clamp(1.25rem, 2.6vw, 1.5rem);
}

h3 {
  font-size: 1.0625rem;
}

p {
  margin: 0 0 12px;
}

.eyebrow {
  margin: 0 0 8px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
}

.lede {
  max-width: 68ch;
  font-size: 1.0625rem;
  color: var(--muted);
}

.section {
  margin-top: 40px;
}

.section > h2 {
  margin-bottom: 8px;
}

.section-intro {
  max-width: 65ch;
  color: var(--muted);
}

.muted {
  color: var(--muted);
}

.note {
  font-size: 0.875rem;
  color: var(--muted);
}

.est {
  display: inline-block;
  margin-left: 2px;
  padding: 0 4px;
  border: 1px solid var(--border);
  border-radius: 4px;
  font-size: 0.6875rem;
  font-weight: 600;
  line-height: 1.5;
  color: var(--muted);
  vertical-align: 1px;
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.code {
  display: inline-block;
  padding: 0 6px;
  border-radius: 999px;
  background: var(--surface-alt);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--muted);
}

/* panel + calculator */

.panel {
  margin-top: 28px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 16px;
}

.calc-fields {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin: 18px 0 20px;
}

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

.field label {
  font-size: 0.875rem;
  font-weight: 600;
}

.field input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
  color: var(--text);
  font: inherit;
  font-size: 1rem;
}

.field input:focus {
  border-color: var(--accent);
}

.hint {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--muted);
  line-height: 1.45;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 10px;
  background: var(--accent);
  color: #ffffff;
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

@media (prefers-color-scheme: dark) {
  .button {
    color: #04201c;
  }
}

.button:hover {
  background: var(--accent-strong);
}

.calc-error {
  margin: 14px 0 0;
  color: var(--danger);
  font-size: 0.875rem;
  font-weight: 600;
}

.calc-result {
  margin-top: 22px;
}

.calc-result:empty {
  display: none;
}

.result-card {
  padding-top: 18px;
  border-top: 1px solid var(--border);
}

.result-card h3 {
  margin-bottom: 6px;
  font-size: 1.25rem;
}

.result-dims {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
  margin: 16px 0 0;
}

.result-dims div {
  padding: 12px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg);
}

.result-dims dt {
  margin-bottom: 2px;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--muted);
}

.result-dims dd {
  margin: 0;
  font-variant-numeric: tabular-nums;
  font-size: 0.9375rem;
}

.result-note {
  margin-top: 12px;
  padding: 10px 14px;
  border-left: 3px solid var(--accent);
  background: var(--accent-soft);
  border-radius: 0 8px 8px 0;
  font-size: 0.9375rem;
}

/* tables */

.table-wrap {
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
}

.table-wrap table {
  min-width: 640px;
}

table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
  font-variant-numeric: tabular-nums;
}

th,
td {
  padding: 10px 12px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--border);
}

thead th {
  font-size: 0.8125rem;
  font-weight: 700;
  color: var(--muted);
  background: var(--surface-alt);
  white-space: nowrap;
}

tbody tr:last-child th,
tbody tr:last-child td {
  border-bottom: 0;
}

tbody th {
  font-weight: 600;
}

td.num {
  white-space: nowrap;
}

/* keep the row label visible while the table scrolls sideways on small screens */
.table-wrap tbody th[scope="row"],
.table-wrap thead th:first-child {
  position: sticky;
  left: 0;
  z-index: 1;
  background: var(--surface);
}

.table-wrap thead th:first-child {
  background: var(--surface-alt);
}

.table-wrap tbody th[scope="row"] {
  box-shadow: 1px 0 0 var(--border);
}

.dim-table {
  max-width: 40rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
}

/* lists */

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 8px;
  margin: 16px 0 0;
  padding: 0;
  list-style: none;
}

.link-grid a {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--surface);
  color: var(--text);
  text-decoration: none;
}

.link-grid a:hover {
  border-color: var(--accent);
}

.link-grid .muted {
  font-size: 0.8125rem;
}

.checklist {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
}

.checklist li {
  position: relative;
  padding-left: 26px;
  margin-bottom: 8px;
}

.checklist li::before {
  content: "";
  position: absolute;
  left: 6px;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.measure-list {
  max-width: 65ch;
  margin: 12px 0 16px;
  padding-left: 22px;
}

.measure-list li {
  margin-bottom: 6px;
}

/* callout */

.callout {
  margin: 16px 0;
  padding: 14px 16px;
  border-left: 4px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--accent-soft);
}

.callout p:last-child {
  margin-bottom: 0;
}

.callout-answer {
  margin-top: 0;
}

.answer-dims {
  font-size: 0.875rem;
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}

/* faq */

.faq {
  margin-top: 16px;
}

.faq-item {
  padding: 16px 0;
  border-top: 1px solid var(--border);
}

.faq-item h3 {
  margin-bottom: 4px;
  font-size: 1rem;
}

.faq-item p {
  margin: 0;
  color: var(--muted);
}

.breed-growth {
  margin-top: 20px;
}

.breed-growth h3 {
  font-size: 1rem;
  margin-bottom: 8px;
}

/* footer */

.site-footer {
  margin-top: 64px;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.875rem;
}

.footer-inner {
  padding-top: 24px;
  padding-bottom: 40px;
}

.footer-inner p {
  margin: 0 0 4px;
}

@media (max-width: 720px) {
  .calc-fields,
  .result-dims {
    grid-template-columns: 1fr;
  }

  .panel {
    padding: 18px;
  }

  .hero {
    padding-top: 24px;
  }

  .section {
    margin-top: 32px;
  }

  h1 {
    max-width: none;
  }

  .header-inner {
    gap: 6px 12px;
  }

  .site-header nav {
    width: 100%;
  }

  .nav-list {
    font-size: 0.875rem;
    gap: 4px 14px;
  }

  /* compact rows: the whole table scrolls inside its container on phones */
  .table-wrap table {
    min-width: 860px;
  }

  .table-wrap th,
  .table-wrap td {
    white-space: nowrap;
  }
}

@media (max-width: 380px) {
  .wrap {
    padding: 0 16px;
  }

  .nav-list {
    font-size: 0.8125rem;
    gap: 4px 12px;
  }
}

@media print {
  .site-header,
  .site-footer,
  .skip-link {
    display: none;
  }
}
