/* ── Custom Properties ────────────────────────── */

:root {
  --bg: #0c0806;
  --surface: rgba(200, 170, 140, 0.03);
  --surface-hover: rgba(200, 170, 140, 0.06);
  --border: rgba(200, 170, 140, 0.08);
  --border-hover: rgba(200, 170, 140, 0.18);

  --text-primary: #e8e0d8;
  --text-secondary: #b5a99d;
  --text-muted: #8a7e72;
  --text-bright: #f5efe9;

  --accent: #c4956a;
  --accent-dim: rgba(196, 149, 106, 0.15);

  --font-display: 'Cormorant Garamond', Georgia, serif;
  --font-body: 'Plus Jakarta Sans', system-ui, sans-serif;

  --max-w: 1200px;
  --gutter: 2rem;
}

/* ── Reset & Base ─────────────────────────────── */

*,
*::before,
*::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-body);
  font-weight: 400;
  color: var(--text-primary);
  background: var(--bg);
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* ── Interactive Grid Background ──────────────── */

#grid-bg {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  pointer-events: none;
  z-index: 0;
}

/* ── Grain Texture ───────────────────────────── */

.grain {
  position: fixed;
  inset: 0;
  z-index: 200;
  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='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px;
}

/* ── Ambient Hero Glow ───────────────────────── */

.hero-glow {
  position: fixed;
  top: -30%;
  left: -15%;
  width: 70%;
  height: 80%;
  background: radial-gradient(
    ellipse at center,
    rgba(196, 149, 106, 0.035) 0%,
    rgba(180, 140, 100, 0.012) 45%,
    transparent 70%
  );
  pointer-events: none;
  z-index: 0;
}

/* ── Typography ──────────────────────────────── */

h1, h2, h3 {
  font-family: var(--font-display);
  line-height: 1.15;
  color: var(--text-bright);
}

h2 {
  font-size: 0.7rem;
  font-family: var(--font-body);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.25em;
  color: var(--accent);
  margin-bottom: 2.5rem;
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 1rem;
}

h2::before {
  content: '';
  width: 2rem;
  height: 1px;
  background: var(--accent);
  opacity: 0.5;
  flex-shrink: 0;
}

h3 {
  font-size: clamp(1.5rem, 2.5vw, 1.85rem);
  font-weight: 500;
  margin-bottom: 0.75rem;
  color: var(--text-bright);
}

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

/* ── Layout ──────────────────────────────────── */

header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 300;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid transparent;
  transition: background 0.4s ease, border-color 0.4s ease, backdrop-filter 0.4s ease;
}

header.scrolled {
  background: rgba(12, 8, 6, 0.9);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom-color: var(--border);
}

nav {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 1.25rem var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.logo img {
  display: block;
  height: 28px;
  width: auto;
  opacity: 0;
  transition: opacity 0.4s ease;
  pointer-events: none;
}

.logo.visible img {
  opacity: 0.9;
  pointer-events: auto;
}

.logo.visible:hover img {
  opacity: 1;
}

.nav-links {
  list-style: none;
  display: flex;
  gap: 2.5rem;
}

.nav-links a {
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.3s;
  position: relative;
}

.nav-links a::after {
  content: '';
  position: absolute;
  bottom: -4px;
  left: 0;
  width: 0;
  height: 1px;
  background: var(--accent);
  transition: width 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

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

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

main {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--gutter);
  position: relative;
  z-index: 1;
}

section {
  padding: 5rem 0;
}

/* ── Hero ────────────────────────────────────── */

.hero {
  height: 400px;
  display: flex;
  align-items: center;
  padding-top: 4rem;
  position: relative;
  overflow: hidden;
}

.hero-accent {
  position: absolute;
  right: -8%;
  top: 50%;
  transform: translateY(-50%);
  width: clamp(320px, 48vw, 600px);
  height: auto;
  opacity: 1;
  animation: rotate-slow 120s linear infinite;
}

@keyframes rotate-slow {
  from { transform: translateY(-50%) rotate(0deg); }
  to { transform: translateY(-50%) rotate(360deg); }
}

.hero-content {
  position: relative;
  z-index: 2;
}

.hero-logo {
  margin-bottom: 2rem;
  transition: opacity 0.5s ease;
}

.hero-logo.faded {
  opacity: 0;
}

.hero-logo-img {
  height: clamp(52px, 9vw, 90px);
  width: auto;
  display: block;
}

.tagline {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 3.5vw, 2.8rem);
  font-weight: 300;
  font-style: italic;
  color: var(--text-secondary);
  max-width: 560px;
  line-height: 1.3;
}

.tagline .accent {
  color: var(--accent);
  font-style: normal;
  font-weight: 500;
}

/* ── Hero Illustration ──────────────────────── */

.hero-illustration {
  position: absolute;
  right: 0;
  bottom: 0;
  height: 100%;
  width: auto;
  pointer-events: none;
  object-fit: contain;
  object-position: right bottom;
}

/* ── Divider ────────────────────────────────── */

.section-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--accent-dim), var(--border), transparent 80%);
  border: none;
  margin: 0;
}

/* ── About ───────────────────────────────────── */

.about {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 4rem;
  align-items: start;
}

.about h2 {
  grid-column: 1 / -1;
}

.about-lead {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 3vw, 2.4rem);
  font-weight: 400;
  color: var(--text-bright);
  line-height: 1.35;
  margin-bottom: 0;
}

.about p:not(.about-lead) {
  font-size: 1rem;
  color: var(--text-secondary);
  line-height: 1.8;
}

/* ── Trusted By ──────────────────────────────── */

.trusted {
  padding: 3.5rem 0;
}

.logo-strip {
  display: flex;
  align-items: center;
  gap: 3.5rem;
  flex-wrap: wrap;
}

.client-logo {
  height: 28px;
  width: auto;
  opacity: 0.25;
  transition: opacity 0.4s ease;
  filter: grayscale(1);
}

.client-logo:hover {
  opacity: 0.6;
  filter: grayscale(0);
}

/* ── Services ────────────────────────────────── */

.services-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.service-card {
  padding: 3rem;
  border: 1px solid var(--border);
  border-radius: 16px;
  background: var(--surface);
  transition: border-color 0.5s ease, background 0.5s ease, transform 0.5s cubic-bezier(0.22, 1, 0.36, 1);
  position: relative;
  overflow: hidden;
}

.service-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 2rem;
  right: 2rem;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0;
  transition: opacity 0.5s ease;
}

.service-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 16px;
  background: radial-gradient(circle at 50% 0%, var(--accent-dim), transparent 70%);
  opacity: 0;
  transition: opacity 0.5s ease;
  pointer-events: none;
}

.service-card:hover {
  border-color: var(--border-hover);
  background: var(--surface-hover);
  transform: translateY(-4px);
}

.service-card:hover::before {
  opacity: 1;
}

.service-card:hover::after {
  opacity: 1;
}

.service-icon {
  width: 52px;
  height: 52px;
  margin-bottom: 2rem;
  color: var(--accent);
  transition: color 0.3s, transform 0.4s cubic-bezier(0.22, 1, 0.36, 1);
}

.service-card:hover .service-icon {
  color: var(--text-bright);
  transform: scale(1.05);
}

.service-icon svg {
  width: 100%;
  height: 100%;
}

.service-number {
  font-family: var(--font-body);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--accent);
  opacity: 0.6;
  margin-bottom: 1.25rem;
}

.service-card h3 {
  font-family: var(--font-display);
  font-weight: 500;
}

.service-card p {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.75;
}

/* ── Contact ─────────────────────────────────── */

.contact {
  padding-bottom: 6rem;
}

.contact-lead {
  font-family: var(--font-display);
  font-size: clamp(1.6rem, 2.8vw, 2.2rem);
  font-weight: 400;
  font-style: italic;
  color: var(--text-secondary);
  margin-bottom: 2rem;
  max-width: 420px;
  line-height: 1.35;
}

.links {
  list-style: none;
}

.links li {
  margin-bottom: 0.75rem;
}

.links a {
  font-family: var(--font-body);
  font-size: 1rem;
  font-weight: 500;
  color: var(--accent);
  position: relative;
  padding-bottom: 4px;
  transition: color 0.3s;
}

.links a::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--accent);
  opacity: 0.3;
  transform: scaleX(0.3);
  transform-origin: left;
  transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s;
}

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

.links a:hover::after {
  transform: scaleX(1);
  opacity: 0.6;
  background: var(--text-bright);
}

/* ── Footer ──────────────────────────────────── */

footer {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 3rem var(--gutter);
  border-top: 1px solid var(--border);
  position: relative;
  z-index: 1;
}

footer p {
  font-size: 0.7rem;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

/* ── Scroll Reveal ───────────────────────────── */

.reveal,
.reveal-child {
  opacity: 1;
  transform: translateY(0);
}

/* ── Menu Toggle Button ──────────────────────── */

.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 10px;
  flex-shrink: 0;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 7px;
  z-index: 400;
  -webkit-tap-highlight-color: transparent;
  margin-right: -10px;
}

.menu-bar {
  display: block;
  width: 24px;
  height: 1.5px;
  background: var(--text-secondary);
  border-radius: 2px;
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), opacity 0.3s;
}

.menu-toggle.open .menu-bar:first-child {
  transform: translateY(4.25px) rotate(45deg);
}

.menu-toggle.open .menu-bar:last-child {
  transform: translateY(-4.25px) rotate(-45deg);
}

/* ── Mobile ──────────────────────────────────── */

@media (max-width: 768px) {
  :root {
    --gutter: 1.5rem;
  }

  .menu-toggle {
    display: flex;
  }

  .nav-links {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    width: 100%;
    height: 100dvh;
    background: rgba(12, 8, 6, 0.97);
    backdrop-filter: blur(24px);
    -webkit-backdrop-filter: blur(24px);
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    z-index: 350;
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    font-size: 1.1rem;
    letter-spacing: 0.12em;
    color: var(--text-secondary);
  }

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

  section {
    padding: 3.5rem 0;
  }

  .hero {
    height: auto;
    min-height: 300px;
  }

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

  .service-card {
    padding: 2rem;
  }

  .hero-accent {
    right: -25%;
    width: 280px;
    opacity: 0.6;
  }

  .hero-illustration {
    display: none;
  }

  .about {
    display: block;
  }
}

@media (max-width: 480px) {
  .logo-strip {
    gap: 2rem;
  }

  .client-logo {
    height: 22px;
  }
}
