:root {
  --bg: #faf7f1;
  --surface: #ffffff;
  --text: #2c2620;
  --muted: #6e6353;
  --faint: #8a7f6d;
  --border: #e7dfd2;
  --accent: #33646c;
  --accent-dark: #234a52;
  --stitch: #a3b9bd;
  --tick: #cdbfa9;
  --footer-bg: #f5f0e6;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: "Albert Sans", "Segoe UI", system-ui, sans-serif;
  line-height: 1.6;
  color: var(--text);
  background: var(--bg);
}

.wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 1rem;
}

/* Header */
.site-header {
  border-bottom: 1px solid var(--border);
}
.site-header .wrap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 1.5rem;
  padding-top: 0.9rem;
  padding-bottom: 0.9rem;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  font-family: "Young Serif", Georgia, serif;
  font-size: 1.35rem;
  color: var(--text);
  text-decoration: none;
}
.site-header nav {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 1.5rem;
}
.site-header nav a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.9rem;
  font-weight: 500;
}
.site-header nav a:hover { color: var(--accent-dark); }

main { padding: 1.75rem 1rem 3rem; }

h1, h2 {
  font-family: "Young Serif", Georgia, serif;
  font-weight: 400;
}
h1 { font-size: 2.1rem; line-height: 1.15; margin: 0.5rem 0 0.35rem; }
h2 { font-size: 1.45rem; margin-top: 2.5rem; margin-bottom: 0.65rem; }

/* Stitch rule under top-level section headings */
main > h2::after {
  content: "";
  display: block;
  width: 48px;
  border-top: 3px dashed var(--accent);
  margin-top: 0.55rem;
}

.lede { color: var(--muted); font-size: 1.1rem; margin-top: 0; }

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 1.25rem 0 0;
}

a { color: var(--accent-dark); }

/* Calculator card, with a measuring-tape tick strip along the top */
.tool {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2.4rem 1.5rem 1.5rem;
  margin: 1.5rem 0;
  position: relative;
  overflow: hidden;
}
.tool::before {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 14px;
  border-bottom: 1px solid var(--border);
  background-image: repeating-linear-gradient(90deg, transparent 0 11px, var(--tick) 11px 12px);
  background-size: 100% 7px;
  background-repeat: repeat-x;
  background-position: left bottom;
}
.tool h2:first-child { margin-top: 0; }

.fields {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 0.9rem 1.25rem;
  margin-bottom: 1rem;
}
.field label {
  display: block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--muted);
  margin-bottom: 0.35rem;
}
input, select {
  width: 100%;
  padding: 0.55rem 0.65rem;
  font: inherit;
  border: 1px solid #d8cdbc;
  border-radius: 6px;
  background: #fdfcf9;
  color: var(--text);
}
input:focus, select:focus {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}

/* Results, divided from the inputs by a stitched seam */
.results {
  border-top: 2px dashed var(--stitch);
  padding-top: 1.1rem;
  margin-top: 1.35rem;
}
.big-result {
  font-family: "Young Serif", Georgia, serif;
  font-size: 2.2rem;
  color: var(--accent);
  line-height: 1.1;
  margin: 0 0 0.25rem;
}
.muted { color: var(--muted); }
.footnote { color: var(--faint); font-size: 0.85rem; margin-bottom: 0; }

/* Tables */
table {
  width: 100%;
  border-collapse: collapse;
  margin: 0.75rem 0;
}
th, td {
  text-align: left;
  padding: 0.5rem 0.6rem;
  border-bottom: 1px solid #f0e9dc;
  font-size: 0.95rem;
}
th { font-weight: 600; }
td.num, th.num { text-align: right; }

@media (max-width: 480px) {
  th, td { padding: 0.35rem 0.3rem; }
}

/* Tool cards on the homepage */
.tool-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.1rem;
  margin: 2rem 0;
  padding: 0;
  list-style: none;
}
.tool-grid a {
  display: block;
  height: 100%;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 1.3rem 1.5rem;
  color: inherit;
  text-decoration: none;
}
.tool-grid a:hover { border-color: var(--accent); }
.tool-grid h2 {
  margin: 0 0 0.35rem;
  font-size: 1.3rem;
}
.tool-grid p { margin: 0; font-size: 0.93rem; color: var(--muted); }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  background: var(--footer-bg);
  padding: 1.3rem 0 1.6rem;
  font-size: 0.9rem;
  color: var(--faint);
}
.site-footer nav { display: flex; gap: 1.25rem; margin-bottom: 0.5rem; }
.site-footer a { color: var(--muted); text-decoration: none; }
.site-footer a:hover { color: var(--accent-dark); text-decoration: underline; }
.site-footer p { margin: 0; }
