/* ==========================================================================
   Leyton McDonald Plastering — base styles
   Tokens, reset, typography, header, hero, buttons, shared utilities
   ========================================================================== */

:root {
  /* Plaster-inspired palette */
  --bg: #F6F2EC;
  --bg-alt: #EFE9E0;
  --surface: #FFFDF9;
  --ink: #211D19;
  --ink-soft: #5B534B;
  --clay: #B26E4F;
  --clay-deep: #8F5138;
  --line: #E2D9CC;
  --dark: #26211C;
  --dark-soft: #B7ACA1;
  --on-dark: #F4EEE6;

  /* Type */
  --font-display: "Fraunces", Georgia, serif;
  --font-body: "Jost", "Segoe UI", system-ui, sans-serif;

  /* Spacing scale (spacious) */
  --space-2: 8px;
  --space-3: 16px;
  --space-4: 24px;
  --space-5: 40px;
  --space-6: 64px;
  --space-7: 96px;
  --space-8: 140px;

  --radius: 14px;
  --radius-lg: 22px;
  --shadow-soft: 0 20px 50px -24px rgba(52, 40, 30, 0.28);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --header-h: 76px;
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 12px);
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  font-weight: 400;
  line-height: 1.65;
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

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

h1, h2, h3 {
  font-family: var(--font-display);
  font-weight: 500;
  line-height: 1.12;
  margin: 0 0 var(--space-3);
  text-wrap: balance;
}

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

a { color: var(--clay-deep); }

ul, ol { margin: 0; padding: 0; }

.icon { width: 20px; height: 20px; flex: none; }

/* ---------- Accessibility helpers ---------- */
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  margin: -1px; padding: 0; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}

.skip-link {
  position: fixed; top: -60px; left: 16px; z-index: 200;
  background: var(--ink); color: var(--bg);
  padding: 10px 18px; border-radius: 8px;
  text-decoration: none; transition: top 0.2s var(--ease-out);
}
.skip-link:focus { top: 12px; }

:focus-visible {
  outline: 2px solid var(--clay-deep);
  outline-offset: 3px;
  border-radius: 4px;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  gap: 10px;
  min-height: 52px;
  padding: 12px 30px;
  border-radius: 999px;
  font-family: var(--font-body);
  font-size: 16px; font-weight: 500;
  letter-spacing: 0.02em;
  text-decoration: none;
  cursor: pointer;
  border: 1px solid transparent;
  transition: background-color 0.22s var(--ease-out),
              color 0.22s var(--ease-out),
              border-color 0.22s var(--ease-out),
              transform 0.22s var(--ease-out),
              box-shadow 0.22s var(--ease-out);
}
.btn:active { transform: scale(0.97); }

.btn-solid {
  background: var(--ink); color: var(--bg);
  box-shadow: 0 14px 30px -14px rgba(33, 29, 25, 0.5);
}
.btn-solid:hover { background: var(--clay-deep); color: #fff; }

.btn-ghost {
  background: transparent; color: var(--ink);
  border-color: rgba(33, 29, 25, 0.25);
}
.btn-ghost:hover { border-color: var(--ink); background: rgba(33, 29, 25, 0.04); }

.btn-wide { width: 100%; }

/* ---------- Header ---------- */
.site-header {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  height: var(--header-h);
  transition: background-color 0.3s var(--ease-out),
              box-shadow 0.3s var(--ease-out),
              backdrop-filter 0.3s var(--ease-out);
}
.site-header.is-scrolled {
  background: rgba(246, 242, 236, 0.86);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  box-shadow: 0 1px 0 rgba(33, 29, 25, 0.07);
}

.header-inner {
  max-width: 1200px; height: 100%;
  margin: 0 auto; padding: 0 var(--space-4);
  display: flex; align-items: center; gap: var(--space-4);
}

.brand {
  display: flex; align-items: center; gap: 14px;
  text-decoration: none; color: var(--ink);
  margin-right: auto;
}

.logo-img {
  height: 44px; width: auto; flex: none;
  border-radius: 8px;
}

.brand-text { display: flex; flex-direction: column; line-height: 1.15; }
.brand-name {
  font-family: var(--font-display);
  font-size: 19px; font-weight: 600;
}
.brand-sub {
  font-size: 11.5px; font-weight: 500;
  letter-spacing: 0.34em; text-transform: uppercase;
  color: var(--clay-deep);
}

.site-nav ul {
  display: flex; gap: 4px; list-style: none;
}
.site-nav a {
  display: inline-block;
  padding: 10px 14px;
  color: var(--ink); text-decoration: none;
  font-size: 15.5px; font-weight: 500;
  border-radius: 8px;
  position: relative;
  transition: color 0.2s var(--ease-out);
}
.site-nav a::after {
  content: "";
  position: absolute; left: 14px; right: 14px; bottom: 6px;
  height: 1.5px; background: var(--clay-deep);
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.25s var(--ease-out);
}
.site-nav a:hover { color: var(--clay-deep); }
.site-nav a:hover::after { transform: scaleX(1); }

.header-call { min-height: 44px; padding: 8px 20px; font-size: 15px; }

/* Mobile nav toggle */
.nav-toggle {
  display: none;
  width: 48px; height: 48px;
  border: none; background: none; cursor: pointer;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 7px; border-radius: 10px;
}
.nav-toggle-bar {
  width: 24px; height: 2px; background: var(--ink);
  border-radius: 2px;
  transition: transform 0.3s var(--ease-out);
}
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:first-child { transform: translateY(4.5px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] .nav-toggle-bar:last-child { transform: translateY(-4.5px) rotate(-45deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  display: flex; flex-direction: column;
  align-items: center; justify-content: center;
  text-align: center;
  padding: calc(var(--header-h) + var(--space-6)) var(--space-4) var(--space-6);
  overflow: hidden;
  isolation: isolate;
}

/* Plaster grain texture (SVG turbulence, self-contained) */
.hero-texture {
  position: absolute; inset: 0; z-index: -2;
  background:
    radial-gradient(1100px 620px at 78% 12%, rgba(178, 110, 79, 0.13), transparent 62%),
    radial-gradient(900px 560px at 12% 86%, rgba(139, 121, 96, 0.14), transparent 60%),
    linear-gradient(168deg, #F8F4EE 0%, #F1EAE0 58%, #EBE2D4 100%);
}
.hero-texture::after {
  content: "";
  position: absolute; inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.35 0 0 0 0 0.28 0 0 0 0 0.22 0 0 0 0.5 0'/%3E%3C/filter%3E%3Crect width='240' height='240' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.16;
  mix-blend-mode: multiply;
}

/* Slow drifting sheen — the "wet plaster" light sweep */
.hero-sheen {
  position: absolute; inset: -20%; z-index: -1;
  background: linear-gradient(115deg,
    transparent 30%,
    rgba(255, 253, 248, 0.55) 46%,
    rgba(255, 253, 248, 0.0) 54%,
    transparent 70%);
  animation: sheen-drift 9s var(--ease-out) infinite alternate;
  pointer-events: none;
}
@keyframes sheen-drift {
  from { transform: translateX(-12%) rotate(0.001deg); }
  to   { transform: translateX(12%) rotate(0.001deg); }
}

.hero-inner { max-width: 860px; }

.hero-kicker {
  font-size: 13.5px; font-weight: 600;
  letter-spacing: 0.32em; text-transform: uppercase;
  color: var(--clay-deep);
  margin-bottom: var(--space-4);
}

.hero-title {
  font-size: clamp(46px, 8.4vw, 104px);
  font-weight: 480;
  letter-spacing: -0.015em;
  margin-bottom: var(--space-4);
}
.hero-title em, .section-title em {
  font-style: italic; font-weight: 450;
  color: var(--clay-deep);
}

.hero-sub {
  max-width: 560px;
  margin: 0 auto var(--space-5);
  font-size: clamp(17px, 2.1vw, 20px);
  font-weight: 300;
  color: var(--ink-soft);
}

.hero-actions {
  display: flex; flex-wrap: wrap; gap: var(--space-3);
  justify-content: center;
}

/* Hero stats */
.hero-stats {
  display: flex; flex-wrap: wrap; gap: var(--space-3) var(--space-6);
  justify-content: center;
  margin-top: var(--space-6);
  padding-top: var(--space-4);
  border-top: 1px solid rgba(33, 29, 25, 0.12);
}
.stat { display: flex; flex-direction: column; align-items: center; min-width: 130px; }
.stat-num {
  font-family: var(--font-display);
  font-size: clamp(30px, 4vw, 42px);
  font-weight: 550;
  font-variant-numeric: tabular-nums;
  color: var(--ink);
}
.stat-label {
  font-size: 13px; font-weight: 500;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--ink-soft);
}

.scroll-cue {
  position: absolute; bottom: 26px; left: 50%;
  transform: translateX(-50%);
  width: 46px; height: 46px;
  display: grid; place-items: center;
  color: var(--ink-soft);
  border: 1px solid rgba(33, 29, 25, 0.18);
  border-radius: 50%;
  background: rgba(255, 253, 249, 0.5);
  animation: cue-bob 2.4s ease-in-out infinite;
  transition: color 0.2s, border-color 0.2s;
}
.scroll-cue:hover { color: var(--clay-deep); border-color: var(--clay-deep); }
.scroll-cue svg { width: 18px; height: 18px; }
@keyframes cue-bob {
  0%, 100% { transform: translate(-50%, 0); }
  50% { transform: translate(-50%, 7px); }
}

/* ---------- Reveal animations (driven by IntersectionObserver) ---------- */
.reveal-fade {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity 0.8s var(--ease-out), transform 0.8s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal-fade.is-visible { opacity: 1; transform: none; }

.reveal-line { display: block; overflow: hidden; }
.reveal-line > span {
  display: inline-block;
  transform: translateY(110%);
  transition: transform 1s var(--ease-out);
  transition-delay: var(--reveal-delay, 0ms);
}
.reveal-line.is-visible > span { transform: none; }

/* ---------- Reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-sheen, .scroll-cue { animation: none; }
  .reveal-fade, .reveal-line > span {
    opacity: 1; transform: none; transition: none;
  }
  *, *::before, *::after {
    animation-duration: 0.001s !important;
    transition-duration: 0.001s !important;
  }
}

/* ---------- Header/hero responsive ---------- */
@media (max-width: 900px) {
  .site-nav {
    position: fixed;
    top: var(--header-h); left: 0; right: 0;
    background: rgba(246, 242, 236, 0.97);
    -webkit-backdrop-filter: blur(16px);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--line);
    padding: var(--space-3) var(--space-4) var(--space-4);
    transform: translateY(-12px);
    opacity: 0; visibility: hidden;
    transition: transform 0.3s var(--ease-out), opacity 0.3s var(--ease-out), visibility 0.3s;
  }
  .site-nav.is-open { transform: none; opacity: 1; visibility: visible; }
  .site-nav ul { flex-direction: column; gap: 2px; }
  .site-nav a { display: block; padding: 13px 10px; font-size: 18px; }
  .nav-toggle { display: flex; }
  .header-call span { display: none; }
  .header-call { padding: 8px 12px; min-width: 44px; }
}

@media (max-width: 560px) {
  .brand-name { font-size: 16.5px; }
  .hero { padding-bottom: var(--space-7); }
  .hero-stats { gap: var(--space-3) var(--space-4); }
  .stat { min-width: 100px; }
}
