@import url("https://fonts.googleapis.com/css2?family=Poppins:wght@300;400;500;600;700;800&family=Revalia&display=swap");

:root {
  --bg-main: #0b1020;
  --bg-card: #111827;
  --accent: #39ff14;
  --accent-blue: #38bdf8;
  --text-main: #f9fafb;
  --text-muted: #cbd5e1;
  --line: rgba(56, 189, 248, 0.24);
  --display-font: "Revalia", cursive;
  --body-font: "Poppins", sans-serif;
}

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

html {
  color-scheme: dark;
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  min-height: 100vh;
  overflow-x: hidden;
  color: var(--text-main);
  background: #03050c;
  font-family: var(--body-font);
}

a {
  color: inherit;
  text-decoration: none;
}

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

a:focus-visible,
button:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 4px;
}

.skip-link {
  position: fixed;
  top: 1rem;
  left: 1rem;
  z-index: 100;
  padding: 0.75rem 1rem;
  border-radius: 6px;
  color: #07111f;
  background: var(--accent);
  font-weight: 700;
  transform: translateY(-180%);
  transition: transform 0.2s ease;
}

.skip-link:focus {
  transform: translateY(0);
}

.gallery-page,
.all-projects-page {
  min-height: 100vh;
  background:
    radial-gradient(circle at 18% 0%, rgba(246, 238, 220, 0.16) 0, rgba(246, 238, 220, 0.06) 24rem, transparent 46rem),
    radial-gradient(circle at 82% 16%, rgba(56, 189, 248, 0.2) 0, rgba(56, 189, 248, 0.07) 30rem, transparent 56rem),
    radial-gradient(circle at 50% 62%, rgba(92, 111, 145, 0.2) 0, rgba(92, 111, 145, 0.08) 36rem, transparent 68rem),
    linear-gradient(180deg, #151b2c 0%, #0b1020 48%, #03050c 100%);
}

.gallery-scene {
  position: relative;
  min-height: 100vh;
  overflow: hidden;
  perspective: 1400px;
  transform-style: preserve-3d;
}

.gallery-scene::before {
  content: "";
  position: absolute;
  inset: 12% auto auto 50%;
  width: min(90rem, 95vw);
  height: min(54rem, 62vw);
  border-radius: 999px;
  background:
    radial-gradient(circle at 38% 38%, rgba(245, 238, 224, 0.14), transparent 34%),
    radial-gradient(circle at 64% 48%, rgba(56, 189, 248, 0.18), transparent 42%);
  filter: blur(72px);
  opacity: 0.78;
  transform: translateX(-50%);
  pointer-events: none;
}

.gallery-center {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 10;
  width: min(68rem, calc(100vw - 4rem));
  padding: 2rem;
  text-align: center;
  transform: translate(-50%, -50%);
}

.page-kicker {
  color: var(--accent-blue);
  font-size: 0.85rem;
  font-weight: 800;
  letter-spacing: 0.28em;
  text-transform: uppercase;
}

.page-title {
  margin-top: 1.2rem;
  color: #fff;
  font-family: var(--display-font);
  font-size: clamp(2.35rem, 5vw, 4rem);
  font-weight: 400;
  line-height: 1.15;
}

.page-intro {
  max-width: 42rem;
  margin: 1.3rem auto 0;
  color: var(--text-muted);
  font-size: clamp(1rem, 2vw, 1.15rem);
  line-height: 1.8;
}

.page-actions,
.project-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.9rem;
  margin-top: 2rem;
}

.theme-button,
.action-unavailable {
  min-height: 3rem;
  padding: 0.75rem 1.35rem;
  border: 1px solid rgba(56, 189, 248, 0.35);
  border-radius: 0.5rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  color: #fff;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 18px 38px rgba(56, 189, 248, 0.12);
  font-size: 0.875rem;
  font-weight: 700;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease, transform 0.25s ease;
}

.theme-button:hover,
.theme-button:focus-visible {
  border-color: var(--accent);
  background: rgba(57, 255, 20, 0.08);
  box-shadow: 0 20px 44px rgba(57, 255, 20, 0.16);
  transform: translateY(-2px);
}

.theme-button span {
  color: var(--accent);
}

.action-unavailable {
  color: var(--text-muted);
  cursor: not-allowed;
  opacity: 0.7;
}

.floating-card {
  --x: 0vw;
  --y: 0vh;
  --z: 0px;
  --rx: 0deg;
  --ry: 0deg;
  --rz: 0deg;
  --s: 1;
  --float-x: 0.8vw;
  --float-y: -1.2vh;
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  width: clamp(20rem, 24vw, 35rem);
  aspect-ratio: 16 / 10;
  border: 1px solid rgba(56, 189, 248, 0.22);
  border-radius: 14px;
  overflow: hidden;
  display: block;
  color: #fff;
  background: rgba(17, 24, 39, 0.74);
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.34);
  animation: float-card 9s ease-in-out infinite;
  transform:
    translate3d(var(--x), var(--y), var(--z))
    rotateX(var(--rx))
    rotateY(var(--ry))
    rotateZ(var(--rz))
    scale(var(--s));
  transform-style: preserve-3d;
  transition: border-color 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease, transform 0.25s ease;
}

.floating-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(3, 5, 12, 0.02), rgba(3, 5, 12, 0.78));
  opacity: 0.52;
  transition: opacity 0.25s ease;
}

.floating-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.85) brightness(0.78);
  transition: filter 0.25s ease, transform 0.35s ease;
}

.floating-card:hover,
.floating-card:focus-visible,
.floating-card:focus-within {
  z-index: 12;
  border-color: rgba(57, 255, 20, 0.8);
  box-shadow: 0 24px 80px rgba(57, 255, 20, 0.14), 0 28px 74px rgba(0, 0, 0, 0.45);
  animation-play-state: paused;
  filter: brightness(1.08);
  transform:
    translate3d(var(--x), var(--y), var(--z))
    rotateX(var(--rx))
    rotateY(var(--ry))
    rotateZ(var(--rz))
    scale(calc(var(--s) + 0.06));
}

.floating-card:hover::after,
.floating-card:focus-visible::after,
.floating-card:focus-within::after {
  opacity: 0.22;
}

.floating-card:hover img,
.floating-card:focus-visible img,
.floating-card:focus-within img {
  filter: saturate(1.04) brightness(1);
  transform: scale(1.04);
}

.card-meta {
  position: absolute;
  right: 1.4rem;
  bottom: 1.2rem;
  left: 1.4rem;
  z-index: 2;
  opacity: 0;
  transform: translateY(1rem);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.floating-card:hover .card-meta,
.floating-card:focus-visible .card-meta,
.floating-card:focus-within .card-meta {
  opacity: 1;
  transform: translateY(0);
}

.card-label {
  color: var(--accent-blue);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.card-title {
  margin-top: 0.3rem;
  font-size: 1.25rem;
  line-height: 1.3;
}

.project-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-top: 0.8rem;
}

.project-tags span {
  padding: 0.28rem 0.62rem;
  border: 1px solid rgba(56, 189, 248, 0.25);
  border-radius: 999px;
  color: #e2e8f0;
  background: rgba(2, 6, 23, 0.58);
  font-size: 0.7rem;
  font-weight: 600;
}

@keyframes float-card {
  0%,
  100% {
    transform:
      translate3d(var(--x), var(--y), var(--z))
      rotateX(var(--rx))
      rotateY(var(--ry))
      rotateZ(var(--rz))
      scale(var(--s));
  }

  50% {
    transform:
      translate3d(calc(var(--x) + var(--float-x)), calc(var(--y) + var(--float-y)), var(--z))
      rotateX(calc(var(--rx) + 1deg))
      rotateY(calc(var(--ry) - 1deg))
      rotateZ(var(--rz))
      scale(var(--s));
  }
}

.collection-wrap {
  width: min(80rem, calc(100% - 2.5rem));
  margin: 0 auto;
  padding: 5rem 0;
}

.collection-header {
  max-width: 58rem;
  margin: 0 auto;
  text-align: center;
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1.5rem;
  margin-top: 3.5rem;
}

.project-card {
  border: 1px solid rgba(56, 189, 248, 0.18);
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: rgba(17, 24, 39, 0.78);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.26);
  backdrop-filter: blur(16px);
  transition: border-color 0.25s ease, box-shadow 0.25s ease, transform 0.25s ease;
}

.project-card:hover,
.project-card:focus-within {
  border-color: rgba(57, 255, 20, 0.62);
  box-shadow: 0 26px 78px rgba(57, 255, 20, 0.1), 0 28px 76px rgba(0, 0, 0, 0.34);
  transform: translateY(-6px);
}

.project-image-wrap {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.9);
}

.project-image-wrap::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 34%, rgba(3, 5, 12, 0.46));
  pointer-events: none;
}

.project-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.92) brightness(0.88);
  transition: filter 0.3s ease, transform 0.35s ease;
}

.project-card:hover .project-image,
.project-card:focus-within .project-image {
  filter: saturate(1.04) brightness(1);
  transform: scale(1.04);
}

.project-card-content {
  padding: 1.5rem;
  display: flex;
  flex: 1;
  flex-direction: column;
}

.project-category {
  color: var(--accent-blue);
  font-size: 0.72rem;
  font-weight: 800;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}

.project-card-title {
  margin-top: 0.75rem;
  color: #fff;
  font-size: 1.45rem;
  line-height: 1.3;
}

.project-description {
  margin-top: 0.75rem;
  flex: 1;
  color: var(--text-muted);
  font-size: 0.9rem;
  line-height: 1.75;
}

.project-actions {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 1.4rem;
}

.noscript-message {
  max-width: 44rem;
  margin: 2rem auto;
  padding: 1rem;
  border-radius: 8px;
  color: #07111f;
  background: #fbbf24;
  font-weight: 700;
  text-align: center;
}

@media (max-width: 1024px) {
  .floating-card {
    width: clamp(18rem, 28vw, 30rem);
  }

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

@media (max-width: 760px) {
  .gallery-scene {
    min-height: auto;
    overflow: visible;
    padding: 7rem 1.25rem 3rem;
    perspective: none;
  }

  .gallery-center {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    padding: 0;
    margin: 0 auto 3rem;
    transform: none;
  }

  .page-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .page-actions .theme-button {
    width: 100%;
  }

  .floating-card,
  .floating-card:hover,
  .floating-card:focus-visible,
  .floating-card:focus-within {
    position: relative;
    top: auto;
    left: auto;
    width: 100%;
    max-width: 42rem;
    margin: 1.4rem auto;
    animation: none;
    transform: none;
  }

  .floating-card::after {
    opacity: 0.38;
  }

  .card-meta {
    opacity: 1;
    transform: none;
  }

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

@media (max-width: 480px) {
  .collection-wrap {
    width: min(100% - 2rem, 80rem);
    padding: 4rem 0;
  }

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

@media (hover: none) {
  .floating-card .card-meta {
    opacity: 1;
    transform: none;
  }
}

@media (max-height: 720px) and (min-width: 761px) {
  .gallery-scene {
    min-height: 48rem;
  }
}

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