:root {
  --orange-left: #ed872d;
  --yellow: #f2f447;
  --green: #00c788;
  --brown: #b45212;
  --orange-tile: #ed872d;
  --orange-tile-contrast: #e4822b;
  --text: #111;
  --focus: #003f8f;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: #fff;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  line-height: 1.5;
}

body.dialog-open {
  overflow: hidden;
}

a {
  text-decoration: none;
}

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

.skip-link {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 10000;
  padding: 10px 14px;
  border-radius: 8px;
  color: #fff;
  background: #111;
  font-weight: 800;
  transform: translateY(-160%);
}

.skip-link:focus {
  transform: translateY(0);
}

.hero {
  display: grid;
  grid-template-columns: 38% 62%;
  min-height: 448px;
  height: 54.4vh;
}

.brand {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 38px 28px;
  background: var(--orange-left);
  text-align: center;
}

.logo {
  display: block;
  width: clamp(240px, 82%, 560px);
  margin-right: auto;
  margin-left: auto;
}

.logo img {
  display: block;
  width: 100%;
  height: auto;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 10px;
}

.button-link {
  display: inline-block;
  padding: 11px 16px;
  border: 2px solid #111;
  border-radius: 10px;
  color: #fff;
  background: #111;
  font-weight: 800;
  text-decoration: none;
}

.button-link:hover {
  filter: brightness(1.15);
}

.button-link-secondary {
  color: #111;
  background: transparent;
}

.menu {
  position: absolute;
  top: 20px;
  right: 20px;
  z-index: 200;
}

.menu-btn {
  width: 54px;
  height: 54px;
  padding: 0;
  border: 3px solid #111;
  border-radius: 10px;
  background: transparent;
  cursor: pointer;
}

.menu-btn span {
  display: block;
  width: 28px;
  height: 4px;
  margin: 6px auto;
  border-radius: 999px;
  background: #111;
}

.dropdown {
  position: absolute;
  top: 64px;
  right: 0;
  display: none;
  min-width: 250px;
  padding: 10px;
  border-radius: 12px;
  background: #111;
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.25);
}

.dropdown.open {
  display: block;
}

.dropdown a {
  display: block;
  padding: 12px;
  border-radius: 10px;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.02em;
  text-decoration: none;
}

.dropdown a:hover,
.dropdown a:focus-visible {
  background: rgba(255, 255, 255, 0.14);
}

.tiles {
  display: grid;
  grid-template-columns: 1fr 1fr;
  grid-template-rows: repeat(4, 1fr);
}

.tile {
  display: flex;
  align-items: center;
  justify-content: center;
  color: #111;
  font-size: clamp(1.35rem, 2.3vw, 2.5rem);
  font-weight: 900;
  text-align: center;
  text-decoration: none;
  transition: filter 0.08s ease, transform 0.08s ease;
}

.tile-garage,
.tile-entrance {
  grid-column: 1 / -1;
}

.tile-garage {
  grid-row: 1 / span 2;
  color: var(--orange-left);
  background: #111;
}

.tile-entrance {
  grid-row: 3 / span 2;
  color: #111;
  background: var(--orange-tile-contrast);
}

.tile:hover {
  filter: brightness(0.96);
}

.tile:active {
  transform: scale(0.98);
}

.kitchens,
.electrical {
  background: var(--yellow);
}

.bathrooms,
.plumbing {
  background: var(--green);
}

.garage,
.flooring {
  color: #111;
  background: var(--brown);
}

.composite,
.joinery {
  background: var(--orange-tile-contrast);
}

main {
  width: 100%;
}

.home-section {
  width: 100%;
  margin: 0;
  padding: 80px 0;
}

.home-section > * {
  max-width: 1100px;
  margin-right: auto;
  margin-left: auto;
  padding-right: 24px;
  padding-left: 24px;
}

.home-section h2 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: clamp(1.75rem, 4vw, 2.2rem);
}

.home-section p {
  max-width: 900px;
  margin-top: 0;
  margin-bottom: 18px;
  font-size: 1.125rem;
  line-height: 1.6;
}

#kitchens,
#electrical {
  background: var(--yellow);
}

#bathrooms,
#plumbing {
  background: var(--green);
}

#garage-doors,
#flooring {
  color: #111;
  background: var(--brown);
}

#composite-doors,
#joinery {
  background: var(--orange-tile);
}

#garage-doors {
  color: var(--orange-left);
  background: #111;
}

#entrance-doors {
  color: #111;
  background: var(--orange-tile-contrast);
}

#garage-doors .click-note,
#entrance-doors .click-note {
  color: inherit;
}

.contact-link {
  color: inherit;
  font-weight: 900;
}

.kitchen-quote-link {
  text-decoration: none;
}

.bathroom-quote-link {
  text-decoration: none;
}

.section-slideshow {
  position: relative;
  display: block;
  width: 60%;
  margin: 18px auto 0;
  padding: 0;
  color: inherit;
  text-decoration: none;
}

.section-slideshow img {
  display: block;
  width: 100%;
  height: 280px;
  border-radius: 18px;
  object-fit: cover;
  opacity: 1;
  transition: opacity 0.35s ease;
}

.section-slideshow img.is-fading {
  opacity: 0;
}

.section-slideshow .overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 18px;
  border-radius: 18px;
  color: #fff;
  background: rgba(0, 0, 0, 0.58);
  font-weight: 900;
  letter-spacing: 0.02em;
  opacity: 0;
  transition: opacity 0.18s ease;
}

.section-slideshow:hover .overlay,
.section-slideshow:focus-visible .overlay {
  opacity: 1;
}

.click-note {
  width: 100%;
  max-width: 900px;
  margin-top: 12px;
  text-align: center;
  font-size: 1rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

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

.page {
  padding: 28px 18px 60px;
}

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.topbar h1 {
  min-width: 0;
  margin: 0;
  font-size: clamp(1.6rem, 4.2vw, 2.2rem);
  line-height: 1.15;
}

.back {
  flex: 0 0 auto;
  display: inline-block;
  padding: 9px 14px;
  border-radius: 10px;
  color: #fff;
  background: #111;
  font-weight: 800;
  line-height: 1.2;
  text-decoration: none;
}

.back:hover {
  filter: brightness(1.15);
}

.intro {
  margin: 18px 0 24px;
  color: #222;
  line-height: 1.65;
}

.gallery-help {
  margin: 0 0 14px;
  font-weight: 700;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 16px;
}

.gallery figure {
  margin: 0;
  overflow: hidden;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 10px 25px rgba(0, 0, 0, 0.09);
}

.lightbox-trigger {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: #fff;
  cursor: zoom-in;
}

.lightbox-trigger img,
.project-link img,
.project-feature > a img {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
}

.gallery-video {
  display: block;
  width: 100%;
  height: 220px;
  object-fit: cover;
  background: #111;
}

.project-feature > a {
  display: block;
}

.lightbox-trigger:hover img {
  filter: brightness(0.92);
}

.gallery figcaption {
  padding: 12px 12px 14px;
}

.gallery figcaption strong {
  display: block;
  margin-bottom: 6px;
}

.gallery figcaption span {
  display: block;
  color: #444;
  line-height: 1.5;
}

.project-link {
  display: block;
  height: 100%;
  color: inherit;
  text-decoration: none;
}

.project-link figure {
  height: 100%;
  transition: transform 0.2s ease;
}

.project-link:hover figure,
.project-link:focus-visible figure {
  transform: translateY(-2px);
}

body.theme-kitchens,
body.theme-electrical {
  background: var(--yellow);
}

body.theme-bathrooms,
body.theme-plumbing {
  background: var(--green);
}

body.theme-garage {
  color: var(--orange-left);
  background: #111;
}

body.theme-entrance {
  color: #111;
  background: var(--orange-tile-contrast);
}

body.theme-flooring {
  color: #111;
  background: var(--brown);
}

.theme-flooring .intro,
.theme-flooring .contact-link {
  color: #111;
}

.theme-flooring .page,
.theme-flooring .page a:not(.back),
.theme-flooring .gallery figcaption span,
.theme-flooring .site-footer,
.theme-flooring .site-footer a {
  color: #111;
}

.theme-garage .intro,
.theme-garage .contact-link,
.theme-entrance .intro,
.theme-entrance .contact-link,
.theme-garage .topbar h1,
.theme-entrance .topbar h1,
.theme-garage .gallery-help,
.theme-entrance .gallery-help {
  color: inherit;
}

.theme-garage .gallery figcaption strong,
.theme-flooring .gallery figcaption strong {
  color: #111;
}

body.theme-composite,
body.theme-joinery,
body.theme-about,
body.theme-contact {
  background: var(--orange-left);
}

.topbar h1,
.intro,
.gallery-help {
  color: #111;
}

.theme-garage .topbar h1,
.theme-garage .intro,
.theme-garage .gallery-help,
.theme-garage .contact-link,
.theme-entrance .topbar h1,
.theme-entrance .intro,
.theme-entrance .gallery-help,
.theme-entrance .contact-link {
  color: inherit;
}

.theme-garage .back {
  border: 2px solid var(--orange-left);
  color: var(--orange-left);
}

.theme-entrance .gallery figcaption strong {
  color: #111;
}

.content {
  max-width: 1000px;
  margin: 0 auto;
  padding: 2rem 1.2rem 3rem;
}

.theme-about > .topbar,
.theme-contact > .topbar {
  padding: 28px 24px 10px;
}

.text-card {
  margin-bottom: 1.5rem;
  padding: 1.8rem;
  border-radius: 14px;
  color: #222;
  background: #fff;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.08);
}

.text-card h2 {
  margin-top: 0;
  color: #222;
  font-size: clamp(1.3rem, 2.5vw, 1.65rem);
}

.text-card p,
.text-card li {
  color: #333;
  font-size: 1rem;
  line-height: 1.65;
}

.about-list {
  padding-left: 1.25rem;
}

.contact-card p {
  font-size: 1.05rem;
}

.contact-card {
  font-style: normal;
}

.contact-card a {
  color: inherit;
  font-weight: 600;
}

.site-footer {
  padding: 30px 20px;
  color: #fff;
  background: #111;
  text-align: center;
}

.site-footer p {
  margin: 5px auto;
  max-width: 800px;
}

.site-footer a {
  color: #fff;
  font-weight: 700;
}

.lightbox {
  position: fixed;
  inset: 0;
  z-index: 9999;
  width: 100%;
  height: 100%;
  padding: 64px 76px 30px;
  border: 0;
  color: #fff;
  background: rgba(0, 0, 0, 0.94);
}

.lightbox.open {
  display: grid;
  place-items: center;
}

.lightbox[hidden] {
  display: none;
}

.lightbox-content {
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  align-items: center;
  width: 100%;
  height: 100%;
  margin: 0;
}

.lightbox-content img {
  display: block;
  max-width: 100%;
  max-height: calc(100vh - 150px);
  margin: auto;
  border-radius: 10px;
  object-fit: contain;
}

.lightbox-content figcaption {
  max-width: 75ch;
  margin: 12px auto 0;
  text-align: center;
}

.lightbox-nav,
.lightbox-close {
  position: absolute;
  display: grid;
  place-items: center;
  border: 2px solid rgba(255, 255, 255, 0.65);
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  cursor: pointer;
}

.lightbox-nav:hover,
.lightbox-close:hover {
  background: #333;
}

.lightbox-nav {
  top: 50%;
  width: 52px;
  height: 52px;
  font-size: 2rem;
  transform: translateY(-50%);
}

.lightbox-nav.prev {
  left: 14px;
}

.lightbox-nav.next {
  right: 14px;
}

.lightbox-close {
  top: 14px;
  right: 14px;
  width: 46px;
  height: 46px;
  font-size: 1.3rem;
}

.error-page {
  min-height: 55vh;
}

@media (max-width: 900px) {
  .hero {
    grid-template-columns: 1fr;
    height: auto;
  }

  .brand {
    min-height: 320px;
  }

  .tiles {
    min-height: 352px;
  }

  .section-slideshow {
    width: 90%;
  }
}

@media (max-width: 600px) {
  .brand {
    min-height: 288px;
    padding-right: 22px;
    padding-left: 22px;
  }

  .menu {
    top: 14px;
    right: 14px;
  }

  .menu-btn {
    width: 44px;
    height: 44px;
    border-width: 2px;
  }

  .menu-btn span {
    width: 22px;
    height: 3px;
    margin: 5px auto;
  }

  .dropdown {
    top: 54px;
    min-width: 220px;
  }

  .home-section {
    padding: 58px 0;
  }

  .section-slideshow img {
    height: 220px;
  }

  .topbar {
    align-items: flex-start;
  }

  .back {
    padding: 8px 10px;
    font-size: 0.88rem;
  }

  .lightbox {
    padding: 62px 14px 24px;
  }

  .lightbox-content img {
    max-height: calc(100vh - 190px);
  }

  .lightbox-nav {
    top: auto;
    bottom: 20px;
    width: 46px;
    height: 46px;
    transform: none;
  }
}

@media (max-width: 360px) {
  .topbar {
    flex-wrap: wrap;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
  }
}
