/* The Stair Calculator — site styles (palette matches the homepage calculator) */
:root {
  --brand: #205d49;
  --brand-strong: #172d27;
  --brand-soft: #eef5ef;
  --brand-bright: #619641;
  --lime: #ddf993;
  --wood: #b07a3e;
  --wood-soft: #f7f0e6;
  --ink: #172d27;
  --ink-2: #2f4239;
  --muted: #52665e;
  --line: #dce4df;
  --surface: #ffffff;
  --surface-2: #f5f7f4;
  --ok: #15803d;
  --ok-soft: #e8f6ec;
  --warn: #b45309;
  --warn-soft: #fdf3e3;
  --bad: #b91c1c;
  --bad-soft: #fdecec;
  --radius: 14px;
  --radius-sm: 9px;
  --shadow: 0 1px 2px rgba(23, 45, 39, .06), 0 8px 24px rgba(23, 45, 39, .07);
  --wrap: 1240px;
  --read: 740px;
  --font: Inter, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 84px; }
body {
  margin: 0;
  font-family: var(--font);
  font-size: 1.0625rem;
  line-height: 1.7;
  color: var(--ink-2);
  background: var(--surface);
  overflow-x: hidden;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-strong); }
h1, h2, h3, h4 { color: var(--ink); line-height: 1.25; margin: 0 0 .6em; letter-spacing: -.01em; }
h1 { font-size: clamp(1.9rem, 4.2vw, 2.9rem); font-weight: 700; letter-spacing: -.035em; line-height: 1.12; }
h2 { font-size: clamp(1.45rem, 2.8vw, 1.95rem); font-weight: 650; letter-spacing: -.025em; margin-top: 2.2em; }
h3 { font-size: 1.22rem; font-weight: 700; margin-top: 1.7em; }
h4 { font-size: 1.05rem; font-weight: 700; margin-top: 1.4em; }
p, ul, ol, table, figure, blockquote { margin: 0 0 1.15em; }
ul, ol { padding-left: 1.3em; }
li { margin: .35em 0; }
li::marker { color: var(--brand); }
strong { color: var(--ink); }
hr { border: 0; border-top: 1px solid var(--line); margin: 2.5rem 0; }
:focus-visible { outline: 3px solid var(--brand-bright); outline-offset: 2px; border-radius: 4px; }

/* Side margins match the homepage calculator (.tsc-wrap) so every page lines up. */
.wrap { width: 100%; max-width: calc(var(--wrap) + 96px); margin: 0 auto; padding: 0 18px; }
@media (min-width: 541px) { .wrap { padding: 0 28px; } }
@media (min-width: 1101px) { .wrap { padding: 0 48px; } }

.skip-link { position: absolute; left: 12px; top: -60px; background: var(--ink); color: #fff; padding: 8px 14px; border-radius: 8px; z-index: 100; }
.skip-link:focus { top: 12px; color: #fff; }

/* Header */
.site-header { position: sticky; top: 0; z-index: 50; background: rgba(255, 255, 255, .94); backdrop-filter: saturate(160%) blur(10px); border-bottom: 1px solid var(--line); }
.site-header .wrap { display: flex; align-items: center; justify-content: space-between; gap: 16px; min-height: 72px; }
.brand { display: inline-flex; align-items: center; gap: 11px; text-decoration: none; color: var(--ink); font-weight: 750; font-size: 1.3rem; letter-spacing: -.045em; white-space: nowrap; }
.brand:hover { color: var(--ink); }
.brand svg { width: 32px; height: 32px; flex: none; }
.brand .brand-light { font-weight: 400; }
.brand .brand-dot { color: var(--brand-bright); }
.nav-toggle { display: inline-flex; align-items: center; justify-content: center; width: 44px; height: 44px; border: 1px solid var(--line); border-radius: 10px; background: #fff; color: var(--ink); cursor: pointer; }
.nav-toggle svg { width: 22px; height: 22px; }
.site-nav { display: none; }
.site-nav.open { display: block; position: absolute; left: 0; right: 0; top: 100%; background: #fff; border-bottom: 1px solid var(--line); box-shadow: var(--shadow); }
.site-nav ul { list-style: none; margin: 0; padding: 8px 16px 14px; }
.site-nav li { margin: 0; }
.site-nav a { display: block; padding: 11px 12px; border-radius: 9px; text-decoration: none; color: var(--ink); font-weight: 600; font-size: .98rem; }
.site-nav a:hover, .site-nav a[aria-current="page"] { background: var(--brand-soft); color: var(--brand-strong); }
.site-nav .nav-cta { background: var(--ink); color: #fff; text-align: center; margin-top: 6px; border-radius: 6px; }
.site-nav .nav-cta:hover { background: var(--brand); color: #fff; }
.site-nav .nav-cta span { margin-left: 10px; }
@media (min-width: 860px) {
  .nav-toggle { display: none; }
  .site-nav, .site-nav.open { display: block; position: static; box-shadow: none; border: 0; background: transparent; }
  .site-nav ul { display: flex; align-items: center; gap: 4px; padding: 0; }
  .site-nav a { padding: 8px 13px; font-size: .95rem; }
  .site-nav .nav-cta { margin: 0 0 0 8px; padding: 9px 16px; }
}

/* Buttons */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 46px; padding: 10px 20px; border-radius: 11px; border: 1px solid transparent; font: inherit; font-weight: 700; font-size: .98rem; line-height: 1.2; cursor: pointer; text-decoration: none; transition: background .15s, border-color .15s, color .15s; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:hover { background: var(--brand-strong); color: #fff; }
.btn-ghost { background: #fff; color: var(--ink); border-color: var(--line); }
.btn-ghost:hover { border-color: var(--brand); color: var(--brand-strong); }
.btn svg { width: 18px; height: 18px; }

[hidden] { display: none !important; }

/* Tables */
.table-wrap { overflow-x: auto; margin: 0 0 1.3em; border: 1px solid var(--line); border-radius: 12px; -webkit-overflow-scrolling: touch; }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: .93rem; line-height: 1.5; margin: 0; }
.table-wrap th, .table-wrap td { text-align: left; padding: 10px 12px; border-bottom: 1px solid var(--line); vertical-align: top; }
.table-wrap thead th { background: var(--surface-2); color: var(--ink); font-weight: 750; font-size: .84rem; text-transform: uppercase; letter-spacing: .03em; }
.table-wrap tbody tr:last-child td { border-bottom: 0; }
.table-wrap td:first-child { font-weight: 650; color: var(--ink); }
.num { font-variant-numeric: tabular-nums; white-space: nowrap; }

/* Sections */
.section { padding: 46px 0; }
.section-alt { background: var(--surface-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.section > .wrap > h2:first-child, .section-head h2 { margin-top: 0; }
.section-head { max-width: 780px; margin-bottom: 22px; }
.section-head p { color: var(--muted); font-size: 1.05rem; }
.prose { max-width: var(--read); }
.split { display: grid; gap: 28px; align-items: center; }
@media (min-width: 900px) { .split { grid-template-columns: 1.1fr .9fr; gap: 48px; } .split.reverse > :first-child { order: 2; } }
.split h2 { margin-top: 0; }
.card-grid { display: grid; gap: 16px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .card-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .card-grid.three { grid-template-columns: repeat(3, 1fr); } .card-grid.four { grid-template-columns: repeat(4, 1fr); } }
.card { background: #fff; border: 1px solid var(--line); border-radius: var(--radius); padding: 18px 18px 6px; }
.card h3 { margin-top: 0; font-size: 1.08rem; display: flex; align-items: center; gap: 10px; }
.card p { font-size: .97rem; }
.steps-list { counter-reset: step; list-style: none; padding: 0; display: grid; gap: 12px; }
.steps-list > li { counter-increment: step; position: relative; margin: 0; padding: 14px 16px 14px 60px; background: #fff; border: 1px solid var(--line); border-radius: 12px; }
.steps-list > li::before { content: counter(step); position: absolute; left: 14px; top: 13px; width: 32px; height: 32px; border-radius: 9px; background: var(--brand); color: #fff; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.steps-list h3 { margin: 2px 0 4px; font-size: 1.04rem; }
.steps-list p { margin: 0 0 .4em; font-size: .97rem; }
.formula { display: inline-block; font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: .88rem; background: var(--brand-soft); color: var(--brand-strong); border-radius: 7px; padding: 3px 9px; margin: 4px 0 6px; font-weight: 600; }

figure { margin: 1.6em 0; }
figure img { border-radius: 12px; background: #fff; border: 1px solid var(--line); width: 100%; }
figcaption { font-size: .86rem; color: var(--muted); margin-top: 8px; text-align: center; }
.media-frame img { border-radius: 16px; border: 1px solid var(--line); background: #fff; width: 100%; }

.callout { border-left: 4px solid var(--brand); background: var(--brand-soft); border-radius: 0 12px 12px 0; padding: 14px 18px; margin: 1.5em 0; }
.callout p:last-child, .callout ul:last-child { margin-bottom: 0; }
.callout .callout-title { display: block; font-weight: 800; color: var(--brand-strong); font-size: .82rem; letter-spacing: .06em; text-transform: uppercase; margin-bottom: 4px; }
.callout.wood { border-color: var(--wood); background: var(--wood-soft); }
.callout.wood .callout-title { color: #8a5a22; }
.callout.warn { border-color: var(--warn); background: var(--warn-soft); }
.callout.warn .callout-title { color: var(--warn); }
.related-inline { display: flex; gap: 10px; align-items: center; padding: 12px 16px; border: 1px solid var(--line); border-radius: 12px; margin: 1.5em 0; font-weight: 600; background: #fff; }
.related-inline::before { content: "Related"; font-size: .72rem; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ink); background: var(--lime); border-radius: 6px; padding: 3px 8px; flex: none; }
.related-inline a { text-decoration: none; }
.related-inline a:hover { text-decoration: underline; }

/* FAQ */
.faq { display: grid; gap: 10px; }
.faq details { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 0 16px; }
.faq summary { cursor: pointer; list-style: none; padding: 14px 30px 14px 0; font-weight: 700; color: var(--ink); position: relative; line-height: 1.45; }
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after { content: "+"; position: absolute; right: 0; top: 11px; font-size: 1.4rem; font-weight: 500; color: var(--brand); line-height: 1.2; }
.faq details[open] summary::after { content: "\2212"; }
.faq .answer { padding: 0 0 6px; }
.faq .answer p { font-size: .98rem; }

/* Articles */
.page-head { padding: 30px 0 8px; background: linear-gradient(180deg, var(--brand-soft), #fff); }
@media (min-width: 900px) { .page-head { padding: 46px 0 12px; } }
.page-head .wrap { max-width: calc(var(--read) + 96px); }
.page-head.wide .wrap { max-width: var(--wrap); }
.breadcrumbs { font-size: .85rem; color: var(--muted); margin-bottom: 14px; }
.breadcrumbs ol { list-style: none; padding: 0; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 8px; }
.breadcrumbs li { margin: 0; display: inline-flex; gap: 8px; align-items: center; }
.breadcrumbs li + li::before { content: "/"; color: #a5b1bf; }
.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--brand); text-decoration: underline; }
.meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 14px; font-size: .9rem; color: var(--muted); margin: 6px 0 4px; }
.meta .cat { font-weight: 800; color: var(--brand-strong); text-transform: uppercase; letter-spacing: .06em; font-size: .76rem; background: #fff; border: 1px solid #bfe6e9; padding: 3px 10px; border-radius: 999px; }
.article { padding: 8px 0 40px; }
.article .wrap { max-width: calc(var(--read) + 96px); }
.article .lead { font-size: 1.14rem; color: var(--ink-2); }
.feature-img { margin: 18px 0 26px; }
.feature-img img { border-radius: 16px; }
.toc { border: 1px solid var(--line); border-radius: 12px; background: var(--surface-2); padding: 4px 18px; margin: 1.6em 0 2em; }
.toc summary { cursor: pointer; font-weight: 800; color: var(--ink); padding: 11px 0; }
.toc ol { margin: 0 0 12px; padding-left: 1.3em; font-size: .95rem; }
.toc li { margin: .25em 0; }
.toc a { text-decoration: none; }
.toc a:hover { text-decoration: underline; }
.author-box { display: flex; gap: 14px; align-items: flex-start; padding: 18px; border: 1px solid var(--line); border-radius: 14px; background: var(--surface-2); margin: 2.4em 0 1em; }
.author-box .avatar { flex: none; width: 48px; height: 48px; border-radius: 50%; background: var(--brand); color: #fff; font-weight: 800; font-size: 1.2rem; display: flex; align-items: center; justify-content: center; }
.author-box p { margin: 0; font-size: .95rem; }
.author-box strong { display: block; font-size: 1rem; }
.cta-box { margin: 2.2em 0; padding: 22px; border-radius: 16px; background: var(--ink); color: #dbe5ef; display: grid; gap: 12px; }
@media (min-width: 640px) { .cta-box { grid-template-columns: 1fr auto; align-items: center; } }
.cta-box h2, .cta-box h3, .cta-box .cta-title { color: #fff; margin: 0 0 4px; font-size: 1.25rem; font-weight: 800; line-height: 1.3; }
.cta-box p { margin: 0; font-size: .97rem; }
.cta-box .btn-primary { background: var(--lime); color: var(--ink); }
.cta-box .btn-primary:hover { background: #fff; color: var(--ink); }

/* Post cards */
.post-grid { display: grid; gap: 20px; grid-template-columns: 1fr; }
@media (min-width: 640px) { .post-grid { grid-template-columns: 1fr 1fr; } }
@media (min-width: 1000px) { .post-grid { grid-template-columns: repeat(3, 1fr); } }
.post-card { display: flex; flex-direction: column; background: #fff; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; transition: box-shadow .15s, transform .15s; }
.post-card:hover { box-shadow: var(--shadow); transform: translateY(-2px); }
.post-card .thumb { aspect-ratio: 16 / 9; background: var(--surface-2); overflow: hidden; border-bottom: 1px solid var(--line); }
.post-card .thumb img { width: 100%; height: 100%; object-fit: cover; }
.post-card .body { padding: 16px 18px 18px; display: flex; flex-direction: column; flex: 1; }
.post-card .cat { font-size: .74rem; font-weight: 800; letter-spacing: .07em; text-transform: uppercase; color: var(--brand-strong); }
.post-card h2, .post-card h3 { font-size: 1.1rem; margin: 6px 0 8px; line-height: 1.35; }
.post-card h2 a, .post-card h3 a { color: var(--ink); text-decoration: none; }
.post-card h2 a:hover, .post-card h3 a:hover { color: var(--brand); }
.post-card h2 a::after, .post-card h3 a::after { content: ""; position: absolute; inset: 0; }
.post-card { position: relative; }
.post-card p { font-size: .94rem; color: var(--muted); margin: 0 0 12px; }
.post-card .date { margin-top: auto; font-size: .82rem; color: var(--muted); }

/* Footer */
.site-footer { background: var(--surface-2); border-top: 1px solid var(--line); color: var(--muted); padding: 46px 0 26px; font-size: .95rem; }
.site-footer a { color: var(--ink-2); text-decoration: none; }
.site-footer a:hover { color: var(--brand); text-decoration: underline; }
.footer-grid { display: grid; gap: 28px; grid-template-columns: 1fr; }
@media (min-width: 720px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr; } }
.site-footer h2 { color: var(--ink); font-size: .78rem; text-transform: uppercase; letter-spacing: .1em; margin: 0 0 12px; }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin: 0 0 8px; }
.site-footer .brand { color: var(--ink); margin-bottom: 12px; }
.site-footer .brand:hover { text-decoration: none; color: var(--ink); }
.footer-bottom { border-top: 1px solid var(--line); margin-top: 30px; padding-top: 18px; display: flex; flex-wrap: wrap; gap: 8px 20px; justify-content: space-between; font-size: .85rem; color: var(--muted); }

/* Misc */
.notfound { text-align: center; padding: 70px 0 40px; }
.notfound .big { font-size: 5rem; font-weight: 900; color: var(--brand); line-height: 1; margin-bottom: 10px; }
.legal h2 { font-size: 1.35rem; }
.legal h3 { font-size: 1.08rem; }
.contact-cards .card { padding-bottom: 14px; }
.contact-cards .card p:last-child { margin-bottom: 0; }
.mail-link { font-weight: 800; font-size: 1.05rem; word-break: break-all; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { transition: none !important; }
}
@media print {
  .site-header, .site-footer, .nav-toggle, .cta-box, .home-guides, .skip-link { display: none !important; }
  body { font-size: 11pt; }
}
