/* ============================================================
   Daat Analytics — Shared Brand Styles
   Used across all pages: index, about, services, case-studies
   ============================================================ */

:root {
  --navy: #1e2a5e;
  --navy-deep: #161f47;
  --teal: #14b8a6;
  --teal-soft: #5eead4;
  --amber: #f59e0b;
  --amber-soft: #fef3c7;
  --paper: #fafaf7;
  --paper-warm: #f5f3ed;
  --ink: #1a1a1a;
  --ink-soft: #4a4a4a;
  --ink-muted: #71717a;
  --line: #e4e4e7;
}

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

html { scroll-behavior: smooth; }

body {
  font-family: 'Geist', -apple-system, BlinkMacSystemFont, sans-serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.55;
  font-weight: 400;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 48px;
}

/* ============ NAVIGATION ============ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  padding: 24px 48px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: rgba(250, 250, 247, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.04);
}

.logo {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 2px;
  text-decoration: none;
  color: var(--navy);
  font-family: 'Inter', sans-serif;
  font-weight: 500;
  font-size: 19px;
  letter-spacing: -0.02em;
  transition: opacity 0.2s ease;
  /* Explicit height prevents Chrome iOS from miscalculating column flex content */
  line-height: 1;
}

.logo:hover {
  opacity: 0.7;
}

/* SVG logo mark */
.logo-svg {
  height: 72px;
  width: auto;
  display: block;
}

/* .ai badge entrance — subtle pop with overshoot (homepage only triggers on load) */
.logo-ai-badge {
  transform-origin: 183px -2px;
  transform: scale(0);
  animation: badgePop 0.6s cubic-bezier(0.34, 1.56, 0.64, 1) 0.4s forwards;
}

@keyframes badgePop {
  to { transform: scale(1); }
}

.logo-text {
  font-family: 'Inter', sans-serif;
  font-weight: 400;
  font-size: 11px;
  letter-spacing: 0.35em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: block;
  padding-left: 2px;
  /* Right-padding compensates for letter-spacing overflow on the last letter,
     which Chrome iOS sometimes uses to compute zero width. */
  padding-right: 4px;
  line-height: 1.2;
  /* Explicit minimum width prevents Chrome iOS from collapsing to zero width
     when calculating the wordmark box with heavy letter-spacing. */
  min-width: 80px;
  white-space: nowrap;
}

/* Hide wordmark on narrow screens to save space */
@media (max-width: 640px) {
  .logo-text {
    font-size: 9px;
    letter-spacing: 0.3em;
  }
}

/* ============ HAMBURGER MENU ============ */
.menu-toggle {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  width: 48px;
  height: 48px;
  background: transparent;
  border: 1px solid var(--line);
  border-radius: 50%;
  cursor: pointer;
  padding: 0;
  transition: all 0.3s ease;
  position: relative;
  z-index: 102;
}

.menu-toggle:hover {
  border-color: var(--navy);
  transform: scale(1.05);
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 1.5px;
  background: var(--navy);
  border-radius: 1px;
  transition: all 0.3s cubic-bezier(0.68, -0.6, 0.32, 1.6);
}

.menu-toggle span:nth-child(1) {
  margin-bottom: 5px;
}

.menu-toggle.active span:nth-child(1) {
  transform: translateY(3.5px) rotate(45deg);
}

.menu-toggle.active span:nth-child(2) {
  transform: translateY(-3px) rotate(-45deg);
}

/* Slide-in menu panel */
.menu-overlay {
  position: fixed;
  top: 0;
  right: 0;
  width: 100%;
  max-width: 480px;
  height: 100vh;
  background: var(--paper-warm);
  z-index: 101;
  transform: translateX(100%);
  transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
  display: flex;
  flex-direction: column;
  padding: 120px 64px 64px;
  border-left: 0.5px solid var(--line);
  box-shadow: -40px 0 80px -20px rgba(30, 42, 94, 0.08);
}

.menu-overlay.active {
  transform: translateX(0);
}

.menu-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(22, 31, 71, 0.3);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.4s ease;
}

.menu-backdrop.active {
  opacity: 1;
  pointer-events: auto;
}

.menu-link {
  display: block;
  font-family: 'Fraunces', serif;
  font-size: 36px;
  line-height: 1.2;
  font-weight: 400;
  color: var(--navy);
  text-decoration: none;
  padding: 12px 0;
  border-bottom: 0.5px solid rgba(0, 0, 0, 0.06);
  transition: color 0.2s ease, padding-left 0.3s ease;
  position: relative;
}

.menu-link::before {
  content: '';
  position: absolute;
  left: -20px;
  top: 50%;
  width: 8px;
  height: 8px;
  background: var(--teal);
  border-radius: 50%;
  opacity: 0;
  transform: translateY(-50%) scale(0.5);
  transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.menu-link:hover {
  color: var(--teal);
  padding-left: 16px;
}

.menu-link:hover::before {
  opacity: 1;
  transform: translateY(-50%) scale(1);
}

.menu-link.current {
  color: var(--ink-muted);
  cursor: default;
}

.menu-link.current:hover {
  padding-left: 0;
}

.menu-link.current::before {
  display: none;
}

.menu-link .accent {
  font-style: italic;
  color: var(--teal);
}

.menu-footer {
  margin-top: auto;
  padding-top: 32px;
  font-size: 13px;
  color: var(--ink-muted);
  line-height: 1.7;
}

.menu-footer a {
  color: var(--navy);
  text-decoration: none;
  font-weight: 500;
}

.menu-footer a:hover {
  color: var(--teal);
}

/* Stagger menu links on open */
.menu-overlay.active .menu-link {
  animation: slideInRight 0.6s cubic-bezier(0.65, 0, 0.35, 1) backwards;
}

.menu-overlay.active .menu-link:nth-child(1) { animation-delay: 0.1s; }
.menu-overlay.active .menu-link:nth-child(2) { animation-delay: 0.15s; }
.menu-overlay.active .menu-link:nth-child(3) { animation-delay: 0.2s; }
.menu-overlay.active .menu-link:nth-child(4) { animation-delay: 0.25s; }
.menu-overlay.active .menu-link:nth-child(5) { animation-delay: 0.3s; }

@keyframes slideInRight {
  from {
    opacity: 0;
    transform: translateX(20px);
  }
  to {
    opacity: 1;
    transform: translateX(0);
  }
}

/* ============ TYPOGRAPHY UTILITIES ============ */
.eyebrow {
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  font-weight: 500;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-muted);
  display: inline-flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 32px;
}

.eyebrow::before {
  content: '';
  display: inline-block;
  width: 32px;
  height: 1px;
  background: var(--ink-muted);
}

h1, h2, h3, h4 {
  font-family: 'Fraunces', serif;
  font-weight: 400;
  color: var(--navy);
  letter-spacing: -0.02em;
  line-height: 1.05;
}

p {
  font-family: 'Geist', sans-serif;
  color: var(--ink-soft);
}

.accent-teal {
  color: var(--teal);
  font-style: italic;
}

.underline-amber {
  position: relative;
  display: inline-block;
}

.underline-amber::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 4px;
  height: 12px;
  background: var(--amber);
  opacity: 0.35;
  z-index: -1;
  border-radius: 2px;
}

/* ============ INNER PAGE HERO (used by About, Services, Case Studies) ============ */
.page-hero {
  padding: 200px 0 100px;
  border-bottom: 0.5px solid var(--line);
}

.page-hero .eyebrow {
  opacity: 0;
  animation: pageHeroFade 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.3s forwards;
}

.page-hero .page-headline {
  font-size: clamp(56px, 7vw, 96px);
  margin-bottom: 32px;
  max-width: 900px;
  opacity: 0;
  animation: pageHeroFade 0.9s cubic-bezier(0.16, 1, 0.3, 1) 0.4s forwards;
}

.page-hero .page-subhead {
  font-family: 'Geist', sans-serif;
  font-size: 19px;
  font-weight: 400;
  line-height: 1.55;
  color: var(--ink-soft);
  max-width: 60ch;
  opacity: 0;
  animation: pageHeroFade 0.7s cubic-bezier(0.16, 1, 0.3, 1) 0.55s forwards;
}

@keyframes pageHeroFade {
  from { opacity: 0; transform: translateY(16px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============ SHARED CONTENT BLOCKS ============ */
.section {
  padding: 120px 0;
}

.section-title {
  font-size: clamp(42px, 5vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.025em;
  color: var(--navy);
  margin-bottom: 80px;
  max-width: 800px;
}

/* ============ BUTTONS ============ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--navy);
  color: var(--paper);
  border: none;
  padding: 18px 32px;
  border-radius: 100px;
  font-family: 'Geist', sans-serif;
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.01em;
  cursor: pointer;
  text-decoration: none;
  transition: all 0.3s ease;
}

.btn:hover {
  background: var(--navy-deep);
  transform: translateY(-2px);
  box-shadow: 0 12px 30px -8px rgba(30, 42, 94, 0.3);
}

.btn svg { transition: transform 0.3s ease; }
.btn:hover svg { transform: translateX(4px); }

.btn-amber {
  background: var(--amber);
  color: var(--navy);
}

.btn-amber:hover {
  background: #d97706;
  box-shadow: 0 12px 30px -8px rgba(245, 158, 11, 0.4);
}

/* ============ FOOTER ============ */
.footer {
  padding: 64px 0 48px;
  background: var(--paper-warm);
  border-top: 0.5px solid var(--line);
}

.footer-content {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  flex-wrap: wrap;
  gap: 32px;
  font-size: 13px;
  color: var(--ink-muted);
}

.footer-content .copyright {
  font-family: 'Geist', sans-serif;
}

.footer-content .tagline {
  font-family: 'Fraunces', serif;
  font-style: italic;
  font-size: 14px;
  letter-spacing: 0.04em;
}

/* ============ SCROLL REVEAL ANIMATION ============ */
.reveal {
  opacity: 0;
  transform: translateY(30px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}

/* ============ RESPONSIVE ============ */
@media (max-width: 768px) {
  .container {
    padding: 0 24px;
  }

  .nav {
    padding: 16px 24px;
  }

  .logo-svg {
    height: 56px;
  }

  .page-hero {
    padding: 140px 0 64px;
  }

  .section {
    padding: 80px 0;
  }

  .menu-overlay {
    padding: 100px 32px 48px;
  }

  .menu-link {
    font-size: 28px;
  }
}
