:root {
  --bg: #e9edf3;
  --surface: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #dbe2ea;
  --brand: #0a7a76;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  font-family: "HelveticaNeue-Light", "Helvetica Neue Light", "Helvetica Neue", "Helvetica", "Arial", "Apple SD Gothic Neo", "Malgun Gothic", sans-serif;
  font-weight: 300;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

main {
  flex: 1;
}

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

.container {
  width: min(1120px, 92%);
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 1000;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
}

.logo {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: 0.04em;
}

.menu-root {
  display: flex;
  gap: 1.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
  align-items: center;
}

.nav a,
.submenu-toggle {
  color: #334155;
  font-weight: 300;
  font-size: 0.95rem;
}

.submenu-toggle {
  border: 0;
  background: transparent;
  cursor: pointer;
  padding: 0;
  font-family: inherit;
}

.has-submenu {
  position: relative;
}

.submenu {
  position: absolute;
  top: 100%;
  left: 0;
  min-width: 220px;
  list-style: none;
  margin: 0;
  padding: 8px 0;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.08);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 20;
}

.submenu li a {
  display: block;
  padding: 8px 12px;
  white-space: nowrap;
}

.submenu li a:hover {
  background: #f1f5f9;
}

.has-submenu:hover .submenu,
.has-submenu:focus-within .submenu {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.menu-root > li:nth-last-child(2) .submenu {
  left: auto;
  right: 0;
}

.menu-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 4px;
  cursor: pointer;
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  background: var(--text);
  transition: 0.2s ease;
}

.hero-3d {
  position: relative;
  width: 100%;
  min-height: 76vh;
  overflow: hidden;
  background: #ffffff;
}

#three-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
}

.section {
  padding: 64px 0;
}

.section-alt {
  background: var(--surface);
}

.section h2 {
  margin: 0 0 14px;
  font-size: 1.65rem;
}

.section p {
  margin: 0;
  color: var(--muted);
}

.page-hero {
  padding: 96px 0 44px;
  background: var(--surface);
  border-bottom: 1px solid var(--line);
}

.page-kicker {
  margin: 0 0 10px;
  color: var(--brand);
  font-size: 0.95rem;
  font-weight: 700;
}

.page-hero h1 {
  margin: 0;
  font-size: 2.4rem;
  line-height: 1.2;
  font-weight: 300;
}

.overview-video-section {
  width: 100%;
  background: #000000;
  overflow: hidden;
}

.overview-video {
  display: block;
  width: 100%;
  height: auto;
}

.page-content {
  padding: 56px 0 72px;
}

.content-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 56px;
  align-items: start;
}

.content-layout-single {
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
}

.content-main {
  display: grid;
  gap: 44px;
}

.content-block h2,
.content-side h2 {
  margin: 0 0 16px;
  font-size: 1.35rem;
  line-height: 1.35;
  font-weight: 300;
}

.content-block h3,
.content-block h4,
.content-block h5 {
  margin: 0 0 16px;
  font-size: 1.35rem;
  line-height: 1.35;
  font-weight: 300;
  color: #0f172a;
}

.content-block p > strong:first-child {
  display: block;
  margin: 0 0 16px;
  font-size: 1.35rem;
  line-height: 1.35;
  font-weight: 300;
  color: #0f172a;
}

.content-block p {
  margin: 0;
  color: #334155;
  font-size: 1rem;
  line-height: 1.85;
  word-break: keep-all;
}

.content-block p + p {
  margin-top: 16px;
}

.program-points {
  margin: 16px 0 0;
  padding-left: 20px;
  color: #334155;
  display: grid;
  gap: 6px;
}

.program-points li {
  line-height: 1.7;
}

.course-grid {
  margin-top: 20px;
  display: grid;
  gap: 12px;
}

.course-card {
  padding: 16px;
  background: #f8fafc;
  border: 1px solid #e2e8f0;
  border-radius: 8px;
}

.course-card h3 {
  margin: 0 0 6px;
  font-size: 1.03rem;
  font-weight: 400;
}

.course-card p {
  margin: 0;
  color: #334155;
  line-height: 1.75;
}

.works-grid .course-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  height: 100%;
}

.works-grid .course-card > a {
  width: 100%;
}

.works-grid .course-card > a img {
  width: 100% !important;
  height: auto !important;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
  margin: 0 !important;
  border-radius: 4px;
}

.works-grid .course-card h3 {
  width: 100%;
  min-height: 3.2em;
  margin: 0.55rem 0 0;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  line-height: 1.35;
}

.works-grid .course-card p {
  width: 100%;
  min-height: 1.6em;
  margin-top: 0.3rem;
  text-align: center;
  line-height: 1.35;
}

.faculty-list {
  display: grid;
  gap: 28px;
}

.faculty-card {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: 24px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
}

.faculty-photo {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid #e2e8f0;
}

.faculty-body h2 {
  margin: 0 0 8px;
  font-size: 1.5rem;
  font-weight: 400;
  line-height: 1.3;
}

.faculty-body h2 span {
  font-size: 1rem;
  color: #64748b;
  font-weight: 300;
  margin-left: 8px;
}

.faculty-role {
  margin: 0 0 12px;
  color: #0a7a76;
}

.faculty-body h3 {
  margin: 16px 0 6px;
  font-size: 1.02rem;
  font-weight: 400;
}

.faculty-body p {
  margin: 0;
  color: #334155;
  line-height: 1.75;
}

.faculty-items {
  margin: 8px 0 0;
  padding-left: 18px;
  color: #334155;
  display: grid;
  gap: 4px;
}

.faculty-items li {
  line-height: 1.65;
}

.people-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 22px;
}

.people-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  overflow: hidden;
}

.people-card > a {
  display: block;
}

.people-photo {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  display: block;
}

.people-card h2 {
  margin: 0;
  padding: 12px 14px;
  font-size: 1.02rem;
  font-weight: 400;
  line-height: 1.4;
}

.profile-header {
  display: flex;
  justify-content: center;
}

.profile-photo {
  width: min(560px, 100%);
  border-radius: 10px;
  border: 1px solid var(--line);
}

.content-side {
  position: sticky;
  top: 92px;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.research-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.research-tags li {
  padding: 7px 10px;
  background: #f1f5f9;
  color: #334155;
  border: 1px solid #e2e8f0;
  border-radius: 6px;
  font-size: 0.88rem;
  line-height: 1.2;
}

.gallery-grid {
  margin-top: 20px;
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.gallery-card {
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
  padding: 0;
  min-height: 0;
  border-radius: 14px;
  overflow: hidden;
}

.gallery-card img {
  width: 100%;
  aspect-ratio: 1190 / 1683;
  object-fit: cover;
  display: block;
}

.archive-title {
  margin: 0 0 28px;
  font-size: 2rem;
  line-height: 1.25;
}

.thesis-archive {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 36px;
  align-items: start;
  padding-top: 8px;
  border-top: 1px solid var(--line);
}

.thesis-years {
  display: grid;
  gap: 0;
  padding: 18px 0 24px 28px;
  border-left: 1px solid var(--line);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.thesis-years a {
  display: block;
  padding: 20px 0 20px 14px;
  border-left: 3px solid transparent;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 300;
  line-height: 1.2;
}

.thesis-years a.is-active {
  color: var(--text);
  border-left-color: var(--text);
  font-weight: 300;
}

.sticky-year-nav .thesis-years {
  position: sticky;
  top: 86px;
  max-height: calc(100vh - 104px);
  overflow-y: auto;
  overscroll-behavior: contain;
}

.thesis-main {
  display: grid;
  gap: 48px;
}

.thesis-year-section h2 {
  margin: 0;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.thesis-list {
  display: grid;
  gap: 30px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.thesis-item {
  display: block;
}

.thesis-title {
  display: inline;
  color: var(--text);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.55;
  word-break: keep-all;
}

.thesis-title:hover {
  text-decoration: underline;
  text-underline-offset: 5px;
}

.thesis-meta {
  margin: 5px 0 0;
  color: var(--text);
  font-size: 0.92rem;
  line-height: 1.4;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: var(--surface);
  padding: 20px 0;
}

.site-footer p {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
}

@media (max-width: 860px) {
  .menu-toggle {
    display: inline-flex;
  }

  .nav {
    position: absolute;
    top: 64px;
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--line);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.25s ease;
  }

  .menu-root {
    flex-direction: column;
    gap: 0;
    padding: 8px 0;
    align-items: stretch;
  }

  .menu-root > li > a,
  .menu-root > li > .submenu-toggle {
    display: block;
    padding: 12px 4%;
    width: 100%;
    text-align: left;
  }

  .has-submenu .submenu {
    position: static;
    min-width: 0;
    border: 0;
    border-radius: 0;
    box-shadow: none;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    max-height: 0;
    overflow: hidden;
    padding: 0;
    transition: max-height 0.2s ease;
    background: #f8fafc;
  }

  .has-submenu.is-open .submenu {
    max-height: var(--submenu-max-height, 0px);
    padding: 4px 0 8px;
  }

  .submenu li a {
    padding: 8px 8%;
  }

  .page-hero {
    padding: 72px 0 34px;
  }

  .page-hero h1 {
    font-size: 2rem;
  }

  .page-content {
    padding: 42px 0 56px;
  }

  .content-layout {
    grid-template-columns: 1fr;
    gap: 40px;
  }

  .faculty-card {
    grid-template-columns: 1fr;
  }

  .faculty-photo {
    max-width: 280px;
  }

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

  .content-side {
    position: static;
  }

  .site-header.menu-open .nav {
    max-height: var(--mobile-nav-max-height, 0px);
  }

  .site-header.menu-open .menu-toggle span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
  }

  .site-header.menu-open .menu-toggle span:nth-child(2) {
    opacity: 0;
  }

  .site-header.menu-open .menu-toggle span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
  }

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

  .thesis-archive {
    grid-template-columns: 1fr;
    gap: 28px;
  }

  .thesis-years {
    display: flex;
    overflow-x: auto;
    gap: 24px;
    padding: 14px 0;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .sticky-year-nav .thesis-years {
    position: static;
    max-height: none;
    overflow-y: visible;
  }

  .thesis-years a {
    flex: 0 0 auto;
    padding: 0 0 6px;
    border-left: 0;
    border-bottom: 2px solid transparent;
    font-size: 1rem;
  }

  .thesis-years a.is-active {
    border-bottom-color: var(--text);
  }
}

@media (max-width: 600px) {
  .hero-3d {
    min-height: 62vh;
  }

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

  .thesis-list {
    gap: 24px;
  }

  .thesis-title {
    font-size: 1rem;
  }

  .thesis-meta {
    font-size: 0.9rem;
  }

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