/* Summit Ridge Builders: a design-build remodeler.
   Layout: the page is a blueprint. Cyanotype blue ground with live contour lines; content sits on white
   "drawing sheets" with title blocks; hi-vis yellow (Sierra's vest) is the one accent, used for actions
   and the hazard strip. Left-aligned, generous margins, slab headings like stamped lumber. */
@font-face { font-family: 'Zilla Slab'; font-weight: 700; font-display: swap; src: url(fonts/zilla-slab-latin-700-normal.woff2) format('woff2'); }
@font-face { font-family: 'Zilla Slab'; font-weight: 600; font-display: swap; src: url(fonts/zilla-slab-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Public Sans'; font-weight: 400; font-display: swap; src: url(fonts/public-sans-latin-400-normal.woff2) format('woff2'); }
@font-face { font-family: 'Public Sans'; font-weight: 600; font-display: swap; src: url(fonts/public-sans-latin-600-normal.woff2) format('woff2'); }
@font-face { font-family: 'Public Sans'; font-weight: 700; font-display: swap; src: url(fonts/public-sans-latin-700-normal.woff2) format('woff2'); }

:root {
  --blueprint: #1a4a85;      /* cyanotype */
  --blueprint-deep: #143c6e;
  --contour: #dcebff;        /* linework (read by contour-bg.js) */
  --paper: #f4f7fb;          /* drawing sheet */
  --ink: #0f2140;            /* drafting ink */
  --muted: #4a5a73;
  --on-blue: #eef4fd;
  --on-blue-muted: #bccde6;
  --hivis: #dff23a;          /* Sierra's vest; actions and hazards only */
  --rule: #c9d5e6;

  --display: 'Zilla Slab', Rockwell, 'Roboto Slab', Georgia, serif;
  --body: 'Public Sans', system-ui, -apple-system, 'Segoe UI', Roboto, sans-serif;
  --gutter: clamp(16px, 4vw, 48px);
  --max: 1220px;
  color-scheme: dark;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 84px; -webkit-text-size-adjust: 100%; }
body {
  margin: 0; background-color: var(--blueprint); color: var(--on-blue); font: 400 17px/1.6 var(--body);
  /* the drafting grid behind the contours */
  background-image: linear-gradient(rgba(220, 235, 255, 0.07) 1px, transparent 1px), linear-gradient(90deg, rgba(220, 235, 255, 0.07) 1px, transparent 1px);
  background-size: 32px 32px; background-attachment: fixed;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; }
button { font: inherit; cursor: pointer; }
:focus-visible { outline: 3px solid var(--hivis); outline-offset: 3px; border-radius: 4px; }
[hidden] { display: none !important; }
h1, h2, h3 { text-wrap: balance; margin: 0; }
p { margin: 0; }
.skip { position: absolute; left: -9999px; top: 8px; z-index: 100; background: var(--hivis); color: var(--ink); padding: 10px 14px; border-radius: 6px; font-weight: 700; }
.skip:focus { left: 8px; }

#contourBg { position: fixed; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; }
.no-webgl #contourBg { display: none; }
.ribbon, .top, .hazard, main, .foot, .noscript { position: relative; z-index: 1; }

/* ---------- ribbon, header, hazard strip ---------- */
.ribbon { background: var(--ink); color: var(--on-blue-muted); font-size: 13px; padding: 7px var(--gutter); text-align: center; }
.ribbon a { color: var(--paper); font-weight: 600; text-underline-offset: 3px; margin-left: 6px; white-space: nowrap; }
.top {
  position: sticky; top: env(safe-area-inset-top, 0px); z-index: 20;
  display: flex; align-items: center; gap: 24px; padding: 12px var(--gutter);
  background: rgba(20, 60, 110, 0.88); backdrop-filter: blur(10px); -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid rgba(220, 235, 255, 0.16);
}
.brand { display: flex; align-items: center; gap: 12px; text-decoration: none; margin-right: auto; color: var(--paper); }
.brand-mark { width: 40px; height: 28px; flex: none; }
.brand-word { font: 700 23px/1 var(--display); letter-spacing: 0.01em; }
.brand-word span { font-weight: 600; color: var(--on-blue-muted); }
.nav { display: flex; gap: 22px; font-weight: 600; font-size: 15px; }
.nav a { text-decoration: none; padding: 6px 0; border-bottom: 2px solid transparent; color: var(--on-blue); }
.nav a:hover { border-bottom-color: var(--hivis); }

.hazard {
  display: block; width: 100%; border: 0; padding: 0; text-align: center; color: var(--ink);
  background: repeating-linear-gradient(-45deg, var(--hivis) 0 18px, var(--ink) 18px 36px);
}
.hazard-text { display: inline-block; margin: 8px 0; padding: 6px 16px; background: var(--hivis); border-radius: 4px; font-size: 15px; }
.hazard:hover .hazard-text { background: var(--paper); }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: 0 24px; border-radius: 6px; border: 2px solid transparent; font-weight: 700; font-size: 16px; text-decoration: none; transition: background-color 0.15s, color 0.15s; }
.btn-hivis { background: var(--hivis); color: var(--ink); }
.btn-hivis:hover { background: var(--paper); }
.btn-ghost { background: transparent; color: var(--paper); border-color: rgba(238, 244, 253, 0.6); }
.btn-ghost:hover { background: var(--paper); color: var(--ink); }
.btn-small { min-height: 40px; padding: 0 16px; font-size: 15px; }
.btn-line { background: transparent; color: var(--ink); border-color: var(--ink); min-height: 44px; font-size: 15px; }
.btn-line:hover { background: var(--ink); color: var(--paper); }
.btn-line-light { background: transparent; color: var(--paper); border-color: var(--paper); }
.btn-line-light:hover { background: var(--paper); color: var(--ink); }

/* ---------- hero ---------- */
main > section { max-width: var(--max); margin: 0 auto; padding-inline: var(--gutter); }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr); gap: clamp(28px, 5vw, 64px); align-items: center; padding-block: clamp(32px, 5vw, 72px) clamp(48px, 7vw, 96px); }
.where { color: var(--on-blue-muted); font-weight: 600; margin-bottom: 16px; }
.hero h1 { font: 700 clamp(2.4rem, 4.5vw, 4.3rem)/1.04 var(--display); color: var(--paper); letter-spacing: -0.01em; max-width: 15ch; }
.lede { font-size: clamp(17px, 1.5vw, 20px); color: var(--on-blue); max-width: 34em; margin-top: 22px; }
.cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }

/* the photo as a drawing sheet: dimension line above, title block below */
.drawing { margin: 0; background: var(--paper); color: var(--ink); padding: 34px 14px 14px; border-radius: 4px; box-shadow: 0 30px 60px -30px rgba(5, 18, 40, 0.75); position: relative; }
.dim { position: absolute; left: 14px; right: 14px; top: 10px; height: 14px; border-left: 1.5px solid var(--ink); border-right: 1.5px solid var(--ink); display: grid; place-items: center; }
.dim::before { content: ''; position: absolute; left: 0; right: 0; top: 50%; border-top: 1.5px solid var(--ink); }
.dim span { position: relative; background: var(--paper); padding: 0 10px; font: 600 13px/1 var(--display); letter-spacing: 0.04em; }
.drawing img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; border: 1.5px solid var(--ink); }
.title-block { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); margin: 10px 0 0; border: 1.5px solid var(--ink); }
.title-block div { padding: 8px 10px; border-left: 1.5px solid var(--ink); min-width: 0; }
.title-block div:first-child { border-left: 0; }
.title-block dt { font-size: 11px; color: var(--muted); font-weight: 600; letter-spacing: 0.02em; }
.title-block dd { margin: 2px 0 0; font: 700 15px/1.25 var(--display); font-variant-numeric: tabular-nums; }

/* ---------- services as drawing sheets ---------- */
.work { padding-block: clamp(40px, 6vw, 80px); }
.section-head { display: grid; gap: 12px; margin-bottom: clamp(24px, 3.5vw, 40px); max-width: 46em; }
.section-head h2, .process h2, .sierra h2, .questions h2, .legend h2, .office h2, .em-inner h2 { font: 700 clamp(32px, 4vw, 50px)/1.05 var(--display); color: var(--paper); }
.section-head p { color: var(--on-blue-muted); font-size: 18px; }
.sheets { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(16px, 2.2vw, 26px); }
.sheet-card { background: var(--paper); color: var(--ink); border-radius: 4px; padding: 22px; display: flex; flex-direction: column; gap: 14px; box-shadow: 0 18px 40px -26px rgba(5, 18, 40, 0.7); }
.sheet-head { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.sheet-head h3 { font: 700 26px/1.1 var(--display); }
.tag { font-size: 12px; font-weight: 700; padding: 3px 8px; border-radius: 3px; background: var(--hivis); color: var(--ink); }
.sheet-desc { color: #2a3a55; }
.sheet-block { margin: 0; border: 1.5px solid var(--ink); display: grid; }
.sheet-block div { padding: 8px 12px; border-top: 1.5px solid var(--ink); display: grid; gap: 2px; }
.sheet-block div:first-child { border-top: 0; }
.sheet-block dt { font-size: 13px; color: var(--muted); font-weight: 600; }
.sheet-block dd { margin: 0; font-size: 15px; font-variant-numeric: tabular-nums; }
.sheet-block div:first-child dd { font: 700 18px/1.3 var(--display); }
.sheet-card .btn { margin-top: auto; align-self: flex-start; }

/* ---------- process (a real sequence) ---------- */
.process { padding-block: clamp(40px, 6vw, 80px); }
.process h2 { max-width: 18ch; margin-bottom: clamp(24px, 3.5vw, 40px); }
.steps { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(16px, 2.4vw, 28px); counter-reset: step; }
.steps li { counter-increment: step; position: relative; padding-top: 58px; }
.steps li::before { content: counter(step); position: absolute; left: 0; top: 0; width: 42px; height: 42px; border-radius: 50%; display: grid; place-items: center; border: 2px solid var(--paper); font: 700 20px/1 var(--display); color: var(--paper); background: var(--blueprint); z-index: 1; }
.steps li::after { content: ''; position: absolute; left: 50px; right: -12px; top: 20px; border-top: 1.5px dashed rgba(238, 244, 253, 0.45); }
.steps li:last-child::after { display: none; }
.steps h3 { font: 700 21px/1.2 var(--display); color: var(--paper); margin-bottom: 8px; }
.steps p { color: var(--on-blue-muted); font-size: 15.5px; }

/* ---------- emergencies ---------- */
.emergency { max-width: none; padding: 0; margin-block: clamp(24px, 4vw, 48px); background: var(--ink); border-top: 10px solid transparent; border-image: repeating-linear-gradient(-45deg, var(--hivis) 0 14px, var(--ink) 14px 28px) 10; }
.em-inner { max-width: var(--max); margin: 0 auto; padding: clamp(36px, 6vw, 72px) var(--gutter); }
.em-lede { color: var(--on-blue); font-size: 18px; margin-top: 12px; max-width: 40em; }
.on-call { margin-top: 10px; font-weight: 700; color: var(--hivis); }
.em-list { list-style: none; margin: 28px 0 0; padding: 0; display: grid; grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); gap: 14px; }
.em-item { display: flex; flex-direction: column; gap: 8px; padding: 18px; border-radius: 6px; background: #17305a; border: 1px solid rgba(220, 235, 255, 0.16); }
.em-item h3 { font: 700 19px/1.2 var(--display); color: var(--paper); }
.em-first { font-size: 15px; color: var(--on-blue); }
.em-who { font-size: 13.5px; color: var(--on-blue-muted); }
.is-911 .em-who { color: #ffd3c4; font-weight: 600; }
.em-btn { margin-top: auto; align-self: flex-start; min-height: 40px; padding: 0 14px; border-radius: 6px; border: 2px solid var(--hivis); background: transparent; color: var(--hivis); font-weight: 700; font-size: 14px; }
.em-btn:hover { background: var(--hivis); color: var(--ink); }

/* ---------- Sierra ---------- */
.sierra { display: grid; grid-template-columns: minmax(0, 0.8fr) minmax(0, 1.2fr); gap: clamp(24px, 5vw, 64px); align-items: center; padding-block: clamp(48px, 7vw, 96px); }
.sierra-art img { width: 100%; max-width: 420px; aspect-ratio: 1; object-fit: cover; border-radius: 8px; border: 2px solid var(--paper); box-shadow: 14px 14px 0 var(--hivis); }
.sierra-copy > p { margin-top: 16px; max-width: 36em; color: var(--on-blue); font-size: 18px; }
.sierra-does { list-style: none; padding: 0; margin: 20px 0 0; display: grid; gap: 10px; }
.sierra-does li { position: relative; padding-left: 28px; }
.sierra-does li::before { content: ''; position: absolute; left: 0; top: 0.35em; width: 16px; height: 16px; border-radius: 3px; background: var(--hivis); clip-path: polygon(14% 52%, 0 66%, 40% 100%, 100% 22%, 86% 8%, 40% 72%); }
.sierra-copy > .sierra-try { margin-top: 26px; font-size: 15px; color: var(--on-blue-muted); }
.sierra-asks { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.sierra-asks button { min-height: 44px; padding: 0 16px; border-radius: 6px; border: 1.5px solid rgba(238, 244, 253, 0.55); background: rgba(15, 33, 64, 0.35); color: var(--paper); font-size: 15px; text-align: left; }
.sierra-asks button:hover { border-color: var(--hivis); background: rgba(15, 33, 64, 0.7); }

/* ---------- service area + office ---------- */
.area { display: grid; grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr); gap: clamp(20px, 3vw, 40px); padding-block: clamp(40px, 6vw, 80px); align-items: start; }
.legend, .office { background: var(--paper); color: var(--ink); border-radius: 4px; padding: clamp(20px, 3vw, 32px); display: grid; gap: 14px; }
.legend h2, .office h2 { color: var(--ink); font-size: clamp(28px, 3.2vw, 40px); }
.towns { list-style: none; margin: 0; padding: 0; columns: 3 9em; column-gap: 20px; }
.towns li { padding: 4px 0; border-bottom: 1px dashed var(--rule); break-inside: avoid; }
.area-note { color: var(--muted); font-size: 15px; }
.legend .btn { justify-self: start; }
.office-phone { font-weight: 700; font-size: 19px; font-variant-numeric: tabular-nums; }
.office-license { color: var(--muted); font-size: 15px; }
.hours { width: 100%; border-collapse: separate; border-spacing: 0; border: 1.5px solid var(--ink); font-variant-numeric: tabular-nums; }
.hours th, .hours td { padding: 9px 12px; border-top: 1px solid var(--rule); font-size: 15px; text-align: left; }
.hours tr:first-child th, .hours tr:first-child td { border-top: 0; }
.hours th { font-weight: 400; }
.hours td { text-align: right; white-space: nowrap; }
.hours tr.today th, .hours tr.today td { font-weight: 700; background: #e7eefa; }

/* ---------- questions ---------- */
.questions { padding-block: clamp(32px, 5vw, 64px) clamp(56px, 8vw, 96px); }
.questions h2 { margin-bottom: 22px; }
.faq { display: grid; gap: 10px; max-width: 52em; }
.faq details { background: rgba(15, 33, 64, 0.45); border: 1px solid rgba(220, 235, 255, 0.18); border-radius: 6px; padding: 0 18px; }
.faq summary { cursor: pointer; padding: 15px 0; font-weight: 600; color: var(--paper); list-style-position: outside; }
.faq details[open] summary { border-bottom: 1px solid rgba(220, 235, 255, 0.18); }
.faq details p { padding: 12px 0 16px; color: var(--on-blue); }

/* ---------- footer ---------- */
.foot { background: var(--ink); color: var(--on-blue-muted); padding: clamp(40px, 6vw, 72px) var(--gutter) calc(96px + env(safe-area-inset-bottom, 0px)); display: grid; gap: 18px; justify-items: start; }
.foot-title { font: 700 clamp(32px, 4.4vw, 52px)/1 var(--display); color: var(--paper); }
.foot-note { max-width: 46em; }
.foot-small { font-size: 13px; color: #8a9ab3; }
.foot-small a { color: var(--on-blue-muted); }
.noscript { padding: 16px var(--gutter); background: var(--paper); color: var(--ink); }

/* ---------- Sierra chat widget ---------- */
.ac-launcher {
  position: fixed; z-index: 40; right: max(16px, env(safe-area-inset-right, 0px)); bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  display: flex; align-items: center; gap: 10px; padding: 5px 20px 5px 5px; border-radius: 999px; border: 0;
  background: var(--ink); color: var(--paper); font-weight: 700; font-size: 16px;
  box-shadow: 0 0 0 2px var(--hivis), 0 12px 30px rgba(5, 18, 40, 0.5);
}
.ac-launcher:hover { background: #18315c; }
.ac-launcher-face { width: 44px; height: 44px; border-radius: 50%; object-fit: cover; }
.ac-panel {
  position: fixed; z-index: 50; right: 16px; bottom: calc(16px + env(safe-area-inset-bottom, 0px));
  width: min(400px, calc(100vw - 32px)); height: min(640px, calc(100vh - 120px)); height: min(640px, calc(100dvh - 120px));
  display: flex; flex-direction: column; overflow: hidden; background: #0c1b33; color: var(--on-blue); border-radius: 12px;
  box-shadow: 0 0 0 2px var(--hivis), 0 24px 60px rgba(0, 0, 0, 0.5);
  animation: ac-in 0.22s ease-out;
}
@keyframes ac-in { from { opacity: 0; transform: translateY(12px) scale(0.98); } }
.ac-head { display: flex; align-items: center; gap: 12px; padding: 14px 14px 14px 16px; border-bottom: 1px solid rgba(220, 235, 255, 0.12); background: var(--blueprint-deep); }
.ac-face { width: 40px; height: 40px; border-radius: 50%; object-fit: cover; box-shadow: 0 0 0 2px var(--hivis); }
.ac-who { flex: 1; min-width: 0; }
.ac-name { font: 700 21px/1 var(--display); display: flex; align-items: center; gap: 8px; color: var(--paper); }
.ac-live { width: 8px; height: 8px; border-radius: 50%; background: #8a9ab3; }
.is-ai .ac-live { background: var(--hivis); box-shadow: 0 0 8px var(--hivis); }
.ac-role { font-size: 13px; color: var(--on-blue-muted); margin-top: 3px; }
.ac-close { width: 40px; height: 40px; border-radius: 50%; border: 0; background: rgba(255, 255, 255, 0.08); color: var(--paper); font-size: 24px; line-height: 1; }
.ac-close:hover { background: rgba(255, 255, 255, 0.16); }
.ac-log { flex: 1; overflow-y: auto; padding: 16px; display: flex; flex-direction: column; gap: 10px; overscroll-behavior: contain; }
.ac-msg { max-width: 88%; padding: 10px 14px; border-radius: 10px; font-size: 15.5px; line-height: 1.45; overflow-wrap: anywhere; }
.ac-msg.bot { background: #1a2f52; border-bottom-left-radius: 3px; align-self: flex-start; }
.ac-msg.user { background: var(--paper); color: var(--ink); border-bottom-right-radius: 3px; align-self: flex-end; }
.ac-msg b { color: var(--paper); }
.ac-msg.user b { color: var(--ink); }
.ac-msg.typing { display: flex; gap: 5px; padding: 14px; }
.ac-msg.typing i { width: 7px; height: 7px; border-radius: 50%; background: var(--hivis); opacity: 0.4; animation: ac-dot 1s infinite; }
.ac-msg.typing i:nth-child(2) { animation-delay: 0.15s; }
.ac-msg.typing i:nth-child(3) { animation-delay: 0.3s; }
@keyframes ac-dot { 50% { opacity: 1; transform: translateY(-3px); } }
.ac-chips { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 16px; }
.ac-chips:not(:empty) { padding-bottom: 10px; }
.ac-chip { min-height: 36px; padding: 0 13px; border-radius: 6px; border: 1.5px solid rgba(223, 242, 58, 0.7); background: transparent; color: var(--paper); font-size: 14px; }
.ac-chip:hover { background: rgba(223, 242, 58, 0.14); }
.ac-form { display: flex; gap: 8px; padding: 12px; border-top: 1px solid rgba(220, 235, 255, 0.12); }
.ac-input { flex: 1; min-width: 0; min-height: 46px; padding: 0 14px; border-radius: 8px; border: 1.5px solid rgba(220, 235, 255, 0.2); background: #12264a; color: var(--paper); font: 16px var(--body); }
.ac-input:focus { outline: none; border-color: var(--hivis); box-shadow: 0 0 0 3px rgba(223, 242, 58, 0.2); }
.ac-send { min-height: 46px; padding: 0 16px; border-radius: 8px; border: 0; background: var(--hivis); color: var(--ink); font-weight: 700; }
.ac-foot { padding: 0 16px 12px; font-size: 12px; color: #8a9ab3; }
.ac-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* ---------- smaller screens ---------- */
@media (max-width: 1000px) {
  .hero { grid-template-columns: 1fr; }
  .hero h1 { max-width: 16ch; }
  .sheets { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .steps { grid-template-columns: repeat(2, minmax(0, 1fr)); row-gap: 32px; }
  .steps li:nth-child(2)::after { display: none; }
  .sierra { grid-template-columns: 1fr; }
  .sierra-art img { max-width: 300px; }
  .area { grid-template-columns: 1fr; }
}
@media (max-width: 640px) {
  body { font-size: 16px; }
  .nav { display: none; }
  .brand-word { font-size: 19px; }
  .brand-word span { display: none; }
  .hazard-text { font-size: 14px; margin: 6px 0; }
  .title-block { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .title-block div:nth-child(3) { border-left: 0; }
  .title-block div:nth-child(n+3) { border-top: 1.5px solid var(--ink); }
  .sheets, .steps { grid-template-columns: 1fr; }
  .steps li::after { display: none; }
  .towns { columns: 2; }
  .ac-panel { inset: 0; width: 100%; height: 100%; border-radius: 0; padding-top: env(safe-area-inset-top, 0px); padding-bottom: env(safe-area-inset-bottom, 0px); }
  .ac-open { overflow: hidden; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .ac-msg.typing i, .ac-panel { animation: none; }
  .btn { transition: none; }
}
