/* ========================================
   DESIGN SYSTEM — Variables
   ======================================== */

/* === ACCENT CYCLING === */
@property --accent-hue {
  syntax: '<number>';
  initial-value: 220;
  inherits: true;
}

@keyframes cycleAccent {
  0%   { --accent-hue: 220; } /* blue #0055FF */
  33%  { --accent-hue: 258; } /* violet #8B5CF6 */
  66%  { --accent-hue: 160; } /* emerald #10B981 */
  100% { --accent-hue: 220; } /* back to blue */
}

:root {
  /* === PALETTE === */
  --black:        #050505;
  --black-rich:   #0A0A0B;
  --white:        #EDEDED;
  --white-soft:   #D4D4D4;

  /* Cycling accent */
  --accent:       hsl(var(--accent-hue), 100%, 55%);
  --accent-hover: hsl(var(--accent-hue), 100%, 65%);
  --accent-glow:  hsl(var(--accent-hue), 100%, 75%);
  --accent-muted: hsl(var(--accent-hue), 60%, 25%);
  /* the accent as words: a lighter step of the same cycling colour, so small text reads at 4.5:1 on
     black through the whole cycle (55% gives 4.25:1 in blue and less in violet; quality pass, 2026-10-27) */
  --accent-text: hsl(var(--accent-hue), 100%, 68%);

  /* Static blue fallback for specific uses */
  --blue:         #0055FF;
  --blue-bright:  #2979FF;
  --blue-glow:    #4D94FF;
  --blue-dark:    #003ECB;

  /* Neutrals */
  --gray-950:     #0E0E0F;
  --gray-900:     #141415;
  --gray-800:     #1C1C1E;
  --gray-700:     #2C2C2E;
  --gray-600:     #3A3A3C;
  --gray-500:     #545456;
  --gray-400:     #7C7C80;
  --gray-300:     #A1A1A6;
  --gray-200:     #C7C7CC;

  /* Semantic */
  --bg:           var(--black);
  --bg-elevated:  var(--gray-950);
  --bg-card:      var(--gray-900);
  --text:         var(--white);
  --text-dim:     var(--gray-300);
  /* muted words: 5:1 or more on the page, the cards and the raised panels (gray-500 read 2.7:1) */
  --text-muted:   #88888D;

  /* Borders */
  --border-hair:   1px solid rgba(255, 255, 255, 0.06);
  --border-subtle: 1px solid rgba(255, 255, 255, 0.10);
  --border-medium: 1px solid rgba(255, 255, 255, 0.18);
  --border-strong: 2px solid var(--white);

  /* === TYPOGRAPHY === */
  --font-display: 'Syne', sans-serif;
  --font-body:    'Outfit', sans-serif;
  --font-mono:    'Space Mono', monospace;

  /* Fluid Type Scale */
  --text-xs:    clamp(0.6875rem, 0.65rem + 0.19vw, 0.8125rem);
  --text-sm:    clamp(0.8125rem, 0.76rem + 0.26vw, 0.9375rem);
  --text-base:  clamp(0.9375rem, 0.88rem + 0.31vw, 1.0625rem);
  --text-lg:    clamp(1.0625rem, 0.96rem + 0.52vw, 1.3125rem);
  --text-xl:    clamp(1.375rem, 1.15rem + 1.13vw, 1.875rem);
  --text-2xl:   clamp(1.75rem, 1.35rem + 2vw, 2.75rem);
  --text-3xl:   clamp(2.25rem, 1.6rem + 3.25vw, 4rem);
  --text-4xl:   clamp(2.75rem, 1.8rem + 4.75vw, 5.5rem);
  --text-hero:  clamp(3.25rem, 1.5rem + 7vw, 7rem);

  /* Leading */
  --leading-none:    0.95;
  --leading-tight:   1.05;
  --leading-snug:    1.25;
  --leading-normal:  1.6;
  --leading-relaxed: 1.75;

  /* Tracking */
  --tracking-tighter: -0.04em;
  --tracking-tight:   -0.02em;
  --tracking-normal:  0;
  --tracking-wide:    0.06em;
  --tracking-wider:   0.12em;
  --tracking-widest:  0.2em;

  /* === 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-32: 8rem;
  --space-section: clamp(6rem, 4rem + 6vw, 12rem);

  /* === LAYOUT === */
  --container-max: 1360px;
  --container-pad: clamp(1.25rem, 1rem + 2vw, 3rem);
  --grid-gap:      clamp(1rem, 0.5rem + 1.5vw, 2rem);

  /* === EFFECTS === */
  --shadow-brutal:   4px 4px 0 var(--accent);
  --shadow-brutal-lg: 6px 6px 0 var(--accent);
  --glow:            0 0 30px hsla(var(--accent-hue), 100%, 55%, 0.25);
  --glow-strong:     0 0 60px hsla(var(--accent-hue), 100%, 55%, 0.35);
  --noise-opacity:   0.035;

  /* === TRANSITIONS === */
  --ease-out-expo: cubic-bezier(0.16, 1, 0.3, 1);
  --ease-out-quart: cubic-bezier(0.25, 1, 0.5, 1);
  --duration-fast:   150ms;
  --duration-normal: 300ms;
  --duration-slow:   600ms;

  /* Accent animation */
  animation: cycleAccent 20s ease-in-out infinite;
}

/* === LIGHT THEME === */
[data-theme="light"] {
  --black:        #FAFAFA;
  --black-rich:   #F5F5F5;
  --white:        #1A1A1A;
  --white-soft:   #333333;

  --gray-950:     #F0F0F0;
  --gray-900:     #E8E8E8;
  --gray-800:     #E0E0E0;
  --gray-700:     #D0D0D0;
  --gray-600:     #B0B0B0;
  --gray-500:     #888888;
  --gray-400:     #666666;
  --gray-300:     #444444;
  --gray-200:     #333333;

  /* the same two jobs on the light page: 5:1 or more on white and on the light cards */
  --text-muted:   #616161;
  --accent-text:  hsl(var(--accent-hue), 100%, 24%);

  --border-hair:   1px solid rgba(0, 0, 0, 0.06);
  --border-subtle: 1px solid rgba(0, 0, 0, 0.10);
  --border-medium: 1px solid rgba(0, 0, 0, 0.18);
  --border-strong: 2px solid var(--white);

  --noise-opacity: 0.02;
}
