:root {
  --bg: #050816;
  --panel: rgba(10, 16, 35, 0.72);
  --line: rgba(142, 215, 255, 0.18);
  --text: #eff6ff;
  --muted: rgba(231, 239, 255, 0.7);
  --acid: #8dff2e;
  --cyan: #79d8ff;
  --shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  --radius: 24px;
  --max-width: 1120px;
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  font-family: 'Space Grotesk', Arial, sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #081020 0%, #050816 40%, #03050f 100%);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

/* Grid overlay */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  background:
    linear-gradient(rgba(255, 255, 255, 0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
  background-size: 80px 80px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.5), transparent 82%);
  opacity: 0.14;
  pointer-events: none;
  z-index: -4;
}

/* Zebra-stripe overlay (SVG) — semi-transparent purple/black midground */
.zebra-overlay {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -3;
  opacity: 0.85;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent 88%);
  -webkit-mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.6), transparent 88%);
}

body::after {
  content: '';
  position: fixed;
  inset: 0;
  background: radial-gradient(circle at top, transparent 0 45%, rgba(0, 0, 0, 0.38) 100%);
  pointer-events: none;
  z-index: -2;
}

a {
  color: inherit;
}

img {
  max-width: 100%;
  display: block;
}

/* ── Artifact field (floating GIFs) ── */

.artifact-field {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.artifact {
  position: absolute;
  opacity: 0;
  transform: rotate(var(--artifact-rotate, 0deg)) scale(0);
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.06));
  mix-blend-mode: screen;
  transition: none;
}

.artifact.is-visible {
  animation: artifact-grow 1.2s ease-out forwards;
}

.artifact.is-visible.artifact-bouncing {
  animation: none;
  opacity: var(--artifact-opacity, 0.3);
  transform: rotate(var(--artifact-rotate, 0deg)) scale(var(--artifact-scale, 1));
}

.artifact-shrinking {
  animation: artifact-shrink 1.2s ease-in forwards;
}

@keyframes artifact-grow {
  from {
    opacity: 0;
    transform: rotate(var(--artifact-rotate, 0deg)) scale(0);
  }
  to {
    opacity: var(--artifact-opacity, 0.3);
    transform: rotate(var(--artifact-rotate, 0deg)) scale(var(--artifact-scale, 1));
  }
}

@keyframes artifact-shrink {
  to {
    opacity: 0;
    transform: rotate(var(--artifact-rotate, 0deg)) scale(0);
  }
}

@keyframes artifact-spin {
  from { rotate: 0deg; }
  to   { rotate: 360deg; }
}

/* ── Layout shell ── */

main,
.topbar,
.footer {
  width: min(calc(100% - 2rem), var(--max-width));
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ── Top bar ── */

.topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-top: 1.25rem;
  padding: 0.5rem 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.8rem;
  text-decoration: none;
}

.brand-logo {
  width: 2.4rem;
  height: 2.4rem;
  object-fit: contain;
  border-radius: 50%;
}

.brand-wordmark {
  font-family: 'Cooper Black', sans-serif;
  font-size: 1rem;
  letter-spacing: 0.3rem;
  font-weight: 400;
  color: var(--acid);
}

/* ── Intro ── */

main {
  padding: 3rem 0 4rem;
}

.intro {
  padding: 2.5rem 0 2rem;
}

.intro h1 {
  font-family: 'Cooper Black', sans-serif;
  font-size: clamp(2.6rem, 6vw, 4.8rem);
  line-height: 1;
  letter-spacing: -0.03em;
  max-width: 18ch;
}

.intro-sub {
  margin-top: 1rem;
  color: var(--muted);
  font-size: 1.1rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.byline {
  margin-top: 0.9rem;
  color: var(--muted);
  font-size: 1.05rem;
  letter-spacing: 0.04em;
}

/* ── Project grid ── */

.projects {
  padding: 1rem 0 2rem;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 1rem;
}

/* ── Project card ── */

.project-card {
  display: flex;
  flex-direction: column;
  gap: 0.9rem;
  padding: 1.6rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(13, 19, 40, 0.82), rgba(6, 10, 24, 0.82));
  backdrop-filter: blur(16px);
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: transform 0.28s ease, border-color 0.28s ease;
}

.project-card::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(121, 216, 255, 0.06), transparent 45%, rgba(141, 255, 46, 0.05));
  opacity: 0;
  transition: opacity 0.28s ease;
}

.project-card > * {
  position: relative;
  z-index: 1;
}

.project-card.has-media {
  flex-direction: row;
  align-items: stretch;
  gap: 1.2rem;
}

.project-copy {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
  min-width: 0;
}

.project-media {
  flex: 0 0 11rem;
  width: 11rem;
  min-height: 15rem;
  margin-left: auto;
  align-self: stretch;
  display: flex;
  align-items: center;
  justify-content: center;
}

.project-media img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.project-card:hover,
.project-card:focus-within {
  transform: translateY(-4px);
  border-color: rgba(141, 255, 46, 0.26);
}

.project-card:hover::before,
.project-card:focus-within::before {
  opacity: 1;
}

.card-type {
  text-transform: uppercase;
  letter-spacing: 0.18rem;
  font-size: 0.72rem;
  color: var(--cyan);
}

.project-card h2 {
  font-family: 'Cooper Black', sans-serif;
  font-size: 1.7rem;
  line-height: 1;
  letter-spacing: 0.02em;
}

.project-card h2 a {
  text-decoration: none;
  color: inherit;
}

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

.card-link {
  margin-top: auto;
  padding-top: 0.4rem;
  display: inline-flex;
  width: fit-content;
  text-decoration: none;
  color: var(--acid);
  font-weight: 500;
  font-size: 0.95rem;
  transition: color 0.2s ease, transform 0.2s ease;
}

.card-link:hover,
.card-link:focus-visible {
  transform: translateX(3px);
  color: var(--text);
}

/* ── Footer ── */

.footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 2rem 0 3rem;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.footer-title {
  font-family: 'Cooper Black', sans-serif;
  color: var(--acid);
  letter-spacing: 0.22rem;
  font-weight: 400;
  font-size: 0.9rem;
  margin-bottom: 0.3rem;
}

.footer-sub {
  color: var(--muted);
  font-size: 0.95rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 1rem;
}

.footer-links a {
  color: var(--muted);
  text-decoration: none;
  font-size: 0.95rem;
}

.footer-links a:hover,
.footer-links a:focus-visible {
  color: var(--text);
}

/* ── Responsive ── */

@media (max-width: 720px) {
  main,
  .footer {
    width: min(calc(100% - 1.25rem), var(--max-width));
  }

  .intro h1 {
    max-width: 100%;
  }

  .project-grid {
    grid-template-columns: 1fr;
  }

  .project-card.has-media {
    gap: 0.95rem;
  }

  .project-media {
    flex-basis: 8.25rem;
    width: 8.25rem;
    min-height: 12rem;
  }

  .footer {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
