/* ============================================
   ANALYTICAL DATA SYSTEMS — Brand System
   ============================================ */

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

/* --- Variables --- */
:root {
  --bg-primary: #09090b;
  --bg-surface: #111114;
  --bg-elevated: #18181c;
  --bg-hover: #1e1e24;
  --border: #232329;
  --border-subtle: #1a1a20;

  --text-primary: #ececee;
  --text-secondary: #7d7d8a;
  --text-tertiary: #55555f;

  --accent: #c9a54e;
  --accent-hover: #dbb960;
  --accent-muted: rgba(201, 165, 78, 0.12);
  --accent-text: #0d0d0f;

  --link: #6b9aff;
  --link-hover: #8db3ff;

  --font-display: 'Instrument Serif', Georgia, serif;
  --font-body: 'Outfit', -apple-system, sans-serif;

  --max-width: 1200px;
  --content-width: 800px;
  --nav-height: 72px;

  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--link-hover);
}

/* --- Typography --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 400;
  line-height: 1.15;
  color: var(--text-primary);
}

h1 {
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(2rem, 4vw, 3rem);
  letter-spacing: -0.01em;
}

h3 {
  font-size: clamp(1.4rem, 2.5vw, 1.75rem);
}

h4 {
  font-size: 1.15rem;
  font-family: var(--font-body);
  font-weight: 600;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  font-size: 0.75rem;
  color: var(--accent);
}

p {
  color: var(--text-secondary);
  font-size: 1.05rem;
  max-width: 640px;
}

.text-large {
  font-size: clamp(1.15rem, 2vw, 1.35rem);
  line-height: 1.55;
}

/* --- Layout --- */
.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.container--narrow {
  max-width: var(--content-width);
  margin: 0 auto;
  padding: 0 2rem;
}

.container--720 {
  max-width: 720px;
  margin: 0 auto;
  padding: 0 2rem;
}

.container--780 {
  max-width: 780px;
  margin: 0 auto;
  padding: 0 2rem;
}

.container--860 {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 2rem;
}

section {
  padding: 7rem 0;
}

.section--flush-top {
  padding-top: 0;
}

.section-label {
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 1.5rem;
  display: block;
}

/* --- Navigation --- */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-height);
  background: rgba(9, 9, 11, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-subtle);
  z-index: 1000;
  transition: background 0.3s ease;
}

.nav__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 2rem;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.nav__logo {
  font-family: var(--font-body);
  font-weight: 700;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--text-primary);
  text-decoration: none;
}

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

.nav__links {
  display: flex;
  align-items: center;
  gap: 2.25rem;
  list-style: none;
}

.nav__divider {
  display: none;
}

.nav__links a {
  font-size: 0.82rem;
  font-weight: 500;
  color: var(--text-secondary);
  text-decoration: none;
  transition: color 0.2s ease;
  letter-spacing: 0.01em;
}

.nav__links a:hover,
.nav__links a.active {
  color: var(--text-primary);
}

.nav__cta {
  font-size: 0.8rem !important;
  font-weight: 600 !important;
  color: var(--accent) !important;
  border: 1px solid var(--accent);
  padding: 0.5rem 1.25rem;
  border-radius: 4px;
  transition: all 0.2s ease !important;
}

.nav__cta:hover {
  background: var(--accent);
  color: var(--accent-text) !important;
}

/* Mobile nav toggle */
.nav__toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: 0.5rem;
}

.nav__toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text-primary);
  margin: 5px 0;
  transition: all 0.3s ease;
}

/* --- Hero --- */
.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  padding-top: var(--nav-height);
  position: relative;
  overflow: hidden;
}

.hero::before {
  content: '';
  position: absolute;
  top: -20%;
  right: -15%;
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, var(--accent-muted) 0%, transparent 70%);
  pointer-events: none;
}

.hero__content {
  position: relative;
  z-index: 1;
  max-width: 780px;
}

.hero h1 {
  margin-bottom: 1.5rem;
}

.hero h1 em {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--accent);
}

.hero p {
  font-size: clamp(1.1rem, 2vw, 1.25rem);
  line-height: 1.7;
  margin-bottom: 2.5rem;
  max-width: 600px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: var(--font-body);
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.9rem 2rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: all 0.25s var(--ease-out);
  text-decoration: none;
  letter-spacing: 0.01em;
}

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

.btn--primary:hover {
  background: var(--accent-hover);
  color: var(--accent-text);
  transform: translateY(-1px);
  box-shadow: 0 4px 24px rgba(201, 165, 78, 0.2);
}

.btn--outline {
  background: transparent;
  color: var(--text-primary);
  border: 1px solid var(--border);
}

.btn--outline:hover {
  border-color: var(--text-secondary);
  color: var(--text-primary);
}

.btn__arrow {
  transition: transform 0.2s ease;
}

.btn:hover .btn__arrow {
  transform: translateX(3px);
}

/* --- Cards / Pillars --- */
.pillars {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1.5rem;
}

.pillar {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 2.5rem 2rem;
  transition: all 0.3s var(--ease-out);
  position: relative;
  overflow: hidden;
}

.pillar::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 2px;
  background: var(--accent);
  opacity: 0;
  transition: opacity 0.3s ease;
}

.pillar:hover {
  border-color: var(--border);
  transform: translateY(-2px);
}

.pillar:hover::before {
  opacity: 1;
}

.pillar__number {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--accent);
  opacity: 0.35;
  line-height: 1;
  margin-bottom: 1.5rem;
}

.pillar h3 {
  margin-bottom: 1rem;
  font-size: 1.5rem;
}

.pillar p {
  font-size: 0.95rem;
  line-height: 1.65;
}

.pillar__link {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-top: 1.5rem;
  font-size: 0.85rem;
  font-weight: 600;
  color: var(--accent);
  text-decoration: none;
  transition: gap 0.2s ease;
}

.pillar__link:hover {
  gap: 0.6rem;
  color: var(--accent-hover);
}

/* --- Credibility Strip --- */
.credibility {
  border-top: 1px solid var(--border-subtle);
  border-bottom: 1px solid var(--border-subtle);
  padding: 4rem 0;
}

.credibility__grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 2rem;
}

.credibility__item {
  text-align: center;
  padding: 0 1rem;
}

.credibility__value {
  font-family: var(--font-display);
  font-size: 2.5rem;
  color: var(--text-primary);
  line-height: 1;
  margin-bottom: 0.5rem;
}

.credibility__label {
  font-size: 0.82rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

/* --- CTA Section --- */
.cta-section {
  text-align: center;
  padding: 8rem 0;
}

.cta-section h2 {
  margin-bottom: 1rem;
}

.cta-section p {
  margin: 1rem auto 2.5rem;
  text-align: center;
}

/* --- Interior Page Header --- */
.page-header {
  padding-top: calc(var(--nav-height) + 5rem);
  padding-bottom: 4rem;
  border-bottom: 1px solid var(--border-subtle);
}

.page-header h1 {
  margin-bottom: 1rem;
}

.page-header p {
  font-size: clamp(1.05rem, 2vw, 1.2rem);
  max-width: 600px;
}

/* --- Service Tracks --- */
.track {
  padding: 5rem 0;
  border-bottom: 1px solid var(--border-subtle);
}

.track:last-of-type {
  border-bottom: none;
}

.track__header {
  margin-bottom: 3rem;
}

.track__header h2 {
  margin-bottom: 0.75rem;
}

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

.track__card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 6px;
  padding: 2rem;
  transition: border-color 0.3s ease;
}

.track__card:hover {
  border-color: var(--border);
}

.track__card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.track__card p {
  font-size: 0.92rem;
}

/* --- Case Studies --- */
.case-study {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 2.5rem;
  margin-bottom: 2rem;
  transition: border-color 0.3s ease;
}

.case-study:hover {
  border-color: var(--border);
}

.case-study__tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-muted);
  padding: 0.3rem 0.75rem;
  border-radius: 3px;
  margin-bottom: 1.25rem;
}

.case-study h3 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.case-study__meta {
  font-size: 0.85rem;
  color: var(--text-tertiary);
  margin-bottom: 1.25rem;
  font-style: italic;
}

.case-study p {
  font-size: 0.95rem;
  margin-bottom: 0.75rem;
}

.case-study__result {
  margin-top: 1.5rem;
  padding-top: 1.5rem;
  border-top: 1px solid var(--border-subtle);
}

.case-study__result strong {
  color: var(--text-primary);
  font-weight: 600;
}

/* --- Agent Page --- */
.agent-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1.5rem;
  margin-top: 3rem;
}

.agent-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 2.25rem;
  transition: all 0.3s var(--ease-out);
}

.agent-card:hover {
  border-color: var(--border);
  transform: translateY(-2px);
}

.agent-card__icon {
  width: 44px;
  height: 44px;
  background: var(--accent-muted);
  border-radius: 8px;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.25rem;
  font-size: 1.2rem;
}

.agent-card h3 {
  font-size: 1.2rem;
  margin-bottom: 0.75rem;
}

.agent-card p {
  font-size: 0.92rem;
}

/* Lifecycle */
.lifecycle {
  display: grid;
  grid-template-columns: repeat(6, 1fr);
  gap: 0;
  margin-top: 3rem;
  position: relative;
}

.lifecycle::before {
  content: '';
  position: absolute;
  top: 32px;
  left: 8%;
  right: 8%;
  height: 1px;
  background: var(--border);
}

.lifecycle__step {
  text-align: center;
  position: relative;
  padding: 0 0.5rem;
}

.lifecycle__dot {
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  margin: 0 auto 1.25rem;
  position: relative;
  z-index: 1;
  box-shadow: 0 0 0 4px var(--bg-primary), 0 0 0 5px var(--border);
}

.lifecycle__step h4 {
  font-size: 0.72rem;
  margin-bottom: 0.4rem;
  color: var(--text-primary);
  text-transform: none;
  font-weight: 600;
}

.lifecycle__step p {
  font-size: 0.78rem;
  color: var(--text-tertiary);
  line-height: 1.4;
}

/* --- Background Page --- */
.timeline {
  position: relative;
  padding-left: 2.5rem;
}

.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  bottom: 0;
  width: 1px;
  background: var(--border);
}

.timeline__entry {
  position: relative;
  margin-bottom: 3.5rem;
}

.timeline__entry::before {
  content: '';
  position: absolute;
  left: -2.5rem;
  top: 0.5rem;
  width: 8px;
  height: 8px;
  background: var(--accent);
  border-radius: 50%;
  transform: translateX(-3.5px);
}

.timeline__entry h3 {
  font-size: 1.35rem;
  margin-bottom: 0.25rem;
}

.timeline__period {
  font-size: 0.82rem;
  color: var(--text-tertiary);
  margin-bottom: 1rem;
}

.timeline__entry p {
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}

/* --- Contact Page --- */
.contact-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 4rem;
  margin-top: 3rem;
}

.contact__info h3 {
  font-size: 1.5rem;
  margin-bottom: 1.5rem;
}

.contact__method {
  margin-bottom: 2rem;
}

.contact__method h4 {
  color: var(--text-primary);
  margin-bottom: 0.4rem;
}

.contact__method p, .contact__method a {
  font-size: 0.95rem;
}

.contact-form label {
  display: block;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 0.5rem;
  letter-spacing: 0.03em;
}

.contact-form input,
.contact-form textarea {
  width: 100%;
  background: var(--bg-surface);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 0.85rem 1rem;
  font-family: var(--font-body);
  font-size: 0.95rem;
  color: var(--text-primary);
  margin-bottom: 1.25rem;
  transition: border-color 0.2s ease;
  outline: none;
}

.contact-form input:focus,
.contact-form textarea:focus {
  border-color: var(--accent);
}

.contact-form textarea {
  min-height: 140px;
  resize: vertical;
}

/* --- Footer --- */
.footer {
  border-top: 1px solid var(--border-subtle);
  padding: 3rem 0;
}

.footer__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
}

.footer__copy {
  font-size: 0.8rem;
  color: var(--text-tertiary);
}

.footer__links {
  display: flex;
  gap: 2rem;
  list-style: none;
}

.footer__links a {
  font-size: 0.8rem;
  color: var(--text-tertiary);
  transition: color 0.2s ease;
}

.footer__links a:hover {
  color: var(--text-secondary);
}

/* --- Animations --- */
@keyframes fadeUp {
  from {
    opacity: 0;
    transform: translateY(24px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-up {
  opacity: 0;
  animation: fadeUp 0.7s var(--ease-out) forwards;
}

.fade-up--d1 { animation-delay: 0.1s; }
.fade-up--d2 { animation-delay: 0.2s; }
.fade-up--d3 { animation-delay: 0.3s; }
.fade-up--d4 { animation-delay: 0.4s; }
.fade-up--d5 { animation-delay: 0.5s; }

/* Scroll-triggered animations */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.6s var(--ease-out), transform 0.6s var(--ease-out);
}

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

/* --- Divider --- */
.divider {
  width: 48px;
  height: 2px;
  background: var(--accent);
  margin: 2rem 0;
  opacity: 0.6;
}

/* Prose blocks for interior pages */
.prose p {
  margin-bottom: 1rem;
}

.prose p:last-child {
  margin-bottom: 0;
}

/* --- Callout Cards --- */
.callout-card {
  background: var(--bg-surface);
  border: 1px solid var(--border-subtle);
  border-radius: 8px;
  padding: 3rem;
}

.callout-card h3 {
  font-size: 1.4rem;
  margin-bottom: 1rem;
}

.callout-card--lg {
  padding: 3.5rem;
}

.callout-card--lg h3 {
  font-size: 1.75rem;
  margin-bottom: 0.75rem;
}

.callout-card--sm {
  padding: 2.25rem;
}

.callout-card--spaced {
  margin-bottom: 2rem;
}

.callout-card--centered {
  text-align: center;
}

/* CTA grid: text + button side-by-side, stacks on mobile */
.callout-cta {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 3rem;
  align-items: center;
}

/* Contact methods: 2-column grid, stacks on mobile */
.contact-methods {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

/* --- Utility: Prose narrow --- */
.prose--narrow {
  max-width: 680px;
}

/* --- Utility: Margins --- */
.mb-0 { margin-bottom: 0; }
.mb-sm { margin-bottom: 0.75rem; }
.mb-md { margin-bottom: 1rem; }
.mb-lg { margin-bottom: 1.5rem; }
.mb-3xl { margin-bottom: 3rem; }

/* --- Utility: Text --- */
.text-centered {
  text-align: center;
  margin-left: auto;
  margin-right: auto;
}

.text-muted {
  color: var(--text-tertiary);
  font-size: 0.85rem;
}

.text-accent-link {
  color: var(--accent);
  font-size: 0.95rem;
}

/* --- Responsive --- */
@media (max-width: 1024px) {
  .pillars {
    grid-template-columns: 1fr;
    max-width: 600px;
  }

  .credibility__grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem;
  }

  .track__grid {
    grid-template-columns: 1fr;
    max-width: 560px;
  }

  .lifecycle {
    grid-template-columns: repeat(2, 1fr);
    gap: 2rem;
  }

  .lifecycle::before {
    display: none;
  }
}

@media (max-width: 768px) {
  section {
    padding: 4.5rem 0;
  }

  .nav {
    background: #09090b;
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
  }

  .nav__links {
    display: none;
    position: fixed;
    top: var(--nav-height);
    left: 0;
    right: 0;
    bottom: 0;
    background: #09090b;
    background-color: #09090b;
    padding: 2rem;
    gap: 0;
    border-top: 1px solid var(--border);
    z-index: 9999;
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
    opacity: 1;
    overflow-y: auto;
  }

  .nav__links.open {
    display: block;
  }

  .nav__links::after {
    content: '';
    display: block;
    height: 2rem;
    height: calc(2rem + env(safe-area-inset-bottom, 0px));
  }

  .nav__links li {
    width: 100%;
    list-style: none;
  }

  .nav__links a:not(.nav__cta) {
    display: block;
    padding: 1rem 0;
    font-size: 1rem;
    color: var(--text-primary) !important;
    border-bottom: 1px solid var(--border-subtle);
  }

  .nav__cta {
    margin-top: 1rem;
    text-align: center;
    display: block;
    width: 100%;
    padding: 0.75rem 1.25rem !important;
    border: 1px solid var(--accent) !important;
    border-radius: 4px;
    color: var(--accent) !important;
    font-size: 1rem !important;
    font-weight: 600 !important;
    transition: color 0.2s ease, background 0.2s ease;
  }

  .nav__divider {
    display: block;
    border: none;
    border-top: 1px solid var(--border-subtle);
    margin: 1.5rem 0 0;
  }

  .nav__toggle {
    display: block;
  }

  .hero {
    min-height: auto;
    padding-top: calc(var(--nav-height) + 3rem);
    padding-bottom: 4rem;
  }

  .credibility__grid {
    grid-template-columns: 1fr 1fr;
    gap: 2rem;
  }

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

  .lifecycle {
    grid-template-columns: repeat(2, 1fr);
  }

  .contact-grid {
    grid-template-columns: 1fr;
    gap: 3rem;
  }

  .callout-cta {
    grid-template-columns: 1fr;
  }

  .contact-methods {
    grid-template-columns: 1fr;
  }

  .callout-card {
    padding: 2.25rem;
  }

  .footer__inner {
    flex-direction: column;
    gap: 1.5rem;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .container {
    padding: 0 1.25rem;
  }

  .credibility__grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

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

  .callout-card {
    padding: 1.75rem;
  }

  .callout-card--sm {
    padding: 1.5rem;
  }
}

/* --- Accessibility --- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }

  .reveal {
    opacity: 1;
    transform: none;
  }

  .fade-up {
    opacity: 1;
    animation: none;
  }
}
