/* =========================================================
   JL Kitchens & Bedrooms — homepage styles
   Palette: navy anchor + brass accent + sage whisper (see README notes in index.html)
   ========================================================= */

:root {
  --navy-950: #12203D;
  --navy-800: #1C2E52;
  --navy-700: #24365E;
  --brass-500: #B08D4F;
  --brass-300: #D9BE8C;
  --sage-500: #7C8B6F;
  --sage-100: #E7EBE2;
  --paper: #F7F4EE;
  --paper-dim: #EFEAE0;
  --ink-900: #211D18;
  --ink-600: #544E45;
  --ink-400: #8A8375;
  --border: #DCD4C2;
  --radius-s: 4px;
  --radius-m: 8px;
  --shadow-card: 0 18px 40px -22px rgba(18, 32, 61, 0.35);
  --font-serif: "Playfair Display", "Iowan Old Style", "Palatino Linotype", Georgia, serif;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --container: 1240px;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.01ms !important; animation-iteration-count: 1 !important; transition-duration: 0.01ms !important; scroll-behavior: auto !important; }
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink-900);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

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

h1, h2, h3, h4 {
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.15;
  margin: 0;
  color: var(--navy-950);
}

p { margin: 0 0 1em; }
a { color: inherit; }

.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 24px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.skip-link {
  position: absolute;
  left: 12px; top: -60px;
  background: var(--brass-500);
  color: var(--navy-950);
  padding: 10px 16px;
  border-radius: var(--radius-s);
  z-index: 200;
  font-weight: 600;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 12px; }

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

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 14px 28px;
  border-radius: var(--radius-s);
  font-family: var(--font-sans);
  font-weight: 600;
  font-size: 1rem;
  text-decoration: none;
  border: 1.5px solid transparent;
  cursor: pointer;
  transition: transform 0.15s ease, background-color 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.btn-primary {
  background: var(--brass-500);
  color: var(--navy-950);
}
.btn-primary:hover, .btn-primary:focus-visible {
  background: var(--brass-300);
  transform: translateY(-2px);
  box-shadow: 0 12px 24px -10px rgba(176, 141, 79, 0.55);
}
.btn-outline {
  background: transparent;
  border-color: var(--brass-300);
  color: var(--paper);
}
.btn-outline:hover, .btn-outline:focus-visible {
  background: rgba(217, 190, 140, 0.12);
  border-color: var(--brass-500);
}

/* ---------- Header ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(18, 32, 61, 0.94);
  backdrop-filter: saturate(140%) blur(6px);
  border-bottom: 1px solid rgba(217, 190, 140, 0.18);
}
.site-header .container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding-top: 12px;
  padding-bottom: 12px;
}
.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  color: var(--paper);
}
.brand img { width: 44px; height: 44px; }
.brand-name {
  font-family: var(--font-serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.brand-name span { display: block; font-family: var(--font-sans); font-size: 0.65rem; letter-spacing: 0.14em; text-transform: uppercase; color: var(--brass-300); font-weight: 600; }

.main-nav ul {
  list-style: none;
  display: flex;
  gap: 28px;
  margin: 0;
  padding: 0;
}
.main-nav a {
  text-decoration: none;
  color: var(--paper);
  font-weight: 500;
  font-size: 0.95rem;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
  transition: border-color 0.15s ease, color 0.15s ease;
}
.main-nav a:hover, .main-nav a:focus-visible { border-color: var(--brass-500); color: var(--brass-300); }
.main-nav a.is-active { border-color: var(--brass-500); color: var(--brass-300); }

.header-actions { display: flex; align-items: center; gap: 18px; }
.header-cta { display: inline-flex; }

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid rgba(217, 190, 140, 0.4);
  border-radius: var(--radius-s);
  color: var(--paper);
  padding: 8px 10px;
  font-size: 1.1rem;
  cursor: pointer;
}

/* ---------- Hero (split layout: solid navy text panel + full-bleed photo) ---------- */
.hero {
  position: relative;
  display: grid;
  grid-template-columns: minmax(380px, 46%) 1fr;
  min-height: clamp(560px, 78vh, 760px);
  color: var(--paper);
  /* .hero is a <section>, so it would otherwise inherit the generic
     section{padding} rule (96px / 64px on mobile) and leave the page
     background exposed above/below the panels. */
  padding: 0;
}

/* ---- Text panel ---- */
.hero-text-panel {
  position: relative;
  background: var(--navy-950);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(56px, 7vw, 96px) clamp(32px, 5vw, 72px) clamp(56px, 7vw, 96px) clamp(56px, 8vw, 120px);
  overflow: hidden;
  z-index: 1;
}
.hero-rule {
  display: block;
  width: 56px;
  height: 3px;
  background: var(--brass-500);
  margin-bottom: 24px;
  border-radius: 2px;
}
.hero-watermark {
  position: absolute;
  right: -8%;
  bottom: -10%;
  width: 58%;
  max-width: 340px;
  opacity: 0.05;
  pointer-events: none;
  user-select: none;
}
.hero-eyebrow {
  position: relative;
  font-family: var(--font-sans);
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-size: 0.78rem;
  color: var(--brass-300);
  font-weight: 700;
  margin-bottom: 20px;
  display: block;
}
.hero h1 {
  position: relative;
  font-size: clamp(2.1rem, 3.6vw, 3.25rem);
  color: var(--paper);
  overflow: hidden;
}
.hero h1 .line {
  display: block;
  transform: translateY(110%);
  animation: hero-reveal 0.8s cubic-bezier(0.2, 0.9, 0.25, 1) forwards;
}
.hero h1 .line:nth-child(2) { animation-delay: 0.12s; }
@keyframes hero-reveal {
  to { transform: translateY(0); }
}
@media (prefers-reduced-motion: reduce) {
  .hero h1 .line { transform: none; animation: none; }
}
.hero-sub {
  position: relative;
  font-size: 1.1rem;
  max-width: 46ch;
  margin: 24px 0 34px;
  color: var(--paper-dim);
}
.hero-ctas { position: relative; display: flex; flex-wrap: wrap; gap: 18px; align-items: center; }
.hero-note { position: relative; font-size: 0.85rem; color: var(--brass-300); margin-top: 20px; }

/* ---- Media panel: full-bleed carousel, no text, no scrim ---- */
.hero-media-panel {
  position: relative;
  overflow: hidden;
}
.hero-media {
  position: absolute;
  inset: 0;
}
.hero-slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  opacity: 0;
  transition: opacity 1.6s ease;
  will-change: opacity;
  /* Source photos are ~736px wide; now displayed at roughly half the hero's
     width instead of full-bleed, so the upscale ratio is much lower than
     before. Slight contrast/saturation boost still helps a touch. */
  filter: contrast(1.05) saturate(1.05);
}
.hero-slide.is-active { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .hero-slide { transition: none; }
}

/* ---------- Hero slide dots (sit on the media panel only) ---------- */
.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 1;
}
.hero-dot {
  width: 22px;
  height: 6px;
  padding: 0;
  border: none;
  border-radius: 3px;
  background: rgba(247, 244, 238, 0.5);
  cursor: pointer;
  overflow: hidden;
  position: relative;
  transition: background-color 0.3s ease, width 0.3s ease;
}
.hero-dot span { display: none; }
.hero-dot.is-active {
  width: 30px;
  background: var(--brass-300);
}
.hero-dot:hover, .hero-dot:focus-visible { background: rgba(247, 244, 238, 0.75); }
@media (prefers-reduced-motion: reduce) {
  .hero-dots { display: none; }
}

/* ---------- Trust bar ---------- */
.trust-bar {
  /* Lighter than the hero's navy-950 plus a gold hairline + shadow so it
     reads as its own strip rather than a continuation of the hero. */
  background: var(--navy-800);
  color: var(--paper);
  border-top: 1px solid rgba(217, 190, 140, 0.3);
  box-shadow: 0 12px 20px -16px rgba(0, 0, 0, 0.45) inset;
  position: relative;
  z-index: 1;
}
.trust-bar-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 40px;
  align-items: center;
  justify-content: space-between;
  padding-top: 20px;
  padding-bottom: 20px;
  font-size: 0.88rem;
}
.trust-icon {
  width: 15px;
  height: 15px;
  flex: none;
  color: var(--brass-500);
}
.coverage-list,
.trust-badges {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 22px;
  margin: 0;
  padding: 0;
}
.coverage-list li,
.trust-badges li {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--paper-dim);
}
.trust-badges {
  padding-left: 32px;
  border-left: 1px solid rgba(217, 190, 140, 0.22);
}
.trust-badges li { font-weight: 600; color: var(--brass-300); }

/* ---------- Restrained scroll-reveal ---------- */
/* Applied via IntersectionObserver in script.js to .editorial-row,
   .testimonial and .work-item. Subtle rise + fade, staggered per group,
   triggers once. Skipped entirely under prefers-reduced-motion. */
.reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}
.reveal.is-visible { opacity: 1; transform: translateY(0); }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
}

/* ---------- Section scaffolding ---------- */
section { padding: 96px 0; }
.section-head { max-width: 640px; margin-bottom: 48px; }
.section-kicker {
  display: block;
  font-size: 0.78rem;
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-weight: 700;
  color: var(--brass-500);
  margin-bottom: 12px;
}
.section-head h2 { font-size: clamp(1.9rem, 3vw, 2.6rem); }
.section-head p { color: var(--ink-600); margin-top: 14px; font-size: 1.05rem; }

/* ---------- Featured work (asymmetric) ---------- */
.work-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.work-item {
  position: relative;
  border-radius: var(--radius-m);
  overflow: hidden;
  box-shadow: var(--shadow-card);
  min-height: 340px;
  /* .work-item is a <button> (opens the lightbox) — reset button chrome. */
  display: block;
  width: 100%;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  font: inherit;
  text-align: left;
  cursor: pointer;
}
.work-item img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s ease; }
.work-item:hover img { transform: scale(1.04); }
.work-item .work-caption {
  position: absolute; left: 0; right: 0; bottom: 0;
  padding: 18px 20px;
  background: linear-gradient(0deg, rgba(18,32,61,0.85), transparent);
  color: var(--paper);
  font-size: 0.92rem;
  font-weight: 600;
  text-align: left;
}

/* ---------- Gallery lightbox ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 300;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(9, 14, 28, 0.92);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.25s ease;
}
.lightbox.is-open { opacity: 1; visibility: visible; }
body.lightbox-open { overflow: hidden; }
.lightbox-figure {
  margin: 0;
  max-width: min(92vw, 1100px);
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}
.lightbox-img {
  max-width: 100%;
  max-height: 78vh;
  width: auto;
  height: auto;
  border-radius: var(--radius-m);
  box-shadow: 0 30px 60px -20px rgba(0, 0, 0, 0.6);
}
.lightbox-caption { color: var(--paper); font-size: 0.95rem; text-align: center; }
.lightbox-close,
.lightbox-nav {
  position: absolute;
  border: 1px solid rgba(217, 190, 140, 0.35);
  background: rgba(247, 244, 238, 0.1);
  color: var(--paper);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background-color 0.15s ease, color 0.15s ease, border-color 0.15s ease;
}
.lightbox-close:hover, .lightbox-close:focus-visible,
.lightbox-nav:hover, .lightbox-nav:focus-visible {
  background: var(--brass-500);
  color: var(--navy-950);
  border-color: var(--brass-500);
}
.lightbox-close { top: 20px; right: 20px; width: 44px; height: 44px; }
.lightbox-close svg { width: 20px; height: 20px; }
.lightbox-nav { top: 50%; transform: translateY(-50%); width: 48px; height: 48px; }
.lightbox-nav svg { width: 22px; height: 22px; }
.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }
@media (max-width: 780px) {
  .lightbox-close { top: 12px; right: 12px; width: 40px; height: 40px; }
  .lightbox-nav { width: 40px; height: 40px; }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
  .lightbox-figure { gap: 10px; }
}

/* ---------- Testimonials ---------- */
.testimonials {
  background: var(--navy-950);
  color: var(--paper);
}
.testimonials .section-head h2 { color: var(--paper); }
.testimonials .section-head p { color: var(--paper-dim); }
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 28px;
}
.testimonial {
  background: var(--navy-800);
  border: 1px solid rgba(217, 190, 140, 0.18);
  border-radius: var(--radius-m);
  padding: 32px 28px;
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}
/* hover:hover + pointer:fine excludes touch devices, which report a hover
   state on tap that then gets "stuck" until the user taps elsewhere. */
@media (hover: hover) and (pointer: fine) {
  .testimonial:hover {
    transform: translateY(-4px);
    box-shadow: 0 24px 44px -22px rgba(0, 0, 0, 0.55);
    border-color: rgba(217, 190, 140, 0.4);
  }
}
.testimonial .quote-mark { font-family: var(--font-serif); font-size: 2.6rem; color: var(--brass-500); line-height: 1; display: block; margin-bottom: 8px; }
.testimonial blockquote { margin: 0 0 20px; font-size: 1.02rem; color: var(--paper-dim); }
.testimonial cite { font-style: normal; font-weight: 600; color: var(--brass-300); font-size: 0.9rem; }
.stars { color: var(--brass-500); letter-spacing: 2px; margin-bottom: 12px; display: block; }

/* ---------- Numbered editorial rows: offer / cover / why ---------- */
.editorial-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 24px;
  padding: 48px 0;
  border-top: 1px solid var(--border);
}
.editorial-row:last-of-type { border-bottom: 1px solid var(--border); }
.editorial-num {
  font-family: var(--font-serif);
  font-size: 3.2rem;
  color: var(--brass-300);
  line-height: 1;
}
.editorial-body h3 { font-size: 1.5rem; margin-bottom: 12px; }
.editorial-body p { color: var(--ink-600); max-width: 68ch; font-size: 1.02rem; }
.editorial-body ul { color: var(--ink-600); padding-left: 20px; margin: 12px 0 0; }
.editorial-body li { margin-bottom: 4px; }

/* ---------- Final CTA + form ---------- */
.cta-section {
  background: var(--paper-dim);
  padding: 0;
}
.cta-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  min-height: 720px;
}
.cta-form-wrap {
  padding: 96px 56px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.cta-form-wrap h2 { margin-bottom: 12px; }
.cta-form-wrap > p { color: var(--ink-600); margin-bottom: 32px; }
.cta-media { position: relative; }
.cta-media img { width: 100%; height: 100%; object-fit: cover; }

form.enquiry-form { display: grid; gap: 20px; }
.form-row { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.field label {
  display: block;
  font-weight: 600;
  font-size: 0.9rem;
  margin-bottom: 6px;
  color: var(--navy-950);
}
.field .hint { display: block; font-weight: 400; color: var(--ink-400); font-size: 0.82rem; margin-top: 2px; }
.field input, .field textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1.5px solid var(--border);
  border-radius: var(--radius-s);
  background: var(--paper);
  font-family: var(--font-sans);
  font-size: 1rem;
  color: var(--ink-900);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.field input:focus, .field textarea:focus {
  border-color: var(--brass-500);
  box-shadow: 0 0 0 3px rgba(176, 141, 79, 0.18);
  outline: none;
}
.field textarea { resize: vertical; min-height: 110px; }
.form-status {
  border-radius: var(--radius-s);
  padding: 14px 16px;
  font-size: 0.95rem;
  font-weight: 600;
  display: none;
}
.form-status.visible { display: block; }
.form-status.success { background: var(--sage-100); color: #3E4A34; border: 1px solid var(--sage-500); }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--navy-950);
  color: var(--paper-dim);
  padding: 72px 0 28px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 48px;
  border-bottom: 1px solid rgba(217, 190, 140, 0.18);
}
.footer-brand { display: flex; align-items: flex-start; gap: 12px; }
.footer-brand img { width: 40px; height: 40px; }
.footer-brand .brand-name { color: var(--paper); }
.footer-col h4 { color: var(--paper); font-family: var(--font-sans); font-size: 0.85rem; text-transform: uppercase; letter-spacing: 0.1em; margin-bottom: 16px; }
.footer-col ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.footer-col a { text-decoration: none; color: var(--paper-dim); font-size: 0.95rem; }
.footer-col a:hover, .footer-col a:focus-visible { color: var(--brass-300); }
address { font-style: normal; font-size: 0.95rem; line-height: 1.7; }
.footer-contact-line { display: flex; align-items: center; gap: 8px; margin-top: 8px; }
.footer-icon { width: 14px; height: 14px; flex: none; color: var(--brass-500); }
.social-row { display: flex; gap: 12px; margin-top: 16px; }
.social-row a {
  width: 38px; height: 38px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid rgba(217, 190, 140, 0.35);
  border-radius: 50%;
  transition: background-color 0.15s ease, border-color 0.15s ease;
}
.social-row a:hover, .social-row a:focus-visible { background: var(--brass-500); border-color: var(--brass-500); }
.footer-bottom {
  display: flex; justify-content: space-between; flex-wrap: wrap; gap: 12px;
  padding-top: 24px;
  font-size: 0.82rem;
  color: var(--ink-400);
}

/* ---------- Responsive ---------- */
@media (max-width: 1000px) {
  .work-grid { grid-template-columns: 1fr 1fr; }
  .work-item { min-height: 300px; }
  .testimonial-grid { grid-template-columns: 1fr; }
  .cta-grid { grid-template-columns: 1fr; }
  .cta-media { min-height: 360px; order: -1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 780px) {
  .main-nav { position: fixed; top: 68px; left: 0; right: 0; height: calc(100vh - 68px); background: var(--navy-950); padding: 24px; transform: translateY(-8px); opacity: 0; pointer-events: none; transition: opacity 0.2s ease, transform 0.2s ease; }
  .main-nav.open { opacity: 1; transform: translateY(0); pointer-events: auto; }
  .main-nav ul { flex-direction: column; gap: 4px; }
  .main-nav a { display: block; padding: 14px 4px; font-size: 1.05rem; border-bottom: 1px solid rgba(217,190,140,0.14); }
  .header-cta { display: none; }
  .nav-toggle { display: inline-flex; align-items: center; justify-content: center; }
  section { padding: 64px 0; }
  .editorial-row { grid-template-columns: 1fr; }
  .editorial-num { font-size: 2.2rem; }
  .work-grid { grid-template-columns: 1fr; }
  .work-item { min-height: 260px; }
  .form-row { grid-template-columns: 1fr; }
  .cta-form-wrap { padding: 56px 24px; }
  .footer-grid { grid-template-columns: 1fr; gap: 32px; }
  .trust-bar-inner { flex-direction: column; align-items: flex-start; gap: 14px; }
  .trust-badges { padding-left: 0; border-left: none; padding-top: 14px; border-top: 1px solid rgba(217, 190, 140, 0.22); width: 100%; }
  /* Stack the split hero: navy text panel on top (headline/CTA visible
     immediately), photo carousel below — not side-by-side below tablet. */
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-text-panel { padding: 56px 24px 48px; }
  /* A contained, near-square crop (rather than a tall full-viewport-height
     one) so object-fit:cover doesn't have to zoom in as aggressively —
     less of each photo gets cropped away on narrow screens. */
  .hero-media-panel { aspect-ratio: 1 / 1; min-height: 320px; }
  .hero-watermark { width: 70%; }
  .hero-dots { bottom: 18px; }

  /* Per-image object-position — default "center" crops each photo
     differently well; tuned per photo so the most important part
     (the run of cabinetry, not empty wall/ceiling) stays in frame. */
  .hs-hero2 { object-position: 50% 55%; }
  .hs-hero4 { object-position: 50% 38%; }
}
