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

:root {
  --bg: #000;
  --fg: #fff;
  --lime: #c6ff00;
  --muted: #6b6b6b;
  --line: rgba(255, 255, 255, 0.09);
  --line-hover: rgba(255, 255, 255, 0.32);
  --surface: rgba(255, 255, 255, 0.02);
  --radius: 20px;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
}

html,
body {
  min-height: 100%;
}

body {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background: var(--bg);
  color: var(--fg);
  font-family: "Helvetica Neue", Helvetica, Arial, "Apple SD Gothic Neo", "Noto Sans KR", sans-serif;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* 은은한 그리드 배경 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
  -webkit-mask-image: radial-gradient(ellipse at 50% 40%, #000 20%, transparent 75%);
}

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

/* Header */
.header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 32px 48px;
}

.logo {
  font-size: 28px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.header__est,
.footer {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--muted);
}

/* Main / Gallery */
.main {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 40px 48px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
}

/* Card (공통) */
.card {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 340px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  overflow: hidden;
  transition:
    transform 0.5s var(--ease),
    border-color 0.5s var(--ease),
    box-shadow 0.5s var(--ease);
}

.card:hover,
.card:focus-visible {
  transform: translateY(-4px) scale(1.02);
  border-color: var(--line-hover);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.04), 0 24px 60px -20px rgba(198, 255, 0, 0.18);
  outline: none;
}

/* Project card */
.card__visual {
  position: relative;
  flex: 1;
  min-height: 160px;
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}

.graphic {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
}

.graphic__glow {
  opacity: 0.75;
  transition: opacity 0.8s var(--ease);
  animation: breathe 6s ease-in-out infinite;
}

/* ISSUE LAB 카드 호버: 살짝 떠오르고 라임색 빛 강조 */
.card--project:hover,
.card--project:focus-visible {
  transform: translateY(-6px) scale(1.02);
  border-color: rgba(198, 255, 0, 0.35);
  box-shadow: 0 0 0 1px rgba(198, 255, 0, 0.06), 0 30px 70px -24px rgba(198, 255, 0, 0.32);
}

.card--project:hover .graphic__glow {
  opacity: 1;
  animation-play-state: paused;
}

/* 3D 오브젝트 */
.orb {
  position: absolute;
  left: 65%;
  top: 50%;
  width: 0;
  height: 0;
  perspective: 800px;
}

.orb__tilt {
  position: absolute;
  transform-style: preserve-3d;
  transform: rotateX(calc(var(--my, 0) * -28deg)) rotateY(calc(var(--mx, 0) * 32deg));
  transition: transform 1.2s var(--ease);
}

.orb__spin {
  position: absolute;
  transform-style: preserve-3d;
  animation: spin 32s linear infinite;
}

.orb__ring,
.orb__orbit {
  position: absolute;
  left: 0;
  top: 0;
  border-radius: 50%;
  transform-style: preserve-3d;
}

.orb__ring {
  border: 1px solid rgba(198, 255, 0, 0.55);
}

.orb__ring--1 { width: 68px;  height: 68px;  margin: -34px;  transform: rotateY(0deg);  border-color: rgba(198, 255, 0, 0.8); }
.orb__ring--2 { width: 122px; height: 122px; margin: -61px;  transform: rotateY(60deg); }
.orb__ring--3 { width: 176px; height: 176px; margin: -88px;  transform: rotateY(120deg); border-color: rgba(198, 255, 0, 0.35); }

.orb__ring--dash {
  width: 232px;
  height: 232px;
  margin: -116px;
  border: 1px dashed rgba(198, 255, 0, 0.28);
  animation: turn 90s linear infinite;
}

.orb__orbit {
  width: 232px;
  height: 232px;
  margin: -116px;
  border: 1px solid rgba(198, 255, 0, 0.3);
}

.orb__orbit--a { transform: rotateZ(-24deg) rotateX(69deg); }
.orb__orbit--b { transform: rotateZ(36deg) rotateX(69deg); }

.orb__track {
  position: absolute;
  inset: -1px;
  border-radius: 50%;
  transform-style: preserve-3d;
  animation: turn 14s linear infinite;
}

.orb__track--rev {
  animation-duration: 20s;
  animation-direction: reverse;
}

.orb__sat {
  position: absolute;
  left: 50%;
  top: -4px;
  width: 8px;
  height: 8px;
  margin-left: -4px;
  border-radius: 50%;
  background: var(--lime);
  box-shadow: 0 0 10px rgba(198, 255, 0, 0.8);
}

.orb__sat--sm {
  width: 6px;
  height: 6px;
  top: -3px;
  margin-left: -3px;
  opacity: 0.75;
}

.orb__core {
  position: absolute;
  left: -9px;
  top: -9px;
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: radial-gradient(circle at 35% 35%, #efffb0, var(--lime) 55%, #7fa300);
  box-shadow: 0 0 18px rgba(198, 255, 0, 0.6);
  transform: translateZ(1px);
}

@keyframes spin {
  from { transform: rotateX(-14deg) rotateY(0deg); }
  to   { transform: rotateX(-14deg) rotateY(360deg); }
}

@keyframes turn {
  to { transform: rotate(360deg); }
}

@keyframes breathe {
  0%, 100% { opacity: 0.65; }
  50%      { opacity: 0.85; }
}

.card__body {
  display: flex;
  flex-direction: column;
  gap: 16px;
  padding: 22px 24px 26px;
}

.card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.card__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.card__arrow {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  font-size: 16px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: var(--lime);
  transition: transform 0.5s var(--ease), background 0.5s var(--ease), color 0.5s var(--ease), border-color 0.5s var(--ease);
}

.card--project:hover .card__arrow,
.card--project:focus-visible .card__arrow {
  transform: translate(3px, -3px);
  background: var(--lime);
  border-color: var(--lime);
  color: #000;
}

.card__titles {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.card__tags {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.2em;
  color: var(--muted);
}

.card__title {
  font-size: clamp(28px, 3vw, 40px);
  font-weight: 800;
  letter-spacing: -0.035em;
  line-height: 1;
  color: var(--lime);
}

/* Coming soon card */
.card--soon {
  align-items: center;
  justify-content: center;
  cursor: default;
}

.soon {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 20px;
}

.soon__icon {
  position: relative;
  width: 64px;
  height: 64px;
  border: 1px solid var(--line-hover);
  border-radius: 50%;
  transition: border-color 0.5s var(--ease), transform 0.5s var(--ease);
}

/* + 아이콘 */
.soon__icon::before,
.soon__icon::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  background: var(--fg);
  transform: translate(-50%, -50%);
}

.soon__icon::before {
  width: 22px;
  height: 1.5px;
}

.soon__icon::after {
  width: 1.5px;
  height: 22px;
}

.soon__text {
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.25em;
  color: var(--muted);
  transition: color 0.5s var(--ease);
}

.card--soon:hover .soon__icon {
  border-color: rgba(255, 255, 255, 0.6);
  transform: rotate(90deg);
}

.soon__copy {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.soon__sub {
  font-size: 12px;
  color: #4a4a4a;
  transition: color 0.5s var(--ease);
}

.card--soon:hover .soon__sub {
  color: var(--muted);
}

.card--soon:hover .soon__text {
  color: var(--fg);
}

/* Footer */
.footer {
  display: flex;
  justify-content: space-between;
  padding: 32px 48px;
}

/* 움직임 줄이기 설정 존중 */
@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}

/* Tablet */
@media (max-width: 960px) {
  .gallery {
    grid-template-columns: repeat(2, 1fr);
  }
}

/* Mobile */
@media (max-width: 720px) {
  .header,
  .footer {
    padding: 24px 20px;
  }

  .logo {
    font-size: 22px;
  }

  .main {
    align-items: flex-start;
    padding: 8px 20px 32px;
  }

  .gallery {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .card {
    min-height: 0;
  }

  .card__visual {
    min-height: 200px;
  }

  .orb {
    left: 62%;
  }

  .card__body {
    padding: 22px 24px 26px;
  }

  .card--soon {
    min-height: 200px;
  }

  .footer {
    flex-direction: column;
    gap: 8px;
  }
}
