/* ── Fonts ──────────────────────────────────────────────────────────── */
@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/fraunces/fraunces-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/fraunces/fraunces-semibold.woff2') format('woff2');
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'Fraunces';
  src: url('../fonts/fraunces/fraunces-italic.woff2') format('woff2');
  font-weight: 400;
  font-style: italic;
  font-display: swap;
}

@font-face {
  font-family: 'TexGyreHeros';
  src: url('../fonts/texgyreheros/texgyreheros-bold.woff2') format('woff2');
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: 'TexGyreHeros';
  src: url('../fonts/texgyreheros/texgyreheros-regular.woff2') format('woff2');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

/* ── Tokens ─────────────────────────────────────────────────────────── */
:root {
  --cream:        #F4EFE6;   /* page background, warm stucco */
  --paper:        #FBF8F2;   /* raised cards */
  --stone:        #E7E0D3;   /* alternate sections */
  --ink:          #1F2A26;   /* deep charcoal-green — text, dark bands */
  --ink-soft:     #5A615C;   /* secondary text */
  --accent:       #9A4320;   /* terracotta — CTAs, links, numerals */
  --accent-light: #D98A63;   /* terracotta on dark backgrounds */
  --brass:        #A07838;   /* hairlines and small rules only */
  --line:         #D8CFBF;   /* warm hairline dividers */
  --on-ink:       #F4EFE6;
  --on-ink-soft:  #B9B3A6;

  --ff-display: 'Fraunces', Georgia, 'Times New Roman', serif;
  --ff-body:    'TexGyreHeros', Helvetica, Arial, sans-serif;

  --gutter:     clamp(1rem, 4vw, 3rem);
  --max:        1200px;
  --header-h:   72px;
  --section-y:  clamp(4rem, 9vw, 7.5rem);
}

/* ── Reset ──────────────────────────────────────────────────────────── */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  font-family: var(--ff-body);
  font-weight: 400;
  font-size: 16px;
  background: var(--cream);
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  background: var(--cream);
  line-height: 1.65;
}

main {
  flex: 1;
}

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

a {
  color: inherit;
}

ul {
  list-style: none;
}

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

section[id] {
  scroll-margin-top: var(--header-h);
}

/* ── Layout helpers ─────────────────────────────────────────────────── */
.container {
  width: min(100% - 2 * var(--gutter), var(--max));
  margin-inline: auto;
}

.section {
  padding-block: var(--section-y);
}

.section--stone { background: var(--stone); }

.section--ink {
  background: var(--ink);
  color: var(--on-ink);
}

/* ── Typography ─────────────────────────────────────────────────────── */
.display,
.heading {
  font-family: var(--ff-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.08;
  text-wrap: balance;
}

.display {
  font-size: clamp(2.5rem, 5vw + 0.75rem, 4.75rem);
}

.heading {
  font-size: clamp(2rem, 2.5vw + 1rem, 3.25rem);
}

.display em,
.heading em {
  font-style: italic;
  color: var(--accent);
}

.section--ink .heading em {
  color: var(--accent-light);
}

/* Signature element: a short brass rule before each eyebrow label,
   echoing the precision lines of architectural drawings. */
.eyebrow {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 1.25rem;
}

.eyebrow::before {
  content: '';
  width: 2rem;
  height: 1px;
  background: var(--brass);
}

.section--ink .eyebrow { color: var(--on-ink-soft); }

.lede {
  font-size: clamp(1.0625rem, 0.4vw + 1rem, 1.25rem);
  line-height: 1.7;
  color: var(--ink-soft);
  max-width: 54ch;
}

.prose p {
  font-size: 1.0625rem;
  line-height: 1.8;
  max-width: 62ch;
}

.prose p + p {
  margin-top: 1.25rem;
}

/* ── Buttons ────────────────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  font-family: var(--ff-body);
  font-weight: 700;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 1rem 1.6rem;
  border: 1px solid transparent;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.1s ease;
}

.btn:active {
  transform: scale(0.98);
}

.btn--primary {
  background: var(--accent);
  color: var(--cream);
}

.btn--primary:hover {
  background: var(--ink);
}

.btn--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--ink);
}

.btn--ghost:hover {
  background: var(--ink);
  color: var(--cream);
}

.btn-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

/* ── Header ─────────────────────────────────────────────────────────── */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(244, 239, 230, 0.94);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--line);
}

.header-inner {
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: 2rem;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  gap: 0.6rem;
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 1.75rem;
  letter-spacing: 0.02em;
  line-height: 1;
  color: var(--ink);
  text-decoration: none;
}

.wordmark span {
  font-family: var(--ff-body);
  font-weight: 700;
  font-size: 0.65rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
}

.site-nav {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 2rem;
}

.site-nav a:not(.btn) {
  font-size: 0.9375rem;
  text-decoration: none;
  color: var(--ink);
  padding-block: 0.25rem;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, color 0.2s ease;
}

.site-nav a:not(.btn):hover,
.site-nav a[aria-current="page"]:not(.btn) {
  border-bottom-color: var(--brass);
}

.site-nav .btn {
  padding: 0.8rem 1.25rem;
}

/* Hamburger — mobile only */
.menu-toggle {
  display: none;
  margin-left: auto;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.75rem 0.5rem;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  background: var(--ink);
  transition: transform 0.22s ease, opacity 0.22s ease;
}

/* Animate to ✕ when open */
.site-header.open .menu-toggle span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.site-header.open .menu-toggle span:nth-child(2) {
  opacity: 0;
}
.site-header.open .menu-toggle span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* ── Hero ───────────────────────────────────────────────────────────── */
.hero {
  padding-block: clamp(2.5rem, 6vw, 5.5rem) var(--section-y);
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  align-items: center;
  gap: clamp(2.5rem, 6vw, 6rem);
}

.hero .display {
  margin-bottom: 1.75rem;
}

.hero .lede {
  margin-bottom: 2.25rem;
}

.hero-areas {
  margin-top: 2.75rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
  font-size: 0.875rem;
  color: var(--ink-soft);
}

.hero-areas strong {
  color: var(--ink);
  font-weight: 700;
}

/* Framed image with an offset brass outline */
.frame {
  position: relative;
}

.frame::before {
  content: '';
  position: absolute;
  inset: 1.25rem -1.25rem -1.25rem 1.25rem;
  border: 1px solid var(--brass);
  pointer-events: none;
}

.frame img {
  position: relative;
  width: 100%;
  object-fit: cover;
}

.hero .frame img {
  aspect-ratio: 4 / 5;
  object-position: 72% center;
}

/* ── About ──────────────────────────────────────────────────────────── */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: center;
  gap: clamp(2.5rem, 6vw, 6rem);
}

.split .heading {
  margin-bottom: 1.75rem;
}

.about-image img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
}

/* ── Section header (heading + lede side by side) ───────────────────── */
.section-head {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: end;
  gap: 1.5rem clamp(2.5rem, 6vw, 6rem);
  margin-bottom: clamp(2.5rem, 5vw, 4rem);
}

/* ── Services ───────────────────────────────────────────────────────── */
.services {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2.5rem 2rem;
}

.service {
  padding-top: 1.5rem;
  border-top: 1px solid var(--line);
}

.service-num {
  display: block;
  font-family: var(--ff-display);
  font-style: italic;
  font-size: 1.125rem;
  color: var(--accent);
  margin-bottom: 1rem;
}

.service h3 {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 1.375rem;
  line-height: 1.2;
  margin-bottom: 0.6rem;
}

.service p {
  font-size: 0.9375rem;
  color: var(--ink-soft);
}

/* ── Standards (dark band) ──────────────────────────────────────────── */
.standards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.standard {
  padding: 0.5rem 2.5rem 0.5rem 0;
}

.standard + .standard {
  padding-left: 2.5rem;
  border-left: 1px solid rgba(160, 120, 56, 0.5);
}

.standard h3 {
  font-family: var(--ff-display);
  font-weight: 400;
  font-size: clamp(1.5rem, 1vw + 1.1rem, 1.875rem);
  line-height: 1.2;
  margin-bottom: 0.75rem;
}

.standard p {
  color: var(--on-ink-soft);
  max-width: 34ch;
}

/* ── Accreditations ─────────────────────────────────────────────────
   Badges sit on pale cards — the logos are designed for a light ground. */
.accreditations {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.accreditation {
  padding: clamp(1.75rem, 3vw, 2.5rem);
  background: var(--paper);
  border: 1px solid var(--line);
}

.accreditation-logo {
  height: 96px;
  width: auto;
  max-width: 100%;
  object-fit: contain;
  object-position: left center;
  margin-bottom: 1.75rem;
}

.accreditation h3 {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 1.375rem;
  line-height: 1.2;
  margin-bottom: 0.6rem;
}

.accreditation p {
  color: var(--ink-soft);
  max-width: 48ch;
}

/* ── Our work: before/after cards ───────────────────────────────────── */
.work-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(2.5rem, 5vw, 4rem);
}

.work-card h3 {
  font-family: var(--ff-display);
  font-weight: 600;
  font-size: 1.5rem;
  margin: 1.5rem 0 0.5rem;
}

.work-card p {
  color: var(--ink-soft);
  max-width: 52ch;
}

/* ── Compare slider ───────────────────────────────────────────────────
   --pos is set per .compare element via JS.
   clip-path: inset(0 calc(100% - var(--pos)) 0 0)
     — reveals the after image from the left edge
     — 0%  → full before, 100% → full after
   touch-action: pan-y keeps vertical page scrolling working on phones. */
.compare {
  --pos: 50%;
  position: relative;
  aspect-ratio: 1 / 1;
  overflow: hidden;
  background: var(--stone);
  cursor: ew-resize;
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.compare img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  pointer-events: none;
}

.compare-after {
  position: absolute;
  inset: 0;
  z-index: 1;
  clip-path: inset(0 calc(100% - var(--pos)) 0 0);
}

.compare-tag {
  position: absolute;
  top: 1rem;
  z-index: 3;
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--cream);
  background: rgba(31, 42, 38, 0.72);
  padding: 0.35rem 0.7rem;
  pointer-events: none;
}

.compare-tag--after  { left: 1rem; }
.compare-tag--before { right: 1rem; }

/* Kept for keyboard and screen-reader use; pointer input is handled in JS */
.compare-range {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  pointer-events: none;
}

.compare-divider {
  position: absolute;
  top: 0;
  bottom: 0;
  left: var(--pos);
  z-index: 2;
  width: 2px;
  margin-left: -1px;
  background: var(--cream);
  pointer-events: none;
}

.compare-handle {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 44px;
  height: 44px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: var(--cream);
  box-shadow: 0 2px 12px rgba(31, 42, 38, 0.25);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  transition: transform 0.15s ease;
}

/* Two small chevrons drawn with borders */
.compare-handle::before,
.compare-handle::after {
  content: '';
  width: 7px;
  height: 7px;
  border: solid var(--ink);
  border-width: 0 0 2px 2px;
}

.compare-handle::before { transform: rotate(45deg); }
.compare-handle::after  { transform: rotate(-135deg); }

.compare:hover .compare-handle {
  transform: translate(-50%, -50%) scale(1.08);
}

.compare-range:focus-visible ~ .compare-divider .compare-handle {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* ── CTA band ───────────────────────────────────────────────────────── */
.cta {
  text-align: center;
}

.cta .eyebrow {
  justify-content: center;
}

.cta .heading {
  margin-bottom: 1rem;
}

.cta .lede {
  margin: 0 auto 2.25rem;
}

.cta .btn-row {
  justify-content: center;
}

/* ── Contact page ───────────────────────────────────────────────────── */
.contact-grid {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: clamp(2.5rem, 6vw, 6rem);
  align-items: start;
}

.contact-grid .display {
  margin-bottom: 1.5rem;
}

.details {
  margin-top: 3rem;
  display: grid;
  gap: 1.5rem;
}

.details div {
  padding-top: 1.25rem;
  border-top: 1px solid var(--line);
}

.details dt {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-bottom: 0.35rem;
}

.details dd {
  font-size: 1.0625rem;
}

.contact-cards {
  display: grid;
  gap: 1.25rem;
}

.contact-card {
  display: block;
  padding: clamp(1.75rem, 3vw, 2.5rem);
  background: var(--paper);
  border: 1px solid var(--line);
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.contact-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: 0 10px 30px rgba(31, 42, 38, 0.08);
}

.contact-card .eyebrow {
  margin-bottom: 1rem;
}

.contact-card-value {
  display: block;
  font-family: var(--ff-display);
  font-size: clamp(1.5rem, 1.5vw + 1rem, 2rem);
  line-height: 1.2;
  overflow-wrap: anywhere;
  color: var(--ink);
  margin-bottom: 1rem;
}

.contact-card-action {
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ── Footer ─────────────────────────────────────────────────────────── */
.site-footer {
  background: var(--ink);
  color: var(--on-ink-soft);
  padding-block: clamp(3.5rem, 6vw, 5rem) 2rem;
  font-size: 0.9375rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 2.5rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(185, 179, 166, 0.2);
}

.site-footer .wordmark {
  color: var(--on-ink);
  margin-bottom: 1rem;
}

.site-footer .wordmark span {
  color: var(--accent-light);
}

.footer-tagline {
  max-width: 34ch;
}

.footer-heading {
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--on-ink);
  margin-bottom: 1rem;
}

address.footer-list {
  font-style: normal;
}

.footer-list li + li {
  margin-top: 0.4rem;
}

.site-footer a {
  color: var(--on-ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease;
}

.site-footer a:hover {
  border-bottom-color: var(--accent-light);
}

.footer-legal {
  padding-top: 1.5rem;
  font-size: 0.8125rem;
}

/* ── Scroll reveal ──────────────────────────────────────────────────
   Only hidden when JS is running (html.js), so content never disappears
   without it. */
.js .reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: none;
}

/* ── Responsive ─────────────────────────────────────────────────────── */
@media (max-width: 1020px) {
  .services {
    grid-template-columns: repeat(2, 1fr);
  }
}

@media (max-width: 860px) {
  .hero-grid,
  .split,
  .section-head,
  .contact-grid {
    grid-template-columns: 1fr;
  }

  .hero .frame img {
    aspect-ratio: 4 / 3;
  }

  .standards {
    grid-template-columns: 1fr;
    gap: 2rem;
  }

  .standard,
  .standard + .standard {
    padding: 2rem 0 0;
    border-left: none;
    border-top: 1px solid rgba(160, 120, 56, 0.5);
  }

  .footer-grid {
    grid-template-columns: 1fr 1fr;
  }

  .footer-brand {
    grid-column: 1 / -1;
  }
}

/* Nav collapses earlier than the content — the full link row needs ~900px */
@media (max-width: 900px) {
  .menu-toggle {
    display: flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-h);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 0.5rem var(--gutter) 1.5rem;
    background: var(--cream);
    border-bottom: 1px solid var(--line);
    box-shadow: 0 12px 24px rgba(31, 42, 38, 0.08);
  }

  .site-header.open .site-nav {
    display: flex;
  }

  .site-nav a:not(.btn) {
    font-family: var(--ff-display);
    font-size: 1.375rem;
    padding: 0.85rem 0;
    border-bottom: 1px solid var(--line);
  }

  .site-nav a:not(.btn):hover,
  .site-nav a[aria-current="page"]:not(.btn) {
    border-bottom-color: var(--line);
    color: var(--accent);
  }

  .site-nav .btn {
    margin-top: 1.25rem;
    padding: 1rem;
  }

}

@media (max-width: 760px) {
  .work-grid,
  .accreditations {
    grid-template-columns: 1fr;
  }

  /* Leave room for the offset outline at the screen edge */
  .frame {
    margin-right: 0.75rem;
  }

  .frame::before {
    inset: 0.75rem -0.75rem -0.75rem 0.75rem;
  }
}

@media (max-width: 560px) {
  .services {
    grid-template-columns: 1fr;
  }

  .footer-grid {
    grid-template-columns: 1fr;
  }

  .btn-row .btn {
    width: 100%;
  }
}

/* ── Accessibility: reduced motion ──────────────────────────────────── */
@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .js .reveal {
    opacity: 1;
    transform: none;
  }
}
