/* ============================================
   ZELA CONSULTING — DESIGN SYSTEM
   Light/Dark · Institutional Elite
   ============================================ */

@import url('https://fonts.googleapis.com/css2?family=Playfair+Display:ital,wght@0,400;0,500;0,600;0,700;0,800;0,900;1,400;1,600;1,700&family=Inter:wght@300;400;500;600;700&family=Cormorant+Garamond:ital,wght@0,300;0,400;0,600;1,300;1,400&display=swap');

/* ─── TOKENS — LIGHT (default) ───────────── */
:root {
  /* Brand */
  --color-primary:        #a10b2d;
  --color-primary-hover:  #c41236;
  --color-primary-dim:    rgba(161, 11, 45, 0.10);
  --color-primary-glow:   rgba(161, 11, 45, 0.25);

  /* Backgrounds */
  --color-bg:             #FAFAF9;
  --color-bg-2:           #F2EDE8;
  --color-bg-3:           #EAE5E0;
  --color-bg-4:           #E0DBD6;
  --color-bg-card:        #FFFFFF;
  --color-bg-card-hover:  #F8F5F2;

  /* Text */
  --color-text:           #111111;
  --color-text-secondary: #4A4745;
  --color-text-muted:     #8A8280;
  --color-text-dim:       #C0BBB8;

  /* Borders */
  --color-border:         rgba(0,0,0,0.08);
  --color-border-hover:   rgba(0,0,0,0.16);
  --color-border-red:     rgba(161,11,45,0.35);

  --color-logo-gray:      #878387;
  --color-white:          #FFFFFF;
  --color-off-white:      #F5F0EB;

  /* Typography */
  --font-display:   'Playfair Display', 'Cormorant Garamond', Georgia, serif;
  --font-body:      'Inter', system-ui, -apple-system, sans-serif;
  --font-accent:    'Cormorant Garamond', Georgia, serif;

  /* Type Scale */
  --text-xs:   0.75rem;    /* 12px */
  --text-sm:   0.875rem;   /* 14px */
  --text-base: 1rem;       /* 16px */
  --text-md:   1.125rem;   /* 18px */
  --text-lg:   1.25rem;    /* 20px */
  --text-xl:   1.5rem;     /* 24px */
  --text-2xl:  2rem;       /* 32px */
  --text-3xl:  2.5rem;     /* 40px */
  --text-4xl:  3.25rem;    /* 52px */
  --text-5xl:  4.25rem;    /* 68px */
  --text-6xl:  5.5rem;     /* 88px */

  /* Spacing */
  --space-1:   4px;
  --space-2:   8px;
  --space-3:   12px;
  --space-4:   16px;
  --space-5:   20px;
  --space-6:   24px;
  --space-8:   32px;
  --space-10:  40px;
  --space-12:  48px;
  --space-16:  64px;
  --space-20:  80px;
  --space-24:  96px;
  --space-32:  128px;

  /* Radius */
  --radius-xs: 2px;
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 20px;

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.10);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.12);
  --shadow-xl:  0 16px 64px rgba(0,0,0,0.16);
  --shadow-red: 0 0 40px rgba(161,11,45,0.15);

  /* Theme transition */
  --theme-transition: background-color 0.3s ease, color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;

  /* Transitions */
  --trans-fast:   150ms cubic-bezier(0.4, 0, 0.2, 1);
  --trans-base:   250ms cubic-bezier(0.4, 0, 0.2, 1);
  --trans-slow:   400ms cubic-bezier(0.4, 0, 0.2, 1);
  --trans-spring: 500ms cubic-bezier(0.34, 1.56, 0.64, 1);

  /* Layout */
  --max-width:     1200px;
  --max-width-lg:  1400px;
  --gutter:        24px;
  --gutter-lg:     80px;
}

/* ─── TOKENS — DARK ──────────────────────── */
[data-theme="dark"] {
  --color-primary-dim:    rgba(161, 11, 45, 0.15);
  --color-primary-glow:   rgba(161, 11, 45, 0.35);

  --color-bg:             #0D0D0D;
  --color-bg-2:           #111111;
  --color-bg-3:           #161616;
  --color-bg-4:           #1c1c1c;
  --color-bg-card:        #131313;
  --color-bg-card-hover:  #181818;

  --color-text:           #F0EDE8;
  --color-text-secondary: #9A9490;
  --color-text-muted:     #5C5855;
  --color-text-dim:       #3A3836;

  --color-border:         rgba(255,255,255,0.06);
  --color-border-hover:   rgba(255,255,255,0.12);

  --shadow-sm:  0 1px 3px rgba(0,0,0,0.4);
  --shadow-md:  0 4px 16px rgba(0,0,0,0.5);
  --shadow-lg:  0 8px 32px rgba(0,0,0,0.6);
  --shadow-xl:  0 16px 64px rgba(0,0,0,0.7);
  --shadow-red: 0 0 40px rgba(161,11,45,0.2);
}

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

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

body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
  overflow-x: hidden;
  transition: var(--theme-transition);
}

*, *::before, *::after {
  transition: background-color 0.3s ease, border-color 0.3s ease, box-shadow 0.3s ease;
}

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

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

ul, ol {
  list-style: none;
}

button {
  cursor: pointer;
  border: none;
  background: none;
  font-family: inherit;
}

input, textarea, select {
  font-family: inherit;
}

/* ─── GRAIN TEXTURE OVERLAY ──────────────── */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' 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-size: 200px 200px;
  opacity: 0.03;
  pointer-events: none;
  z-index: 9999;
  mix-blend-mode: multiply;
  transition: none;
}

[data-theme="dark"] body::before {
  mix-blend-mode: overlay;
  opacity: 0.025;
}

/* ─── LAYOUT UTILITIES ───────────────────── */
.container {
  width: 100%;
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

@media (min-width: 1024px) {
  .container {
    padding: 0 var(--gutter-lg);
  }
}

.container-lg {
  width: 100%;
  max-width: var(--max-width-lg);
  margin: 0 auto;
  padding: 0 var(--gutter);
}

@media (min-width: 1024px) {
  .container-lg {
    padding: 0 var(--gutter-lg);
  }
}

/* ─── TYPOGRAPHY ─────────────────────────── */
.display-1 {
  font-family: var(--font-display);
  font-size: clamp(2.5rem, 6vw, var(--text-6xl));
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

.display-2 {
  font-family: var(--font-display);
  font-size: clamp(2rem, 4.5vw, var(--text-5xl));
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.01em;
}

.heading-1 {
  font-family: var(--font-display);
  font-size: clamp(1.75rem, 3.5vw, var(--text-4xl));
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

.heading-2 {
  font-family: var(--font-display);
  font-size: clamp(1.5rem, 2.5vw, var(--text-3xl));
  font-weight: 500;
  line-height: 1.25;
}

.heading-3 {
  font-family: var(--font-display);
  font-size: clamp(1.25rem, 2vw, var(--text-2xl));
  font-weight: 500;
  line-height: 1.3;
}

.body-lg {
  font-size: var(--text-md);
  line-height: 1.7;
  color: var(--color-text-secondary);
}

.body-base {
  font-size: var(--text-base);
  line-height: 1.7;
}

.body-sm {
  font-size: var(--text-sm);
  line-height: 1.6;
  color: var(--color-text-secondary);
}

.label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.label-red {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-primary);
}

/* ─── RED DOT ELEMENT ────────────────────── */
.red-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--color-primary);
  flex-shrink: 0;
}

.red-dot--lg {
  width: 12px;
  height: 12px;
}

.red-dot--xl {
  width: 20px;
  height: 20px;
}

.red-dot--pulse {
  animation: pulse-dot 2s ease-in-out infinite;
}

@keyframes pulse-dot {
  0%, 100% { box-shadow: 0 0 0 0 rgba(161,11,45,0.6); }
  50% { box-shadow: 0 0 0 8px rgba(161,11,45,0); }
}

/* ─── SECTION DIVIDER ────────────────────── */
.section-divider {
  display: flex;
  align-items: center;
  gap: var(--space-4);
  margin-bottom: var(--space-6);
}

.section-divider__line {
  width: 40px;
  height: 1px;
  background: var(--color-primary);
}

.section-divider__label {
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: var(--color-primary);
}

/* ─── BUTTONS ────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-body);
  font-size: var(--text-sm);
  font-weight: 600;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: all var(--trans-base);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  background: rgba(255,255,255,0.08);
  opacity: 0;
  transition: opacity var(--trans-fast);
}

.btn:hover::after {
  opacity: 1;
}

.btn-primary {
  background: var(--color-primary);
  color: var(--color-white);
  padding: 14px 32px;
  border: 1px solid var(--color-primary);
}

.btn-primary:hover {
  background: var(--color-primary-hover);
  border-color: var(--color-primary-hover);
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(161,11,45,0.35);
}

.btn-secondary {
  background: transparent;
  color: var(--color-text);
  padding: 13px 31px;
  border: 1px solid var(--color-border-hover);
}

.btn-secondary:hover {
  border-color: var(--color-primary);
  color: var(--color-primary);
  transform: translateY(-1px);
}

.btn-ghost {
  background: transparent;
  color: var(--color-text-secondary);
  padding: 10px 0;
  gap: var(--space-2);
  border-bottom: 1px solid transparent;
}

.btn-ghost:hover {
  color: var(--color-primary);
  border-bottom-color: var(--color-primary);
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid var(--color-border);
  transition: all var(--trans-base);
}

.btn-icon:hover {
  border-color: var(--color-primary);
  background: var(--color-primary-dim);
}

/* Arrow icon for buttons */
.btn-arrow {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  transition: gap var(--trans-base);
}

.btn:hover .btn-arrow {
  gap: var(--space-3);
}

/* ─── CARDS ──────────────────────────────── */
.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  transition: all var(--trans-base);
  position: relative;
  overflow: hidden;
}

.card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 2px;
  background: var(--color-primary);
  transform: scaleY(0);
  transition: transform var(--trans-base);
  transform-origin: bottom;
}

.card:hover {
  background: var(--color-bg-card-hover);
  border-color: var(--color-border-hover);
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.card:hover::before {
  transform: scaleY(1);
}

/* ─── BADGES ─────────────────────────────── */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 4px 10px;
  border-radius: var(--radius-xs);
  border: 1px solid;
}

.badge-red {
  color: var(--color-primary);
  border-color: rgba(161,11,45,0.4);
  background: rgba(161,11,45,0.08);
}

.badge-gray {
  color: var(--color-text-secondary);
  border-color: var(--color-border-hover);
  background: transparent;
}

/* ─── SECTION SPACING ────────────────────── */
.section {
  padding: var(--space-20) 0;
}

.section-lg {
  padding: var(--space-32) 0;
}

.section-sm {
  padding: var(--space-12) 0;
}

@media (max-width: 768px) {
  .section { padding: var(--space-16) 0; }
  .section-lg { padding: var(--space-20) 0; }
}

/* ─── GRID ───────────────────────────────── */
.grid-2 {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: var(--space-6);
}

.grid-3 {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-6);
}

.grid-4 {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: var(--space-6);
}

@media (max-width: 1024px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 640px) {
  .grid-2,
  .grid-3,
  .grid-4 { grid-template-columns: 1fr; }
}

/* ─── SCROLL ANIMATIONS ──────────────────── */
/* Reveal: JS adds .will-animate before observing, so elements visible without JS */
.reveal.will-animate {
  opacity: 0;
  transform: translateY(24px);
}

.reveal {
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.reveal-left.will-animate {
  opacity: 0;
  transform: translateX(-24px);
}

.reveal-left {
  transition: opacity 0.7s ease, transform 0.7s ease;
}

.reveal-left.visible {
  opacity: 1 !important;
  transform: translateX(0) !important;
}

.stagger > *.will-animate {
  opacity: 0;
  transform: translateY(20px);
}

.stagger > * {
  transition: opacity 0.6s ease, transform 0.6s ease;
}

.stagger.visible > *:nth-child(1) { transition-delay: 0ms; }
.stagger.visible > *:nth-child(2) { transition-delay: 80ms; }
.stagger.visible > *:nth-child(3) { transition-delay: 160ms; }
.stagger.visible > *:nth-child(4) { transition-delay: 240ms; }
.stagger.visible > *:nth-child(5) { transition-delay: 320ms; }
.stagger.visible > *:nth-child(6) { transition-delay: 400ms; }
.stagger.visible > * {
  opacity: 1 !important;
  transform: translateY(0) !important;
}

/* ─── HORIZONTAL RULE ────────────────────── */
.hr {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: var(--space-8) 0;
}

/* ─── CUSTOM SCROLLBAR ───────────────────── */
::-webkit-scrollbar {
  width: 6px;
}

::-webkit-scrollbar-track {
  background: var(--color-bg-2);
}

::-webkit-scrollbar-thumb {
  background: var(--color-bg-4);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-primary);
}

/* ─── SELECTION ──────────────────────────── */
::selection {
  background: var(--color-primary-dim);
  color: var(--color-text);
}

/* ─── FOCUS ──────────────────────────────── */
:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 2px;
}
