/* ============================================================
   Ensen Developments — Silver Pinewood Design Language
   Dark luxury, massive bold sans-serif, full-viewport sections,
   warm beige accents, film grain texture, scroll-snap
   ============================================================ */

@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&display=swap');

:root {
  --color-bg: #282828;
  --color-bg-alt: #1e1e1e;
  --color-warm: #F0EAE2;
  --color-warm-dark: #C4B5A4;
  --color-primary: #998170;
  --color-accent: #BA8F71;
  --color-text: #FFFFFF;
  --color-text-dark: #282828;
  --color-text-muted: rgba(255,255,255,0.55);
  --color-text-muted-dark: rgba(40,40,40,0.55);
  --color-border: rgba(255,255,255,0.12);
  --color-border-dark: rgba(40,40,40,0.12);
  --color-overlay: rgba(0,0,0,0.35);

  --font: 'Outfit', sans-serif;
  --h1: clamp(3rem, 8vw, 8rem);
  --h2: clamp(2rem, 5vw, 4.75rem);
  --h3: clamp(1.1rem, 1.8vw, 1.4rem);
  --body: 16px;
  --nav: 13px;
  --small: 12px;

  --weight-heading: 700;
  --weight-body: 300;
  --weight-nav: 500;

  --lh-heading: 0.95;
  --lh-body: 1.7;
  --ls-heading: -0.02em;
  --ls-nav: 0.15em;

  --px: clamp(24px, 4vw, 48px);
  --header-h: 60px;
}

/* --- Reset --- */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
body {
  font-family: var(--font);
  font-weight: var(--weight-body);
  color: var(--color-text);
  background: var(--color-bg);
  line-height: var(--lh-body);
  font-size: var(--body);
}
img { max-width: 100%; height: auto; display: block; }
a { text-decoration: none; color: inherit; }

/* --- Film Grain Overlay --- */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 9999;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 128px 128px;
  animation: noise-animation 0.3s steps(3) infinite;
}
@keyframes noise-animation {
  0% { transform: translate(0, 0); }
  33% { transform: translate(-10px, 5px); }
  66% { transform: translate(5px, -10px); }
  100% { transform: translate(0, 0); }
}

/* --- Header --- */
.site-header {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 1000;
  height: var(--header-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 var(--px);
}
.header-brand {
  font-size: var(--small);
  font-weight: var(--weight-nav);
  letter-spacing: var(--ls-nav);
  text-transform: uppercase;
  opacity: 0.7;
  line-height: 1.3;
}
.header-nav {
  display: flex;
  gap: 40px;
  align-items: center;
}
.header-nav a {
  font-size: var(--nav);
  font-weight: var(--weight-nav);
  letter-spacing: var(--ls-nav);
  text-transform: uppercase;
  transition: opacity 0.3s ease;
}
.header-nav a:hover { opacity: 0.6; }

.mobile-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 8px;
}
.mobile-toggle span {
  display: block;
  width: 22px;
  height: 1.5px;
  background: var(--color-text);
  margin: 5px 0;
  transition: all 0.3s ease;
}

/* --- Sections --- */
.section {
  min-height: 100dvh;
  position: relative;
  display: flex;
  overflow: hidden;
}

/* --- Hero --- */
.hero {
  align-items: flex-start;
  padding: calc(var(--header-h) + 40px) var(--px) var(--px);
}
.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero-bg img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center top;
}
.hero-overlay {
  position: absolute;
  inset: 0;
  background: var(--color-overlay);
  z-index: 1;
}
.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  height: 100%;
  width: 100%;
}
.hero h1 {
  font-size: var(--h1);
  font-weight: var(--weight-heading);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  text-transform: uppercase;
  max-width: 70%;
}
.hero-tagline {
  align-self: flex-end;
  text-align: right;
  font-size: clamp(1.2rem, 2vw, 1.8rem);
  font-weight: 400;
  color: var(--color-accent);
  letter-spacing: 0.05em;
}

/* Page load animation */
.load-fade { opacity: 0; animation: fadeUp 1s ease forwards; }
.load-fade:nth-child(2) { animation-delay: 0.15s; }
.load-fade:nth-child(3) { animation-delay: 0.3s; }
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(30px); }
  to { opacity: 1; transform: translateY(0); }
}

/* --- About Section (dark bg, large text + image) --- */
.section-about {
  background: var(--color-bg);
  flex-direction: column;
  padding: var(--px);
  gap: 40px;
}
.about-text {
  max-width: 65%;
}
.about-text h2 {
  font-size: var(--h2);
  font-weight: var(--weight-heading);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  text-transform: uppercase;
  margin-bottom: 32px;
}
.about-text p {
  font-size: 18px;
  color: var(--color-text-muted);
  max-width: 600px;
  line-height: 1.8;
}
.about-images {
  display: grid;
  grid-template-columns: 1fr 1.8fr;
  gap: 4px;
  flex: 0 0 40vh;
  max-height: 40vh;
  overflow: hidden;
}
.about-images img {
  width: 100%; height: 100%;
  object-fit: cover;
  max-height: 40vh;
}

/* --- Services (warm bg, large text) --- */
.section-services {
  background: var(--color-warm);
  color: var(--color-text-dark);
  flex-direction: column;
  padding: var(--px);
  justify-content: center;
}
.section-services h2 {
  font-size: var(--h2);
  font-weight: var(--weight-heading);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  text-transform: uppercase;
  color: var(--color-text-dark);
  max-width: 80%;
  margin-bottom: 60px;
}
.services-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: var(--color-border-dark);
}
.service-card {
  background: var(--color-warm);
  padding: 32px 24px;
  transition: background-color 0.4s ease;
}
.service-card:hover {
  background: var(--color-warm-dark);
}
.service-card h3 {
  font-size: var(--h3);
  font-weight: 600;
  margin-bottom: 12px;
  color: var(--color-text-dark);
}
.service-card p {
  font-size: 14px;
  color: var(--color-text-muted-dark);
  line-height: 1.7;
}

/* --- Projects (dark bg, gallery) --- */
.section-projects {
  background: var(--color-bg-alt);
  flex-direction: column;
  padding: var(--px);
}
.projects-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 40px;
}
.projects-header h2 {
  font-size: var(--h2);
  font-weight: var(--weight-heading);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  text-transform: uppercase;
}
.projects-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 4px;
  flex: 1;
}
.gallery-item {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}
.gallery-item img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 0.6s ease;
}
.gallery-item:hover img { transform: scale(1.05); }
.gallery-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 50%, rgba(0,0,0,0.7));
  opacity: 0;
  transition: opacity 0.4s ease;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
}
.gallery-item:hover .gallery-overlay { opacity: 1; }
.gallery-overlay h3 {
  font-size: 20px;
  font-weight: 600;
}
.gallery-overlay span {
  font-size: 13px;
  color: var(--color-text-muted);
  margin-top: 4px;
}

/* --- Contact (warm bg) --- */
.section-contact {
  background: var(--color-warm);
  color: var(--color-text-dark);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: var(--px);
}
.section-contact h2 {
  font-size: var(--h2);
  font-weight: var(--weight-heading);
  line-height: var(--lh-heading);
  letter-spacing: var(--ls-heading);
  text-transform: uppercase;
  margin-bottom: 40px;
}
.contact-grid {
  display: flex;
  gap: 64px;
  margin-top: 40px;
}
.contact-item { text-align: center; }
.contact-item .label {
  font-size: var(--small);
  letter-spacing: var(--ls-nav);
  text-transform: uppercase;
  color: var(--color-text-muted-dark);
  margin-bottom: 8px;
}
.contact-item .value {
  font-size: 18px;
  font-weight: 500;
}
.contact-item .value a {
  color: var(--color-text-dark);
  border-bottom: 1px solid var(--color-border-dark);
  transition: border-color 0.3s ease;
}
.contact-item .value a:hover { border-color: var(--color-accent); }

.btn-outline {
  display: inline-block;
  padding: 14px 32px;
  border: 1px solid rgba(40,40,40,0.3);
  font-size: var(--nav);
  font-weight: var(--weight-nav);
  letter-spacing: var(--ls-nav);
  text-transform: uppercase;
  color: var(--color-text-dark);
  transition: all 0.3s ease;
  margin-top: 32px;
}
.btn-outline:hover {
  background: var(--color-text-dark);
  color: var(--color-warm);
}

/* --- Footer --- */
.site-footer {
  background: var(--color-bg-alt);
  padding: 48px var(--px) 24px;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.footer-brand {
  font-size: var(--small);
  font-weight: var(--weight-nav);
  letter-spacing: var(--ls-nav);
  text-transform: uppercase;
  opacity: 0.5;
  line-height: 1.4;
}
.footer-links {
  display: flex;
  gap: 32px;
}
.footer-links a {
  font-size: var(--nav);
  letter-spacing: var(--ls-nav);
  text-transform: uppercase;
  opacity: 0.5;
  transition: opacity 0.3s ease;
}
.footer-links a:hover { opacity: 1; }
.footer-contact {
  text-align: right;
  font-size: 14px;
  color: var(--color-text-muted);
}
.footer-contact a { transition: opacity 0.3s ease; }
.footer-contact a:hover { opacity: 0.6; }

/* --- Scroll Reveal --- */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}
.reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}
.reveal-delay-1 { transition-delay: 0.1s; }
.reveal-delay-2 { transition-delay: 0.2s; }
.reveal-delay-3 { transition-delay: 0.3s; }
.reveal-delay-4 { transition-delay: 0.4s; }

@media (prefers-reduced-motion: reduce) {
  .reveal, .load-fade { animation: none !important; opacity: 1 !important; transform: none !important; transition: none !important; }
  body::after { animation: none; }
}

/* ============================================================
   Responsive
   ============================================================ */
@media (max-width: 1024px) {
  .header-nav { display: none; }
  .header-nav.open {
    display: flex;
    flex-direction: column;
    position: fixed;
    inset: 0;
    background: var(--color-bg);
    z-index: 999;
    justify-content: center;
    align-items: center;
    gap: 32px;
  }
  .header-nav.open a { font-size: 24px; color: var(--color-text); }
  .mobile-toggle { display: block; }

  .hero h1 { max-width: 100%; }
  .about-text { max-width: 100%; }
  .about-images { grid-template-columns: 1fr 1fr; height: 40%; }
  .services-grid { grid-template-columns: 1fr 1fr; }
  .projects-gallery { grid-template-columns: 1fr 1fr; }
  .contact-grid { flex-direction: column; gap: 32px; }
  .site-footer { flex-direction: column; gap: 24px; }
  .footer-contact { text-align: left; }
}

@media (max-width: 640px) {
  html { scroll-snap-type: none; }
  .section { min-height: auto; padding: 80px var(--px); }
  .hero { min-height: 100dvh; }
  .hero h1 { font-size: clamp(2.5rem, 10vw, 4rem); }
  .services-grid { grid-template-columns: 1fr; }
  .projects-gallery { grid-template-columns: 1fr; }
  .about-images { grid-template-columns: 1fr; height: auto; }
  .footer-links { flex-direction: column; gap: 12px; }
}