/* ============================================
   INA/LAB Design System
   A credible, minimal, editorial knowledge platform
   ============================================ */

/* ============================================
   Design Tokens
   ============================================ */
:root {
  /* Colors - Sophisticated, calm palette */
  --ink: #1a1a1a;
  --ink-soft: #2d2d2d;
  --muted: #6b7280;
  --muted-light: #9ca3af;
  --surface: #ffffff;
  --surface-raised: #f9fafb;
  --surface-subtle: #f3f4f6;
  --border: #e5e7eb;
  --border-light: #f0f1f3;
  --accent: #0B2E59;
  --accent-light: #2563eb;
  --accent-soft: #dbeafe;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --success: #059669;
  --success-soft: #d1fae5;
  --warning: #d97706;
  --warning-soft: #fed7aa;

  /* Typography scale */
  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Helvetica Neue', Arial, sans-serif;
  --font-serif: 'Source Serif 4', Georgia, 'Times New Roman', serif;
  
  --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 */
  
  /* Fluid typography */
  --h1: clamp(2.25rem, 4vw + 1rem, 3.75rem);
  --h2: clamp(1.75rem, 3vw + 0.75rem, 2.5rem);
  --h3: clamp(1.25rem, 2vw + 0.5rem, 1.5rem);
  --body: 1.0625rem;  /* 17px for better readability */
  --body-small: 0.9375rem;  /* 15px */

  /* Line heights */
  --leading-none: 1;
  --leading-tight: 1.25;
  --leading-snug: 1.375;
  --leading-normal: 1.5;
  --leading-relaxed: 1.625;
  --leading-loose: 2;

  /* Spacing scale - 4px base */
  --space-1: 0.25rem;   /* 4px */
  --space-2: 0.5rem;    /* 8px */
  --space-3: 0.75rem;   /* 12px */
  --space-4: 1rem;      /* 16px */
  --space-5: 1.25rem;   /* 20px */
  --space-6: 1.5rem;    /* 24px */
  --space-8: 2rem;      /* 32px */
  --space-10: 2.5rem;   /* 40px */
  --space-12: 3rem;     /* 48px */
  --space-16: 4rem;     /* 64px */
  --space-20: 5rem;     /* 80px */
  --space-24: 6rem;     /* 96px */
  --space-32: 8rem;     /* 128px */

  /* Layout */
  --container-sm: 640px;
  --container-md: 768px;
  --container-lg: 1024px;
  --container-xl: 1200px;
  --container: 1120px;
  --content-width: 72ch;

  /* Radius */
  --radius-sm: 0.375rem;   /* 6px */
  --radius: 0.5rem;        /* 8px */
  --radius-md: 0.75rem;    /* 12px */
  --radius-lg: 1rem;       /* 16px */
  --radius-xl: 1.5rem;     /* 24px */
  --radius-full: 9999px;

  /* Shadows - subtle and refined */
  --shadow-sm: 0 1px 2px 0 rgba(0, 0, 0, 0.03);
  --shadow: 0 1px 3px 0 rgba(0, 0, 0, 0.04), 0 1px 2px -1px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 4px 6px -1px rgba(0, 0, 0, 0.05), 0 2px 4px -2px rgba(0, 0, 0, 0.05);
  --shadow-lg: 0 10px 15px -3px rgba(0, 0, 0, 0.06), 0 4px 6px -4px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 20px 25px -5px rgba(0, 0, 0, 0.06), 0 8px 10px -6px rgba(0, 0, 0, 0.06);

  /* Transitions */
  --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-base: 200ms cubic-bezier(0.4, 0, 0.2, 1);
  --transition-slow: 300ms cubic-bezier(0.4, 0, 0.2, 1);
}

/* Dark mode support */
@media (prefers-color-scheme: dark) {
  :root {
    --ink: #f9fafb;
    --ink-soft: #e5e7eb;
    --muted: #9ca3af;
    --muted-light: #6b7280;
    --surface: #1a1a1a;
    --surface-raised: #2d2d2d;
    --surface-subtle: #262626;
    --border: #404040;
    --border-light: #333333;
    --accent: #3b82f6;
    --accent-light: #60a5fa;
    --accent-soft: #1e3a8a;
  }
}

/* ============================================
   Reset & Base Styles
   ============================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-sans);
  font-size: var(--body);
  line-height: var(--leading-relaxed);
  color: var(--ink);
  background: var(--surface-raised);
  overflow-x: hidden;
}

/* Typography */
h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: var(--leading-tight);
  letter-spacing: -0.025em;
  color: var(--ink);
}

h1 { font-size: var(--h1); margin-bottom: var(--space-6); }
h2 { font-size: var(--h2); margin-bottom: var(--space-5); }
h3 { font-size: var(--h3); margin-bottom: var(--space-4); }

p {
  margin-bottom: var(--space-4);
  max-width: var(--content-width);
}

p:last-child {
  margin-bottom: 0;
}

/* Links */
a {
  color: var(--accent);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--accent-light);
}

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: var(--radius-sm);
}

/* Lists */
ul, ol {
  margin-bottom: var(--space-4);
}

li {
  margin-bottom: var(--space-2);
}

/* ============================================
   Layout Components
   ============================================ */

/* Skip Link */
.skip-link {
  position: absolute;
  left: -9999px;
  top: var(--space-4);
  z-index: 9999;
  padding: var(--space-3) var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  color: var(--ink);
  font-weight: 500;
  box-shadow: var(--shadow-lg);
}

.skip-link:focus {
  left: var(--space-4);
}

/* Container */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-6);
}

@media (max-width: 768px) {
  .container {
    padding: 0 var(--space-4);
  }
}

/* Section */
.section {
  padding: var(--space-16) 0;
}

.section.tight {
  padding: var(--space-12) 0;
}

.section.border-top {
  border-top: 1px solid var(--border-light);
}

.section.border-bottom {
  border-bottom: 1px solid var(--border-light);
}

@media (max-width: 768px) {
  .section {
    padding: var(--space-12) 0;
  }
  
  .section.tight {
    padding: var(--space-8) 0;
  }
}

/* ============================================
   Header & Navigation
   ============================================ */
.header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(249, 250, 251, 0.85);
  backdrop-filter: saturate(180%) blur(20px);
  border-bottom: 1px solid var(--border-light);
  transition: box-shadow var(--transition-base);
}

@media (prefers-color-scheme: dark) {
  .header {
    background: white;
  }
}

.header.scrolled {
  box-shadow: var(--shadow-sm);
}

.navbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-6);
  padding: var(--space-4) 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-3);
  min-width: 0;
  flex-shrink: 0;
}

.brand img {
  height: 56px;
  width: auto;
  display: block;
}

.brand span {
  font-size: var(--text-sm);
  color: var(--muted);
  font-weight: 500;
  display: none;
  white-space: nowrap;
}

@media (min-width: 1024px) {
  .brand span {
    display: block;
  }
}

/* Navigation */
.nav {
  display: flex;
  align-items: center;
  gap: var(--space-2);
}

.nav a {
  padding: var(--space-2) var(--space-3);
  border-radius: var(--radius);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink-soft);
  transition: all var(--transition-fast);
  white-space: nowrap;
}

.nav a:hover {
  background: var(--surface);
  color: var(--ink);
}

.nav a[aria-current="page"] {
  background: var(--surface);
  color: var(--ink);
  box-shadow: var(--shadow-sm);
}

/* Mobile Menu Button */
.menu-btn {
  display: none;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--surface);
  font: inherit;
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--ink);
  cursor: pointer;
  transition: all var(--transition-fast);
}

.menu-btn:hover {
  border-color: var(--accent);
  background: var(--surface);
}

.menu-btn svg {
  transition: transform var(--transition-fast);
}

.menu-btn[aria-expanded="true"] svg {
  transform: rotate(90deg);
}

@media (max-width: 900px) {
  .menu-btn {
    display: inline-flex;
  }
  
  .nav {
    display: none;
  }
  
  .nav.is-open {
    display: flex;
    position: absolute;
    top: 100%;
    left: var(--space-4);
    right: var(--space-4);
    flex-direction: column;
    align-items: stretch;
    gap: var(--space-1);
    padding: var(--space-3);
    background: var(--surface);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-xl);
    margin-top: var(--space-2);
  }
  
  .nav.is-open a {
    padding: var(--space-3) var(--space-4);
  }
}

/* ============================================
   Hero Section
   ============================================ */
.hero {
  padding: var(--space-20) 0 var(--space-16);
  background: linear-gradient(180deg, var(--surface) 0%, var(--surface-raised) 100%);
}

@media (max-width: 768px) {
  .hero {
    padding: var(--space-12) 0 var(--space-10);
  }
}

.hero h1 {
  font-size: var(--h1);
  line-height: var(--leading-tight);
  margin-bottom: var(--space-5);
  max-width: 20ch;
}

.hero p {
  font-size: var(--text-lg);
  color: var(--muted);
  max-width: 65ch;
  line-height: var(--leading-relaxed);
  margin-bottom: 0;
}

.kicker {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: var(--space-4);
  padding: var(--space-1) 0;
}

.kicker::before {
  content: '';
  width: 24px;
  height: 2px;
  background: var(--accent);
  border-radius: var(--radius-full);
}

/* ============================================
   Typography Utilities
   ============================================ */
.h2 {
  font-size: var(--h2);
  margin-bottom: var(--space-5);
  letter-spacing: -0.02em;
}

.h3 {
  font-size: var(--h3);
  margin-bottom: var(--space-4);
}

.lead {
  font-size: var(--text-lg);
  color: var(--muted);
  line-height: var(--leading-relaxed);
  max-width: 75ch;
  margin-bottom: var(--space-6);
}

.meta {
  font-size: var(--text-sm);
  color: var(--muted-light);
  line-height: var(--leading-normal);
}

.muted {
  color: var(--muted);
}

/* ============================================
   Grid System
   ============================================ */
.grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--space-6);
}

.cols-12 { grid-column: span 12; }
.cols-8 { grid-column: span 8; }
.cols-6 { grid-column: span 6; }
.cols-4 { grid-column: span 4; }
.cols-3 { grid-column: span 3; }

@media (max-width: 900px) {
  .cols-8,
  .cols-6,
  .cols-4,
  .cols-3 {
    grid-column: span 12;
  }
}

/* ============================================
   Card Component
   ============================================ */
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  transition: all var(--transition-base);
  box-shadow: var(--shadow-sm);
}

.card:hover {
  box-shadow: var(--shadow-md);
  border-color: var(--border);
}

.card h3 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
  color: var(--ink);
}

.card p {
  color: var(--muted);
  margin-bottom: var(--space-3);
  font-size: var(--body-small);
  line-height: var(--leading-relaxed);
}

.card .meta {
  margin-top: var(--space-3);
  padding-top: var(--space-3);
  border-top: 1px solid var(--border-light);
}

.card .list {
  margin-top: var(--space-4);
}

/* ============================================
   Badge Component
   ============================================ */
.badge {
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
  padding: var(--space-2) var(--space-3);
  font-size: var(--text-xs);
  font-weight: 500;
  color: var(--muted);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: all var(--transition-fast);
}

.badge:hover {
  background: var(--surface-subtle);
  border-color: var(--accent);
  color: var(--accent);
  cursor: pointer;
}

.badge.active {
  background: var(--accent-soft);
  border-color: var(--accent);
  color: var(--accent);
}

/* ============================================
   List Component
   ============================================ */
.list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.list li {
  position: relative;
  padding-left: var(--space-6);
  margin-bottom: var(--space-3);
  color: var(--muted);
  line-height: var(--leading-relaxed);
}

.list li::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.6em;
  width: 4px;
  height: 4px;
  background: var(--accent);
  border-radius: var(--radius-full);
}

.list li strong {
  color: var(--ink);
  font-weight: 600;
}

/* ============================================
   Split Layout
   ============================================ */
.split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-8);
  align-items: start;
}

@media (max-width: 900px) {
  .split {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

/* ============================================
   Notice & Callout
   ============================================ */
.notice {
  padding: var(--space-5);
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 4px solid var(--accent);
  border-radius: var(--radius);
  color: var(--muted);
  line-height: var(--leading-relaxed);
  margin: var(--space-6) 0;
}

.callout {
  padding: var(--space-6);
  background: var(--accent-soft);
  border: 1px solid var(--accent);
  border-radius: var(--radius-lg);
  color: var(--ink);
  margin: var(--space-8) 0;
}

.callout strong {
  display: block;
  margin-bottom: var(--space-2);
  color: var(--accent);
}

/* ============================================
   Dividers
   ============================================ */
.hr {
  height: 1px;
  background: var(--border-light);
  border: none;
  margin: var(--space-8) 0;
}

/* ============================================
   Table Component
   ============================================ */
.table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
}

.table thead {
  background: var(--surface-subtle);
}

.table th,
.table td {
  padding: var(--space-4) var(--space-5);
  text-align: left;
  border-bottom: 1px solid var(--border-light);
  vertical-align: top;
}

.table th {
  font-size: var(--text-xs);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.table td {
  font-size: var(--body-small);
  color: var(--ink-soft);
}

.table tr:last-child td {
  border-bottom: none;
}

.table tbody tr {
  transition: background var(--transition-fast);
}

.table tbody tr:hover {
  background: var(--surface-raised);
}

/* ============================================
   Person Card
   ============================================ */
.person {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: var(--space-4);
  align-items: start;
}

.photo {
  width: 92px;
  height: 92px;
  border-radius: var(--radius-lg);

  /* hard reset: remove old placeholder styling (dotted/dashed frame) */
  border: 0 !important;
  outline: 0;
  background: transparent;
  background-image: none !important;
  box-shadow: var(--shadow-sm);

  overflow: hidden;
  display: block;
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 160ms ease;
}

.person h3 {
  margin-bottom: var(--space-1);
  font-size: var(--text-lg);
}

.person .meta {
  margin-bottom: var(--space-2);
}

.person p {
  font-size: var(--text-sm);
  line-height: var(--leading-relaxed);
  color: var(--muted);
}

/* Photo links (Team) — safe wrapper that won't affect layout */
.photo-link {
  display: block;
  width: 100%;
  height: 100%;
  text-decoration: none;
  color: inherit;
  line-height: 0;
  border-radius: inherit;
}

.photo-link:focus-visible {
  outline: 2px solid var(--accent, #0B2E59);
  outline-offset: 3px;
  border-radius: inherit;
}

.photo-link:hover img {
  transform: scale(1.03);
}


/* ============================================
   Attribution
   ============================================ */
.attribution {
  margin-top: var(--space-8);
  padding-top: var(--space-6);
  border-top: 1px solid var(--border-light);
  font-size: var(--text-sm);
  color: var(--muted-light);
  line-height: var(--leading-relaxed);
}

/* ============================================
   Footer
   ============================================ */
.footer {
  background: var(--surface);
  border-top: 1px solid var(--border-light);
  padding: var(--space-12) 0 var(--space-8);
  margin-top: var(--space-16);
}

.footer .row {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-8);
  margin-bottom: var(--space-6);
}

@media (max-width: 768px) {
  .footer .row {
    grid-template-columns: 1fr;
    gap: var(--space-6);
  }
}

.footer strong {
  display: block;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--ink);
  margin-bottom: var(--space-2);
}

.footer a {
  color: var(--muted);
  transition: color var(--transition-fast);
}

.footer a:hover {
  color: var(--accent);
}

.footer .meta {
  font-size: var(--text-sm);
  color: var(--muted-light);
  margin-top: var(--space-1);
}

/* ============================================
   Search & Filter
   ============================================ */
.search-bar {
  margin-bottom: var(--space-8);
}

.search-input {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  font-family: inherit;
  font-size: var(--body-small);
  color: var(--ink);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: all var(--transition-fast);
}

.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

.search-input::placeholder {
  color: var(--muted-light);
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-6);
}

/* ============================================
   Utility Classes
   ============================================ */
.hidden {
  display: none !important;
}

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

/* ============================================
   Animations
   ============================================ */
@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-in {
  animation: fadeIn var(--transition-base) ease-out;
}

/* ============================================
   Focus Visible
   ============================================ */
*:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
}

button:focus-visible,
a:focus-visible {
  outline-offset: 3px;
}

/* ============================================
   Print Styles
   ============================================ */
@media print {
  .header,
  .footer,
  .menu-btn,
  .skip-link,
  .search-bar,
  .filter-group {
    display: none;
  }
  
  body {
    background: white;
    color: black;
  }
  
  .card {
    break-inside: avoid;
    box-shadow: none;
    border: 1px solid #ccc;
  }
}
