/* Longwood HVAC — "Terracotta & Linen Living"
   Restyled from the Stitch design-import (design-import/terracotta_linen_living/DESIGN.md):
   clay #7C4A32 · forest #2E4034 · linen #EDE4D6 · sand #F7F3ED · charcoal #1F2421
   Newsreader (editorial serif, regular-weight display/headlines) paired with
   Plus Jakarta Sans (body, labels). Architectural minimalism: generous
   margins, flat tonal cards (border, not drop shadow), pill badges reserved
   for tags/labels only, an ultra-diffused ambient shadow reserved for the
   one genuinely "floating" element (the pinned header).
   Committed light palette: this is a domestic, paper-warm design and an
   auto-inverted version of it reads as a different brand. */

:root {
  color-scheme: light;

  /* ---- core roles (DESIGN.md) ---- */
  --clay:          #7C4A32;
  --clay-hover:    #643B27;
  --clay-subtle:   #F5EFEB;
  --forest:        #2E4034;
  --forest-hover:  #233128;
  --forest-subtle: #E8ECE9;
  --linen:         #EDE4D6;
  --sand:          #F7F3ED;
  --charcoal:      #1F2421;
  --charcoal-muted:#5B615C;

  /* ---- derived / structural ---- */
  --paper:      #FFFFFF;       /* elevated white card surface */
  --oat-2:      var(--linen);  /* secondary tint band, kept for legacy class name */
  --ink:        var(--charcoal);
  --body:       #3E4642;
  --muted:      var(--charcoal-muted);
  --border-subtle: rgba(31, 36, 33, 0.08);
  --border-medium: rgba(31, 36, 33, 0.16);
  --rule:       var(--border-medium);
  --rule-soft:  var(--border-subtle);

  --shadow-ambient: 0 12px 36px -8px rgba(31, 36, 33, 0.06),
                     0 2px 8px 0 rgba(31, 36, 33, 0.03);

  /* ---- radii (DESIGN.md `rounded`) ---- */
  --radius-sm:   0.125rem;
  --radius:      0.25rem;
  --radius-md:   0.375rem;
  --radius-lg:   0.5rem;
  --radius-xl:   0.75rem;
  --radius-full: 9999px;

  /* ---- spacing / measure ---- */
  --measure: 66ch;
  --pad: clamp(20px, 5vw, 32px);
  --gap: clamp(28px, 5vw, 56px);
  --wrap-max: 76rem; /* 1216px, DESIGN.md container-max */

  /* ---- type families ---- */
  --serif: "Newsreader", "Iowan Old Style", "Palatino Linotype", Palatino,
           Georgia, "Times New Roman", serif;
  --sans: "Plus Jakarta Sans", -apple-system, BlinkMacSystemFont, "Segoe UI",
          Roboto, "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--sand);
  color: var(--body);
  font-family: var(--sans);
  font-size: 16.5px;
  line-height: 1.72;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* ---- editorial serif headline scale (DESIGN.md display/headline-*) ---- */

h1, h2, h3, h4 {
  font-family: var(--serif);
  color: var(--forest);
  line-height: 1.14;
  margin: 0 0 0.5em;
}

h1 {
  font-size: clamp(2.15rem, 1.55rem + 2.6vw, 3.5rem); /* 38px -> 56px */
  font-weight: 400;
  line-height: 1.12;
  letter-spacing: -0.018em;
}
h2 {
  font-size: clamp(1.6rem, 1.25rem + 1.5vw, 2.5rem); /* 30px -> 40px */
  font-weight: 400;
  line-height: 1.16;
  letter-spacing: -0.013em;
  margin-top: 0;
}
h3 {
  font-size: 1.32rem; /* ~22px, headline-sm */
  font-weight: 500;
  line-height: 1.28;
  letter-spacing: 0;
}
h4 {
  font-size: 1.08rem;
  font-weight: 600;
  color: var(--ink);
}

p { margin: 0 0 1.1em; max-width: var(--measure); }

a { color: var(--forest); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--clay); }

strong { color: var(--ink); font-weight: 650; }

hr { border: 0; height: 1px; background: var(--rule-soft); margin: var(--gap) 0; }

/* ---------- layout ---------- */

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

section { padding: clamp(44px, 7vw, 96px) 0; }
section.tight { padding: clamp(32px, 4.5vw, 56px) 0 clamp(20px, 3vw, 32px); }

.paper { background: var(--paper); }
.oat2  { background: var(--linen); }
.forest { background: var(--forest); color: #E3E9E3; }
.forest h1, .forest h2, .forest h3, .forest h4 { color: #FBF7F1; }
.forest a { color: #E9C9B3; }
.forest a:hover { color: #FBF7F1; }

/* Eyebrow — plain tracked label inline in the flow of a page (esec()
   sections use this repeatedly, so it stays quiet rather than a badge on
   every heading). */
.eyebrow {
  display: block;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 600;
  color: var(--clay);
  margin: 0 0 12px;
}
.forest .eyebrow { color: #D9B79C; }

/* The hero and each page's opening eyebrow get the fuller pill-badge
   treatment straight out of the Stitch overline pattern — used once per
   page, not stacked section after section. */
.hero .eyebrow,
section.tight .eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.7rem;
  letter-spacing: 0.09em;
  font-weight: 600;
  color: var(--forest);
  background: var(--forest-subtle);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-full);
  padding: 5px 14px 5px 12px;
  margin-bottom: 18px;
}
.hero .eyebrow::before,
section.tight .eyebrow::before {
  content: "";
  width: 6px; height: 6px; border-radius: 50%;
  background: var(--forest); flex: 0 0 auto;
}

.lede {
  font-family: var(--sans);
  font-size: clamp(1.08rem, 1rem + 0.4vw, 1.2rem);
  line-height: 1.65;
  letter-spacing: -0.005em;
  color: var(--ink);
  max-width: 60ch;
}

/* ---------- header ---------- */

.topbar {
  background: var(--forest);
  color: #D7E0D7;
  font-family: var(--sans);
  font-size: 0.8rem;
  line-height: 1.5;
  padding: 8px 0;
}
.topbar .wrap { display: flex; flex-wrap: wrap; gap: 6px 18px; align-items: center; }
.topbar a { color: #EBD3C1; }
.topbar a:hover { color: #fff; }

header.site {
  background: rgba(247, 243, 237, 0.92);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border-subtle);
  position: sticky;
  top: 0;
  z-index: 40;
  box-shadow: var(--shadow-ambient);
}
header.site .wrap {
  display: flex; flex-wrap: wrap; align-items: center;
  gap: 10px 24px; padding-top: 14px; padding-bottom: 14px;
}

.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; }
.brand-logo { height: 44px; width: auto; display: block; flex: 0 0 auto; }
.brand .name {
  font-family: var(--serif); font-size: 1.28rem; font-weight: 500;
  color: var(--forest); line-height: 1.05; letter-spacing: -0.01em;
}
.brand .sub {
  display: block; font-family: var(--sans); font-size: 0.64rem;
  letter-spacing: 0.15em; text-transform: uppercase; color: var(--clay);
  font-weight: 600; margin-top: 4px;
}

nav.main { margin-left: auto; }
nav.main ul {
  list-style: none; margin: 0; padding: 0;
  display: flex; flex-wrap: wrap; gap: 4px 20px; align-items: center;
}
nav.main a {
  color: var(--body); text-decoration: none; font-size: 0.9rem; font-weight: 500;
  padding: 4px 0; border-bottom: 2px solid transparent;
}
nav.main a:hover { color: var(--clay); border-bottom-color: var(--clay); }
nav.main a[aria-current="page"] { color: var(--forest); border-bottom-color: var(--clay); }

.head-cta { display: flex; align-items: center; }
.head-cta .btn { padding: 9px 18px; font-size: 0.87rem; }

@media (max-width: 760px) {
  .head-cta { display: none; }
}

/* ---------- buttons ---------- */

.btn {
  display: inline-block; text-decoration: none;
  font-family: var(--sans); font-weight: 600; font-size: 0.96rem;
  padding: 13px 26px; border-radius: var(--radius); border: 1.5px solid var(--clay);
  background: var(--clay); color: var(--linen);
  line-height: 1.3;
  transition: background-color 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}
.btn:hover { background: var(--clay-hover); border-color: var(--clay-hover); color: #fff; }
.btn.ghost { background: transparent; color: var(--clay); }
.btn.ghost:hover { background: var(--clay-subtle); color: var(--clay-hover); }
.forest .btn { background: var(--linen); border-color: var(--linen); color: var(--forest); }
.forest .btn:hover { background: #fff; border-color: #fff; }
.forest .btn.ghost { background: transparent; color: #EBD9C9; border-color: #6C8072; }
.forest .btn.ghost:hover { background: rgba(255,255,255,0.08); }

.btns { display: flex; flex-wrap: wrap; gap: 12px; margin: 28px 0 0; }

/* ---------- hero ---------- */

.hero { background: var(--sand); border-bottom: 1px solid var(--border-subtle); }
.hero .wrap { padding-top: clamp(44px, 6vw, 80px); padding-bottom: clamp(30px, 5vw, 48px); }
.hero h1 { max-width: 18ch; }
.hero .lede { margin-top: 18px; }

.factstrip {
  border-top: 1px solid var(--border-subtle);
  background: var(--linen);
}
.factstrip ul {
  list-style: none; margin: 0; padding: 22px 0;
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
}
.factstrip li {
  font-size: 0.89rem; line-height: 1.5; color: var(--charcoal-muted);
  background: var(--paper);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: 16px 18px;
}
.factstrip b {
  display: block; font-family: var(--serif); font-size: 1.5rem;
  color: var(--forest); font-weight: 500; letter-spacing: -0.01em;
  margin-bottom: 3px;
}

/* ---------- cutaway ---------- */

.cutaway {
  background: var(--linen);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-xl);
  padding: clamp(14px, 2.5vw, 28px);
  overflow-x: auto;
}
.cutaway svg {
  display: block; width: 100%; min-width: 620px; height: auto;
  background: var(--sand); border-radius: var(--radius-lg);
}
.cutaway figcaption {
  font-size: 0.85rem; color: var(--charcoal-muted); margin-top: 16px;
  border-top: 1px solid var(--border-subtle); padding-top: 12px; max-width: none;
}

ol.keys { list-style: none; margin: 32px 0 0; padding: 0; display: grid; gap: 22px 34px;
  grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); counter-reset: k; }
ol.keys li { counter-increment: k; position: relative; padding-left: 44px; font-size: 0.95rem; }
ol.keys li::before {
  content: counter(k);
  position: absolute; left: 0; top: 0;
  width: 28px; height: 28px; border-radius: var(--radius-full);
  background: var(--clay); color: var(--linen);
  font-family: var(--serif); font-size: 0.92rem; font-weight: 500;
  display: flex; align-items: center; justify-content: center;
}
ol.keys h3 { font-size: 1.06rem; margin-bottom: 4px; color: var(--forest); }
ol.keys p { margin: 0; }

/* ---------- cards ---------- */

.grid { display: grid; gap: clamp(20px, 3vw, 28px); }
.g2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.g3 { grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); }

.card {
  background: var(--paper);
  border: 1px solid var(--border-subtle);
  border-radius: var(--radius-lg);
  padding: clamp(22px, 2.6vw, 30px);
  transition: border-color 0.15s ease;
}
.card:hover { border-color: var(--border-medium); }
.card h3 { margin-bottom: 8px; }
.card p:last-child { margin-bottom: 0; }
.card .ic {
  display: flex; align-items: center; justify-content: center;
  width: 48px; height: 48px; border-radius: var(--radius-lg);
  background: var(--forest-subtle); color: var(--forest); margin-bottom: 16px;
}
.card .ic svg { width: 24px; height: 24px; display: block; }

.card.plain {
  background: transparent; border: 0; border-top: 3px solid var(--clay);
  padding: 22px 0 0; border-radius: 0;
}

/* ---------- callout / note ---------- */

.note {
  background: var(--clay-subtle);
  border-left: 3px solid var(--clay);
  padding: 22px 26px;
  margin: 28px 0;
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
}
.note p:last-child { margin-bottom: 0; }
.note h3 { font-size: 1.08rem; }

.note.green { background: var(--forest-subtle); border-left-color: var(--forest); }

blockquote.code {
  margin: 26px 0; padding: 20px 24px;
  background: var(--paper); border: 1px solid var(--border-subtle);
  border-left: 3px solid var(--forest); border-radius: 0 var(--radius-md) var(--radius-md) 0;
  font-family: var(--serif); font-size: 1.05rem; color: var(--ink); font-weight: 400;
  line-height: 1.6;
}
blockquote.code p { margin: 0 0 0.6em; }
blockquote.code cite {
  display: block; font-family: var(--sans); font-size: 0.79rem;
  font-style: normal; color: var(--charcoal-muted); margin-top: 10px;
}

/* ---------- lists ---------- */

ul.ticks { list-style: none; margin: 0 0 1.2em; padding: 0; max-width: var(--measure); }
ul.ticks li { position: relative; padding-left: 26px; margin-bottom: 11px; }
ul.ticks li::before {
  content: ""; position: absolute; left: 3px; top: 0.68em;
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--clay);
}

ul.plain { list-style: none; margin: 0; padding: 0; }

dl.spec { margin: 0; }
dl.spec div {
  display: grid; grid-template-columns: minmax(170px, 30%) 1fr;
  gap: 6px 24px; padding: 14px 0; border-top: 1px solid var(--border-subtle);
}
dl.spec div:first-child { border-top: 0; }
dl.spec dt { font-weight: 600; color: var(--forest); font-family: var(--sans); }
dl.spec dd { margin: 0; }

@media (max-width: 560px) {
  dl.spec div { grid-template-columns: 1fr; gap: 2px; }
}

/* ---------- table ---------- */

.tablewrap { overflow-x: auto; border: 1px solid var(--border-subtle); border-radius: var(--radius-lg); background: var(--paper); }
table { border-collapse: collapse; width: 100%; min-width: 640px; font-size: 0.92rem; }
caption {
  text-align: left; padding: 16px 18px; font-size: 0.86rem; color: var(--charcoal-muted);
  border-bottom: 1px solid var(--border-subtle);
}
th, td { padding: 12px 18px; text-align: left; border-top: 1px solid var(--border-subtle); vertical-align: top; }
thead th {
  border-top: 0; background: var(--linen); color: var(--forest);
  font-family: var(--sans);
  font-size: 0.72rem; letter-spacing: 0.07em; text-transform: uppercase; font-weight: 600;
}
tbody th { font-weight: 600; color: var(--ink); }
td.num, th.num { text-align: right; font-variant-numeric: tabular-nums; }

/* ---------- faq ---------- */

.faq { border-top: 1px solid var(--border-subtle); max-width: 820px; }
.faq > div { border-bottom: 1px solid var(--border-subtle); padding: 26px 0; }
.faq h3 { font-size: 1.16rem; margin-bottom: 10px; color: var(--forest); }
.faq p:last-child { margin-bottom: 0; }

/* ---------- form ---------- */

form.lead { max-width: 620px; }
.field { margin-bottom: 18px; }
.field label {
  display: block; font-family: var(--sans); font-size: 0.78rem; font-weight: 600;
  letter-spacing: 0.05em; text-transform: uppercase; color: var(--charcoal-muted);
  margin-bottom: 7px;
}
.field input, .field select, .field textarea {
  width: 100%; padding: 12px 14px; font: inherit; font-size: 0.97rem;
  color: var(--ink); background: var(--sand);
  border: 1px solid var(--border-medium); border-radius: var(--radius);
}
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--clay); box-shadow: 0 0 0 1px var(--clay);
}
.field textarea { min-height: 130px; resize: vertical; }
button[disabled] { opacity: 0.55; cursor: not-allowed; }

/* ---------- handover markers ---------- */

.need {
  display: inline-block;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.8em;
  color: var(--clay-hover);
  background: var(--clay-subtle);
  border: 1px dashed var(--clay);
  border-radius: var(--radius);
  padding: 1px 7px;
  line-height: 1.5;
  white-space: normal;
}

.handover {
  border: 1px dashed var(--clay);
  background: var(--clay-subtle);
  padding: 18px 22px;
  border-radius: var(--radius);
  margin: 24px 0;
  font-size: 0.92rem;
}
.handover h3 { font-size: 0.98rem; margin-bottom: 8px; }
.handover p:last-child { margin-bottom: 0; }

/* ---------- sources ---------- */

.sources {
  margin-top: var(--gap); padding-top: 20px; border-top: 1px solid var(--border-subtle);
  font-size: 0.83rem; line-height: 1.65; color: var(--charcoal-muted);
}
.sources h2 { font-size: 0.76rem; letter-spacing: 0.12em; text-transform: uppercase;
  font-family: var(--sans); font-weight: 600; color: var(--charcoal-muted); margin-bottom: 10px; }
.sources ol { margin: 0; padding-left: 20px; }
.sources li { margin-bottom: 7px; word-break: break-word; }
.sources a { color: var(--charcoal-muted); }

/* ---------- breadcrumb ---------- */

.crumbs { font-size: 0.83rem; color: var(--charcoal-muted); padding: 14px 0 0; }
.crumbs a { color: var(--charcoal-muted); }
.crumbs span { padding: 0 6px; }

/* ---------- footer ---------- */

footer.site {
  background: var(--forest); color: #C9D4C9;
  padding: clamp(44px, 6vw, 68px) 0 28px;
  font-size: 0.92rem;
}
footer.site a { color: #EBD3C1; }
footer.site a:hover { color: #fff; }
footer.site h3 {
  color: #FBF7F1; font-size: 0.76rem; letter-spacing: 0.12em;
  text-transform: uppercase; font-family: var(--sans); font-weight: 600; margin-bottom: 14px;
}
footer.site .cols { display: grid; gap: 32px 44px; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
footer.site ul { list-style: none; margin: 0; padding: 0; }
footer.site li { margin-bottom: 9px; }
footer.site p { max-width: 46ch; }
footer.site .footbrand { display: flex; align-items: center; gap: 11px; margin-bottom: 16px; }
.footer-logo {
  height: 36px; width: auto; background: #fff; padding: 6px 12px;
  border-radius: 8px;
}
footer.site .footbrand span { font-family: var(--serif); font-weight: 500; font-size: 1.18rem; color: #FBF7F1; }
footer.site .legal {
  margin-top: 36px; padding-top: 20px; border-top: 1px solid rgba(255,255,255,0.14);
  font-size: 0.81rem; color: #9FAE9F;
}
footer.site .legal p { max-width: 88ch; margin-bottom: 0.7em; }
footer.site .need { background: rgba(255,255,255,0.08); border-color: #8AA08D; color: #EBD3C1; }

/* ---------- misc ---------- */

.skip {
  position: absolute; left: -9999px; top: 0; background: var(--paper);
  color: var(--ink); padding: 10px 16px; z-index: 50; border-radius: 0 0 var(--radius) 0;
}
.skip:focus { left: 8px; top: 8px; }

.split { display: grid; gap: var(--gap); grid-template-columns: 1.15fr 0.85fr; align-items: start; }
@media (max-width: 860px) { .split { grid-template-columns: 1fr; } }

.small { font-size: 0.86rem; color: var(--charcoal-muted); }
.small a { color: var(--charcoal-muted); }

@media print {
  .topbar, nav.main, .head-cta, footer.site, .btns { display: none; }
  header.site { position: static; box-shadow: none; }
  body { background: #fff; font-size: 11pt; }
}
