/* =========================================================
   JD Custom Kitchens & Cabinetry
   Premium monochrome + warm bronze accent
   ========================================================= */

:root {
  /* Color tokens */
  --ink:        #1C1917;   /* primary / near-black */
  --ink-soft:   #44403C;   /* secondary text */
  --bronze:     #9A7B4F;   /* warm accent (ties to timber tones) */
  --bronze-dk:  #7c6240;
  --bg:         #FAFAF9;   /* page background */
  --surface:    #FFFFFF;
  --muted:      #F1EFEC;   /* muted section bg */
  --line:       #E2DDD6;   /* hairline borders */
  --foreground: #0C0A09;
  --on-dark:    #FAFAF9;
  --on-dark-mut:#B8B2AA;

  /* Type */
  --serif: "Playfair Display", Georgia, serif;
  --sans:  "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;

  /* Layout */
  --container: 1200px;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --radius: 4px;

  /* Motion */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.55s;
}

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; transition-duration: 0.001ms !important; }
}

body {
  font-family: var(--sans);
  color: var(--ink);
  background: var(--bg);
  font-weight: 400;
  line-height: 1.65;
  font-size: 1rem;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img { max-width: 100%; display: block; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.skip-link {
  position: absolute; left: 1rem; top: -3rem;
  background: var(--ink); color: var(--on-dark);
  padding: .6rem 1rem; border-radius: var(--radius); z-index: 200;
  transition: top .2s var(--ease);
}
.skip-link:focus { top: 1rem; }

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

/* ---------- Typography helpers ---------- */
.eyebrow {
  font-size: .72rem;
  letter-spacing: .22em;
  text-transform: uppercase;
  font-weight: 500;
  color: var(--bronze-dk);
  margin-bottom: 1.1rem;
}
.eyebrow--light { color: var(--bronze); }

.section { padding-block: clamp(4.5rem, 9vw, 8rem); }
.section--muted { background: var(--muted); }
.section--dark { background: var(--ink); color: var(--on-dark); }

.section__head { max-width: 42rem; margin: 0 auto clamp(2.5rem, 5vw, 4rem); text-align: center; }
.section__head--light .section__lead { color: var(--on-dark-mut); }
.section__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2rem, 4.5vw, 3.25rem);
  line-height: 1.1;
  letter-spacing: -0.01em;
}
.section--dark .section__title { color: var(--on-dark); }
.section__title--left { text-align: left; }
.section__lead {
  margin-top: 1.1rem;
  font-size: 1.075rem;
  color: var(--ink-soft);
}

/* ---------- Buttons ---------- */
.btn {
  --btn-pad-y: .85rem;
  --btn-pad-x: 1.6rem;
  display: inline-flex; align-items: center; justify-content: center; gap: .5rem;
  padding: var(--btn-pad-y) var(--btn-pad-x);
  font-size: .92rem; font-weight: 500;
  letter-spacing: .02em;
  border: 1px solid transparent;
  border-radius: var(--radius);
  transition: background-color .25s var(--ease), color .25s var(--ease),
              border-color .25s var(--ease), transform .25s var(--ease);
  white-space: nowrap;
}
.btn:active { transform: translateY(1px); }
.btn--lg { --btn-pad-y: 1.05rem; --btn-pad-x: 2.1rem; font-size: 1rem; }
.btn--sm { --btn-pad-y: .6rem; --btn-pad-x: 1.1rem; font-size: .85rem; }

.btn--solid { background: var(--ink); color: var(--on-dark); border-color: var(--ink); }
.btn--solid:hover { background: var(--bronze-dk); border-color: var(--bronze-dk); }

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

.section--dark .btn--ghost,
.hero .btn--ghost { color: var(--on-dark); border-color: rgba(250,250,249,.4); }
.section--dark .btn--ghost:hover,
.hero .btn--ghost:hover { border-color: var(--on-dark); background: rgba(250,250,249,.08); }

/* =========================================================
   NAV
   ========================================================= */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  transition: background-color .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
  border-bottom: 1px solid transparent;
}
.nav__inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 84px;
  transition: height .4s var(--ease);
}
.nav__logo { height: 50px; width: auto; transition: height .4s var(--ease); }

.nav__links { display: flex; gap: 2rem; }
.nav__links a {
  font-size: .9rem; font-weight: 500; color: var(--on-dark);
  position: relative; padding-block: .3rem;
  transition: color .25s var(--ease);
}
.nav__links a::after {
  content: ""; position: absolute; left: 0; bottom: 0; height: 1px; width: 0;
  background: currentColor; transition: width .3s var(--ease);
}
.nav__links a:hover::after { width: 100%; }

.nav__cta { color: var(--on-dark); border-color: rgba(250,250,249,.5); background: transparent; }
.nav__cta:hover { background: var(--on-dark); color: var(--ink); border-color: var(--on-dark); }

/* Scrolled state — solid light bar */
.nav.is-scrolled {
  background: rgba(250,250,249,.85);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom-color: var(--line);
  box-shadow: 0 1px 0 rgba(0,0,0,.02);
}
.nav.is-scrolled .nav__inner { height: 70px; }
.nav.is-scrolled .nav__logo { height: 42px; }
.nav.is-scrolled .nav__links a { color: var(--ink); }
.nav.is-scrolled .nav__cta { color: var(--ink); border-color: var(--line); }
.nav.is-scrolled .nav__cta:hover { background: var(--ink); color: var(--on-dark); border-color: var(--ink); }
/* logo is dark artwork; invert when over dark hero so it reads */
.nav:not(.is-scrolled) .nav__logo { filter: brightness(0) invert(1); }

/* When mobile drawer is open, keep the bar solid + dark-on-light for legibility */
.nav.is-open {
  background: var(--surface);
  border-bottom-color: var(--line);
}
.nav.is-open .nav__logo { filter: none; }

/* Hamburger */
.nav__toggle {
  display: none; width: 44px; height: 44px; background: none; border: 0;
  flex-direction: column; gap: 5px; align-items: center; justify-content: center;
}
.nav__toggle span {
  display: block; width: 24px; height: 2px; background: var(--on-dark);
  transition: transform .3s var(--ease), opacity .3s var(--ease), background-color .3s var(--ease);
}
.nav.is-scrolled .nav__toggle span,
.nav.is-open .nav__toggle span { background: var(--ink); }
.nav.is-open .nav__toggle span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav.is-open .nav__toggle span:nth-child(2) { opacity: 0; }
.nav.is-open .nav__toggle span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

/* Drawer */
.drawer {
  background: var(--surface); border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.drawer__links { display: flex; flex-direction: column; padding: 1rem var(--gutter) 1.75rem; gap: .25rem; }
.drawer__links a { padding: .9rem .25rem; font-weight: 500; border-bottom: 1px solid var(--line); color: var(--ink); }
.drawer__links a:last-child { border: 0; margin-top: .75rem; }
.drawer__links a.btn--solid { color: var(--on-dark); }

/* =========================================================
   HERO
   ========================================================= */
.hero {
  position: relative; min-height: 100vh; min-height: 100dvh;
  display: flex; align-items: center;
  color: var(--on-dark); overflow: hidden;
}
.hero__media { position: absolute; inset: 0; z-index: 0; }
.hero__img {
  width: 100%; height: 120%; object-fit: cover;
  will-change: transform;
}
.hero__scrim {
  position: absolute; inset: 0;
  background:
    linear-gradient(180deg, rgba(12,10,9,.55) 0%, rgba(12,10,9,.25) 40%, rgba(12,10,9,.65) 100%),
    linear-gradient(90deg, rgba(12,10,9,.45) 0%, rgba(12,10,9,0) 60%);
}
.hero__content { position: relative; z-index: 2; padding-top: 84px; max-width: 46rem; }
.hero__title {
  font-family: var(--serif);
  font-weight: 500;
  font-size: clamp(2.75rem, 7vw, 5.5rem);
  line-height: 1.04;
  letter-spacing: -0.015em;
  margin-bottom: 1.4rem;
}
.hero__title em { font-style: italic; color: #E9D9BE; }
.hero__sub {
  font-size: clamp(1.05rem, 1.6vw, 1.25rem);
  max-width: 34rem; color: rgba(250,250,249,.9);
  margin-bottom: 2.2rem;
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 1rem; }

.hero__scroll {
  position: absolute; left: 50%; bottom: 2rem; transform: translateX(-50%);
  z-index: 2; width: 26px; height: 44px; border: 1.5px solid rgba(250,250,249,.6);
  border-radius: 20px; display: grid; place-items: start center; padding-top: 8px;
}
.hero__scroll span { width: 3px; height: 8px; border-radius: 3px; background: rgba(250,250,249,.9); animation: scrolldot 1.8s var(--ease) infinite; }
@keyframes scrolldot { 0%{ transform: translateY(0); opacity:1 } 70%{ transform: translateY(14px); opacity:0 } 100%{ opacity:0 } }

/* =========================================================
   TRUST STRIP
   ========================================================= */
.trust { background: var(--ink); color: var(--on-dark); }
.trust__grid {
  display: grid; grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid rgba(250,250,249,.12);
}
.trust__item {
  padding: clamp(2rem, 4vw, 3rem) 1rem; text-align: center;
  border-right: 1px solid rgba(250,250,249,.12);
}
.trust__item:last-child { border-right: 0; }
.trust__num {
  display: block; font-family: var(--serif); font-weight: 500;
  font-size: clamp(2.25rem, 4vw, 3.25rem); line-height: 1; color: #E9D9BE;
  font-variant-numeric: tabular-nums;
}
.trust__label { display: block; margin-top: .7rem; font-size: .82rem; letter-spacing: .12em; text-transform: uppercase; color: var(--on-dark-mut); }

/* =========================================================
   INTRO
   ========================================================= */
.intro__grid {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: clamp(2.5rem, 6vw, 5.5rem);
  align-items: center;
}
.intro__title {
  font-family: var(--serif); font-weight: 500;
  font-size: clamp(1.75rem, 3.4vw, 2.75rem); line-height: 1.15; letter-spacing: -.01em;
  margin-bottom: 1.5rem;
}
.intro__text p { color: var(--ink-soft); margin-bottom: 1.1rem; max-width: 34rem; }
.intro__points { list-style: none; padding: 0; margin-top: 1.75rem; display: grid; gap: .85rem; }
.intro__points li { position: relative; padding-left: 1.9rem; color: var(--ink); font-weight: 500; }
.intro__points li::before {
  content: ""; position: absolute; left: 0; top: .5em; width: 12px; height: 7px;
  border-left: 2px solid var(--bronze); border-bottom: 2px solid var(--bronze);
  transform: rotate(-45deg);
}
.intro__media { position: relative; }
.intro__media img { border-radius: var(--radius); box-shadow: 0 30px 60px -30px rgba(12,10,9,.35); aspect-ratio: 4/5; object-fit: cover; }
.intro__media figcaption {
  position: absolute; left: 1rem; bottom: 1rem; right: 1rem;
  background: rgba(255,255,255,.92); backdrop-filter: blur(4px);
  padding: .7rem 1rem; font-size: .82rem; color: var(--ink-soft); border-radius: var(--radius);
}

/* =========================================================
   SERVICES
   ========================================================= */
.services__grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
}
.service-card {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  overflow: hidden; transition: transform .4s var(--ease), box-shadow .4s var(--ease), border-color .4s var(--ease);
}
.service-card:hover { transform: translateY(-6px); box-shadow: 0 28px 50px -28px rgba(12,10,9,.3); border-color: transparent; }
.service-card__media { aspect-ratio: 3/2; overflow: hidden; }
.service-card__media img { width: 100%; height: 100%; object-fit: cover; transition: transform .7s var(--ease); }
.service-card:hover .service-card__media img { transform: scale(1.06); }
.service-card__body { padding: 1.5rem 1.5rem 1.75rem; }
.service-card__body h3 { font-family: var(--serif); font-weight: 500; font-size: 1.4rem; margin-bottom: .5rem; }
.service-card__body p { color: var(--ink-soft); font-size: .95rem; }

/* =========================================================
   WORK GALLERY
   ========================================================= */
.gallery {
  display: grid; grid-template-columns: repeat(3, 1fr);
  grid-auto-rows: 260px; gap: 1.25rem;
}
.gallery__item {
  position: relative; overflow: hidden; border-radius: var(--radius);
  grid-row: span 1;
}
.gallery__item--tall { grid-row: span 2; }
.gallery__item--wide { grid-column: span 2; }
.gallery__item img { width: 100%; height: 100%; object-fit: cover; transition: transform .8s var(--ease); }
.gallery__item:hover img { transform: scale(1.05); }
.gallery__item figcaption {
  position: absolute; inset: auto 0 0 0;
  padding: 2.5rem 1.25rem 1.1rem;
  background: linear-gradient(180deg, transparent, rgba(12,10,9,.8));
  color: var(--on-dark); font-size: .95rem; font-weight: 500;
  transform: translateY(8px); opacity: .92; transition: transform .4s var(--ease), opacity .4s var(--ease);
}
.gallery__item:hover figcaption { transform: translateY(0); opacity: 1; }
.gallery__item figcaption span {
  display: block; font-size: .68rem; letter-spacing: .2em; text-transform: uppercase;
  color: #E9D9BE; margin-bottom: .25rem; font-weight: 500;
}

/* =========================================================
   PROCESS
   ========================================================= */
.steps {
  list-style: none; padding: 0;
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem;
  counter-reset: step;
}
.step { padding-top: 1.75rem; border-top: 1px solid rgba(250,250,249,.18); }
.step__num { display: block; font-family: var(--serif); font-size: 1.4rem; color: #E9D9BE; margin-bottom: 1rem; letter-spacing: .04em; }
.step h3 { font-family: var(--serif); font-weight: 500; font-size: 1.45rem; margin-bottom: .6rem; color: var(--on-dark); }
.step p { color: var(--on-dark-mut); font-size: .95rem; }

/* =========================================================
   WHY US
   ========================================================= */
.why__grid { display: grid; grid-template-columns: .9fr 1.1fr; gap: clamp(2.5rem, 6vw, 5rem); align-items: center; }
.why__media img { border-radius: var(--radius); aspect-ratio: 4/5; object-fit: cover; box-shadow: 0 30px 60px -30px rgba(12,10,9,.35); }
.why__list { margin-top: 2rem; display: grid; gap: 1.75rem; }
.why__row { padding-left: 1.5rem; border-left: 2px solid var(--bronze); }
.why__row h3 { font-size: 1.2rem; font-weight: 600; margin-bottom: .4rem; }
.why__row p { color: var(--ink-soft); font-size: .97rem; }

/* =========================================================
   TESTIMONIALS
   ========================================================= */
/* Masonry-style review wall (variable-length quotes) */
.reviews { columns: 3 320px; column-gap: 1.5rem; }
.quote {
  background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 1.85rem 1.65rem;
  break-inside: avoid; -webkit-column-break-inside: avoid; page-break-inside: avoid;
  margin: 0 0 1.5rem;
}
.quote__stars { color: var(--bronze); letter-spacing: .15em; margin-bottom: .9rem; font-size: 1rem; }
.quote p { font-size: 1rem; line-height: 1.6; color: var(--ink-soft); margin-bottom: 1.3rem; }
.quote footer { border-top: 1px solid var(--line); padding-top: .9rem; }
.quote footer strong { display: block; font-weight: 600; color: var(--ink); }
.quote footer span { font-size: .82rem; color: var(--ink-soft); }

/* =========================================================
   CONTACT
   ========================================================= */
.contact__inner { max-width: 44rem; margin-inline: auto; text-align: center; }
.contact__title { font-family: var(--serif); font-weight: 500; font-size: clamp(2rem, 4.5vw, 3.25rem); line-height: 1.1; color: var(--on-dark); margin-bottom: 1.2rem; }
.contact__lead { color: var(--on-dark-mut); max-width: 34rem; margin: 0 auto 2.5rem; font-size: 1.075rem; }
.contact__phone {
  display: inline-flex; flex-direction: column; align-items: center; gap: .35rem;
  padding: 1.4rem 2.75rem; border: 1px solid rgba(250,250,249,.25); border-radius: var(--radius);
  transition: border-color .25s var(--ease), background-color .25s var(--ease), transform .25s var(--ease);
}
.contact__phone:hover { border-color: var(--on-dark); background: rgba(250,250,249,.05); transform: translateY(-2px); }
.contact__phone-label { font-size: .72rem; letter-spacing: .22em; text-transform: uppercase; color: var(--bronze); }
.contact__phone-num { font-family: var(--serif); font-size: clamp(1.9rem, 4vw, 2.6rem); color: var(--on-dark); font-variant-numeric: tabular-nums; }
.contact__email { margin-top: 1.4rem; font-size: 1.05rem; }
.contact__email a { color: var(--on-dark); border-bottom: 1px solid rgba(250,250,249,.3); padding-bottom: 2px; transition: color .2s var(--ease), border-color .2s var(--ease); }
.contact__email a:hover { color: #E9D9BE; border-color: #E9D9BE; }
.contact__hours { margin-top: 1.4rem; color: var(--on-dark-mut); font-size: .92rem; }

/* Form */
.form {
  background: var(--surface); color: var(--ink);
  padding: clamp(1.75rem, 3vw, 2.5rem); border-radius: var(--radius);
  box-shadow: 0 40px 80px -40px rgba(0,0,0,.5);
}
.form__row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.1rem; }
.field { display: flex; flex-direction: column; margin-bottom: 1.1rem; }
.field label { font-size: .85rem; font-weight: 500; margin-bottom: .45rem; }
.field__opt { color: var(--ink-soft); font-weight: 400; }
.field input, .field select, .field textarea {
  font: inherit; font-size: .98rem; color: var(--ink);
  padding: .8rem .9rem; border: 1px solid var(--line); border-radius: var(--radius);
  background: var(--bg); transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
  width: 100%;
}
.field textarea { resize: vertical; min-height: 110px; }
.field input:focus, .field select:focus, .field textarea:focus {
  outline: none; border-color: var(--bronze); box-shadow: 0 0 0 3px rgba(154,123,79,.15);
}
.field input.is-invalid, .field select.is-invalid { border-color: var(--bronze-dk); }
.field__error { color: #b4451f; font-size: .8rem; margin-top: .35rem; min-height: 1em; }
.form__submit { width: 100%; margin-top: .5rem; }
.form__note { font-size: .8rem; color: var(--ink-soft); text-align: center; margin-top: .9rem; }
.form__success {
  margin-top: 1rem; padding: .9rem 1rem; border-radius: var(--radius);
  background: #ECF3EC; color: #2c5e2e; font-size: .92rem; text-align: center; font-weight: 500;
}

/* =========================================================
   FOOTER
   ========================================================= */
.footer { background: #100E0D; color: var(--on-dark-mut); padding-top: clamp(3.5rem, 6vw, 5rem); }
.footer__grid { display: grid; grid-template-columns: 1.6fr 1fr 1fr 1.4fr; gap: 2.5rem; padding-bottom: 3rem; }
.footer__logo { height: 60px; width: auto; filter: brightness(0) invert(1); margin-bottom: 1.25rem; }
.footer__brand p { max-width: 22rem; font-size: .95rem; }
.footer__nav { display: flex; flex-direction: column; gap: .65rem; }
.footer h4 { color: var(--on-dark); font-size: .8rem; letter-spacing: .16em; text-transform: uppercase; margin-bottom: .5rem; font-weight: 600; }
.footer__nav a, .footer__contact a { font-size: .95rem; transition: color .2s var(--ease); }
.footer__nav a:hover, .footer__contact a:hover { color: var(--on-dark); }
.footer__contact { display: flex; flex-direction: column; gap: .65rem; align-items: flex-start; }
.footer__hours { font-size: .85rem; color: var(--on-dark-mut); }
.footer__contact .btn { margin-top: .6rem; color: var(--on-dark); border-color: rgba(250,250,249,.25); }
.footer__contact .btn:hover { border-color: var(--on-dark); }
.footer__bottom {
  display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap;
  padding-block: 1.5rem; border-top: 1px solid rgba(250,250,249,.1); font-size: .82rem;
}

/* =========================================================
   REVEAL ANIMATION (CSS fallback + JS/GSAP)
   ========================================================= */
[data-reveal] { opacity: 0; transform: translateY(24px); }
.reveal-ready [data-reveal] { transition: opacity var(--dur) var(--ease), transform var(--dur) var(--ease); }
[data-reveal].is-in { opacity: 1; transform: none; }
/* If JS/GSAP unavailable, never leave content hidden */
.no-js [data-reveal] { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  [data-reveal] { opacity: 1 !important; transform: none !important; }
}

/* =========================================================
   RESPONSIVE
   ========================================================= */
@media (max-width: 1024px) {
  .services__grid, .testimonials__grid { grid-template-columns: repeat(2, 1fr); }
  .steps { grid-template-columns: repeat(2, 1fr); row-gap: 2.5rem; }
  .footer__grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 860px) {
  .nav__links, .nav__cta { display: none; }
  .nav__toggle { display: flex; }

  .intro__grid, .why__grid { grid-template-columns: 1fr; }
  .why__media { order: 2; }
  .intro__media img, .why__media img { aspect-ratio: 16/10; }
  .section__title--left { text-align: left; }

  .gallery { grid-template-columns: repeat(2, 1fr); grid-auto-rows: 200px; }
  .gallery__item--wide { grid-column: span 2; }
  .gallery__item--tall { grid-row: span 1; }
}

@media (max-width: 620px) {
  .trust__grid { grid-template-columns: repeat(2, 1fr); }
  .trust__item:nth-child(2) { border-right: 0; }
  .trust__item:nth-child(1), .trust__item:nth-child(2) { border-bottom: 1px solid rgba(250,250,249,.12); }

  .services__grid, .testimonials__grid, .steps, .footer__grid { grid-template-columns: 1fr; }
  .form__row { grid-template-columns: 1fr; gap: 0; }
  .gallery { grid-template-columns: 1fr; grid-auto-rows: 240px; }
  .gallery__item--wide { grid-column: span 1; }
  .hero__actions { flex-direction: column; align-items: stretch; }
  .hero__actions .btn { width: 100%; }
  .footer__bottom { flex-direction: column; gap: .4rem; }
}
