/* ============================================
   KAP Joinery — Main Stylesheet
   Dark theme with warm amber/gold accents
   ============================================ */

/* --- CSS Variables --- */
:root {
  --bg: #101010;
  --card-bg: #1a1a1a;
  --card-bg-alt: #2a2a2a;
  --accent: #D4A843;
  --accent-dark: #8B6914;
  --text: #eeeeee;
  --text-muted: #aaaaaa;
  --glow: rgba(212, 168, 67, 0.3);
  --glow-strong: rgba(212, 168, 67, 0.6);
  --glow-intense: rgba(212, 168, 67, 0.8);
  --font-heading: 'Work Sans', sans-serif;
  --font-body: 'Open Sans', sans-serif;
}

/* --- Reset & Base --- */
*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  font-size: 18px;
  line-height: 1.6;
  color: var(--text);
  background-color: var(--bg);
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: color 0.3s ease;
}

a:hover {
  color: var(--text);
}

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

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 800;
  text-transform: uppercase;
  letter-spacing: -2px;
  line-height: 1.1;
}

h1 { font-size: clamp(60px, 10vw, 160px); }
h2 { font-size: clamp(32px, 5vw, 56px); margin-bottom: 20px; }
h3 { font-size: clamp(22px, 3vw, 30px); margin-bottom: 10px; }

/* --- Section Divider --- */
.divider {
  width: 100%;
  height: 5px;
  background: linear-gradient(90deg, var(--accent), var(--accent-dark));
  border-radius: 50px;
  margin: 0;
}

/* --- Container --- */
.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 20px;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 1000;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.85) 0%, transparent 100%);
  padding: 20px 0;
  transition: background 0.3s ease;
}

.nav.scrolled {
  background: rgba(16, 16, 16, 0.95);
  backdrop-filter: blur(10px);
  padding: 12px 0;
}

.nav .container {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.nav-logo {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 24px;
  text-transform: uppercase;
  letter-spacing: -1px;
}

.nav-logo .kap {
  color: var(--accent);
}

.nav-logo .joinery {
  color: var(--text);
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 30px;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 800;
  text-transform: uppercase;
  color: var(--text);
  position: relative;
  padding-bottom: 4px;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 0;
  height: 2px;
  background-color: var(--accent);
  transition: width 0.3s ease;
}

.nav-links a:hover {
  color: var(--accent);
}

.nav-links a:hover::after {
  width: 100%;
}

/* Hamburger */
.hamburger {
  display: none;
  flex-direction: column;
  cursor: pointer;
  gap: 5px;
}

.hamburger span {
  width: 25px;
  height: 3px;
  background-color: var(--text);
  border-radius: 2px;
  transition: all 0.3s ease;
}

.hamburger.active span:nth-child(1) {
  transform: rotate(45deg) translate(5px, 6px);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: rotate(-45deg) translate(5px, -6px);
}

/* --- Hero Section --- */
.hero {
  position: relative;
  height: 100vh;
  min-height: 600px;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  overflow: hidden;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background: url('../images/hero/hero.jpg') center/cover no-repeat;
  filter: brightness(0.3);
  z-index: 0;
}

.hero-content {
  position: relative;
  z-index: 1;
  padding: 0 20px;
}

.hero-title .kap {
  display: block;
  color: var(--accent);
  text-shadow: 0 0 40px var(--glow), 0 0 80px var(--glow);
}

.hero-title .joinery {
  display: block;
  color: var(--accent-dark);
  text-shadow: 0 0 30px rgba(139, 105, 20, 0.3);
}

.hero-tagline {
  font-size: clamp(18px, 2.5vw, 24px);
  color: var(--text-muted);
  margin-top: 20px;
  margin-bottom: 40px;
  font-weight: 400;
}

/* --- CTA Button --- */
.cta-btn {
  display: inline-block;
  padding: 16px 40px;
  background: var(--accent);
  color: var(--bg);
  font-family: var(--font-body);
  font-size: 16px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  border: 2px solid var(--accent);
  border-radius: 4px;
  cursor: pointer;
  transition: all 0.3s ease;
}

.cta-btn:hover {
  background: transparent;
  color: var(--accent);
  box-shadow: 0 0 20px var(--glow);
}

/* --- Sections --- */
section {
  padding: 80px 0;
}

.section-header {
  text-align: center;
  margin-bottom: 60px;
}

.section-header h2 {
  color: var(--text);
}

.section-header p {
  color: var(--text-muted);
  max-width: 600px;
  margin: 0 auto;
  font-size: 20px;
}

/* --- Services Grid --- */
.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 20px;
}

.service-card {
  background: var(--card-bg);
  padding: 30px 20px;
  border-radius: 8px;
  text-align: center;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.service-card:hover {
  transform: scale(1.05);
  box-shadow: 0px 6px 15px var(--glow-strong);
}

.service-card .icon {
  font-size: 48px;
  margin-bottom: 15px;
}

.service-card h3 {
  color: var(--accent);
  margin-bottom: 10px;
  letter-spacing: 0;
}

.service-card p {
  color: var(--text-muted);
  font-size: 16px;
}

/* --- Testimonials --- */
.testimonials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: 20px;
}

.testimonial-card {
  background: var(--card-bg-alt);
  padding: 30px 20px;
  border-radius: 10px;
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.testimonial-card:hover {
  transform: translateY(-5px);
  box-shadow: 0px 10px 25px var(--glow);
}

.testimonial-card::before {
  content: '\201C';
  position: absolute;
  top: 10px;
  left: 15px;
  font-size: 50px;
  color: var(--accent);
  opacity: 0.15;
  font-family: serif;
  line-height: 1;
}

.testimonial-card p {
  font-style: italic;
  color: var(--text-muted);
  margin-bottom: 15px;
}

.testimonial-card .name {
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  font-size: 14px;
  padding-bottom: 5px;
  border-bottom: 2px solid var(--accent);
  display: inline-block;
}

/* --- About / Why Choose Us --- */
.about-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
  align-items: center;
}

.about-content .text p {
  color: var(--text-muted);
  margin-bottom: 15px;
  font-size: 18px;
}

.about-content .image-placeholder {
  background: var(--card-bg);
  border-radius: 8px;
  height: 350px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  border: 1px solid #333;
}

/* --- Gallery Grid --- */
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 20px;
}

.gallery-item {
  position: relative;
  overflow: hidden;
  border-radius: 8px;
  border: 1px solid #333;
  cursor: pointer;
  box-shadow: 0px 15px 30px var(--glow);
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.gallery-item:hover {
  transform: scale(1.05);
  box-shadow: 0px 15px 30px var(--glow-intense);
}

.gallery-item img {
  width: 100%;
  height: 250px;
  object-fit: cover;
  display: block;
}

.gallery-item .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  transition: opacity 0.3s ease;
}

.gallery-item:hover .overlay {
  opacity: 1;
}

.gallery-item .overlay span {
  color: var(--accent);
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 14px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

/* --- Lightbox --- */
.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 2000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.lightbox.active {
  opacity: 1;
  visibility: visible;
}

.lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  border-radius: 4px;
}

.lightbox-close {
  position: absolute;
  top: 20px;
  right: 30px;
  font-size: 36px;
  color: var(--text);
  cursor: pointer;
  transition: color 0.3s ease;
  background: none;
  border: none;
  font-family: var(--font-body);
}

.lightbox-close:hover {
  color: var(--accent);
}

.lightbox-prev,
.lightbox-next {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 36px;
  color: var(--text);
  cursor: pointer;
  background: none;
  border: none;
  padding: 10px;
  transition: color 0.3s ease;
}

.lightbox-prev { left: 20px; }
.lightbox-next { right: 20px; }

.lightbox-prev:hover,
.lightbox-next:hover {
  color: var(--accent);
}

/* --- Contact Page --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 40px;
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.contact-form label {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
}

.contact-form input,
.contact-form select,
.contact-form textarea {
  width: 100%;
  padding: 12px 15px;
  background: var(--card-bg);
  border: 1px solid #333;
  border-radius: 4px;
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  transition: border-color 0.3s ease;
}

.contact-form input:focus,
.contact-form select:focus,
.contact-form textarea:focus {
  outline: none;
  border-color: var(--accent);
}

.contact-form textarea {
  min-height: 150px;
  resize: vertical;
}

.contact-details h3 {
  color: var(--accent);
  margin-bottom: 20px;
  letter-spacing: 0;
}

.contact-details .detail {
  margin-bottom: 20px;
}

.contact-details .detail-label {
  font-size: 14px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 1px;
  color: var(--text-muted);
  margin-bottom: 5px;
}

.contact-details .detail-value {
  font-size: 18px;
  color: var(--text);
}

.contact-details .detail-value a {
  color: var(--accent);
}

.map-container {
  margin-top: 30px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid #333;
}

.map-container iframe {
  width: 100%;
  height: 250px;
  border: 0;
  filter: grayscale(1) invert(0.9) contrast(1.2);
}

/* --- Footer --- */
.footer {
  background: var(--card-bg);
  padding: 40px 0;
  text-align: center;
  border-top: 1px solid #222;
}

.footer p {
  color: var(--text-muted);
  font-size: 14px;
}

.footer a {
  color: var(--accent);
}

/* --- Responsive --- */

/* Tablet */
@media (max-width: 1024px) {
  .about-content {
    grid-template-columns: 1fr;
  }

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

/* Mobile */
@media (max-width: 768px) {
  .nav-links {
    position: fixed;
    top: 0;
    right: -100%;
    width: 70%;
    height: 100vh;
    background: rgba(16, 16, 16, 0.98);
    flex-direction: column;
    padding: 80px 30px;
    transition: right 0.3s ease;
  }

  .nav-links.active {
    right: 0;
  }

  .hamburger {
    display: flex;
  }

  section {
    padding: 60px 0;
  }

  .hero {
    min-height: 500px;
  }

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

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

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

/* Small mobile */
@media (max-width: 375px) {
  body {
    font-size: 16px;
  }

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

  .cta-btn {
    padding: 14px 30px;
    font-size: 14px;
  }
}
