/* ==========================================================================
   Loft Conversion Windsor — main stylesheet
   Warm & approachable design system · mobile-first · accessible
   --------------------------------------------------------------------------
   Tokens live in :root; everything else consumes them.
   ========================================================================== */

:root {
  /* Colour */
  --ink:        #26211d;   /* near-black, warm */
  --body:       #4b443e;   /* body text */
  --muted:      #6b625a;   /* secondary text */
  --brand:      #c2441c;   /* terracotta — primary action */
  --brand-dark: #9e3714;   /* hover / pressed */
  --brand-soft: #f7e9e1;   /* tinted surfaces */
  --brand-tint: #f3ddd0;   /* stronger tint */
  --gold:       #d98e3b;   /* ratings / accents */
  --bg:         #fbf8f4;   /* page background */
  --surface:    #ffffff;   /* cards */
  --border:     #e7ded3;   /* hairlines */
  --success:    #2e7d4f;
  --error:      #b3261e;

  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
               "Helvetica Neue", Arial, sans-serif;
  --font-serif: Georgia, "Iowan Old Style", "Palatino Linotype", "Times New Roman", serif;

  --text-sm: 0.9375rem;    /* 15px */
  --text-base: 1.0625rem;  /* 17px */
  --text-md: 1.1875rem;    /* 19px */
  --text-lg: 1.375rem;     /* 22px */
  --text-xl: 1.75rem;      /* 28px */
  --text-2xl: 2.25rem;     /* 36px */
  --text-3xl: clamp(2.25rem, 5vw + 1rem, 3.5rem); /* hero h1 */

  /* Spacing scale */
  --space-1: 0.5rem;
  --space-2: 1rem;
  --space-3: 1.5rem;
  --space-4: 2rem;
  --space-5: 3rem;
  --space-6: 4.5rem;
  --space-7: 6.5rem;

  /* Layout */
  --container: 72rem;       /* 1152px */
  --radius: 0.75rem;
  --radius-lg: 1.25rem;
  --shadow-sm: 0 1px 2px rgba(38, 33, 29, 0.06), 0 1px 3px rgba(38, 33, 29, 0.08);
  --shadow-md: 0 8px 24px rgba(38, 33, 29, 0.10);
  --shadow-lg: 0 18px 48px rgba(38, 33, 29, 0.16);
  --ring: 0 0 0 3px rgba(194, 68, 28, 0.35);

  --header-h: 4.25rem;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 1rem);
}

body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--body);
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  color: var(--ink);
  line-height: 1.15;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 var(--space-2);
  text-wrap: balance;
}

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

a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--brand-dark); }

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

ul, ol { margin: 0 0 var(--space-2); padding-left: 1.25rem; }

:focus-visible { outline: none; box-shadow: var(--ring); border-radius: 4px; }

::selection { background: var(--brand-tint); color: var(--ink); }

/* Visually hidden — for screen readers only */
.visually-hidden {
  position: absolute !important;
  width: 1px; height: 1px;
  margin: -1px; padding: 0; border: 0;
  clip: rect(0 0 0 0); clip-path: inset(50%);
  overflow: hidden; white-space: nowrap;
}

/* Skip link */
.skip-link {
  position: absolute;
  left: 1rem; top: -100%;
  z-index: 100;
  background: var(--ink);
  color: #fff;
  padding: 0.75rem 1.25rem;
  border-radius: 0 0 var(--radius) var(--radius);
  text-decoration: none;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; color: #fff; }

/* ------------------------------ Layout ------------------------------ */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: clamp(1.25rem, 4vw, 2.5rem);
}

.section { padding-block: var(--space-6); }
.section--tight { padding-block: var(--space-5); }
.section--tint { background: var(--surface); }
.section--soft { background: var(--brand-soft); }

.section-head {
  max-width: 46rem;
  margin: 0 auto var(--space-5);
  text-align: center;
}
.section-head--left { margin-inline: 0; text-align: left; }

.eyebrow {
  display: inline-block;
  font-family: var(--font-sans);
  font-size: 0.8125rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--brand);
  margin-bottom: var(--space-2);
}

.lead { font-size: var(--text-md); color: var(--muted); }

.grid { display: grid; gap: var(--space-3); }

/* ------------------------------ Buttons ------------------------------ */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 700;
  line-height: 1;
  padding: 0.9rem 1.5rem;
  border-radius: 999px;
  border: 2px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.18s ease, border-color 0.18s ease,
              color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}
.btn:active { transform: translateY(1px); }

.btn--primary { background: var(--brand); color: #fff; }
.btn--primary:hover { background: var(--brand-dark); color: #fff; }

.btn--secondary { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn--secondary:hover { background: var(--ink); color: #fff; }

.btn--ghost { background: transparent; color: var(--brand); border-color: var(--brand); }
.btn--ghost:hover { background: var(--brand); color: #fff; }

.btn--lg { padding: 1.05rem 1.9rem; font-size: var(--text-md); }
.btn--block { width: 100%; }

/* ------------------------------ Header ------------------------------ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(251, 248, 244, 0.9);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}
.site-header.is-scrolled {
  border-bottom-color: var(--border);
  box-shadow: var(--shadow-sm);
}

.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-3);
  min-height: var(--header-h);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  text-decoration: none;
  color: var(--ink);
}
.brand__mark {
  width: 2.25rem; height: 2.25rem;
  flex: none;
}
.brand__text { display: flex; flex-direction: column; line-height: 1.1; }
.brand__name { font-family: var(--font-serif); font-weight: 700; font-size: 1.125rem; }
.brand__sub {
  font-size: 0.6875rem; letter-spacing: 0.08em; text-transform: uppercase;
  color: var(--brand); font-weight: 700;
}

.nav__menu { display: flex; align-items: center; gap: var(--space-2); }

.nav__links { display: flex; align-items: center; gap: var(--space-2); list-style: none; margin: 0; padding: 0; }
.nav__links a {
  color: var(--ink);
  text-decoration: none;
  font-weight: 600;
  font-size: var(--text-sm);
  padding: 0.5rem 0.75rem;
  border-radius: 999px;
}
.nav__links a:hover { color: var(--brand); background: var(--brand-soft); }
.nav__links a[aria-current="page"] { color: var(--brand); }

.nav__cta { display: inline-flex; }

.nav__toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 2.75rem; height: 2.75rem;
  padding: 0.5rem;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  cursor: pointer;
}
.nav__toggle span {
  display: block;
  height: 2px;
  width: 100%;
  background: var(--ink);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}
.nav__toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav__toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav__toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* ------------------------------ Hero ------------------------------ */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(60rem 40rem at 85% -10%, rgba(194, 68, 28, 0.10), transparent 60%),
    linear-gradient(180deg, var(--brand-soft), var(--bg));
}
.hero__inner {
  display: grid;
  gap: var(--space-5);
  padding-block: var(--space-6) var(--space-6);
  align-items: center;
}
.hero h1 { font-size: var(--text-3xl); margin-bottom: var(--space-3); }
.hero .lead { font-size: var(--text-lg); max-width: 36rem; }

.hero__ctas { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }

.hero__trust {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-top: var(--space-4);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border);
}
.trust-item { display: flex; flex-direction: column; }
.trust-item strong { font-family: var(--font-serif); font-size: 1.35rem; color: var(--ink); }
.trust-item span { font-size: 0.8125rem; color: var(--muted); }

.hero__media {
  position: relative;
  display: flex;
  justify-content: center;
}
.hero__media svg { width: min(100%, 30rem); }

.rating { display: inline-flex; align-items: center; gap: 0.4rem; font-weight: 700; color: var(--ink); }
.rating .stars { color: var(--gold); letter-spacing: 2px; font-size: 1.05rem; }
.rating small { color: var(--muted); font-weight: 600; }

/* ------------------------------ Stats band ------------------------------ */
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: var(--space-3); }
.stat {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  text-align: center;
}
.stat strong {
  display: block;
  font-family: var(--font-serif);
  font-size: var(--text-2xl);
  color: var(--brand);
}
.stat span { font-size: 0.9375rem; color: var(--muted); }

/* ------------------------------ Cards ------------------------------ */
.cards { display: grid; gap: var(--space-3); }

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
}
.card h3 { font-size: var(--text-lg); }
.card p { color: var(--muted); }

.card__icon {
  width: 3rem; height: 3rem;
  display: grid; place-items: center;
  border-radius: var(--radius);
  background: var(--brand-soft);
  color: var(--brand);
  margin-bottom: var(--space-2);
  font-size: 1.5rem;
}
.card__icon svg { width: 1.6rem; height: 1.6rem; }

.link-more { display: inline-flex; align-items: center; gap: 0.35rem; font-weight: 700; text-decoration: none; }
.link-more:hover { text-decoration: underline; }

/* Benefit / checklist */
.check-list { list-style: none; padding: 0; margin: 0; }
.check-list li {
  position: relative;
  padding-left: 2rem;
  margin-bottom: 0.75rem;
}
.check-list li::before {
  content: "✓";
  position: absolute;
  left: 0; top: 0;
  width: 1.4rem; height: 1.4rem;
  display: grid; place-items: center;
  background: var(--brand-soft);
  color: var(--brand-dark);
  font-weight: 700;
  font-size: 0.85rem;
  border-radius: 50%;
}

/* ------------------------------ Process ------------------------------ */
.steps { display: grid; gap: var(--space-3); counter-reset: step; }
.step {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
}
.step::before {
  counter-increment: step;
  content: counter(step);
  display: grid; place-items: center;
  width: 2.5rem; height: 2.5rem;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-weight: 700;
  font-size: 1.1rem;
  margin-bottom: var(--space-2);
}
.step h3 { font-size: var(--text-lg); }

/* ------------------------------ Pricing ------------------------------ */
.price {
  background: var(--ink);
  color: #f3ece4;
  border-radius: var(--radius-lg);
  padding: var(--space-4);
}
.price .eyebrow { color: var(--gold); }
.price h2, .price h3 { color: #fff; }
.price p { color: #cfc6bc; }
.price__figure {
  font-family: var(--font-serif);
  font-size: var(--text-3xl);
  color: #fff;
  margin-bottom: 0.25rem;
}
.price__range { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-top: var(--space-3); }
.price__range span {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.16);
  padding: 0.4rem 0.9rem;
  border-radius: 999px;
  font-size: var(--text-sm);
  color: #eee5db;
}

.price-grid { display: grid; gap: var(--space-3); }
.price-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-3);
}
.price-card h3 { font-size: var(--text-lg); }
.price-card .amount { font-family: var(--font-serif); font-size: var(--text-xl); color: var(--brand); }
.price-card .note { font-size: 0.875rem; color: var(--muted); }

/* ------------------------------ Testimonials ------------------------------ */
.quote {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--brand);
  border-radius: var(--radius);
  padding: var(--space-3);
  box-shadow: var(--shadow-sm);
}
.quote blockquote { margin: 0 0 var(--space-2); font-family: var(--font-serif); font-size: var(--text-md); color: var(--ink); }
.quote footer { display: flex; align-items: center; gap: 0.75rem; }
.quote .avatar {
  width: 2.75rem; height: 2.75rem;
  border-radius: 50%;
  background: var(--brand-soft);
  color: var(--brand-dark);
  display: grid; place-items: center;
  font-weight: 700;
  flex: none;
}
.quote .who { font-weight: 700; color: var(--ink); font-size: var(--text-sm); }
.quote .where { font-size: 0.8125rem; color: var(--muted); }

/* ------------------------------ FAQ ------------------------------ */
.faq { max-width: 48rem; margin-inline: auto; }
.faq details {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  margin-bottom: var(--space-2);
  overflow: hidden;
}
.faq summary {
  cursor: pointer;
  list-style: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-2);
  padding: 1.1rem 1.35rem;
  font-weight: 700;
  color: var(--ink);
  font-size: var(--text-base);
}
.faq summary::-webkit-details-marker { display: none; }
.faq summary::after {
  content: "+";
  font-size: 1.5rem;
  line-height: 1;
  color: var(--brand);
  flex: none;
  transition: transform 0.2s ease;
}
.faq details[open] summary::after { transform: rotate(45deg); }
.faq summary:hover { background: var(--brand-soft); }
.faq .faq__body { padding: 0 1.35rem 1.25rem; color: var(--muted); }

/* ------------------------------ Areas ------------------------------ */
.areas { display: flex; flex-wrap: wrap; gap: 0.6rem; }
.areas span {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: var(--text-sm);
  color: var(--ink);
  font-weight: 600;
}

/* ------------------------------ CTA band ------------------------------ */
.cta-band {
  background: var(--brand);
  color: #fff;
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  text-align: center;
  position: relative;
  overflow: hidden;
}
.cta-band h2 { color: #fff; }
.cta-band p { color: #fbe9df; max-width: 40rem; margin-inline: auto; }
.cta-band .btn--secondary { border-color: #fff; color: #fff; }
.cta-band .btn--secondary:hover { background: #fff; color: var(--brand); }

/* ------------------------------ Forms ------------------------------ */
.form { display: grid; gap: var(--space-3); }
.field { display: flex; flex-direction: column; gap: 0.4rem; }
.field label { font-weight: 700; color: var(--ink); font-size: var(--text-sm); }
.field .hint { font-size: 0.8125rem; color: var(--muted); }
.field input, .field select, .field textarea {
  font: inherit;
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: var(--radius);
  padding: 0.8rem 1rem;
  width: 100%;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field textarea { min-height: 9rem; resize: vertical; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none;
  border-color: var(--brand);
  box-shadow: var(--ring);
}
.field input[aria-invalid="true"], .field select[aria-invalid="true"], .field textarea[aria-invalid="true"] {
  border-color: var(--error);
}
.field .error-msg { font-size: 0.8125rem; color: var(--error); display: none; }
.field.has-error .error-msg { display: block; }

.form-status {
  padding: 1rem 1.25rem;
  border-radius: var(--radius);
  font-weight: 600;
  display: none;
}
.form-status[hidden] { display: none; }
.form-status--success { display: block; background: #e7f4ec; color: var(--success); border: 1px solid #bcdcc6; }
.form-status--error { display: block; background: #fdecea; color: var(--error); border: 1px solid #f2c0bb; }

/* ------------------------------ Gallery ------------------------------ */
.gallery-filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: var(--space-4);
}
.filter-btn {
  font: inherit;
  font-weight: 600;
  font-size: var(--text-sm);
  color: var(--ink);
  background: var(--surface);
  border: 1.5px solid var(--border);
  border-radius: 999px;
  padding: 0.5rem 1.1rem;
  cursor: pointer;
  transition: all 0.15s ease;
}
.filter-btn:hover { border-color: var(--brand); color: var(--brand); }
.filter-btn[aria-pressed="true"] { background: var(--brand); border-color: var(--brand); color: #fff; }

.gallery { display: grid; gap: var(--space-3); }
.gallery figure {
  margin: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.gallery img { width: 100%; aspect-ratio: 3 / 2; object-fit: cover; }
.gallery figcaption { padding: 0.9rem 1.1rem; font-weight: 600; color: var(--ink); font-size: var(--text-sm); }
.gallery figcaption small { display: block; color: var(--muted); font-weight: 500; }

/* ------------------------------ About ------------------------------ */
.split { display: grid; gap: var(--space-5); align-items: center; }
.split__media svg { border-radius: var(--radius-lg); background: var(--brand-soft); width: 100%; }

.values { display: grid; gap: var(--space-3); }
.credential {
  display: flex; gap: 1rem; align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--space-3);
}

/* ------------------------------ Contact ------------------------------ */
.contact-layout { display: grid; gap: var(--space-5); }
.contact-details { display: grid; gap: var(--space-3); }
.contact-row { display: flex; gap: 1rem; align-items: flex-start; }
.contact-row .icon {
  width: 2.75rem; height: 2.75rem; flex: none;
  display: grid; place-items: center;
  background: var(--brand-soft); color: var(--brand);
  border-radius: var(--radius);
}
.contact-row .icon svg { width: 1.4rem; height: 1.4rem; }
.contact-row strong { display: block; color: var(--ink); }
.contact-row a { color: var(--body); text-decoration: none; }
.contact-row a:hover { color: var(--brand); }

/* ------------------------------ Footer ------------------------------ */
.site-footer {
  background: var(--ink);
  color: #cfc6bc;
  padding-block: var(--space-6) var(--space-3);
  margin-top: var(--space-6);
}
.site-footer a { color: #e6ddd3; text-decoration: none; }
.site-footer a:hover { color: #fff; }
.site-footer h3 { color: #fff; font-size: var(--text-base); margin-bottom: var(--space-2); }
.footer-grid { display: grid; gap: var(--space-4); }
.footer-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.5rem; }
.site-footer .brand__name { color: #fff; }
.site-footer .brand__sub { color: var(--gold); }
.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.14);
  margin-top: var(--space-5);
  padding-top: var(--space-3);
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  justify-content: space-between;
  font-size: 0.875rem;
}

/* ------------------------------ Reveal animation ------------------------------ */
/* Scoped to .js so content remains visible if JavaScript is unavailable. */
.js .reveal { opacity: 0; transform: translateY(16px); transition: opacity 0.5s ease, transform 0.5s ease; }
.js .reveal.is-visible { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .nav__toggle span, .faq summary::after { transition: none; }
}

/* ------------------------------ Breakpoints ------------------------------ */
@media (min-width: 40rem) {
  .cards { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); }
  .stats { grid-template-columns: repeat(4, 1fr); }
  .gallery { grid-template-columns: repeat(2, 1fr); }
  .price-grid { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 56rem) {
  .hero__inner { grid-template-columns: 1.1fr 0.9fr; padding-block: var(--space-7); }
  .split { grid-template-columns: 1fr 1fr; }
  .contact-layout { grid-template-columns: 1.05fr 0.95fr; }
  .gallery { grid-template-columns: repeat(3, 1fr); }
  .footer-grid { grid-template-columns: 2fr 1fr 1fr 1fr; }
  .steps { grid-template-columns: repeat(4, 1fr); }
}

@media (max-width: 55.99rem) {
  .nav__toggle { display: flex; }
  .nav__menu {
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow-md);
    padding: var(--space-2);
    display: none;
  }
  .nav.is-open .nav__menu { display: flex; }
  .nav__links { flex-direction: column; align-items: stretch; gap: 0; }
  .nav__links a { display: block; padding: 0.85rem 1rem; font-size: var(--text-base); }
  .nav__cta { width: 100%; justify-content: center; }
}
