/* ==========================================================================
   Legacy Historic Woodworks
   Mobile-first. Navigation goes horizontal at 760px.
   All text/background pairs below meet WCAG AA (4.5:1 for body text).
   ========================================================================== */

/* ---------- Design tokens ---------- */
:root {
  --green-900: #12372a;   /* dark brand green: footer, hover */
  --green-700: #1f5c46;   /* main brand green: buttons, links */
  --green-100: #e6f2ec;   /* light tint: backgrounds */
  --sand-50:  #fbf8f3;    /* warm page background */
  --ink:      #1d2320;    /* text */
  --muted:    #55605a;    /* secondary text */
  --radius: 10px;
  --space: clamp(1rem, 2.5vw, 1.5rem);
}

/* Roles: the rest of the stylesheet uses these names, mapped to the tokens.
   Contrast (WCAG AA needs 4.5:1 for text):
   ink on sand 15.1, muted on sand 6.2, green-700 on sand 7.4,
   white on green-700 7.8, sand on green-900 12.4, green-100 on green-900 11.4 */
:root {
  /* Colors */
  --color-bg: var(--sand-50);
  --color-surface: #ffffff;
  --color-tint: var(--green-100);
  --color-text: var(--ink);
  --color-text-muted: var(--muted);
  --color-primary: var(--green-700);
  --color-primary-hover: var(--green-900);
  --color-on-primary: #ffffff;
  --color-dark: var(--green-900);          /* header, hero, footer */
  --color-on-dark: var(--sand-50);
  --color-accent: var(--green-100);        /* highlights on dark areas */
  --color-border: color-mix(in srgb, var(--green-700) 22%, white);
  --color-granite: #ebe7e0;                /* card stone base; ink 13.4, green-700 6.3 */
  --color-granite-edge: #d3cdc3;           /* card border */
  --color-map-served: #3d7a60;             /* service-area states */
  --color-map-land: #e3e8e4;               /* states outside the service area */
  --color-focus: var(--green-900);         /* focus ring on light areas */
  --color-focus-on-dark: var(--green-100); /* focus ring on dark areas */

  /* Typography — serif fonts available on virtually every system */
  --font-serif: Georgia, "Times New Roman", Times, serif;
  --font-size-base: 1.0625rem;
  --line-height: 1.65;

  /* Spacing scale, all derived from --space (1rem on phones, 1.5rem on wide screens) */
  --space-3xs: calc(var(--space) * 0.25);
  --space-2xs: calc(var(--space) * 0.5);
  --space-xs: calc(var(--space) * 0.75);
  --space-s: var(--space);
  --space-m: calc(var(--space) * 1.5);
  --space-l: calc(var(--space) * 2);
  --space-xl: calc(var(--space) * 3);
  --space-2xl: calc(var(--space) * 4.5);

  /* Layout */
  --max-width: 72rem;
  --header-height: 4rem;
  --transition: 150ms ease-in-out;
}

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

/* The site has one look. "only light" stops dark-mode browsers from restyling
   or auto-darkening it, so light and dark mode show the same solid background. */
html {
  color-scheme: only light;
  background-color: var(--color-bg);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-serif);
  font-size: var(--font-size-base);
  line-height: var(--line-height);
}

h1,
h2,
h3 {
  margin: 0 0 var(--space-s);
  line-height: 1.2;
  font-weight: 700;
  letter-spacing: 0.01em;
}

h1 { font-size: clamp(2rem, 6vw, 3.25rem); }
h2 { font-size: clamp(1.625rem, 4vw, 2.25rem); }
h3 { font-size: 1.25rem; }

p {
  margin: 0 0 var(--space-s);
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.2em;
}

a:hover {
  color: var(--color-primary-hover);
  text-decoration-thickness: 2px;
}

img,
iframe {
  max-width: 100%;
}

address {
  font-style: normal;
}

/* ---------- Focus styles ---------- */
:focus-visible {
  outline: 3px solid var(--color-focus);
  outline-offset: 3px;
}

/* Dark areas get a light focus ring so it stays visible */
.site-header,
.site-footer {
  --color-focus: var(--color-focus-on-dark);
}

/* main receives focus from the skip link; no ring needed on the whole region */
main:focus {
  outline: none;
}

/* ---------- Skip link ---------- */
.skip-link {
  position: absolute;
  top: var(--space-2xs);
  left: var(--space-2xs);
  z-index: 100;
  padding: var(--space-2xs) var(--space-s);
  background-color: var(--color-surface);
  color: var(--color-primary);
  font-weight: 700;
  border-radius: var(--radius);
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: translateY(0);
}

/* ---------- Layout helpers ---------- */
.section-inner,
.header-inner,
.hero-inner {
  width: 100%;
  max-width: var(--max-width);
  margin-inline: auto;
  padding-inline: var(--space-s);
}

main > section {
  padding-block: var(--space-xl);
  /* keeps headings clear of the sticky header when jumping via nav */
  scroll-margin-top: var(--header-height);
}

/* ---------- Buttons ---------- */
.button {
  display: inline-block;
  padding: var(--space-xs) var(--space-m);
  border: 2px solid var(--color-primary);
  border-radius: var(--radius);
  background-color: var(--color-primary);
  color: var(--color-on-primary);
  font-weight: 700;
  text-decoration: none;
  text-align: center;
}

.button:hover {
  background-color: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  color: var(--color-on-primary);
}

.button-outline {
  background-color: transparent;
  color: var(--color-primary);
}

.button-outline:hover {
  background-color: var(--color-primary);
  color: var(--color-on-primary);
}

/* ---------- Header & navigation (mobile first) ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background-color: var(--color-dark);
  color: var(--color-on-dark);
  border-bottom: 3px solid var(--color-accent);
}

.header-inner {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2xs);
  min-height: var(--header-height);
  padding-block: var(--space-2xs);
}

.brand {
  flex: 1 1 0;      /* lets the name wrap so the menu button stays beside it */
  min-width: 0;
  color: var(--color-on-dark);
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-decoration: none;
}

.brand:hover {
  color: var(--color-accent);
}

.menu-toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2xs);
  min-height: 44px;
  padding: var(--space-2xs) var(--space-xs);
  border: 2px solid var(--color-on-dark);
  border-radius: var(--radius);
  background: transparent;
  color: var(--color-on-dark);
  font: inherit;
  font-size: 0.9375rem;
  cursor: pointer;
}

.menu-toggle:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* Three-bar icon drawn with backgrounds, so it follows the text color */
.menu-toggle-icon,
.menu-toggle-icon::before,
.menu-toggle-icon::after {
  display: block;
  width: 1.25rem;
  height: 2px;
  background-color: currentColor;
}

.menu-toggle-icon {
  position: relative;
}

.menu-toggle-icon::before,
.menu-toggle-icon::after {
  content: "";
  position: absolute;
  left: 0;
}

.menu-toggle-icon::before { top: -6px; }
.menu-toggle-icon::after  { top: 6px; }

/* Turn the bars into an X when open */
.menu-toggle[aria-expanded="true"] .menu-toggle-icon {
  background-color: transparent;
}

.menu-toggle[aria-expanded="true"] .menu-toggle-icon::before {
  top: 0;
  transform: rotate(45deg);
}

.menu-toggle[aria-expanded="true"] .menu-toggle-icon::after {
  top: 0;
  transform: rotate(-45deg);
}

.site-nav {
  flex-basis: 100%;
}

.nav-list {
  display: flex;
  flex-direction: column;
  margin: 0;
  padding: 0 0 var(--space-2xs);
  list-style: none;
}

.nav-list a {
  display: block;
  padding: var(--space-xs) var(--space-2xs);
  color: var(--color-on-dark);
  font-size: 0.9375rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  border-top: 1px solid color-mix(in srgb, var(--color-on-dark) 20%, transparent);
}

.nav-list a:hover {
  color: var(--color-accent);
  text-decoration: underline;
}

/* When JavaScript runs, the toggle controls the list.
   Without JavaScript, the button is hidden and the links stay visible. */
@media (scripting: enabled) {
  .site-nav:not(.is-open) .nav-list {
    display: none;
  }
}

@media (scripting: none) {
  .menu-toggle {
    display: none;
  }
}

/* ---------- Hero (error pages and the no-JavaScript form answer page) ----------
   Same deep green as the home hero, drawn with gradients only: a soft pool of light
   behind the logo and a darker lower-right corner.
   Text contrast on the lightest part of the green (#2a6e56): sand 5.9, green-100 5.4. */
.hero {
  background-color: var(--green-900);
  background-image:
    radial-gradient(ellipse 60% 50% at 50% 30%, rgb(118 210 166 / 0.22), transparent 70%),
    linear-gradient(150deg, #2a6e56 0%, #19513e 32%, #0f3628 62%, #071d15 100%);
  color: var(--color-on-dark);
  text-align: center;
  --color-focus: var(--color-focus-on-dark);
}

.hero h1 {
  color: var(--color-on-dark);
}

.hero a:not(.button) {
  color: var(--color-accent);
}

/* Buttons on the green: light solid button, light outline button */
.hero .button {
  border-color: var(--color-on-dark);
  background-color: var(--color-on-dark);
  color: var(--green-900);
}

.hero .button:hover {
  border-color: var(--color-accent);
  background-color: var(--color-accent);
  color: var(--green-900);
}

.hero .button-outline {
  background-color: transparent;
  color: var(--color-on-dark);
}

.hero .button-outline:hover {
  background-color: var(--color-on-dark);
  color: var(--green-900);
}

main > .hero {
  padding-block: var(--space-2xl);
}

.hero-inner {
  max-width: 48rem;
}

.hero-logo {
  display: block;
  width: auto;
  height: clamp(11.2rem, 28.8vw, 14.4rem);
  margin: 0 auto var(--space-m);
  /* warm-yellow glow that follows the logo's outline, as on the home hero */
  filter:
    drop-shadow(0 0 3px rgb(255 228 150 / 0.7))
    drop-shadow(0 0 26px rgb(255 214 102 / 0.55));
}

.hero-eyebrow {
  margin-bottom: var(--space-xs);
  color: var(--color-accent);
  font-weight: 700;
  font-size: 0.875rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.hero-lead {
  font-size: 1.125rem;
}

/* ---------- Home hero: green field, column drawings, centred logo ----------
   (The .hero rules above are still used by the 404/403/500 pages.)

   --p runs 0 → 1 as the hero scrolls away (set by script.js; stays 0 for
   reduced motion). Every moving part is a transform, so scrolling only
   recomposites.

   Column art (tablets and desktops): images/hero/col3-*.webp, made from
   the hatched L3.png and R3.png (same drawing and scale as L2/R2): black
   hatched lines, white fill, transparent outside the drawing. Each file is
   a plain percentage (25, 37.5, 50) of the same drawing, so every size
   keeps one scale:
     col3-L-*   the left column
     col3-R-*   the right piece's left 2880 drawing px: all that tablets
                and desktops ever show (the rest is past the screen edge)
   Every size and position below is a multiple of --u, the CSS size of one
   pixel of the original drawings, so the two pieces always stay in
   proportion.

   Phone art: images/hero/entry-100.webp, the Entry doorway drawing (broken
   scroll pediment over the top of a double door), 1252 x 769: Entry.png
   with the outside of the drawing made transparent and the empty border
   trimmed, inside still white. One lossless file serves every phone; it
   is only ever shown smaller than this, never stretched.

   Original-drawing measurements used (after cropping):
     L: 1412 x 6556. Pedestal ink spans the full width. The old L.png is its
        bottom 3547 rows.
     R: 5714 x 6670. Cornice tip at x 2, y 259; entablature bottom y 1865;
        column (capital) x 705–1685, its centre at x 1195. The old R.png is
        its top-left 2875 x 3547.
   The tall, wide art lets --u shrink on small screens without the columns
   ever running short of the hero. */
main > .hx {
  padding-block: 0;
}

.hx {
  --p: 0;
  /* Hero height: a little under 3/5 of the screen, lower on narrow
     screens, so the headline below shows on first load */
  --h: clamp(17rem, min(58svh, 75vw), 62rem);

  /* Logo plaque (848x1152 art), centred on the page */
  --logo-h: clamp(8rem, min(var(--h) * 0.48, 30cqw), 19rem);
  --logo-w: calc(var(--logo-h) * 848 / 1152);
  --margin: clamp(0.75rem, 3cqw, 2rem);
  /* Room on each side of the logo */
  --avail: calc(50cqw - var(--logo-w) / 2 - var(--margin));

  /* Art scale. Wide screens: the old hero art's height fills the hero.
     Narrower: shrink until the right column fits beside the logo. Never so
     small that either piece runs short of the hero's height. */
  --u: max(var(--h) / 6550,
           min(var(--h) / 3547, (var(--avail) - 0.75rem) / 1690));
  --lw: calc(1412 * var(--u));
  --lh: calc(6556 * var(--u));
  --rw: calc(2880 * var(--u));   /* the col3-R crop */
  --rh: calc(6670 * var(--u));
  /* Right piece: old art's right edge on the screen edge, but never closer
     to the logo than --margin */
  --r-left: max(100cqw - 2875 * var(--u),
                50cqw + var(--logo-w) / 2 + var(--margin));
  /* Logo centre, from the hero top */
  --logo-y: calc(var(--h) / 2);

  /* Scroll motion */
  --zoom: 0.12;     /* columns + logo grow this much by the time the hero is gone */
  --rise: 2.5rem;   /* logo lifts this far */

  container-type: inline-size;
  position: relative;
  height: var(--h);
  overflow: clip;
  isolation: isolate;
  background-color: var(--green-900);
}

/* Background: gradients only. Deep green with soft ovals of light (a teal
   bloom high right, a warm gold haze low left, a pool behind the logo, a
   shaded corner) and warm angled light stripes falling from the upper
   left. Each layer moves at its own rate on scroll, so they slide past one
   another. */
.hx-bg,
.hx-bg > * {
  position: absolute;
  pointer-events: none;
}
.hx-bg {
  inset: 0;
  z-index: 0;
  /* The logo's position inside the layers, which overhang the hero by 25%
     top and bottom */
  --logo-y-in: calc(var(--logo-y) + var(--h) * 0.25);
}

.hx-bg-base {
  inset: -25% -10%;
  background:
    radial-gradient(ellipse 28% 36% at 50% var(--logo-y-in),
      rgb(118 210 166 / 0.6), rgb(80 170 130 / 0.2) 45%, transparent 72%),
    linear-gradient(150deg, #2a6e56 0%, #19513e 32%, #0f3628 62%, #071d15 100%);
  transform: translateY(calc(var(--p) * 14%)) scale(calc(1 + var(--p) * 0.25));
  will-change: transform;
}

.hx-bg-oval {
  inset: -25% -20%;
  will-change: transform;
}
.hx-bg-teal {
  background: radial-gradient(ellipse 46% 56% at 80% 24%,
    rgb(62 172 170 / 0.75), rgb(52 150 150 / 0.3) 42%, transparent 72%);
  transform: translate(calc(var(--p) * -8%), calc(var(--p) * 12%));
}
.hx-bg-gold {
  background: radial-gradient(ellipse 46% 44% at 16% 84%,
    rgb(204 178 86 / 0.4), rgb(150 150 72 / 0.16) 42%, transparent 72%);
  transform: translate(calc(var(--p) * 10%), calc(var(--p) * -8%));
}
.hx-bg-shade {
  background: radial-gradient(ellipse 34% 30% at 92% 94%, rgb(2 12 8 / 0.7), transparent 72%);
  transform: translateY(calc(var(--p) * 16%));
}

.hx-bg-light {
  inset: -30% -40%;
  background: linear-gradient(112deg,
    transparent 18%, rgb(255 232 170 / 0.15) 24%, transparent 31%,
    transparent 37%, rgb(255 232 170 / 0.22) 45%, transparent 53%,
    transparent 57%, rgb(255 232 170 / 0.12) 61%, transparent 65%,
    transparent 69%, rgb(255 232 170 / 0.19) 75%, transparent 82%);
  -webkit-mask-image: linear-gradient(to bottom, #000 20%, transparent 90%);
  mask-image: linear-gradient(to bottom, #000 20%, transparent 90%);
  mix-blend-mode: screen;
  transform: translateX(calc(-6% + var(--p) * 14%));
  will-change: transform;
}

/* Soft dark edges so the eye settles on the centre */
.hx-bg-vignette {
  inset: 0;
  background: radial-gradient(ellipse 85% 90% at 50% 45%, transparent 55%, rgb(5 20 14 / 0.45) 100%);
}

/* Columns + logo: one wrapper zooms everything about the logo, like a
   camera pushing in, so they grow together and never run into each other */
.hx-scene {
  position: absolute;
  inset: 0;
  z-index: 1;
  transform-origin: 50% var(--logo-y);
  transform: scale(calc(1 + var(--p) * var(--zoom)));
  will-change: transform;
}

.hx-col,
.hx-entry {
  position: absolute;
  max-width: none;
  user-select: none;
  pointer-events: none;
  filter: drop-shadow(0 12px 22px rgb(0 0 0 / 0.28));
}

/* Entry doorway: phones only (shown in the phone rules below). Centred,
   standing on the floor; --ew is set there. */
.hx-entry {
  display: none;
  left: 50%;
  bottom: 0;
  width: var(--ew);
  height: auto;
  translate: -50% 0;
}

/* Left column: pinned to the left edge, standing on the floor; the shaft
   runs up past the top of the hero */
.hx-col-l {
  left: 0;
  bottom: 0;
  width: var(--lw);
  height: var(--lh);
}

/* Right entablature: cornice at the top, shaft running down past the floor,
   entablature running off the right edge */
.hx-col-r {
  left: var(--r-left);
  top: 0;
  width: var(--rw);
  height: var(--rh);
}

.hx-logo {
  position: absolute;
  z-index: 1;
  left: 50%;
  top: var(--logo-y);
  width: auto;
  height: var(--logo-h);
  max-width: none;
  translate: -50% -50%;
  transform: translateY(calc(var(--p) * var(--rise) * -1)) scale(calc(1 + var(--p) * 0.04));
  /* faint warm-yellow glow that follows the plaque's outline */
  filter:
    drop-shadow(0 0 3px rgb(255 228 150 / 0.7))
    drop-shadow(0 0 26px rgb(255 214 102 / 0.55));
}

/* Phones: no columns. The Entry doorway stands centred on the floor, the
   screen width less 1.25rem each side, and the logo sits centred in the
   green above it. On wide, short screens (phones turned sideways, small
   tablets) the doorway is capped at 55% of the hero height so the logo
   still fits above it. */
@media (max-width: 759px) {
  .hx {
    --h: clamp(19rem, 120vw, 60svh);
    --ew: min(100cqw - 2.5rem, var(--h) * 0.55 * 1252 / 769);
    --eh: calc(var(--ew) * 769 / 1252);   /* the art's own shape */
    /* Logo no taller than about 2/3 of the green above the doorway, so it
       keeps clear of the pediment on short phones */
    --logo-h: clamp(7rem, min(40cqw, (var(--h) - var(--eh)) * 0.68), 15rem);
    --logo-y: calc((var(--h) - var(--eh)) / 2);
  }
  .hx-col { display: none; }
  .hx-entry { display: block; }
}

/* Headline band under the marble. Sits close under the hero so it shows
   on first load. The eyebrow, headline and lead use the full content
   width and only wrap when they must, with wrapped lines balanced. The
   headline scales with the screen so it stays on one line on laptops and
   desktops (it needs about 25em). */
main > .intro {
  padding-block: var(--space-m) 0;
}
main > .intro + section {
  padding-top: var(--space-xl);
}
.intro {
  text-align: center;
}
.intro .hero-eyebrow {
  margin-bottom: var(--space-2xs);
  color: var(--green-700);
}
.intro h1 {
  margin-bottom: var(--space-xs);
  color: var(--green-900);
  font-size: clamp(2rem, 3.2vw, 3rem);
}
.intro .hero-eyebrow,
.intro h1,
.intro .hero-lead {
  text-wrap: balance;
}
/* Same width as the services row on wide screens */
@media (min-width: 1200px) {
  .intro .section-inner {
    max-width: min(92vw, 110rem);
  }
}

/* ---------- Marble divider (between hero and services) ----------
   Frame lines are drawn in CSS from the original image's pixel colors, so they stay
   crisp at any width. The marble is a seamless 1248x128 tile that repeats across
   the band; the marble tops out at 50px tall (well below the tile's 128px), so it
   is never enlarged or blurred on wide screens. Source: imagesOld/marble-divider.jpg
   (beside the public folder, not uploaded with the site).
   The band is a third shorter than it first was (56px on phones up to 92px on
   wide screens): now 38px up to 62px. The frame strips keep their full 6px, so
   only the marble between them got shorter. */
.marble-divider {
  --frame: 6px;         /* each of the top and bottom frame strips */
  --marble-max: 80px;   /* the original band's tallest marble, before the cut */
  --shrink: 0.67;       /* the band is 2/3 of its original height */
  height: calc(clamp(3.5rem, 8vw, calc(var(--marble-max) + 2 * var(--frame))) * var(--shrink));
  background:
    linear-gradient(to bottom,
      #757b7a 0 1px, #898e85 1px 2px, #c1c9b9 2px 6px) top / 100% var(--frame) no-repeat,
    linear-gradient(to bottom,
      #9fa59b 0 4px, #8e918a 4px 5px, #545651 5px 6px) bottom / 100% var(--frame) no-repeat,
    url("images/marble-divider-tile.webp") center var(--frame) / auto calc(100% - 2 * var(--frame)) repeat-x,
    #b1baad;
}

/* ---------- Services ---------- */
.services h2,
.cta h2 {
  text-align: center;
}

.card-grid,
.steps {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-m);
  margin: var(--space-l) 0 0;
  padding: 0;
  list-style: none;
}

/* Cards: photo on top, light granite body below.
   The granite is a tiling SVG (specks recolored to soft stone gray)
   over a warm stone base, with a faint top-to-bottom shading for depth.
   Text is ink, not muted, so it stays readable over the specks. */
.card {
  display: flex;
  overflow: hidden; /* clips the photo to the rounded corners */
  background-color: var(--color-granite);
  background-image:
    linear-gradient(180deg, rgb(255 255 255 / 0.35), rgb(0 0 0 / 0.04)),
    url("images/granite-light-mottled.svg");
  background-size: auto, 192px 192px;
  border: 1px solid var(--color-granite-edge);
  border-radius: var(--radius);
  box-shadow: 0 1px 2px rgb(0 0 0 / 0.06), 0 6px 16px rgb(0 0 0 / 0.08);
}

.card article {
  display: flex;
  flex-direction: column;
  width: 100%;
}

.card-image {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 8 / 5;
  object-fit: cover;
  background-color: var(--color-granite-edge); /* shows while loading */
  border-bottom: 4px solid var(--color-primary);
}

.card-body {
  padding: var(--space-m);
}

.card h3 {
  color: var(--color-primary);
}

.card p {
  color: var(--color-text);
}

/* ---------- About ---------- */
.about {
  background-color: var(--color-tint);
  border-block: 1px solid var(--color-border);
}

.about-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-l);
  align-items: start;
}

.about-map {
  margin: 0;
}

/* Service-area map (inline SVG). Contrast for graphics, WCAG needs 3:1:
   served states vs other states 4.1, white marker ring on served green 5.1 */
.service-map {
  display: block;
  width: 100%;
  height: auto;
  background-color: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
}

.map-state {
  fill: var(--color-map-land);
  stroke: var(--color-surface);
  stroke-width: 1;
  stroke-linejoin: round;
}

.map-state--served {
  fill: var(--color-map-served);
}

/* Special project areas: diagonal stripes in the served green */
.map-state--special {
  fill: url(#map-hatch);
}

.map-hatch-bg {
  fill: var(--color-map-land);
}

.map-hatch-line {
  fill: var(--color-map-served);
}

.map-marker-halo {
  fill: var(--color-surface);
  stroke: var(--color-dark);
  stroke-width: 2;
}

.map-marker-dot {
  fill: var(--color-dark);
}

/* Line from the shop marker out to its label in the Atlantic: dark line over a white halo */
.map-leader,
.map-leader-halo {
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-leader {
  stroke: var(--color-dark);
  stroke-width: 2.5;
}

.map-leader-halo {
  stroke: var(--color-surface);
  stroke-width: 7;
}

.map-label {
  font-family: var(--font-serif);
  font-size: 26px; /* SVG units: scales with the map */
  font-weight: 700;
  fill: var(--color-text);
  stroke: var(--color-surface);
  stroke-width: 7px;
  stroke-linejoin: round;
  paint-order: stroke; /* white halo behind the letters */
}

.about-map figcaption {
  margin-top: var(--space-2xs);
}

.map-legend {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3xs) var(--space-m);
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--color-text-muted);
  font-size: 0.9375rem;
}

.map-legend li {
  display: flex;
  align-items: center;
  gap: 0.5em;
}

.swatch {
  flex: none;
  width: 1em;
  height: 1em;
  border-radius: 3px;
  background-color: var(--color-map-served);
}

.swatch--special {
  background-color: var(--color-map-land);
  background-image: repeating-linear-gradient(-45deg, var(--color-map-served) 0 2px, transparent 2px 4.5px);
  box-shadow: inset 0 0 0 1px var(--color-map-served);
}

.swatch--shop {
  width: 0.7em;
  height: 0.7em;
  margin-inline: 0.15em;
  border-radius: 50%;
  background-color: var(--color-dark);
  box-shadow: 0 0 0 2px var(--color-surface), 0 0 0 4px var(--color-dark);
}

/* ---------- Contact ---------- */
.cta .section-inner > p {
  max-width: 40rem;
  margin-inline: auto;
  color: var(--color-text-muted);
  text-align: center;
}

/* Error red: 6.6:1 on the page background, 7:1 on white */
.contact-form {
  --color-error: #a3261b;

  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-s) var(--space-m);
  max-width: 44rem;
  margin: var(--space-l) auto 0;
}

.field {
  display: flex;
  flex-direction: column;
  gap: var(--space-3xs);
  min-width: 0;
}

.field label {
  font-weight: 700;
}

.field-note {
  color: var(--color-text-muted);
  font-weight: 400;
  font-size: 0.9375rem;
}

/* Input border is muted gray: 6.2:1 against the page, above the 3:1 needed for controls */
.field input,
.field textarea {
  width: 100%;
  min-height: 44px;
  padding: var(--space-2xs) var(--space-xs);
  border: 1px solid var(--color-text-muted);
  border-radius: var(--radius);
  background-color: var(--color-surface);
  color: var(--color-text);
  font: inherit;
}

.field textarea {
  resize: vertical;
}

.field [aria-invalid="true"] {
  border: 2px solid var(--color-error);
}

.field-hint,
.field-error {
  margin: 0;
  font-size: 0.9375rem;
}

.field-hint {
  color: var(--color-text-muted);
}

.field-error {
  color: var(--color-error);
  font-weight: 700;
}

.field-error:empty,
.form-status:empty {
  display: none;
}

.form-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: var(--space-xs);
}

.form-actions .button {
  font: inherit;
  font-weight: 700;
  cursor: pointer;
}

.form-actions .button:disabled {
  cursor: progress;
  opacity: 0.7;
}

.form-status {
  margin: 0;
  font-weight: 700;
  color: var(--color-primary);
}

.form-status[data-state="error"] {
  color: var(--color-error);
}

/* Honeypot: off-screen rather than display:none, which some bots skip */
.hp-field {
  position: absolute;
  left: -10000px;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* ---------- Footer ---------- */
.site-footer {
  padding-block: var(--space-l);
  background-color: var(--color-dark);
  color: var(--color-on-dark);
  font-size: 0.9375rem;
}

.footer-inner {
  display: grid;
  gap: var(--space-s);
}

.site-footer a {
  color: var(--color-accent);
  overflow-wrap: anywhere;
}

.site-footer a:hover {
  color: var(--color-on-dark);
}

.copyright {
  color: var(--color-on-dark);
}

/* ---------- Error pages (404.html, 403.html, 500.html) ----------
   The hero fills the space between header and footer so the footer sits at the bottom */
.error-body {
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.error-main {
  display: flex;
  flex: 1 0 auto;
}

main > .error-hero {
  display: flex;
  align-items: center;
  width: 100%;
  padding-block: var(--space-xl);
}

.error-logo {
  height: clamp(8rem, 20vw, 10rem);
}

/* List of field problems on the form answer page shown to visitors without JavaScript */
.form-page-errors {
  display: inline-block;
  margin: var(--space-s) 0;
  padding-left: 1.25em;
  text-align: left;
  font-weight: 700;
}

.error-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: var(--space-xs);
  margin-top: var(--space-m);
}

/* ---------- Tablet / desktop: 760px and up ---------- */
@media (min-width: 760px) {
  .header-inner {
    flex-wrap: nowrap;
    padding-block: 0;
  }

  .brand {
    flex: 0 1 auto;
    font-size: 1.125rem;
  }

  /* Horizontal menu; the toggle is no longer needed */
  .menu-toggle {
    display: none;
  }

  .site-nav {
    flex-basis: auto;
  }

  .site-nav .nav-list,
  .site-nav:not(.is-open) .nav-list {
    display: flex;
    flex-direction: row;
    gap: var(--space-2xs);
    padding: 0;
  }

  .nav-list a {
    padding: var(--space-2xs) var(--space-xs);
    border-top: 0;
  }

  main > section {
    padding-block: var(--space-2xl);
  }

  .section-inner,
  .header-inner,
  .hero-inner {
    padding-inline: var(--space-l);
  }

  .card-grid {
    grid-template-columns: repeat(3, 1fr);
  }

  .steps {
    grid-template-columns: repeat(auto-fit, minmax(12rem, 1fr));
  }

  .about-inner {
    grid-template-columns: 3fr 2fr;
    gap: var(--space-xl);
  }

  .contact-form {
    grid-template-columns: 1fr 1fr;
  }

  .field--wide {
    grid-column: 1 / -1;
  }

  .footer-inner {
    grid-template-columns: 1fr auto;
    align-items: end;
  }
}

/* ---------- Large screens: 1200px and up ----------
   The services row grows with the window so the photos and cards get bigger */
@media (min-width: 1200px) {
  .services .section-inner {
    max-width: min(92vw, 110rem);
  }

  .card-grid {
    gap: var(--space-l);
  }

  .card-body {
    padding: var(--space-l);
  }

  .card h3 {
    font-size: clamp(1.25rem, 1.6vw, 1.75rem);
  }

  .card p {
    font-size: clamp(1.0625rem, 1.15vw, 1.25rem);
  }
}

/* ---------- Motion ---------- */
@media (prefers-reduced-motion: no-preference) {
  html {
    scroll-behavior: smooth;
  }

  a,
  .button,
  .menu-toggle,
  .menu-toggle-icon,
  .menu-toggle-icon::before,
  .menu-toggle-icon::after,
  .skip-link {
    transition:
      color var(--transition),
      background-color var(--transition),
      border-color var(--transition),
      transform var(--transition),
      top var(--transition);
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------- Windows High Contrast / forced colors ---------- */
@media (forced-colors: active) {
  .map-state { fill: Canvas; stroke: CanvasText; }
  .map-state--special { fill: url(#map-hatch); }
  .map-hatch-bg { fill: Canvas; }
  .map-hatch-line { fill: Highlight; }
  .swatch--special { background-color: Canvas; background-image: repeating-linear-gradient(-45deg, Highlight 0 2px, Canvas 2px 4.5px); }
  .map-leader { stroke: CanvasText; }
  .map-leader-halo { stroke: Canvas; }
  .map-state--served, .swatch { fill: Highlight; background-color: Highlight; forced-color-adjust: none; }

  .button,
  .menu-toggle {
    border: 2px solid ButtonText;
  }

  .menu-toggle-icon,
  .menu-toggle-icon::before,
  .menu-toggle-icon::after {
    background-color: ButtonText;
  }

  .menu-toggle[aria-expanded="true"] .menu-toggle-icon {
    background-color: transparent;
  }
}
