/* ============================================================
   QWM — Quick-Witted Management
   Design System v3
   ============================================================ */

/* === RESET === */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body { min-height: 100vh; line-height: 1.5; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; text-rendering: optimizeLegibility; }
img, picture, svg { max-width: 100%; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; border: none; background: none; color: inherit; }
input, textarea { font: inherit; color: inherit; }

/* === TOKENS === */
:root {
  --qwm-charcoal: #0B0B0C;
  --qwm-charcoal-2: #111114;
  --qwm-charcoal-3: #1A1A1C;
  --qwm-white: #F5F5F3;
  --qwm-white-90: rgba(245, 245, 243, 0.9);
  --qwm-white-60: rgba(245, 245, 243, 0.6);
  --qwm-white-50: rgba(245, 245, 243, 0.5);
  --qwm-white-40: rgba(245, 245, 243, 0.4);
  --qwm-white-30: rgba(245, 245, 243, 0.3);
  --qwm-white-20: rgba(245, 245, 243, 0.2);
  --qwm-white-10: rgba(245, 245, 243, 0.1);
  --qwm-white-05: rgba(245, 245, 243, 0.05);
  --qwm-gold: #C6A96B;
  --qwm-gold-soft: #D4BC85;
  --qwm-red: #8C1F28;
  --qwm-blue: #1F3A5F;

  --font-display: 'Playfair Display', 'Times New Roman', serif;
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-mono: 'IBM Plex Mono', 'Courier New', monospace;

  --pad-x: clamp(20px, 5vw, 80px);
  --section-y: clamp(80px, 12vw, 180px);
  --max-w: 1280px;
}

body {
  background: var(--qwm-charcoal);
  color: var(--qwm-white);
  font-family: var(--font-sans);
  font-weight: 400;
  overflow-x: hidden;
}

/* === GRAIN === */
.grain {
  position: fixed; inset: 0; pointer-events: none; z-index: 9999;
  opacity: 0.04; mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

/* === TYPOGRAPHY === */
.display-xl { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.03em; line-height: 1.04; font-size: clamp(40px, 6.5vw, 88px); }
.display-lg { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.025em; line-height: 1.08; font-size: clamp(34px, 4.8vw, 64px); }
.display-md { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.02em; line-height: 1.12; font-size: clamp(28px, 3.6vw, 48px); }
.display-sm { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.015em; line-height: 1.18; font-size: clamp(22px, 2.4vw, 32px); }

.metric-xl { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.04em; line-height: 0.92; font-size: clamp(48px, 7vw, 100px); }
.metric-lg { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.03em; line-height: 0.95; font-size: clamp(36px, 4.5vw, 64px); }
.metric-md { font-family: var(--font-display); font-weight: 500; letter-spacing: -0.025em; line-height: 1; font-size: clamp(28px, 3vw, 40px); }

.body-lg { font-size: clamp(16px, 1.15vw, 19px); line-height: 1.65; color: var(--qwm-white-60); font-weight: 400; }
.body-md { font-size: 15px; line-height: 1.65; color: var(--qwm-white-50); }
.body-sm { font-size: 13px; line-height: 1.65; color: var(--qwm-white-40); }

.micro {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--qwm-white-40);
}

.micro-gold { color: var(--qwm-gold); }

/* === LAYOUT === */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 0 var(--pad-x);
}

.section {
  padding: var(--section-y) 0;
  position: relative;
}

/* === ACCENTS === */
.gold-line {
  width: 64px; height: 1px;
  background: var(--qwm-gold);
  display: block;
}

.gold-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--qwm-gold);
  display: inline-block;
}

.divider-thin {
  height: 1px;
  background: var(--qwm-white-10);
  width: 100%;
}

/* === BUTTONS === */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 28px;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 13px;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  transition: all 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
  cursor: pointer;
  border: 1px solid transparent;
}

.btn-primary {
  background: var(--qwm-gold);
  color: var(--qwm-charcoal);
}
.btn-primary:hover {
  background: var(--qwm-white);
  transform: translateY(-1px);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--qwm-white-30);
  color: var(--qwm-white);
}
.btn-outline:hover {
  border-color: var(--qwm-white);
  background: var(--qwm-white-05);
}

.btn-ghost {
  padding: 0;
  background: transparent;
  color: var(--qwm-gold);
  border: none;
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  position: relative;
}
.btn-ghost::after {
  content: ''; position: absolute; bottom: -4px; left: 0;
  height: 1px; width: 100%;
  background: var(--qwm-gold);
  transform-origin: right;
  transition: transform 0.5s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.btn-ghost:hover { color: var(--qwm-white); }
.btn-ghost:hover::after { background: var(--qwm-white); transform: scaleX(0.4); transform-origin: left; }

/* === NAVIGATION === */
.nav {
  position: fixed; top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 14px 0;
  background: rgba(11, 11, 12, 0.7);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--qwm-white-05);
}
.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.nav-logo {
  display: inline-flex;
  align-items: center;
  height: 72px;
  text-decoration: none;
  flex-shrink: 0;
  padding: 4px 0;
}
.nav-logo img {
  height: 100%;
  width: auto;
  display: block;
  object-fit: contain;
}
@media (max-width: 768px) {
  .nav-logo { height: 56px; }
}
.nav-logo-text {
  font-family: var(--font-display);
  font-weight: 500;
  font-size: 20px;
  letter-spacing: 0.02em;
  color: var(--qwm-white);
}
.nav-logo-text .gold { color: var(--qwm-gold); }

.nav-links {
  display: flex;
  align-items: center;
  gap: 36px;
  list-style: none;
}
.nav-link {
  font-family: var(--font-mono);
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--qwm-white-50);
  transition: color 0.3s;
  position: relative;
  padding: 8px 0;
}
.nav-link:hover, .nav-link.active { color: var(--qwm-white); }
.nav-link.active::after {
  content: ''; position: absolute; bottom: 0; left: 0; right: 0;
  height: 1px; background: var(--qwm-gold);
}

.nav-cta {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--qwm-gold);
  border-bottom: 1px solid var(--qwm-gold);
  padding-bottom: 4px;
  transition: all 0.3s;
}
.nav-cta:hover { color: var(--qwm-white); border-color: var(--qwm-white); }

.nav-toggle {
  display: none;
  width: 32px; height: 24px;
  position: relative;
}
.nav-toggle span {
  position: absolute; left: 0; right: 0;
  height: 1px; background: var(--qwm-white);
  transition: all 0.3s;
}
.nav-toggle span:nth-child(1) { top: 4px; }
.nav-toggle span:nth-child(2) { top: 12px; }
.nav-toggle span:nth-child(3) { top: 20px; }
.nav-toggle.open span:nth-child(1) { top: 12px; transform: rotate(45deg); }
.nav-toggle.open span:nth-child(2) { opacity: 0; }
.nav-toggle.open span:nth-child(3) { top: 12px; transform: rotate(-45deg); }

@media (max-width: 768px) {
  .nav-toggle { display: block; }
  .nav-links {
    position: fixed; top: 73px; left: 0; right: 0;
    background: var(--qwm-charcoal);
    flex-direction: column;
    padding: 40px var(--pad-x);
    gap: 28px;
    transform: translateY(-150%);
    transition: transform 0.4s cubic-bezier(0.2, 0.8, 0.2, 1);
    border-bottom: 1px solid var(--qwm-white-10);
  }
  .nav-links.open { transform: translateY(0); }
  .nav-cta { display: none; }
}

/* === HERO === */
.hero {
  min-height: 100vh;
  position: relative;
  display: flex;
  align-items: flex-end;
  padding-bottom: clamp(60px, 10vw, 120px);
  padding-top: 140px;
  overflow: hidden;
}
.hero-bg {
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 30% 20%, rgba(31, 58, 95, 0.18) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 80%, rgba(140, 31, 40, 0.10) 0%, transparent 60%),
    linear-gradient(180deg, var(--qwm-charcoal) 0%, #050506 100%);
}
.hero-svg {
  position: absolute; inset: 0;
  opacity: 0.5;
}

/* === FOOTER === */
.footer {
  background: var(--qwm-charcoal);
  border-top: 1px solid var(--qwm-white-05);
  padding: 80px 0 40px;
}
.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr 1fr;
  gap: 60px;
  margin-bottom: 60px;
}
@media (max-width: 768px) {
  .footer-grid { grid-template-columns: 1fr 1fr; gap: 40px; }
}
@media (max-width: 540px) {
  .footer-grid { grid-template-columns: 1fr; gap: 40px; }
}
.footer-brand .footer-logo {
  display: block;
  margin-bottom: 28px;
}
.footer-brand .footer-logo img {
  height: 96px;
  width: auto;
  display: block;
}
.footer-tag {
  color: var(--qwm-white-50);
  font-size: 14px;
  line-height: 1.7;
  max-width: 320px;
  font-family: var(--font-sans);
  font-weight: 400;
}
.footer-col h4 {
  font-family: var(--font-sans);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--qwm-gold);
  margin-bottom: 24px;
}
.footer-col ul { list-style: none; }
.footer-col li { margin-bottom: 14px; }
.footer-col a,
.footer-col span {
  color: var(--qwm-white-60);
  font-size: 14px;
  line-height: 1.5;
  font-family: var(--font-sans);
  font-weight: 400;
  transition: color 0.3s;
  display: inline-block;
}
.footer-col a:hover { color: var(--qwm-white); }

.footer-cta {
  display: inline-flex !important;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  background: var(--qwm-gold);
  color: var(--qwm-charcoal) !important;
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 12px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-top: 8px;
  white-space: nowrap;
  transition: all 0.3s;
}
.footer-cta:hover {
  background: var(--qwm-white);
  color: var(--qwm-charcoal) !important;
  transform: translateY(-1px);
}

.footer-bottom {
  padding-top: 32px;
  border-top: 1px solid var(--qwm-white-05);
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 13px;
  color: var(--qwm-white-40);
  font-family: var(--font-sans);
  font-weight: 400;
  letter-spacing: 0.02em;
}
@media (max-width: 600px) {
  .footer-bottom { flex-direction: column; gap: 12px; text-align: center; }
}

/* === CARDS === */
.card-grid {
  display: grid;
  gap: 1px;
  background: var(--qwm-white-05);
}
.card-grid > * {
  background: var(--qwm-charcoal);
  padding: clamp(28px, 4vw, 56px);
}

/* === SCROLL REVEAL === */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 1s cubic-bezier(0.2, 0.8, 0.2, 1), transform 1s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.reveal.visible {
  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; }
.reveal-delay-5 { transition-delay: 0.5s; }

/* === DOSSIER ELEMENTS === */
.dossier-mark {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--qwm-white-40);
}

.classified-band {
  display: inline-flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  border: 1px solid var(--qwm-gold);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--qwm-gold);
}

/* === FORM === */
.form-field { margin-bottom: 28px; }
.form-label {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--qwm-white-50);
  margin-bottom: 12px;
}
.form-input, .form-textarea, .form-select {
  width: 100%;
  background: transparent;
  border: none;
  border-bottom: 1px solid var(--qwm-white-20);
  padding: 12px 0;
  color: var(--qwm-white);
  font-family: var(--font-sans);
  font-size: 16px;
  transition: border-color 0.3s;
}
.form-textarea { min-height: 120px; resize: vertical; }
.form-input:focus, .form-textarea:focus, .form-select:focus {
  outline: none;
  border-bottom-color: var(--qwm-gold);
}
.form-input::placeholder, .form-textarea::placeholder {
  color: var(--qwm-white-30);
}
.form-select {
  appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg width='12' height='8' viewBox='0 0 12 8' fill='none' xmlns='http://www.w3.org/2000/svg'%3E%3Cpath d='M1 1L6 6L11 1' stroke='%23F5F5F3' stroke-opacity='0.5' stroke-linecap='square'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 8px center;
  padding-right: 32px;
  cursor: pointer;
}
.form-select option { background: var(--qwm-charcoal); color: var(--qwm-white); }

/* === RESPONSIVE GRID HELPERS === */
.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(40px, 6vw, 96px); align-items: center; }
.grid-2-cards { grid-template-columns: 1fr 1fr; }
.grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: clamp(32px, 4vw, 64px); }
.grid-4 { display: grid; grid-template-columns: repeat(4, 1fr); gap: clamp(24px, 3vw, 48px); }
.grid-5 { display: grid; grid-template-columns: repeat(5, 1fr); gap: clamp(24px, 3vw, 48px); }

/* Step grid-5 down progressively so it doesn't overflow */
@media (max-width: 1500px) {
  .grid-5 { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 900px) {
  .grid-2 { grid-template-columns: 1fr; gap: 48px; }
  .grid-2-cards { grid-template-columns: 1fr !important; }
  .grid-3 { grid-template-columns: 1fr; gap: 48px; }
  .grid-4 { grid-template-columns: 1fr 1fr; gap: 40px; }
  .grid-5 { grid-template-columns: 1fr 1fr; gap: 40px; }
  /* Inline grids that need to collapse */
  .stack-mobile { grid-template-columns: 1fr !important; gap: 32px !important; }
  .grid-2.principal-grid { grid-template-columns: 1fr !important; }
  [data-stack="mobile"] { grid-template-columns: 1fr !important; gap: 24px !important; }
}
@media (max-width: 600px) {
  .grid-4 { grid-template-columns: 1fr; gap: 0; }
  .grid-5 { grid-template-columns: 1fr; gap: 0; }
}

/* === UTILITIES === */
.mt-sm { margin-top: 16px; }
.mt-md { margin-top: 32px; }
.mt-lg { margin-top: 48px; }
.mt-xl { margin-top: 80px; }
.mb-sm { margin-bottom: 16px; }
.mb-md { margin-bottom: 32px; }
.mb-lg { margin-bottom: 48px; }
.mb-xl { margin-bottom: 80px; }

.text-white { color: var(--qwm-white); }
.text-white-60 { color: var(--qwm-white-60); }
.text-white-40 { color: var(--qwm-white-40); }
.text-gold { color: var(--qwm-gold); }
.text-center { text-align: center; }
.max-w-2xl { max-width: 640px; }
.max-w-3xl { max-width: 768px; }
.max-w-4xl { max-width: 896px; }
.max-w-5xl { max-width: 1024px; }
