/* ============================================
   Signature Carpentry — Modern Stylesheet
   ============================================ */

/* --- Design Tokens --- */
:root {
  --color-text: #232323;
  --color-bg: #ffffff;
  --color-dark: #232323;
  --color-dark-alt: #444444;
  --color-accent: #a62a00;
  --color-accent-hov: #5a1700;
  --color-info: #3e97d1;
  --color-muted: #777777;
  --color-border: #e5e5e5;
  --overlay-dark: rgba(35, 35, 35, 0.55);
  --overlay-darker: rgba(35, 35, 35, 0.7);

  --font-body: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-heading: "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;

  --size-hero: clamp(2.5rem, 6vw, 4.5rem);
  --size-h2: clamp(1.75rem, 3vw, 2.25rem);
  --size-h3: clamp(1.15rem, 2vw, 1.4rem);
  --size-body: clamp(1rem, 1.1vw, 1.0625rem);
  --size-small: 0.8rem;

  --container-max: 1200px;
  --nav-h: 5rem;
  --radius: 4px;
  --ease: cubic-bezier(.2, .8, .2, 1);
  --shadow-sm: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-md: 0 6px 24px rgba(0, 0, 0, 0.12);
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; scroll-padding-top: var(--nav-h); }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--size-body);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: 0; background: none; }
h1, h2, h3, h4, h5, h6 { font-family: var(--font-heading); font-weight: 700; line-height: 1.2; margin: 0 0 0.5em; }

/* --- Utilities --- */
.container {
  width: min(var(--container-max), 100% - 2rem);
  margin-inline: auto;
}
.container-wide { width: 100%; margin-inline: auto; }
.text-center { text-align: center; }
.visually-hidden {
  position: absolute; width: 1px; height: 1px;
  padding: 0; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: -999px; top: 0; z-index: 9999;
  background: var(--color-dark); color: #fff;
  padding: 0.75rem 1rem;
}
.skip-link:focus { left: 0; }

/* --- Section title + underline --- */
.section-title {
  font-size: var(--size-h2);
  text-transform: uppercase;
  letter-spacing: 0.03em;
  text-align: center;
  margin-bottom: 0.5rem;
}
.section-subtitle {
  font-size: var(--size-h3);
  font-weight: 300;
  text-align: center;
  max-width: 800px;
  margin: 1rem auto 3rem;
  color: var(--color-text);
}
.underline {
  width: 60px; height: 3px;
  background: var(--color-accent);
  margin: 0.75rem auto;
}

/* --- Buttons --- */
.btn {
  display: inline-block;
  padding: 0.85rem 1.75rem;
  font-size: var(--size-small);
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  border-radius: var(--radius);
  transition: background .2s var(--ease), color .2s var(--ease), transform .2s var(--ease);
  cursor: pointer;
  border: 2px solid transparent;
  text-align: center;
}
.btn-primary { background: var(--color-dark); color: #fff; }
.btn-primary:hover { background: #000; }
.btn-accent { background: var(--color-accent); color: #fff; }
.btn-accent:hover { background: var(--color-accent-hov); }
.btn-outline-white { border-color: #fff; color: #fff; background: transparent; }
.btn-outline-white:hover { background: #fff; color: var(--color-dark); }
.btn-outline-dark { border-color: var(--color-dark); color: var(--color-dark); background: transparent; }
.btn-outline-dark:hover { background: var(--color-dark); color: #fff; }

/* --- Header / Nav --- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  background: rgba(35, 35, 35, 0.95);
  backdrop-filter: blur(6px);
  height: var(--nav-h);
  transition: background .3s var(--ease);
}
.nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
  padding: 0 1.5rem;
  max-width: 1400px;
  margin: 0 auto;
}
.nav-logo img {
  height: 3.5rem;
  width: auto;
}
.nav-menu {
  display: flex;
  align-items: center;
  gap: 2rem;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-link {
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.5rem 0;
  transition: color .2s var(--ease);
  position: relative;
}
.nav-link::after {
  content: "";
  position: absolute;
  left: 0; bottom: 0;
  width: 0; height: 2px;
  background: var(--color-accent);
  transition: width .3s var(--ease);
}
.nav-link:hover::after,
.nav-link[aria-current="page"]::after { width: 100%; }
.nav-cta {
  background: var(--color-accent);
  color: #fff;
  padding: 0.65rem 1.25rem;
  border-radius: var(--radius);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  transition: background .2s var(--ease);
}
.nav-cta:hover { background: var(--color-accent-hov); }

/* Hamburger */
.nav-toggle {
  display: none;
  width: 2.5rem; height: 2.5rem;
  position: relative;
  z-index: 1100;
}
.nav-toggle span {
  display: block;
  position: absolute;
  left: 0.5rem;
  width: 1.5rem; height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .3s var(--ease), opacity .2s var(--ease), top .3s var(--ease);
}
.nav-toggle span:nth-child(1) { top: 0.85rem; }
.nav-toggle span:nth-child(2) { top: 1.2rem; }
.nav-toggle span:nth-child(3) { top: 1.55rem; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { top: 1.2rem; transform: rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { top: 1.2rem; transform: rotate(-45deg); }

@media (max-width: 992px) {
  .nav-toggle { display: block; }
  .nav-menu {
    position: fixed;
    inset: var(--nav-h) 0 0 0;
    flex-direction: column;
    justify-content: center;
    background: rgba(35, 35, 35, 0.98);
    gap: 1.5rem;
    transform: translateX(100%);
    transition: transform .35s var(--ease);
  }
  .nav-menu.is-open { transform: translateX(0); }
  .nav-cta-wrap {
    position: fixed;
    bottom: 2rem;
    left: 0; right: 0;
    text-align: center;
    transform: translateX(100%);
    transition: transform .35s var(--ease);
  }
  .nav-cta-wrap.is-open { transform: translateX(0); }
}

/* --- Hero --- */
.hero {
  position: relative;
  min-height: 100vh;
  display: grid;
  place-items: center;
  color: #fff;
  text-align: center;
  overflow: hidden;
  padding: var(--nav-h) 1rem 0;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background: url("../images/de713b32bd9123e121e6c1c845ebe4b1-2000x2667.jpg") center/cover no-repeat;
  z-index: -2;
}
@media (min-width: 992px) {
  .hero-bg { background-attachment: fixed; }
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--overlay-dark);
  z-index: -1;
}
.hero-content {
  position: relative;
  max-width: 900px;
  background: rgba(255, 255, 255, 0.92);
  color: var(--color-dark);
  padding: clamp(2.5rem, 6vw, 4rem) clamp(2rem, 6vw, 4.5rem);
  border-radius: var(--radius);
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}
.hero-content::before {
  content: "";
  position: absolute;
  inset: 0.75rem;
  border: 2px solid var(--color-dark);
  border-radius: 2px;
  pointer-events: none;
}
.hero-title {
  font-family: var(--font-heading);
  font-size: var(--size-hero);
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.03em;
  line-height: 1.1;
  margin-bottom: 1.25rem;
  color: var(--color-dark);
}
.hero-tagline {
  font-family: var(--font-heading);
  font-size: clamp(0.95rem, 1.2vw, 1.1rem);
  text-transform: uppercase;
  letter-spacing: 0.15em;
  font-weight: 400;
  color: var(--color-text);
  margin: 0;
}
.hero-arrow {
  position: absolute;
  bottom: 2rem;
  left: 50%;
  transform: translateX(-50%);
  color: #fff;
  font-size: 1.5rem;
  animation: bounce 2s infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateX(-50%) translateY(0); }
  50% { transform: translateX(-50%) translateY(0.5rem); }
}

/* --- Process Cards --- */
.process {
  padding: 5rem 0;
}
.process-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 2.5rem;
  margin-top: 3rem;
}
.process-card {
  text-align: center;
  padding: 0 1rem;
}
.process-icon-wrap {
  position: relative;
  width: 80px; height: 80px;
  margin: 0 auto 1.5rem;
  border-radius: 50%;
  background: var(--color-dark-alt);
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 2rem;
}
.process-num {
  position: absolute;
  right: -8px; bottom: -8px;
  width: 28px; height: 28px;
  border-radius: 50%;
  background: var(--color-dark-alt);
  border: 3px solid #fff;
  font-size: 0.8rem;
  display: grid;
  place-items: center;
  font-weight: 700;
}
.process-card h3 {
  font-size: 1.1rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 0.75rem;
}
.process-card p {
  color: var(--color-muted);
  font-size: 0.95rem;
  margin: 0;
}

/* --- CTA Band (parallax) --- */
.cta-band {
  position: relative;
  padding: 5rem 1rem;
  color: #fff;
  text-align: center;
  overflow: hidden;
}
.cta-band-bg {
  position: absolute; inset: 0;
  background: url("../images/2b80551981d5e4e88b2b7e47b0211ffe-1680x2240.jpg") center/cover no-repeat;
  z-index: -2;
}
@media (min-width: 992px) {
  .cta-band-bg { background-attachment: fixed; }
}
.cta-band::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--overlay-darker);
  z-index: -1;
}
.cta-band-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 2rem;
  align-items: center;
  justify-content: center;
}
.cta-band h2 {
  font-size: var(--size-h2);
  text-transform: uppercase;
  margin: 0;
  flex: 1 1 400px;
}
.cta-band .btn {
  flex-shrink: 0;
}

/* --- Team --- */
.team {
  padding: 5rem 0;
  background: #fff;
}
.team-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: 2rem;
  max-width: 1000px;
  margin: 3rem auto 0;
}
.team-card {
  text-align: center;
  cursor: pointer;
  transition: transform .3s var(--ease);
}
.team-card:hover { transform: translateY(-6px); }
.team-photo {
  aspect-ratio: 1 / 1;
  width: 100%;
  border-radius: 50%;
  object-fit: cover;
  object-position: center top;
  box-shadow: var(--shadow-sm);
  transition: box-shadow .3s var(--ease);
}
.team-card:hover .team-photo {
  box-shadow: var(--shadow-md);
}
.team-name {
  font-size: 1.25rem;
  margin: 1.25rem 0 0.25rem;
}
.team-role {
  color: var(--color-muted);
  font-size: 0.95rem;
  margin: 0;
}
.team-role a {
  color: var(--color-accent);
  text-decoration: underline;
}

/* --- Team Bio Dialog --- */
dialog.bio-modal {
  border: 0;
  border-radius: 8px;
  padding: 0;
  max-width: 560px;
  width: 90%;
  box-shadow: var(--shadow-md);
}
dialog.bio-modal::backdrop {
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: blur(2px);
}
.bio-modal-inner {
  padding: 2.5rem;
  position: relative;
}
.bio-modal h3 {
  font-size: 1.5rem;
  margin-bottom: 0.25rem;
  text-transform: uppercase;
}
.bio-modal .bio-role {
  color: var(--color-accent);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}
.bio-modal p {
  line-height: 1.7;
  color: var(--color-text);
}
.bio-modal a {
  color: var(--color-accent);
  text-decoration: underline;
}
.bio-close {
  position: absolute;
  top: 0.75rem; right: 0.75rem;
  width: 2.25rem; height: 2.25rem;
  border-radius: 50%;
  font-size: 1.25rem;
  color: var(--color-muted);
  transition: background .2s var(--ease);
}
.bio-close:hover { background: var(--color-border); color: var(--color-dark); }

/* --- Service Sections (split) --- */
.service {
  display: grid;
  grid-template-columns: 1fr 1fr;
  align-items: stretch;
  min-height: 420px;
}
.service-dark { background: var(--color-dark); color: #fff; }
.service-light { background: #fff; color: var(--color-text); }
.service-content {
  padding: 4rem clamp(1.5rem, 5vw, 4rem);
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.service-content h2 {
  font-size: var(--size-h2);
  text-transform: uppercase;
  margin-bottom: 1.5rem;
}
.service-content h2 a {
  border-bottom: 2px solid transparent;
  transition: border-color .2s var(--ease);
}
.service-content h2 a:hover { border-color: var(--color-accent); }
.service-content p {
  font-size: 1rem;
  line-height: 1.7;
  margin: 0;
  font-weight: 300;
}
.service-image {
  background-size: cover;
  background-position: center;
  min-height: 300px;
}
.service-image a {
  display: block;
  width: 100%;
  height: 100%;
}
.service-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.service-reverse .service-content { order: 2; }
.service-reverse .service-image { order: 1; }

@media (max-width: 768px) {
  .service { grid-template-columns: 1fr; }
  .service-reverse .service-content { order: initial; }
  .service-reverse .service-image { order: initial; }
  .service-image { min-height: 250px; }
}

/* --- Contact Section --- */
.contact-section {
  padding: 5rem 0;
  background: #fafafa;
}
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3rem;
  margin-top: 3rem;
}
@media (max-width: 768px) {
  .contact-grid { grid-template-columns: 1fr; }
}
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
}
.contact-form input,
.contact-form textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  font: inherit;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  background: #fff;
  transition: border-color .2s var(--ease), box-shadow .2s var(--ease);
}
.contact-form input:focus,
.contact-form textarea:focus {
  outline: 0;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(166, 42, 0, 0.12);
}
.contact-form textarea { min-height: 160px; resize: vertical; }
.form-alert {
  padding: 0.85rem 1rem;
  border-radius: var(--radius);
  font-size: 0.95rem;
}
.form-alert.success { background: #d4edda; color: #155724; }
.form-alert.error { background: #f8d7da; color: #721c24; }
.contact-info {
  text-align: center;
  margin-bottom: 1rem;
}
.contact-info p {
  color: var(--color-text);
  font-size: 1.05rem;
  margin: 0.25rem 0;
}
.contact-info strong { display: block; margin-top: 1rem; }
.google-map {
  width: 100%;
  height: 100%;
  min-height: 400px;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}
.google-map iframe {
  width: 100%;
  height: 100%;
  min-height: 400px;
  border: 0;
  display: block;
}

/* --- Call/Email buttons band --- */
.action-band {
  padding: 3rem 0;
  text-align: center;
  background: #fff;
}
.action-band .btn { margin: 0.35rem; }

/* --- Footer --- */
.site-footer {
  background: var(--color-dark);
  color: #fff;
  padding: 2.5rem 1rem;
}
.footer-inner {
  max-width: var(--container-max);
  margin: 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: center;
  justify-content: space-between;
}
.footer-copy { margin: 0; font-size: 0.95rem; }
.footer-social {
  display: flex;
  gap: 1rem;
  list-style: none;
  padding: 0; margin: 0;
}
.footer-social a {
  display: grid;
  place-items: center;
  width: 2.5rem; height: 2.5rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.footer-social a:hover {
  background: var(--color-accent);
  transform: translateY(-3px);
}
.footer-social svg { width: 1rem; height: 1rem; fill: currentColor; }

/* --- Page Header (for inner pages) --- */
.page-header {
  position: relative;
  padding: 8rem 1rem 5rem;
  min-height: 40vh;
  display: grid;
  place-items: center;
  color: #fff;
  text-align: center;
  overflow: hidden;
}
.page-header-bg {
  position: absolute; inset: 0;
  background-size: cover;
  background-position: center;
  z-index: -2;
}
.page-header::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--overlay-darker);
  z-index: -1;
}
.page-header h1 {
  font-size: var(--size-hero);
  text-transform: uppercase;
  margin-bottom: 1rem;
}
.page-header p {
  font-size: var(--size-h3);
  font-weight: 300;
  max-width: 700px;
  margin: 0 auto;
}

/* --- Reviews Carousel (projects.php) --- */
.reviews {
  position: relative;
  padding: 5rem 1rem;
  color: #fff;
  overflow: hidden;
}
.reviews-bg {
  position: absolute; inset: 0;
  background: url("../images/de713b32bd9123e121e6c1c845ebe4b1-2000x2667.jpg") center/cover no-repeat;
  z-index: -2;
}
.reviews::before {
  content: "";
  position: absolute; inset: 0;
  background: var(--overlay-darker);
  z-index: -1;
}
.reviews-track {
  display: flex;
  scroll-snap-type: x mandatory;
  overflow-x: auto;
  scroll-behavior: smooth;
  scrollbar-width: none;
  max-width: 900px;
  margin: 0 auto;
}
.reviews-track::-webkit-scrollbar { display: none; }
.review-slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  padding: 2rem 1rem;
  text-align: center;
}
.review-photo {
  width: 120px; height: 120px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 1.5rem;
  border: 4px solid var(--color-accent);
  box-shadow: var(--shadow-md);
}
.review-text {
  font-size: 1.1rem;
  line-height: 1.7;
  font-style: italic;
  max-width: 700px;
  margin: 0 auto 1.5rem;
}
.review-author {
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-size: 0.9rem;
}
.reviews-controls {
  display: flex;
  justify-content: center;
  gap: 1rem;
  margin-top: 1.5rem;
}
.reviews-btn {
  width: 3rem; height: 3rem;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.15);
  color: #fff;
  font-size: 1.25rem;
  transition: background .2s var(--ease);
}
.reviews-btn:hover { background: var(--color-accent); }

/* --- Project Category Cards --- */
.projects-overview {
  padding: 5rem 0;
  background: #fff;
}
.projects-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 2rem;
  margin-top: 3rem;
}
.project-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .3s var(--ease), box-shadow .3s var(--ease);
  background: #fff;
}
.project-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-md);
}
.project-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
}
.project-card-body {
  padding: 1.5rem;
  text-align: center;
}
.project-card h3 {
  font-size: 1.25rem;
  text-transform: uppercase;
  margin-bottom: 0.5rem;
}
.project-card .underline { margin-bottom: 1.5rem; }

/* --- Gallery (category pages) --- */
.gallery {
  padding: 4rem 0;
}
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1rem;
}
.gallery-item {
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  aspect-ratio: 4 / 3;
  position: relative;
}
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s var(--ease);
}
.gallery-item:hover img { transform: scale(1.05); }
.gallery-empty {
  text-align: center;
  padding: 4rem 1rem;
  color: var(--color-muted);
  font-size: 1.25rem;
}

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity .7s var(--ease), transform .7s var(--ease);
}
.reveal.in-view {
  opacity: 1;
  transform: none;
}

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