/* =========================================================================
   Solid Space — design system
   Tokens → base → layout → components → motion → responsive → a11y
   No dependencies. Motion follows: transform/opacity/clip-path only,
   ease-out on enters, <300ms on UI, reduced-motion = gentler, not zero.
   ========================================================================= */

/* ---------- 1. Tokens ---------------------------------------------------- */
:root {
  /* Color — green scale */
  --green-900: #0f2e23;
  --green-800: #1a4232;
  --green-700: #3e5c4e;

  /* Color — ink (on light) */
  --ink:   #1a2b23;
  --ink-2: #33463c;
  --ink-3: #55645b;
  --ink-4: #5c6a61;   /* 4.8:1 on bone — was 3.8, failed AA for small text */

  /* Color — bone (on dark / backgrounds) */
  --bone:   #f3f0e8;
  --bone-2: #ece8dd;
  --bone-3: #e2ddcf;
  --bone-4: #d9d3c3;

  /* Text on dark */
  --on-dark:    rgba(243, 240, 232, 1);
  --on-dark-80: rgba(243, 240, 232, 0.84);
  --on-dark-60: rgba(243, 240, 232, 0.62);
  --on-dark-45: rgba(243, 240, 232, 0.56); /* 5.0:1 on green — was 4.1 */

  /* Hairlines — one alpha per theme */
  --line:     rgba(15, 46, 35, 0.14);
  --line-2:   rgba(15, 46, 35, 0.08);
  --line-inv: rgba(243, 240, 232, 0.18);

  /* One metallic gradient. Used on dark surfaces only — on bone its bright stops fail contrast. */
  --metal: linear-gradient(105deg, #b9bfc7 0%, #edeff2 30%, #a6acb4 55%, #f4f5f7 78%, #9aa0a8 100%);

  /* Type */
  --font-serif: 'Cormorant Garamond', 'Iowan Old Style', Georgia, serif;
  --font-sans: 'Jost', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, monospace;

  /* Space — 8pt scale */
  --s-1: 0.25rem;  --s-2: 0.5rem;   --s-3: 0.75rem;  --s-4: 1rem;
  --s-5: 1.5rem;   --s-6: 2rem;     --s-7: 3rem;     --s-8: 4rem;
  --s-9: 6rem;     --s-10: 8rem;

  --gutter: clamp(1.25rem, 5vw, 3rem);
  --section-y: clamp(4.5rem, 10vw, 7rem);
  --container: 75rem; /* 1200px */

  /* Motion */
  --ease-out: cubic-bezier(0.23, 1, 0.32, 1);
  --ease-in-out: cubic-bezier(0.77, 0, 0.175, 1);
  --dur-press: 140ms;
  --dur-ui: 200ms;
  --dur-reveal: 500ms;

  --radius: 2px;

  /* Elevation — soft, tinted with the brand green rather than neutral black.
     Bigger surfaces read as thicker: more blur, more spread. */
  --shadow-sm: 0 1px 2px rgba(15, 46, 35, 0.05), 0 2px 8px -4px rgba(15, 46, 35, 0.08);
  --shadow-md: 0 2px 4px rgba(15, 46, 35, 0.04), 0 12px 28px -12px rgba(15, 46, 35, 0.14);
  --shadow-lg: 0 4px 8px rgba(15, 46, 35, 0.04), 0 32px 64px -32px rgba(15, 46, 35, 0.22);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--bone);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 1.0625rem;
  font-weight: 300;
  line-height: 1.65;
  font-optical-sizing: auto;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  /* `clip`, not `hidden` — `hidden` would make body a scroll container and break position:sticky */
  overflow-x: clip;
}

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

h1, h2, h3 {
  font-family: var(--font-serif);
  font-weight: 500;
  margin: 0;
  text-wrap: balance;
}

/* Size-specific tracking + leading: tighter as type grows */
.display {
  font-size: clamp(2.75rem, 5.5vw, 4.75rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
}
.h2 {
  font-size: clamp(2.125rem, 3.6vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.015em;
}
.h3 {
  font-size: clamp(1.5rem, 2.2vw, 1.875rem);
  line-height: 1.2;
  letter-spacing: -0.01em;
}

p { margin: 0; text-wrap: pretty; }

a { color: var(--green-900); text-decoration: none; }

.eyebrow {
  font-size: 0.8125rem;
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 var(--s-4);
}
.eyebrow--metal { width: fit-content; } /* on light: solid ink — a gradient's bright stops fail AA at 13px */
.on-dark .eyebrow { color: var(--on-dark-60); }
.on-dark .eyebrow--metal {
  background: var(--metal);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.lede { font-size: 1.1875rem; line-height: 1.6; color: var(--ink-2); }
.on-dark .lede { color: var(--on-dark-80); }
.muted { color: var(--ink-3); }
.on-dark .muted { color: var(--on-dark-60); }

::selection { background: var(--green-900); color: var(--bone); }

/* Focus — visible on both themes */
:focus-visible {
  outline: 2px solid var(--green-900);
  outline-offset: 3px;
  border-radius: var(--radius);
}
.on-dark :focus-visible,
.nav__cta:focus-visible { outline-color: var(--bone); }

/* ---------- 3. Layout ---------------------------------------------------- */
.container {
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.section { padding-block: var(--section-y); }
.section--alt { background: var(--bone-2); }
.section--dark,
.on-dark {
  background: var(--green-900);
  color: var(--on-dark);
  position: relative;
  overflow: hidden;
}
.on-dark a { color: var(--on-dark); }

/* Decorative watermark bleed */
.watermark {
  position: absolute;
  pointer-events: none;
  user-select: none;
  opacity: 0.05;
  z-index: 0;
}
.watermark--hero { right: -12%; top: 50%; transform: translateY(-50%); width: 130%; max-width: 2100px; }
.watermark--left  { left: -14%; top: -18%; width: 65%; max-width: 950px; opacity: 0.045; }
.watermark--right { right: -10%; top: -14%; width: 65%; max-width: 950px; opacity: 0.045; }
.on-dark > .container { position: relative; z-index: 1; }

.split {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: var(--s-8);
  align-items: center;
}
.split--pricing { grid-template-columns: 1fr 1.6fr; align-items: start; }
.split--contact { grid-template-columns: 1fr 1.2fr; gap: clamp(2.5rem, 6vw, 4.5rem); align-items: start; }

.skip {
  position: absolute;
  left: var(--s-4);
  top: var(--s-4);
  z-index: 100;
  background: var(--green-900);
  color: var(--bone);
  padding: var(--s-3) var(--s-5);
  border-radius: var(--radius);
  transform: translateY(-200%);
  transition: transform var(--dur-ui) var(--ease-out);
}
.skip:focus-visible { transform: translateY(0); }

/* ---------- 4. Navigation ------------------------------------------------ */
.nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  padding: 1.125rem var(--gutter);
  background: rgba(243, 240, 232, 0.72);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
}

/* Scroll edge effect instead of a hard 1px divider */
.nav::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: -1.5rem;
  height: 1.5rem;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(15, 46, 35, 0.07), rgba(15, 46, 35, 0));
  opacity: 0;
  transition: opacity var(--dur-ui) var(--ease-out);
}
.nav.is-scrolled::after { opacity: 1; }

.nav__brand {
  font-weight: 500;
  font-size: 0.9375rem;
  letter-spacing: 0.32em;
  color: var(--green-900);
  white-space: nowrap;
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 1.75rem;
  font-size: 0.875rem;
  letter-spacing: 0.06em;
}

.nav__link {
  color: var(--ink-2);
  position: relative;
  padding-block: 0.25rem;
  transition: color var(--dur-ui) ease;
}
.nav__link::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 1px;
  background: currentColor;
  clip-path: inset(0 100% 0 0);
  transition: clip-path var(--dur-ui) var(--ease-out);
}
.nav__link[aria-current='true'] { color: var(--green-900); }
.nav__link[aria-current='true']::after { clip-path: inset(0 0 0 0); }

.lang {
  display: flex;
  gap: var(--s-2);
  color: var(--ink-4);
  font-size: 0.8125rem;
}
.lang a { color: var(--ink-4); transition: color var(--dur-ui) ease; }
.lang a[aria-current='true'] { color: var(--green-900); font-weight: 500; }

/* Mobile menu trigger + panel */
.nav__toggle {
  display: none;
  align-items: center;
  justify-content: center;
  width: 2.75rem;
  height: 2.75rem;
  margin-right: -0.5rem;
  padding: 0;
  background: none;
  border: 0;
  color: var(--green-900);
  cursor: pointer;
  transition: transform var(--dur-press) var(--ease-out);
}
.nav__toggle:active { transform: scale(0.94); }
.nav__toggle svg { width: 22px; height: 22px; }
.nav__toggle .icon-close { display: none; }
.nav__toggle[aria-expanded='true'] .icon-open { display: none; }
.nav__toggle[aria-expanded='true'] .icon-close { display: block; }

.menu {
  position: absolute;
  top: calc(100% + 0.5rem);
  right: var(--gutter);
  left: var(--gutter);
  z-index: 60;
  display: grid;
  gap: var(--s-1);
  padding: var(--s-5);
  background: rgba(243, 240, 232, 0.92);
  backdrop-filter: blur(24px) saturate(180%);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 24px 48px -24px rgba(15, 46, 35, 0.28);
  /* Anchored to its trigger, not the viewport centre */
  transform-origin: top right;
  opacity: 0;
  transform: scale(0.96) translateY(-6px);
  visibility: hidden;
  transition:
    opacity 140ms var(--ease-out),
    transform 140ms var(--ease-out),
    visibility 0s linear 140ms;
}
.menu.is-open {
  opacity: 1;
  transform: scale(1) translateY(0);
  visibility: visible;
  transition:
    opacity 180ms var(--ease-out),
    transform 180ms var(--ease-out),
    visibility 0s;
}
.menu a {
  padding: var(--s-3) var(--s-2);
  font-size: 1.0625rem;
  color: var(--ink-2);
  border-radius: var(--radius);
  transition: background-color var(--dur-ui) ease, color var(--dur-ui) ease;
}
.menu .lang { padding: var(--s-3) var(--s-2) 0; border-top: 1px solid var(--line); margin-top: var(--s-2); }

/* ---------- 5. Buttons --------------------------------------------------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: var(--s-2);
  padding: 0.9375rem 2.125rem;
  border: 1px solid transparent;
  border-radius: var(--radius);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  line-height: 1.2;
  cursor: pointer;
  text-align: center;
  transition:
    transform var(--dur-press) var(--ease-out),
    background-color var(--dur-ui) ease,
    border-color var(--dur-ui) ease,
    color var(--dur-ui) ease;
}
/* Feedback on press, instantly */
.btn:active { transform: scale(0.97); }

.btn--primary,
.on-dark .btn--primary { background: var(--green-900); color: var(--bone); }
.btn--metal,
.on-dark .btn--metal { background: var(--metal); color: var(--green-900); }
.btn--light,
.on-dark .btn--light { background: var(--bone); color: var(--green-900); }
.btn--ghost {
  background: transparent;
  color: var(--on-dark);
  border-color: rgba(243, 240, 232, 0.35);
}
.btn--sm { padding: 0.625rem 1.375rem; font-size: 0.875rem; }

@media (hover: hover) and (pointer: fine) {
  .btn--primary:hover { background: var(--green-800); }
  .btn--ghost:hover { border-color: rgba(243, 240, 232, 0.8); }
  .nav__link:hover { color: var(--green-900); }
  .nav__link:hover::after { clip-path: inset(0 0 0 0); }
  .lang a:hover { color: var(--green-900); }
  .menu a:hover { background: rgba(15, 46, 35, 0.05); color: var(--green-900); }
  .contact-list a:hover .contact-list__value { color: var(--on-dark); }
}

/* ---------- 6. Hero ------------------------------------------------------ */
.hero { padding-block: clamp(3.5rem, 8vw, 6rem) clamp(4rem, 9vw, 5.5rem); }

/* A real plastered surface under the type — the material the business actually
   works in. Overlay blend, then vignetted back to brand green by ::after so
   no detail competes with the headline. Decorative only. */
.hero::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: url('../assets/atmosphere/hero-plaster.jpg');
  background-image: image-set(
    url('../assets/atmosphere/hero-plaster.webp') type('image/webp'),
    url('../assets/atmosphere/hero-plaster.jpg') type('image/jpeg')
  );
  background-size: cover;
  background-position: center right;
  opacity: 0.9;
  mix-blend-mode: overlay;
  pointer-events: none;
}
/* Vignette back toward brand green so edges stay solid and the type stays legible */
.hero::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    linear-gradient(100deg, rgba(15, 46, 35, 0.92) 0%, rgba(15, 46, 35, 0.55) 40%, rgba(15, 46, 35, 0.72) 100%),
    radial-gradient(75% 100% at 18% 45%, rgba(15, 46, 35, 0.55), rgba(15, 46, 35, 0) 70%);
  pointer-events: none;
}
.hero > .container { position: relative; z-index: 1; }
.hero .display em {
  font-style: italic;
  background: var(--metal);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
}
.hero__copy { display: flex; flex-direction: column; gap: 1.375rem; margin: var(--s-6) 0 2.75rem; max-width: 42ch; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--s-4); align-items: center; }
.hero__logo { display: flex; justify-content: center; }
.hero__logo img { width: 100%; max-width: 28.75rem; }

.trust {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 3.5rem;
  margin-top: 4.5rem;
  padding-top: 1.75rem;
  border-top: 1px solid var(--line-inv);
  font-size: 0.875rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--on-dark-60);
}

/* ---------- 7. Services -------------------------------------------------- */
.services { display: grid; }
.service {
  display: grid;
  grid-template-columns: 5rem 1fr 1.4fr;
  gap: var(--s-5);
  align-items: baseline;
  padding-block: 1.875rem;
  border-top: 1px solid var(--line);
}
.service:last-child { border-bottom: 1px solid var(--line); }
.service__num {
  font-size: 0.875rem;
  color: var(--ink-4);
  letter-spacing: 0.1em;
}
.service__title { margin: 0; }
.service__desc { color: var(--ink-2); line-height: 1.6; }

/* ---------- 8. Projects -------------------------------------------------- */
.grid-cards {
  display: grid;
  /* Three cards, three columns — auto-fit would leave a dead column at wide widths */
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-5);
}
.project { margin: 0; }
.project__frame {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  border-radius: var(--radius);
  /* A surface lit from the upper left, not a flat swatch */
  background:
    radial-gradient(120% 90% at 22% 8%, rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0) 60%),
    linear-gradient(160deg, var(--bone-2) 0%, var(--bone-3) 62%, #d5cfbe 100%);
  box-shadow: var(--shadow-sm);
  display: flex;
  align-items: center;
  justify-content: center;
}
.project__frame::after {
  /* soft inner edge so the tile reads as a framed plate, not a flat block */
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.5),
    inset 0 0 0 1px rgba(15, 46, 35, 0.07);
  pointer-events: none;
}
.project__frame--photo { background: var(--bone-3); }
.project__frame img.project__photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.project__frame img.project__mark {
  position: absolute;
  width: 150%;
  max-width: none;
  opacity: 0.08;
  pointer-events: none;
}
.project__label {
  position: relative;
  font-family: var(--font-serif);
  font-size: 1.125rem;
  letter-spacing: 0.02em;
  color: var(--ink-3);
}
.project figcaption {
  padding: 0.875rem 0.125rem 0;
  font-size: 0.875rem;
  letter-spacing: 0.08em;
  color: var(--ink-2);
}
.on-dark .project__frame { background: rgba(243, 240, 232, 0.06); }
.on-dark .project__frame::after { box-shadow: inset 0 0 0 1px var(--line-inv); }
.on-dark .project__label { color: var(--on-dark-60); }

/* ---------- 8b. Atmosphere band ----------------------------------------- */
/* A full-bleed pause between sections. Decorative material photography —
   never captioned as a completed job. */
.band {
  position: relative;
  height: clamp(16rem, 34vw, 30rem);
  overflow: hidden;
  background: var(--bone-2);
}
.band img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 55%;
}
.band::after {
  content: '';
  position: absolute;
  inset: 0;
  /* feather the top and bottom edges into the adjoining sections */
  background: linear-gradient(to bottom, var(--bone) 0%, rgba(243, 240, 232, 0) 18%, rgba(243, 240, 232, 0) 82%, var(--bone) 100%);
  pointer-events: none;
}
.band--onAlt::after {
  background: linear-gradient(to bottom, var(--bone-2) 0%, rgba(236, 232, 221, 0) 18%, rgba(236, 232, 221, 0) 82%, var(--bone) 100%);
}

/* ---------- 9. Pricing --------------------------------------------------- */
.prices { margin: 0; display: grid; }
.price-row {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: var(--s-5);
  padding-block: 1.375rem;
  border-top: 1px solid var(--line);
}
.price-row:last-of-type { border-bottom: 1px solid var(--line); }
.price-row dt { font-size: 1.125rem; font-weight: 300; }
.price-row dd {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.5rem;
  white-space: nowrap;
}
.price-note { margin-top: 1.125rem; font-size: 0.8125rem; color: var(--ink-3); letter-spacing: 0.04em; }

/* ---------- 10. About pillars ------------------------------------------- */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: var(--s-6);
  padding-top: 1.75rem;
  border-top: 1px solid var(--line-inv);
}
.pillar__title { margin: 0 0 var(--s-2); font-family: var(--font-serif); font-size: 1.75rem; line-height: 1.15; }
.pillar__desc { font-size: 0.875rem; line-height: 1.5; color: var(--on-dark-60); }

/* ---------- 11. Testimonials -------------------------------------------- */
.quote {
  position: relative;
  margin: 0;
  padding: 2.25rem 2rem;
  border-radius: var(--radius);
  background:
    radial-gradient(120% 80% at 15% 0%, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0) 55%),
    var(--bone-2);
  box-shadow: var(--shadow-sm);
  display: flex;
  flex-direction: column;
  gap: var(--s-5);
}
.quote::before {
  content: '”';
  position: absolute;
  top: 0.25rem;
  right: 1.25rem;
  font-family: var(--font-serif);
  font-size: 5rem;
  line-height: 1;
  color: rgba(15, 46, 35, 0.08);
  pointer-events: none;
}
.quote p {
  position: relative;
  margin: 0;
  font-family: var(--font-serif);
  font-size: 1.375rem;
  line-height: 1.45;
}
.quote footer { font-size: 0.875rem; letter-spacing: 0.08em; color: var(--ink-3); }

/* ---------- 12. FAQ ------------------------------------------------------ */
.faq { display: grid; max-width: 53.75rem; }
.faq details { border-top: 1px solid var(--line); }
.faq details:last-of-type { border-bottom: 1px solid var(--line); }
.faq summary {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-5);
  padding-block: var(--s-5);
  font-size: 1.125rem;
  font-weight: 400;
  list-style: none;
  cursor: pointer;
}
.faq summary::-webkit-details-marker { display: none; }
.faq-plus {
  flex: none;
  font-size: 1.5rem;
  font-weight: 300;
  color: var(--ink-3);
  transition: transform var(--dur-ui) var(--ease-out);
}
.faq details[open] .faq-plus { transform: rotate(45deg); }
/* Accordion: the sanctioned grid-rows exception */
.faq-body {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 250ms var(--ease-out);
}
.faq details[open] .faq-body { grid-template-rows: 1fr; }
.faq-inner { overflow: hidden; }
.faq-inner p { padding-bottom: var(--s-5); color: var(--ink-2); line-height: 1.65; max-width: 65ch; }

/* ---------- 13. Contact -------------------------------------------------- */
.contact-list { display: grid; gap: 1.25rem; font-size: 1.0625rem; }
.contact-list a, .contact-list p { display: flex; gap: var(--s-4); align-items: baseline; margin: 0; }
.contact-list__key {
  flex: none;
  width: 5.25rem;
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--on-dark-45);
}
.contact-list__value { color: var(--on-dark-80); transition: color var(--dur-ui) ease; }

.form {
  display: grid;
  gap: 1.125rem;
  padding: clamp(1.5rem, 4vw, 2.5rem);
  background: rgba(243, 240, 232, 0.05);
  border: 1px solid var(--line-inv);
  border-radius: var(--radius);
}
.form__title { font-family: var(--font-serif); font-size: 1.625rem; margin-bottom: var(--s-1); }
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.125rem; }
.field { display: grid; gap: 0.375rem; }
.field label {
  font-size: 0.75rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--on-dark-60);
}
.field input,
.field textarea {
  width: 100%;
  background: transparent;
  border: 1px solid rgba(243, 240, 232, 0.3);
  border-radius: var(--radius);
  color: var(--on-dark);
  font-family: var(--font-sans);
  font-size: 0.9375rem;
  font-weight: 300;
  padding: 0.8125rem 1rem;
  transition: border-color var(--dur-ui) ease;
}
.field textarea { resize: vertical; min-height: 6.5rem; }
.field input::placeholder,
.field textarea::placeholder { color: var(--on-dark-45); }
.field input:focus-visible,
.field textarea:focus-visible { outline: 2px solid var(--bone); outline-offset: 1px; }
.field[data-invalid='true'] input,
.field[data-invalid='true'] textarea { border-color: #e5a08a; }
.field__error {
  font-size: 0.75rem;
  letter-spacing: 0.04em;
  color: #e5a08a;
  min-height: 1rem;
  opacity: 0;
  transition: opacity 160ms var(--ease-out);
}
.field[data-invalid='true'] .field__error { opacity: 1; }

/* Blur-masked crossfade between button label and confirmation */
.form__status {
  margin: 0;
  font-size: 0.8125rem;
  color: var(--on-dark-45);
  transition: opacity var(--dur-ui) ease, filter var(--dur-ui) ease;
}
.form__status.is-swapping { opacity: 0.35; filter: blur(2px); }

/* ---------- 14. Footer --------------------------------------------------- */
.footer { background: var(--green-900); color: var(--on-dark-60); padding-bottom: var(--s-7); }
.footer__inner {
  border-top: 1px solid var(--line-inv);
  padding-top: 2.5rem;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: center;
  gap: var(--s-5);
}
.footer img { width: 13.75rem; }
.footer p { font-size: 0.8125rem; letter-spacing: 0.08em; }

/* ---------- 15. Scroll reveal ------------------------------------------- */
/* Hidden only when JS can un-hide it. */
.js [data-reveal] {
  opacity: 0;
  transform: translateY(16px);
}
.js [data-reveal].is-visible {
  opacity: 1;
  transform: translateY(0);
  transition:
    opacity var(--dur-reveal) var(--ease-out) var(--reveal-delay, 0ms),
    transform var(--dur-reveal) var(--ease-out) var(--reveal-delay, 0ms);
}
/* Projects reveal by uncovering, like a plate being unwrapped */
.js [data-reveal-clip] .project__frame { clip-path: inset(0 0 100% 0); }
.js [data-reveal-clip].is-visible .project__frame {
  clip-path: inset(0 0 0 0);
  transition: clip-path 700ms var(--ease-out) var(--reveal-delay, 0ms);
}

/* ---------- 16. Responsive ---------------------------------------------- */
@media (max-width: 63.99em) { /* < 1024px */
  .split,
  .split--pricing,
  .split--contact { grid-template-columns: 1fr; gap: var(--s-7); }
  .hero__logo { order: -1; }
  .hero__logo img { max-width: 20rem; }
  .service { grid-template-columns: 3rem 1fr; row-gap: var(--s-2); }
  .service__desc { grid-column: 2; }
  .pillars { gap: var(--s-5); }
}

@media (min-width: 56.25em) { /* the panel only exists for the collapsed nav */
  .menu { display: none; }
}

@media (max-width: 56.24em) { /* < 900px — the desktop nav row stops fitting before this */
  .nav__links { display: none; }
  .nav__toggle { display: inline-flex; }
  .nav__cta--desktop { display: none; }
  .pillars { grid-template-columns: minmax(0, 1fr); }
  .trust { gap: 0.5rem 2rem; margin-top: 3rem; }
  .grid-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 39.99em) { /* < 640px */
  .price-row { flex-direction: column; align-items: flex-start; gap: var(--s-1); }
  .form__row { grid-template-columns: 1fr; }
  .contact-list a, .contact-list p { flex-direction: column; gap: var(--s-1); }
  .contact-list__key { width: auto; }
  .watermark--hero { width: 190%; opacity: 0.04; }
  .quote { padding: 1.75rem 1.5rem; }
  .grid-cards { grid-template-columns: minmax(0, 1fr); }
  .footer__inner { flex-direction: column; align-items: flex-start; }
}

/* ---------- 17. Accessibility preferences ------------------------------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js [data-reveal] { transform: none; }
  .js [data-reveal].is-visible {
    transform: none;
    transition: opacity 200ms ease var(--reveal-delay, 0ms);
  }
  .js [data-reveal-clip] .project__frame { clip-path: none; }
  .js [data-reveal-clip].is-visible .project__frame { clip-path: none; transition: none; }
  .menu,
  .menu.is-open { transform: none; transition: opacity 150ms ease, visibility 0s; }
  .btn:active,
  .nav__toggle:active { transform: none; }
}

@media (prefers-reduced-transparency: reduce) {
  .nav { background: var(--bone); backdrop-filter: none; -webkit-backdrop-filter: none; }
  .menu { background: var(--bone); backdrop-filter: none; -webkit-backdrop-filter: none; }
}

@media (prefers-contrast: more) {
  :root { --line: rgba(15, 46, 35, 0.4); --line-inv: rgba(243, 240, 232, 0.45); --ink-3: #3c4a42; --ink-4: #4a584f; }
  .nav { background: var(--bone); backdrop-filter: none; }
  /* Flat brand green behind the headline — no texture competing with the type */
  .hero::before { display: none; }
  .hero::after { background: var(--green-900); }
  .band { display: none; }
}

@media print {
  .nav, .menu, .skip, .watermark, .form { display: none; }
  body { background: #fff; color: #000; }
  .on-dark, .section--dark, .footer { background: #fff; color: #000; }
}

/* ---------- 18. Section-head utilities ---------------------------------- */
.h2--head    { max-width: 20ch; margin-bottom: var(--s-8); }
.h2--head-sm { max-width: 18ch; margin-bottom: var(--s-8); }
.h2--tight   { margin-bottom: var(--s-7); }
.h2--intro   { margin-bottom: var(--s-5); }
.h2--about   { max-width: 20ch; margin-bottom: var(--s-6); }
.about-lede  { max-width: 56ch; margin-bottom: var(--s-7); }
.container--narrow { max-width: 53.75rem; }
