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

:root {
  color-scheme: light;
  font-family:
    Inter,
    system-ui,
    -apple-system,
    BlinkMacSystemFont,
    "Segoe UI",
    sans-serif;
  --bg: #f7f8fb;
  --surface: #ffffff;
  --text: #101820;
  --muted: #475569;
  --border: #e2e8f0;
  --button-bg: #0f172a;
  --button-text: #ffffff;
  --button-outline-bg: #ffffff;
  --button-outline-border: #cbd5e1;
  --link: #0f172a;
}

body {
  min-height: 100vh;
  line-height: 1.5;
  background: var(--bg);
  color: var(--text);
}

body.dark {
  color-scheme: dark;
  --bg: #090b12;
  --surface: #111827;
  --text: #f8fafc;
  --muted: #cbd5e1;
  --border: #334155;
  --button-bg: #e2e8f5;
  --button-text: #0f172a;
  --button-outline-bg: #111827;
  --button-outline-border: #475569;
  --link: #d1d5db;
}

button,
a {
  font: inherit;
}

.page-shell {
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(20px, 5vw, 40px) clamp(16px, 4vw, 24px);
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 24px;
  gap: 16px;
}

.home-link,
.theme-toggle {
  border-radius: 999px;
  border: 1px solid var(--border);
  padding: clamp(8px, 2vw, 10px) clamp(12px, 3vw, 16px);
  background: var(--button-outline-bg);
  color: var(--link);
  text-decoration: none;
  cursor: pointer;
}

.home-link:hover,
.theme-toggle:hover {
  opacity: 0.92;
}

.hero {
  padding-bottom: clamp(24px, 5vw, 32px);
  border-bottom: 1px solid var(--border);
  margin-bottom: clamp(24px, 5vw, 32px);
}

.eyebrow {
  color: var(--muted);
  font-size: 0.95rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin-bottom: 12px;
}

h1 {
  font-size: clamp(2.25rem, 3vw, 3.5rem);
  line-height: 1.05;
  margin-bottom: 16px;
}

.hero-copy {
  max-width: 680px;
  color: var(--muted);
  font-size: 1.04rem;
}

.project-grid {
  display: grid;
  gap: clamp(16px, 4vw, 24px);
}

.project-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 20px;
  padding: clamp(16px, 4vw, 24px);
  display: flex;
  flex-direction: column;
  gap: clamp(16px, 3vw, 20px);
}

.project-type {
  color: var(--text);
  font-size: 0.92rem;
  font-weight: 600;
  margin-bottom: 8px;
}

.project-card h2 {
  font-size: 1.4rem;
  margin-bottom: 12px;
}

.project-description {
  color: var(--muted);
  font-size: 1rem;
  max-width: 38rem;
}

.tech-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  list-style: none;
}

.tech-list li {
  background: var(--button-outline-bg);
  color: var(--text);
  padding: clamp(6px, 1.5vw, 8px) clamp(10px, 2.5vw, 12px);
  border-radius: 999px;
  font-size: 0.92rem;
}

.project-actions {
  display: flex;
  flex-wrap: wrap;
  gap: clamp(8px, 2vw, 12px);
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: clamp(10px, 2vw, 12px) clamp(14px, 3vw, 18px);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
}

.button-outline {
  background: var(--button-outline-bg);
  color: var(--text);
  border-color: var(--button-outline-border);
}

.button-outline:hover,
.button-primary:hover {
  filter: contrast(95%);
}

.button-primary {
  background: var(--button-bg);
  color: var(--button-text);
}

.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 23, 42, 0.55);
  display: grid;
  place-items: center;
  padding: clamp(16px, 4vw, 24px);
  z-index: 50;
}

.hidden {
  display: none;
}

.modal-panel {
  width: min(880px, 100%);
  max-height: 90vh;
  overflow: auto;
  background: var(--surface);
  border-radius: 24px;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.18);
  position: relative;
}

.modal-close {
  position: absolute;
  top: 18px;
  right: 18px;
  background: transparent;
  border: none;
  font-size: 1.8rem;
  line-height: 1;
  color: var(--muted);
  cursor: pointer;
}

.modal-content {
  padding: clamp(24px, 5vw, 40px) clamp(20px, 4vw, 32px) clamp(24px, 4vw, 32px);
}

.modal-content h2 {
  margin-bottom: 16px;
}

.modal-summary,
.modal-purpose,
.modal-notes {
  color: var(--muted);
  margin-bottom: 20px;
}

.modal-section + .modal-section {
  margin-top: 24px;
}

.modal-features {
  list-style: disc inside;
  color: var(--muted);
  display: grid;
  gap: 10px;
}

.modal-footer {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

@media (min-width: 720px) {
  .project-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (min-width: 1024px) {
  .project-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (min-width: 1440px) {
  .page-shell {
    max-width: 1400px;
  }

  .project-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

@media (max-width: 640px) {
  .site-header {
    flex-direction: column;
    align-items: stretch;
  }

  .home-link,
  .theme-toggle {
    text-align: center;
  }

  .modal-content {
    padding: clamp(20px, 5vw, 32px) clamp(16px, 4vw, 20px)
      clamp(20px, 4vw, 24px);
  }
}
