/* ═══════════════════════════════════════════
   WALDMAN SYSTEMS — Design System
   ═══════════════════════════════════════════ */

@import url('https://fonts.googleapis.com/css2?family=Syne:wght@400;600;700;800&family=DM+Sans:ital,opsz,wght@0,9..40,300;0,9..40,400;0,9..40,500;1,9..40,300&display=swap');

/* ── THEME VARIABLES ── */
:root {
  --bg:         #f5f2ec;
  --bg2:        #edeae2;
  --surface:    #ffffff;
  --surface2:   #f0ece4;
  --ink:        #1a1814;
  --ink2:       #3d3a34;
  --muted:      #8a8478;
  --accent:     #1a3a2a;
  --accent-h:   #254d38;
  --gold:       #b5862a;
  --gold-h:     #c9962e;
  --line:       rgba(26,24,20,0.11);
  --line-s:     rgba(26,24,20,0.06);
  --nav-bg:     rgba(245,242,236,0.9);
  --shadow-sm:  0 2px 12px rgba(26,24,20,0.06);
  --shadow-md:  0 6px 32px rgba(26,24,20,0.10);
  --shadow-lg:  0 16px 64px rgba(26,24,20,0.13);
  --btn-fg:     #f5f2ec;
  --radius:     6px;
  --transition: 0.2s ease;
}

[data-theme="dark"] {
  --bg:         #080b10;
  --bg2:        #0c1018;
  --surface:    #111622;
  --surface2:   #161d2c;
  --ink:        #e2e6f0;
  --ink2:       #a8afc4;
  --muted:      #5c647a;
  --accent:     #3ecfa8;
  --accent-h:   #50ddb6;
  --gold:       #d4a442;
  --gold-h:     #e6b84a;
  --line:       rgba(255,255,255,0.07);
  --line-s:     rgba(255,255,255,0.03);
  --nav-bg:     rgba(8,11,16,0.92);
  --shadow-sm:  0 2px 12px rgba(0,0,0,0.3);
  --shadow-md:  0 6px 32px rgba(0,0,0,0.4);
  --shadow-lg:  0 16px 64px rgba(0,0,0,0.5);
  --btn-fg:     #080b10;
}

/* ── RESET ── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: 'DM Sans', sans-serif;
  font-weight: 300;
  line-height: 1.65;
  overflow-x: hidden;
  transition: background var(--transition), color var(--transition);
}

/* Grain texture overlay */
body::after {
  content: '';
  position: fixed; inset: 0;
  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)' opacity='0.025'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 9999;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }

/* ── TYPOGRAPHY ── */
h1, h2, h3, h4 {
  font-family: 'Syne', sans-serif;
  line-height: 1.08;
  letter-spacing: -0.02em;
}

.eyebrow {
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--gold);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  margin-bottom: 1rem;
}
.eyebrow::before {
  content: '';
  display: block;
  width: 24px; height: 1px;
  background: var(--gold);
  flex-shrink: 0;
}

/* ── NAVIGATION ── */
nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 1000;
  height: 68px;
  display: flex;
  align-items: center;
  padding: 0 4rem;
  background: var(--nav-bg);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--line);
  transition: background var(--transition);
}

.nav-logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.05rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
  margin-right: 3rem;
  transition: opacity var(--transition);
}
.nav-logo:hover { opacity: 0.75; }
.nav-logo span { color: var(--gold); }

.nav-center {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  flex: 1;
}

.nav-link {
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  color: var(--muted);
  padding: 0.45rem 0.8rem;
  border-radius: 4px;
  transition: color var(--transition), background var(--transition);
  white-space: nowrap;
}
.nav-link:hover, .nav-link.active { color: var(--ink); background: var(--line-s); }

/* Dropdown */
.nav-dropdown { position: relative; }

.nav-dropdown-toggle {
  display: flex;
  align-items: center;
  gap: 0.3rem;
  cursor: pointer;
}
.nav-dropdown-toggle svg { transition: transform 0.2s; }
.nav-dropdown:hover .nav-dropdown-toggle svg { transform: rotate(180deg); }

.dropdown-menu {
  position: absolute;
  top: calc(100% + 12px);
  left: 50%;
  transform: translateX(-50%) translateY(-6px);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 0.5rem;
  min-width: 230px;
  box-shadow: var(--shadow-md);
  opacity: 0;
  visibility: hidden;
  transition: all 0.2s ease;
  pointer-events: none;
}
.nav-dropdown:hover .dropdown-menu {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
  pointer-events: all;
}

.dropdown-item {
  display: flex;
  flex-direction: column;
  padding: 0.65rem 0.9rem;
  border-radius: 4px;
  color: var(--ink2);
  font-size: 0.83rem;
  transition: background var(--transition), color var(--transition);
  gap: 0.15rem;
}
.dropdown-item:hover { background: var(--bg2); color: var(--ink); }
.dropdown-item small {
  font-size: 0.72rem;
  color: var(--muted);
  font-weight: 300;
}
.dropdown-item:hover small { color: var(--muted); }

.nav-right {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: auto;
}

/* Theme toggle */
.theme-toggle {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--muted);
  transition: color var(--transition), background var(--transition), border-color var(--transition);
}
.theme-toggle:hover { color: var(--ink); background: var(--line-s); }

/* Mobile nav toggle */
.nav-hamburger {
  display: none;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
  padding: 6px;
  background: none;
  border: none;
}
.nav-hamburger span {
  display: block;
  width: 22px; height: 2px;
  background: var(--ink);
  border-radius: 2px;
  transition: all 0.3s;
}

/* Mobile menu */
.mobile-menu {
  display: none;
  position: fixed;
  top: 68px; left: 0; right: 0;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
  padding: 1.5rem 2rem 2rem;
  box-shadow: var(--shadow-md);
  z-index: 999;
  flex-direction: column;
  gap: 0.25rem;
}
.mobile-menu.open { display: flex; }
.mobile-menu a {
  font-size: 1rem;
  font-weight: 500;
  color: var(--ink2);
  padding: 0.75rem 0.5rem;
  border-bottom: 1px solid var(--line-s);
}
.mobile-menu a:last-child { border-bottom: none; }

/* ── BUTTONS ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  font-family: 'Syne', sans-serif;
  font-weight: 700;
  font-size: 0.78rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.75rem 1.8rem;
  border-radius: 4px;
  border: none;
  cursor: pointer;
  transition: all 0.2s;
  text-decoration: none;
  white-space: nowrap;
}

.btn-primary {
  background: var(--accent);
  color: var(--btn-fg);
}
.btn-primary:hover { background: var(--accent-h); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.btn-gold {
  background: var(--gold);
  color: #fff;
}
.btn-gold:hover { background: var(--gold-h); transform: translateY(-1px); box-shadow: var(--shadow-sm); }

.btn-outline {
  background: transparent;
  color: var(--ink);
  border: 1px solid var(--line);
}
.btn-outline:hover { background: var(--line-s); border-color: var(--muted); transform: translateY(-1px); }

.btn-ghost {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--accent);
  padding: 0.7rem 1.6rem;
}
.btn-ghost:hover { background: var(--accent); color: var(--btn-fg); }

/* ── LAYOUT ── */
.page-wrap {
  padding-top: 68px;
}

.container {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 4rem;
}

.section { padding: 7rem 0; }
.section-sm { padding: 5rem 0; }

/* ── PAGE HERO ── */
.page-hero {
  background: var(--bg2);
  padding: 6rem 0 5rem;
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  font-size: clamp(2.5rem, 5vw, 4.5rem);
  font-weight: 800;
  color: var(--ink);
  margin-bottom: 1.2rem;
}

.page-hero p {
  font-size: 1.1rem;
  color: var(--ink2);
  max-width: 560px;
  line-height: 1.75;
}

/* ── DIVIDER ── */
.divider { height: 1px; background: var(--line); }

/* ── CARDS ── */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 2.5rem;
  transition: background var(--transition), box-shadow var(--transition), transform var(--transition);
}
.card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }

.card-accent-top::before {
  content: '';
  display: block;
  height: 3px;
  background: linear-gradient(90deg, var(--accent), var(--gold));
  border-radius: var(--radius) var(--radius) 0 0;
  margin: -2.5rem -2.5rem 2rem;
}

/* ── GRID UTILITIES ── */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 2rem; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem; }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem; }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 2rem; }

/* ── STAT BAR ── */
.stat-bar {
  display: flex;
  justify-content: center;
  gap: 5rem;
  flex-wrap: wrap;
  padding: 2.5rem 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.stat .num {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 2.2rem;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 0.25rem;
}
.stat .lbl {
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 500;
}

/* ── TAGS ── */
.tag {
  display: inline-block;
  font-size: 0.7rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.25rem 0.7rem;
  border-radius: 3px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
  border: 1px solid color-mix(in srgb, var(--accent) 25%, transparent);
}

/* ── FOOTER ── */
footer {
  background: var(--ink);
  color: rgba(245,242,236,0.5);
  padding: 3rem 4rem 2rem;
  transition: background var(--transition);
}

[data-theme="dark"] footer { background: #030507; }

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 3rem;
  margin-bottom: 3rem;
  padding-bottom: 3rem;
  border-bottom: 1px solid rgba(255,255,255,0.08);
}

.footer-brand .logo {
  font-family: 'Syne', sans-serif;
  font-weight: 800;
  font-size: 1.1rem;
  color: rgba(245,242,236,0.9);
  margin-bottom: 0.8rem;
}
.footer-brand .logo span { color: var(--gold); }
.footer-brand p { font-size: 0.85rem; line-height: 1.7; }

.footer-col h4 {
  font-family: 'Syne', sans-serif;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(245,242,236,0.5);
  margin-bottom: 1rem;
}

.footer-col a {
  display: block;
  font-size: 0.85rem;
  color: rgba(245,242,236,0.65);
  margin-bottom: 0.5rem;
  transition: color 0.15s;
}
.footer-col a:hover { color: rgba(245,242,236,0.95); }

.footer-bottom {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 0.78rem;
  flex-wrap: wrap;
  gap: 0.5rem;
}

/* ── FADE-IN ANIMATIONS ── */
.fade-up {
  opacity: 0;
  transform: translateY(20px);
  animation: fadeUp 0.65s ease forwards;
}
@keyframes fadeUp { to { opacity: 1; transform: translateY(0); } }

.fade-up:nth-child(1) { animation-delay: 0.08s; }
.fade-up:nth-child(2) { animation-delay: 0.18s; }
.fade-up:nth-child(3) { animation-delay: 0.28s; }
.fade-up:nth-child(4) { animation-delay: 0.38s; }
.fade-up:nth-child(5) { animation-delay: 0.48s; }
.fade-up:nth-child(6) { animation-delay: 0.58s; }

/* ── RESPONSIVE ── */
@media (max-width: 1024px) {
  nav { padding: 0 2rem; }
  .container { padding: 0 2rem; }
  footer { padding: 2.5rem 2rem 1.5rem; }
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 2rem; }
  .grid-3 { grid-template-columns: 1fr 1fr; }
  .grid-4 { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 768px) {
  .nav-center, .nav-right .btn { display: none; }
  .nav-hamburger { display: flex; }
  .nav-right { gap: 0.5rem; }
  .container { padding: 0 1.5rem; }
  .section { padding: 5rem 0; }
  .grid-2, .grid-3, .grid-4 { grid-template-columns: 1fr; }
  .stat-bar { gap: 2.5rem; }
  footer { padding: 2rem 1.5rem; }
  .footer-grid { grid-template-columns: 1fr; gap: 2rem; }
  .footer-bottom { flex-direction: column; text-align: center; }
  .page-hero { padding: 4rem 0 3rem; }
}
