/* ==============================================
   CSS Variables
   ============================================== */
:root {
  --color-bg: #FAFAF8;
  --color-bg-alt: #F3F1ED;
  --color-text: #1A1A1A;
  --color-text-muted: #6B6B6B;
  --color-text-light: #999999;
  --color-accent: #B8956A;
  --color-accent-hover: #A6835B;
  --color-white: #FFFFFF;
  --color-dark: #1A1A1A;
  --color-border: rgba(0, 0, 0, 0.06);
  --color-border-strong: rgba(0, 0, 0, 0.10);
  --color-overlay: rgba(15, 15, 15, 0.55);

  --font-heading: 'Playfair Display', serif;
  --font-body: 'Inter', sans-serif;

  --text-h1: clamp(2.25rem, 5vw, 3.75rem);
  --text-h2: clamp(1.75rem, 3.5vw, 2.75rem);
  --text-h3: clamp(1.125rem, 2vw, 1.375rem);
  --text-body: clamp(0.9375rem, 1vw, 1.0625rem);
  --text-small: clamp(0.8125rem, 0.9vw, 0.875rem);
  --line-height-heading: 1.2;
  --line-height-body: 1.7;

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 1.5rem;
  --space-lg: 2rem;
  --space-xl: 3rem;
  --space-2xl: 4rem;
  --space-3xl: 6rem;
  --space-4xl: 8rem;

  --radius-sm: 0.25rem;
  --radius-md: 0.5rem;
  --radius-lg: 1rem;
  --radius-full: 9999px;

  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 16px rgba(0, 0, 0, 0.06);

  --max-width: 80rem;
  --header-height: 4.5rem;

  --transition-fast: 150ms ease;
  --transition-base: 200ms ease;
}

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

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-body);
  line-height: var(--line-height-body);
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: inherit;
  text-decoration: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font: inherit;
  color: inherit;
}

input,
textarea,
select {
  font: inherit;
  color: inherit;
}

/* ==============================================
   Typography
   ============================================== */
h1, h2, h3, h4 {
  font-family: var(--font-heading);
  font-weight: 600;
  line-height: var(--line-height-heading);
  color: var(--color-text);
}

h1 { font-size: var(--text-h1); }
h2 { font-size: var(--text-h2); }
h3 { font-size: var(--text-h3); }

p { max-width: 65ch; }

/* ==============================================
   Layout
   ============================================== */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding-left: var(--space-md);
  padding-right: var(--space-md);
}

.section {
  padding: var(--space-2xl) 0;
}

.section-alt {
  background-color: var(--color-bg-alt);
}

.section-header {
  text-align: center;
  margin-bottom: var(--space-xl);
}

#services .section-header,
#works .section-header,
#contact .section-header {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
}

#services .section-header .section-eyebrow,
#works .section-header .section-eyebrow,
#contact .section-header .section-eyebrow {
  text-align: center;
}

#services .section-header .section-title,
#works .section-header .section-title,
#services .section-header .section-subtitle,
#works .section-header .section-subtitle,
#contact .section-header .section-title,
#contact .section-header .section-subtitle {
  text-align: center;
}

.section-eyebrow {
  font-size: var(--text-small);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}

.section-title {
  margin-bottom: var(--space-sm);
}

.section-subtitle {
  color: var(--color-text-muted);
  max-width: 48ch;
  margin: 0 auto;
}

/* ==============================================
   Buttons
   ============================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-family: var(--font-body);
  font-weight: 500;
  font-size: var(--text-small);
  letter-spacing: 0.02em;
  padding: 0.75rem 1.5rem;
  border-radius: var(--radius-full);
  transition: all var(--transition-base);
  white-space: nowrap;
  min-height: 44px;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-white);
}

.btn-primary:hover {
  background-color: var(--color-accent-hover);
}

.btn-ghost {
  background-color: transparent;
  color: var(--color-white);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.btn-ghost:hover {
  background-color: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.5);
}

.btn-lg {
  padding: 0.875rem 2rem;
  font-size: var(--text-body);
}

.btn-full {
  width: 100%;
}

/* ==============================================
   Header
   ============================================== */
.header {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  z-index: 100;
  height: var(--header-height);
  transition: background-color var(--transition-base),
              border-color var(--transition-base),
              box-shadow var(--transition-base);
}

.header.scrolled {
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  box-shadow: var(--shadow-sm);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 100%;
}

.header-logo img {
  height: 40px;
  width: auto;
}

.header-logo {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
}

.header-brand-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.0625rem;
  color: var(--color-white);
  white-space: nowrap;
}

.header.scrolled .header-brand-name {
  color: var(--color-text);
}

.header-logo img {
  border-radius: var(--radius-md);
}

.header-nav {
  display: none;
}

.header-cta {
  display: none;
}

.nav-link {
  font-size: var(--text-small);
  font-weight: 500;
  letter-spacing: 0.02em;
  transition: color var(--transition-fast);
  padding: var(--space-xs) 0;
}

.header:not(.scrolled) .nav-link {
  color: var(--color-white);
}

.header.scrolled .nav-link {
  color: var(--color-text);
}

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

/* Hamburger */
.hamburger {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 44px;
  height: 44px;
  gap: 5px;
}

.hamburger span {
  display: block;
  width: 22px;
  height: 2px;
  background-color: var(--color-white);
  transition: all var(--transition-base);
  border-radius: 1px;
}

.header.scrolled .hamburger span {
  background-color: var(--color-text);
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

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

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile Menu */
.mobile-menu {
  display: none;
  position: absolute;
  top: var(--header-height);
  left: 0;
  width: 100%;
  background-color: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-sm) var(--space-md) var(--space-md);
  box-shadow: var(--shadow-md);
}

.mobile-menu.open {
  display: block;
  animation: slideDown 200ms ease forwards;
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-8px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.mobile-nav {
  display: flex;
  flex-direction: column;
  gap: var(--space-xs);
}

.mobile-nav-link {
  display: block;
  padding: 0.75rem var(--space-sm);
  font-size: var(--text-body);
  font-weight: 500;
  color: var(--color-text);
  border-radius: var(--radius-md);
  transition: background-color var(--transition-fast), color var(--transition-fast);
}

.mobile-nav-link:hover {
  color: var(--color-accent);
  background-color: rgba(0, 0, 0, 0.03);
}

.mobile-cta {
  margin-top: var(--space-sm);
  text-align: center;
}

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

.hero-video {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: var(--color-overlay);
}

.hero-content {
  position: relative;
  z-index: 2;
  padding-top: var(--header-height);
}

.hero-eyebrow {
  font-size: var(--text-small);
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.15em;
  color: var(--color-accent);
  margin-bottom: var(--space-md);
}

.hero-title {
  color: var(--color-white);
  margin-bottom: var(--space-md);
  max-width: 16ch;
}

.hero-subtitle {
  color: rgba(255, 255, 255, 0.75);
  max-width: 48ch;
  margin-bottom: var(--space-lg);
  line-height: var(--line-height-body);
}

.hero-ctas {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-bottom: var(--space-xl);
}

.hero-trust {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

.trust-item {
  display: flex;
  align-items: center;
  gap: 0.375rem;
  font-size: var(--text-small);
  color: rgba(255, 255, 255, 0.6);
}

.trust-item svg {
  width: 16px;
  height: 16px;
  color: var(--color-accent);
}

.trust-divider {
  width: 1px;
  height: 16px;
  background-color: rgba(255, 255, 255, 0.2);
}

/* ==============================================
   Services
   ============================================== */
.service-card {
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  transition: box-shadow var(--transition-base);
}

.service-card:hover {
  box-shadow: var(--shadow-md);
}

.service-icon {
  width: 48px;
  height: 48px;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--color-accent);
  margin-bottom: var(--space-md);
}

.service-icon svg {
  width: 36px;
  height: 36px;
}

.service-title {
  margin-bottom: var(--space-xs);
}

.service-desc {
  color: var(--color-text-muted);
  font-size: var(--text-small);
}

/* ==============================================
   About
   ============================================== */
.about-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.about-text .section-eyebrow {
  text-align: left;
}

.about-text .section-title {
  text-align: left;
  margin-bottom: var(--space-md);
}

.about-text p {
  color: var(--color-text-muted);
  margin-bottom: var(--space-sm);
}

.about-badges {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-xs);
  margin-top: var(--space-md);
}

.badge {
  display: inline-flex;
  align-items: center;
  padding: 0.5rem 1rem;
  font-size: var(--text-small);
  font-weight: 500;
  color: var(--color-accent);
  border: 1px solid var(--color-accent);
  border-radius: var(--radius-full);
  letter-spacing: 0.02em;
}

/* Mobile: image above "Who We Are" text */
.about-image {
  border-radius: var(--radius-lg);
  overflow: hidden;
  order: -1;
}

.about-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  aspect-ratio: 4 / 3;
}

/* ==============================================
   Works
   ============================================== */
.works-card {
  border-radius: var(--radius-lg);
  overflow: hidden;
  background-color: var(--color-bg-alt);
}

.works-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.works-card:hover img {
  transform: scale(1.03);
}

/* Works: always grid, show 6 initially */
.works-carousel .carousel-track {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  overflow: visible;
  scroll-snap-type: none;
  padding: 0 var(--space-md);
  gap: var(--space-md);
  max-width: var(--max-width);
  margin: 0 auto;
}

.works-carousel .carousel-item {
  flex: none;
}

.works-item-extra {
  display: none;
}

#works.works-expanded .works-item-extra {
  display: block;
}

.works-toggle-wrap {
  text-align: center;
  margin-top: var(--space-lg);
  padding: 0 var(--space-md);
}

.works-toggle {
  font-weight: 500;
  color: var(--color-text);
  border-color: var(--color-border-strong);
  background-color: var(--color-white);
}

.works-toggle:hover {
  background-color: var(--color-bg-alt);
  border-color: var(--color-accent);
  color: var(--color-accent);
}

/* ==============================================
   Contact
   ============================================== */
.contact-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.contact-info {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

.contact-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: var(--space-sm);
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow-sm);
}

.contact-item svg {
  width: 24px;
  height: 24px;
  color: var(--color-accent);
  flex-shrink: 0;
}

.contact-item h3 {
  font-family: var(--font-body);
  font-size: var(--text-body);
  font-weight: 600;
  margin-bottom: 0.25rem;
  color: var(--color-accent);
}

.contact-item p,
.contact-item a {
  color: var(--color-text-muted);
  font-size: var(--text-small);
}

.contact-item a:hover {
  color: var(--color-accent);
}

.contact-form {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
  background-color: var(--color-white);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
}

.form-group {
  display: flex;
  flex-direction: column;
  gap: 0.375rem;
}

.form-group label {
  font-size: var(--text-small);
  font-weight: 500;
  color: var(--color-text);
}

.form-group input,
.form-group select,
.form-group textarea {
  padding: 0.875rem 1rem;
  border: 1px solid var(--color-border-strong);
  border-radius: var(--radius-md);
  background-color: var(--color-bg);
  font-size: var(--text-body);
  transition: border-color var(--transition-fast), box-shadow var(--transition-fast);
  min-height: 48px;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
  outline: none;
  border-color: var(--color-accent);
  box-shadow: 0 0 0 3px rgba(184, 149, 106, 0.12);
}

.form-group input::placeholder,
.form-group textarea::placeholder {
  color: var(--color-text-light);
}

.form-group select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='16' height='16' viewBox='0 0 24 24' fill='none' stroke='%236B6B6B' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpolyline points='6 9 12 15 18 9'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 1rem center;
  background-size: 16px;
  padding-right: 2.5rem;
  cursor: pointer;
}

.form-row {
  display: flex;
  flex-direction: column;
  gap: var(--space-md);
}

/* ==============================================
   Footer
   ============================================== */
.footer {
  background-color: var(--color-dark);
  color: rgba(255, 255, 255, 0.6);
  padding-top: var(--space-2xl);
}

.footer-grid {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  padding-bottom: var(--space-xl);
  align-items: center;
  text-align: center;
}

.footer-brand {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.footer-brand-row {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  margin-bottom: var(--space-sm);
}

.footer-logo {
  height: 36px;
  width: auto;
  border-radius: var(--radius-sm);
}

.footer-brand-name {
  font-family: var(--font-heading);
  font-weight: 600;
  font-size: 1.125rem;
  color: var(--color-white);
}

.footer-desc {
  font-size: var(--text-small);
  max-width: 36ch;
  line-height: var(--line-height-body);
}

.footer-links h4,
.footer-contact h4 {
  font-family: var(--font-body);
  font-size: var(--text-small);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  color: var(--color-white);
  margin-bottom: var(--space-sm);
}

.footer-links a {
  display: block;
  font-size: var(--text-small);
  padding: 0.25rem 0;
  transition: color var(--transition-fast);
}

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

.footer-contact p,
.footer-contact a {
  font-size: var(--text-small);
  display: block;
  margin-bottom: 0.25rem;
}

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

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: var(--space-md) 0;
}

.footer-bottom p {
  font-size: var(--text-small);
  text-align: center;
}

/* ==============================================
   Carousel (Mobile-First)
   ============================================== */
.carousel {
  position: relative;
}

.carousel-track {
  display: flex;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  gap: var(--space-sm);
  padding: 0 var(--space-md);
  scroll-padding-left: var(--space-md);
}

.carousel-track::-webkit-scrollbar {
  display: none;
}

.carousel-item {
  flex: 0 0 88%;
  scroll-snap-align: start;
}

.carousel-dots {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: var(--space-md);
  padding: 0 var(--space-md);
}

.carousel-dots .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background-color: rgba(0, 0, 0, 0.12);
  border: none;
  padding: 0;
  cursor: pointer;
  transition: background-color var(--transition-fast), transform var(--transition-fast);
  min-height: auto;
  min-width: auto;
}

.carousel-dots .dot.active {
  background-color: var(--color-accent);
  transform: scale(1.25);
}

#works-dots .dot {
  width: 6px;
  height: 6px;
}

/* ==============================================
   Reveal Animation
   ============================================== */
[data-reveal] {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

[data-reveal].revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ==============================================
   Responsive: Tablet (768px+)
   ============================================== */
@media (min-width: 768px) {
  .section {
    padding: var(--space-3xl) 0;
  }

  .section-header {
    margin-bottom: var(--space-2xl);
  }

  /* Header */
  .header-nav {
    display: flex;
    gap: var(--space-lg);
    align-items: center;
  }

  .header-cta {
    display: inline-flex;
  }

  .header-brand-name {
    display: none;
  }

  .hamburger {
    display: none;
  }

  .mobile-menu {
    display: none !important;
  }

  /* Services carousel → grid */
  .services-carousel .carousel-track {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    overflow: visible;
    scroll-snap-type: none;
    padding: 0 var(--space-md);
    gap: var(--space-md);
    max-width: var(--max-width);
    margin: 0 auto;
  }

  .services-carousel .carousel-item {
    flex: none;
  }

  #services-dots {
    display: none;
  }

  /* Works carousel → grid */
  .works-carousel .carousel-track {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    overflow: visible;
    scroll-snap-type: none;
    padding: 0 var(--space-md);
    gap: var(--space-md);
    max-width: var(--max-width);
    margin: 0 auto;
  }

  .works-carousel .carousel-item {
    flex: none;
  }

  #works-dots {
    display: none;
  }

  /* About */
  .about-grid {
    flex-direction: row;
    align-items: center;
  }

  .about-text {
    flex: 1;
    order: 1;
  }

  .about-image {
    flex: 1;
    order: 2;
  }

  .about-image img {
    aspect-ratio: 3 / 4;
    min-height: 400px;
  }

  /* Contact */
  .contact-grid {
    flex-direction: row;
    align-items: flex-start;
  }

  .contact-info {
    flex: 0 0 38%;
  }

  .contact-form {
    flex: 1;
  }

  .form-row {
    flex-direction: row;
    gap: var(--space-md);
  }

  .form-row .form-group {
    flex: 1;
  }

  /* Footer */
  .footer-grid {
    flex-direction: row;
    justify-content: space-between;
    align-items: flex-start;
    text-align: left;
  }

  .footer-brand {
    flex: 0 0 40%;
    align-items: flex-start;
  }

  .footer-brand-row {
    margin-bottom: var(--space-sm);
  }
}

/* ==============================================
   Responsive: Desktop (1024px+)
   ============================================== */
@media (min-width: 1024px) {
  .section {
    padding: var(--space-4xl) 0;
  }

  .container {
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
  }

  .services-carousel .carousel-track {
    grid-template-columns: repeat(4, 1fr);
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
  }

  .works-carousel .carousel-track {
    grid-template-columns: repeat(3, 1fr);
    padding-left: var(--space-lg);
    padding-right: var(--space-lg);
  }

  .about-image img {
    min-height: 520px;
  }

  .contact-form {
    padding: var(--space-xl);
  }
}

/* ==============================================
   Responsive: Large Desktop (1280px+)
   ============================================== */
@media (min-width: 1280px) {
  .hero-content {
    padding-left: var(--space-xl);
  }
}
