:root {
  --bg:         #282a36;
  --surface:    #44475a;
  --foreground: #f8f8f2;
  --comment:    #6272a4;
  --muted:      #9cb5ff; /* accessible secondary text — passes 4.5:1 on both --bg and --surface */
  --cyan:       #8be9fd;
  --green:      #50fa7b;
  --orange:     #ffb86c;
  --pink:       #ff79c6;
  --purple:     #bd93f9;
  --red:        #ff5555;
  --yellow:     #f1fa8c;
}

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

/* ── Skip link ──────────────────────────────────────── */

.skip-link {
  position: absolute;
  top: -100%;
  left: 1rem;
  padding: 0.5rem 1rem;
  background: var(--purple);
  color: var(--bg);
  font-size: 0.875rem;
  font-weight: 600;
  border-radius: 0 0 6px 6px;
  text-decoration: none;
  z-index: 200;
}

.skip-link:focus {
  top: 0;
}

/* ── Focus styles ───────────────────────────────────── */

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

/* ── Animations ─────────────────────────────────────── */

@keyframes fadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

@keyframes blink {
  0%,  49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

html {
  font-size: 16px;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  background-color: var(--bg);
  color: var(--foreground);
  font-family: 'Roboto', system-ui, -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  line-height: 1.6;
  min-height: 100vh;
}

main {
  max-width: 900px;
  margin: 0 auto;
  padding: 2.5rem 2rem 4rem;
  animation: fadeIn 0.25s ease forwards;
}

/* ── Header ─────────────────────────────────────────── */

header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 1.5rem;
  margin-bottom: 2rem;
}

h1 {
  font-size: 2.75rem;
  font-weight: 700;
  color: var(--foreground);
  letter-spacing: -0.03em;
  line-height: 1.1;
  margin-bottom: 0.4rem;
}

.cursor {
  display: inline-block;
  color: var(--cyan);
  animation: blink 1s linear infinite;
  margin-left: 1px;
}

.role {
  color: var(--muted);
  font-size: 1.05rem;
  margin-bottom: 0.4rem;
}

.currently {
  color: var(--muted);
  font-size: 0.875rem;
}

/* ── Social links ───────────────────────────────────── */

.social {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  flex-shrink: 0;
  align-items: flex-end;
}

.social a {
  color: var(--muted);
  text-decoration: none;
  display: flex;
  align-items: center;
  transition: color 0.15s ease;
}

.social a:hover {
  color: var(--cyan);
}

.social a svg {
  display: block;
}

/* ── Section ────────────────────────────────────────── */

section {
  margin-top: 1.5rem;
}

h2 {
  font-size: 0.7rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  color: var(--muted);
  margin-bottom: 1.25rem;
  display: flex;
  align-items: center;
  gap: 1rem;
}

h2::after {
  content: '';
  flex: 1;
  height: 1px;
  background: var(--surface);
}

/* ── About ──────────────────────────────────────────── */

.about-body {
  color: var(--muted);
  font-size: 0.9rem;
  line-height: 1.75;
}

.about-body a {
  color: var(--cyan);
  text-decoration: none;
}

.about-body a:hover {
  text-decoration: underline;
}

/* ── Projects list ──────────────────────────────────── */

.projects {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
  align-items: stretch;
}

/* ── Project card ───────────────────────────────────── */

.project-card {
  background: var(--surface);
  border-radius: 8px;
  padding: 1.375rem 1.5rem;
  display: flex;
  flex-direction: column;
  gap: 0.625rem;
  border: 1px solid transparent;
  transition: border-color 0.15s ease;
}

.project-card:hover {
  border-color: var(--comment);
}

.project-card.featured {
  border-left: 3px solid var(--purple);
  padding-left: calc(1.5rem - 2px); /* compensate for thicker border */
}

.project-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 0.5rem;
}

.project-header h3 {
  font-size: 0.975rem;
  font-weight: 600;
  color: var(--foreground);
}

.project-link {
  color: var(--foreground);
  text-decoration: none;
  line-height: 1;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  transition: color 0.15s ease;
}

.project-link:hover {
  color: var(--cyan);
}

.project-card p {
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.65;
}

/* ── Tags ───────────────────────────────────────────── */

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
  margin-top: 0.25rem;
}

.tag {
  background: var(--bg);
  color: var(--green);
  font-size: 0.725rem;
  font-weight: 500;
  padding: 0.2rem 0.55rem;
  border-radius: 4px;
  letter-spacing: 0.02em;
}


/* ── Single card screenshot ─────────────────────────── */

.card-screenshot {
  width: 100%;
  height: auto;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 6px;
  margin-top: auto;
  padding-top: 0.75rem;
  display: block;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.card-screenshot:hover {
  opacity: 0.75;
}

/* ── Screenshot grid ────────────────────────────────── */

.screenshots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0.375rem;
  margin-top: 0.75rem;
  border-radius: 6px;
  overflow: hidden;
}

.screenshots img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  display: block;
  cursor: pointer;
  transition: opacity 0.15s ease;
}

.screenshots img:hover {
  opacity: 0.75;
}

/* ── Lightbox ───────────────────────────────────────── */

#lb {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.92);
  z-index: 100;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 1.25rem;
  padding: 1.5rem;
  box-sizing: border-box;
}

#lb.open {
  display: flex;
}

#lb-img {
  max-width: calc(100% - 8rem);
  max-height: 90vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 4px;
  display: block;
  flex-shrink: 1;
}

#lb-prev,
#lb-next {
  background: none;
  border: 1px solid var(--comment);
  color: var(--foreground);
  font-size: 1.1rem;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: 4px;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s ease, color 0.15s ease;
}

#lb-prev:hover,
#lb-next:hover {
  border-color: var(--cyan);
  color: var(--cyan);
}

#lb-close {
  position: absolute;
  top: 1rem;
  right: 1rem;
  background: none;
  border: 1px solid var(--comment);
  color: var(--foreground);
  font-size: 1rem;
  width: 2rem;
  height: 2rem;
  border-radius: 4px;
  cursor: pointer;
  line-height: 1;
  transition: border-color 0.15s ease, color 0.15s ease;
}

#lb-close:hover {
  border-color: var(--red);
  color: var(--red);
}

.steam-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.375rem;
  margin-top: 0.5rem;
  padding: 0.55rem 1.125rem;
  background: var(--purple);
  color: var(--bg);
  font-size: 0.875rem;
  font-weight: 600;
  text-decoration: none;
  border-radius: 6px;
  letter-spacing: 0.01em;
  transition: filter 0.15s ease, transform 0.1s ease;
  border: none;
  cursor: pointer;
  align-self: flex-start;
}

.steam-cta:hover {
  filter: brightness(1.12);
  transform: translateY(-1px);
}

/* ── Footer ─────────────────────────────────────────── */

footer {
  max-width: 900px;
  margin: 0 auto;
  padding: 1.5rem 2rem;
  text-align: center;
  color: var(--muted);
  font-size: 0.775rem;
  border-top: 1px solid var(--surface);
}

/* ── More link ──────────────────────────────────────── */

.more-link {
  display: inline-block;
  margin-top: 1.25rem;
  color: var(--muted);
  text-decoration: none;
  font-size: 0.85rem;
  transition: color 0.15s ease;
}

.more-link:hover {
  color: var(--cyan);
}

/* ── Responsive ─────────────────────────────────────── */

@media (max-width: 640px) {
  .projects {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 500px) {
  main {
    padding: 1.75rem 1.25rem 3rem;
  }

  h1 {
    font-size: 2.1rem;
  }
}

/* ── Reduced motion ─────────────────────────────────── */

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }

  .cursor {
    animation: none;
  }
}
