/* =========================================================
   [Your Company Name] — plumbing, Mississauga
   Composition: terminal chrome + section colour bands +
   editorial serif + expandable index + grain overlay.
   ========================================================= */

:root {
  --bg-1: #14100c;
  --bg-2: #b23a1e;
  --bg-3: #1d4a4a;
  --bg-4: #e8a33d;

  --ink: #14100c;
  --paper: #fdf8f0;

  --serif: 'Fraunces', 'Cormorant Garamond', Georgia, serif;
  --sans: 'DM Sans', 'Inter', system-ui, -apple-system, sans-serif;
  --mono: 'JetBrains Mono', ui-monospace, 'SFMono-Regular', Menlo, monospace;

  --measure: 68ch;
  --pad: clamp(1.25rem, 5vw, 4rem);
  --radius: 3px;
}

/* ---------- theme: dark is the default reading of the chrome ---------- */
html[data-theme="dark"] {
  --page: #14100c;
  --page-ink: #f6efe4;
  --chrome-bg: #1d1712;
  --chrome-ink: #ded5c8;
  --chrome-line: #362c22;
  --muted: #a89c8b;
  --card: #1c1611;
  --card-line: #3a2f24;
  --field-bg: #191310;
  --field-line: #4a3d2f;
  --accent: #e8a33d;
  --accent-ink: #14100c;
}

html[data-theme="light"] {
  --page: #fdf8f0;
  --page-ink: #1c1610;
  --chrome-bg: #f6ede0;
  --chrome-ink: #2e261d;
  --chrome-line: #e0d3c0;
  --muted: #6f6353;
  --card: #fffdf9;
  --card-line: #e6d9c6;
  --field-bg: #fffdf9;
  --field-line: #cdbda6;
  --accent: #8a2f16;
  --accent-ink: #fdf8f0;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--page);
  color: var(--page-ink);
  font-family: var(--sans);
  font-size: 1.05rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

a { color: inherit; }

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

/* ---------- grain overlay ---------- */
.grain {
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.06;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='200' height='200' filter='url(%23n)'/></svg>");
  background-size: 200px 200px;
}
html[data-theme="light"] .grain { opacity: 0.045; }

/* =========================================================
   TERMINAL CHROME
   ========================================================= */
.chrome {
  position: sticky;
  top: 0;
  z-index: 100;
  background: var(--chrome-bg);
  border-bottom: 1px solid var(--chrome-line);
  color: var(--chrome-ink);
}

.chrome-bar {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  padding: 0.6rem var(--pad);
  border-bottom: 1px solid var(--chrome-line);
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
}

.dots { display: inline-flex; gap: 0.4rem; flex: none; }
.dots i {
  width: 11px; height: 11px; border-radius: 50%;
  display: block;
}
.dots i:nth-child(1) { background: #b23a1e; }
.dots i:nth-child(2) { background: #e8a33d; }
.dots i:nth-child(3) { background: #1d4a4a; }

.chrome-title {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  opacity: 0.75;
}

.theme-toggle {
  flex: none;
  font-family: var(--mono);
  font-size: 0.72rem;
  background: transparent;
  border: 1px solid var(--chrome-line);
  color: var(--chrome-ink);
  border-radius: var(--radius);
  padding: 0.5rem 0.7rem;
  min-height: 44px;
  cursor: pointer;
  letter-spacing: 0.02em;
}
.theme-toggle:hover { border-color: var(--chrome-ink); }
.tt-sep { opacity: 0.4; margin: 0 0.15rem; }
html[data-theme="dark"] .tt-dark,
html[data-theme="light"] .tt-light { color: var(--accent); font-weight: 600; }
html[data-theme="dark"] .tt-light,
html[data-theme="light"] .tt-dark { opacity: 0.72; }

.tabs {
  display: flex;
  gap: 0;
  overflow-x: auto;
  scrollbar-width: none;
  padding: 0 var(--pad);
}
.tabs::-webkit-scrollbar { display: none; }
.tabs a {
  font-family: var(--mono);
  font-size: 0.78rem;
  text-decoration: none;
  padding: 0.85rem 1rem;
  min-height: 44px;
  display: inline-flex;
  align-items: center;
  border-right: 1px solid var(--chrome-line);
  white-space: nowrap;
  opacity: 0.7;
  transition: opacity 0.15s ease, background 0.15s ease;
}
.tabs a:first-child { border-left: 1px solid var(--chrome-line); }
.tabs a:hover { opacity: 1; background: color-mix(in srgb, var(--chrome-ink) 8%, transparent); }

/* =========================================================
   BANDS — each section takes over the full background
   ========================================================= */
.band { padding: clamp(3.5rem, 9vw, 7rem) 0; }
.wrap { max-width: 1100px; margin: 0 auto; padding: 0 var(--pad); }
.wrap-narrow { max-width: 760px; }

.band-red    { background: var(--bg-2); color: #fff6ec; }
.band-blue   { background: var(--bg-3); color: #f4fbf6; }
.band-yellow { background: var(--bg-4); color: #241a0c; }
.band-dark   { background: var(--bg-1); color: #f6efe4; }

.band-red .prompt, .band-blue .prompt { color: rgba(255,255,255,0.78); }

/* muted mono labels on the red band need more weight than the default 0.6 */
.band-red .entry-num,
.band-red .entry-tag { opacity: 0.88; }
.band-yellow .prompt { color: rgba(36,26,12,0.72); }
.band-dark .prompt { color: rgba(246,239,228,0.68); }

.band-red .note, .band-blue .note { color: rgba(255,255,255,0.88); }
.band-yellow .note { color: rgba(36,26,12,0.82); }
.band-dark .note { color: rgba(246,239,228,0.8); }

.band-red .section-intro, .band-blue .section-intro { color: rgba(255,255,255,0.92); }
.band-yellow .section-intro { color: rgba(36,26,12,0.88); }
.band-dark .section-intro { color: rgba(246,239,228,0.86); }

/* =========================================================
   TYPE
   ========================================================= */
h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.12;
  letter-spacing: -0.015em;
  margin: 0 0 0.6em;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.4rem, 7.5vw, 5rem);
  font-variation-settings: 'wght' 300, 'opsz' 120;
  margin-bottom: 0.4em;
}

h2 {
  font-size: clamp(1.9rem, 4.6vw, 3rem);
  font-variation-settings: 'wght' 500, 'opsz' 90;
}

h3 {
  font-size: clamp(1.15rem, 2.4vw, 1.45rem);
  font-variation-settings: 'wght' 600, 'opsz' 40;
  margin-bottom: 0.35em;
}

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

.prompt {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  margin: 0 0 1.4rem;
  text-transform: lowercase;
}
.sigil { opacity: 0.55; margin-right: 0.35rem; }

.section-intro { font-size: 1.08rem; margin-bottom: 2.2rem; }

.note {
  font-size: 0.94rem;
  border-left: 2px solid currentColor;
  padding-left: 0.9rem;
  opacity: 0.9;
  max-width: var(--measure);
}

/* =========================================================
   HERO
   ========================================================= */
.hero {
  padding: clamp(3rem, 8vw, 6rem) 0 clamp(3rem, 7vw, 5.5rem);
  max-width: 1100px;
  margin: 0 auto;
  padding-left: var(--pad);
  padding-right: var(--pad);
}

.hero .lede {
  font-size: clamp(1.05rem, 2vw, 1.22rem);
  max-width: 60ch;
  opacity: 0.9;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin: 2rem 0 2.75rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0.8rem 1.5rem;
  font-family: var(--mono);
  font-size: 0.82rem;
  letter-spacing: 0.03em;
  text-decoration: none;
  border-radius: var(--radius);
  border: 1px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-2px); }

.btn-solid { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }
.btn-ghost { background: transparent; color: inherit; border-color: currentColor; }
.btn-wide { width: 100%; }

.hero-facts {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 1.25rem 2rem;
  margin: 0;
  padding-top: 2rem;
  border-top: 1px solid color-mix(in srgb, var(--page-ink) 18%, transparent);
}
.hero-facts dt {
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  opacity: 0.6;
  margin-bottom: 0.2rem;
}
.hero-facts dd { margin: 0; font-size: 0.98rem; }

/* =========================================================
   EXPANDABLE INDEX
   ========================================================= */
.index { border-top: 1px solid currentColor; }

.entry {
  border-bottom: 1px solid color-mix(in srgb, currentColor 35%, transparent);
}

.entry summary {
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas: "num title" "num tag";
  gap: 0 1.1rem;
  align-items: baseline;
  padding: 1.35rem 0;
  cursor: pointer;
  list-style: none;
  min-height: 44px;
}
.entry summary::-webkit-details-marker { display: none; }

.entry-num {
  grid-area: num;
  font-family: var(--mono);
  font-size: 0.78rem;
  opacity: 0.6;
  padding-top: 0.35em;
}

.entry-title {
  grid-area: title;
  font-family: var(--serif);
  font-size: clamp(1.25rem, 3vw, 1.85rem);
  font-variation-settings: 'wght' 500, 'opsz' 60;
  line-height: 1.2;
  transition: font-variation-settings 0.25s ease;
}
.entry summary:hover .entry-title { font-variation-settings: 'wght' 700, 'opsz' 60; }
.entry[open] .entry-title { font-variation-settings: 'wght' 700, 'opsz' 60; }

.entry-tag {
  grid-area: tag;
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.03em;
  opacity: 0.6;
  margin-top: 0.3rem;
}

.entry-body {
  padding: 0 0 1.75rem 0;
  animation: reveal 0.28s ease both;
}
.entry-body p, .entry-body ul { max-width: var(--measure); }
.entry-body ul {
  margin: 0 0 1.1rem;
  padding-left: 1.1rem;
}
.entry-body li { margin-bottom: 0.35rem; }

@keyframes reveal {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}

/* =========================================================
   PROCESS STEPS
   ========================================================= */
.steps {
  list-style: none;
  counter-reset: step;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 2rem;
}
.steps li {
  counter-increment: step;
  padding-left: 3.25rem;
  position: relative;
  max-width: var(--measure);
}
.steps li::before {
  content: counter(step, decimal-leading-zero);
  position: absolute;
  left: 0;
  top: 0.1rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  opacity: 0.65;
  border: 1px solid currentColor;
  border-radius: 50%;
  width: 2.25rem;
  height: 2.25rem;
  display: grid;
  place-items: center;
}
.steps h3 { margin-bottom: 0.3em; }
.steps p { margin-bottom: 0; }

/* =========================================================
   SERVICE AREA
   ========================================================= */
.area-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 2.5rem;
}
.area-grid h3 { border-bottom: 1px solid currentColor; padding-bottom: 0.5rem; }
ul.plain { list-style: none; margin: 0; padding: 0; }
ul.plain li {
  padding: 0.4rem 0;
  border-bottom: 1px solid color-mix(in srgb, currentColor 22%, transparent);
  font-size: 0.98rem;
}

/* =========================================================
   QUOTE FORM
   ========================================================= */
.quote-form {
  background: rgba(0,0,0,0.16);
  border: 1px solid rgba(255,255,255,0.3);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 4vw, 2.25rem);
  display: grid;
  gap: 1.15rem;
}

.field { display: grid; gap: 0.4rem; }
.field-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 1.15rem;
}

.field label {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.85);
}

.field input,
.field select,
.field textarea {
  font-family: var(--sans);
  font-size: 1rem;
  color: #fff;
  background: rgba(0,0,0,0.22);
  border: 1px solid rgba(255,255,255,0.4);
  border-radius: var(--radius);
  padding: 0.75rem 0.85rem;
  min-height: 48px;
  width: 100%;
}
.field textarea { min-height: 140px; resize: vertical; line-height: 1.6; }
.field input::placeholder, .field textarea::placeholder { color: rgba(255,255,255,0.5); }
.field select option { color: #0a0a0a; }

.field input:focus, .field select:focus, .field textarea:focus {
  outline: 3px solid #e8a33d;
  outline-offset: 2px;
  border-color: #e8a33d;
}

.field-check {
  grid-template-columns: auto 1fr;
  align-items: start;
  gap: 0.7rem;
}
.field-check input {
  width: 22px; height: 22px; min-height: 22px;
  margin-top: 0.15rem;
  accent-color: #e8a33d;
}
.field-check label {
  text-transform: none;
  letter-spacing: 0;
  font-family: var(--sans);
  font-size: 0.95rem;
  line-height: 1.5;
}

.quote-form .btn-solid {
  background: #e8a33d;
  color: #241a0c;
  border-color: #e8a33d;
  font-weight: 600;
}
.quote-form .btn-solid:hover { background: #fff6ec; border-color: #fff6ec; }

.form-status {
  margin: 0;
  font-family: var(--mono);
  font-size: 0.82rem;
  padding: 0.85rem 1rem;
  border: 1px solid rgba(255,255,255,0.5);
  border-radius: var(--radius);
  background: rgba(0,0,0,0.25);
}
.form-status.is-error { border-color: #fff; background: rgba(0,0,0,0.45); }

/* =========================================================
   FOOTER
   ========================================================= */
.site-footer {
  background: var(--bg-1);
  color: #f6efe4;
  padding: clamp(2.5rem, 6vw, 4rem) 0 4.5rem;
  border-top: 1px solid #362c22;
}
.footer-inner {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 2rem;
}
.footer-name {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-variation-settings: 'wght' 600, 'opsz' 40;
  margin-bottom: 0.3rem;
}
.footer-meta {
  font-family: var(--mono);
  font-size: 0.76rem;
  color: #c4b8a6;
  margin: 0 0 0.45rem;
  max-width: none;
}
.footer-meta a { color: #f6efe4; }

.muted.attribution {
  text-align: center;
  margin: 3rem auto 0;
  font-family: var(--mono);
  font-size: 0.72rem;
  color: #a89c8b;
  max-width: none;
}
.muted.attribution a { color: #d3c7b5; text-decoration: none; }
.muted.attribution a:hover { text-decoration: underline; }

/* =========================================================
   TESTIMONIALS
   ========================================================= */
.quotes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1.5rem;
  margin: 0 0 2rem;
}

.quote {
  margin: 0;
  background: rgba(0,0,0,0.18);
  border: 1px solid rgba(255,255,255,0.32);
  border-radius: var(--radius);
  padding: clamp(1.25rem, 3vw, 1.75rem);
  display: flex;
  flex-direction: column;
  gap: 1rem;
}

.quote blockquote {
  margin: 0;
  font-family: var(--serif);
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  font-variation-settings: 'wght' 400, 'opsz' 40;
  line-height: 1.5;
  text-wrap: pretty;
}

.quote figcaption {
  margin-top: auto;
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.03em;
  line-height: 1.6;
  color: rgba(255,255,255,0.82);
}
.quote figcaption .who { display: block; color: #fff; }
.quote figcaption .where { display: block; opacity: 0.85; }

.quote-note {
  border-left: 2px solid rgba(255,255,255,0.6);
  padding-left: 0.9rem;
  max-width: var(--measure);
  font-size: 0.94rem;
  color: rgba(255,255,255,0.88);
}

/* =========================================================
   KINETIC HERO — weight shifts with scroll progress
   ========================================================= */
@keyframes weigh {
  from { font-variation-settings: 'wght' 200, 'opsz' 120; }
  to   { font-variation-settings: 'wght' 800, 'opsz' 120; }
}

@supports (animation-timeline: scroll()) {
  .kinetic {
    animation: weigh linear both;
    animation-timeline: scroll(root block);
    animation-range: 0 30vh;
  }
}

/* =========================================================
   MOTION PREFERENCES
   ========================================================= */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  .kinetic { animation: none; font-variation-settings: 'wght' 400, 'opsz' 120; }
  .btn:hover { transform: none; }
}

/* =========================================================
   SMALL SCREENS
   ========================================================= */
@media (max-width: 560px) {
  body { font-size: 1rem; }
  .chrome-title { display: none; }
  .entry summary { grid-template-areas: "num title" "num tag"; gap: 0 0.85rem; }
  .steps li { padding-left: 0; padding-top: 3rem; }
  .steps li::before { top: 0; }
}
