:root {
  color-scheme: light;
  --paper: #f8f8f5;
  --white: #ffffff;
  --ink: #202b2e;
  --muted: #627076;
  --line: #dce1dd;
  --accent: #a95231;
  --accent-light: #f3e8df;
  --dark: #233139;
  --dark-soft: #34434a;
  --dark-muted: #b9c7ca;
  --font-ui: "DM Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-display: "Manrope", "DM Sans", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body { margin: 0; background: var(--paper); color: var(--ink); font-family: var(--font-ui); font-size: 16px; line-height: 1.58; -webkit-font-smoothing: antialiased; }
button, input { font: inherit; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }
output, .diagram-label, .diagram-small { font-variant-numeric: tabular-nums; }
::selection { background: #d8b8a3; color: #182327; }
:focus-visible { outline: 3px solid #bd754f; outline-offset: 3px; }
.page-width { width: min(960px, calc(100% - 64px)); margin-inline: auto; }
.skip-link { position: fixed; z-index: 100; top: -80px; left: 18px; background: var(--dark); color: #fff; padding: 10px 16px; border-radius: 4px; }
.skip-link:focus { top: 18px; }

.site-header { border-bottom: 1px solid #e8eae5; background: rgba(248, 248, 245, .96); }
.header-inner { height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 32px; }
.brand { display: inline-flex; align-items: center; gap: 12px; text-decoration: none; font-family: var(--font-display); font-weight: 800; font-size: 15px; letter-spacing: -.035em; white-space: nowrap; }
.brand-mark { display: block; flex: 0 0 auto; width: 28px; height: 28px; }
.site-nav { display: flex; align-items: center; gap: 34px; }
.site-nav a { text-decoration: none; color: #465459; font-weight: 600; font-size: 13px; transition: color .2s ease; }
.site-nav a:hover, .site-nav a:focus-visible { color: var(--accent); }

.hero { max-width: 860px; padding-top: 68px; padding-bottom: 38px; display: flex; justify-content: space-between; align-items: end; gap: 32px; }
.eyebrow, .section-index, .optional-label, .result-label, .example-label { font-size: 11px; font-weight: 800; letter-spacing: .15em; line-height: 1.3; }
.eyebrow { display: flex; align-items: center; gap: 10px; color: var(--accent); }
.eyebrow-line { width: 23px; height: 1px; background: currentColor; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { font-family: var(--font-display); }
h1 { margin: 17px 0 17px; font-size: clamp(42px, 5.5vw, 68px); line-height: 1.07; letter-spacing: -.075em; font-weight: 800; }
h1::after { content: "."; color: var(--accent); }
.hero-copy > p { max-width: 690px; margin-bottom: 0; color: #526166; font-size: 17px; line-height: 1.7; }
.calculator-shell { max-width: 860px; margin-inline: auto; overflow: hidden; border: 1px solid #dde3dd; border-radius: 11px; background: var(--white); box-shadow: 0 12px 28px rgba(36, 46, 48, .035); }
.calculator-inputs { padding: 28px 34px 25px; }
.section-index { color: var(--accent); }
.panel-heading h2, .calculator-results h2 { margin: 0 0 5px; font-size: 22px; line-height: 1.25; letter-spacing: -.045em; font-weight: 700; }
.panel-heading p { margin-bottom: 22px; color: var(--muted); font-size: 13px; }
.field-row { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }
.calculator-inputs .field { margin-bottom: 0; }
.calculator-inputs .field-hint { margin-top: 11px; }
.field { margin-bottom: 15px; }
.field label { display: block; color: #263337; font-weight: 700; font-size: 13px; margin-bottom: 8px; }
.field label span { color: #748186; font-weight: 500; }
.input-wrap { height: 48px; border: 1px solid #cbd3d0; border-radius: 5px; background: #fff; display: flex; align-items: center; transition: border-color .18s ease, box-shadow .18s ease; }
.input-wrap:focus-within { border-color: #9a5f44; box-shadow: 0 0 0 3px #a952311d; }
.input-wrap:has(input[aria-invalid="true"]) { border-color: #b34538; }
.input-wrap input { width: 100%; height: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); padding: 0 16px; font-size: 16px; font-weight: 600; font-variant-numeric: tabular-nums; }
.input-wrap input::placeholder { color: #aab3b3; font-weight: 400; opacity: 1; }
.input-wrap input::-webkit-inner-spin-button, .input-wrap input::-webkit-outer-spin-button { -webkit-appearance: none; margin: 0; }
.input-wrap input[type="number"] { -moz-appearance: textfield; appearance: textfield; }
.field-hint, .field-error { margin: 7px 0 0; font-size: 12px; line-height: 1.45; }
.field-hint { color: #748186; }
.field-error { color: #a33d31; min-height: 0; }
.field-error:empty { display: none; }
.label-line { display: flex; justify-content: space-between; align-items: baseline; gap: 5px; }
.optional-label { color: #99a2a1; font-size: 9px; }
.price-field { margin-bottom: 0; }
.price-input .input-prefix { color: #8b9899; font-weight: 700; padding-left: 17px; }
.price-input input { padding-left: 8px; }

.calculator-results { padding: 24px 34px 23px; color: var(--ink); background: #f7f9f6; border-top: 1px solid #dde3dd; }
.calculator-results[hidden] { display: none; }
.calculator-results h2 { color: var(--ink); }
.cost-result[hidden] { display: none; }
.result-data { display: grid; grid-template-columns: minmax(0, 1.3fr) repeat(2, minmax(0, 1fr)); gap: 18px; align-items: end; margin-top: 17px; }
.calculator-results.has-cost .result-data { grid-template-columns: minmax(0, 1.3fr) repeat(3, minmax(0, 1fr)); gap: 14px; }
.result-label { display: block; color: #667a70; font-size: 11px; font-weight: 700; letter-spacing: .01em; }
.primary-result { padding: 0; }
.primary-value { display: flex; align-items: baseline; gap: 11px; margin-top: 1px; white-space: nowrap; }
.primary-value output { color: var(--ink); font-family: var(--font-display); font-size: clamp(48px, 4.8vw, 58px); font-weight: 700; line-height: 1.12; letter-spacing: -.075em; }
.primary-value > span { color: #667875; font-size: 15px; font-weight: 600; }
.secondary-result, .cost-result { min-width: 0; padding: 0 0 5px 18px; border-left: 1px solid #d9e0da; }
.secondary-value { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; margin-top: 6px; }
.secondary-value output { font-family: var(--font-display); font-size: 25px; font-weight: 700; letter-spacing: -.05em; line-height: 1.2; }
.secondary-value span { color: #6b7b78; font-size: 12px; }
.cost-value { margin-top: 6px; color: var(--ink); font-family: var(--font-display); font-size: 25px; line-height: 1.2; font-weight: 700; letter-spacing: -.05em; white-space: nowrap; }
.result-method { grid-column: 1 / -1; margin: 17px 0 0; padding-top: 11px; border-top: 1px solid #dce4dc; color: #687a75; font-size: 11px; line-height: 1.5; }
.result-method strong { color: #354942; font-weight: 700; }
.result-method a { margin-left: 6px; color: #985338; text-underline-offset: 3px; white-space: nowrap; }
.below-calculator { margin: 14px 0 0; color: #788484; font-size: 12px; text-align: center; }
.measurement-section { padding-top: 65px; }

.content-section { padding-block: 100px; scroll-margin-top: 20px; }
.section-heading h2 { margin: 13px 0 12px; max-width: 640px; font-size: clamp(30px, 3.4vw, 44px); line-height: 1.16; font-weight: 800; letter-spacing: -.065em; }
.section-heading > p { max-width: 560px; color: var(--muted); font-size: 16px; line-height: 1.75; }
.measure-grid { display: grid; grid-template-columns: .95fr 1.05fr; align-items: center; gap: clamp(54px, 8vw, 125px); margin-top: 34px; }
.measure-copy { max-width: 490px; color: #4b5b60; font-size: 15px; line-height: 1.85; }
.measure-copy p { margin-bottom: 17px; }
.measure-copy p:last-child { margin-bottom: 0; }
.diagram-card { margin: 0; border: 1px solid #d8ded8; border-radius: 8px; overflow: hidden; background: #eeefeb; box-shadow: 0 8px 24px rgba(32, 43, 46, .035); }
.diagram-card svg { width: 100%; }
.diagram-card figcaption { padding: 17px 22px 18px; background: #fffefa; color: #637175; font-size: 12px; line-height: 1.5; }
.diagram-label { fill: #334146; font-family: var(--font-ui); font-size: 11px; font-weight: 800; letter-spacing: .07em; }
.diagram-small { fill: #859293; font-family: var(--font-ui); font-size: 11px; font-weight: 800; letter-spacing: .11em; }

.method-section { padding-block: 44px; background: #eceeea; border-block: 1px solid #e1e5df; }
.method-grid .section-heading { margin-bottom: 20px; }
.method-grid .section-heading h2 { max-width: none; margin: 9px 0 6px; font-size: clamp(30px, 3.4vw, 38px); }
.method-grid .section-heading > p { max-width: none; margin: 0; font-size: 14px; line-height: 1.6; }
.formula-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 24px; list-style: none; margin: 0; padding: 0; }
.formula-list li { padding: 13px 0 0; border-top: 1px solid #cbd5ce; }
.formula-list li > span { display: block; margin-bottom: 8px; color: var(--accent); font-size: 11px; letter-spacing: .08em; font-weight: 800; }
.formula-list strong { display: block; margin-bottom: 3px; font-size: 14px; }
.formula-list p { margin: 0; color: #59686b; font-size: 13px; line-height: 1.55; }
.formula-tail { white-space: nowrap; }
.worked-example { display: grid; grid-template-columns: 220px minmax(0, 1fr); align-items: center; gap: 2px 20px; margin-top: 18px; padding: 15px 22px; background: var(--white); border: 1px solid #d8ded8; border-radius: 6px; }
.example-label { color: var(--accent); font-size: 10px; }
.example-values { grid-column: 2; grid-row: 1; display: flex; flex-wrap: wrap; align-items: baseline; gap: 14px; }
.example-metric { display: inline-flex; align-items: baseline; gap: 5px; white-space: nowrap; }
.example-metric + .example-metric::before { content: "→"; margin-right: 9px; color: #b1bebb; font-size: 18px; font-weight: 400; }
.worked-example strong { font-family: var(--font-display); font-size: 24px; line-height: 1.3; letter-spacing: -.05em; }
.example-metric > span { color: #788486; font-size: 12px; }
.worked-example p { grid-column: 2; grid-row: 2; color: #718082; font-size: 11px; margin: 0; }
.source-note { color: #657273; font-size: 12px; line-height: 1.55; margin: 10px 0 0; }
.source-note a { font-weight: 700; text-underline-offset: 3px; }

.details-section { display: grid; grid-template-columns: 1fr 1fr; gap: 22px; padding-top: 64px; }
.detail-card { padding: 36px 40px 30px; border: 1px solid #dee3dd; border-radius: 7px; background: #fffefa; }
.detail-card h2 { margin: 16px 0 17px; max-width: 390px; font-size: 26px; line-height: 1.27; letter-spacing: -.055em; }
.detail-card p { color: #58686c; font-size: 14px; line-height: 1.8; }
.detail-card p:last-child { margin-bottom: 0; }
.detail-card strong { color: var(--ink); }

.faq-section { padding-top: 12px; padding-bottom: 100px; }
.faq-section .section-heading { margin-bottom: 36px; }
.faq-list { border-top: 1px solid #d7ded8; }
.faq-list details { border-bottom: 1px solid #d7ded8; }
.faq-list summary { position: relative; display: block; list-style: none; cursor: pointer; padding: 21px 50px 21px 0; font-family: var(--font-display); font-size: 16px; line-height: 1.45; font-weight: 700; letter-spacing: -.025em; }
.faq-list summary::-webkit-details-marker { display: none; }
.faq-list summary::after { content: "+"; position: absolute; right: 7px; top: 16px; color: var(--accent); font-family: var(--font-ui); font-size: 25px; line-height: 1; font-weight: 400; }
.faq-list details[open] summary::after { content: "−"; }
.faq-list details p { max-width: 760px; padding: 0 50px 22px 0; margin: 0; color: #5d6c70; font-size: 14px; line-height: 1.8; }

.closing-section { margin-bottom: 86px; padding: 31px 38px; border-radius: 7px; background: #e8ece8; display: flex; justify-content: space-between; align-items: center; gap: 25px; }
.closing-section h2 { margin: 8px 0 3px; font-size: 23px; line-height: 1.3; letter-spacing: -.055em; }
.closing-section p { margin-bottom: 0; color: #657475; font-size: 13px; }
.back-link { flex: 0 0 auto; display: inline-flex; align-items: center; justify-content: center; gap: 12px; min-height: 46px; padding: 0 19px; border-radius: 4px; background: var(--dark); color: white; font-weight: 700; font-size: 13px; text-decoration: none; transition: background .2s ease, transform .2s ease; }
.back-link:hover { background: #3d4d52; transform: translateY(-1px); }
.site-footer { border-top: 1px solid #dfe4df; padding: 27px 0; }
.footer-inner { display: flex; align-items: center; gap: 22px; color: #80908f; font-size: 12px; }
.footer-brand { color: var(--ink); font-family: var(--font-display); font-size: 13px; font-weight: 800; letter-spacing: -.02em; }
.footer-inner a { margin-left: auto; color: #556467; text-underline-offset: 3px; }

@media (max-width: 1000px) {
  .calculator-inputs, .calculator-results { padding-inline: 28px; }
  .primary-value output { font-size: clamp(50px, 6vw, 62px); }
  .measure-grid { gap: 35px; }
}

@media (max-width: 760px) {
  .page-width { width: min(100% - 36px, 600px); }
  .header-inner { height: 66px; }
  .site-nav { gap: 18px; }
  .site-nav a { font-size: 12px; }
  .hero { padding-top: 45px; padding-bottom: 27px; }
  h1 { font-size: clamp(42px, 9vw, 60px); }
  .hero-copy > p { font-size: 15px; line-height: 1.7; }
  .calculator-inputs { padding: 27px 28px 22px; }
  .field-row { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .calculator-results { padding: 25px 28px 23px; }
  .result-data, .calculator-results.has-cost .result-data { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 18px; }
  .primary-result { grid-column: 1 / -1; }
  .primary-result + .secondary-result { padding-left: 0; border-left: 0; }
  .cost-result { grid-column: 1 / -1; padding: 14px 0 0; border-left: 0; border-top: 1px solid #dce4dc; }
  .result-method { margin-top: 0; }
  .primary-value output { font-size: 68px; }
  .content-section { padding-block: 76px; }
  .measure-grid, .details-section { grid-template-columns: 1fr; gap: 28px; }
  .measure-grid { margin-top: 24px; }
  .measure-copy { max-width: none; }
  .method-section { padding-block: 46px; }
  .method-grid .section-heading { margin-bottom: 22px; }
  .method-grid .section-heading > p { max-width: 550px; }
  .formula-list { grid-template-columns: 1fr; gap: 0; }
  .formula-list li { display: grid; grid-template-columns: 32px 1fr; gap: 12px; padding: 12px 0; }
  .formula-list li:last-child { border-bottom: 1px solid #cbd5ce; }
  .formula-list li > span { margin: 2px 0 0; }
  .worked-example { grid-template-columns: 1fr; gap: 5px; padding: 16px 19px; }
  .example-values, .worked-example p { grid-column: 1; grid-row: auto; }
  .details-section { gap: 15px; padding-top: 50px; }
  .detail-card { padding: 31px 29px; }
  .faq-section { padding-top: 0; padding-bottom: 74px; }
  .closing-section { margin-bottom: 60px; }
}

@media (max-width: 480px) {
  .page-width { width: calc(100% - 32px); }
  .brand { font-size: 13px; gap: 9px; }
  .brand-mark { width: 24px; height: 24px; }
  .site-nav a:first-child { display: none; }
  .hero { padding-top: 37px; }
  h1 { margin-top: 13px; margin-bottom: 13px; font-size: clamp(38px, 10vw, 48px); letter-spacing: -.07em; }
  .calculator-inputs, .calculator-results { padding-inline: 22px; }
  .calculator-inputs { padding-top: 27px; }
  .calculator-results { padding-top: 26px; }
  .field-row { gap: 12px; }
  .field-thickness, .price-field { grid-column: 1 / -1; }
  .field label { font-size: 12px; }
  .input-wrap input { padding-inline: 12px; }
  .primary-value output { font-size: clamp(56px, 16vw, 70px); }
  .primary-value > span { font-size: 14px; }
  .secondary-value output { font-size: 25px; }
  .secondary-result { padding-left: 14px; }
  .measurement-section { padding-top: 45px; }
  .section-heading h2 { font-size: 33px; }
  .content-section { padding-block: 66px; }
  .measure-copy { font-size: 14px; }
  .diagram-card figcaption { padding-inline: 15px; }
  .method-section { padding-block: 40px; }
  .formula-list li { grid-template-columns: 30px 1fr; gap: 7px; }
  .formula-list p { overflow-wrap: anywhere; }
  .worked-example { padding: 15px 17px; }
  .example-values { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; }
  .example-metric { display: flex; flex-direction: column; gap: 0; }
  .example-metric + .example-metric::before { display: none; }
  .example-metric > span { font-size: 11px; }
  .worked-example strong { font-size: 23px; }
  .detail-card { padding: 28px 24px; }
  .detail-card h2 { font-size: 24px; }
  .faq-section { padding-top: 0; padding-bottom: 60px; }
  .faq-list summary { font-size: 15px; }
  .closing-section { padding: 28px 25px; flex-direction: column; align-items: start; }
  .footer-inner { flex-wrap: wrap; gap: 5px 16px; }
  .footer-inner a { margin-left: 0; width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; }
}
