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

:root {
  --bg: #08080f;
  --text: #e8e8f0;
  --text-muted: #8888a0;
  --accent: #6366f1;
  --accent-glow: rgba(99, 102, 241, 0.35);
  --surface: rgba(255, 255, 255, 0.04);
  --border: rgba(255, 255, 255, 0.08);
  --font-display: 'Syne', system-ui, sans-serif;
  --font-body: 'DM Sans', system-ui, sans-serif;
}

html {
  color-scheme: dark;
}

body {
  margin: 0;
  min-height: 100dvh;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--text);
  background: var(--bg);
  overflow-x: hidden;
}

#bg,
#bg-fx {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
}

#bg {
  transition: opacity 0.8s ease;
}

#bg-fx {
  opacity: 0;
  transition: opacity 1.2s ease-out;
}

body.fx-weather #bg {
  opacity: 0;
}

body.fx-weather-ready #bg-fx {
  opacity: 1;
}

.grain {
  position: fixed;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.page {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  min-height: 100dvh;
  width: 100%;
  padding: 1rem clamp(1rem, 3vw, 3rem) clamp(1rem, 2vw, 1.25rem);
}

.page-header {
  flex-shrink: 0;
  text-align: center;
  margin-bottom: 0.5rem;
}

.page-header__label {
  margin: 0;
  font-family: var(--font-display);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--text-muted);
}

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

.projects-index {
  flex-shrink: 0;
  width: 100%;
  max-width: 120rem;
  margin: auto auto 0;
  max-height: min(40vh, 26rem);
  overflow-y: auto;
  padding-top: 1.5rem;
  scrollbar-width: thin;
  scrollbar-color: rgba(255, 255, 255, 0.15) transparent;
  mask-image: linear-gradient(to bottom, transparent, #000 1.5rem);
}

.projects-list {
  display: flex;
  flex-direction: row;
  align-items: flex-end;
  justify-content: center;
  gap: 1rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.projects-column {
  display: flex;
  flex: 1;
  flex-direction: column;
  gap: 1rem;
  min-width: 0;
  max-width: 22rem;
}

@media (min-width: 960px) {
  .projects-list {
    gap: 1.25rem;
  }

  .projects-column {
    gap: 1.25rem;
  }
}

@media (min-width: 1280px) {
  .projects-list {
    gap: 1.5rem;
  }
}

.project-card {
  display: block;
  padding: 1.125rem 1.375rem;
  border-radius: 0.875rem;
  background: var(--surface);
  border: 1px solid var(--border);
  text-decoration: none;
  color: inherit;
  transition: border-color 0.3s ease, background 0.3s ease, transform 0.3s ease;
}

.project-card:hover,
.project-card:focus-visible {
  border-color: var(--accent);
  background: rgba(255, 255, 255, 0.06);
  transform: translateY(-2px);
  outline: none;
}

.project-card__title {
  margin: 0 0 0.25rem;
  font-family: var(--font-display);
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}

.project-card__desc {
  margin: 0 0 0.5rem;
  font-size: 0.875rem;
  color: var(--text-muted);
}

.project-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.project-card__tag {
  font-size: 0.6875rem;
  padding: 0.125rem 0.5rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
  color: var(--text-muted);
}

.project-card.is-active {
  border-color: var(--accent);
}

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

  .project-card:hover,
  .project-card:focus-visible {
    transform: none;
  }
}
