/* Language-based font switching */
body.lang-kr { font-family: "Gowun Dodum", sans-serif; }
body.lang-en { font-family: "Cause", sans-serif; }

@keyframes fadeInUp {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}
.scroll-arrow {
  animation: fadeInUp 0.6s ease-out 3s forwards, bounce 2s ease-in-out 3.6s infinite;
  opacity: 0;
}

/* ============================
   SINGLE BACKGROUND STRATEGY
   - one black canvas, content floats above
   ============================ */
html, body { height: 100%; }
body {
  background: #000;
  color: #fff;
}

/* 섹션은 배경/페이드 없이 투명 + 통일된 간격만 */
.section {
  position: relative;
  z-index: 10;
  background: transparent;
}

/* 옵션: 섹션 연결을 더 부드럽게(끊김 완화) */
.section + .section {
  margin-top: -40px; /* 살짝 겹치게 해서 단절감 제거 */
}

/* 카드들만 살리고, 섹션 배경은 없애는 방향 */
.glass-card {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.10);
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
}

/* ============================
   STARFIELD (PAGE-WIDE)
   ============================ */
.starfield {
  position: fixed;
  inset: 0;
  overflow: hidden;
  pointer-events: none;
  z-index: 1;
  --px: 0px;
  --py: 0px;
}

/* subtle nebula haze */
.starfield::before {
  content: "";
  position: absolute;
  inset: -20%;
  background:
    radial-gradient(60% 40% at 20% 30%, rgba(255,255,255,0.06), transparent 60%),
    radial-gradient(40% 30% at 80% 20%, rgba(255,255,255,0.04), transparent 55%),
    radial-gradient(50% 40% at 70% 80%, rgba(255,255,255,0.05), transparent 60%),
    radial-gradient(40% 35% at 30% 85%, rgba(255,255,255,0.035), transparent 60%);
  filter: blur(24px);
  opacity: 0.9;
  transform: translateZ(0);
}

.star {
  position: absolute;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.95);
  will-change: transform, opacity;
  box-shadow:
    0 0 10px rgba(255, 255, 255, 0.35),
    0 0 22px rgba(255, 255, 255, 0.18);
  left: 0;
  top: 0;
  transform: translate3d(
    calc(var(--x) + var(--px) * var(--depth)),
    calc(var(--y) + var(--py) * var(--depth)),
    0
  );
}

@keyframes starTwinkle {
  0% { opacity: 0.15; transform: translate3d(var(--x), var(--y), 0) scale(0.85); }
  20% { opacity: 0.85; transform: translate3d(var(--x), var(--y), 0) scale(1.05); }
  45% { opacity: 0.25; transform: translate3d(var(--x), var(--y), 0) scale(0.92); }
  70% { opacity: 1; transform: translate3d(var(--x), var(--y), 0) scale(1.12); }
  100% { opacity: 0.18; transform: translate3d(var(--x), var(--y), 0) scale(0.88); }
}

@keyframes starDrift {
  0% { transform: translate3d(calc(var(--x) + 0px), calc(var(--y) + 0px), 0); }
  50% { transform: translate3d(calc(var(--x) + 22px), calc(var(--y) - 16px), 0); }
  100% { transform: translate3d(calc(var(--x) - 18px), calc(var(--y) + 20px), 0); }
}

.star[data-anim="1"] {
  animation:
    starTwinkle var(--tw) cubic-bezier(0.4, 0, 0.6, 1) infinite,
    starDrift var(--dr) ease-in-out infinite;
  animation-delay: var(--delay);
}



/* Light mode: keep single background concept, just invert text + soften stars */
html.light-mode body { background: #fff; color: #000; }

html[lang="ko"] body,
body.lang-kr {
  font-family: "Gowun Dodum", sans-serif;
}
html.light-mode .starfield::before {
  background:
    radial-gradient(60% 40% at 20% 30%, rgba(0,0,0,0.035), transparent 60%),
    radial-gradient(40% 30% at 80% 20%, rgba(0,0,0,0.025), transparent 55%),
    radial-gradient(50% 40% at 70% 80%, rgba(0,0,0,0.03), transparent 60%),
    radial-gradient(40% 35% at 30% 85%, rgba(0,0,0,0.02), transparent 60%);
  opacity: 0.35;
}
html.light-mode #starfield .star {
  background: #000 !important;
  background-color: #000 !important;
  box-shadow:
    0 0 8px rgba(0, 0, 0, 0.22),
    0 0 18px rgba(0, 0, 0, 0.1) !important;
  opacity: 0.28 !important;
}
html.light-mode .glass-card { background: rgba(0,0,0,0.04); border-color: rgba(0,0,0,0.08); }

html.light-mode .project-card,
html.light-mode #loadMoreDetail {
  background: rgba(0, 0, 0, 0.03) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
}

html.light-mode #projectModal > div:nth-child(2) > div {
  background: rgba(255, 255, 255, 0.96) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
}

html.light-mode #projectClose {
  background: transparent !important;
  border: 0 !important;
  box-shadow: none !important;
}

html.light-mode .view-btn.active {
  background: rgba(0, 0, 0, 0.08) !important;
}

.contact-icon {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.03);
  color: #111;
  transition: transform 160ms ease, background-color 160ms ease, border-color 160ms ease;
}

.theme-toggle {
  width: 2rem;
  height: 2rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  transition: background-color 160ms ease, transform 160ms ease;
}

.language-switch {
  height: 2rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  color: #737373;
  font-size: 0.68rem;
  letter-spacing: 0.04em;
}

.language-option {
  padding: 0.2rem 0.1rem;
  color: inherit;
  opacity: 0.55;
  transition: opacity 160ms ease, color 160ms ease;
}

.language-option:hover,
.language-option.active {
  color: currentColor;
  opacity: 1;
  font-weight: 600;
}

html:not(.light-mode) .language-switch {
  color: #d4d4d4;
}

.theme-toggle:hover {
  background: rgba(127, 127, 127, 0.14);
  transform: rotate(8deg);
}

.theme-toggle svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

html:not(.light-mode) .contact-icon {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.05);
}

html:not(.light-mode) .course-list li,
html:not(.light-mode) .graduate-course-list li {
  color: #d4d4d4;
  border-color: rgba(255, 255, 255, 0.12);
  background: rgba(255, 255, 255, 0.05);
}

.contact-icon:hover {
  transform: translateY(-2px);
  background: rgba(0, 0, 0, 0.08);
  border-color: rgba(0, 0, 0, 0.22);
}

.contact-icon svg {
  width: 0.95rem;
  height: 0.95rem;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.education-details summary::-webkit-details-marker {
  display: none;
}

.project-school-details summary::-webkit-details-marker {
  display: none;
}

.project-school-details[open] .education-chevron {
  transform: rotate(180deg);
}

.project-school-details[open] .coursework-expand {
  grid-template-rows: 1fr;
}

.education-chevron {
  transition: transform 200ms ease;
}

.education-details[open] .education-chevron {
  transform: rotate(180deg);
}

.coursework-expand {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows 240ms ease;
}

.education-details[open] .coursework-expand {
  grid-template-rows: 1fr;
}

.coursework-content {
  overflow: hidden;
}

.course-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.course-list li {
  padding: 0.25rem 0.6rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 9999px;
  background: rgba(0, 0, 0, 0.03);
  color: #525252;
  font-size: 0.72rem;
  line-height: 1.2;
}

.graduate-course-list {
  display: grid;
  gap: 0.6rem;
}

.graduate-course-list li {
  padding: 0.7rem 0.8rem;
  border: 1px solid rgba(0, 0, 0, 0.1);
  border-radius: 0.75rem;
  background: rgba(0, 0, 0, 0.025);
}

.graduate-course-list strong {
  display: block;
  font-size: 0.78rem;
  line-height: 1.45;
  font-weight: 500;
}

.graduate-course-list span {
  display: block;
  margin-top: 0.25rem;
  color: #737373;
  font-size: 0.7rem;
}

.poster-thumbnail {
  width: 4.5rem;
  height: 5.75rem;
  overflow: hidden;
  border: 1px solid rgba(0, 0, 0, 0.12);
  border-radius: 0.5rem;
  background: #fff;
  transition: transform 160ms ease, box-shadow 160ms ease;
}

.poster-thumbnail:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.12);
}

.poster-thumbnail img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
}

.poster-dialog {
  width: fit-content;
  max-width: none;
  max-height: 94vh;
  padding: 0;
  border: 0;
  border-radius: 0.75rem;
  background: transparent;
  overflow: visible;
}

.poster-dialog::backdrop {
  background: rgba(0, 0, 0, 0.72);
  backdrop-filter: blur(4px);
}

.poster-dialog-content {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-width: 92vw;
  max-height: 92vh;
  overflow: hidden;
  border-radius: 0.75rem;
  background: #fff;
}

.poster-dialog-content > img {
  display: block;
  width: auto;
  height: auto;
  max-width: 92vw;
  max-height: 92vh;
  object-fit: contain;
}

.poster-dialog-close {
  position: fixed;
  z-index: 2;
  width: 2.25rem;
  height: 2.25rem;
  margin: 0.75rem 0 0 0.75rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.18);
}

.poster-dialog-close svg {
  width: 1rem;
  height: 1rem;
  fill: none;
  stroke: #111;
  stroke-width: 2;
  stroke-linecap: round;
}

/* Light mode: navbar styling */
html.light-mode #navbar {
  background: rgba(255, 255, 255, 0.9) !important;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  border-bottom-color: rgba(0, 0, 0, 0.1) !important;
}

/* Light mode: navbar text and links */
html.light-mode #navbar * {
  color: #000 !important;
}

html.light-mode #navbar a:hover,
html.light-mode #navbar button:hover {
  color: #000 !important;
  opacity: 0.7;
}

/* Light mode: force all text to black */
html.light-mode,
html.light-mode *,
html.light-mode h1,
html.light-mode h2,
html.light-mode h3,
html.light-mode h4,
html.light-mode p,
html.light-mode span,
html.light-mode a,
html.light-mode button,
html.light-mode label,
html.light-mode input,
html.light-mode textarea,
html.light-mode select,
html.light-mode li,
html.light-mode div {
  color: #000 !important;
}

/* Override Tailwind text color classes in light mode */
html.light-mode .text-white,
html.light-mode .text-gray-300,
html.light-mode .text-gray-400,
html.light-mode .text-neutral-200,
html.light-mode .text-neutral-300,
html.light-mode .text-neutral-400,
html.light-mode .text-neutral-500 {
  color: #000 !important;
}

/* Keep hover states but make them darker in light mode */
html.light-mode a:hover,
html.light-mode button:hover {
  color: #000 !important;
  opacity: 0.7;
}

/* Light mode: select and option styling */
html.light-mode select {
  background: rgba(0, 0, 0, 0.04) !important;
  border-color: rgba(0, 0, 0, 0.1) !important;
  color: #000 !important;
}

html.light-mode select:focus {
  background: rgba(0, 0, 0, 0.08) !important;
  border-color: rgba(0, 0, 0, 0.2) !important;
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.06) !important;
}

html.light-mode select option {
  background: #fff !important;
  color: #000 !important;
}

html.light-mode select option:hover,
html.light-mode select option:checked {
  background: rgba(0, 0, 0, 0.1) !important;
  color: #000 !important;
}
