/* ==========================================================================
   Hanley's Joinery & Maintenance
   Colours and type are set once here and used everywhere.
   ========================================================================== */

:root {
  --ivory: #f5f1e8;
  --ivory-deep: #ece6d9;
  --charcoal: #232522;
  --charcoal-soft: #555851;
  --green: #3f5546;
  --green-deep: #2f4136;
  --wood: #a67f56;
  --wood-light: #cdb393;
  --line: rgba(35, 37, 34, 0.14);

  --serif: "Cormorant Garamond", "Iowan Old Style", Georgia, serif;
  --sans: "Hanken Grotesk", system-ui, -apple-system, "Segoe UI", sans-serif;

  --gutter: clamp(1.25rem, 4vw, 3rem);
  --section: clamp(4.5rem, 10vw, 9rem);
  --ease: cubic-bezier(0.22, 0.61, 0.36, 1);
}

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

html {
  scroll-behavior: smooth;
  scroll-padding-top: 6.5rem;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  background: var(--ivory);
  color: var(--charcoal);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; }
ul, ol { list-style: none; margin: 0; padding: 0; }
h1, h2, h3, p, figure, dl, dd { margin: 0; }

h1, h2, h3 {
  font-family: var(--serif);
  font-weight: 400;
  line-height: 1.05;
  letter-spacing: -0.01em;
  text-wrap: balance;
}
h2 { font-size: clamp(2.4rem, 5.2vw, 4rem); }
h3 { font-size: clamp(1.6rem, 2.6vw, 2.1rem); line-height: 1.15; }

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

.wrap {
  width: 100%;
  max-width: 82rem;
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.narrow { max-width: 58rem; }

.skip-link {
  position: absolute;
  left: 1rem; top: -4rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  background: var(--charcoal);
  color: var(--ivory);
  text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.eyebrow {
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--green);
  margin-bottom: 1.25rem;
}

/* Clearly marked details still to be supplied */
.placeholder {
  font-family: var(--sans);
  font-size: 0.9em;
  font-style: normal;
  color: var(--wood);
  border-bottom: 1px dashed currentColor;
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 3.25rem;
  padding: 0.85rem 1.9rem;
  border: 1px solid transparent;
  border-radius: 0;
  font: 500 0.82rem/1 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.btn-light { background: var(--ivory); color: var(--charcoal); }
.btn-light:hover { background: var(--green); color: var(--ivory); }
.btn-ghost { border-color: rgba(245, 241, 232, 0.6); color: var(--ivory); }
.btn-ghost:hover { background: var(--ivory); color: var(--charcoal); border-color: var(--ivory); }
.btn-dark { background: var(--green); color: var(--ivory); }
.btn-dark:hover { background: var(--green-deep); }
.btn[disabled] { opacity: 0.6; cursor: default; }

/* ---------- Header ---------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  color: var(--ivory);
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease), box-shadow 0.4s var(--ease);
}
.site-header.is-solid,
.site-header.is-open {
  background: var(--ivory);
  color: var(--charcoal);
  box-shadow: 0 1px 0 var(--line);
}
.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  min-height: 6.25rem;
}

.brand {
  display: flex;
  flex-direction: column;
  gap: 0.2rem;
  text-decoration: none;
  line-height: 1;
}
.brand-name {
  font-family: var(--serif);
  font-size: 2.75rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}
.brand-sub {
  font-size: 0.9rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
/* Soft shade behind the header while it sits over the hero photograph */
.site-header::before {
  content: "";
  position: absolute;
  inset: 0 0 -3rem 0;
  z-index: -1;
  background: linear-gradient(to bottom, rgba(24, 26, 23, 0.7), rgba(24, 26, 23, 0));
  pointer-events: none;
  transition: opacity 0.4s var(--ease);
}
.site-header.is-solid::before,
.site-header.is-open::before { opacity: 0; }
.site-header.is-solid .brand-name,
.site-header.is-open .brand-name { color: var(--green-deep); }

.site-nav ul { display: flex; align-items: center; gap: clamp(1.25rem, 2.6vw, 2.5rem); }
.site-nav a {
  position: relative;
  font-size: 0.8rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  text-decoration: none;
  padding: 0.5rem 0;
}
.site-nav a:not(.nav-cta)::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: 0.2rem;
  height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.4s var(--ease);
}
.site-nav a:not(.nav-cta):hover::after { transform: scaleX(1); }
.site-nav .nav-cta {
  padding: 0.75rem 1.25rem;
  border: 1px solid currentColor;
  transition: background-color 0.35s var(--ease), color 0.35s var(--ease), border-color 0.35s var(--ease);
}
.site-nav .nav-cta:hover { background: var(--green); border-color: var(--green); color: var(--ivory); }

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.75rem;
  min-height: 2.75rem;
  padding: 0;
  background: none;
  border: 0;
  color: inherit;
  font: 500 0.78rem/1 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
}
.nav-toggle-bars,
.nav-toggle-bars::before {
  display: block;
  width: 1.5rem;
  height: 1px;
  background: currentColor;
  transition: transform 0.35s var(--ease);
}
.nav-toggle-bars { position: relative; transform: translateY(-3px); }
.nav-toggle-bars::before { content: ""; position: absolute; top: 7px; }
.is-open .nav-toggle-bars { transform: translateY(0) rotate(45deg); }
.is-open .nav-toggle-bars::before { transform: translateY(-7px) rotate(-90deg); }

/* ---------- Hero ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: flex-end;
  min-height: 100vh;
  min-height: 100svh;
  color: var(--ivory);
  background: var(--charcoal);
  overflow: hidden;
}
.hero-img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: 50% 58%;
  animation: hero-settle 2.4s var(--ease) both;
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, rgba(24, 26, 23, 0.86) 0%, rgba(24, 26, 23, 0.35) 55%, rgba(24, 26, 23, 0.5) 100%);
}
.hero-content {
  position: relative;
  z-index: 1;
  padding-top: 8rem;
  padding-bottom: clamp(3rem, 8vw, 6rem);
  animation: fade-up 1.2s 0.2s var(--ease) both;
}
.hero .eyebrow { color: var(--wood-light); }
.hero h1 {
  max-width: 13ch;
  font-size: clamp(3rem, 9vw, 7.25rem);
  line-height: 0.95;
  letter-spacing: -0.02em;
}
.hero h1 em { font-style: italic; }
.hero-intro {
  max-width: 34rem;
  margin-top: 1.75rem;
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  color: rgba(245, 241, 232, 0.88);
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.9rem; margin-top: 2.25rem; }

@keyframes hero-settle { from { transform: scale(1.05); } to { transform: scale(1); } }
@keyframes fade-up { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- Intro ---------- */
.intro { padding-block: var(--section) 0; }
.lede {
  font-family: var(--serif);
  font-size: clamp(1.6rem, 3.2vw, 2.5rem);
  line-height: 1.3;
  text-wrap: pretty;
}

/* ---------- Sections ---------- */
.section { padding-block: var(--section); }
.section-tint { background: var(--ivory-deep); }
.section-head { margin-bottom: clamp(2.5rem, 6vw, 4.5rem); }
.section-sub { margin-top: 1.25rem; max-width: 32rem; color: var(--charcoal-soft); }

/* ---------- Services ---------- */
.services { border-top: 1px solid var(--line); }
.service {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) minmax(0, 1.1fr) 7.5rem;
  align-items: center;
  gap: clamp(1rem, 3vw, 3rem);
  padding-block: clamp(1.5rem, 3vw, 2.25rem);
  border-bottom: 1px solid var(--line);
}
.service-num {
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--wood);
}
.service h3 { transition: color 0.35s var(--ease), transform 0.5s var(--ease); }
.service p { color: var(--charcoal-soft); max-width: 30rem; }
.service img {
  width: 7.5rem;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  filter: saturate(0.9);
  transition: filter 0.5s var(--ease), transform 0.7s var(--ease);
}
.service:hover h3 { color: var(--green); transform: translateX(6px); }
.service:hover img { filter: none; transform: scale(1.04); }
.services-note { margin-top: 2rem; color: var(--charcoal-soft); }
.services-note a { color: var(--green); text-underline-offset: 0.2em; }

/* ---------- Work ---------- */
.work-grid { columns: 3; column-gap: clamp(1rem, 2vw, 1.75rem); }
.work-item {
  break-inside: avoid;
  margin-bottom: clamp(1.5rem, 3vw, 2.5rem);
}
.work-item a {
  display: block;
  overflow: hidden;
  background: var(--wood-light);
  cursor: zoom-in;
}
.work-item img {
  width: 100%;
  transition: transform 1.1s var(--ease), opacity 0.6s var(--ease);
}
.work-item a:hover img,
.work-item a:focus-visible img { transform: scale(1.035); }
.work-item figcaption {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  margin-top: 0.8rem;
  font-size: 0.9rem;
  color: var(--charcoal-soft);
}
.work-item figcaption::before {
  content: "";
  flex: none;
  width: 1.25rem;
  height: 1px;
  background: var(--wood);
  transform: translateY(-0.3em);
  transition: width 0.4s var(--ease);
}
.work-item:hover figcaption::before { width: 2.25rem; }

/* ---------- About ---------- */
.about {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: clamp(2.5rem, 7vw, 7rem);
  align-items: center;
}
.about-media { position: relative; padding: 0 12% 12% 0; }
.about-img-main { width: 100%; aspect-ratio: 4 / 5; object-fit: cover; }
.about-img-inset {
  position: absolute;
  right: 0; bottom: 0;
  width: 44%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: 50% 20%;
  border: 0.6rem solid var(--ivory);
}
.about-text h2 { margin-bottom: 1.75rem; font-size: clamp(2.2rem, 4.2vw, 3.4rem); }
.about-text > p:not(.eyebrow) { color: var(--charcoal-soft); max-width: 34rem; }
.about-text > p + p { margin-top: 1rem; }

.facts { margin-top: 2.5rem; border-top: 1px solid var(--line); }
.facts > div {
  display: grid;
  grid-template-columns: 9.5rem 1fr;
  gap: 1rem;
  padding-block: 0.9rem;
  border-bottom: 1px solid var(--line);
}
dt {
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--charcoal-soft);
  padding-top: 0.3em;
}

/* ---------- Testimonials ---------- */
.quotes {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr));
  gap: clamp(2rem, 4vw, 4rem);
}
.quote { max-width: 40rem; padding-top: 1.5rem; border-top: 1px solid var(--charcoal); }
.quote blockquote { margin: 0; }
.quote blockquote p {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.2vw, 1.8rem);
  font-style: italic;
  line-height: 1.35;
}
.quote figcaption { margin-top: 1.25rem; font-size: 0.9rem; font-weight: 500; }
.quote figcaption span:not(.placeholder) { display: block; font-weight: 400; color: var(--charcoal-soft); }
.quote-placeholder { border-top-style: dashed; border-top-color: var(--wood); }

/* ---------- Contact ---------- */
.contact { background: var(--charcoal); color: var(--ivory); }
.contact .eyebrow { color: var(--wood-light); }
.contact-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.05fr);
  gap: clamp(2.5rem, 7vw, 7rem);
  align-items: start;
}
.contact-info > p:not(.eyebrow) { margin-top: 1.5rem; max-width: 28rem; color: rgba(245, 241, 232, 0.75); }
.contact-list { margin-top: 2.75rem; }
.contact-list > div { padding-block: 1.1rem; border-top: 1px solid rgba(245, 241, 232, 0.16); }
.contact-list dt { color: rgba(245, 241, 232, 0.6); padding: 0 0 0.35rem; }
.contact-phone {
  font-family: var(--serif);
  font-size: clamp(2.2rem, 4.5vw, 3.25rem);
  line-height: 1.1;
  text-decoration: none;
  transition: color 0.35s var(--ease);
}
.contact-phone:hover { color: var(--wood-light); }
.contact-link { text-underline-offset: 0.25em; text-decoration-color: rgba(245, 241, 232, 0.4); overflow-wrap: anywhere; transition: color 0.35s var(--ease); }
.contact-link:hover { color: var(--wood-light); }
.contact .placeholder { color: var(--wood-light); }

.enquiry {
  display: grid;
  gap: 1.4rem;
  padding: clamp(1.5rem, 4vw, 3rem);
  background: var(--ivory);
  color: var(--charcoal);
}
@media (min-width: 60.01rem) {
  .enquiry { margin-top: -3.5rem; }
}
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 1.4rem; }
.field label {
  display: block;
  margin-bottom: 0.4rem;
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--charcoal-soft);
}
.optional { font-weight: 400; letter-spacing: 0.04em; text-transform: none; }
.field input,
.field select,
.field textarea {
  width: 100%;
  padding: 0.7rem 0;
  border: 0;
  border-bottom: 1px solid rgba(35, 37, 34, 0.35);
  border-radius: 0;
  background: transparent;
  color: inherit;
  font: inherit;
  transition: border-color 0.3s var(--ease);
}
.field textarea { resize: vertical; min-height: 7rem; }
.field input:focus,
.field select:focus,
.field textarea:focus { outline: none; border-bottom-color: var(--green); box-shadow: 0 1px 0 var(--green); }
.field [aria-invalid="true"] { border-bottom-color: #9a3b2c; }
.enquiry .btn { justify-self: start; margin-top: 0.5rem; }
.hp { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }
.form-status { min-height: 1.5em; font-size: 0.95rem; }
.form-status.is-error { color: #9a3b2c; }
.form-status.is-ok { color: var(--green); }
.form-status a { color: inherit; font-weight: 600; }

/* ---------- Footer ---------- */
.site-footer {
  background: var(--charcoal);
  color: rgba(245, 241, 232, 0.7);
  font-size: 0.9rem;
  border-top: 1px solid rgba(245, 241, 232, 0.16);
}
.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 2rem;
  padding-block: 3rem;
}
.footer-name { font-family: var(--serif); font-size: 1.5rem; color: var(--ivory); margin-bottom: 0.25rem; }
.site-footer a { text-decoration: none; transition: color 0.3s var(--ease); }
.site-footer a:hover { color: var(--ivory); }
.site-footer nav ul { display: flex; flex-wrap: wrap; gap: 0.5rem 1.75rem; }
.footer-legal { grid-column: 1 / -1; font-size: 0.8rem; line-height: 1.8; color: rgba(245, 241, 232, 0.5); }

/* ---------- Lightbox ---------- */
.lightbox {
  width: 100vw; height: 100vh;
  max-width: none; max-height: none;
  margin: 0; padding: clamp(1rem, 4vw, 3rem);
  border: 0;
  background: rgba(24, 26, 23, 0.96);
  color: var(--ivory);
}
.lightbox[open] { display: grid; place-items: center; animation: fade-in 0.35s var(--ease); }
.lightbox::backdrop { background: transparent; }
.lightbox figure { display: grid; gap: 0.9rem; justify-items: center; }
.lightbox img { max-height: calc(100vh - 9rem); width: auto; object-fit: contain; }
.lightbox figcaption { font-size: 0.9rem; color: rgba(245, 241, 232, 0.75); }
.lightbox-close {
  position: absolute;
  top: 1rem; right: 1.25rem;
  min-height: 2.75rem;
  padding: 0 0.5rem;
  background: none; border: 0;
  color: var(--ivory);
  font: 500 0.78rem/1 var(--sans);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  cursor: pointer;
}
@keyframes fade-in { from { opacity: 0; } to { opacity: 1; } }

/* ---------- Scroll reveal (only when JS is running) ---------- */
.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.9s var(--ease), transform 0.9s var(--ease);
}
.js .reveal.is-visible { opacity: 1; transform: none; }

/* ---------- Responsive ---------- */
@media (max-width: 60rem) {
  .work-grid { columns: 2; }
  .about, .contact-grid { grid-template-columns: 1fr; }
  .about-media { max-width: 34rem; }
  .service { grid-template-columns: 2.5rem minmax(0, 1fr) 6rem; }
  .service p { grid-column: 2 / 3; grid-row: 2; }
  .service img { grid-row: 1 / 3; grid-column: 3; width: 6rem; }
  .service h3 { align-self: end; }
  .service p { align-self: start; }
  .service { row-gap: 0.4rem; }
}

@media (max-width: 52rem) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: fixed;
    inset: 6.25rem 0 0 0;
    background: var(--ivory);
    color: var(--charcoal);
    padding: 2rem var(--gutter) 3rem;
    overflow-y: auto;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.35s var(--ease), visibility 0.35s;
  }
  .is-open .site-nav { opacity: 1; visibility: visible; }
  .site-nav ul { flex-direction: column; align-items: stretch; gap: 0; }
  .site-nav li { border-bottom: 1px solid var(--line); }
  .site-nav a:not(.nav-cta) {
    display: block;
    padding: 1.1rem 0;
    font-family: var(--serif);
    font-size: 2rem;
    letter-spacing: 0;
    text-transform: none;
  }
  .site-nav a:not(.nav-cta)::after { display: none; }
  .site-nav li:last-child { border: 0; margin-top: 2rem; }
  .site-nav .nav-cta { display: block; padding: 1.1rem; text-align: center; background: var(--green); border-color: var(--green); color: var(--ivory); }
}

@media (max-width: 36rem) {
  body { font-size: 1rem; }
  .brand-name { font-size: 2.2rem; }
  .brand-sub { font-size: 0.7rem; letter-spacing: 0.18em; }
  .hero-actions .btn { width: 100%; }
  .work-grid { columns: 1; }
  .field-row { grid-template-columns: 1fr; }
  .service { grid-template-columns: 2rem minmax(0, 1fr); }
  .service img { display: none; }
  .facts > div { grid-template-columns: 1fr; gap: 0.15rem; }
  .footer-inner { grid-template-columns: 1fr; }
  .enquiry .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
  .js .reveal { opacity: 1; transform: none; }
}
