/* ============================================================
   PS5 PORTFOLIO — THEME SYSTEM
   CSS custom properties for dark / light / green themes
   ============================================================ */

/* ── Font imports ── */
@import url('https://fonts.googleapis.com/css2?family=Outfit:wght@300;400;500;600;700;800&family=Inter:wght@300;400;500;600;700&family=DM+Mono:wght@400;500&display=swap');

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

html {
  font-size: 16px;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  overflow-x: hidden;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: 400;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  min-height: 100dvh;
  transition: background-color 300ms ease-in-out, color 300ms ease-in-out;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

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

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

ul,
ol {
  list-style: none;
}

/* ── Typography scale ── */
:root {
  --font-sans: 'Inter', ui-sans-serif, system-ui, -apple-system, sans-serif;
  --font-mono: 'DM Mono', ui-monospace, 'Cascadia Code', monospace;
  --font-display: 'Outfit', var(--font-sans);

  --text-xs:   0.75rem;   /* 12px */
  --text-sm:   0.875rem;  /* 14px */
  --text-base: 1rem;      /* 16px */
  --text-lg:   1.125rem;  /* 18px */
  --text-xl:   1.25rem;   /* 20px */
  --text-2xl:  1.5rem;    /* 24px */
  --text-3xl:  1.875rem;  /* 30px */
  --text-4xl:  2.25rem;   /* 36px */
  --text-5xl:  3rem;      /* 48px */
  --text-6xl:  3.75rem;   /* 60px */
  --text-hero: 4rem;      /* 64px */

  --leading-tight:  1.25;
  --leading-normal: 1.6;
  --leading-loose:  1.8;

  --tracking-tight:  -0.02em;
  --tracking-normal: 0em;
  --tracking-wide:   0.04em;
  --tracking-wider:  0.08em;
  --tracking-widest: 0.16em;
  --tracking-mega:   0.24em;
  --tracking-hero:   0.08em;

  /* 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;

  /* Radius */
  --radius-sm:   4px;
  --radius-md:   8px;
  --radius-lg:   12px;
  --radius-xl:   16px;
  --radius-2xl:  24px;
  --radius-full: 9999px;

  /* Z-index layers */
  --z-base:    0;
  --z-above:   10;
  --z-overlay: 100;
  --z-modal:   200;
  --z-toast:   300;
  --z-nav:     400;

  /* Easing */
  --ease-bounce:  cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth:  cubic-bezier(0.22, 1, 0.36, 1);
  --ease-in-out:  cubic-bezier(0.4, 0, 0.2, 1);
}

/* ============================================================
   DARK THEME (default)
   ============================================================ */
[data-theme="dark"],
:root {
  --color-bg:            #0a0a0f;
  --color-bg-alt:        #050508;
  --color-surface:       #161620;
  --color-surface-raised:#1e1e2e;
  --color-surface-overlay:#2a2a3e;
  --color-border:        rgba(255, 255, 255, 0.06);
  --color-border-subtle: rgba(255, 255, 255, 0.03);

  --color-text:          #e8e6e3;
  --color-text-muted:    rgba(232, 230, 227, 0.55);
  --color-text-faint:    rgba(232, 230, 227, 0.3);
  --color-text-inverse:  #0a0a0f;

  --color-accent:        #00439C;
  --color-accent-hover:  #0055c4;
  --color-accent-active: #003580;
  --color-accent-subtle: rgba(0, 67, 156, 0.15);
  --color-accent-glow:   rgba(0, 67, 156, 0.5);

  --color-secondary:     #7b1fa2;
  --color-secondary-hover: #9c27b0;
  --color-secondary-subtle: rgba(123, 31, 162, 0.12);
  --color-secondary-glow:   rgba(123, 31, 162, 0.35);

  --color-danger:        #ff4d6d;
  --color-warning:       #ffb84d;
  --color-success:       #4dff91;

  /* Glassmorphism */
  --glass-bg:     rgba(22, 22, 32, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur:   blur(24px) saturate(1.6);
  --glass-tint:   rgba(0, 67, 156, 0.05);

  /* Shadows */
  --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.6);
  --shadow-md:  0 4px 16px rgba(0, 0, 0, 0.7);
  --shadow-lg:  0 12px 40px rgba(0, 0, 0, 0.8);
  --shadow-xl:  0 24px 64px rgba(0, 0, 0, 0.85);
  --shadow-accent: 0 0 24px rgba(0, 67, 156, 0.5);
  --shadow-secondary: 0 0 24px rgba(123, 31, 162, 0.4);

  /* Background gradient */
  --bg-gradient: radial-gradient(ellipse at 20% 10%, rgba(0, 67, 156, 0.15) 0%, transparent 50%),
                 radial-gradient(ellipse at 80% 90%, rgba(74, 20, 140, 0.10) 0%, transparent 50%),
                 #0a0a0f;
}

/* ============================================================
   LIGHT THEME
   ============================================================ */
[data-theme="light"] {
  --color-bg:            #f4f5fa;
  --color-bg-alt:        #e8eaf0;
  --color-surface:       #ffffff;
  --color-surface-raised:#f8f9fc;
  --color-surface-overlay:#eef0f8;
  --color-border:        rgba(10, 10, 15, 0.1);
  --color-border-subtle: rgba(10, 10, 15, 0.05);

  --color-text:          #0a0a0f;
  --color-text-muted:    rgba(10, 10, 15, 0.55);
  --color-text-faint:    rgba(10, 10, 15, 0.35);
  --color-text-inverse:  #f4f5fa;

  --color-accent:        #00439C;
  --color-accent-hover:  #003580;
  --color-accent-active: #002a66;
  --color-accent-subtle: rgba(0, 67, 156, 0.1);
  --color-accent-glow:   rgba(0, 67, 156, 0.25);

  --color-secondary:     #6a1b9a;
  --color-secondary-hover: #4a148c;
  --color-secondary-subtle: rgba(106, 27, 154, 0.1);
  --color-secondary-glow:   rgba(106, 27, 154, 0.2);

  --color-danger:        #d93050;
  --color-warning:       #d97500;
  --color-success:       #1a8c45;

  --glass-bg:     rgba(255, 255, 255, 0.75);
  --glass-border: rgba(10, 10, 15, 0.1);
  --glass-blur:   blur(24px) saturate(1.6);
  --glass-tint:   rgba(0, 67, 156, 0.03);

  --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.08);
  --shadow-md:  0 4px 16px rgba(0, 0, 0, 0.1);
  --shadow-lg:  0 12px 40px rgba(0, 0, 0, 0.12);
  --shadow-xl:  0 24px 64px rgba(0, 0, 0, 0.15);
  --shadow-accent: 0 0 24px rgba(0, 67, 156, 0.25);
  --shadow-secondary: 0 0 24px rgba(106, 27, 154, 0.2);

  --bg-gradient: radial-gradient(ellipse at 20% 10%, rgba(0, 67, 156, 0.06) 0%, transparent 50%),
                 radial-gradient(ellipse at 80% 90%, rgba(106, 27, 154, 0.04) 0%, transparent 50%),
                 #f4f5fa;
}

/* ============================================================
   GREEN THEME
   ============================================================ */
[data-theme="green"] {
  --color-bg:            #0f1a12;
  --color-bg-alt:        #0a140d;
  --color-surface:       #1a2e1d;
  --color-surface-raised:#243828;
  --color-surface-overlay:#2e4233;
  --color-border:        rgba(255, 255, 255, 0.06);
  --color-border-subtle: rgba(255, 255, 255, 0.03);

  --color-text:          #e8e6e3;
  --color-text-muted:    rgba(232, 230, 227, 0.55);
  --color-text-faint:    rgba(232, 230, 227, 0.3);
  --color-text-inverse:  #0f1a12;

  --color-accent:        #00c853;
  --color-accent-hover:  #00e060;
  --color-accent-active: #00b048;
  --color-accent-subtle: rgba(0, 200, 83, 0.15);
  --color-accent-glow:   rgba(0, 200, 83, 0.4);

  --color-secondary:     #69f0ae;
  --color-secondary-hover: #80ffbe;
  --color-secondary-subtle: rgba(105, 240, 174, 0.12);
  --color-secondary-glow:   rgba(105, 240, 174, 0.35);

  --color-danger:        #ff4d6d;
  --color-warning:       #ffb84d;
  --color-success:       #69f0ae;

  --glass-bg:     rgba(26, 46, 29, 0.75);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-blur:   blur(24px) saturate(1.6);
  --glass-tint:   rgba(0, 200, 83, 0.05);

  --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.6);
  --shadow-md:  0 4px 16px rgba(0, 0, 0, 0.7);
  --shadow-lg:  0 12px 40px rgba(0, 0, 0, 0.8);
  --shadow-xl:  0 24px 64px rgba(0, 0, 0, 0.85);
  --shadow-accent: 0 0 24px rgba(0, 200, 83, 0.5);
  --shadow-secondary: 0 0 24px rgba(105, 240, 174, 0.4);

  --bg-gradient: radial-gradient(ellipse at 20% 10%, rgba(0, 200, 83, 0.12) 0%, transparent 50%),
                 radial-gradient(ellipse at 80% 90%, rgba(105, 240, 174, 0.08) 0%, transparent 50%),
                 #0f1a12;
}

/* ============================================================
   SEMANTIC HELPERS
   ============================================================ */

/* Animated gradient background */
.bg-dynamic {
  background: var(--bg-gradient);
  background-size: 200% 200%;
}

/* Text utilities */
.text-accent     { color: var(--color-accent); }
.text-secondary  { color: var(--color-secondary); }
.text-muted      { color: var(--color-text-muted); }
.text-faint      { color: var(--color-text-faint); }

/* Surface utilities */
.surface         { background: var(--color-surface); }
.surface-raised  { background: var(--color-surface-raised); }

/* Focus ring — accessible, themed */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}
