/* ==========================================================================
   Copperline Plumbing & Heating - hand-authored, token-driven design system
   No framework, no build step, no preprocessor. This is showcase build 4 of
   4 - deliberately the most different from the other three: dark-first by
   default (not a light theme with a dark override), a copper accent tied
   directly to the business name, an interactive Plumbing/Heating toggle,
   and a dual fire/water photography concept instead of stock technician
   photos. See README.md "Design notes" and
   Builder Man/memory/showcase-builds-batch.md.
   Both colour schemes verified programmatically for WCAG AA contrast - see
   README.md "Verified in QA".
   ========================================================================== */

/* -------------------------------------------------------------------------
   Tokens - DARK is the default theme here, not a media-query override. The
   light theme is the override instead - the opposite authoring order from
   builds 1-3, chosen because a dark, copper-glow aesthetic is the whole
   creative point of this build, not an afterthought variant.
   ------------------------------------------------------------------------- */
:root {
  color-scheme: dark;

  --ink: #F2EFEA;
  --paper: #14181C;
  --paper-2: #1C2126;
  --paper-3: #232930;
  --muted: #9AA3AB;
  --line: #2C333A;

  /* Copper - the one accent, named in the business itself. Lighter/brighter
     in dark mode (needs to pop off near-black); a separate, much darker
     variant is defined in the light override below, because this value
     measures only 4.47:1 as text and 3.62:1 as a button fill with dark text
     on the light paper - see lessons-learned.md on colour tokens that can't
     survive a scheme flip. */
  --copper-600: #C9793D;
  --copper-700: #D98A4D;

  --btn-primary-bg: var(--copper-600);
  --btn-primary-bg-hover: var(--copper-700);
  --btn-primary-fg: #14181C;
  --btn-secondary-bg: transparent;
  --btn-secondary-border: var(--ink);
  --btn-secondary-fg: var(--ink);
  --btn-secondary-bg-hover: rgba(242, 239, 234, 0.08);

  --shadow-soft: 0 18px 40px -20px rgba(0, 0, 0, 0.55);
  --shadow-lift: 0 26px 54px -18px rgba(0, 0, 0, 0.6);
  --glow-copper: 0 0 60px -12px rgba(201, 121, 61, 0.45);

  /* A diagonal, asymmetric radius motif - only two opposite corners rounded
     - instead of a plain radius scale, meant to suggest a pipe elbow/fitting
     rather than a generic rounded card. Distinct from every other build's
     shape system. */
  --radius-sm: 6px;
  --corner-cut: 22px 6px 22px 6px;
  --radius-pill: 999px;

  /* Fixed, scheme-independent - used for the one or two elements that must
     stay a specific surface regardless of scheme (none currently needed
     beyond the tokens above, since dark IS the base here - kept for parity
     with the other three builds' token structure and in case a future
     edit adds one). */
  --surface-dark: #14181C;
  --on-dark: #F2EFEA;

  --font-display: "Oswald", system-ui, -apple-system, "Segoe UI", sans-serif;
  --font-body: "Mulish", system-ui, -apple-system, "Segoe UI", sans-serif;

  --maxw: 1200px;
}

@media (prefers-color-scheme: light) {
  :root {
    color-scheme: light;
    --ink: #181410;
    --paper: #F1F1EE;
    --paper-2: #FFFFFF;
    --paper-3: #E6E6E1;
    --muted: #5B5F63;
    --line: #DBDBD5;

    /* Much darker than the dark-mode value - see the token comment above. */
    --copper-600: #8C4A1B;
    --copper-700: #7A3F17;

    --btn-primary-bg: var(--copper-600);
    --btn-primary-bg-hover: var(--copper-700);
    --btn-primary-fg: #FFFFFF;
    --btn-secondary-border: var(--ink);
    --btn-secondary-fg: var(--ink);
    --btn-secondary-bg-hover: rgba(24, 20, 16, 0.06);

    --shadow-soft: 0 16px 36px -20px rgba(20, 16, 12, 0.3);
    --shadow-lift: 0 24px 50px -18px rgba(20, 16, 12, 0.35);
    --glow-copper: 0 0 50px -14px rgba(140, 74, 27, 0.3);
  }
}

/* -------------------------------------------------------------------------
   Reset & base
   ------------------------------------------------------------------------- */
* { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: 118px; }
body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: clip;
}
img { max-width: 100%; display: block; }
h1, h2, h3, h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.08; margin: 0; text-wrap: balance; }
p { margin: 0; }
a { color: inherit; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; cursor: pointer; }
em { font-style: normal; color: var(--copper-600); }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

.skip-link {
  position: absolute; left: 12px; top: -60px;
  background: var(--copper-600); color: var(--btn-primary-fg);
  padding: 12px 18px; border-radius: var(--radius-sm);
  z-index: 200; transition: top .2s ease;
}
.skip-link:focus { top: 12px; }

::selection { background: rgba(201, 121, 61, 0.3); color: var(--ink); }

/* -------------------------------------------------------------------------
   Buttons
   ------------------------------------------------------------------------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  border-radius: var(--radius-pill);
  font-weight: 700; font-size: 0.95rem;
  padding: 14px 26px;
  border: 1.5px solid transparent;
  transition: transform .18s ease, background-color .18s ease, box-shadow .18s ease;
  white-space: nowrap;
  text-decoration: none;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--btn-primary-bg); color: var(--btn-primary-fg); box-shadow: var(--shadow-soft); }
.btn-primary:hover { background: var(--btn-primary-bg-hover); transform: translateY(-2px); }
.btn-secondary { background: var(--btn-secondary-bg); color: var(--btn-secondary-fg); border-color: var(--btn-secondary-border); }
.btn-secondary:hover { background: var(--btn-secondary-bg-hover); transform: translateY(-2px); }
.btn-sm { padding: 10px 20px; font-size: 0.85rem; }
.btn:focus-visible { outline: 2.5px solid var(--copper-600); outline-offset: 3px; }

.logomark { display: block; flex-shrink: 0; }
.logomark-drop { fill: var(--copper-600); }
.logomark-flame { fill: var(--ink); }

/* -------------------------------------------------------------------------
   Emergency announcement strip - sits above the header, a section type
   none of the other three builds have.
   ------------------------------------------------------------------------- */
.announce-strip { background: var(--copper-600); color: var(--btn-primary-fg); }
.announce-strip .container { display: flex; align-items: center; justify-content: center; gap: 10px; padding-top: 9px; padding-bottom: 9px; text-align: center; flex-wrap: wrap; }
.announce-strip strong { font-weight: 800; }
.announce-strip a { text-decoration: underline; font-weight: 700; }

/* -------------------------------------------------------------------------
   Header
   ------------------------------------------------------------------------- */
.site-header {
  position: sticky; top: 0; z-index: 100;
  background: rgba(20, 24, 28, 0.92);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color .2s ease, background-color .2s ease;
}
@media (prefers-color-scheme: light) {
  .site-header { background: rgba(241, 241, 238, 0.92); }
}
.site-header.is-stuck { border-bottom-color: var(--line); }
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 78px; gap: 20px; }

.wordmark { display: inline-flex; align-items: center; gap: 10px; text-decoration: none; }
.wordmark-text { font-family: var(--font-display); font-weight: 600; font-size: 1.18rem; color: var(--ink); text-transform: uppercase; letter-spacing: 0.01em; }
.wordmark-text span { color: var(--copper-600); }

.main-nav { display: none; }
.main-nav ul { display: flex; align-items: center; gap: 24px; }
.main-nav a { font-size: 0.92rem; font-weight: 600; color: var(--muted); text-decoration: none; transition: color .15s ease; }
.main-nav a:hover { color: var(--ink); }

.header-actions { display: flex; align-items: center; gap: 14px; }
.header-phone { display: none; font-size: 1rem; font-weight: 700; color: var(--ink); text-decoration: none; }

@media (max-width: 480px) {
  .header-actions .btn-primary { display: none; }
}

.menu-toggle {
  display: grid; place-items: center;
  width: 44px; height: 44px; border-radius: var(--radius-sm);
  background: transparent; border: 1.5px solid var(--line); color: var(--ink);
}
.menu-toggle-bars { width: 20px; height: 14px; position: relative; }
.menu-toggle-bars span { position: absolute; left: 0; width: 100%; height: 2px; background: currentColor; border-radius: 2px; }
.menu-toggle-bars span:nth-child(1) { top: 0; }
.menu-toggle-bars span:nth-child(2) { top: 6px; }
.menu-toggle-bars span:nth-child(3) { top: 12px; }

.mobile-nav { display: none; background: var(--paper-2); border-bottom: 1px solid var(--line); }
.mobile-nav.is-open { display: block; }
.mobile-nav ul { padding: 10px 24px 20px; display: flex; flex-direction: column; }
.mobile-nav a:not(.btn) { display: block; padding: 13px 4px; font-size: 1.02rem; font-weight: 600; color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--line); }
.mobile-nav li:last-child a { border-bottom: none; }
.mobile-nav-cta { margin-top: 14px; }

@media (min-width: 1040px) {
  .main-nav { display: block; }
  .header-phone { display: inline; }
  .menu-toggle { display: none; }
  .mobile-nav { display: none !important; }
  .wordmark-text { white-space: nowrap; }
}

/* -------------------------------------------------------------------------
   Eyebrow / section heading
   ------------------------------------------------------------------------- */
.eyebrow {
  display: inline-flex; align-items: center; gap: 10px;
  font-size: 0.78rem; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--copper-600);
}
.eyebrow::before { content: ""; width: 22px; height: 2px; background: var(--copper-600); border-radius: 2px; }
.section-head { max-width: 640px; margin-bottom: 44px; }
.section-head h2 { font-size: clamp(1.9rem, 3.4vw, 2.7rem); margin-top: 12px; text-transform: uppercase; }
.section-head p:not(.eyebrow) { margin-top: 14px; color: var(--muted); font-size: 1.05rem; }
.section-head.center { margin-left: auto; margin-right: auto; text-align: center; }

section { padding: 84px 0; }
@media (max-width: 640px) { section { padding: 56px 0; } }

/* -------------------------------------------------------------------------
   Hero - pure typographic on a dark radial copper-glow gradient, no photo.
   A fourth distinct hero composition (Fieldstone: split w/ portrait photo;
   Northbound: poster type + banner photo below; Trailhead: full-bleed photo
   with scrim; Copperline: no photo at all at the hero level - photography
   is reserved for the plumbing/heating toggle instead).
   ------------------------------------------------------------------------- */
.hero {
  padding: 72px 0 88px;
  background:
    radial-gradient(900px 500px at 85% -10%, rgba(201,121,61,0.22), transparent 60%),
    radial-gradient(700px 500px at 0% 110%, rgba(201,121,61,0.12), transparent 60%),
    var(--paper);
}
.hero-copy { max-width: 800px; }
.hero-copy .eyebrow { margin-bottom: 18px; }
.hero-copy h1 { font-size: clamp(2.6rem, 6vw, 4.3rem); text-transform: uppercase; }
.hero-copy p:not(.eyebrow) { margin-top: 22px; font-size: 1.15rem; color: var(--muted); max-width: 58ch; }
.hero-actions { margin-top: 32px; display: flex; flex-wrap: wrap; gap: 14px; }
.hero-stats { margin-top: 44px; display: flex; flex-wrap: wrap; gap: 30px 44px; padding-top: 30px; border-top: 1px solid var(--line); }
.hero-stat strong { font-family: var(--font-display); font-size: clamp(1.7rem, 3vw, 2.2rem); color: var(--ink); display: block; }
.hero-stat span { font-size: 0.85rem; color: var(--muted); }

/* -------------------------------------------------------------------------
   Service toggle - interactive Plumbing/Heating tabs, each with its own
   photo (water ripple / flame) and service list. The standout structural
   feature of this build; none of the other three have an interactive
   content-swap component.
   ------------------------------------------------------------------------- */
.toggle-tabs { display: inline-flex; background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--radius-pill); padding: 5px; gap: 4px; }
.toggle-tab {
  border: none; background: transparent; color: var(--muted);
  font-family: var(--font-display); font-weight: 600; font-size: 0.95rem; text-transform: uppercase; letter-spacing: 0.03em;
  padding: 12px 26px; border-radius: var(--radius-pill);
  transition: background-color .2s ease, color .2s ease;
}
.toggle-tab.is-active { background: var(--copper-600); color: var(--btn-primary-fg); }
.toggle-tab:focus-visible { outline: 2.5px solid var(--copper-600); outline-offset: 2px; }

.toggle-panels { margin-top: 44px; }
.toggle-panel { display: none; }
.toggle-panel.is-active { display: grid; gap: 40px; grid-template-columns: 1fr; }
.toggle-media { border-radius: var(--corner-cut); overflow: hidden; aspect-ratio: 4/3; box-shadow: var(--shadow-lift); }
.toggle-media img { width: 100%; height: 100%; object-fit: cover; }
.toggle-text h3 { font-size: 1.5rem; text-transform: uppercase; }
.toggle-text > p { margin-top: 12px; color: var(--muted); }
.toggle-list { margin-top: 22px; display: flex; flex-direction: column; gap: 12px; }
.toggle-list li { padding-left: 26px; position: relative; font-weight: 600; }
.toggle-list li::before { content: ""; position: absolute; left: 0; top: 8px; width: 10px; height: 10px; background: var(--copper-600); border-radius: 2px; transform: rotate(45deg); }
.toggle-text .btn { margin-top: 26px; }

@media (min-width: 860px) { .toggle-panel.is-active { grid-template-columns: 1fr 1fr; align-items: center; } }

/* -------------------------------------------------------------------------
   Why us - asymmetric value-prop grid with the diagonal corner-cut motif.
   ------------------------------------------------------------------------- */
.why-grid { display: grid; gap: 18px; grid-template-columns: 1fr; }
.why-card { background: var(--paper-2); border: 1px solid var(--line); border-radius: var(--corner-cut); padding: 30px 26px; }
.why-card h3 { font-size: 1.15rem; text-transform: uppercase; }
.why-card p { margin-top: 10px; color: var(--muted); font-size: 0.96rem; }
@media (min-width: 700px) { .why-grid { grid-template-columns: repeat(2, 1fr); } }
@media (min-width: 1000px) { .why-grid { grid-template-columns: repeat(4, 1fr); } }

/* Recent work - reuses the why-grid column pattern but with photos in the
   signature corner-cut shape, at a taller portrait ratio than the toggle's
   4:3 media. */
.work-grid { display: grid; gap: 18px; grid-template-columns: repeat(2, 1fr); }
.work-media { border-radius: var(--corner-cut); overflow: hidden; aspect-ratio: 3/4; box-shadow: var(--shadow-soft); }
.work-media img { width: 100%; height: 100%; object-fit: cover; }
@media (min-width: 1000px) { .work-grid { grid-template-columns: repeat(4, 1fr); } }

/* -------------------------------------------------------------------------
   Legacy timeline - big pull-quote years, a narrative device none of the
   other builds use (they're all single-founder-still-owner stories;
   Copperline is a two-generation handoff).
   ------------------------------------------------------------------------- */
.legacy-band { background: var(--paper-2); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.legacy-grid { display: grid; gap: 30px; grid-template-columns: 1fr; }
.legacy-item strong { display: block; font-family: var(--font-display); font-size: clamp(2.4rem, 5vw, 3.4rem); color: var(--copper-600); }
.legacy-item p { margin-top: 10px; color: var(--muted); max-width: 40ch; }
@media (min-width: 860px) { .legacy-grid { grid-template-columns: repeat(3, 1fr); } }

/* -------------------------------------------------------------------------
   Mid-page emergency CTA banner
   ------------------------------------------------------------------------- */
.emergency-cta {
  background: var(--copper-600); color: var(--btn-primary-fg);
  border-radius: var(--corner-cut);
  padding: 44px 32px;
  display: flex; flex-direction: column; gap: 20px; align-items: flex-start;
  box-shadow: var(--glow-copper);
}
.emergency-cta h2 { font-size: clamp(1.6rem, 3vw, 2.1rem); text-transform: uppercase; }
.emergency-cta p { margin-top: 6px; font-size: 1.02rem; opacity: 0.9; max-width: 60ch; }
.emergency-cta .btn-primary { background: var(--btn-primary-fg); color: var(--copper-700); }
.emergency-cta .btn-primary:hover { background: var(--paper-2); }
@media (min-width: 760px) { .emergency-cta { flex-direction: row; align-items: center; justify-content: space-between; } }

/* -------------------------------------------------------------------------
   Reviews - a single bold stat plus a couple of quotes side by side, a
   pattern none of builds 1-3 used (marquee / pull-quote slider / stacked
   wall).
   ------------------------------------------------------------------------- */
.reviews-grid { display: grid; gap: 40px; grid-template-columns: 1fr; align-items: center; }
.reviews-stat strong { display: block; font-family: var(--font-display); font-size: clamp(3.2rem, 8vw, 5.5rem); color: var(--copper-600); line-height: 1; }
.reviews-stat span { display: block; margin-top: 10px; color: var(--muted); font-size: 1.05rem; }
.reviews-quotes { display: flex; flex-direction: column; gap: 22px; }
.review-quote { border-left: 3px solid var(--copper-600); padding-left: 20px; }
.review-quote blockquote { font-size: 1.05rem; }
.review-quote footer { margin-top: 10px; font-size: 0.85rem; color: var(--muted); font-weight: 600; }
@media (min-width: 860px) { .reviews-grid { grid-template-columns: 0.8fr 1.2fr; } }

/* -------------------------------------------------------------------------
   FAQ accordion
   ------------------------------------------------------------------------- */
.faq-list { max-width: 780px; }
.faq-item { border-bottom: 1px solid var(--line); }
.faq-item summary {
  list-style: none; cursor: pointer;
  display: flex; align-items: center; justify-content: space-between; gap: 20px;
  padding: 22px 4px; font-weight: 700; font-size: 1.02rem;
}
.faq-item summary::-webkit-details-marker { display: none; }
.faq-plus { flex-shrink: 0; width: 26px; height: 26px; border-radius: 50%; border: 1.5px solid var(--line); position: relative; transition: transform .2s ease; }
.faq-plus::before, .faq-plus::after { content: ""; position: absolute; background: var(--ink); }
.faq-plus::before { left: 6px; right: 6px; top: 12px; height: 2px; }
.faq-plus::after { top: 6px; bottom: 6px; left: 12px; width: 2px; }
.faq-item[open] .faq-plus { transform: rotate(45deg); }
.faq-answer { padding: 0 4px 22px; color: var(--muted); max-width: 62ch; }

/* -------------------------------------------------------------------------
   Contact - split info + form, with service area folded into the info side.
   ------------------------------------------------------------------------- */
.contact-band { background: var(--paper-2); border-top: 1px solid var(--line); }
.contact-grid { display: grid; gap: 40px; grid-template-columns: 1fr; }
.contact-info h2 { font-size: clamp(1.8rem, 3vw, 2.3rem); text-transform: uppercase; }
.contact-info p:not(.eyebrow) { margin-top: 14px; color: var(--muted); }
.contact-info-list { margin-top: 28px; display: flex; flex-direction: column; gap: 18px; }
.contact-info-item strong { display: block; font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.08em; color: var(--copper-600); margin-bottom: 4px; }
.contact-info-item a, .contact-info-item span { font-size: 1.02rem; text-decoration: none; }
.contact-info-item a:hover { text-decoration: underline; }

.area-list { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px 10px; }
.area-chip { border: 1.5px solid var(--line); border-radius: var(--radius-pill); padding: 6px 14px; font-size: 0.84rem; font-weight: 600; color: var(--ink); }
.area-chip.is-hq { border-color: var(--copper-600); color: var(--copper-600); }

.field-group { margin-bottom: 18px; }
.field-label { display: block; font-size: 0.88rem; font-weight: 700; margin-bottom: 7px; }
.field {
  width: 100%; padding: 13px 15px; font: inherit;
  border-radius: var(--radius-sm); border: 1.5px solid var(--line);
  background: var(--paper); color: var(--ink);
}
.field:focus { outline: none; border-color: var(--copper-600); box-shadow: 0 0 0 3px rgba(201, 121, 61, 0.2); }
textarea.field { resize: vertical; min-height: 120px; }
.field-row { display: grid; gap: 18px; grid-template-columns: 1fr; }
@media (min-width: 560px) { .field-row { grid-template-columns: 1fr 1fr; } }
.field-error { display: none; color: #E0654A; font-size: 0.84rem; margin-top: 6px; }
.field[aria-invalid="true"] { border-color: #E0654A; }
.field[aria-invalid="true"] + .field-error { display: block; }

.form-status { margin-top: 16px; font-size: 0.92rem; padding: 12px 16px; border-radius: var(--radius-sm); display: none; }
.form-status.is-visible { display: block; }
.form-status.is-success { background: rgba(201, 121, 61, 0.14); color: var(--copper-600); }
.form-status.is-error { background: rgba(224, 101, 74, 0.14); color: #E0654A; }

.captcha-wrap { min-height: 65px; margin: 6px 0 18px; }
.captcha-wrap:empty { display: none; margin: 0; }

@media (min-width: 940px) { .contact-grid { grid-template-columns: 0.85fr 1fr; align-items: start; } }

/* -------------------------------------------------------------------------
   Footer
   ------------------------------------------------------------------------- */
.site-footer { background: var(--paper-2); color: var(--muted); padding: 56px 0 28px; border-top: 1px solid var(--line); }
.footer-grid { display: grid; gap: 34px; grid-template-columns: 1fr; }
.footer-brand .wordmark-text { color: var(--ink); }
.footer-brand p { margin-top: 14px; font-size: 0.92rem; max-width: 34ch; color: var(--muted); }
.footer-col h4 { font-family: var(--font-body); font-size: 0.82rem; text-transform: uppercase; letter-spacing: 0.1em; color: var(--muted); margin-bottom: 14px; }
.footer-col ul { display: flex; flex-direction: column; gap: 10px; }
.footer-col a { color: var(--ink); text-decoration: none; font-size: 0.94rem; opacity: 0.85; }
.footer-col a:hover { text-decoration: underline; opacity: 1; }
.footer-bottom { margin-top: 40px; padding-top: 24px; border-top: 1px solid var(--line); font-size: 0.84rem; color: var(--muted); display: flex; flex-wrap: wrap; gap: 10px 20px; justify-content: space-between; }
@media (min-width: 760px) { .footer-grid { grid-template-columns: 1.4fr 1fr 1fr 1fr; } }

/* -------------------------------------------------------------------------
   Scroll reveals - IntersectionObserver driven, no scroll listeners
   ------------------------------------------------------------------------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity .6s ease, transform .6s ease; }
.reveal.is-in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1 !important; transform: none !important; transition: none !important; }
  .btn, .toggle-tab { transition: none !important; }
}
