/* ----------------------------------
 * Design tokens
 * ---------------------------------- */
:root {
  --bg: #ffffff;
  --fg: #141414;
  --muted: #6b6b6b;
  --border: #e6e6e6;
  --surface: #f5f5f5;
  --accent: #141414;

  --text-sm: 0.875rem;
  --text-base: 1rem;
  --text-lg: 1.125rem;
  --text-xl: 1.5rem;
  --text-2xl: 2rem;
  --text-3xl: 3rem;

  --space-1: 4px;
  --space-2: 8px;
  --space-3: 12px;
  --space-4: 16px;
  --space-6: 24px;
  --space-8: 32px;
  --space-12: 48px;
  --space-16: 64px;

  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;

  --shadow: 0 1px 2px rgba(0, 0, 0, 0.04), 0 8px 24px rgba(0, 0, 0, 0.06);
  --shadow-lg: 0 2px 4px rgba(0, 0, 0, 0.06), 0 16px 40px rgba(0, 0, 0, 0.1);
}

/* ----------------------------------
 * Base
 * ---------------------------------- */
html,
body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  font-family: Arial, sans-serif;
}

body {
  position: relative;
  display: grid;
  grid-template-rows: 1fr;
  place-items: center;
  background: transparent;
  color: var(--fg);
  font-size: var(--text-base);
  line-height: 1.6;
}

h1,
h2,
h3 {
  margin: 0;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.2;
}

a {
  color: var(--fg);
  text-decoration: none;
  transition: color 0.2s ease;
}

/* ----------------------------------
 * Layout
 * ---------------------------------- */
.wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  align-self: center;
  text-align: center;
  gap: var(--space-6);
}

.title {
  font-size: var(--text-2xl);
  font-weight: 600;
  letter-spacing: -0.02em;
  margin-bottom: var(--space-6);
}

.content {
  display: flex;
  gap: var(--space-6);
  justify-content: center;
  align-items: center;
  flex-wrap: wrap;
}

canvas {
  position: absolute;
  top: 0;
  left: 0;
  z-index: -1;
}

/* ----------------------------------
 * Header
 * ---------------------------------- */
.site-header {
  position: absolute;
  top: 0;
  width: 100%;
  align-self: start;
  justify-self: stretch;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  padding: var(--space-4) 0;
  border-bottom: 1px solid var(--border);
}

.site-title {
  justify-self: center;
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.site-nav {
  display: flex;
  align-items: center;
  justify-self: start;
  padding-left: var(--space-6);
}

/* ----------------------------------
 * Links / nav buttons
 * ---------------------------------- */
.nav-btn {
  border: none;
  background: transparent;
  padding: 0;
  font: inherit;
  color: var(--muted);
  cursor: pointer;
  transition: color 0.2s ease;
}

.nav-btn:hover {
  color: var(--fg);
}

.site-nav .nav-btn:hover {
  transform: translateX(-2px);
  transition: color 0.2s ease, transform 0.2s ease;
}

/* ----------------------------------
 * Home page
 * ---------------------------------- */
.home-page {
  grid-template-rows: 1fr;
}

/* ----------------------------------
 * About page
 * ---------------------------------- */
.about-page {
  display: grid;
  grid-template-rows: 1fr;
  min-height: 100vh;
}

.about-page .wrap {
  align-self: center;
  align-items: flex-start;
  justify-self: start;
  text-align: left;
  padding-left: var(--space-12);
  max-width: 720px;
}

.about-page .title {
  margin-bottom: var(--space-1);
}

.about-page .content {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0;
}

.about-page ul {
  display: flex;
  flex-direction: column;
  gap: var(--space-1);
  margin: 0;
  padding-left: var(--space-6);
}

.about-page > .wrap > .content > ul > li {
  line-height: 1.5;
}

.about-page ul ul {
  margin-top: var(--space-1);
}

/* ----------------------------------
 * Projects page
 * ---------------------------------- */
.projects-page .wrap {
  width: min(100%, 1020px);
  align-self: start;
  justify-self: center;
  padding-top: var(--space-16);
}

.projects-grid {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-6);
  justify-content: center;
  width: 100%;
}

.project-card {
  flex: 0 1 300px;
  width: 300px;
  max-width: 300px;
  box-sizing: border-box;
  --pad: var(--space-4);
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--pad);
  cursor: pointer;
  overflow: hidden;
  text-align: left;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.project-card img {
  width: calc(100% + (var(--pad) * 2));
  height: 160px;
  object-fit: cover;
  object-position: center;
  display: block;
  margin: calc(var(--pad) * -1) calc(var(--pad) * -1) var(--space-3);
}

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

.project-card p {
  margin: 0 0 var(--space-3);
  color: var(--muted);
  font-size: var(--text-sm);
}

.tools {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-2);
  margin-bottom: var(--space-3);
}

.tool {
  display: inline-block;
  padding: var(--space-1) var(--space-2);
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg);
  color: var(--muted);
  font-size: var(--text-sm);
}

.actions {
  display: flex;
  gap: var(--space-4);
}

.actions a {
  font-size: var(--text-sm);
  color: var(--muted);
}

.actions a:hover {
  color: var(--fg);
}

/* ----------------------------------
 * Modal
 * ---------------------------------- */
.modal.hidden {
  display: none;
}

.modal {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(2px);
  display: grid;
  place-items: center;
}

.modal-content {
  position: relative;
  background: var(--bg);
  padding: var(--space-8);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  max-width: 640px;
  width: 90%;
}

.modal-content h2 {
  font-size: var(--text-xl);
  margin-bottom: var(--space-3);
}

.modal-content img {
  width: 100%;
  height: 400px;
  object-fit: cover;
  border-radius: var(--radius-sm);
  margin-top: var(--space-4);
}

.modal-close {
  position: absolute;
  top: var(--space-4);
  right: var(--space-4);
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg);
  color: var(--muted);
  font-size: var(--text-base);
  cursor: pointer;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.modal-close:hover {
  color: var(--fg);
  border-color: var(--muted);
}

/* ----------------------------------
 * Contact page
 * ---------------------------------- */
.contact-links {
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.contact-links a {
  color: var(--muted);
  font-size: var(--text-lg);
}

.contact-links a:hover {
  color: var(--fg);
}

/* ----------------------------------
 * Generic page subtext
 * ---------------------------------- */
.subtext {
  color: var(--muted);
  margin: 0;
}

/* ----------------------------------
 * Responsive
 * ---------------------------------- */
@media (max-width: 600px) {
  .wrap {
    padding: 0 var(--space-4);
  }

  .content {
    flex-direction: column;
    gap: var(--space-3);
  }

  .content a {
    word-break: break-all;
  }

  .about-page .wrap {
    padding-left: var(--space-4);
    padding-right: var(--space-4);
  }
}
