/* ─────────────────────────────────────────
   RESET
───────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }
html { scroll-behavior: smooth; -webkit-font-smoothing: antialiased; -moz-osx-font-smoothing: grayscale; }
img, video { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; }
ul, ol { list-style: none; }

/* ─────────────────────────────────────────
   DESIGN TOKENS
───────────────────────────────────────── */
:root {
  /* Colors — app dark mode CI */
  --color-text:           #e8ede6;
  --color-text-muted:     #6b7565;
  --color-text-subtle:    #4a5245;
  --color-background:     #0d110a;
  --color-surface:        #161a12;
  --color-surface-raised: #1c2118;
  --color-border:         #252b1f;
  --color-border-strong:  #323829;
  --color-primary:        #d4f042;
  --color-primary-hover:  #bfdc2a;
  --color-primary-muted:  #2a3a10;
  --color-secondary:      #6b7565;
  --color-secondary-hover:#8a9583;
  --color-accent:         #d4f042;
  --color-accent-hover:   #bfdc2a;
  --color-success:        #22c55e;
  --color-danger:         #ef4444;
  --color-warning:        #f59e0b;
  --color-info:           #3b82f6;

  /* Typography */
  --font-sans: 'Inter', system-ui, sans-serif;
  --font-mono: 'JetBrains Mono', monospace;
  --text-xs:   0.75rem;
  --text-sm:   0.875rem;
  --text-base: 1rem;
  --text-lg:   1.125rem;
  --text-xl:   1.25rem;
  --text-2xl:  1.5rem;
  --text-3xl:  1.875rem;
  --text-hero: clamp(1.8rem, 4vw, 3.2rem);
  --text-hero-sub: clamp(1.1rem, 2.5vw, 2rem);

  /* Spacing */
  --space-1:  0.25rem;
  --space-2:  0.5rem;
  --space-3:  0.75rem;
  --space-4:  1rem;
  --space-5:  1.25rem;
  --space-6:  1.5rem;
  --space-8:  2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;
  --space-28: 7rem;

  /* Layout */
  --radius-sm:     4px;
  --radius-md:     8px;
  --radius-lg:     12px;
  --radius-xl:     16px;
  --radius-full:   9999px;
  --shadow-sm:     0 1px 3px rgba(0,0,0,.3);
  --shadow-md:     0 4px 12px rgba(0,0,0,.4);
  --container-max: 1200px;
  --header-height: 64px;

  /* Z-index scale */
  --z-dropdown: 10;
  --z-header:   100;
  --z-modal:    200;
}

/* ─────────────────────────────────────────
   BASE
───────────────────────────────────────── */
body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--color-text);
  background: var(--color-background);
}

a { color: inherit; text-decoration: none; }
a, button { cursor: pointer; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }
}

/* ─────────────────────────────────────────
   TYPOGRAPHY
───────────────────────────────────────── */
.h1 { font-size: var(--text-3xl);  font-weight: 700; line-height: 1.2;  color: var(--color-text); letter-spacing: -0.02em; }
.h2 { font-size: var(--text-2xl);  font-weight: 700; line-height: 1.25; color: var(--color-text); letter-spacing: -0.02em; }
.h3 { font-size: var(--text-xl);   font-weight: 600; line-height: 1.3;  color: var(--color-text); }
.h4 { font-size: var(--text-lg);   font-weight: 600; line-height: 1.35; color: var(--color-text); }
.h5 { font-size: var(--text-base); font-weight: 600; line-height: 1.4;  color: var(--color-text); }
.h6 { font-size: var(--text-sm);   font-weight: 600; line-height: 1.4;  color: var(--color-text); }

.text-hero     { font-size: var(--text-hero); font-weight: 800; line-height: 1.1; color: var(--color-text); letter-spacing: -0.02em; }
.text-hero-sub { font-size: var(--text-hero-sub); font-weight: 600; color: var(--color-accent); }

.text-body    { font-size: var(--text-base); font-weight: 400; line-height: 1.6; color: var(--color-text); }
.text-lead    { font-size: var(--text-lg);   font-weight: 400; line-height: 1.6; color: var(--color-text-muted); }
.text-small   { font-size: var(--text-sm);   font-weight: 400; line-height: 1.5; color: var(--color-text); }
.text-caption { font-size: var(--text-sm);   font-weight: 400; color: var(--color-text-muted); }
.text-label   { font-size: var(--text-xs);   font-weight: 600; color: var(--color-text-muted); text-transform: uppercase; letter-spacing: .06em; font-family: var(--font-mono); }
.text-hint    { font-size: var(--text-xs);   font-weight: 400; color: var(--color-text-subtle); }
.text-mono    { font-family: var(--font-mono); font-size: var(--text-sm); }

/* Color modifiers — stack on top of any text class */
.text-muted   { color: var(--color-text-muted); }
.text-subtle  { color: var(--color-text-subtle); }
.text-success { color: var(--color-success); }
.text-danger  { color: var(--color-danger); }
.text-warning { color: var(--color-warning); }
.text-info    { color: var(--color-info); }
.text-primary { color: var(--color-primary); }
.text-accent  { color: var(--color-accent); }

/* ─────────────────────────────────────────
   SITE STRUCTURE
───────────────────────────────────────── */
.site-header {
  height: var(--header-height);
  position: sticky;
  top: 0;
  z-index: var(--z-header);
  background: rgba(13, 17, 10, 0.85);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  height: 100%;
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-8);
}

.site-logo {
  font-weight: 700;
  font-size: var(--text-base);
  color: var(--color-text);
  letter-spacing: -0.02em;
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-8);
  flex: 1;
}

.site-nav a {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  transition: color 0.15s;
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  white-space: nowrap;
}

.site-nav a:hover { color: var(--color-text); }

.site-wrapper {
  display: flex;
  min-height: calc(100vh - var(--header-height));
  flex-direction: column;
}

.site-main { flex: 1; min-width: 0; }

.container {
  max-width: var(--container-max);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

.container--left  { margin-left: 0; margin-right: auto; }
.container--right { margin-right: 0; margin-left: auto; }

.text-center { text-align: center; }
.text-left   { text-align: left; }
.text-right  { text-align: right; }

.section {
  display: flex;
  flex-direction: column;
  gap: var(--space-6);
  padding-top: var(--space-28);
  padding-bottom: var(--space-28);
  border-top: 1px solid var(--color-border);
}

.site-footer {
  border-top: 1px solid var(--color-border);
}

/* ─────────────────────────────────────────
   LAYOUT HELPERS
───────────────────────────────────────── */
.stack    { display: flex; flex-direction: column; gap: var(--space-4); }
.stack-sm { gap: var(--space-2); }
.stack-lg { gap: var(--space-8); }

.cluster  { display: flex; flex-wrap: wrap; gap: var(--space-3); align-items: center; }

.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); }
.grid-auto { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--space-6); }

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

/* ─────────────────────────────────────────
   MOBILE HEADER
───────────────────────────────────────── */
.btn-menu { display: none; }

@media (max-width: 768px) {
  .site-nav {
    display: none;
    position: absolute;
    top: var(--header-height);
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-4) var(--space-6);
    z-index: var(--z-header);
  }

  .site-nav--open { display: flex; }

  .site-nav a {
    padding: var(--space-3) 0;
    width: 100%;
    border-bottom: 1px solid var(--color-border);
  }

  .site-nav a:last-child { border-bottom: none; }

  .btn-menu { display: inline-flex; }

  .header-inner { position: relative; }
}
