/* =========================================================
   JM Fencing & Gardening — single-page site
   Design tokens → base → layout → components → motion → responsive
   ========================================================= */

:root {
  /* palette — sky-matched dusky aubergine to warm peach */
  --bg: #2a1e2a;
  --bg-2: #34232f;
  --bg-3: #3f2a35;
  --line: rgba(255, 255, 255, 0.10);
  --line-2: rgba(255, 255, 255, 0.18);

  --ink: rgba(255, 255, 255, 0.94);
  --ink-2: rgba(255, 255, 255, 0.66);
  --ink-3: rgba(255, 255, 255, 0.42);

  --warm: #e8b07a;
  /* peach-horizon accent */
  --warm-2: #d4945a;
  --sage: #9bb088;
  /* muted leaf */
  --sand: #c79f76;
  /* sandstone */

  /* type */
  --display: "Fraunces", "Times New Roman", serif;
  --ui: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;

  /* spacing scale */
  --gutter: clamp(1.25rem, 3vw, 2.5rem);
  --section-y: clamp(5rem, 10vw, 9rem);

  /* motion */
  --ease: cubic-bezier(.2, .7, .2, 1);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  /* Page background matches the modal panel green so any peeking
     edges blend into the deck instead of flashing the old plum. */
  background: #2e3a26;
  color: var(--ink);
  font-family: var(--ui);
  font-size: clamp(15px, 1.05vw, 17px);
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  cursor: pointer;
}

::selection {
  background: #e8b07a;
  color: #1a1018;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--warm);
  color: #1a1018;
  padding: .6rem 1rem;
  font-weight: 600;
  z-index: 1000;
}

.skip-link:focus {
  left: 1rem;
  top: 1rem;
  outline: 2px solid #1a1018;
}

/* shared bits */
.eyebrow {
  font-family: var(--ui);
  font-size: .92rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 1.25rem;
  font-weight: 500;
}

.display {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(2.4rem, 4.4vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.025em;
  margin: 0 0 1.25rem;
  font-variation-settings: "opsz" 96;
}

.display em {
  font-style: italic;
  color: #e8b07a;
}

/* =========================================================
   NAV
   ========================================================= */
.nav {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1.1rem var(--gutter);
  background: linear-gradient(to bottom, rgba(42, 30, 42, 0.72), rgba(42, 30, 42, 0));
  backdrop-filter: blur(10px) saturate(110%);
  -webkit-backdrop-filter: blur(10px) saturate(110%);
  transition: transform .55s var(--ease), opacity .4s var(--ease);
  will-change: transform, opacity;
}

.nav--hidden {
  transform: translateY(-110%);
  opacity: 0;
  pointer-events: none;
}

.nav__logo {
  display: flex;
  align-items: baseline;
  gap: .65rem;
}

.nav__logo-mark {
  font-family: var(--display);
  font-weight: 600;
  font-size: 1.3rem;
  letter-spacing: -0.02em;
  color: var(--warm);
  font-variation-settings: "opsz" 9;
}

.nav__logo-name {
  font-size: .82rem;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-2);
}

.nav__links {
  display: flex;
  align-items: center;
  gap: 2rem;
}

.nav__links a {
  font-size: .82rem;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--ink-2);
  position: relative;
  transition: color .3s var(--ease);
}

.nav__links a:not(.nav__cta)::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 1px;
  background: var(--warm);
  transform: scaleX(0);
  transform-origin: right center;
  transition: transform .45s var(--ease);
}

.nav__links a:hover {
  color: var(--ink);
}

.nav__links a:hover::after {
  transform: scaleX(1);
  transform-origin: left center;
}

.nav__cta {
  border: 1px solid var(--line-2);
  padding: .55rem 1rem;
  border-radius: 999px;
  background: rgba(232, 176, 122, 0.08);
  color: var(--ink) !important;
  transition: background .35s var(--ease), border-color .35s var(--ease), transform .35s var(--ease);
}

.nav__cta:hover {
  background: var(--warm);
  border-color: var(--warm);
  color: #1a1018 !important;
  transform: translateY(-1px);
}

.nav__cta::after {
  display: none;
}

/* mobile hamburger */
.nav__toggle {
  display: none;
}

.nav__hamburger {
  display: none;
  width: 30px;
  height: 22px;
  position: relative;
  cursor: pointer;
}

.nav__hamburger span {
  position: absolute;
  left: 0;
  right: 0;
  height: 1.5px;
  background: var(--ink);
  transition: transform .35s var(--ease), opacity .25s var(--ease), top .35s var(--ease);
}

.nav__hamburger span:nth-child(1) {
  top: 2px;
}

.nav__hamburger span:nth-child(2) {
  top: 10px;
}

.nav__hamburger span:nth-child(3) {
  top: 18px;
}

.nav__toggle:checked~.nav__hamburger span:nth-child(1) {
  top: 10px;
  transform: rotate(45deg);
}

.nav__toggle:checked~.nav__hamburger span:nth-child(2) {
  opacity: 0;
}

.nav__toggle:checked~.nav__hamburger span:nth-child(3) {
  top: 10px;
  transform: rotate(-45deg);
}

/* =========================================================
   STAGE + DECK (single-viewport layout)
   The body actually scrolls (the .scroll-track generates height),
   but visually .stage stays pinned. Cards inside .deck animate
   in/out as the user scrolls.
   ========================================================= */
.stage {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  /* cards re-enable pointer events on themselves */
  overflow: hidden;
}

.stage__bg {
  position: absolute;
  inset: 0;
  will-change: transform;
}

.deck {
  position: absolute;
  inset: 0;
  overflow: hidden;
  /* Clips the strip so we never see cards that have scrolled past the
     top of the viewport bleeding outside the stage. */
}

/* The conveyor belt itself — a vertical strip containing every card.
   Starts just below the viewport and translates upward as one rigid
   unit, so cards always maintain the same spacing relative to each
   other (no per-card timing math, no overlap possible). */
.deck__strip {
  position: absolute;
  top: 100vh;
  left: 0;
  right: 0;
  display: flex;
  flex-direction: column;
  will-change: transform;
}

.card {
  width: 100%;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 5vw;
  pointer-events: auto;
}

.card__panel {
  width: min(1100px, 92%);
  /* Panels are the visible "modal". They sit centred inside their
     100vh card slot, with a small margin top/bottom so the conveyor
     shows a thin band of hero between modals during the handoff. */
  min-height: 86vh;
  max-height: 92vh;
  overflow: visible;
  position: relative;
  background: url('Camel-C1.jpg') repeat center / 600px;
  border: 1px solid rgba(0, 0, 0, 0.18);
  border-radius: 22px;
  padding: clamp(1.5rem, 3vw, 2.75rem);
  pointer-events: auto;
  box-shadow:
    0 4px 8px rgba(0, 0, 0, 0.3),
    0 16px 40px rgba(0, 0, 0, 0.4),
    0 50px 100px rgba(0, 0, 0, 0.5);
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* Dark text palette for light sandstone background */
  --ink: rgba(35, 30, 25, 0.92);
  --ink-2: rgba(35, 30, 25, 0.68);
  --ink-3: rgba(35, 30, 25, 0.46);
  --line: rgba(0, 0, 0, 0.08);
  --line-2: rgba(0, 0, 0, 0.16);
  --warm: #9b5e2c;
  --warm-2: #7d4a1f;
  color: var(--ink);
}

/* Frosted glass overlay — softens sandstone texture for text readability */
.card__panel::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(2px);
  -webkit-backdrop-filter: blur(2px);
  pointer-events: none;
  z-index: 0;
}

/* All card content must sit above the overlay */
.card__panel>* {
  position: relative;
  z-index: 1;
}

/* FAQ is the only modal allowed to scroll internally. */
[data-card="faq"] .card__panel {
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(0, 0, 0, 0.22) transparent;
  justify-content: flex-start;
}

[data-card="faq"] .card__panel::-webkit-scrollbar {
  width: 8px;
}

[data-card="faq"] .card__panel::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.22);
  border-radius: 4px;
}

.scroll-track {
  position: relative;
  width: 100%;
  pointer-events: none;
}

.scroll-segment {
  height: 100vh;
}

/* =========================================================
   HERO BACKDROP (lives inside .stage__bg, not its own scroll wrapper)
   ========================================================= */
.hero-stage {
  position: absolute;
  inset: 0;
  overflow: hidden;
  /* Matches the loader and modal panels so the brief moment before
     frames load (and any uncovered seam pixels) stays in palette. */
  background: #2e3a26;
}

#hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  opacity: 0;
  /* fades in once preloader resolves */
}

/* Subtle dark overlay across the hero so overlaid copy stays legible
   over the bright sunset sky in the frame sequence. */
.hero-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background:
    linear-gradient(to bottom,
      rgba(0, 0, 0, 0.42) 0%,
      rgba(0, 0, 0, 0.22) 35%,
      rgba(0, 0, 0, 0.22) 65%,
      rgba(0, 0, 0, 0.45) 100%);
}

/* loader */
.hero-loader {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  /* Match the modal panel green so the load → site transition is seamless. */
  background: #2e3a26;
  z-index: 4;
  transition: opacity .55s var(--ease);
}

.hero-loader.is-hidden {
  opacity: 0;
  pointer-events: none;
}

.hero-loader__ring {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.12);
  border-top-color: var(--sage);
  border-right-color: var(--warm);
  animation: spin 1.1s linear infinite;
}

.hero-loader__label {
  margin-top: 1.25rem;
  font-size: .78rem;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-3);
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

/* text overlays */
/* Every hero overlay is vertically + horizontally centred by default. The
   modifier classes (--center, --left, --right, --static) only differ in
   visibility / animation behaviour, never in position. GSAP's scale-through-
   viewer animation overrides the transform at runtime; before JS runs (and
   if JS fails) the CSS keeps overlays correctly placed. */
.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  padding: 0 var(--gutter);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  opacity: 0;
  text-align: center;
  pointer-events: none;
  text-shadow: 0 2px 30px rgba(0, 0, 0, 0.35);
}

.hero-overlay>* {
  max-width: 56rem;
}

/* Hero headline is visible on page load without animation. */
.hero-overlay--static {
  opacity: 1;
}

/* Modifier classes kept for backwards-compatibility but inherit the
   base-class centred positioning. */
.hero-overlay--center,
.hero-overlay--left,
.hero-overlay--right {
  /* inherit base */
}

.hero-overlay[data-overlay="0"] .scroll-cue {
  pointer-events: auto;
}

.hero-title {
  font-family: var(--display);
  font-weight: 600;
  font-size: clamp(7rem, 9vw, 9rem);
  line-height: .94;
  letter-spacing: -0.03em;
  margin: 0 0 1.25rem;
  font-variation-settings: "opsz" 144;
}

.hero-title em {
  font-style: italic;
  color: var(--warm);
}

.hero-sub {
  max-width: 32rem;
  margin: 0 auto;
  color: var(--ink-2);
  font-size: clamp(1rem, 1.3vw, 1.15rem);
}

/* All overlays are centred now — sub text uses the same auto margin as center. */

.hero-line {
  font-family: var(--display);
  font-weight: 400;
  font-size: clamp(4rem, 9.5vw, 9.5rem);
  line-height: .98;
  letter-spacing: -0.025em;
  margin: 0;
  font-variation-settings: "opsz" 144;
  color: var(--ink);
}

.hero-line em {
  font-style: italic;
  color: var(--warm);
}

.scroll-cue {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: .6rem;
  margin-top: 2.5rem;
  color: var(--ink-3);
  font-size: .72rem;
  letter-spacing: .25em;
  text-transform: uppercase;
  transition: color .3s var(--ease), transform .3s var(--ease);
}

.scroll-cue:hover {
  color: var(--ink);
  transform: translateY(2px);
}

.scroll-cue svg {
  animation: cue 2.1s var(--ease) infinite;
}

@keyframes cue {

  0%,
  100% {
    transform: translateY(0);
    opacity: .55;
  }

  50% {
    transform: translateY(6px);
    opacity: 1;
  }
}

/* =========================================================
   SECTION CTA — appears at the bottom of each modal card to
   give the user a clear next step (mostly into the contact card).
   Two variants: solid warm pill (default) and ghost/outlined
   (used in FAQ where the prompt is more conversational).
   ========================================================= */
.section-cta {
  display: inline-flex;
  align-items: center;
  gap: .55rem;
  margin-top: clamp(1.5rem, 3vw, 2.25rem);
  padding: .85rem 1.5rem;
  background: var(--warm);
  color: #1a1018;
  border: 1px solid var(--warm);
  border-radius: 999px;
  font-weight: 500;
  letter-spacing: .02em;
  font-size: .98rem;
  white-space: nowrap;
  transition:
    background .35s var(--ease),
    border-color .35s var(--ease),
    transform .3s var(--ease),
    color .3s var(--ease);
}

.section-cta:hover {
  background: var(--warm-2);
  border-color: var(--warm-2);
  transform: translateY(-2px);
}

.section-cta__arrow {
  width: 1em;
  height: 1em;
  transition: transform .3s var(--ease);
}

.section-cta:hover .section-cta__arrow {
  transform: translateX(3px);
}

.section-cta--ghost {
  background: transparent;
  color: var(--ink);
  border-color: var(--line-2);
}

.section-cta--ghost:hover {
  background: rgba(255, 255, 255, 0.045);
  border-color: var(--warm);
  color: var(--warm);
}

/* =========================================================
   ABOUT
   ========================================================= */
.about {
  padding: 0;
  background: transparent;
}

.about__grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: clamp(2rem, 5vw, 6rem);
  align-items: center;
}

.about__copy p {
  color: var(--ink-2);
  margin: 0 0 1rem;
  max-width: 36ch;
}

.about__intro {
  margin-top: 1.25rem !important;
  font-size: 1.02rem;
  line-height: 1.65;
  max-width: 42ch !important;
  color: var(--ink-2);
}

.about__ticks {
  list-style: none;
  padding: 0;
  margin: 2rem 0 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: .8rem 1.5rem;
}

.about__ticks li {
  position: relative;
  padding-left: 1.5rem;
  color: var(--ink-2);
  font-size: .92rem;
}

.about__ticks li::before {
  content: "";
  position: absolute;
  left: 0;
  top: .55em;
  width: 8px;
  height: 8px;
  background: var(--sage);
  transform: rotate(45deg);
}

.about__visual {
  margin: 0;
  position: relative;
  border-radius: 4px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.4);
  width: 100%;
}

.about__visual img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.95) brightness(0.96);
}

.about__visual figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1rem 1.25rem;
  background: linear-gradient(to top, rgba(20, 12, 18, 0.85), transparent);
  font-size: .82rem;
  color: rgba(255, 255, 255, 0.66);
  letter-spacing: .04em;
}

/* =========================================================
   SERVICES
   ========================================================= */
.services {
  padding: 0;
  background: transparent;
  border-top: 0;
}

.services__head {
  max-width: 1280px;
  margin: 0 auto 1.75rem;
  text-align: left;
}

.services__head .display {
  margin: 0;
}

.services__grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  /* No grid background — the 1px gap and 1px border become subtle
     dividers showing the panel green through, so each cell visually
     shares the modal background. */
  border: 1px solid var(--line);
}

.service {
  background: transparent;
  padding: clamp(1.25rem, 2vw, 2rem);
  display: flex;
  flex-direction: column;
  gap: 1.1rem;
  transition: background .4s var(--ease), transform .4s var(--ease);
  position: relative;
}

.service::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  background: #c07830;
  width: 0;
  transition: width .55s var(--ease);
}

.service:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.service:hover::after {
  width: 100%;
}

.service__icon {
  width: 44px;
  height: 44px;
  color: var(--ink);
}

.service__icon svg {
  width: 100%;
  height: 100%;
}

.service h3 {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.45rem;
  letter-spacing: -0.01em;
  margin: 0;
}

.service p {
  color: var(--ink-2);
  margin: 0;
  font-size: .95rem;
}

/* =========================================================
   PROCESS
   ========================================================= */
.process {
  padding: 0;
  background: transparent;
}

.process__head {
  max-width: 1280px;
  margin: 0 auto 1.75rem;
}

.process__list {
  list-style: none;
  padding: 0;
  margin: 0;
  max-width: 1280px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
  margin-inline: auto;
  counter-reset: step;
}

.process__step {
  border-top: 1px solid var(--line-2);
  padding: 1.5rem 0.85rem;
  position: relative;
  background: transparent;
  transition: background .4s var(--ease), transform .4s var(--ease);
}

.process__step::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  height: 2px;
  background: #c07830;
  width: 0;
  transition: width .55s var(--ease);
}

.process__step:hover {
  background: rgba(255, 255, 255, 0.15);
  transform: translateY(-2px);
}

.process__step:hover::after {
  width: 100%;
}

.process__num {
  font-family: var(--display);
  font-style: italic;
  color: #c07830;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  display: block;
  margin-bottom: 1rem;
}

.process__step h3 {
  font-family: var(--display);
  font-size: 1.4rem;
  font-weight: 500;
  margin: 0 0 .6rem;
  letter-spacing: -0.01em;
}

.process__step p {
  color: var(--ink-2);
  margin: 0;
  font-size: .95rem;
}

/* =========================================================
   GALLERY
   ========================================================= */
.gallery {
  padding: 0;
  background: transparent;
}

.gallery__head {
  max-width: 1280px;
  margin: 0 auto 1.75rem;
}

.gallery__lede {
  color: var(--ink-2);
  max-width: 38ch;
}

.gallery__grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.tile {
  position: relative;
  overflow: hidden;
  /* Placeholder tone while image loads — matches sandstone palette. */
  background: rgba(0, 0, 0, 0.15);
  border: 0;
  padding: 0;
  cursor: zoom-in;
  border-radius: 2px;
  outline: 0;
  aspect-ratio: 1 / 1;
  /* uniform square cells */
}

.tile:focus-visible {
  box-shadow: 0 0 0 2px #c07830;
}

/* Modifier classes left in HTML are no-ops now — every tile is a square. */
.tile--tall,
.tile--wide {
  grid-column: auto;
  grid-row: auto;
  aspect-ratio: 1 / 1;
}

.tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .9s var(--ease), filter .6s var(--ease);
  filter: saturate(0.95);
}

.tile:hover img {
  transform: scale(1.045);
  filter: saturate(1.05);
}

.tile__cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 1rem 1.25rem;
  background: linear-gradient(to top, rgba(20, 12, 18, 0.92), transparent);
  font-size: .85rem;
  text-align: left;
  color: var(--ink);
  letter-spacing: .03em;
  transform: translateY(8px);
  opacity: 0;
  transition: transform .5s var(--ease), opacity .5s var(--ease);
}

.tile:hover .tile__cap,
.tile:focus-visible .tile__cap {
  transform: translateY(0);
  opacity: 1;
}

/* =========================================================
   BACK TO TOP
   Fixed bottom-right pill, hidden until the user has scrolled
   past the hero. Click smooth-scrolls back to scrollY 0.
   ========================================================= */
.back-to-top {
  position: fixed;
  bottom: clamp(1rem, 2.5vw, 1.75rem);
  right: clamp(1rem, 2.5vw, 1.75rem);
  width: 48px;
  height: 48px;
  border-radius: 50%;
  border: 0;
  background: var(--warm);
  color: #1a1018;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 60;
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
  transition:
    opacity .35s var(--ease),
    transform .35s var(--ease),
    background .3s var(--ease);
}

.back-to-top.is-visible {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.back-to-top:hover {
  background: var(--warm-2);
  transform: translateY(-2px);
}

.back-to-top:focus-visible {
  outline: 2px solid var(--warm);
  outline-offset: 3px;
}

.back-to-top svg {
  display: block;
}

/* lightbox */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(20, 12, 18, 0.94);
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
  animation: fade .35s var(--ease);
}

.lightbox[hidden] {
  display: none;
}

.lightbox figure {
  margin: 0;
  max-width: 1200px;
}

.lightbox img {
  max-width: 100%;
  max-height: 80vh;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 30px 100px rgba(0, 0, 0, 0.6);
}

.lightbox figcaption {
  margin-top: 1rem;
  text-align: center;
  color: var(--ink-2);
  font-size: .9rem;
}

.lightbox__close {
  position: absolute;
  top: 1.25rem;
  right: 1.5rem;
  width: 44px;
  height: 44px;
  border: 1px solid var(--line-2);
  background: rgba(255, 255, 255, 0.04);
  border-radius: 50%;
  color: var(--ink);
  font-size: 1.6rem;
  line-height: 1;
}

.lightbox__close:hover {
  background: var(--warm);
  color: #1a1018;
  border-color: var(--warm);
}

@keyframes fade {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

/* =========================================================
   FAQ
   ========================================================= */
.faq {
  padding: 0;
  background: transparent;
}

.faq__head {
  max-width: 1100px;
  margin: 0 auto 1.75rem;
}

.faq__list {
  max-width: 1100px;
  margin: 0 auto;
}

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

.qa:last-child {
  border-bottom: 1px solid var(--line-2);
}

.qa summary {
  list-style: none;
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 2rem;
  cursor: pointer;
  font-family: var(--display);
  font-size: clamp(1.1rem, 1.8vw, 1.5rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--ink);
  transition: color .3s var(--ease);
}

.qa summary::-webkit-details-marker {
  display: none;
}

.qa summary:hover {
  color: #9b5e2c;
}

.qa summary i {
  flex: 0 0 24px;
  width: 24px;
  height: 24px;
  position: relative;
  transition: transform .4s var(--ease);
}

.qa summary i::before,
.qa summary i::after {
  content: "";
  position: absolute;
  inset: auto;
  background: currentColor;
  transition: transform .4s var(--ease);
}

.qa summary i::before {
  top: 11px;
  left: 4px;
  right: 4px;
  height: 1.5px;
}

.qa summary i::after {
  left: 11px;
  top: 4px;
  bottom: 4px;
  width: 1.5px;
}

.qa[open] summary i::after {
  transform: scaleY(0);
}

.qa[open] summary i {
  transform: rotate(180deg);
}

.qa__body {
  overflow: hidden;
  max-height: 0;
  transition: max-height .5s var(--ease);
}

.qa[open] .qa__body {
  max-height: 500px;
}

.qa__body p {
  color: var(--ink-2);
  margin: 1rem 0 0;
  max-width: 65ch;
  font-size: .98rem;
}

.qa__body a {
  color: var(--warm);
  border-bottom: 1px solid var(--warm);
}

/* =========================================================
   CTA / CONTACT
   ========================================================= */
.cta {
  padding: 0;
  background: transparent;
  border-top: 0;
}

.cta__inner {
  max-width: 920px;
  margin: 0 auto;
  text-align: center;
}

.cta__lede {
  color: var(--ink-2);
  max-width: 36ch;
  margin: 0 auto 2.5rem;
}

.cta__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  justify-content: center;
  margin-bottom: 3.5rem;
}

.chip {
  display: inline-flex;
  align-items: center;
  gap: .65rem;
  padding: .85rem 1.4rem;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  font-size: .98rem;
  letter-spacing: .02em;
  background: rgba(255, 255, 255, 0.15);
  transition: background .35s var(--ease), border-color .35s var(--ease), transform .3s var(--ease), color .3s var(--ease);
}

.chip:hover {
  background: rgba(255, 255, 255, 0.3);
  border-color: var(--ink-3);
  transform: translateY(-1px);
}

.chip--primary {
  background: #e8b07a;
  color: #1a1018;
  border-color: #e8b07a;
  font-weight: 500;
}

.chip--primary:hover {
  background: #d4945a;
  border-color: #d4945a;
  color: #1a1018;
}

.cta__form {
  text-align: left;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.25rem;
  max-width: 720px;
  margin: 0 auto;
}

.field {
  display: flex;
  flex-direction: column;
  gap: .4rem;
}

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

.field label {
  font-size: .72rem;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.field input,
.field select,
.field textarea {
  background: rgba(255, 255, 255, 0.45);
  border: 1px solid var(--line-2);
  color: var(--ink);
  padding: .85rem 1rem;
  font: inherit;
  border-radius: 2px;
  transition: border-color .3s var(--ease), background .3s var(--ease);
}

.field textarea {
  resize: vertical;
  min-height: 110px;
}

.field select {
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--ink-2) 50%),
    linear-gradient(135deg, var(--ink-2) 50%, transparent 50%);
  background-position:
    calc(100% - 18px) 50%,
    calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 2.5rem;
}

.field select option {
  background: #d4b896;
  color: rgba(35, 30, 25, 0.92);
}

.field input:focus,
.field select:focus,
.field textarea:focus {
  outline: none;
  border-color: var(--warm);
  background: rgba(255, 255, 255, 0.6);
}

.btn {
  display: inline-block;
  padding: .95rem 1.6rem;
  border: 1px solid transparent;
  border-radius: 999px;
  font: inherit;
  letter-spacing: .02em;
  cursor: pointer;
  transition: background .35s var(--ease), color .35s var(--ease), transform .3s var(--ease);
  grid-column: 1 / -1;
  justify-self: start;
}

.btn--primary {
  background: #e8b07a;
  color: #1a1018;
  font-weight: 500;
}

.btn--primary:hover {
  background: #d4945a;
  transform: translateY(-1px);
}

.form-note {
  grid-column: 1 / -1;
  color: var(--ink-3);
  font-size: .82rem;
  margin: 0;
}

.form-note a {
  color: #9b5e2c;
  border-bottom: 1px solid #9b5e2c;
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer {
  display: none;
  /* Footer info duplicates the contact card; hidden in the modal-deck layout. */
  background: #243018;
  padding: clamp(3rem, 6vw, 5rem) var(--gutter) 1.5rem;
  border-top: 1px solid var(--line);
}

.footer__inner {
  max-width: 1280px;
  margin: 0 auto 2rem;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1.4fr 1fr;
  gap: 2.5rem;
}

.footer__brand strong {
  font-family: var(--display);
  font-weight: 500;
  font-size: 1.2rem;
  letter-spacing: -0.01em;
  display: block;
  margin-bottom: .25rem;
}

.footer__brand p,
.footer__col p {
  color: var(--ink-3);
  margin: 0;
}

.footer__col h4 {
  font-size: .72rem;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin: 0 0 1rem;
  font-weight: 500;
}

.footer__col a {
  display: block;
  color: var(--ink-2);
  margin-bottom: .35rem;
  font-size: .92rem;
  transition: color .3s var(--ease);
}

.footer__col a:hover {
  color: var(--warm);
}

.footer__base {
  max-width: 1280px;
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding-top: 1.25rem;
  font-size: .78rem;
  color: var(--ink-3);
}

.footer__base p {
  margin: 0;
}

/* =========================================================
   GSAP-driven reveal helpers
   ========================================================= */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
}

[data-reveal-stagger]>* {
  opacity: 0;
  transform: translateY(20px);
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1100px) {
  .services__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .process__list {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }

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

@media (max-width: 820px) {
  .nav {
    padding: .9rem var(--gutter);
  }

  .nav__links {
    position: fixed;
    inset: 64px 0 auto 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    /* Match the modal panel green, slightly transparent so the hero
       backdrop / current modal subtly shows through. */
    background: rgba(46, 56, 38, 0.92);
    backdrop-filter: blur(14px);
    -webkit-backdrop-filter: blur(14px);
    padding: 1rem var(--gutter) 1.5rem;
    transform: translateY(-110%);
    opacity: 0;
    pointer-events: none;
    transition: transform .45s var(--ease), opacity .35s var(--ease);
    border-bottom: 1px solid var(--line);
  }

  .nav__links a {
    padding: 1rem 0;
    border-bottom: 1px solid var(--line);
    text-align: left;
  }

  .nav__links a:last-child {
    border-bottom: 0;
  }

  .nav__cta {
    align-self: flex-start;
    margin-top: .9rem;
    /* Restore explicit pill padding — the .nav__links a rule above
       collapses horizontal padding to 0 on mobile, so the text would
       overlap the rounded edges without this. */
    padding: .7rem 1.4rem;
    border-bottom: 0;
  }

  .nav__hamburger {
    display: block;
  }

  .nav__toggle:checked~.nav__links {
    transform: translateY(0);
    opacity: 1;
    pointer-events: auto;
  }

  /* Mobile: each card slot grows to fit its content (no internal
     scroll), so a touch anywhere in the modal scrolls the body /
     conveyor naturally — no scroll-hijack. The strip total height is
     measured in JS and the .scroll-track height is set to match, so
     the conveyor maths keep working with variable card heights. */
  .card {
    width: 100%;
    height: auto;
    min-height: 100vh;
    padding: 0 4vw;
    align-items: stretch;
  }

  .card__panel {
    width: 100%;
    min-height: auto;
    max-height: none;
    overflow: visible;
    padding: clamp(1.25rem, 4vw, 2rem);
    border-radius: 18px;
    margin: 4vh auto;
    /* Anchor content to the top so the headline reads first. */
    justify-content: flex-start;
  }

  /* FAQ panel needs the same touch-friendly treatment on mobile: no
     internal scroll. The card slot grows to fit all 8 questions
     (collapsed or expanded), and a touch anywhere on the panel
     scrolls the body conveyor like every other modal. */
  [data-card="faq"] .card__panel {
    overflow: visible;
    overscroll-behavior: auto;
    max-height: none;
  }

  /* Services fit comfortably as a 2-column grid on mobile (3 rows of
     2 instead of 6 stacked rows that overflow into the next card). */
  .services__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  /* Process steps in 2 columns (2 rows × 2) instead of stacked. */
  .process__list {
    grid-template-columns: repeat(2, 1fr);
    gap: 1.25rem;
  }

  /* Mobile hero — vertical layout. The landscape frames center-crop to portrait
     via the canvas (cover math), and ALL text overlays anchor to the vertical
     centre of the viewport. No more left/right gymnastics on small screens. */
  .hero-overlay,
  .hero-overlay--center,
  .hero-overlay--left,
  .hero-overlay--right {
    inset: 0;
    padding: 0 var(--gutter);
  }

  .hero-overlay>* {
    max-width: 100%;
  }

  /* Vignette darken on mobile — strongest in the central band where text sits,
     softer at the very top/bottom so the patio + sky stay visible. */
  .hero-stage::before {
    background:
      radial-gradient(ellipse 90% 70% at 50% 50%, rgba(0, 0, 0, 0.50) 0%, rgba(0, 0, 0, 0.18) 70%, transparent 100%),
      linear-gradient(to bottom, rgba(0, 0, 0, 0.20) 0%, rgba(0, 0, 0, 0.0) 30%, rgba(0, 0, 0, 0.0) 70%, rgba(0, 0, 0, 0.30) 100%);
  }

  /* Tighter type so it fits a portrait viewport */
  .hero-title {
    font-size: clamp(5rem, 9.5vw, 3.4rem);
    margin-bottom: .9rem;
  }

  .hero-line {
    font-size: clamp(4rem, 7.5vw, 4rem);
  }

  .hero-sub {
    font-size: .94rem;
    max-width: 28rem;
  }

  .hero-overlay .eyebrow {
    margin-bottom: .8rem;
  }

  .scroll-cue {
    margin-top: 1.5rem;
  }

  .scroll-cue svg {
    height: 28px;
  }

  .about__grid {
    grid-template-columns: 1fr;
    gap: 2.5rem;
  }

  .about__visual {
    aspect-ratio: 4/3;
  }

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

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

  .gallery__grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .tile,
  .tile--tall,
  .tile--wide {
    grid-column: auto;
    grid-row: auto;
    aspect-ratio: 1 / 1;
  }

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

  .footer__inner {
    grid-template-columns: 1fr;
    gap: 1.75rem;
  }
}

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

  .tile,
  .tile--tall,
  .tile--wide {
    grid-column: auto;
    grid-row: auto;
    aspect-ratio: 4 / 3;
  }
}

@media (prefers-reduced-motion: reduce) {

  *,
  *::before,
  *::after {
    animation-duration: .001ms !important;
    transition-duration: .001ms !important;
  }

  html {
    scroll-behavior: auto;
  }

  .scroll-cue svg {
    animation: none;
  }

  .hero-loader__ring {
    animation: none;
  }

  /* Reduced-motion fallback: revert to traditional vertical scroll.
     Stage becomes a static block, deck cards stack normally, scroll-track collapses. */
  html,
  body {
    scrollbar-width: auto;
  }

  html::-webkit-scrollbar,
  body::-webkit-scrollbar {
    display: initial;
  }

  .stage {
    position: relative;
    inset: auto;
    height: auto;
    perspective: none;
    pointer-events: auto;
    overflow: visible;
  }

  .stage__bg {
    position: relative;
    inset: auto;
    height: 100vh;
    transform: none !important;
  }

  .deck {
    position: relative;
    inset: auto;
    overflow: visible;
    transform: none !important;
  }

  .deck__strip {
    position: relative;
    top: auto;
    transform: none !important;
  }

  .card {
    width: 100%;
    height: auto;
    opacity: 1 !important;
    transform: none !important;
    pointer-events: auto;
    padding: var(--section-y) var(--gutter);
  }

  .card__panel {
    width: 100%;
    max-width: 1280px;
    max-height: none;
    overflow: visible;
    background: transparent;
    border: 0;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
    backdrop-filter: none;
  }

  .scroll-track {
    display: none;
  }

  .footer {
    display: block;
  }
}