/* ==========================================================================
   CSS FOUNDATION & DESIGN SYSTEM
   ========================================================================== */

:root {
  /* Color Palette */
  color-scheme: dark; /* Added as per Vercel Web Interface Guidelines */
  --color-bg-main: #131E17; /* Deep Forest Green */
  --color-bg-dark: #0A110D; /* Very Dark Green */
  --color-accent: #C4A575; /* Brushed Gold / Wood */
  --color-accent-hover: #D4B384;
  --color-text-main: #FBF9F6; /* Off-white / Linen */
  --color-text-muted: #8E9C92; /* Muted Green-Gray */
  --color-white: #FFFFFF;

  /* Typography */
  --font-heading: "Playfair Display", serif;
  --font-body: "Inter", sans-serif;

  /* Transitions */
  --transition-fast: 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --transition-slow: 0.8s cubic-bezier(0.25, 1, 0.5, 1);

  /* Spacing System */
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 3rem;
  --space-xl: 5rem;

  /* Layout */
  --header-height: 80px;
  --container-width: 1400px;
}

/* ==========================================================================
   RESET & BASE STYLES
   ========================================================================== */

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: var(--font-body);
  color: var(--color-text-main);
  background-color: var(--color-bg-main);
  line-height: 1.6;
  font-size: 16px;
  overflow-x: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  font-weight: 500;
  line-height: 1.2;
  color: var(--color-text-main);
}

.italic {
  font-style: italic;
  font-weight: 400;
}

a {
  text-decoration: none;
  color: inherit;
  /* transition: var(--transition-fast); (Removed transition: all anti-pattern) */
  transition: color 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

.container {
  width: 100%;
  max-width: var(--container-width);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* ==========================================================================
   COMPONENTS
   ========================================================================== */

/* Buttons */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.875rem 2rem;
  font-family: var(--font-body);
  font-size: 0.875rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  border-radius: 4px;
  cursor: pointer;
  /* transition: var(--transition-fast); (Removed transition: all anti-pattern) */
  transition: background-color 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), color 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), border-color 0.3s cubic-bezier(0.2, 0.8, 0.2, 1), transform 0.2s cubic-bezier(0.2, 0.8, 0.2, 1);
  border: 1px solid transparent;
}

.btn:active {
  transform: scale(0.96);
}


.btn:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 4px;
}

.btn-primary {
  background-color: var(--color-accent);
  color: var(--color-bg-dark);
  font-weight: 600;
}

.btn-primary:hover {
  background-color: var(--color-white);
  color: var(--color-bg-dark);
}

.dark-btn {
  background-color: var(--color-text-main);
  color: var(--color-bg-dark);
  font-weight: 600;
}

.dark-btn:hover {
  background-color: var(--color-accent);
  color: var(--color-bg-dark);
}

.btn-outline {
  background-color: transparent;
  border-color: var(--color-text-main);
  color: var(--color-text-main);
}

.btn-outline:hover {
  background-color: var(--color-text-main);
  color: var(--color-bg-dark);
}

/* Eyebrow Text */
.eyebrow {
  display: block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-sm);
}

.eyebrow-light {
  color: rgba(255, 255, 255, 0.6);
}

/* Section Spacing */
.section {
  padding: var(--space-xl) 0;
}

/* Base Cards */
.card {
  background-color: var(--color-bg-dark);
  padding: var(--space-lg) var(--space-md);
  border-radius: 8px;
  /* transition: var(--transition-fast); (Removed transition: all anti-pattern) */
  transition: background-color 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), border-color 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

/* ==========================================================================
   LAYOUT STRUCTURES
   ========================================================================== */

/* Navbar */
.navbar {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: var(--header-height);
  z-index: 100;
  /* transition: var(--transition-fast); (Removed transition: all anti-pattern) */
  transition: background-color 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94), border-bottom-color 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
  /* Start transparent */
  background-color: transparent;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.navbar.scrolled {
  background-color: rgba(10, 17, 13, 0.85);
  backdrop-filter: blur(20px) saturate(180%);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 1px solid rgba(196, 165, 117, 0.1);
}


.navbar-container {
  height: 100%;
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.brand {
  display: flex;
  align-items: center;
  font-family: var(--font-heading);
  font-size: 1.5rem;
  font-weight: 600;
  color: var(--color-white);
}

.brand-logo {
  height: 40px;
  width: auto;
  object-fit: contain;
}

.footer-logo {
  height: 56px;
  margin-bottom: var(--space-sm);
}

.navbar.scrolled .brand {
  color: var(--color-text-main);
}

.nav-links {
  display: flex;
  gap: var(--space-md);
}

.nav-links a {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--color-white);
}

.navbar.scrolled .nav-links a {
  color: var(--color-text-main);
}

.nav-links a:hover {
  color: var(--color-accent);
}

.nav-btn {
  border-color: rgba(255, 255, 255, 0.5);
  color: var(--color-white);
}

.navbar.scrolled .nav-btn {
  border-color: var(--color-text-main);
  color: var(--color-text-main);
}

/* Hero Section */
.hero {
  position: relative;
  height: 100vh;
  width: 100%;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.hero-bg-wrapper {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 120%; /* For parallax */
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transform: scale(1.1); /* initial parallax state */
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(42, 42, 40, 0.4) 0%,
    rgba(42, 42, 40, 0.8) 100%
  );
  z-index: 1;
}

.hero-content {
  position: relative;
  z-index: 2;
  padding-top: var(--header-height);
}

.hero-text-wrapper {
  max-width: 800px;
}

.hero h1 {
  font-size: clamp(3rem, 6vw, 5.5rem);
  color: var(--color-white);
  margin-bottom: var(--space-md);
}

.hero p {
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  color: rgba(255, 255, 255, 0.8);
  max-width: 600px;
  margin-bottom: var(--space-lg);
}

/* Nossa Essencia */
.essence {
  background-color: var(--color-bg-main);
}

.essence-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
  align-items: center;
}

.essence-text h2 {
  font-size: clamp(2.5rem, 4vw, 3.5rem);
  margin-bottom: var(--space-md);
}

.accent-text {
  color: var(--color-accent);
  font-style: italic;
}

.essence-text p {
  color: var(--color-text-muted);
  font-size: 1.125rem;
  margin-bottom: var(--space-sm);
}

.essence-image-wrapper {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  height: 600px;
}

.essence-img {
  width: 100%;
  height: 120%;
  object-fit: cover;
  transform: scale(1.1); /* Prepare for parallax */
}

/* Purpose (Missão/Visão) */
.purpose-section {
  background-color: var(--color-bg-dark);
}

.purpose-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  padding: var(--space-md) 0;
}


.purpose-card p {
  color: var(--color-text-muted);
  font-size: 1.125rem;
  max-width: 500px;
}

/* Services */
.bg-dark {
  background-color: var(--color-bg-dark);
  color: var(--color-text-main);
}


.bg-dark h2 {
  color: var(--color-white);
}

.services-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: var(--space-md);
  margin-top: var(--space-lg);
}

.service-card {
  background-color: rgba(255, 255, 255, 0.03);
  border: 1px solid rgba(255, 255, 255, 0.05);
}

.service-card:hover {
  background-color: rgba(255, 255, 255, 0.05);
  border-color: var(--color-accent);
}

.icon-wrapper {
  margin-bottom: var(--space-md);
  color: var(--color-accent);
}

.icon-wrapper svg {
  width: 32px;
  height: 32px;
}

.service-card h3 {
  font-size: 1.5rem;
  margin-bottom: var(--space-sm);
  color: var(--color-white);
}

.service-card p {
  color: rgba(255, 255, 255, 0.6);
}

/* Projects */
.projects {
  background-color: var(--color-bg-dark);
}

.project-item {
  margin-top: var(--space-xl);
}

.projects-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-lg);
}

/* Offset second item for asymmetrical grid */
.mt-offset {
  margin-top: calc(var(--space-xl) * 2);
}

.project-img-wrapper {
  border-radius: 8px;
  overflow: hidden;
  margin-bottom: var(--space-sm);
  aspect-ratio: 4/5;
}

.project-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.transform-hover {
  transition: transform var(--transition-slow);
}
.project-img-wrapper:hover .transform-hover {
  transform: scale(1.05);
}

.project-info h3 {
  font-size: 2rem;
  margin-bottom: 0.25rem;
}

.project-category {
  font-size: 0.875rem;
  color: var(--color-text-muted);
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

/* CTA */
.cta-section {
  background-color: var(--color-bg-main);
}

.cta-box {
  background-color: var(--color-accent);
  padding: var(--space-xl) var(--space-lg);
  border-radius: 12px;
  text-align: center;
  color: var(--color-white);
}

.cta-box h2 {
  color: var(--color-bg-main);
  font-size: clamp(3rem, 5vw, 4.5rem);
  margin-bottom: var(--space-sm);
}

.cta-box p {
  color: var(--color-bg-main);
  font-size: 1.25rem;
  margin-bottom: var(--space-md);
  max-width: 600px;
  margin-inline: auto;
}

/* Footer */
.footer {
  background-color: var(--color-bg-dark);
  color: rgba(255, 255, 255, 0.6);
  padding: var(--space-xl) 0 var(--space-md);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.footer h4 {
  color: var(--color-accent); /* Fixed readability issue */
  font-family: var(--font-body);
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.1em;
  margin-bottom: var(--space-md);
}

.footer-links,
.footer-social {
  display: flex;
  flex-direction: column;
  gap: var(--space-sm);
}

.footer a:hover {
  color: var(--color-accent);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding-top: var(--space-md);
  text-align: center;
  font-size: 0.875rem;
}

/* ==========================================================================
   ANIMATIONS & UTILITIES
   ========================================================================== */

/* Fade Up Initial State */
.fade-up {
  opacity: 0;
  transform: translateY(40px);
  transition:
    opacity var(--transition-slow),
    transform var(--transition-slow);
}

/* Reveal Slide Initial State (Image masks) */
.reveal-slide {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.2s cubic-bezier(0.77, 0, 0.175, 1);
}

/* Reveal Scale Initial State (Wrapper for parallax scaling) */
.reveal-scale {
  opacity: 0;
  transform: scale(1.05);
  transition:
    opacity 1.5s ease-out,
    transform 1.5s cubic-bezier(0.25, 1, 0.5, 1);
}

/* Delay classes for staggered animations */
.delay-1 {
  transition-delay: 0.1s;
}
.delay-2 {
  transition-delay: 0.2s;
}
.delay-3 {
  transition-delay: 0.3s;
}

/* Active States applied by JS IntersectionObserver */
.is-visible.fade-up {
  opacity: 1;
  transform: translateY(0);
}

.is-visible.reveal-slide {
  clip-path: inset(0 0 0 0);
}

.is-visible.reveal-scale {
  opacity: 1;
  transform: scale(1);
}

/* Text Rotator Animation */
.text-rotator {
  display: inline-grid;
  color: var(--color-accent);
}

.text-rotator .rotate-word {
  grid-area: 1 / 1;
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.5s ease, transform 0.5s ease;
  pointer-events: none;
}

.text-rotator .rotate-word.active {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}

.text-rotator .rotate-word.out {
  opacity: 0;
  transform: translateY(-20px);
}

/* ==========================================================================
   MEDIA QUERIES
   ========================================================================== */

/* ==========================================================================
   MEDIA QUERIES & MOBILE NAV
   ========================================================================== */

/* Mobile Nav Toggle Button */
.mobile-nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 30px;
  height: 20px;
  background: transparent;
  border: none;
  cursor: pointer;
  z-index: 1001;
  padding: 0;
}

.hamburger-line {
  width: 100%;
  height: 2px;
  background-color: var(--color-white);
  transition: var(--transition-fast);
  border-radius: 2px;
}

.navbar.scrolled .hamburger-line {
  background-color: var(--color-text-main);
}

/* Mobile Menu Overlay */
.mobile-menu {
  position: fixed;
  top: 0;
  right: -100%;
  width: 100%;
  height: 100vh;
  background-color: rgba(10, 17, 13, 0.98);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  z-index: 2000;
  padding: var(--space-xl) var(--space-md);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  transition: opacity 0.4s ease, visibility 0.4s ease, transform 0.6s cubic-bezier(0.2, 0.8, 0.2, 1);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-20px);
}

.mobile-menu.active {
  opacity: 1;
  visibility: visible;
  right: 0;
  transform: translateY(0);
}


.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: var(--space-xl);
}

.mobile-menu-close {
  background: transparent;
  border: none;
  color: var(--color-white);
  cursor: pointer;
}

.mobile-menu-close svg {
  width: 32px;
  height: 32px;
}

.mobile-nav-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-lg);
  text-align: center;
  width: 100%;
}

.mobile-nav-links a {
  font-family: var(--font-heading);
  font-size: 2rem;
  font-weight: 500;
  color: var(--color-text-main);
  transition: color 0.3s ease, transform 0.3s ease;
  position: relative;
}

.mobile-nav-links a:active {
  color: var(--color-accent);
  transform: scale(0.95);
}

.mobile-cta {
  margin-top: var(--space-lg);
  width: 100%;
  max-width: 300px;
  margin-inline: auto;
}


@media (max-width: 992px) {
  .essence-grid,
  .projects-grid,
  .footer-grid,
  .purpose-grid {
    grid-template-columns: 1fr;
    gap: var(--space-xl);
  }

  /* Scroll Snapping for Projects */
  .projects-grid {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    gap: var(--space-md);
    padding-bottom: var(--space-md);
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none; /* Hide scrollbar Firefox */
  }

  .projects-grid::-webkit-scrollbar {
    display: none; /* Hide scrollbar Chrome/Safari */
  }

  .project-item {
    flex: 0 0 85%;
    scroll-snap-align: center;
    margin-top: 0 !important;
  }

  .nav-links, 
  .nav-btn {
    display: none;
  }

  .mobile-nav-toggle {
    display: flex;
    margin-left: var(--space-md);
  }

  .mt-offset {
    margin-top: 0;
  }

  .essence-image-wrapper {
    height: 450px;
  }

  .hero h1 {
    font-size: 3.5rem;
  }
}

@media (max-width: 768px) {
  :root {
    --space-xl: 3.5rem;
  }
  
  .hero h1 {
    font-size: 2.75rem;
  }

  .section {
    padding: var(--space-xl) var(--space-md);
  }


  .footer-grid {
    text-align: center;
  }

  .footer-brand, .footer-links, .footer-social {
    align-items: center;
  }
}
