/* style.css — Midnight Center Design Tokens & Components */

/* ========================================
   FONTS — Satoshi from Fontshare
   ======================================== */
@font-face {
  font-family: 'Satoshi';
  src: url('https://api.fontshare.com/v2/css?f[]=satoshi@400,500,700,900&display=swap') format('woff2');
  font-display: swap;
}

/* ========================================
   TYPE SCALE — Fluid with clamp()
   ======================================== */
:root {
  --text-xs:   clamp(0.75rem,  0.7rem  + 0.25vw, 0.875rem);
  --text-sm:   clamp(0.875rem, 0.8rem  + 0.35vw, 1rem);
  --text-base: clamp(1rem,     0.9rem  + 0.5vw,  1.125rem);
  --text-lg:   clamp(1.125rem, 0.95rem + 0.85vw, 1.5rem);
  --text-xl:   clamp(1.5rem,   1rem    + 1.5vw,  2.25rem);
  --text-2xl:  clamp(2rem,     1.2rem  + 2.5vw,  3.5rem);
  --text-3xl:  clamp(2.5rem,   1rem    + 4vw,    5rem);
  --text-hero: clamp(3rem,     0.5rem  + 7vw,    8rem);

  /* Font families */
  --font-display: 'Satoshi', system-ui, -apple-system, sans-serif;
  --font-body: 'Satoshi', system-ui, -apple-system, sans-serif;
}

/* ========================================
   SPACING — 4px system
   ======================================== */
:root {
  --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-32: 8rem;
}

/* ========================================
   COLOR PALETTE — Dark-first, Midnight Center
   ======================================== */

/* DARK MODE — PRIMARY (default) */
:root, [data-theme="dark"] {
  --color-bg:               #0a0a0a;
  --color-surface:          #111111;
  --color-surface-2:        #161616;
  --color-surface-offset:   #1a1a1a;
  --color-surface-offset-2: #222222;
  --color-surface-dynamic:  #2a2a2a;
  --color-divider:          #2e2e2e;
  --color-border:           #363636;

  --color-text:             #e0e0e0;
  --color-text-muted:       #888888;
  --color-text-faint:       #555555;
  --color-text-inverse:     #0a0a0a;

  /* Primary — Bright Teal (from logo) */
  --color-primary:          #2EECD2;
  --color-primary-hover:    #26d4bc;
  --color-primary-active:   #1fb8a3;
  --color-primary-highlight: rgba(46, 236, 210, 0.1);

  /* Semantic colors */
  --color-error:            #f87171;
  --color-error-hover:      #ef4444;
  --color-error-highlight:  rgba(248, 113, 113, 0.1);

  --color-success:          #4ade80;
  --color-success-hover:    #22c55e;
  --color-success-highlight: rgba(74, 222, 128, 0.1);

  --color-warning:          #fbbf24;
  --color-warning-hover:    #f59e0b;
  --color-warning-highlight: rgba(251, 191, 36, 0.1);

  /* Shadows — dark mode, darker */
  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.3);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.4);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.5);
}

/* LIGHT MODE — Secondary */
[data-theme="light"] {
  --color-bg:               #f5f5f5;
  --color-surface:          #ffffff;
  --color-surface-2:        #fafafa;
  --color-surface-offset:   #eeeeee;
  --color-surface-offset-2: #e8e8e8;
  --color-surface-dynamic:  #e0e0e0;
  --color-divider:          #d4d4d4;
  --color-border:           #c0c0c0;

  --color-text:             #1a1a1a;
  --color-text-muted:       #666666;
  --color-text-faint:       #999999;
  --color-text-inverse:     #f5f5f5;

  --color-primary:          #0d9b8a;
  --color-primary-hover:    #0a7d6f;
  --color-primary-active:   #086559;
  --color-primary-highlight: rgba(13, 155, 138, 0.08);

  --color-error:            #dc2626;
  --color-error-hover:      #b91c1c;
  --color-error-highlight:  rgba(220, 38, 38, 0.08);

  --color-success:          #16a34a;
  --color-success-hover:    #15803d;
  --color-success-highlight: rgba(22, 163, 74, 0.08);

  --color-warning:          #d97706;
  --color-warning-hover:    #b45309;
  --color-warning-highlight: rgba(217, 119, 6, 0.08);

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.08);
  --shadow-lg: 0 12px 32px rgba(0, 0, 0, 0.12);
}

/* ========================================
   SHARED TOKENS
   ======================================== */
:root {
  --radius-sm: 0.375rem;
  --radius-md: 0.5rem;
  --radius-lg: 0.75rem;
  --radius-xl: 1rem;
  --radius-full: 9999px;

  --transition-interactive: 180ms cubic-bezier(0.16, 1, 0.3, 1);

  --content-narrow: 640px;
  --content-default: 960px;
  --content-wide: 1200px;
  --content-full: 100%;
}

/* ========================================
   SCROLL ANIMATIONS — Opacity only (no CLS)
   ======================================== */
.fade-in {
  opacity: 1;
}

@supports (animation-timeline: scroll()) {
  .fade-in {
    opacity: 0;
    animation: reveal-fade linear both;
    animation-timeline: view();
    animation-range: entry 0% entry 100%;
  }
}

@keyframes reveal-fade {
  to { opacity: 1; }
}
