/* ===== MIT-inspired Design System ===== */
:root {
  /* Color palette - MIT inspired with green accents */
  --bg: #fafafa;
  --panel: #ffffff;
  --text: #1a1a1a;
  --text-muted: #666666;
  --accent: #16a34a;
  --accent-dark: #166534;
  --accent-light: #34d399;
  --link:#334155;       /* AA+ */
  --link-hover:#0f172a; /* AAA */
  --link-visited:#1f2937;/* AAA */
  --border: #e5e7eb;
  --border-light: #f3f4f6;
  --shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
  --shadow-lg: 0 10px 25px rgba(0, 0, 0, 0.1);
  --gradient: linear-gradient(135deg, #f8fafc 0%, #f1f5f9 100%);
  
  /* Typography */
  --font-sans: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen', 'Ubuntu', 'Cantarell', sans-serif;
  --font-mono: 'SF Mono', 'Monaco', 'Inconsolata', 'Roboto Mono', monospace;
  
  /* Spacing */
  --space-xs: 0.25rem;
  --space-sm: 0.5rem;
  --space-md: 1rem;
  --space-lg: 1.5rem;
  --space-xl: 2rem;
  --space-2xl: 3rem;
  
  /* Border radius */
  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
}

/* Base styles */
* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
  padding: 0;
}

body {
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.6;
  color: var(--text);
  background: var(--gradient);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.about p + p { margin-top: 1rem; }

/* Container */
.container {
  width: min(1200px, 95%);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* Links */
a {
  color: var(--link);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--link-hover);
  text-decoration: underline;
}

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

/* ===== Header ===== */
.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 64px;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
  box-shadow: var(--shadow);
}

.site-header .wrap {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  font-weight: 700;
  font-size: 1.1rem;
  color: var(--text);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand .dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 2px var(--accent-light);
}

/* Navigation */
nav ul {
  display: flex;
  gap: var(--space-sm);
  list-style: none;
  margin: 0;
  padding: 0;
}

nav a {
  display: inline-flex;
  align-items: center;
  padding: var(--space-sm) var(--space-md);
  border-radius: var(--radius-md);
  color: var(--text);
  font-weight: 500;
  font-size: 0.9rem;
  transition: all 0.2s ease;
  border: 1px solid transparent;
  background: transparent;
}

nav a:hover {
  background: var(--bg);
  border-color: var(--border);
  color: var(--text);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

nav a[aria-current="page"] {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

nav a[aria-current="page"]:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: white;
  transform: translateY(-1px);
}

.menu-btn {
  display: none;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s ease;
}

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

/* Main content */
main {
  padding-top: 84px;
  min-height: calc(100vh - 64px);
}

/* ===== Typography ===== */
h1, h2, h3, h4, h5, h6 {
  margin: 0 0 var(--space-md) 0;
  font-weight: 700;
  line-height: 1.2;
  color: var(--text);
}

h1 {
  font-size: clamp(2rem, 4vw, 3rem);
}

h2 {
  font-size: clamp(1.5rem, 3vw, 2rem);
}

h3 {
  font-size: clamp(1.25rem, 2.5vw, 1.5rem);
}

p {
  margin: 0 0 var(--space-md) 0;
  color: var(--text);
}

/* ===== Cards and Panels ===== */
.card {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow);
  transition: all 0.2s ease;
}

.card:hover {
  box-shadow: var(--shadow-lg);
  transform: translateY(-2px);
}

.panel {
  background: var(--panel);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-lg);
  box-shadow: var(--shadow);
}

/* ===== Buttons ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: var(--space-sm);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel);
  color: var(--text);
  font-weight: 500;
  font-size: 0.9rem;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
}

.btn:hover {
  background: var(--bg);
  border-color: var(--accent);
  color: var(--text);
  text-decoration: none;
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: white;
}

.btn-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.btn-secondary:hover {
  background: var(--bg);
  border-color: var(--accent);
}

/* ===== Badges ===== */
.badge {
  display: inline-flex;
  align-items: center;
  padding: var(--space-xs) var(--space-sm);
  background: var(--accent-light);
  color: var(--accent-dark);
  border-radius: var(--radius-sm);
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}

/* ===== Forms ===== */
input, select, textarea {
  width: 100%;
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel);
  color: var(--text);
  font-family: inherit;
  font-size: 0.9rem;
  transition: all 0.2s ease;
}

input:focus, select:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(22, 163, 74, 0.1);
}

/* ===== Responsive Design ===== */
@media (max-width: 768px) {
  .menu-btn {
    display: inline-flex;
  }
  
  nav ul {
    display: none;
    position: absolute;
    top: 100%;
    right: var(--space-md);
    left: var(--space-md);
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: var(--radius-lg);
    padding: var(--space-md);
    box-shadow: var(--shadow-lg);
    flex-direction: column;
    gap: var(--space-xs);
  }
  
  nav ul.open {
    display: flex;
  }
  
  nav a {
    width: 100%;
    justify-content: flex-start;
  }
  
  .container {
    padding: 0 var(--space-sm);
  }
}

@media (max-width: 480px) {
  .site-header .wrap {
    padding: 0 var(--space-sm);
  }
  
  .brand {
    font-size: 1rem;
  }
  
  .card, .panel {
    padding: var(--space-md);
  }
}

/* ===== Utility Classes ===== */
.text-center { text-align: center; }
.text-left { text-align: left; }
.text-right { text-align: right; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: var(--space-sm); }
.mt-2 { margin-top: var(--space-md); }
.mt-3 { margin-top: var(--space-lg); }
.mt-4 { margin-top: var(--space-xl); }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: var(--space-sm); }
.mb-2 { margin-bottom: var(--space-md); }
.mb-3 { margin-bottom: var(--space-lg); }
.mb-4 { margin-bottom: var(--space-xl); }

.p-0 { padding: 0; }
.p-1 { padding: var(--space-sm); }
.p-2 { padding: var(--space-md); }
.p-3 { padding: var(--space-lg); }
.p-4 { padding: var(--space-xl); }

.hidden { display: none; }
.visible { display: block; }

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

.fade-in {
  animation: fadeIn 0.6s ease-out;
}

/* ===== PDF Viewer ===== */
.pdf-viewer-container {
  position: relative;
  width: 100%;
  margin: 1rem 0;
}

.pdf-viewer-container iframe {
  width: 100%;
  height: 600px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  background: white;
}

.pdf-actions {
  display: flex;
  gap: 1rem;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 1rem;
}

.pdf-actions .btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.75rem 1.5rem;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  font-weight: 500;
  transition: all 0.2s ease;
}

.pdf-actions .btn:hover {
  background: var(--bg);
  border-color: var(--accent);
  transform: translateY(-1px);
  box-shadow: var(--shadow);
}

.pdf-actions .btn-primary {
  background: var(--accent);
  color: white;
  border-color: var(--accent);
}

.pdf-actions .btn-primary:hover {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
  color: white;
}

/* Responsive PDF viewer */
@media (max-width: 768px) {
  .pdf-viewer-container iframe {
    height: 400px;
  }
  
  .pdf-actions {
    flex-direction: column;
    align-items: center;
  }
  
  .pdf-actions .btn {
    width: 100%;
    max-width: 300px;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .pdf-viewer-container iframe {
    height: 300px;
  }
}

/* ===== Print Styles ===== */
@media print {
  .site-header {
    position: static;
    background: white;
    border-bottom: 1px solid #ccc;
  }
  
  main {
    padding-top: 0;
  }
  
  .card, .panel {
    box-shadow: none;
    border: 1px solid #ccc;
  }
  
  .pdf-viewer-container {
    display: none;
  }
}
