/* 
   BARATH K — PORTFOLIO STYLESHEET
   
   TABLE OF CONTENTS
   1.  Font Imports 
   2.  Design Tokens - themes
   3.  Base Reset & Body
   4.  Background Texture
   5.  Typography Scale
   6.  Navigation
   7.  Hero Section
   8.  Section Scaffolding
   9.  About Section
   10. Education Section
   11. Experience Section
   12. Projects — Bento Grid
   13. Project Filters
   14. Project Modal
   15. Skills Section
   16. Footer
   17. Animations & Keyframes
   18. Accessibility
   19. Responsive Breakpoints
   20. Utility Classes
 */


/* ─── 1. FONT IMPORTS ──────────────────────────────────────────── */

/* PAIRING A — Zodiak + Sora + JetBrains Mono */
@import url('https://fonts.googleapis.com/css2?family=Sora:wght@300;400;500&family=JetBrains+Mono:ital,wght@0,300;0,400;0,500;1,300;1,400&display=swap');

/* Zodiak is not on Google Fonts — load from Fontshare (free, high quality) */
@import url('https://api.fontshare.com/v2/css?f[]=zodiak@300,400,600,301,401&display=swap');

/* PAIRING B — Bricolage Grotesque + Sora + JetBrains Mono */
@import url('https://fonts.googleapis.com/css2?family=Bricolage+Grotesque:opsz,wght@12..96,300;12..96,400;12..96,600&family=Sora:wght@300;400;500&family=JetBrains+Mono:ital,wght@0,300;0,400;0,500;1,300&display=swap');

/* PAIRING C — Fraunces + Sora + IBM Plex Mono */
@import url('https://fonts.googleapis.com/css2?family=Fraunces:ital,opsz,wght@0,9..144,400;0,9..144,600;1,9..144,400&family=Sora:wght@300;400;500&family=IBM+Plex+Mono:ital,wght@0,400;0,500;0,600;1,400&display=swap');

:root {
  --font-display: 'Zodiak', 'Georgia', 'Times New Roman', serif;
  --font-body:    'Sora', 'Helvetica Neue', 'Arial', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Consolas', 'Courier New', monospace;
}

html[data-font-pairing="a"] {
  --font-display: 'Zodiak', 'Georgia', 'Times New Roman', serif;
  --font-body:    'Sora', 'Helvetica Neue', 'Arial', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Consolas', 'Courier New', monospace;
}

html[data-font-pairing="b"] {
  --font-display: 'Bricolage Grotesque', 'Helvetica Neue', 'Arial', sans-serif;
  --font-body:    'Sora', 'Helvetica Neue', 'Arial', sans-serif;
  --font-mono:    'JetBrains Mono', 'Fira Code', 'Consolas', 'Courier New', monospace;
}

html[data-font-pairing="c"] {
  --font-display: 'Fraunces', 'Georgia', 'Times New Roman', serif;
  --font-body:    'Sora', 'Helvetica Neue', 'Arial', sans-serif;
  --font-mono:    'IBM Plex Mono', 'Courier New', monospace;
}


/* ─── 2. DESIGN TOKENS — THEMES ──────────────────────── */

/* LIGHT  */
[data-theme="light"] {
  /* Surfaces */
  --bg:           #f5f4f0;
  --bg-card:      #ffffff;
  --bg-subtle:    #eceae4;
  --bg-glass:     rgba(245, 244, 240, 0.82);

  /* Borders */
  --border:       #dddad2;
  --border-strong:#b8b5ad;

  /* Text */
  --text:         #18180f;
  --text-2:       #4a4840;
  --text-3:       #888480;

  /* Accent — deep teal */
  --accent:       #0f766e;
  --accent-2:     #0d9488;
  --accent-light: #e6faf8;
  --accent-text:  #ffffff;

  /* Tags */
  --tag-bg:       #ddf4f1;
  --tag-text:     #0f766e;
  --tag-border:   #b2e8e2;

  /* Shadows */
  --shadow-sm:    0 1px 2px rgba(24,24,15,0.06), 0 2px 8px rgba(24,24,15,0.04);
  --shadow-md:    0 2px 8px rgba(24,24,15,0.08), 0 8px 24px rgba(24,24,15,0.06);
  --shadow-lg:    0 8px 32px rgba(24,24,15,0.12), 0 32px 64px rgba(24,24,15,0.08);

  /* Blur */
  --blur-nav:     blur(14px);
  --blur-modal:   blur(8px);

  /* Texture */
  --grid-color:   rgba(24,24,15,0.055);
  --grid-size:    28px;
}

/* DARK */
[data-theme="dark"] {
  --bg:           #111110;
  --bg-card:      #1c1c1a;
  --bg-subtle:    #242422;
  --bg-glass:     rgba(17, 17, 16, 0.84);

  --border:       #2e2e2c;
  --border-strong:#484846;

  --text:         #e8e6e0;
  --text-2:       #a8a6a0;
  --text-3:       #686660;

  --accent:       #2dd4bf;
  --accent-2:     #5eead4;
  --accent-light: #0d2e2a;
  --accent-text:  #0a0f0e;

  --tag-bg:       #122926;
  --tag-text:     #5eead4;
  --tag-border:   #1e4a44;

  --shadow-sm:    0 1px 2px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.2);
  --shadow-md:    0 2px 8px rgba(0,0,0,0.4), 0 8px 24px rgba(0,0,0,0.3);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.5), 0 32px 64px rgba(0,0,0,0.4);

  --blur-nav:     blur(16px);
  --blur-modal:   blur(10px);

  --grid-color:   rgba(232,230,224,0.03);
  --grid-size:    28px;
}

/* MIDNIGHT */
[data-theme="midnight"] {
  --bg:           #08080f;
  --bg-card:      #111118;
  --bg-subtle:    #18181f;
  --bg-glass:     rgba(8, 8, 15, 0.86);

  --border:       #22222e;
  --border-strong:#38384a;

  --text:         #e2e0f0;
  --text-2:       #9a98b0;
  --text-3:       #5a5870;

  --accent:       #818cf8;
  --accent-2:     #a5b4fc;
  --accent-light: #1a1a30;
  --accent-text:  #08080f;

  --tag-bg:       #1a1a30;
  --tag-text:     #a5b4fc;
  --tag-border:   #2e2e50;

  --shadow-sm:    0 1px 2px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:    0 2px 8px rgba(0,0,0,0.5), 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.6), 0 32px 64px rgba(0,0,0,0.5);

  --blur-nav:     blur(16px);
  --blur-modal:   blur(10px);

  --grid-color:   rgba(129,140,248,0.04);
  --grid-size:    28px;
}

/* SEPIA */
[data-theme="sepia"] {
  --bg:           #f8f3eb;
  --bg-card:      #fdfaf5;
  --bg-subtle:    #ede8de;
  --bg-glass:     rgba(248, 243, 235, 0.85);

  --border:       #d8d0c0;
  --border-strong:#b8b0a0;

  --text:         #2a2010;
  --text-2:       #6a5a40;
  --text-3:       #9a8a70;

  --accent:       #c2410c;
  --accent-2:     #ea580c;
  --accent-light: #fde8d8;
  --accent-text:  #ffffff;

  --tag-bg:       #fde8d8;
  --tag-text:     #c2410c;
  --tag-border:   #f9c5a8;

  --shadow-sm:    0 1px 2px rgba(42,32,16,0.07), 0 2px 8px rgba(42,32,16,0.05);
  --shadow-md:    0 2px 8px rgba(42,32,16,0.09), 0 8px 24px rgba(42,32,16,0.07);
  --shadow-lg:    0 8px 32px rgba(42,32,16,0.13), 0 32px 64px rgba(42,32,16,0.09);

  --blur-nav:     blur(14px);
  --blur-modal:   blur(8px);

  --grid-color:   rgba(42,32,16,0.06);
  --grid-size:    28px;
}

/* WARM */
[data-theme="warm"] {
  --bg:           #faf7f4;
  --bg-card:      #ffffff;
  --bg-subtle:    #f3ede5;
  --bg-glass:     rgba(250, 247, 244, 0.85);

  --border:       #e5ddd2;
  --border-strong:#c4b8aa;

  --text:         #2d2520;
  --text-2:       #6b6258;
  --text-3:       #9b8977;

  --accent:       #c85a17;
  --accent-2:     #e07530;
  --accent-light: #fce5d1;
  --accent-text:  #ffffff;

  --tag-bg:       #f4e5d0;
  --tag-text:     #8b4513;
  --tag-border:   #dcc4a8;

  --shadow-sm:    0 1px 2px rgba(45,37,32,0.06), 0 2px 8px rgba(45,37,32,0.04);
  --shadow-md:    0 2px 8px rgba(45,37,32,0.08), 0 8px 24px rgba(45,37,32,0.06);
  --shadow-lg:    0 8px 32px rgba(45,37,32,0.12), 0 32px 64px rgba(45,37,32,0.08);

  --blur-nav:     blur(14px);
  --blur-modal:   blur(8px);

  --grid-color:   rgba(45,37,32,0.055);
  --grid-size:    28px;
}

/* CARBON */
[data-theme="carbon"] {
  --bg:           #0d0d0c;
  --bg-card:      #161614;
  --bg-subtle:    #1e1e1b;
  --bg-glass:     rgba(13, 13, 12, 0.88);

  --border:       #2a2a27;
  --border-strong:#3d3d3a;

  --text:         #e8e6df;
  --text-2:       #9e9c94;
  --text-3:       #5e5c55;

  --accent:       #4ade80;
  --accent-2:     #86efac;
  --accent-light: #0a2014;
  --accent-text:  #060f0a;

  --tag-bg:       #0f2818;
  --tag-text:     #4ade80;
  --tag-border:   #1a4028;

  --shadow-sm:    0 1px 2px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:    0 2px 8px rgba(0,0,0,0.5), 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.6), 0 32px 64px rgba(0,0,0,0.5);

  --blur-nav:     blur(16px);
  --blur-modal:   blur(10px);

  --grid-color:   rgba(74, 222, 128, 0.04);
  --grid-size:    28px;
}

/* VOID */
[data-theme="void"] {
  --bg:           #060609;
  --bg-card:      #0e0e14;
  --bg-subtle:    #15151e;
  --bg-glass:     rgba(6, 6, 9, 0.90);

  --border:       #1e1e2a;
  --border-strong:#2e2e42;

  --text:         #dddaf0;
  --text-2:       #8e8caa;
  --text-3:       #4e4c68;

  --accent:       #a78bfa;
  --accent-2:     #c4b5fd;
  --accent-light: #1a1030;
  --accent-text:  #060609;

  --tag-bg:       #180f30;
  --tag-text:     #c4b5fd;
  --tag-border:   #2a1e50;

  --shadow-sm:    0 1px 2px rgba(0,0,0,0.5), 0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:    0 2px 8px rgba(0,0,0,0.6), 0 8px 24px rgba(0,0,0,0.5);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.7), 0 32px 64px rgba(0,0,0,0.6);

  --blur-nav:     blur(16px);
  --blur-modal:   blur(10px);

  --grid-color:   rgba(167, 139, 250, 0.04);
  --grid-size:    28px;
}
/* SLATE */
[data-theme="slate"] {
  --bg:           #f7f8fc;
  --bg-card:      #ffffff;
  --bg-subtle:    #eef0f8;
  --bg-glass:     rgba(247, 248, 252, 0.85);

  --border:       #dde1ee;
  --border-strong:#b8bfd4;

  --text:         #0f172a;
  --text-2:       #475569;
  --text-3:       #94a3b8;

  --accent:       #1d4ed8;
  --accent-2:     #3b82f6;
  --accent-light: #dbeafe;
  --accent-text:  #ffffff;

  --tag-bg:       #dbeafe;
  --tag-text:     #1d4ed8;
  --tag-border:   #bfdbfe;

  --shadow-sm:    0 1px 2px rgba(15,23,42,0.06), 0 2px 8px rgba(15,23,42,0.04);
  --shadow-md:    0 2px 8px rgba(15,23,42,0.08), 0 8px 24px rgba(15,23,42,0.06);
  --shadow-lg:    0 8px 32px rgba(15,23,42,0.12), 0 32px 64px rgba(15,23,42,0.08);

  --blur-nav:     blur(14px);
  --blur-modal:   blur(8px);

  --grid-color:   rgba(15,23,42,0.05);
  --grid-size:    28px;
}

/* NAVY */
[data-theme="navy"] {
  --bg:           #070d1a;
  --bg-card:      #0d1628;
  --bg-subtle:    #131f35;
  --bg-glass:     rgba(7, 13, 26, 0.90);

  --border:       #1a2640;
  --border-strong:#243452;

  --text:         #e2e8f4;
  --text-2:       #94a3b8;
  --text-3:       #4a5a78;

  --accent:       #60a5fa;
  --accent-2:     #93c5fd;
  --accent-light: #0c1e3a;
  --accent-text:  #070d1a;

  --tag-bg:       #0c1e3a;
  --tag-text:     #93c5fd;
  --tag-border:   #162d54;

  --shadow-sm:    0 1px 2px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:    0 2px 8px rgba(0,0,0,0.5), 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.6), 0 32px 64px rgba(0,0,0,0.5);

  --blur-nav:     blur(16px);
  --blur-modal:   blur(10px);

  --grid-color:   rgba(96,165,250,0.04);
  --grid-size:    28px;
}

[data-theme="bar-blue"] {
  --bg:           #ffffff;
  --bg-card:      #f7f8fc;
  --bg-subtle:    #eef0f8;
  --bg-glass:     rgba(247, 248, 252, 0.85);

  --border:       #dde1ee;
  --border-strong:#b8bfd4;

  --text:         #08132f;
  --text-2:       #475569;
  --text-3:       #94a3b8;

  --accent:       #0C3270;
  --accent-2:     #3b82f6;
  --accent-light: #dbeafe;
  --accent-text:  #ffffff;

  --tag-bg:       #dbeafe;
  --tag-text:     #1d4ed8;
  --tag-border:   #bfdbfe;

  --shadow-sm:    0 1px 2px rgba(15,23,42,0.06), 0 2px 8px rgba(15,23,42,0.04);
  --shadow-md:    0 2px 8px rgba(15,23,42,0.08), 0 8px 24px rgba(15,23,42,0.06);
  --shadow-lg:    0 8px 32px rgba(15,23,42,0.12), 0 32px 64px rgba(15,23,42,0.08);

  --blur-nav:     blur(14px);
  --blur-modal:   blur(8px);

  --grid-color:   rgba(15,23,42,0.05);
  --grid-size:    28px;
}

[data-theme="bar-blue-dark"] {
  --bg:           #050b1a; 
  --bg-card:      #08132f; 
  --bg-subtle:    #0f1f45;
  --bg-glass:     rgba(5, 11, 26, 0.85);

  --border:       #1e2d54;
  --border-strong:#2a4073;

  --text:         #f1f5f9;
  --text-2:       #94a3b8;
  --text-3:       #64748b;

  --accent:       #3b82f6; 
  --accent-2:     #60a5fa;
  --accent-light: #12234f;
  --accent-text:  #ffffff;

  --tag-bg:       #172a5e;
  --tag-text:     #93c5fd;
  --tag-border:   #1e3a8a;

  --shadow-sm:    0 1px 2px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:    0 2px 8px rgba(0,0,0,0.5), 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg:    0 8px 32px rgba(0,0,0,0.6), 0 32px 64px rgba(0,0,0,0.5);

  --blur-nav:     blur(14px);
  --blur-modal:   blur(8px);

  --grid-color:   rgba(59, 130, 246, 0.06); 
  --grid-size:    28px;
}
[data-theme="bar-navy"] {
  --bg:           #0a0f1e;
  --bg-card:      #0f1729;
  --bg-subtle:    #131c31;
  --bg-glass:     rgba(10, 15, 30, 0.92);

  --border:       #1e2d4a;
  --border-strong:#2d4068;

  --text:         #e2e8f0;
  --text-2:       #94a3b8;
  --text-3:       #64748b;

  --accent:       #3b82f6;
  --accent-2:     #60a5fa;
  --accent-light: #0c1f3d;
  --accent-text:  #ffffff;

  --tag-bg:       #0c1f3d;
  --tag-text:     #93c5fd;
  --tag-border:   #1e3a5f;

  --shadow-sm:    0 1px 3px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.45), 0 8px 28px rgba(0,0,0,0.35);
  --shadow-lg:    0 12px 48px rgba(59,130,246,0.15), 0 24px 60px rgba(0,0,0,0.5);

  --blur-nav:     blur(16px);
  --blur-modal:   blur(10px);

  --grid-color:   rgba(59,130,246,0.06);
  --grid-size:    28px;
}
[data-theme="arctic"] {
  --bg:           #f8fafc;
  --bg-card:      #ffffff;
  --bg-subtle:    #f1f5f9;
  --bg-glass:     rgba(248, 250, 252, 0.85);

  --border:       #e2e8f0;
  --border-strong:#cbd5e1;

  --text:         #0f172a;
  --text-2:       #475569;
  --text-3:       #94a3b8;

  --accent:       #0ea5e9;
  --accent-2:     #38bdf8;
  --accent-light: #e0f2fe;
  --accent-text:  #ffffff;

  --tag-bg:       #ecfeff;
  --tag-text:     #0891b2;
  --tag-border:   #a5f3fc;

  --shadow-sm:    0 1px 2px rgba(15,23,42,0.04), 0 2px 6px rgba(15,23,42,0.03);
  --shadow-md:    0 4px 12px rgba(15,23,42,0.06), 0 8px 20px rgba(15,23,42,0.04);
  --shadow-lg:    0 12px 40px rgba(14,165,233,0.1), 0 24px 50px rgba(15,23,42,0.08);

  --blur-nav:     blur(14px);
  --blur-modal:   blur(8px);

  --grid-color:   rgba(14,165,233,0.06);
  --grid-size:    26px;
}
[data-theme="midnight-lab"] {
  --bg:           #0b0e14;
  --bg-card:      #111620;
  --bg-subtle:    #181d28;
  --bg-glass:     rgba(11, 14, 20, 0.92);

  --border:       #252d3a;
  --border-strong:#354050;

  --text:         #d4dae5;
  --text-2:       #8c95a6;
  --text-3:       #5c6678;

  --accent:       #00bfff;
  --accent-2:     #00e5ff;
  --accent-light: #0a1f2c;
  --accent-text:  #0b0e14;

  --tag-bg:       #0d2137;
  --tag-text:     #4fc3f7;
  --tag-border:   #0277bd;

  --shadow-sm:    0 0 3px rgba(0,191,255,0.1), 0 2px 6px rgba(0,0,0,0.4);
  --shadow-md:    0 0 10px rgba(0,191,255,0.12), 0 6px 20px rgba(0,0,0,0.5);
  --shadow-lg:    0 0 30px rgba(0,229,255,0.15), 0 20px 50px rgba(0,0,0,0.6);

  --blur-nav:     blur(14px);
  --blur-modal:   blur(10px);

  --grid-color:   rgba(0,191,255,0.04);
  --grid-size:    28px;
}
[data-theme="plasma"] {
  --bg:           #13111a;
  --bg-card:      #1c1826;
  --bg-subtle:    #251f33;
  --bg-glass:     rgba(19, 17, 26, 0.9);

  --border:       #362e4a;
  --border-strong:#4a3f66;

  --text:         #f0e8ff;
  --text-2:       #b8a8d4;
  --text-3:       #8678a8;

  --accent:       #e040fb;
  --accent-2:     #7c4dff;
  --accent-light: #2d1f3d;
  --accent-text:  #ffffff;

  --tag-bg:       #2d1a40;
  --tag-text:     #ea80fc;
  --tag-border:   #7b1fa2;

  --shadow-sm:    0 1px 4px rgba(224,64,251,0.15), 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:    0 4px 16px rgba(224,64,251,0.2), 0 8px 32px rgba(0,0,0,0.4);
  --shadow-lg:    0 8px 48px rgba(124,77,255,0.25), 0 24px 64px rgba(0,0,0,0.5);

  --blur-nav:     blur(18px);
  --blur-modal:   blur(12px);

  --grid-color:   rgba(224,64,251,0.06);
  --grid-size:    30px;
}
[data-theme="matrix"] {
  --bg:           #0d1117;
  --bg-card:      #161b22;
  --bg-subtle:    #1c2128;
  --bg-glass:     rgba(13, 17, 23, 0.92);

  --border:       #30363d;
  --border-strong:#484f58;

  --text:         #c9d1d9;
  --text-2:       #8b949e;
  --text-3:       #6e7681;

  --accent:       #00ff88;
  --accent-2:     #39ffb4;
  --accent-light: #0d2818;
  --accent-text:  #0d1117;

  --tag-bg:       #0d2818;
  --tag-text:     #3fb950;
  --tag-border:   #238636;

  --shadow-sm:    0 0 2px rgba(0,255,136,0.2), 0 2px 8px rgba(0,0,0,0.4);
  --shadow-md:    0 0 8px rgba(0,255,136,0.15), 0 8px 24px rgba(0,0,0,0.5);
  --shadow-lg:    0 0 32px rgba(0,255,136,0.1), 0 32px 64px rgba(0,0,0,0.6);

  --blur-nav:     blur(12px);
  --blur-modal:   blur(8px);

  --grid-color:   rgba(0,255,136,0.05);
  --grid-size:    24px;
}
[data-theme="neural"] {
  --bg:           #0a0a0f;
  --bg-card:      #12121a;
  --bg-subtle:    #1a1a25;
  --bg-glass:     rgba(10, 10, 15, 0.9);

  --border:       #2a2a3d;
  --border-strong:#3d3d5c;

  --text:         #e8e8f0;
  --text-2:       #9d9db5;
  --text-3:       #6b6b85;

  --accent:       #6366f1;
  --accent-2:     #818cf8;
  --accent-light: #1e1b4b;
  --accent-text:  #ffffff;

  --tag-bg:       #1e1b4b;
  --tag-text:     #a5b4fc;
  --tag-border:   #3730a3;

  --shadow-sm:    0 1px 2px rgba(99,102,241,0.1), 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:    0 2px 8px rgba(99,102,241,0.15), 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg:    0 8px 32px rgba(99,102,241,0.2), 0 32px 64px rgba(0,0,0,0.5);

  --blur-nav:     blur(16px);
  --blur-modal:   blur(10px);

  --grid-color:   rgba(99,102,241,0.08);
  --grid-size:    32px;
}
[data-theme="slate-light"] {
  --bg:           #f8f9fb;
  --bg-card:      #ffffff;
  --bg-subtle:    #f0f2f5;
  --bg-glass:     rgba(248, 249, 251, 0.88);

  --border:       #e1e5eb;
  --border-strong:#c8cdd6;

  --text:         #111827;
  --text-2:       #4b5563;
  --text-3:       #9ca3af;

  --accent:       #2563eb;
  --accent-2:     #3b82f6;
  --accent-light: #eff6ff;
  --accent-text:  #ffffff;

  --tag-bg:       #eff6ff;
  --tag-text:     #1d4ed8;
  --tag-border:   #bfdbfe;

  --shadow-sm:    0 1px 3px rgba(17,24,39,0.06), 0 2px 6px rgba(17,24,39,0.04);
  --shadow-md:    0 4px 12px rgba(17,24,39,0.08), 0 8px 24px rgba(17,24,39,0.05);
  --shadow-lg:    0 12px 40px rgba(37,99,235,0.1), 0 24px 56px rgba(17,24,39,0.08);

  --blur-nav:     blur(14px);
  --blur-modal:   blur(8px);

  --grid-color:   rgba(17,24,39,0.045);
  --grid-size:    28px;
}

[data-theme="slate-dark"] {
  --bg:           #0d1117;
  --bg-card:      #161b22;
  --bg-subtle:    #1c2128;
  --bg-glass:     rgba(13, 17, 23, 0.92);

  --border:       #2a3040;
  --border-strong:#3d4758;

  --text:         #e6edf3;
  --text-2:       #8d96a0;
  --text-3:       #5c6672;

  --accent:       #4f8ef7;
  --accent-2:     #79a8f9;
  --accent-light: #0f1e3d;
  --accent-text:  #ffffff;

  --tag-bg:       #0f1e3d;
  --tag-text:     #79a8f9;
  --tag-border:   #1e3a6e;

  --shadow-sm:    0 1px 3px rgba(0,0,0,0.3), 0 2px 8px rgba(0,0,0,0.2);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.35), 0 8px 28px rgba(0,0,0,0.25);
  --shadow-lg:    0 12px 48px rgba(79,142,247,0.15), 0 24px 60px rgba(0,0,0,0.4);

  --blur-nav:     blur(16px);
  --blur-modal:   blur(10px);

  --grid-color:   rgba(79,142,247,0.05);
  --grid-size:    28px;
}
[data-theme="sage-light"] {
  --bg:           #f6f8f6;
  --bg-card:      #ffffff;
  --bg-subtle:    #edf2ed;
  --bg-glass:     rgba(246, 248, 246, 0.88);

  --border:       #dde5dd;
  --border-strong:#bfcebf;

  --text:         #1a2e1a;
  --text-2:       #4a5e4a;
  --text-3:       #8a9e8a;

  --accent:       #2d7a3a;
  --accent-2:     #3d9e4d;
  --accent-light: #eaf4eb;
  --accent-text:  #ffffff;

  --tag-bg:       #eaf4eb;
  --tag-text:     #1f5c2b;
  --tag-border:   #b8ddbf;

  --shadow-sm:    0 1px 3px rgba(26,46,26,0.06), 0 2px 6px rgba(26,46,26,0.04);
  --shadow-md:    0 4px 14px rgba(26,46,26,0.08), 0 8px 24px rgba(26,46,26,0.05);
  --shadow-lg:    0 12px 40px rgba(45,122,58,0.1), 0 24px 56px rgba(26,46,26,0.07);

  --blur-nav:     blur(14px);
  --blur-modal:   blur(8px);

  --grid-color:   rgba(26,46,26,0.045);
  --grid-size:    28px;
}

[data-theme="sage-dark"] {
  --bg:           #0e1210;
  --bg-card:      #151c16;
  --bg-subtle:    #1b251c;
  --bg-glass:     rgba(14, 18, 16, 0.92);

  --border:       #263028;
  --border-strong:#364038;

  --text:         #ddeedd;
  --text-2:       #80a082;
  --text-3:       #556857;

  --accent:       #4caf64;
  --accent-2:     #6ec882;
  --accent-light: #0e2414;
  --accent-text:  #0e1210;

  --tag-bg:       #0e2414;
  --tag-text:     #6ec882;
  --tag-border:   #1e4828;

  --shadow-sm:    0 1px 3px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.25);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.4), 0 8px 28px rgba(0,0,0,0.3);
  --shadow-lg:    0 12px 48px rgba(76,175,100,0.12), 0 24px 60px rgba(0,0,0,0.45);

  --blur-nav:     blur(16px);
  --blur-modal:   blur(10px);

  --grid-color:   rgba(76,175,100,0.05);
  --grid-size:    28px;
}
[data-theme="ember-light"] {
  --bg:           #f0e5d8;
  --bg-card:      #faf6f1;
  --bg-subtle:    #e8ddd0;
  --bg-glass:     rgba(240, 229, 216, 0.88);

  --border:       #d9cfc3;
  --border-strong:#c4b8aa;

  --text:         #2e4052;
  --text-2:       #4a5c6e;
  --text-3:       #7a8f9e;

  --accent:       #a5c9ca;
  --accent-2:     #7db5b6;
  --accent-light: #e2f0f0;
  --accent-text:  #2e4052;

  --tag-bg:       #fdf6e3;
  --tag-text:     #8a6e1a;
  --tag-border:   #d9bf77;

  --highlight:    #c84b31;
  --highlight-light: #fceae5;

  --shadow-sm:    0 1px 3px rgba(46,64,82,0.07), 0 2px 6px rgba(46,64,82,0.04);
  --shadow-md:    0 4px 14px rgba(46,64,82,0.09), 0 8px 24px rgba(46,64,82,0.06);
  --shadow-lg:    0 12px 40px rgba(165,201,202,0.2), 0 24px 56px rgba(46,64,82,0.08);

  --blur-nav:     blur(14px);
  --blur-modal:   blur(8px);

  --grid-color:   rgba(46,64,82,0.05);
  --grid-size:    28px;
}

[data-theme="ember-dark"] {
  --bg:           #1a2530;
  --bg-card:      #2e4052;
  --bg-subtle:    #243140;
  --bg-glass:     rgba(26, 37, 48, 0.92);

  --border:       #3d5268;
  --border-strong:#4e6478;

  --text:         #f0e5d8;
  --text-2:       #a5c9ca;
  --text-3:       #6a8fa0;

  --accent:       #a5c9ca;
  --accent-2:     #c5dfe0;
  --accent-light: #1e3540;
  --accent-text:  #1a2530;

  --tag-bg:       #2a2010;
  --tag-text:     #d9bf77;
  --tag-border:   #6b5a20;

  --highlight:    #c84b31;
  --highlight-light: #3d1a10;

  --shadow-sm:    0 1px 3px rgba(0,0,0,0.35), 0 2px 8px rgba(0,0,0,0.25);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.4), 0 8px 28px rgba(0,0,0,0.3);
  --shadow-lg:    0 12px 48px rgba(165,201,202,0.1), 0 24px 60px rgba(0,0,0,0.45);

  --blur-nav:     blur(16px);
  --blur-modal:   blur(10px);

  --grid-color:   rgba(165,201,202,0.06);
  --grid-size:    28px;
}
[data-theme="dusk-light"] {
  --bg:           #f2e9e4;
  --bg-card:      #faf6f4;
  --bg-subtle:    #ece0da;
  --bg-glass:     rgba(242, 233, 228, 0.88);

  --border:       #ddd0ca;
  --border-strong:#c9ada7;

  --text:         #22223b;
  --text-2:       #4a4e69;
  --text-3:       #9a8c98;

  --accent:       #4a4e69;
  --accent-2:     #6b6f8f;
  --accent-light: #eae8f0;
  --accent-text:  #f2e9e4;

  --tag-bg:       #f5edeb;
  --tag-text:     #6b4a46;
  --tag-border:   #c9ada7;

  --shadow-sm:    0 1px 3px rgba(34,34,59,0.07), 0 2px 6px rgba(34,34,59,0.04);
  --shadow-md:    0 4px 14px rgba(34,34,59,0.09), 0 8px 24px rgba(34,34,59,0.06);
  --shadow-lg:    0 12px 40px rgba(74,78,105,0.15), 0 24px 56px rgba(34,34,59,0.08);

  --blur-nav:     blur(14px);
  --blur-modal:   blur(8px);

  --grid-color:   rgba(34,34,59,0.045);
  --grid-size:    28px;
}

[data-theme="dusk-dark"] {
  --bg:           #22223b;
  --bg-card:      #2d2d4a;
  --bg-subtle:    #1a1a2e;
  --bg-glass:     rgba(34, 34, 59, 0.93);

  --border:       #3a3a58;
  --border-strong:#4a4e69;

  --text:         #f2e9e4;
  --text-2:       #c9ada7;
  --text-3:       #9a8c98;

  --accent:       #9a8c98;
  --accent-2:     #c9ada7;
  --accent-light: #2e2840;
  --accent-text:  #22223b;

  --tag-bg:       #2e2030;
  --tag-text:     #c9ada7;
  --tag-border:   #5c4a54;

  --shadow-sm:    0 1px 3px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.45), 0 8px 28px rgba(0,0,0,0.35);
  --shadow-lg:    0 12px 48px rgba(154,140,152,0.1), 0 24px 60px rgba(0,0,0,0.5);

  --blur-nav:     blur(16px);
  --blur-modal:   blur(10px);

  --grid-color:   rgba(154,140,152,0.06);
  --grid-size:    28px;
}
[data-theme="graphite-light"] {
  --bg:           #ecf0f1;
  --bg-card:      #ffffff;
  --bg-subtle:    #e2e8ea;
  --bg-glass:     rgba(236, 240, 241, 0.88);

  --border:       #bdc3c7;
  --border-strong:#a0aaae;

  --text:         #2c3e50;
  --text-2:       #34495e;
  --text-3:       #7f8c8d;

  --accent:       #2c3e50;
  --accent-2:     #34495e;
  --accent-light: #dce4e8;
  --accent-text:  #ecf0f1;

  --tag-bg:       #e8eef0;
  --tag-text:     #2c3e50;
  --tag-border:   #bdc3c7;

  --shadow-sm:    0 1px 3px rgba(44,62,80,0.07), 0 2px 6px rgba(44,62,80,0.04);
  --shadow-md:    0 4px 14px rgba(44,62,80,0.09), 0 8px 24px rgba(44,62,80,0.06);
  --shadow-lg:    0 12px 40px rgba(44,62,80,0.12), 0 24px 56px rgba(44,62,80,0.08);

  --blur-nav:     blur(14px);
  --blur-modal:   blur(8px);

  --grid-color:   rgba(44,62,80,0.045);
  --grid-size:    28px;
}

[data-theme="graphite-dark"] {
  --bg:           #1a2533;
  --bg-card:      #2c3e50;
  --bg-subtle:    #243040;
  --bg-glass:     rgba(26, 37, 51, 0.93);

  --border:       #34495e;
  --border-strong:#4a6278;

  --text:         #ecf0f1;
  --text-2:       #bdc3c7;
  --text-3:       #7f8c8d;

  --accent:       #bdc3c7;
  --accent-2:     #dde3e5;
  --accent-light: #243040;
  --accent-text:  #1a2533;

  --tag-bg:       #243040;
  --tag-text:     #bdc3c7;
  --tag-border:   #34495e;

  --shadow-sm:    0 1px 3px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.45), 0 8px 28px rgba(0,0,0,0.35);
  --shadow-lg:    0 12px 48px rgba(44,62,80,0.5), 0 24px 60px rgba(0,0,0,0.45);

  --blur-nav:     blur(16px);
  --blur-modal:   blur(10px);

  --grid-color:   rgba(189,195,199,0.05);
  --grid-size:    28px;
}
[data-theme="ivory-light"] {
  --bg:           #fafaf8;
  --bg-card:      #ffffff;
  --bg-subtle:    #f2f2ee;
  --bg-glass:     rgba(250, 250, 248, 0.9);

  --border:       #e4e4dc;
  --border-strong:#c8c8bc;

  --text:         #18181a;
  --text-2:       #52525a;
  --text-3:       #a0a098;

  --accent:       #18181a;
  --accent-2:     #3d3d42;
  --accent-light: #f0f0ec;
  --accent-text:  #ffffff;

  --tag-bg:       #f0f0ec;
  --tag-text:     #18181a;
  --tag-border:   #d4d4cc;

  --shadow-sm:    0 1px 3px rgba(24,24,26,0.07), 0 2px 6px rgba(24,24,26,0.04);
  --shadow-md:    0 4px 14px rgba(24,24,26,0.08), 0 8px 24px rgba(24,24,26,0.05);
  --shadow-lg:    0 12px 40px rgba(24,24,26,0.1), 0 24px 56px rgba(24,24,26,0.07);

  --blur-nav:     blur(14px);
  --blur-modal:   blur(8px);

  --grid-color:   rgba(24,24,26,0.04);
  --grid-size:    26px;
}

[data-theme="ivory-dark"] {
  --bg:           #111110;
  --bg-card:      #1a1a18;
  --bg-subtle:    #222220;
  --bg-glass:     rgba(17, 17, 16, 0.93);

  --border:       #2e2e2c;
  --border-strong:#424240;

  --text:         #eeeee8;
  --text-2:       #8a8a84;
  --text-3:       #585854;

  --accent:       #eeeee8;
  --accent-2:     #c8c8c0;
  --accent-light: #252522;
  --accent-text:  #111110;

  --tag-bg:       #252522;
  --tag-text:     #c8c8c0;
  --tag-border:   #3a3a38;

  --shadow-sm:    0 1px 3px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:    0 4px 16px rgba(0,0,0,0.45), 0 8px 28px rgba(0,0,0,0.35);
  --shadow-lg:    0 12px 48px rgba(0,0,0,0.5), 0 24px 60px rgba(0,0,0,0.4);

  --blur-nav:     blur(16px);
  --blur-modal:   blur(10px);

  --grid-color:   rgba(238,238,232,0.03);
  --grid-size:    26px;
}
[data-theme="jupyter"] {
  --bg:           #f7f7f7;
  --bg-card:      #ffffff;
  --bg-subtle:    #efefef;
  --bg-glass:     rgba(247, 247, 247, 0.88);

  --border:       #e0e0e0;
  --border-strong:#cfcfcf;

  --text:         #1a1a1a;
  --text-2:       #555555;
  --text-3:       #888888;

  --accent:       #f37626;
  --accent-2:     #ff9d5c;
  --accent-light: #fff3eb;
  --accent-text:  #ffffff;

  --tag-bg:       #e8f4fd;
  --tag-text:     #0366d6;
  --tag-border:   #b8daff;

  --shadow-sm:    0 1px 3px rgba(0,0,0,0.08);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.1);
  --shadow-lg:    0 8px 30px rgba(0,0,0,0.12);

  --blur-nav:     blur(10px);
  --blur-modal:   blur(6px);

  --grid-color:   rgba(0,0,0,0.04);
  --grid-size:    20px;
}
[data-theme="sepia-dark"] {
  --bg:           #141008;
  --bg-card:      #1e1810;
  --bg-subtle:    #282015;
  --bg-glass:     rgba(20, 16, 8, 0.90);

  --border:       #362c1e;
  --border-strong:#4a3e2c;

  --text:         #ede6d6;
  --text-2:       #b8a888;
  --text-3:       #7a6c55;

  --accent:       #e8773a;
  --accent-2:     #f09860;
  --accent-light: #2c1a0a;
  --accent-text:  #141008;

  --tag-bg:       #2c1a0a;
  --tag-text:     #f09860;
  --tag-border:   #5c3518;

  --shadow-sm:    0 1px 2px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:    0 2px 8px rgba(0,0,0,0.5), 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg:    0 8px 32px rgba(232,119,58,0.08), 0 32px 64px rgba(0,0,0,0.5);

  --blur-nav:     blur(16px);
  --blur-modal:   blur(10px);

  --grid-color:   rgba(237,230,214,0.035);
  --grid-size:    28px;
}
[data-theme="warm-dark"] {
  --bg:           #12100d;
  --bg-card:      #1c1916;
  --bg-subtle:    #25211c;
  --bg-glass:     rgba(18, 16, 13, 0.90);

  --border:       #332e28;
  --border-strong:#4a4238;

  --text:         #f0ebe4;
  --text-2:       #b0a594;
  --text-3:       #706558;

  --accent:       #e07530;
  --accent-2:     #f09050;
  --accent-light: #2a1508;
  --accent-text:  #12100d;

  --tag-bg:       #2a1508;
  --tag-text:     #f09050;
  --tag-border:   #5c3010;

  --shadow-sm:    0 1px 2px rgba(0,0,0,0.4), 0 2px 8px rgba(0,0,0,0.3);
  --shadow-md:    0 2px 8px rgba(0,0,0,0.5), 0 8px 24px rgba(0,0,0,0.4);
  --shadow-lg:    0 8px 32px rgba(224,117,48,0.08), 0 32px 64px rgba(0,0,0,0.5);

  --blur-nav:     blur(16px);
  --blur-modal:   blur(10px);

  --grid-color:   rgba(240,235,228,0.03);
  --grid-size:    28px;
}
/* Shared non-colour tokens — same across all themes */
:root {
  /* Type scale using clamp() for fluid sizing */
  --text-xs:   clamp(0.68rem, 0.64rem + 0.16vw, 0.78rem);
  --text-sm:   clamp(0.84rem, 0.8rem + 0.18vw, 0.95rem);
  --text-base: clamp(1rem, 0.96rem + 0.2vw, 1.1rem);
  --text-lg:   clamp(1.12rem, 1.06rem + 0.28vw, 1.28rem);
  --text-xl:   clamp(1.3rem, 1.2rem + 0.48vw, 1.56rem);
  --text-2xl:  clamp(1.5rem, 1.34rem + 0.9vw, 2.15rem);
  --text-3xl:  clamp(3rem, 2.35rem + 2.6vw, 4.75rem);

  /* Spacing */
  --space-1:  4px;
  --space-2:  8px;
  --space-3:  12px;
  --space-4:  16px;
  --space-5:  24px;
  --space-6:  32px;
  --space-7:  48px;
  --space-8:  64px;
  --space-9:  96px;

  --section-pad-top: var(--space-8);
  --section-pad-bottom: var(--space-6);

  --icon-sm: 11px;
  --icon-md: 12px;
  --icon-lg: 16px;

  /* Radius */
  --radius-sm:  4px;
  --radius-md:  8px;
  --radius-lg:  14px;

  /* Transitions */
  --t-fast:   0.15s ease;
  --t-mid:    0.25s ease;
  --t-slow:   0.45s ease;
}


/* ─── 3. BASE RESET & BODY ───────────────────────────────────────── */

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

html {
  scroll-behavior: smooth;
  /* font-size is left at browser default (usually 16px) — we use clamp() */
  -webkit-text-size-adjust: 100%;
  overflow-x: clip;
}

body {
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.7;
  color: var(--text);
  background-color: var(--bg);
  /* Theme transitions — smooth when toggling */
  transition:
    background-color var(--t-mid),
    color var(--t-mid);
  overflow-x: hidden;
  min-height: 100vh;
  padding-top: 56px;
}

@supports not (overflow: clip) {
  html {
    overflow-x: hidden;
  }
}

html.theme-switching * {
  transition-duration: 0.22s !important;
}

/* Remove default list styling where used semantically */
ul, ol { list-style: none; }

/* Images are block-level by default to avoid inline spacing issues */
img, svg { display: block; max-width: 100%; }

/* Links inherit colour by default; specific link styles below */
a { color: inherit; text-decoration: none; }

/* Buttons reset */
button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

/* Focus visible — keyboard nav only, not mouse */
:focus { outline: none; }
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}


/* ─── 4. BACKGROUND TEXTURE ────────────────────────────────────────  */

body::before {
  content: '';
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-color) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-color) 1px, transparent 1px);
  background-size: var(--grid-size) var(--grid-size);
  pointer-events: none;
  z-index: 0;
  /* Transitions so texture fades smoothly when theme changes */
  transition: opacity var(--t-mid);
}

html[data-bg-style="layered"] body::before {
  display: none;
}

html[data-bg-style="layered"] body {
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--text) 8%, transparent) 0.0625rem, transparent 0.0625rem),
    linear-gradient(to bottom, color-mix(in srgb, var(--text) 8%, transparent) 0.0625rem, transparent 0.0625rem),
    radial-gradient(circle at 10% 15%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 35%),
    radial-gradient(circle at 85% 20%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 34%);
  background-size: 1.25rem 1.25rem, 1.25rem 1.25rem, 100% 100%, 100% 100%;
  background-position: 0 0, 0 0, center, center;
}

body::after {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 78vh;
  pointer-events: none;
  z-index: 0;
  opacity: 0;
  transition: opacity var(--t-mid);
}

html[data-bg-style="layered"] body::after {
  opacity: 1;
  background:
    linear-gradient(to bottom, color-mix(in srgb, var(--accent) 12%, transparent), transparent 65%),
    radial-gradient(circle at 20% 0%, color-mix(in srgb, var(--accent) 16%, transparent), transparent 45%),
    radial-gradient(circle at 80% 8%, color-mix(in srgb, var(--accent-2) 14%, transparent), transparent 44%);
}

/*  Gradient-fade — gradient at top fades to normal as you scroll */
html[data-bg-style="gradient-fade"] body::before {
  background-image:
    linear-gradient(to bottom, 
      color-mix(in srgb, var(--accent) 24%, var(--bg)) 0%,
      color-mix(in srgb, var(--accent-2) 18%, var(--bg)) 15%,
      transparent 60%
    );
  background-size: 100% 100%;
  background-attachment: scroll;
  background-position: 0 0;
}

html[data-bg-style="gradient-fade"] body::after {
  display: none;
}

/* DOT-GRID — radial dots, more modern than graph paper lines */
html[data-bg-style="dot-grid"] body::before {
  background-image: radial-gradient(
    circle,
    color-mix(in srgb, var(--accent) 22%, var(--grid-color)) 1.5px,
    transparent 1px
  );
  background-size: 32px 32px;
  background-position: 0 0;
  opacity: 0.9;
}

html[data-bg-style="dot-grid"] body::after {
  display: none;
}

/* AURORA — soft radial glow from top corners, fades down */
html[data-bg-style="aurora"] body::before {
  background-image:
    radial-gradient(ellipse 90% 48% at 18% -8%,
      color-mix(in srgb, var(--accent) 34%, transparent),
      transparent 62%),
    radial-gradient(ellipse 72% 36% at 82% -6%,
      color-mix(in srgb, var(--accent-2) 28%, transparent),
      transparent 58%),
    linear-gradient(to bottom,
      color-mix(in srgb, var(--accent) 10%, transparent) 0%,
      transparent 68%);
  background-size: 100% 100%;
  background-attachment: scroll;
  background-repeat: no-repeat;
  opacity: 0.95;
  filter: blur(18px);
  transform: scale(1.02);
}

html[data-bg-style="aurora"] body::after {
  display: none;
}

/* GRAIN — film grain texture via SVG noise, no HTML element needed */
html[data-bg-style="grain"] body::before {
  background-image:
    radial-gradient(circle at 20% 18%, rgba(255,255,255,0.05) 0.7px, transparent 0.8px),
    radial-gradient(circle at 78% 34%, rgba(0,0,0,0.05) 0.8px, transparent 0.9px),
    radial-gradient(circle at 52% 72%, color-mix(in srgb, var(--accent) 9%, transparent) 0.75px, transparent 0.85px),
    radial-gradient(circle at 44% 46%, color-mix(in srgb, var(--text) 8%, transparent) 0.7px, transparent 0.8px);
  background-size: 7px 7px, 11px 11px, 13px 13px, 9px 9px;
  background-position: 0 0, 2px 3px, 1px 2px, 4px 1px;
  background-attachment: scroll;
  background-repeat: repeat;
  opacity: 0.72;
}

html[data-bg-style="grain"] body::after {
  display: none;
}


/* CONTOUR — subtle topographic arcs, clean + technical */
html[data-bg-style="contour"] body::before {
  background-image:
    repeating-radial-gradient(
      ellipse 140% 72% at 50% -12%,
      color-mix(in srgb, var(--text) 6%, transparent) 0 1px,
      transparent 1px 22px
    ),
    radial-gradient(
      circle at 18% 10%,
      color-mix(in srgb, var(--accent) 14%, transparent),
      transparent 28%
    ),
    radial-gradient(
      circle at 82% 8%,
      color-mix(in srgb, var(--accent-2) 12%, transparent),
      transparent 24%
    ),
    linear-gradient(
      to bottom,
      color-mix(in srgb, var(--accent) 6%, transparent),
      transparent 62%
    );
  background-size: 100% 100%;
  background-repeat: no-repeat;
  opacity: 0.82;
}

html[data-bg-style="contour"] body::after {
  display: none;
}
/* SCATTER — randomized dot pattern, like a scatterplot */
html[data-bg-style="scatter"] body::before {
  background-image:
    radial-gradient(circle, color-mix(in srgb, var(--accent) 20%, transparent) 1.2px, transparent 1.2px),
    radial-gradient(circle, color-mix(in srgb, var(--accent-2) 16%, transparent) 1px, transparent 1px),
    radial-gradient(circle, color-mix(in srgb, var(--text) 8%, transparent) 0.8px, transparent 0.8px),
    radial-gradient(circle at 15% 12%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 30%);
  background-size:
    47px 53px,
    31px 37px,
    19px 23px,
    100% 100%;
  background-position:
    3px 7px,
    11px 2px,
    5px 13px,
    0 0;
  background-repeat: repeat, repeat, repeat, no-repeat;
  opacity: 0.75;
}

html[data-bg-style="scatter"] body::after {
  display: none;
}
/* MESH — soft gradient mesh, modern glassmorphism feel */
html[data-bg-style="mesh"] body::before {
  background-image:
    radial-gradient(ellipse 60% 50% at 10% 15%,
      color-mix(in srgb, var(--accent) 20%, transparent),
      transparent 55%),
    radial-gradient(ellipse 50% 60% at 85% 25%,
      color-mix(in srgb, var(--accent-2) 18%, transparent),
      transparent 50%),
    radial-gradient(ellipse 70% 40% at 50% 80%,
      color-mix(in srgb, var(--accent) 12%, transparent),
      transparent 55%),
    radial-gradient(ellipse 40% 50% at 70% 60%,
      color-mix(in srgb, var(--accent-2) 10%, transparent),
      transparent 50%);
  background-size: 100% 100%;
  background-repeat: no-repeat;
  opacity: 0.9;
  filter: blur(40px);
  transform: scale(1.05);
}

html[data-bg-style="mesh"] body::after {
  display: none;
}
/* HORIZON — single clean gradient band at top, ultra minimal */
html[data-bg-style="horizon"] body::before {
  background-image:
    linear-gradient(
      168deg,
      color-mix(in srgb, var(--accent) 16%, transparent) 0%,
      color-mix(in srgb, var(--accent-2) 12%, transparent) 20%,
      transparent 45%
    );
  background-size: 100% 100%;
  background-repeat: no-repeat;
  opacity: 1;
}

html[data-bg-style="horizon"] body::after {
  display: none;
}
/* CROSSHATCH — diagonal technical lines, engineering notebook feel */
html[data-bg-style="crosshatch"] body::before {
  background-image:
    repeating-linear-gradient(
      45deg,
      color-mix(in srgb, var(--text) 4%, transparent) 0 1px,
      transparent 1px 20px
    ),
    repeating-linear-gradient(
      -45deg,
      color-mix(in srgb, var(--text) 3%, transparent) 0 1px,
      transparent 1px 20px
    ),
    radial-gradient(
      circle at 20% 8%,
      color-mix(in srgb, var(--accent) 10%, transparent),
      transparent 28%
    );
  background-size: 100% 100%;
  background-repeat: repeat;
  opacity: 0.6;
}

html[data-bg-style="crosshatch"] body::after {
  display: none;
}
/* SPOTLIGHT — soft centered glow behind hero content */
html[data-bg-style="spotlight"] body::before {
  background-image:
    radial-gradient(
      ellipse 62% 34% at 50% 2%,
      color-mix(in srgb, var(--accent) 18%, transparent),
      transparent 68%
    ),
    radial-gradient(
      ellipse 88% 46% at 50% -6%,
      color-mix(in srgb, var(--accent-2) 10%, transparent),
      transparent 72%
    ),
    linear-gradient(
      to bottom,
      color-mix(in srgb, var(--bg-subtle) 50%, transparent) 0%,
      transparent 58%
    );
  background-size: 100% 100%;
  background-repeat: no-repeat;
  opacity: 0.95;
  filter: blur(10px);
}

html[data-bg-style="spotlight"] body::after {
  display: none;
}
/* BLUEPRINT — major/minor technical grid */
html[data-bg-style="blueprint"] body::before {
  background-image:
    linear-gradient(to right, color-mix(in srgb, var(--accent) 9%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--accent) 9%, transparent) 1px, transparent 1px),
    linear-gradient(to right, color-mix(in srgb, var(--text) 4%, transparent) 1px, transparent 1px),
    linear-gradient(to bottom, color-mix(in srgb, var(--text) 4%, transparent) 1px, transparent 1px),
    radial-gradient(circle at 14% 10%, color-mix(in srgb, var(--accent-2) 12%, transparent), transparent 26%);
  background-size:
    96px 96px,
    96px 96px,
    24px 24px,
    24px 24px,
    100% 100%;
  background-repeat: repeat, repeat, repeat, repeat, no-repeat;
  opacity: 0.7;
}

html[data-bg-style="blueprint"] body::after {
  display: none;
}
/* PAPER-FIBER — subtle textured paper look */
html[data-bg-style="paper-fiber"] body::before {
  background-image:
    repeating-linear-gradient(
      0deg,
      color-mix(in srgb, var(--text) 2.2%, transparent) 0 1px,
      transparent 1px 7px
    ),
    repeating-linear-gradient(
      90deg,
      color-mix(in srgb, var(--text) 1.6%, transparent) 0 1px,
      transparent 1px 9px
    ),
    radial-gradient(
      circle at 20% 10%,
      color-mix(in srgb, var(--accent) 8%, transparent),
      transparent 24%
    );
  background-size: 100% 100%;
  background-repeat: repeat;
  opacity: 0.3;
  filter: blur(0.2px);
}

html[data-bg-style="paper-fiber"] body::after {
  display: none;
}
/* GRAIN OVERLAY — improved, theme-aware */
.grain-overlay {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background-image:
    repeating-linear-gradient(
      0deg,
      transparent,
      transparent 2px,
      rgba(0, 0, 0, 0.012) 2px,
      rgba(0, 0, 0, 0.012) 4px
    );
  pointer-events: none;
  z-index: 9999;
  opacity: 0.35;
  transition: opacity var(--t-mid);
}


/* ─── 5. TYPOGRAPHY ──────────────────────────────────────────────── */

/* Display type — headings, hero name, section titles */
.font-display  { font-family: var(--font-display); }
.font-body     { font-family: var(--font-body); }
.font-mono     { font-family: var(--font-mono); }

/* Section label — small uppercase mono above section title */
.section-label {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-2);
  display: block;
}

/* Section title */
.section-title {
  font-family: var(--font-display);
  font-size: var(--text-2xl);
  font-weight: 300;
  letter-spacing: -0.02em;
  line-height: 1.15;
  color: var(--text);
  margin-bottom: var(--space-7);
}

/* Divider between major sections */
.section-divider {
  border: none;
  border-top: 1px solid var(--border);
  margin: 0;
}


/* ─── 6. NAVIGATION ──────────────────────────────────────────────── */

.nav {
  position: fixed;
  top: 0;
  inset-inline: 0;
  width: 100%;
  z-index: 200;
  background: var(--bg-glass);
  backdrop-filter: var(--blur-nav);
  -webkit-backdrop-filter: var(--blur-nav);
  border-bottom: 1px solid var(--border);
  transition:
    background var(--t-mid),
    border-color var(--t-mid);
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-4);
  height: 56px;
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-5);
  position: relative;
  z-index: 1;
}

/* Brand — SVG mark + name */
.nav-brand {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  text-decoration: none;
  flex-shrink: 0;
}

.nav-mark {
  flex-shrink: 0;
  /* Accent colour is set inline via currentColor / var(--accent) in SVG */
}

.nav-mark-text {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  font-family: var(--font-display);
  font-size: var(--text-xs);
  letter-spacing: 0.08em;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-light);
  border: 1px solid var(--border-strong);
}

.nav-name {
  font-family: var(--font-display);
  font-size: var(--text-sm);
  font-weight: 400;
  /* Italic in Zodiak; weight contrast in Bricolage */
  font-style: normal;
  color: var(--text);
  letter-spacing: 0.01em;
  transition: color var(--t-fast);
}
.nav-brand:hover .nav-name { color: var(--accent); }
html[data-font-pairing="a"] .nav-name { font-style: italic; }

/* Nav links — desktop */
.nav-links {
  display: flex;
  align-items: center;
  gap: var(--space-5);
}

.nav-links a {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: 0.05em;
  text-transform: capitalize;
  color: var(--text-3);
  text-decoration: none;
  transition: color var(--t-fast);
  white-space: nowrap;
}
.nav-links a:hover { color: var(--accent); }

/* "Lab →" link — slightly distinguished */
.nav-lab-link {
  color: var(--accent) !important;
  opacity: 0.8;
}
.nav-lab-link:hover { opacity: 1; }

/* Nav right — theme toggle + hamburger */
.nav-right {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  flex-shrink: 0;
}

/* Theme toggle pill */
.theme-toggle {
  position: relative;
  width: 46px;
  height: 26px;
  background: var(--bg-subtle);
  border: 1px solid var(--border-strong);
  border-radius: 13px;
  cursor: pointer;
  transition: background var(--t-mid), border-color var(--t-mid);
  flex-shrink: 0;
}

.theme-toggle-secondary {
  height: 26px;
  padding: 0 10px;
  border-radius: 13px;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  transition: all var(--t-fast);
}

.theme-toggle-secondary:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}

.theme-toggle::after {
  content: '';
  position: absolute;
  top: 3px;
  left: 3px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  transition: transform var(--t-mid);
}

/* Moved right when dark theme active */
[data-theme="dark"]     .theme-toggle::after,
[data-theme="midnight"] .theme-toggle::after { transform: translateX(20px); }

.theme-toggle.is-second::after {
  transform: translateX(20px);
}

/* Hamburger — mobile only */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-sm);
  transition: background var(--t-fast);
}
.nav-hamburger:hover { background: var(--bg-subtle); }

.nav-hamburger span {
  display: block;
  width: 20px;
  height: 1.5px;
  background: var(--text-2);
  border-radius: 2px;
  transition: transform var(--t-mid), opacity var(--t-mid);
}

/* Hamburger → X when open */
.nav-hamburger[aria-expanded="true"] span:nth-child(1) { transform: translateY(6.5px) rotate(45deg); }
.nav-hamburger[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-hamburger[aria-expanded="true"] span:nth-child(3) { transform: translateY(-6.5px) rotate(-45deg); }

/* Mobile nav panel */
.nav-mobile-panel {
  display: none;
  position: absolute;
  top: 56px;
  left: 0;
  right: 0;
  background: var(--bg-glass);
  backdrop-filter: var(--blur-nav);
  -webkit-backdrop-filter: var(--blur-nav);
  border-bottom: 1px solid var(--border);
  padding: var(--space-4) var(--space-5);
  z-index: 199;
}

.nav-mobile-panel.open { display: block; }

.nav-mobile-panel a {
  display: block;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  text-transform: capitalize;
  color: var(--text-2);
  padding: var(--space-3) 0;
  border-bottom: 1px solid var(--border);
  transition: color var(--t-fast);
}
.nav-mobile-panel a:last-child { border-bottom: none; }
.nav-mobile-panel a:hover { color: var(--accent); }


/* ─── 7. HERO SECTION ────────────────────────────────────────────── */

.hero {
  padding: var(--space-9) 0 var(--space-8);
  position: relative;
  z-index: 1;
}

.hero-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

/* Eyebrow label above name */
.hero-eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-4);
  opacity: 0;
  animation: fadeUp 0.5s 0.1s ease forwards;
}

/* The name — large, display font */
.hero-name {
  font-family: var(--font-display);
  font-size: var(--text-3xl);
  font-weight: 300;
  letter-spacing: -0.025em;
  line-height: 1.08;
  color: var(--text);
  margin-bottom: var(--space-4);
  opacity: 0;
  animation: fadeUp 0.5s 0.2s ease forwards;
}

/* Italic surname — expressive in Zodiak, weight contrast in Bricolage */
.hero-name em {
  font-style: normal;
  color: var(--accent);
}
html[data-font-pairing="a"] .hero-name em { font-style: italic; }

/* Title line — monospace, feels like a terminal prompt */
.hero-title {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--text-2);
  letter-spacing: 0.04em;
  margin-bottom: var(--space-5);
  opacity: 0;
  animation: fadeUp 0.5s 0.3s ease forwards;
}

.hero-title::before {
  content: '> ';
  color: var(--accent);
  opacity: 0.6;
}

/* Tagline */
.hero-tagline {
  font-family: var(--font-body);
  font-size: var(--text-lg);
  font-weight: 300;
  color: var(--text-2);
  line-height: 1.75;
  max-width: 560px;
  margin-bottom: var(--space-6);
  opacity: 0;
  animation: fadeUp 0.5s 0.4s ease forwards;
}
/* Social icon links */
.hero-social {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-3);
  margin-bottom: var(--space-5);
  opacity: 0;
  animation: fadeUp 0.5s 0.5s ease forwards;
}

.social-link {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  color: var(--text-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.04em;
  transition: all var(--t-fast);
  text-decoration: none;
}
.social-link svg { width: 16px; height: 16px; flex-shrink: 0; }
.social-link:hover {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--accent-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}

/* Resume CTA button */
.hero-cta {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  background: var(--accent);
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  letter-spacing: 0.06em;
  border-radius: var(--radius-md);
  text-decoration: none;
  transition: opacity var(--t-fast), transform var(--t-fast);
}
.hero-cta:hover { opacity: 0.88; transform: translateY(-1px); }

/* Availability badge */
.hero-available {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
  letter-spacing: 0.04em;
  margin-top: var(--space-4);
  opacity: 0;
  animation: fadeUp 0.5s 0.65s ease forwards;
}

.available-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: pulse 2.5s ease-in-out infinite;
}


/* ─── 8. SECTION SCAFFOLDING ─────────────────────────────────────── */

.section {
  padding: var(--section-pad-top) 0 var(--section-pad-bottom);
  position: relative;
  z-index: 1;
}

.section-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-5);
}

/* Scroll reveal — JS adds .visible when section enters viewport */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity var(--t-slow),
    transform var(--t-slow);
}
.reveal.visible {
  opacity: 1;
  transform: translateY(0);
}


/* ─── 9. ABOUT SECTION ───────────────────────────────────────────── */

.about-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(140px, 220px);
  grid-template-areas:
    "text avatar"
    "text facts";
  gap: var(--space-8);
  align-items: start;
  overflow: visible;
}

.about-layout.no-avatar {
  grid-template-columns: 1fr;
  grid-template-areas:
    "text"
    "facts";
}

.about-layout.no-facts {
  grid-template-columns: 1fr;
  grid-template-areas:
    "avatar"
    "text";
}

.about-layout.no-avatar.no-facts {
  grid-template-columns: 1fr;
  grid-template-areas: "text";
}

.about-avatar {
  grid-area: avatar;
  width: clamp(128px, 14vw, 168px);
  height: auto;
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
  justify-self: end;
}

.about-text {
  grid-area: text;
  font-size: var(--text-lg);
  font-weight: 300;
  color: var(--text-2);
  line-height: 1.85;
  max-width: 640px;
  min-width: 0;
}

/* Stat chips beside the about text */
.about-facts {
  grid-area: facts;
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
  flex-shrink: 0;
  min-width: 0;
}

.about-fact {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-3) var(--space-4);
  text-align: right;
  min-width: 110px;
  box-shadow: var(--shadow-sm);
}

.about-fact-value {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--accent);
  line-height: 1.1;
}

.about-fact-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-3);
  letter-spacing: 0.06em;
  margin-top: 2px;
}


/* ─── 10. EDUCATION SECTION ──────────────────────────────────────── */

.edu-grid {
  display: grid;
  gap: var(--space-3);
}

.edu-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-3);
  box-shadow: var(--shadow-sm);
  transition: box-shadow var(--t-fast), border-color var(--t-fast);
}
.edu-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}

.edu-degree {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 400;
  color: var(--text);
}

.edu-institution {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-2);
  margin-top: 3px;
  letter-spacing: 0.04em;
}

.edu-note {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
  margin-top: var(--space-2);
  display: flex;
  align-items: center;
  gap: 5px;
  white-space: pre-line;
}

.edu-right { text-align: right; }

.edu-gpa {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  color: var(--accent);
  font-weight: 300;
}

.edu-year {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-3);
  margin-top: 2px;
}


/* ─── 11. EXPERIENCE SECTION ─────────────────────────────────────── */

.exp-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  box-shadow: var(--shadow-sm);
  margin-bottom: var(--space-4);
  transition: box-shadow var(--t-fast);
}
.exp-card:hover { box-shadow: var(--shadow-md); }

.exp-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-2);
}

.exp-role {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-weight: 400;
  color: var(--text);
  line-height: 1.2;
}

.exp-period {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-3);
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.exp-company-link {
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  color: var(--accent);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: var(--space-1);
  margin-bottom: var(--space-4);
  transition: opacity var(--t-fast);
}
.exp-company-link:hover { opacity: 0.75; }

.exp-summary {
  font-size: var(--text-base);
  color: var(--text-2);
  line-height: 1.75;
  margin-bottom: var(--space-5);
}

/* Highlights — collapsible grid */
.exp-highlights-wrap {
  overflow: hidden;
  overflow-y: hidden;
  background: color-mix(in srgb, var(--bg-card) 76%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-2) var(--space-2) var(--space-2) var(--space-3);
  transition: max-height 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  overscroll-behavior: contain;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--accent) var(--bg-subtle);
}

.exp-highlights-wrap[data-expanded="false"] {
  padding: 0;
  border-color: transparent;
  background: transparent;
  scrollbar-width: none;
}

.exp-highlights-wrap[data-expanded="false"]::-webkit-scrollbar {
  width: 0;
  height: 0;
}

.exp-highlights-wrap[data-expanded="false"] .exp-highlights {
  opacity: 0;
  visibility: hidden;
}

.exp-highlights-wrap[data-expanded="true"] .exp-highlights {
  opacity: 1;
  visibility: visible;
}

.exp-highlights-wrap::-webkit-scrollbar {
  width: 10px;
}

.exp-highlights-wrap::-webkit-scrollbar-track {
  background: var(--bg-subtle);
  border-radius: 999px;
}

.exp-highlights-wrap::-webkit-scrollbar-thumb {
  background: linear-gradient(180deg, var(--accent), var(--accent-2));
  border-radius: 999px;
  border: 2px solid var(--bg-subtle);
}

.exp-highlights {
  display: grid;
  gap: var(--space-3);
  padding-bottom: var(--space-2);
}

.exp-highlight {
  padding: var(--space-3) var(--space-4);
  background: var(--bg-subtle);
  border-left: 2px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
}

.exp-highlight-title {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
  letter-spacing: 0.06em;
  margin-bottom: 5px;
}

.exp-highlight-detail {
  font-size: var(--text-sm);
  color: var(--text-2);
  line-height: 1.7;
}

.exp-highlight-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
  margin-top: var(--space-2);
}

/* Expand / collapse toggle button */
.exp-toggle {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-3);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-top: var(--space-4);
  transition: all var(--t-fast);
  letter-spacing: 0.04em;
}
.exp-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-light);
}


/* ─── 12. PROJECTS — RESTRAINED BENTO GRID ─────────────────────────  */

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

/* Wide card — featured projects */
.project-card.featured {
  grid-column: span 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(14rem, 18rem);
  gap: var(--space-5);
  align-items: stretch;
}

.project-content-featured {
  min-width: 0;
  display: flex;
  flex-direction: column;
}

/* Compact card — regular projects */
.project-card {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-5);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition:
    box-shadow var(--t-fast),
    border-color var(--t-fast),
    transform var(--t-fast);
  position: relative;
  overflow: hidden;
}

.project-card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
  transform: translateY(-2px);
}

/* Thumbnail strip at top if screenshot exists */
.project-thumbnail {
  width: 100%;
  aspect-ratio: 16/9;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-bottom: var(--space-4);
  background: var(--bg-subtle); /* fallback if image fails */
}

/* On featured cards, thumbnail is the left column */
.project-card.featured .project-thumbnail {
  aspect-ratio: 4/3;
  margin-bottom: 0;
  height: 100%;
}

.project-meta {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
  flex-wrap: wrap;
}

.project-year {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-3);
  letter-spacing: 0.06em;
}

.project-status {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: 2px 8px;
  border-radius: 10px;
  letter-spacing: 0.04em;
}

.project-status.complete     { background: #d1fae5; color: #065f46; }
.project-status.in-progress  { background: #fef3c7; color: #92400e; }
.project-status.archived     { background: var(--bg-subtle); color: var(--text-3); }

[data-theme="dark"] .project-status.complete,
[data-theme="midnight"] .project-status.complete    { background: #052e1a; color: #6ee7b7; }
[data-theme="dark"] .project-status.in-progress,
[data-theme="midnight"] .project-status.in-progress { background: #2e1f00; color: #fcd34d; }

.project-title {
  font-family: var(--font-display);
  font-size: var(--text-lg);
  font-weight: 400;
  color: var(--text);
  line-height: 1.25;
  margin-bottom: 4px;
}

.project-subtitle {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-3);
  margin-bottom: var(--space-3);
  letter-spacing: 0.03em;
}

.project-summary {
  font-size: var(--text-sm);
  color: var(--text-2);
  line-height: 1.7;
  margin-bottom: var(--space-4);
  /* Clamp to 3 lines on compact cards */
  display: -webkit-box;
  line-clamp: 3;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.project-card.featured .project-summary {
  line-clamp: 5;
  -webkit-line-clamp: 5; /* more space on featured cards */
}

/* Tags */
.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-1);
  margin-bottom: var(--space-3);
}

/* Links row with icons */
.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-top: auto;
}

.project-link {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
  text-decoration: none;
  padding: 4px 10px;
  border: 1px solid var(--tag-border);
  border-radius: var(--radius-sm);
  background: var(--accent-light);
  transition: all var(--t-fast);
  letter-spacing: 0.03em;
}
.project-link svg { width: 12px; height: 12px; flex-shrink: 0; }
.project-link .inline-icon { color: currentColor; }
.project-link .inline-icon svg {
  width: var(--icon-size, 12px);
  height: var(--icon-size, 12px);
}
.project-link:hover {
  border-color: var(--accent);
  background: var(--accent-light);
  opacity: 0.85;
}

/* "Expand" hint on card */
.project-expand-hint {
  position: absolute;
  bottom: var(--space-3);
  right: var(--space-4);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-3);
  opacity: 0;
  transition: opacity var(--t-fast);
}
.project-card:hover .project-expand-hint { opacity: 1; }

.inline-icon {
  width: var(--icon-size, var(--icon-md));
  height: var(--icon-size, var(--icon-md));
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.project-featured-media {
  margin-top: 0;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--bg-subtle);
  align-self: stretch;
}

.project-featured-media img,
.project-featured-media video,
.project-featured-media iframe {
  width: 100%;
  display: block;
}

.project-card.featured .project-featured-media img,
.project-card.featured .project-featured-media video,
.project-card.featured .project-featured-media iframe {
  height: 100%;
  object-fit: cover;
}


/* ─── 13. PROJECT FILTERS ────────────────────────────────────────── */

.filter-bar {
  display: flex;
  align-items: center;
  gap: var(--space-2);
  flex-wrap: wrap;
  margin-bottom: var(--space-6);
}

/* Desktop: tag pills (hidden on mobile via media query) */
.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.filter-pills-primary,
.filter-pills-overflow {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.filter-pills-overflow {
  width: 100%;
  margin-top: var(--space-1);
}

.filter-pills-overflow[hidden] {
  display: none !important;
}

.filter-pill-more {
  border-style: solid;
  outline: 2px solid color-mix(in srgb, var(--accent) 72%, var(--border-strong));
  outline-offset: -2px;
  font-weight: 500;
  letter-spacing: 0.05em;
}

.filter-pill-more:hover {
  outline: 3px solid var(--accent);
  outline-offset: -3px;
}

.filter-pill-more[aria-expanded="true"] {
  background: color-mix(in srgb, var(--accent-light) 82%, var(--bg-card));
  border-color: var(--accent);
}

.filter-pill-more:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
}

.filter-pill {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--bg-card);
  color: var(--text-2);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all var(--t-fast);
}
.filter-pill:hover { border-color: var(--accent); color: var(--accent); }
.filter-pill.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

/* Mobile: select dropdown (visible only on mobile) */
.filter-select {
  display: none; /* shown via media query */
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-4);
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-md);
  color: var(--text);
  cursor: pointer;
  width: 100%;
  outline: none;
  transition: border-color var(--t-fast);
  appearance: none;
  -webkit-appearance: none;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 12px center;
  padding-right: 36px;
}
.filter-select:focus { border-color: var(--accent); }

/* Hidden cards — not display:none so grid stays intact */
.project-card.hidden {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  visibility: hidden;
}


/* ─── 14. PROJECT MODAL ──────────────────────────────────────────── */

/* Overlay */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.6);
  backdrop-filter: var(--blur-modal);
  -webkit-backdrop-filter: var(--blur-modal);
  z-index: 500;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: var(--space-5);
  opacity: 0;
  pointer-events: none;
  transition: opacity var(--t-mid);
}

.modal-overlay.open {
  opacity: 1;
  pointer-events: all;
}

html[data-overlay-blur="off"] .modal-overlay {
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

.modal-overlay.side-panel-mode {
  justify-content: flex-end;
  align-items: stretch;
  padding: 0;
  background: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
}

/* In side-panel mode, let clicks pass through left area to project cards. */
.modal-overlay.side-panel-mode.open {
  pointer-events: none;
}

.modal-overlay.side-panel-mode .modal-panel {
  max-width: min(760px, 42vw);
  width: 100%;
  max-height: 100vh;
  height: 100vh;
  border-radius: 0;
  border-top: none;
  border-right: none;
  border-bottom: none;
  transform: translateX(18px);
  pointer-events: auto;
}

.modal-overlay.side-panel-mode.open .modal-panel {
  transform: translateX(0);
}

body.side-panel-open .nav,
body.side-panel-open main,
body.side-panel-open footer {
  width: calc(100% - min(760px, 42vw));
  transition: width var(--t-mid), transform var(--t-mid);
}

/* Modal panel */
.modal-panel {
  background: var(--bg-card);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  width: 100%;
  max-width: 780px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  transform: scale(0.96);
  transition: transform var(--t-mid);
}
.modal-overlay.open .modal-panel { transform: scale(1); }

.modal-header {
  padding: var(--space-6) var(--space-6) var(--space-4);
  border-bottom: 1px solid var(--border);
  position: sticky;
  top: 0;
  background: var(--bg-card);
  z-index: 1;
}

.modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 32px;
  height: 32px;
  border-radius: var(--radius-sm);
  background: var(--bg-subtle);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-2);
  transition: all var(--t-fast);
}
.modal-close:hover { background: var(--border); color: var(--text); }

.modal-body {
  padding: var(--space-5) var(--space-6) var(--space-7);
}

.modal-detail {
  font-size: var(--text-base);
  color: var(--text-2);
  line-height: 1.8;
  margin-bottom: var(--space-6);
}

/* Media item inside modal */
.modal-media-item {
  margin-bottom: var(--space-5);
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--border);
}

.modal-media-caption {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-3);
  padding: var(--space-2) var(--space-3);
  background: var(--bg-subtle);
  letter-spacing: 0.04em;
}

/* YouTube / iframe — 16:9 wrapper */
.aspect-video {
  position: relative;
  width: 100%;
  padding-bottom: 56.25%;
  background: var(--bg-subtle);
}
.aspect-video iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
}

/* PDF viewer */
.modal-pdf {
  width: 100%;
  height: 500px;
  border: none;
  display: block;
}

/* External link in modal */
.modal-external-link {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-3) var(--space-5);
  margin: var(--space-3);
  background: var(--accent-light);
  border: 1px solid var(--tag-border);
  border-radius: var(--radius-md);
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  transition: all var(--t-fast);
}
.modal-external-link:hover { opacity: 0.8; }


.edu-institution-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  color: var(--text-2);
  text-decoration: none;
  border-bottom: 1px dotted color-mix(in srgb, var(--text-3) 60%, transparent);
}

.edu-institution-link:hover {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* ─── 15. SKILLS SECTION ─────────────────────────────────────────── */

.skills-filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-5);
}

.skill-group-btn {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  padding: var(--space-1) var(--space-3);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  color: var(--text-2);
  background: var(--bg-card);
  cursor: pointer;
  letter-spacing: 0.04em;
  transition: all var(--t-fast);
}
.skill-group-btn:hover  { color: var(--accent); border-color: var(--accent); }
.skill-group-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--accent-text);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: var(--space-4);
}

.skill-group {
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4) var(--space-5);
  box-shadow: var(--shadow-sm);
  transition: opacity var(--t-mid), transform var(--t-mid);
}
.skill-group.hidden {
  display: none;
}

.skill-group-label {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--accent);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin-bottom: var(--space-3);
}

.skill-pills {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

/* Shared tag / pill style */
.tag, .skill-pill {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  background: var(--tag-bg);
  color: var(--tag-text);
  border: 1px solid var(--tag-border);
  padding: 3px 9px;
  border-radius: var(--radius-sm);
  letter-spacing: 0.03em;
  transition: all var(--t-fast);
}

.certifications-list {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
}

.certification-pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-size: var(--text-sm);
  padding: 5px 11px;
}

.certification-icon {
  --icon-size: var(--icon-sm);
  color: var(--accent);
}

.cert-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: inherit;
}
.skill-pill:hover {
  border-color: var(--accent);
  cursor: default;
}


/* ─── 16. FOOTER ─────────────────────────────────────────────────── */

footer {
  position: relative;
  z-index: 1;
  border-top: 1px solid var(--border);
  padding: var(--space-7) 0;
}

.footer-inner {
  max-width: 1100px;
  margin: 0 auto;
  padding: 0 var(--space-5);
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--space-4);
}

.footer-left {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-3);
  letter-spacing: 0.04em;
}

.footer-email {
  color: var(--accent);
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  /* decoded at runtime, never as plain text in source */
}

.footer-links {
  display: flex;
  gap: var(--space-4);
}
.footer-links a {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: var(--text-3);
  text-decoration: none;
  transition: color var(--t-fast);
}
.footer-links a:hover { color: var(--accent); }


/* ─── 17. ANIMATIONS & KEYFRAMES ────────────────────────────────── */

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(16px); }
  to   { opacity: 1; transform: translateY(0); }
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50%       { transform: scale(1.3); opacity: 0.5; }
}

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

/* Respect reduced motion preferences */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
  html { scroll-behavior: auto; }
}


/* ─── 18. ACCESSIBILITY ──────────────────────────────────────────── */

/* Skip to main content link — appears on keyboard focus */
.skip-link {
  position: absolute;
  top: -100px;
  left: var(--space-5);
  background: var(--accent);
  color: var(--accent-text);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  padding: var(--space-2) var(--space-4);
  border-radius: var(--radius-md);
  z-index: 9999;
  text-decoration: none;
  transition: top var(--t-fast);
}
.skip-link:focus { top: var(--space-3); }

/* Visually hidden (screen reader only) */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}


/* ── Small / medium screens ── */
@media (max-width: 980px) {
  .nav-inner {
    padding: 0 var(--space-4);
  }

  .nav-links {
    display: none;
  }

  .nav-hamburger {
    display: inline-flex;
  }

  .theme-toggle-secondary {
    display: none;
  }

  .nav-mobile-panel {
    top: 56px;
    max-height: calc(100vh - 56px);
    overflow-y: auto;
  }

  .modal-overlay,
  .modal-overlay.side-panel-mode {
    align-items: flex-end;
    justify-content: center;
    padding: 0;
    background: rgba(0, 0, 0, 0.58);
    backdrop-filter: var(--blur-modal);
    -webkit-backdrop-filter: var(--blur-modal);
  }

  .modal-overlay.side-panel-mode.open {
    pointer-events: all;
  }

  .modal-panel,
  .modal-overlay.side-panel-mode .modal-panel {
    width: 100%;
    max-width: 100%;
    max-height: min(88vh, calc(100vh - 24px));
    border-radius: 18px 18px 0 0;
    border-left: none;
    border-right: none;
    border-bottom: none;
    transform: translateY(16px);
  }

  .modal-overlay.open .modal-panel,
  .modal-overlay.side-panel-mode.open .modal-panel {
    transform: translateY(0);
  }

  .modal-header {
    padding: var(--space-5) var(--space-5) var(--space-3);
  }

  .modal-body {
    padding: var(--space-4) var(--space-5) var(--space-6);
  }

  body.side-panel-open .nav,
  body.side-panel-open main,
  body.side-panel-open footer {
    width: 100%;
  }

  .about-layout {
    grid-template-columns: 1fr;
    grid-template-areas:
      "avatar"
      "text"
      "facts";
    gap: var(--space-4);
  }

  .about-layout.no-avatar {
    grid-template-columns: 1fr;
    grid-template-areas:
      "text"
      "facts";
  }

  .about-layout.no-facts {
    grid-template-columns: 1fr;
    grid-template-areas:
      "avatar"
      "text";
  }

  .about-layout.no-avatar.no-facts {
    grid-template-areas: "text";
  }

  .about-avatar {
    justify-self: center;
    width: clamp(132px, 42vw, 172px);
    height: auto;
  }

  .about-facts {
    flex-direction: column;
    flex-wrap: nowrap;
    gap: var(--space-2);
  }

  .about-fact {
    text-align: left;
    min-width: 0;
    width: 100%;
  }
}

@media (max-width: 920px) {
  .projects-bento {
    grid-template-columns: 1fr;
  }

  .project-card.featured {
    grid-column: auto;
    grid-template-columns: 1fr;
    gap: var(--space-4);
  }

  .project-card.featured .project-thumbnail {
    aspect-ratio: 16 / 9;
    height: auto;
    margin-bottom: var(--space-4);
  }

  .project-featured-media {
    width: 100%;
  }
}



/* ── Large (1024px and above) ── */
@media (min-width: 1024px) {
  /* At large screens, show 3 columns for compact project cards */
  .projects-bento {
    grid-template-columns: repeat(3, 1fr);
  }
  /* Featured still span full width */
  .project-card.featured { grid-column: span 3; }
}


/* ─── 20. UTILITY CLASSES ────────────────────────────────────────── */

.text-accent  { color: var(--accent); }
.text-muted   { color: var(--text-3); }
.text-mono    { font-family: var(--font-mono); }
.text-display { font-family: var(--font-display); }

.mt-2 { margin-top: var(--space-2); }
.mt-3 { margin-top: var(--space-3); }
.mt-4 { margin-top: var(--space-4); }
.mt-5 { margin-top: var(--space-5); }

.flex-center {
  display: flex;
  align-items: center;
  justify-content: center;
}

.flex-between {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
