:root {
  color-scheme: light;
  --bg: #f4f1e9;
  --ink: #112a33;
  --subtle: #4c636b;
  --card: rgba(255, 255, 255, 0.72);
  --line: rgba(17, 42, 51, 0.16);
  --brand: #007a78;
  --brand-2: #e1693b;
  --shadow: 0 18px 40px rgba(17, 42, 51, 0.14);
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: "Noto Sans KR", "Apple SD Gothic Neo", sans-serif;
  color: var(--ink);
  background:
    radial-gradient(circle at 20% 15%, rgba(0, 122, 120, 0.2), transparent 35%),
    radial-gradient(circle at 78% 8%, rgba(225, 105, 59, 0.2), transparent 28%),
    linear-gradient(130deg, #f8f7f3, var(--bg));
  min-height: 100vh;
  line-height: 1.6;
  overflow-x: hidden;
}

.bg-orb {
  position: fixed;
  border-radius: 999px;
  filter: blur(38px);
  z-index: -1;
  opacity: 0.4;
}

.orb-a {
  width: 280px;
  height: 280px;
  background: #00a29f;
  left: -80px;
  top: 180px;
  animation: driftA 12s ease-in-out infinite alternate;
}

.orb-b {
  width: 360px;
  height: 360px;
  background: #f18d5f;
  right: -120px;
  bottom: 120px;
  animation: driftB 14s ease-in-out infinite alternate;
}

.hero,
.section,
.footer {
  width: min(1080px, calc(100% - 2.5rem));
  margin-inline: auto;
}

.hero {
  padding: 4.5rem 0 2.2rem;
}

.hero-eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-bottom: 0.85rem;
}

.chip {
  display: inline-block;
  font-family: "Syne", sans-serif;
  letter-spacing: 0.08em;
  font-weight: 700;
  font-size: 0.8rem;
  color: var(--brand);
  margin-bottom: 0;
}

.hero-update {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 0.7rem;
  border: 1px solid rgba(17, 42, 51, 0.2);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--subtle);
}

h1,
h2 {
  font-family: "Syne", sans-serif;
  letter-spacing: 0.01em;
  line-height: 1.1;
  margin: 0;
}

h1 {
  font-size: clamp(2rem, 4vw, 4rem);
  margin-bottom: 1rem;
}

h2 {
  font-size: clamp(1.5rem, 2.4vw, 2.4rem);
}

.hero p {
  max-width: 780px;
  color: var(--subtle);
  margin: 0;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.35rem;
}

.btn {
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 150px;
  height: 46px;
  padding: 0 1.2rem;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--ink);
  color: #ffffff;
  font-weight: 600;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 18px rgba(17, 42, 51, 0.22);
}

.btn.btn-outline {
  background: transparent;
  border-color: var(--ink);
  color: var(--ink);
}

.section {
  margin-top: 2rem;
}

.section-head {
  margin-bottom: 1.25rem;
}

.kicker {
  margin: 0 0 0.35rem;
  font-size: 0.8rem;
  color: var(--brand);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-weight: 700;
}

.project-grid {
  display: grid;
  gap: 1rem;
  grid-template-columns: repeat(12, 1fr);
}

.project-card {
  grid-column: span 6;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--card);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
  padding: 1rem;
  display: flex;
  flex-direction: column;
  gap: 0.72rem;
}

.project-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.75rem;
}

.project-card h3 {
  margin: 0;
  font-family: "Syne", "Noto Sans KR", sans-serif;
  font-size: 1.35rem;
  line-height: 1.55;
  padding: 0.08em 0 0.2em;
  overflow: visible;
}

.project-card p {
  margin: 0;
  color: var(--subtle);
}

.project-media-block {
  margin-top: auto;
  display: flex;
  flex-direction: column;
  gap: 0.7rem;
}

.project-highlights {
  margin: 0;
  padding-left: 1.1rem;
  color: var(--subtle);
}

.project-highlights li {
  margin-bottom: 0.25rem;
  line-height: 1.45;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  margin: 0;
}

.tags span {
  border: 1px solid rgba(17, 42, 51, 0.22);
  border-radius: 999px;
  padding: 0.24rem 0.7rem;
  font-size: 0.8rem;
}

.gallery {
  display: grid;
  gap: 0.55rem;
  grid-template-columns: repeat(2, 1fr);
}

.gallery-item {
  border: 0;
  border-radius: 12px;
  padding: 0;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  cursor: pointer;
  background: #e4e9eb;
}

.gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.25s ease;
}

.gallery-item:hover img {
  transform: scale(1.05);
}

.gallery-empty {
  grid-column: 1 / -1;
  border: 1px dashed rgba(17, 42, 51, 0.28);
  border-radius: 12px;
  padding: 0.9rem 0.75rem;
  text-align: center;
  font-size: 0.9rem;
  color: var(--subtle);
  background: rgba(255, 255, 255, 0.58);
}

.detail-button {
  border: 1px solid rgba(17, 42, 51, 0.28);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: var(--ink);
  padding: 0.4rem 0.95rem;
  font-size: 0.83rem;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
  flex-shrink: 0;
}

.detail-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 5px 12px rgba(17, 42, 51, 0.15);
}

.footer {
  padding: 2.1rem 0 3rem;
  color: var(--subtle);
}

.detail-modal {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 24, 0.72);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 900;
  padding: 1.2rem;
}

.detail-modal.open {
  display: flex;
}

.detail-panel {
  width: min(980px, 100%);
  max-height: 92vh;
  overflow: auto;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 1.2rem 1.2rem 1.35rem;
  position: relative;
}

.detail-close {
  position: sticky;
  top: 0.2rem;
  margin-left: auto;
  display: block;
  border: 0;
  border-radius: 999px;
  width: 42px;
  height: 42px;
  background: rgba(17, 42, 51, 0.1);
  color: var(--ink);
  font-size: 1.75rem;
  cursor: pointer;
}

.detail-kicker {
  margin: 0.2rem 0 0.3rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.78rem;
  color: var(--brand);
  font-weight: 700;
}

#detail-title {
  margin: 0 0 0.45rem;
  font-family: "Syne", "Noto Sans KR", sans-serif;
  line-height: 1.55;
  padding: 0.08em 0 0.2em;
  overflow: visible;
}

.detail-summary {
  margin: 0;
  font-weight: 700;
  color: var(--ink);
}

.detail-description {
  margin: 0.5rem 0 0;
  color: var(--subtle);
}

.detail-points {
  margin: 0.8rem 0 0;
  padding-left: 1.1rem;
  color: var(--subtle);
}

.detail-points li {
  margin-bottom: 0.3rem;
}

.detail-tags {
  margin-top: 0.8rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
}

.detail-tags span {
  border: 1px solid rgba(17, 42, 51, 0.24);
  border-radius: 999px;
  padding: 0.22rem 0.65rem;
  font-size: 0.8rem;
}

.detail-gallery {
  margin-top: 1rem;
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0.6rem;
}

.detail-gallery-item {
  border: 0;
  border-radius: 12px;
  overflow: hidden;
  padding: 0;
  aspect-ratio: 16 / 10;
  cursor: pointer;
  background: #e5eaec;
}

.detail-gallery-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.detail-gallery-empty {
  grid-column: 1 / -1;
  margin: 0;
  border: 1px dashed rgba(17, 42, 51, 0.28);
  border-radius: 12px;
  padding: 1rem 0.8rem;
  text-align: center;
  color: var(--subtle);
  background: rgba(255, 255, 255, 0.58);
}

.reveal {
  opacity: 0;
  transform: translateY(14px);
  transition:
    opacity 0.65s ease,
    transform 0.65s ease;
  transition-delay: var(--d, 0ms);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 20, 24, 0.9);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 1000;
}

.lightbox.open {
  display: flex;
}

.lightbox-figure {
  margin: 0;
  width: min(92vw, 1000px);
}

#lightbox-image {
  width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

#lightbox-caption {
  margin-top: 0.6rem;
  text-align: center;
  color: #f5f7f8;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  border: 0;
  border-radius: 999px;
  width: 44px;
  height: 44px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 1.8rem;
  cursor: pointer;
}

.lightbox-close {
  right: 1.4rem;
  top: 1.2rem;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
}

.lightbox-nav.prev {
  left: 1rem;
}

.lightbox-nav.next {
  right: 1rem;
}

@keyframes driftA {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(35px, -25px) scale(1.08);
  }
}

@keyframes driftB {
  from {
    transform: translate(0, 0) scale(1);
  }
  to {
    transform: translate(-40px, 25px) scale(0.94);
  }
}

@media (prefers-color-scheme: dark) {
  :root {
    color-scheme: dark;
    --bg: #0d1519;
    --ink: #e7f0f2;
    --subtle: #a8bcc2;
    --card: rgba(17, 28, 33, 0.78);
    --line: rgba(207, 229, 235, 0.2);
    --brand: #56d2c6;
    --brand-2: #ff9a73;
    --shadow: 0 18px 40px rgba(0, 0, 0, 0.45);
  }

  body {
    background:
      radial-gradient(circle at 20% 15%, rgba(86, 210, 198, 0.16), transparent 38%),
      radial-gradient(circle at 78% 8%, rgba(255, 154, 115, 0.14), transparent 30%),
      linear-gradient(130deg, #0a1114, var(--bg));
  }

  .hero-update,
  .detail-button,
  .gallery-empty,
  .detail-gallery-empty {
    background: rgba(16, 27, 33, 0.78);
    border-color: rgba(210, 228, 234, 0.24);
    color: var(--subtle);
  }

  .gallery-item,
  .detail-gallery-item {
    background: #1a2a31;
  }

  .detail-panel {
    background: rgba(14, 24, 29, 0.95);
  }

  .detail-close {
    background: rgba(255, 255, 255, 0.14);
    color: var(--ink);
  }

  .btn {
    background: #15b0a6;
    color: #08282b;
  }

  .btn:hover {
    box-shadow: 0 10px 24px rgba(0, 0, 0, 0.48);
  }

  .btn.btn-outline {
    border-color: rgba(231, 240, 242, 0.58);
    color: var(--ink);
    background: transparent;
  }

  .orb-a,
  .orb-b {
    opacity: 0.25;
  }
}

@media (max-width: 920px) {
  .project-card {
    grid-column: span 12;
  }
}

@media (max-width: 600px) {
  .hero,
  .section,
  .footer {
    width: min(1080px, calc(100% - 1.3rem));
  }

  .hero {
    padding-top: 3.2rem;
  }

  .hero-eyebrow {
    gap: 0.45rem;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  .detail-gallery {
    grid-template-columns: 1fr;
  }

  .lightbox-nav {
    width: 40px;
    height: 40px;
    font-size: 1.5rem;
  }
}
