/* ==========================================================================
   Trevor Smith — residential concept drawings
   A modern plan book: drawings on ivory paper, Clarendon-style labels
   (echoing the room labels on the drawings) and Franklin Gothic text.
   ========================================================================== */

:root {
  /* Paper and ink: UI surfaces follow the theme; drawing sheets stay paper in both */
  --page: #F8F7F3;
  --surface: #FFFFFF;
  --paper: #FFFFFF;
  --paper-ink: #252622;
  --paper-accent: #485148;
  --ink: #252622;
  --ink-2: #464841;
  --muted: #6D706A;
  --rule: #DEDCD5;
  --rule-strong: #C8C6BE;
  --rule-hover: #A9AAA2;
  --accent: #485148;
  --accent-deep: #363D36;
  --on-accent: #F8F7F3;
  --wash: #ECEEE7;
  --field: #FDFDFB;
  --placeholder: #8E908A;
  --error: #8C3A2B;
  --error-wash: #F6ECE8;
  --error-ink: #5E281E;
  --header-bg: rgba(248, 247, 243, 0.94);
  --panel-bg: #252622;
  --panel-fg: #F8F7F3;
  --panel-muted: #B9BBB3;
  --panel-body: #DCDDD6;
  --drawing-filter: none;
  --drawing-opacity: 1;
  --drawing-blend: multiply;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23252622' stroke-width='1.4'/%3E%3C/svg%3E");

  --serif: "Besley", Georgia, "Times New Roman", serif;
  --sans: "Libre Franklin", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --radius: 3px;
  --max: 1160px;
  --gutter: clamp(16px, 4.5vw, 48px);
  --section: clamp(80px, 10vw, 136px);

  /* Type scale: major third from 17px */
  --t-sm: 0.875rem;
  --t-base: 1.0625rem;
  --t-md: 1.25rem;
  --t-lg: 1.5625rem;
  --t-xl: clamp(2rem, 1.35rem + 2.4vw, 3rem);
  --t-hero: clamp(2.5rem, 1.6rem + 3.1vw, 3.85rem);
}

/* Dark (chosen with the header toggle): a drafting table at night. Sheets stay paper; the hero drawing turns to light ink. */
:root[data-site-theme="dark"] {
  --page: #1C1D1A;
  --surface: #242622;
  --paper: #F3F2EC;
  --ink: #ECEBE5;
  --ink-2: #CBCCC5;
  --muted: #A2A59C;
  --rule: #383A34;
  --rule-strong: #4A4D45;
  --rule-hover: #6A6D64;
  --accent: #A7B7A3;
  --accent-deep: #BFCDBB;
  --on-accent: #1C1D1A;
  --wash: #2A2E28;
  --field: #1F201D;
  --placeholder: #80837A;
  --error: #E39580;
  --error-wash: #3A2621;
  --error-ink: #F2C2B4;
  --header-bg: rgba(28, 29, 26, 0.94);
  --panel-bg: #2C2F2A;
  --panel-fg: #ECEBE5;
  --panel-muted: #A2A59C;
  --panel-body: #CBCCC5;
  --drawing-filter: invert(1);
    --drawing-opacity: 0.86;
  --drawing-blend: screen;
  --chevron: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5l5 5 5-5' fill='none' stroke='%23ECEBE5' stroke-width='1.4'/%3E%3C/svg%3E");
  color-scheme: dark;
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 88px;
  -webkit-text-size-adjust: 100%;
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
}

body {
  margin: 0;
  background: var(--page);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--t-base);
  line-height: 1.6;
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }
img { height: auto; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  margin: 0;
  text-wrap: balance;
}
h2 {
  font-size: var(--t-xl);
  line-height: 1.1;
  letter-spacing: -0.015em;
}
h3 { font-size: var(--t-md); line-height: 1.3; }
p { margin: 0; text-wrap: pretty; }

a { color: inherit; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

.wrap {
  width: 100%;
  max-width: calc(var(--max) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 100;
  padding: 10px 16px;
  background: var(--ink);
  color: var(--page);
  text-decoration: none;
}
.skip-link:focus { top: 12px; }

/* ---------- Buttons & links ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--sans);
  font-size: 0.9375rem;
  font-weight: 600;
  letter-spacing: 0.005em;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.btn-primary { background: var(--accent); color: var(--on-accent); }
.btn-primary:hover { background: var(--accent-deep); }
.btn-secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-secondary:hover { background: var(--ink); color: var(--page); }
.btn-compact { min-height: 44px; padding: 0 18px; font-size: 0.875rem; }

.text-link {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}
.text-link:hover { color: var(--ink); }

.text-btn {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--accent);
  font: 600 0.9375rem/1 var(--sans);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 4px;
  cursor: pointer;
}
.text-btn:hover { color: var(--ink); }

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: env(safe-area-inset-top, 0px);
  z-index: 40;
  background: var(--header-bg);
  backdrop-filter: saturate(1.2) blur(8px);
  -webkit-backdrop-filter: saturate(1.2) blur(8px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}
.site-header.is-scrolled { border-bottom-color: var(--rule); }

.header-inner {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 72px;
}

.wordmark {
  display: flex;
  flex-direction: column;
  text-decoration: none;
  line-height: 1.15;
  margin-right: auto;
}
.wordmark-name {
  font-family: var(--serif);
  font-size: 1.3rem;
  font-weight: 500;
  letter-spacing: -0.01em;
}
.wordmark-sub {
  font-size: 0.75rem;
  color: var(--muted);
  letter-spacing: 0.01em;
}

.nav-list {
  display: flex;
  gap: 4px;
  margin: 0;
  padding: 0;
  list-style: none;
}
.nav-list a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  font-size: 0.9375rem;
  text-decoration: none;
  color: var(--ink);
}
.nav-list a:hover { text-decoration: underline; text-underline-offset: 4px; }

.vh {
  position: absolute !important;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

.theme-toggle {
  display: inline-grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  padding: 0;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--ink); }
.theme-icon-sun { display: none; }
:root[data-site-theme="dark"] .theme-icon-sun { display: block; }
:root[data-site-theme="dark"] .theme-icon-moon { display: none; }

.nav-toggle {
  display: none;
  gap: 8px;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: transparent;
  color: var(--ink);
  font: 500 0.875rem var(--sans);
  cursor: pointer;
}

@media (max-width: 860px) {
  .header-inner { gap: 10px; min-height: 64px; }
  .nav-toggle { display: inline-flex; align-items: center; }
  .nav-list {
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    flex-direction: column;
    gap: 0;
    padding: 8px var(--gutter) 20px;
    background: var(--page);
    border-bottom: 1px solid var(--rule);
    display: none;
  }
  .nav-list.is-open { display: flex; }
  .nav-list a {
    width: 100%;
    min-height: 52px;
    padding: 0;
    font-family: var(--serif);
    font-size: 1.25rem;
    border-bottom: 1px solid var(--rule);
  }
}
@media (max-width: 480px) {
  .header-inner { gap: 6px; }
  .wordmark { min-width: 0; }
  .wordmark-name { font-size: 1.125rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  .wordmark-sub { display: none; }
  .nav-toggle { width: 44px; padding: 0; justify-content: center; }
  .nav-toggle-label {
    position: absolute;
    width: 1px;
    height: 1px;
    overflow: hidden;
    clip: rect(0 0 0 0);
    white-space: nowrap;
  }
  .btn-compact { flex: none; padding: 0 12px; font-size: 0.8125rem; }
}

/* ---------- Hero ---------- */
.hero { padding-block: clamp(40px, 7vw, 96px) clamp(64px, 8vw, 112px); }

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 5fr) minmax(0, 7fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: center;
}

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.14em;
  color: var(--accent);
  margin-bottom: 22px;
}

.hero h1 {
  font-size: var(--t-hero);
  line-height: 1.04;
  letter-spacing: -0.022em;
  font-weight: 400;
}

.lede {
  margin-top: 26px;
  max-width: 34em;
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--ink-2);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 34px;
}

.assurances {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 22px;
  margin: 26px 0 0;
  padding: 0;
  list-style: none;
  font-size: var(--t-sm);
  color: var(--muted);
}
.assurances li::before {
  content: "";
  display: inline-block;
  width: 12px;
  height: 1px;
  margin-right: 8px;
  vertical-align: middle;
  background: var(--accent);
}

.hero-figure { margin: 0; }

.hero-sheet {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: none;
  cursor: zoom-in;
}
.hero-sheet img {
  width: 100%;
  filter: var(--drawing-filter);
  opacity: var(--drawing-opacity);
  mix-blend-mode: var(--drawing-blend); /* white paper drops away; linework sits on the page */
  animation: draw-in 1.2s cubic-bezier(0.25, 0.7, 0.2, 1) 0.1s both;
}
@keyframes draw-in {
  from { clip-path: inset(0 100% 0 0); }
  to { clip-path: inset(0 0 0 0); }
}

/* Title block — the strip of cells at the foot of a drawing sheet */
.titleblock {
  display: grid;
  grid-template-columns: auto auto 1fr;
  margin-top: 18px;
  border-top: 1.5px solid var(--ink);
  border-bottom: 1px solid var(--rule-strong);
  font-size: 0.8125rem;
  color: var(--muted);
}

.tb-cell {
  padding: 9px 14px;
  border-left: 1px solid var(--rule-strong);
}
.tb-cell:first-child { border-left: 0; padding-left: 0; }
.tb-label {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 0.8125rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 3px;
  color: var(--ink);
}
.tb-note { text-align: right; }

@media (max-width: 1023px) {
  .hero-grid { grid-template-columns: 1fr; }
  .hero-copy { max-width: 640px; }
}
@media (max-width: 640px) {
  .titleblock { grid-template-columns: auto 1fr; }
  .tb-note {
    grid-column: 1 / -1;
    border-left: 0;
    border-top: 1px solid var(--rule);
    padding-left: 0;
    text-align: left;
  }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--section); }

.section-head {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 24px clamp(32px, 6vw, 96px);
  align-items: end;
  margin-bottom: clamp(36px, 5vw, 56px);
}
.section-head > p {
  max-width: 40em;
  color: var(--muted);
  font-size: 1.0625rem;
}
@media (max-width: 860px) {
  .section-head { grid-template-columns: 1fr; }
}

/* ---------- Work ---------- */
.work { border-top: 1px solid var(--rule); }

.notice {
  margin-bottom: clamp(36px, 5vw, 56px);
  padding: 14px 18px;
  border-left: 2px solid var(--accent);
  background: var(--wash);
  font-size: 0.9375rem;
  color: var(--ink-2);
}

.studies {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(56px, 7vw, 88px) clamp(28px, 4vw, 48px);
}
@media (max-width: 767px) {
  .studies { grid-template-columns: 1fr; }
}

.study { display: flex; flex-direction: column; }

.study-sheet {
  position: relative;
  aspect-ratio: 16 / 10;
  max-width: 100%;
  background: var(--paper);
  border: 1px solid var(--rule);
  cursor: zoom-in;
  transition: border-color 0.2s ease;
}
.study-sheet:hover { border-color: var(--rule-strong); }
.study-sheet img {
  position: absolute;
  inset: 6% 6%;
  width: 88%;
  height: 88%;
  object-fit: contain;
  mix-blend-mode: multiply; /* sheet white takes on the paper tone */
}

.study-body {
  display: grid;
  grid-template-columns: 4.25rem minmax(0, 1fr);
  gap: 0 18px;
  padding-top: 22px;
}

.study-no {
  font-family: var(--serif);
  font-size: 2.25rem;
  line-height: 1;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.study-no span {
  display: block;
  margin-bottom: 4px;
  font-size: 0.8125rem;
  font-style: italic;
  letter-spacing: 0;
  color: var(--muted);
}

.study-text h3 { font-size: 1.375rem; line-height: 1.25; }
.study-text > p:not(.study-flag) {
  margin-top: 10px;
  color: var(--ink-2);
  font-size: 0.96875rem;
}

.specs {
  display: flex;
  flex-wrap: wrap;
  margin: 18px 0 6px;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
}
.specs > div {
  padding: 8px 18px 8px 0;
  margin-right: 18px;
  border-right: 1px solid var(--rule);
}
.specs > div:last-child { border-right: 0; margin-right: 0; }
.specs dt { font-size: 0.75rem; color: var(--muted); }
.specs dd { margin: 0; font-size: 0.9375rem; font-weight: 500; }

.study-flag {
  margin-top: 4px;
  font-size: 0.8125rem;
  color: var(--muted);
  font-style: italic;
  font-family: var(--serif);
}

.fineprint {
  margin-top: clamp(48px, 6vw, 72px);
  padding-top: 18px;
  border-top: 1px solid var(--rule);
  font-size: var(--t-sm);
  color: var(--muted);
}

@media (max-width: 480px) {
  .study-body { grid-template-columns: 1fr; gap: 10px; }
  .study-no { font-size: 1.75rem; }
  .study-no span { display: inline; margin-right: 4px; }
}

/* ---------- Sight lines comparison ---------- */
.sightlines {
  background: var(--surface);
  border-block: 1px solid var(--rule);
}

.sl-head {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(0, 1fr);
  gap: 24px clamp(32px, 6vw, 96px);
  align-items: end;
  margin-bottom: clamp(32px, 4vw, 48px);
}
.sl-intro p { color: var(--muted); }
@media (max-width: 860px) {
  .sl-head { grid-template-columns: 1fr; }
}

.sl-switch {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}
.sl-option {
  min-height: 40px;
  padding: 0 16px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: 500 0.875rem var(--sans);
  cursor: pointer;
}
.sl-option:hover { border-color: var(--ink); }
.sl-option[aria-pressed="true"] {
  background: var(--ink);
  border-color: var(--ink);
  color: var(--page);
}

.compare-figure { margin: 0; }

.compare {
  --pos: 50%;
  position: relative;
  width: 100%;
  overflow: hidden;
  max-width: 100%;
  border: 1px solid var(--rule);
  background: var(--paper);
  cursor: ew-resize;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}
.compare-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  pointer-events: none;
  -webkit-user-drag: none;
}
.compare-over {
  position: absolute;
  inset: 0;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}

.compare-handle {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  width: 44px;
  margin-left: -22px;
  display: grid;
  place-items: center;
  cursor: ew-resize;
}
.compare-handle::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1.5px;
  margin-left: -0.75px;
  background: var(--paper-accent);
}
.compare-handle:focus-visible { outline: none; }
.compare-handle:focus-visible .compare-knob {
  outline: 2px solid var(--paper-accent);
  outline-offset: 3px;
}
.compare-knob {
  position: relative;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--paper-accent);
  color: #F8F7F3;
}

.compare-tag {
  position: absolute;
  top: 14px;
  padding: 5px 10px;
  background: var(--paper);
  color: var(--paper-ink);
  border: 1px solid #DEDCD5;
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  pointer-events: none;
}
.compare-tag-left { left: 14px; }
.compare-tag-right { right: 14px; }

.compare-caption {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 24px;
  margin-top: 14px;
  font-size: var(--t-sm);
  color: var(--muted);
}
.compare-caption #compare-caption-text { color: var(--ink); }
.compare-caption .text-btn { margin-left: auto; font-size: var(--t-sm); }
@media (max-width: 640px) {
  .compare-caption .text-btn { margin-left: 0; }
  .compare-tag { top: 8px; font-size: 0.6875rem; padding: 4px 7px; }
  .compare-tag-left { left: 8px; }
  .compare-tag-right { right: 8px; }
}

/* ---------- About ---------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.6fr);
  gap: 24px clamp(32px, 6vw, 96px);
  align-items: start;
}
.about-title { font-size: var(--t-lg); line-height: 1.2; padding-top: 6px; }
.about-body p {
  font-family: var(--serif);
  font-size: clamp(1.25rem, 1.05rem + 0.7vw, 1.5rem);
  line-height: 1.55;
  letter-spacing: -0.005em;
  max-width: 34em;
}
.signature {
  width: 220px;
  filter: var(--drawing-filter);
  margin-top: 28px;
  margin-left: -8px;
}
@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; }
}

/* ---------- Services ---------- */
.services { border-top: 1px solid var(--rule); }

.packages {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(16px, 2vw, 24px);
  align-items: stretch;
}
@media (max-width: 1023px) {
  .packages { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 700px) {
  .packages { grid-template-columns: 1fr; }
}

.pkg {
  position: relative;
  display: flex;
  flex-direction: column;
  padding: clamp(24px, 2.6vw, 32px);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.pkg-featured {
  border-color: var(--ink);
  box-shadow: inset 0 0 0 0.5px var(--ink);
}
.pkg-flag {
  position: absolute;
  top: -12px;
  left: clamp(24px, 2.6vw, 32px);
  padding: 2px 10px;
  background: var(--page);
  border: 1px solid var(--ink);
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--ink);
}

.pkg-art {
  width: 100%;
  height: auto;
  margin-bottom: 22px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
  overflow: visible;
}
.pkg-art .sk { fill: none; stroke: var(--muted); stroke-width: 1.3; stroke-linecap: round; stroke-linejoin: round; }
.pkg-art .wl, .pkg-art .wl * { fill: none; stroke: var(--ink); stroke-width: 3.2; stroke-linejoin: miter; }
.pkg-art .ln, .pkg-art .ln * { fill: none; stroke: var(--ink); stroke-width: 1; stroke-linecap: round; stroke-linejoin: round; }
.pkg-art .old { fill: none; stroke: var(--muted); stroke-width: 1.4; stroke-dasharray: 4 4; }
.pkg-art .wash { fill: var(--wash); stroke: none; }
.pkg-art .hatch path { stroke: var(--muted); stroke-width: 0.8; }

.pkg-name { font-size: 1.625rem; line-height: 1.2; }
.pkg-price {
  margin-top: 6px;
  font-family: var(--serif);
  font-size: 2rem;
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.pkg-from {
  font-size: 1rem;
  font-style: italic;
  color: var(--muted);
}
.pkg-summary {
  margin-top: 14px;
  font-size: 0.96875rem;
  color: var(--ink-2);
}

.pkg-terms {
  margin: 18px 0 16px;
  border-top: 1px solid var(--rule);
}
.pkg-terms > div {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.875rem;
}
.pkg-terms dt { color: var(--muted); }
.pkg-terms dd { margin: 0; font-weight: 600; text-align: right; }

.pkg-line {
  font-size: 0.875rem;
  color: var(--ink-2);
}
.pkg-line + .pkg-line { margin-top: 8px; }
.pkg-line strong { color: var(--ink); font-weight: 600; }

.pkg-scope {
  align-self: flex-start;
  margin-top: 14px;
  margin-bottom: 18px;
  font-size: 0.875rem;
  padding-block: 10px;
}
.pkg-cta {
  margin-top: auto;
  width: 100%;
}

.pricing-notes {
  display: grid;
  grid-template-columns: auto 1fr 1fr;
  gap: 8px 32px;
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1.5px solid var(--ink);
  font-size: var(--t-sm);
  color: var(--muted);
}
.pricing-key { font-weight: 600; color: var(--ink); }
@media (max-width: 860px) {
  .pricing-notes { grid-template-columns: 1fr; }
}

/* ---------- Scope ---------- */
.scope { border-top: 1px solid var(--rule); }

.scope-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(28px, 4vw, 48px);
}
@media (max-width: 960px) {
  .scope-grid { grid-template-columns: 1fr; max-width: 680px; }
}

.scope-pkg {
  padding-top: 18px;
  border-top: 1.5px solid var(--ink);
  scroll-margin-top: 96px;
}
.scope-pkg:target h3 { text-decoration: underline; text-decoration-color: var(--accent); text-underline-offset: 6px; }
.scope-pkg h3 { font-size: var(--t-lg); line-height: 1.2; }
.scope-pkg h3 span {
  display: block;
  margin-top: 4px;
  font-size: 1rem;
  font-style: italic;
  color: var(--muted);
}
.scope-pkg dl { margin: 18px 0 0; }
.scope-pkg dt {
  margin-top: 16px;
  font-size: 0.8125rem;
  font-weight: 600;
  color: var(--ink);
}
.scope-pkg dd {
  margin: 4px 0 0;
  font-size: 0.9375rem;
  color: var(--ink-2);
}
.expect {
  margin-top: 20px;
  padding-left: 14px;
  border-left: 2px solid var(--rule-strong);
  font-family: var(--serif);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.5;
}

/* General notes — set like the notes block on a drawing sheet */
.notes {
  margin-top: clamp(48px, 6vw, 80px);
  padding: clamp(24px, 3vw, 36px);
  background: var(--surface);
  border: 1px solid var(--rule);
}
.notes h3 {
  font-size: 0.875rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.notes ol {
  columns: 2 340px;
  column-gap: clamp(32px, 4vw, 56px);
  margin: 20px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: note;
}
.notes li {
  position: relative;
  break-inside: avoid;
  margin-bottom: 16px;
  padding-left: 30px;
  font-size: 0.9375rem;
  color: var(--ink-2);
  counter-increment: note;
}
.notes li::before {
  content: counter(note) ".";
  position: absolute;
  left: 0;
  font-family: var(--serif);
  font-weight: 700;
  color: var(--ink);
}

/* ---------- Process ---------- */
.process { border-top: 1px solid var(--rule); }

.steps {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: 0;
  padding: 0;
  list-style: none;
}
/* A dimension string: one line, a slash tick at every break, the step number set above the line */
.steps { position: relative; }
.steps::after,
.step::after {
  content: "";
  position: absolute;
  top: 21px;
  width: 15px;
  height: 15px;
  background: linear-gradient(135deg, transparent calc(50% - 0.75px), var(--ink) calc(50% - 0.75px), var(--ink) calc(50% + 0.75px), transparent calc(50% + 0.75px));
}
.steps::after { right: -7px; }
.step {
  position: relative;
  padding: 60px clamp(20px, 3vw, 44px) 0 0;
}
.step::before {
  content: "";
  position: absolute;
  top: 28px;
  left: 0;
  right: 0;
  height: 1px;
  background: var(--ink);
}
.step::after { left: -7px; }
.step-no {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  text-align: center;
  font-family: var(--serif);
  font-size: 1.125rem;
  line-height: 1.2;
}
.step h3 { font-size: var(--t-lg); line-height: 1.2; }
.step p { margin-top: 10px; color: var(--ink-2); max-width: 28em; }

@media (max-width: 767px) {
  .steps { grid-template-columns: 1fr; }
  .steps::after { top: auto; bottom: -7px; left: 0; right: auto; }
  .step { padding: 0 0 40px 40px; }
  .step:last-child { padding-bottom: 0; }
  .step::before { top: 0; bottom: 0; left: 7px; right: auto; width: 1px; height: auto; }
  .step::after { top: -7px; left: 0; }
  .step-no { position: static; margin-bottom: 4px; text-align: left; color: var(--muted); }
}

/* ---------- Professionals ---------- */
.pros { padding-block: 0 var(--section); }
.pros-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 24px clamp(32px, 6vw, 96px);
  padding: clamp(32px, 5vw, 64px);
  background: var(--panel-bg);
  color: var(--panel-fg);
  border-radius: var(--radius);
}
.pros-kicker {
  margin-bottom: 14px;
  font-size: var(--t-sm);
  color: var(--panel-muted);
}
.pros-body p { color: var(--panel-body); font-size: 1.0625rem; }
.pros-body .btn { margin-top: 26px; }
.pros .btn-secondary { color: var(--panel-fg); border-color: var(--panel-fg); }
.pros .btn-secondary:hover { background: var(--panel-fg); color: var(--panel-bg); }
.pros :focus-visible { outline-color: var(--panel-fg); }
@media (max-width: 760px) {
  .pros-panel { grid-template-columns: 1fr; }
}

/* ---------- FAQ ---------- */
.faq { border-top: 1px solid var(--rule); }
.faq-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.6fr);
  gap: 32px clamp(32px, 6vw, 96px);
  align-items: start;
}
.faq-head { position: sticky; top: 112px; }
.faq-head p { margin-top: 18px; color: var(--muted); max-width: 26em; }
@media (max-width: 860px) {
  .faq-grid { grid-template-columns: 1fr; }
  .faq-head { position: static; }
}

.faq-group + .faq-group { margin-top: 48px; }
.faq-group h3 {
  margin-bottom: 8px;
  font-family: var(--sans);
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--muted);
}
.faq details { border-top: 1px solid var(--rule); }
.faq details:last-child { border-bottom: 1px solid var(--rule); }
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 20px;
  padding: 18px 0;
  font-family: var(--serif);
  font-size: 1.1875rem;
  line-height: 1.35;
  cursor: pointer;
  list-style: none;
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  flex: none;
  font-family: var(--sans);
  font-size: 1.375rem;
  font-weight: 300;
  line-height: 1;
  color: var(--accent);
}
.faq details[open] summary::after { content: "−"; }
.faq summary:hover { color: var(--accent); }
.faq details p {
  padding: 0 40px 22px 0;
  color: var(--ink-2);
  max-width: 40em;
}

/* ---------- Contact ---------- */
.contact { border-top: 1px solid var(--rule); }
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(0, 1.25fr);
  gap: 40px clamp(32px, 6vw, 88px);
  align-items: start;
}
@media (max-width: 900px) {
  .contact-grid { grid-template-columns: 1fr; }
}
.contact-intro > p:first-of-type { margin-top: 20px; color: var(--ink-2); font-size: 1.0625rem; }
.contact-intro h3 {
  margin-top: 36px;
  font-family: var(--sans);
  font-size: var(--t-sm);
  font-weight: 600;
  color: var(--muted);
}
.next-steps {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  counter-reset: next;
  border-top: 1px solid var(--rule);
}
.next-steps li {
  display: grid;
  grid-template-columns: 28px 1fr;
  padding: 12px 0;
  border-bottom: 1px solid var(--rule);
  counter-increment: next;
  font-size: 0.96875rem;
}
.next-steps li::before {
  content: counter(next);
  font-family: var(--serif);
  color: var(--muted);
}
.contact-aside { margin-top: 18px; font-size: 0.9375rem; color: var(--muted); }
.contact-aside + .contact-aside { margin-top: 8px; }

.quote-form {
  padding: clamp(24px, 4vw, 44px);
  background: var(--surface);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}

.hp {
  position: absolute !important;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.field { margin-bottom: 22px; }
.field-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 18px;
}
@media (max-width: 560px) {
  .field-row { grid-template-columns: 1fr; }
}

.field label {
  display: block;
  margin-bottom: 7px;
  font-size: 0.9375rem;
  font-weight: 600;
}
.optional {
  margin-left: 4px;
  font-weight: 400;
  font-size: 0.8125rem;
  color: var(--muted);
}
.field-hint {
  margin: -2px 0 8px;
  font-size: 0.875rem;
  color: var(--muted);
}

.field input[type="text"],
.field input[type="email"],
.field select,
.field textarea {
  width: 100%;
  min-height: 48px;
  padding: 11px 14px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--field);
  color: var(--ink);
  font: 400 1rem/1.4 var(--sans);
  transition: border-color 0.15s ease;
}
.field textarea { resize: vertical; min-height: 132px; }
.field select {
  appearance: none;
  -webkit-appearance: none;
  padding-right: 40px;
  background-image: var(--chevron);
  background-repeat: no-repeat;
  background-position: right 14px center;
}
.field input::placeholder, .field textarea::placeholder { color: var(--placeholder); }
.field input:hover, .field select:hover, .field textarea:hover { border-color: var(--rule-hover); }
.field input:focus-visible, .field select:focus-visible, .field textarea:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: var(--accent);
}
.field [aria-invalid="true"] { border-color: var(--error); }

.field-error {
  margin-top: 6px;
  font-size: 0.875rem;
  color: var(--error);
}
.field-error:empty { display: none; }

.field-check {
  display: grid;
  grid-template-columns: 22px 1fr;
  gap: 4px 12px;
  padding: 16px;
  background: var(--page);
  border: 1px solid var(--rule);
  border-radius: var(--radius);
}
.field-check input {
  width: 20px;
  height: 20px;
  margin: 2px 0 0;
  accent-color: var(--accent);
}
.field-check label {
  margin: 0;
  font-size: 0.875rem;
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink-2);
}
.field-check .field-error { grid-column: 2; }
.field-check:has([aria-invalid="true"]) { border-color: var(--error); }

.form-preview {
  margin-bottom: 18px;
  padding: 12px 14px;
  border: 1px dashed var(--rule-strong);
  font-size: 0.8125rem;
  color: var(--muted);
}

.form-submit { width: 100%; min-height: 52px; font-size: 1rem; }
.form-submit[disabled] { opacity: 0.7; cursor: progress; }

.form-status:not(:empty) {
  margin-top: 16px;
  padding: 14px 16px;
  border-radius: var(--radius);
  font-size: 0.9375rem;
}
.form-status.is-success { background: var(--wash); border-left: 2px solid var(--accent); }
.form-status.is-error { background: var(--error-wash); border-left: 2px solid var(--error); color: var(--error-ink); }
.form-status.is-info { background: var(--page); border-left: 2px solid var(--ink); }
.form-status p + .form-copy-text { margin-top: 12px; }
.form-address { font-weight: 600; user-select: all; -webkit-user-select: all; }
.form-copy-text {
  display: block;
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--field);
  color: var(--ink);
  font: 400 0.8125rem/1.5 var(--sans);
  resize: vertical;
}
.form-copy-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 20px;
  margin-top: 12px;
}

/* ---------- Footer ---------- */
.site-footer {
  padding-block: 48px 56px;
  border-top: 1.5px solid var(--ink);
  font-size: var(--t-sm);
  color: var(--muted);
}
.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.2fr);
  gap: 24px 64px;
}
@media (max-width: 760px) {
  .footer-grid { grid-template-columns: 1fr; }
}
.footer-name { font-family: var(--serif); font-size: 1rem; color: var(--ink); margin-bottom: 6px; }
.footer-copy { margin-top: 6px; }
.footer-legal p { max-width: 44em; }
.privacy { margin-top: 12px; }
.privacy summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  cursor: pointer;
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
}
.privacy p { margin-top: 4px; }

/* ---------- Study viewer ---------- */
.viewer {
  width: 100vw;
  max-width: none;
  height: 100dvh;
  max-height: none;
  margin: 0;
  padding: 0;
  border: 0;
  background: var(--page);
  color: var(--ink);
}
.viewer[open] {
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
}
.viewer::backdrop { background: rgba(37, 38, 34, 0.6); }

.viewer-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto auto;
  align-items: center;
  gap: 12px 24px;
  padding: 12px var(--gutter);
  border-bottom: 1px solid var(--rule);
}
.viewer-no { font-size: 0.8125rem; color: var(--muted); font-style: italic; font-family: var(--serif); }
.viewer-title { font-size: 1.25rem; line-height: 1.25; }
.viewer-count { font-size: var(--t-sm); color: var(--muted); }
.viewer-tools { display: flex; gap: 8px; }
.viewer-btn {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--rule-strong);
  border-radius: var(--radius);
  background: var(--surface);
  color: var(--ink);
  font: 500 0.875rem var(--sans);
  cursor: pointer;
}
.viewer-btn:hover { border-color: var(--ink); }
.viewer-btn[aria-pressed="true"] { background: var(--ink); color: var(--page); border-color: var(--ink); }

@media (max-width: 700px) {
  .viewer-bar { grid-template-columns: minmax(0, 1fr); }
  .viewer-tools { justify-content: space-between; }
  .viewer-zoom { margin-right: 0; }
  .viewer-count { grid-row: 2; grid-column: 1 / -1; }
  .viewer-title { font-size: 1.05rem; }
}

.viewer-stage {
  position: relative;
  overflow: hidden;
  min-height: 0;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
  cursor: zoom-in;
}
.viewer-stage.is-zoomed { cursor: grab; }
.viewer-stage.is-dragging { cursor: grabbing; }
/* The sheet is laid out at its natural size and placed with a transform (see js/main.js) */
.viewer-img {
  position: absolute;
  top: 0;
  left: 0;
  max-width: none;
  max-height: none;
  transform-origin: 0 0;
  background: var(--paper);
  opacity: 0;
  pointer-events: none;
  -webkit-user-drag: none;
}
.viewer-img.is-ready { opacity: 1; transition: opacity 0.15s ease; }
.viewer-stage.is-animating .viewer-img { transition: transform 0.22s ease, opacity 0.15s ease; }

.viewer-zoom { display: flex; gap: 4px; margin-right: 8px; }
.viewer-icon-btn { width: 44px; padding: 0; display: inline-grid; place-items: center; }
.viewer-btn[disabled] { opacity: 0.4; cursor: default; }
.viewer-btn[disabled]:hover { border-color: var(--rule-strong); }
.viewer-hint { font-size: 0.8125rem; color: var(--muted); }

.viewer-nav {
  position: fixed;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  margin-top: -24px;
  border: 1px solid var(--rule-strong);
  border-radius: 50%;
  background: var(--surface);
  color: var(--ink);
  cursor: pointer;
}
.viewer-nav:hover { border-color: var(--ink); }
.viewer-nav[disabled] { opacity: 0.35; cursor: default; }
.viewer-prev { left: clamp(8px, 2vw, 24px); }
.viewer-next { right: clamp(8px, 2vw, 24px); }

.viewer-foot {
  display: flex;
  align-items: center;
  gap: 12px 24px;
  padding: 10px var(--gutter) 14px;
  border-top: 1px solid var(--rule);
  overflow: hidden;
}
.viewer-strip {
  display: flex;
  gap: 8px;
  margin: 0;
  padding: 2px;
  list-style: none;
  overflow-x: auto;
  scrollbar-width: thin;
}
.viewer-thumb {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--muted);
  font: 500 0.75rem var(--sans);
  cursor: pointer;
  white-space: nowrap;
}
.viewer-thumb img {
  width: auto;
  height: 52px;
  background: var(--paper);
  border: 1px solid var(--rule);
}
.viewer-thumb[aria-current="true"] { color: var(--ink); }
.viewer-thumb[aria-current="true"] img { border-color: var(--ink); box-shadow: 0 0 0 1px var(--ink); }
.viewer-flag {
  margin-left: auto;
  font-family: var(--serif);
  font-style: italic;
  font-size: 0.8125rem;
  color: var(--muted);
  text-align: right;
}
@media (max-width: 700px) {
  .viewer-foot { flex-direction: column; align-items: stretch; }
  .viewer-flag { margin-left: 0; text-align: left; }
}
body.viewer-open { overflow: hidden; }
