:root {
  color-scheme: light;
  --ink: #17211b;
  --muted: #637065;
  --paper: #fffdf7;
  --field: #f3f8ef;
  --line: #d8dfd2;
  --cedar: #9f452d;
  --cedar-dark: #713220;
  --leaf: #2f6b4f;
  --leaf-dark: #214b39;
  --sky: #c6ddeb;
  --sun: #e8b84f;
  --warning-bg: #fff3d2;
  --danger-bg: #fbe0d7;
  --shadow: 0 18px 50px rgba(23, 33, 27, 0.12);
  --radius: 8px;
  --radius-lg: 14px;
  --content: 1180px;
  --font-heading: "Fraunces", Georgia, serif;
  --font-body: "Source Sans 3", "Segoe UI", ui-sans-serif, sans-serif;
  --font-mono: "SFMono-Regular", Consolas, monospace;
}

* {
  box-sizing: border-box;
}

[hidden] {
  display: none !important;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(198, 221, 235, 0.38) 0, rgba(255, 253, 247, 0) 420px),
    radial-gradient(circle at 85% 8%, rgba(232, 184, 79, 0.22), transparent 230px),
    var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  line-height: 1.5;
}

a {
  color: var(--leaf-dark);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
}

.skip-link {
  position: fixed;
  left: 16px;
  top: 16px;
  z-index: 100;
  transform: translateY(-180%);
  padding: 10px 14px;
  border-radius: var(--radius);
  color: #fff;
  background: var(--leaf-dark);
  font-weight: 700;
  text-decoration: none;
  transition: transform 0.15s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 253, 247, 0.92);
  border-bottom: 1px solid rgba(216, 223, 210, 0.82);
  backdrop-filter: blur(14px);
}

.nav-shell {
  width: min(var(--content), calc(100% - 32px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  color: #fff;
  background: var(--leaf);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  box-shadow: 0 6px 18px rgba(47, 107, 79, 0.25);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-links a {
  color: var(--muted);
  padding: 10px 12px;
  border-radius: var(--radius);
  font-size: 0.94rem;
  font-weight: 600;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a:focus-visible {
  color: var(--leaf-dark);
  background: var(--field);
}

main {
  overflow: hidden;
}

.hero,
.calculator-shell,
.layout-preview,
.content-section,
.site-footer {
  width: min(var(--content), calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  display: block;
  padding: 38px 0 12px;
}

.hero-copy {
  max-width: 900px;
}

.eyebrow {
  margin: 0 0 10px;
  color: var(--cedar-dark);
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

h1,
h2,
h3 {
  margin: 0;
  line-height: 1.06;
  font-family: var(--font-heading);
  font-weight: 600;
  color: var(--ink);
  letter-spacing: 0;
}

h1 {
  max-width: 920px;
  font-size: clamp(2.2rem, 4.9vw, 4.25rem);
}

h2 {
  font-size: clamp(1.85rem, 3.3vw, 2.72rem);
}

h3 {
  font-size: 1.22rem;
}

.hero-lede {
  max-width: 700px;
  margin: 16px 0 0;
  color: #314039;
  font-size: 1.08rem;
}

.trust-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.trust-row span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 7px 12px;
  border: 1px solid rgba(47, 107, 79, 0.22);
  border-radius: 999px;
  background: rgba(243, 248, 239, 0.72);
  color: var(--leaf-dark);
  font-size: 0.9rem;
  font-weight: 600;
}

.yard-card {
  position: relative;
  min-height: 430px;
  padding: 18px;
  border: 1px solid rgba(47, 107, 79, 0.18);
  border-radius: var(--radius-lg);
  background: #f9fbf4;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.yard-sky {
  height: 110px;
  margin: -18px -18px 0;
  background:
    linear-gradient(180deg, rgba(198, 221, 235, 0.95), rgba(198, 221, 235, 0.15)),
    repeating-linear-gradient(90deg, rgba(255,255,255,0.24) 0 1px, transparent 1px 58px);
}

.yard-board {
  position: relative;
  display: grid;
  grid-template-columns: 0.9fr 1.2fr;
  gap: 14px;
  min-height: 230px;
  margin-top: 18px;
  padding: 18px;
  border: 1px solid #c7d3bc;
  border-radius: var(--radius);
  background:
    linear-gradient(90deg, rgba(216, 223, 210, 0.7) 1px, transparent 1px),
    linear-gradient(rgba(216, 223, 210, 0.7) 1px, transparent 1px),
    #eef5e7;
  background-size: 32px 32px;
}

.preview-coop,
.preview-run {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 154px;
  border-radius: 6px;
  color: #fff;
  font-weight: 700;
  text-align: center;
}

.preview-coop {
  align-self: end;
  background:
    repeating-linear-gradient(90deg, rgba(255,255,255,0.08) 0 6px, transparent 6px 12px),
    var(--cedar);
  box-shadow: inset 0 0 0 3px rgba(113, 50, 32, 0.4);
}

.preview-run {
  background:
    repeating-linear-gradient(45deg, rgba(23,33,27,0.12) 0 1px, transparent 1px 11px),
    rgba(47, 107, 79, 0.72);
  box-shadow: inset 0 0 0 3px rgba(33, 75, 57, 0.35);
}

.yard-card p {
  margin: 18px 4px 0;
  color: var(--muted);
  font-weight: 600;
}

.layout-preview {
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(260px, 420px) minmax(260px, 1fr);
  align-items: center;
  gap: 18px;
  max-width: 980px;
  margin-top: 28px;
  padding: 16px;
}

.layout-preview .yard-sky {
  display: none;
}

.layout-preview .yard-board {
  min-height: 140px;
  margin-top: 0;
  padding: 14px;
  background-size: 28px 28px;
}

.layout-preview .preview-coop,
.layout-preview .preview-run {
  min-height: 94px;
}

.layout-preview p {
  margin: 0;
  max-width: 440px;
}

.calculator-shell {
  margin-top: 14px;
  padding: 24px;
  border: 1px solid rgba(47, 107, 79, 0.22);
  border-radius: var(--radius-lg);
  background: rgba(255, 253, 247, 0.96);
  box-shadow: var(--shadow);
}

.calculator-heading-row {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.calculator-heading-row h2 {
  font-size: clamp(1.75rem, 2.9vw, 2.52rem);
}

.action-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.primary-button,
.ghost-button,
.tab-button,
.preset-button {
  min-height: 42px;
  border-radius: var(--radius);
  border: 1px solid transparent;
  font-weight: 700;
}

.primary-button {
  padding: 10px 16px;
  color: #fff;
  background: var(--leaf);
}

.primary-button:hover,
.primary-button:focus-visible {
  background: var(--leaf-dark);
}

.ghost-button {
  padding: 10px 16px;
  color: var(--leaf-dark);
  background: var(--field);
  border-color: rgba(47, 107, 79, 0.24);
}

.ghost-button:hover,
.ghost-button:focus-visible {
  background: #e5f0dc;
}

.tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  max-width: 520px;
  margin-bottom: 22px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #eef4e9;
}

.tab-button {
  color: var(--muted);
  background: transparent;
  font-weight: 600;
}

.tab-button.is-active {
  color: #fff;
  background: var(--cedar);
  box-shadow: 0 6px 16px rgba(159, 69, 45, 0.18);
}

.tool-grid {
  display: grid;
  grid-template-columns: minmax(300px, 0.9fr) minmax(360px, 1.1fr);
  gap: 24px;
}

.input-panel,
.results-panel {
  min-width: 0;
}

.input-panel {
  display: flex;
  flex-direction: column;
  gap: 18px;
}

.panel-note {
  margin: 0 0 12px;
  color: var(--muted);
  font-weight: 600;
}

.preset-row {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 8px;
}

.preset-button {
  padding: 8px;
  color: var(--leaf-dark);
  background: #fff;
  border-color: var(--line);
  font-size: 0.9rem;
}

.preset-button:hover,
.preset-button:focus-visible {
  border-color: var(--leaf);
  background: var(--field);
}

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

label {
  display: grid;
  gap: 7px;
  color: #2e3a33;
  font-size: 0.92rem;
  font-weight: 600;
}

.unit-hint {
  color: var(--muted);
  font-weight: 600;
}

input,
select {
  width: 100%;
  min-height: 44px;
  padding: 10px 12px;
  color: var(--ink);
  border: 1px solid #c8d3c0;
  border-radius: var(--radius);
  background: #fff;
}

input:focus,
select:focus,
button:focus-visible,
a:focus-visible,
summary:focus-visible {
  outline: 3px solid rgba(232, 184, 79, 0.56);
  outline-offset: 2px;
}

.unit-field {
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 44px;
  margin: 0;
  padding: 9px 12px;
  border: 1px solid #c8d3c0;
  border-radius: var(--radius);
  background: #fff;
}

.unit-field legend {
  padding: 0 6px;
  color: #2e3a33;
  font-size: 0.92rem;
  font-weight: 600;
}

.unit-field label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.unit-field input {
  width: auto;
  min-height: auto;
}

.fine-print {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

.results-panel {
  display: grid;
  gap: 16px;
}

.result-hero {
  padding: 22px;
  border-radius: var(--radius);
  background:
    linear-gradient(135deg, rgba(47, 107, 79, 0.96), rgba(33, 75, 57, 0.96)),
    var(--leaf);
  color: #fff;
}

.result-hero .eyebrow,
.result-hero p,
.result-hero h3 {
  color: rgba(255, 255, 255, 0.86);
}

.result-hero p {
  margin: 8px 0 0;
}

.hero-number {
  color: #fff;
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.3vw, 3.05rem);
  font-weight: 600;
  line-height: 1;
}

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

.metric-card,
.formula-card,
.note-card,
.rule-grid article {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

.metric-card {
  min-height: 120px;
  padding: 16px;
}

.metric-card span {
  display: block;
  color: var(--muted);
  font-size: 0.77rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.metric-card strong {
  display: block;
  margin-top: 8px;
  color: var(--ink);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.72rem;
  line-height: 1;
}

.metric-card small {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 600;
}

.footprint-area,
.verdict-card,
.warnings {
  display: grid;
  gap: 12px;
}

.section-minihead {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
}

.section-minihead h3 {
  font-size: 1.2rem;
}

.section-minihead p {
  margin: 0;
  color: var(--muted);
  font-size: 0.9rem;
}

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

.footprint-card {
  min-height: 88px;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--field);
}

.footprint-card strong {
  display: block;
  font-size: 1.35rem;
}

.footprint-card span {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 0.88rem;
  font-weight: 600;
}

.verdict-card {
  padding: 16px;
  border: 1px solid rgba(47, 107, 79, 0.28);
  border-left: 6px solid var(--leaf);
  border-radius: var(--radius);
  background: #f4faef;
}

.verdict-card.is-tight {
  border-left-color: var(--sun);
  background: var(--warning-bg);
}

.verdict-card.is-small {
  border-left-color: var(--cedar);
  background: var(--danger-bg);
}

.verdict-card p {
  margin: 8px 0 0;
  color: #38453d;
  font-weight: 600;
}

.warning-card {
  padding: 13px 14px;
  border: 1px solid rgba(159, 69, 45, 0.22);
  border-left: 5px solid var(--cedar);
  border-radius: var(--radius);
  background: #fff6ed;
  color: #3b2b24;
  font-weight: 600;
}

.print-summary {
  display: none;
}

.content-section {
  padding: 70px 0;
  border-bottom: 1px solid rgba(216, 223, 210, 0.8);
}

.content-section > p,
.content-section > .source-note,
.split-section p {
  max-width: 780px;
  color: #344139;
  font-size: 1.05rem;
}

.table-wrap {
  margin-top: 24px;
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

table {
  width: 100%;
  min-width: 720px;
  border-collapse: collapse;
}

th,
td {
  padding: 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}

th {
  color: var(--leaf-dark);
  background: var(--field);
  font-size: 0.82rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

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

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 0.56fr);
  gap: 42px;
  align-items: start;
}

.note-card {
  padding: 24px;
  background: #fff;
  box-shadow: 0 12px 32px rgba(23, 33, 27, 0.08);
}

.note-card p {
  margin-bottom: 0;
}

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

.rule-grid article {
  min-height: 128px;
  padding: 18px;
  background: #f8fbf4;
}

.rule-grid strong {
  display: block;
  color: var(--cedar-dark);
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 2.2rem;
  line-height: 1;
}

.rule-grid span {
  display: block;
  margin-top: 8px;
  color: var(--muted);
  font-weight: 600;
}

.formula-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin-top: 24px;
}

.formula-card {
  min-height: 150px;
  padding: 22px;
  background: #fff;
}

.formula-card p {
  margin: 12px 0 0;
  color: var(--muted);
  font-weight: 600;
}

code {
  padding: 2px 5px;
  border-radius: 5px;
  background: #eef4e9;
  color: #25362d;
  font-family: var(--font-mono);
  font-size: 0.92em;
}

.source-note {
  margin-top: 22px;
}

.ad-slot {
  width: min(920px, calc(100% - 32px));
  min-height: 96px;
  margin: 24px auto 0;
  display: grid;
  place-items: center;
  border: 1px dashed #bdc8b4;
  border-radius: var(--radius);
  background: rgba(243, 248, 239, 0.62);
  color: #7b877d;
  font-size: 0.78rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.faq-section {
  display: grid;
  gap: 12px;
}

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

details {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: #fff;
}

summary {
  min-height: 58px;
  display: flex;
  align-items: center;
  padding: 16px 18px;
  color: var(--ink);
  cursor: pointer;
  font-weight: 700;
}

details p {
  margin: 0;
  padding: 0 18px 18px;
  color: #3d4a42;
}

.site-footer {
  padding: 36px 0 54px;
  color: var(--muted);
  font-size: 0.95rem;
  font-weight: 600;
}

.site-footer p {
  margin: 0;
}

.site-footer p + p {
  margin-top: 10px;
}

.site-footer a {
  color: var(--ink);
  font-weight: 700;
  text-decoration: none;
}

.site-footer a:hover {
  text-decoration: underline;
}

.page-main {
  max-width: 1180px;
  margin: 0 auto;
  padding: 36px 24px 24px;
}

.legal-page {
  max-width: 760px;
  padding-top: 54px;
}

.legal-page h1 {
  margin: 0 0 18px;
  font-size: clamp(2.2rem, 6vw, 3.4rem);
}

.legal-page h2 {
  margin: 34px 0 10px;
  color: var(--ink);
  font-size: 1.35rem;
}

.legal-page p {
  margin: 0 0 14px;
  color: var(--muted);
  line-height: 1.72;
}

.legal-page a {
  color: var(--leaf);
  font-weight: 700;
}

@media (max-width: 920px) {
  .hero,
  .layout-preview,
  .tool-grid,
  .split-section {
    grid-template-columns: 1fr;
  }

  .hero {
    gap: 28px;
    padding-top: 30px;
  }

  .yard-card {
    min-height: 340px;
  }

  .layout-preview {
    min-height: 0;
  }

  .calculator-heading-row,
  .section-minihead {
    align-items: flex-start;
    flex-direction: column;
  }

  .action-row {
    justify-content: flex-start;
  }
}

@media (max-width: 660px) {
  .nav-shell {
    width: min(var(--content), calc(100% - 22px));
  }

  .nav-links {
    display: none;
  }

  .hero,
  .calculator-shell,
  .layout-preview,
  .content-section,
  .site-footer {
    width: min(var(--content), calc(100% - 22px));
  }

  .hero {
    padding: 26px 0 8px;
  }

  h1 {
    font-size: clamp(2rem, 11.2vw, 3.05rem);
  }

  .hero-lede {
    font-size: 1rem;
  }

  .yard-card {
    min-height: 300px;
    padding: 12px;
  }

  .layout-preview {
    min-height: 0;
    margin-top: 16px;
  }

  .yard-sky {
    margin: -12px -12px 0;
    height: 72px;
  }

  .yard-board {
    min-height: 170px;
    padding: 12px;
    background-size: 24px 24px;
  }

  .layout-preview .yard-board {
    min-height: 126px;
  }

  .preview-coop,
  .preview-run {
    min-height: 112px;
    font-size: 0.86rem;
  }

  .layout-preview .preview-coop,
  .layout-preview .preview-run {
    min-height: 82px;
  }

  .calculator-shell {
    padding: 14px;
    margin-top: 10px;
  }

  .tabs,
  .preset-row,
  .field-grid,
  .dimension-grid,
  .metric-grid,
  .footprint-list,
  .rule-grid,
  .formula-grid {
    grid-template-columns: 1fr;
  }

  .tabs {
    max-width: none;
  }

  .action-row,
  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .primary-button,
  .ghost-button {
    justify-content: center;
  }

  .result-hero {
    padding: 18px;
  }

  .hero-number {
    font-size: 2rem;
  }

  .content-section {
    padding: 48px 0;
  }
}

@media print {
  :root {
    --ink: #111;
  }

  body {
    background: #fff;
    color: #111;
    font-family: var(--font-body);
  }

  .site-header,
  .hero,
  .calculator-shell,
  .content-section,
  .ad-slot,
  .site-footer {
    display: none !important;
  }

  .print-summary {
    display: block;
    width: auto;
    margin: 0;
    padding: 0;
  }

  .print-summary h2 {
    margin-bottom: 16px;
    color: #111;
    font-size: 24px;
  }

  .print-block {
    break-inside: avoid;
    margin: 0 0 18px;
    padding: 0 0 14px;
    border-bottom: 1px solid #bbb;
  }

  .print-block h3 {
    margin-bottom: 8px;
    color: #111;
    font-size: 16px;
  }

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

  .print-grid p,
  .print-block p,
  .print-block li {
    margin: 0 0 6px;
    font-size: 12px;
    line-height: 1.35;
  }

  a {
    color: #111;
    text-decoration: none;
  }

  @page {
    margin: 0.65in;
  }
}
