/* 
  Design System for Lab Homepage 
  Premium, Modern, Academic - v2.0
*/

:root {
  /* Fonts */
  --font-heading: 'Outfit', -apple-system, BlinkMacSystemFont, sans-serif;
  --font-body: 'Pretendard', -apple-system, BlinkMacSystemFont, sans-serif;

  /* Colors - Light Mode (Default) */
  --color-bg: #ffffff;
  --color-bg-alt: #f8fafc;        /* Slate 50 */
  --color-bg-card: rgba(255, 255, 255, 0.8);
  --color-bg-glass: rgba(255, 255, 255, 0.7);
  
  --color-text-main: #0f172a;     /* Slate 900 */
  --color-text-muted: #64748b;    /* Slate 500 */
  --color-text-light: #94a3b8;    /* Slate 400 */

  --color-primary: #0f172a;       /* Slate 900 */
  --color-accent: #3b82f6;        /* Blue 500 */
  --color-accent-glow: rgba(59, 130, 246, 0.3);
  --color-border: #e2e8f0;        /* Slate 200 */

  /* Gradients */
  --gradient-primary: linear-gradient(135deg, #0f172a 0%, #334155 100%);
  --gradient-accent: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
  --gradient-surface: linear-gradient(180deg, rgba(255,255,255,0.05) 0%, rgba(255,255,255,0) 100%);

  /* Effects */
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.05);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.1), 0 2px 4px -2px rgb(0 0 0 / 0.1);
  --shadow-lg: 0 20px 25px -5px rgb(0 0 0 / 0.1), 0 8px 10px -6px rgb(0 0 0 / 0.1);
  --shadow-glow: 0 0 15px var(--color-accent-glow);
  
  --backdrop-blur: blur(12px);
  --radius-sm: 0.5rem;
  --radius-md: 1rem;
  --radius-lg: 1.5rem;
  
  --header-height: 80px;
  --container-width: 1240px;
}

/* Dark Mode Overrides */
[data-theme="dark"] {
  --color-bg: #020617;            /* Slate 950 */
  --color-bg-alt: #0f172a;        /* Slate 900 */
  --color-bg-card: rgba(15, 23, 42, 0.6);
  --color-bg-glass: rgba(2, 6, 23, 0.7);

  --color-text-main: #f1f5f9;     /* Slate 100 */
  --color-text-muted: #cbd5e1;    /* Slate 300 */
  --color-text-light: #64748b;    /* Slate 500 */

  --color-primary: #f8fafc;       /* Slate 50 */
  --color-accent: #60a5fa;        /* Blue 400 */
  --color-accent-glow: rgba(96, 165, 250, 0.3);
  --color-border: #1e293b;        /* Slate 800 */
  
  --shadow-sm: 0 1px 2px 0 rgb(0 0 0 / 0.5);
  --shadow-md: 0 4px 6px -1px rgb(0 0 0 / 0.5);
}

/* Base Reset & Typography */
* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: var(--font-body);
  background-color: var(--color-bg);
  color: var(--color-text-main);
  line-height: 1.6;
  transition: background-color 0.3s ease, color 0.3s ease;
  overflow-x: hidden;
}

a { text-decoration: none; color: inherit; transition: all 0.2s ease; }
ul { list-style: none; }
img { max-width: 100%; display: block; }

h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.2;
  color: var(--color-text-main);
}

h1 { font-size: 3.5rem; letter-spacing: -0.02em; }
h2 { font-size: 2.25rem; letter-spacing: -0.01em; margin-bottom: 1.5rem; }
h3 { font-size: 1.5rem; margin-bottom: 1rem; }

/* Utilities */
.container { max-width: var(--container-width); margin: 0 auto; padding: 0 1.5rem; }
.section { padding: 6rem 0; position: relative; }
.section-bg { background-color: var(--color-bg-alt); }

.glass {
  background: var(--color-bg-glass);
  backdrop-filter: var(--backdrop-blur);
  -webkit-backdrop-filter: var(--backdrop-blur);
  border: 1px solid var(--color-border);
}

.text-accent { color: var(--color-accent); }
.text-muted { color: var(--color-text-muted); }
.text-gradient {
  background: var(--gradient-accent);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  display: inline-block;
}

/* Buttons */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0.875rem 1.75rem;
  font-weight: 600; font-family: var(--font-heading);
  border-radius: var(--radius-sm);
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  cursor: pointer; position: relative; overflow: hidden;
}

.btn-primary {
  background: var(--color-accent);
  color: white; /* Always white */
  box-shadow: 0 4px 6px -1px var(--color-accent-glow);
}
.btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 15px -3px var(--color-accent-glow);
  filter: brightness(1.1);
}

.btn-outline {
  background: transparent;
  border: 1px solid var(--color-border);
  color: var(--color-text-main);
}
.btn-outline:hover {
  border-color: var(--color-accent);
  color: var(--color-accent);
  background: rgba(59, 130, 246, 0.05);
}

/* Navbar */
header {
  height: var(--header-height);
  position: fixed; top: 0; width: 100%; z-index: 1000;
  transition: all 0.3s ease;
  border-bottom: 1px solid transparent;
}
header.scrolled {
  background: var(--color-bg-glass);
  backdrop-filter: var(--backdrop-blur);
  border-bottom-color: var(--color-border);
  height: 70px; /* Shrink slightly */
}
header .container { display: flex; justify-content: space-between; align-items: center; height: 100%; }

.logo { font-size: 1.5rem; font-weight: 800; font-family: var(--font-heading); letter-spacing: -0.02em; }
.nav-links { display: flex; gap: 2rem; align-items: center; }
.nav-links a { font-weight: 500; color: var(--color-text-muted); font-size: 0.95rem; }
.nav-links a:hover, .nav-links a.active { color: var(--color-accent); }

/* Theme Toggle */
.theme-toggle {
  background: none; border: none; cursor: pointer; color: var(--color-text-main);
  padding: 0.5rem; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s;
}
.theme-toggle:hover { background: var(--color-bg-alt); }

/* Hero Section */
.hero {
  padding-top: 180px; padding-bottom: 120px;
  position: relative; overflow: hidden;
  text-align: center;
}
.hero-canvas {
  position: absolute; top: 0; left: 0; width: 100%; height: 100%;
  z-index: -1;
  opacity: 0.6;
}

/* Cards */
.card {
  background: var(--color-bg-card);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: 2rem;
  transition: all 0.3s ease;
}
.card:hover {
  transform: translateY(-5px);
  border-color: var(--color-accent);
  box-shadow: var(--shadow-lg), var(--shadow-glow);
}

/* Grid System */
.grid { display: grid; gap: 2rem; }
.grid-2 { grid-template-columns: repeat(2, 1fr); }
.grid-3 { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 768px) {
  .grid-2, .grid-3 { grid-template-columns: 1fr; }
  h1 { font-size: 2.5rem; }
}

/* Footer */
footer { padding: 4rem 0; background: var(--color-bg-alt); border-top: 1px solid var(--color-border); margin-top: auto; }