:root {
  --bg: #0f1726;
  --surface: rgba(20, 30, 48, 0.62);
  --surface-hover: rgba(29, 41, 63, 0.82);
  --text: #f7f9fc;
  --muted: #aeb9c9;
  --pink: #E947b2;
  --teal: #1ccba1;
  --blue: #52cdf0;
}

* { box-sizing: border-box; }

html { min-height: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: Arial, Helvetica, sans-serif;
  color: var(--text);
  background: var(--bg);
}

.background {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  background:
    radial-gradient(circle at 50% 5%, rgba(82,205,240,.08), transparent 35%),
    linear-gradient(145deg, #0c1422 0%, #111a2a 45%, #0c1422 100%);
}

.orb {
  position: absolute;
  width: 42vw;
  height: 42vw;
  max-width: 680px;
  max-height: 680px;
  min-width: 280px;
  min-height: 280px;
  border-radius: 50%;
  filter: blur(85px);
  opacity: .40;
  animation: float 16s ease-in-out infinite alternate;
}

.orb-pink { top: -18%; left: -12%; background: var(--pink); animation-duration: 18s; }
.orb-teal { right: -14%; top: 25%; background: var(--teal); animation-duration: 21s; animation-delay: -5s; }
.orb-blue { left: 35%; bottom: -28%; background: var(--blue); animation-duration: 24s; animation-delay: -9s; }

.grid-overlay {
  position: absolute;
  inset: -50%;
  opacity: .13;
  background-image:
    linear-gradient(rgba(255,255,255,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,.08) 1px, transparent 1px);
  background-size: 55px 55px;
  transform: perspective(800px) rotateX(62deg) translateY(-8%);
  transform-origin: center top;
  mask-image: linear-gradient(to bottom, transparent 0%, black 35%, transparent 90%);
  animation: gridMove 18s linear infinite;
}

.page {
  position: relative;
  z-index: 1;
  width: min(1120px, calc(100% - 48px));
  margin: 0 auto;
  padding: clamp(70px, 11vh, 130px) 0 90px;
}

.hero {
  text-align: center;
  margin-bottom: clamp(50px, 8vh, 82px);
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--blue);
  font-size: .78rem;
  font-weight: 700;
  letter-spacing: .28em;
  opacity: .9;
}

h1 {
  margin: 0;
  font-size: clamp(2.4rem, 5.5vw, 5rem);
  line-height: 1.05;
  letter-spacing: -.045em;
  text-shadow: 0 8px 40px rgba(0,0,0,.28);
}

.subtitle {
  margin: 20px 0 0;
  color: var(--muted);
  font-size: clamp(1rem, 2vw, 1.3rem);
}

.projects {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

.project-card {
  position: relative;
  min-height: 330px;
  padding: 34px 30px 28px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  text-decoration: none;
  color: var(--text);
  background: var(--surface);
  border: 1px solid rgba(255,255,255,.10);
  border-radius: 28px;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  box-shadow: 0 24px 70px rgba(0,0,0,.24), inset 0 1px 0 rgba(255,255,255,.06);
  transition: transform .35s cubic-bezier(.2,.8,.2,1), background .35s ease,
              border-color .35s ease, box-shadow .35s ease;
  overflow: hidden;
}

.project-card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 50% 0%, rgba(82,205,240,.10), transparent 48%);
  opacity: 0;
  transition: opacity .35s ease;
}

.project-card:hover {
  transform: translateY(-10px) scale(1.015);
  background: var(--surface-hover);
  border-color: rgba(255,255,255,.22);
  box-shadow: 0 32px 90px rgba(0,0,0,.34), 0 0 45px rgba(82,205,240,.08);
}

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

.logo {
  position: relative;
  z-index: 1;
  width: 125px;
  height: 125px;
  display: grid;
  place-items: center;
  border-radius: 30px;
  margin-bottom: 28px;
  font-size: 2.35rem;
  font-weight: 800;
  letter-spacing: -.06em;
  color: white;
  border: 1px solid rgba(255,255,255,.22);
  box-shadow: 0 18px 45px rgba(0,0,0,.25), inset 0 1px 0 rgba(255,255,255,.22);
  transition: transform .4s cubic-bezier(.2,.8,.2,1), box-shadow .4s ease;
}

.project-card:hover .logo {
  transform: translateY(-5px) rotate(-2deg) scale(1.05);
  box-shadow: 0 24px 55px rgba(0,0,0,.32), 0 0 35px rgba(82,205,240,.14);
}

.logo-gradient { background: linear-gradient(135deg, var(--pink), #9e4fe8 48%, var(--blue)); }
.logo-teal { background: linear-gradient(135deg, #108d8d, var(--teal)); }
.logo-blue { background: linear-gradient(135deg, #168bb5, var(--blue)); }

.project-card h2 {
  position: relative;
  z-index: 1;
  margin: 0;
  font-size: 1.35rem;
  letter-spacing: -.02em;
}

.open-label {
  position: relative;
  z-index: 1;
  margin-top: 12px;
  color: var(--muted);
  font-size: .85rem;
  transition: color .3s ease;
}

.project-card:hover .open-label { color: var(--text); }
.open-label span { display: inline-block; margin-left: 5px; transition: transform .3s ease; }
.project-card:hover .open-label span { transform: translate(3px, -3px); }

.placeholder { cursor: default; opacity: .72; }
.placeholder:hover { transform: translateY(-6px); }
.placeholder:hover .logo { transform: translateY(-3px) scale(1.03); }

footer {
  position: relative;
  z-index: 1;
  padding: 0 24px 30px;
  text-align: center;
  color: rgba(174,185,201,.6);
  font-size: .8rem;
}

@keyframes float {
  0% { transform: translate3d(-3%, -2%, 0) scale(1); }
  50% { transform: translate3d(5%, 4%, 0) scale(1.08); }
  100% { transform: translate3d(-4%, 7%, 0) scale(.96); }
}

@keyframes gridMove {
  from { transform: perspective(800px) rotateX(62deg) translateY(-8%) translateX(0); }
  to { transform: perspective(800px) rotateX(62deg) translateY(-8%) translateX(55px); }
}

@media (max-width: 820px) {
  .page { width: min(620px, calc(100% - 32px)); padding-top: 55px; }
  .projects { grid-template-columns: 1fr; gap: 20px; }
  .project-card { min-height: 280px; }
  .logo { width: 105px; height: 105px; border-radius: 25px; }
  .hero { margin-bottom: 40px; }
}

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