/* ============================================================
   DDFE Lab — site stylesheet
   ============================================================ */
:root {
  color-scheme: dark;
  /* Dark theme, colours taken from the logo */
  --bg: #0b1522;          /* page background (deep ink navy) */
  --bg-soft: #0e1a2a;     /* alternate sections */
  --surface: #12223a;     /* cards */
  --surface-hover: #182c47;
  --navy: #183858;        /* logo navy: page headers, buttons */
  --navy-dark: #070e18;   /* footer */
  --heading: #f2f6fa;
  --text: #d5dde7;
  --muted: #93a2b4;
  --line: #22344b;
  --accent: #5aa9e6;      /* logo wave blue, lightened for dark background */
  --button: #2470a8;      /* logo wave blue */
  --radius: 10px;
  --maxw: 1120px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display",
          "Pretendard Variable", Pretendard, "Apple SD Gothic Neo",
          "Segoe UI", Roboto, "Noto Sans KR", "Malgun Gothic", "Helvetica Neue", Arial, sans-serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: var(--font);
  letter-spacing: -0.01em;
  word-break: keep-all;
  font-size: 16px;
  line-height: 1.7;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}
img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
h1, h2, h3 { font-family: var(--font); letter-spacing: -0.02em; color: var(--heading); line-height: 1.3; }
h2 { font-size: 1.6rem; margin: 0 0 1rem; }
h3 { font-size: 1.15rem; margin: 0 0 .4rem; }

.container { max-width: var(--maxw); margin: 0 auto; padding: 0 20px; }
.section { padding: 56px 0; }
.section.soft { background: var(--bg-soft); }
.section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin-bottom: 1.5rem; }
.section-head h2 { margin: 0; }
.more-link { font-weight: 600; white-space: nowrap; }
.more-link::after { content: " →"; }
.center { text-align: center; }
.lead { font-size: 1.1rem; }

/* ---------- Header / navigation ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(11,21,34,.92);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(6px);
}
.header-inner { display: flex; align-items: center; justify-content: space-between; height: 68px; }
.brand { display: flex; align-items: center; gap: 10px; color: var(--heading); font-family: var(--font); font-weight: 700; font-size: 1.25rem; letter-spacing: .04em; }
.brand:hover { text-decoration: none; }
.brand img { height: 56px; width: 56px; }
.site-nav ul { list-style: none; margin: 0; padding: 0; }
.site-nav > ul { display: flex; gap: 4px; }
.site-nav li { position: relative; }
.site-nav a { display: block; padding: 8px 12px; color: var(--text); font-weight: 600; font-size: .95rem; border-radius: 6px; }
.site-nav a:hover { text-decoration: none; background: var(--surface); color: var(--heading); }
.site-nav li.active > a { color: var(--accent); }
.site-nav .submenu {
  display: none; position: absolute; left: 0; top: 100%;
  min-width: 190px; padding: 6px; background: var(--surface);
  border: 1px solid var(--line); border-radius: 8px; box-shadow: 0 8px 24px rgba(0,0,0,.35);
}
.site-nav .has-children:hover > .submenu,
.site-nav .has-children:focus-within > .submenu { display: block; }
.site-nav .submenu a { font-weight: 400; }
.nav-toggle { display: none; }
.nav-toggle-label { display: none; }

@media (max-width: 900px) {
  .nav-toggle-label { display: flex; align-items: center; justify-content: center; width: 44px; height: 44px; cursor: pointer; }
  .nav-toggle-label span, .nav-toggle-label span::before, .nav-toggle-label span::after {
    display: block; width: 22px; height: 2px; background: var(--heading); position: relative; content: "";
  }
  .nav-toggle-label span::before { position: absolute; top: -7px; }
  .nav-toggle-label span::after { position: absolute; top: 7px; }
  .site-nav {
    display: none; position: absolute; top: 68px; left: 0; right: 0;
    background: var(--bg); border-bottom: 1px solid var(--line); box-shadow: 0 8px 16px rgba(0,0,0,.35);
    max-height: calc(100vh - 68px); overflow-y: auto;
  }
  .nav-toggle:checked ~ .site-nav { display: block; }
  .site-nav > ul { flex-direction: column; padding: 8px 12px 16px; gap: 0; }
  .site-nav .submenu { display: block; position: static; border: 0; box-shadow: none; padding: 0 0 0 14px; min-width: 0; }
}

/* ---------- Hero ---------- */
.hero {
  background-size: cover; background-position: center; background-color: var(--navy-dark);
  min-height: 420px; display: flex;
}
.hero-overlay {
  flex: 1; display: flex; align-items: center; justify-content: center; padding: 60px 20px;
  background: linear-gradient(180deg, rgba(11,21,34,.25) 0%, rgba(11,21,34,.55) 70%, var(--bg) 100%);
}
.hero h1 { color: #fff; font-size: clamp(2rem, 5vw, 3.4rem); text-align: center; margin: 0; text-shadow: 0 2px 16px rgba(0,0,0,.4); }

/* ---------- Page header (sub-pages) ---------- */
.page-header { background: linear-gradient(120deg, var(--bg) 0%, var(--navy) 100%); border-bottom: 1px solid var(--line); color: #fff; padding: 44px 0; }
.page-header h1 { color: #fff; margin: 0; font-size: clamp(1.7rem, 4vw, 2.4rem); }

/* ---------- Generic content ---------- */
.content { padding: 48px 0 64px; }
.content > .container > *:first-child { margin-top: 0; }
.prose h2 { margin-top: 2.2rem; padding-bottom: .4rem; border-bottom: 2px solid var(--line); }

/* ---------- Welcome (home) ---------- */
.welcome { display: grid; grid-template-columns: 1fr 1fr; gap: 40px; align-items: center; }
@media (max-width: 860px) { .welcome { grid-template-columns: 1fr; } }

/* ---------- Videos ---------- */
.video { margin: 0; }
.video-frame { position: relative; aspect-ratio: 16 / 9; border-radius: var(--radius); overflow: hidden; background: #000; box-shadow: 0 4px 18px rgba(0,0,0,.4); }
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video figcaption { margin-top: .6rem; font-weight: 600; color: var(--heading); font-size: .95rem; line-height: 1.45; }
.video-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 32px 28px; }
.video-grid.three { grid-template-columns: repeat(3, 1fr); }
@media (max-width: 900px) { .video-grid.three { grid-template-columns: 1fr; } }

/* ---------- News ---------- */
.news-list { display: flex; flex-direction: column; gap: 28px; }
.news-item {
  display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 3fr); gap: 28px;
  padding: 24px; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius);
}
.news-item.no-image { grid-template-columns: 1fr; }
.news-media { display: flex; flex-direction: column; gap: 12px; }
.news-media img { width: 100%; border-radius: 6px; }
.news-date {
  display: inline-block; font-size: .8rem; font-weight: 700; letter-spacing: .03em;
  color: var(--accent); background: none; border: 1px solid var(--accent); padding: 1px 8px; border-radius: 0; margin-bottom: .5rem;
}
.news-subtitle { font-style: italic; color: var(--muted); margin: 0 0 .6rem; }
.news-text p { margin: 0 0 .7rem; }
.news-text p:last-child { margin-bottom: 0; }
@media (max-width: 760px) { .news-item { grid-template-columns: 1fr; padding: 18px; } }

/* ---------- Team ---------- */
.team-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.team-card {
  display: flex; flex-direction: column; gap: 12px; min-height: 240px; padding: 32px 30px 28px;
  background: var(--surface); border-top: 4px solid var(--accent); color: var(--text);
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.team-card-title { font-size: 1.6rem; font-weight: 700; color: var(--heading); letter-spacing: -0.02em; }
.team-card-desc { font-size: 1.05rem; color: var(--muted); line-height: 1.55; }
.team-card-more { margin-top: auto; padding-top: 10px; font-size: .95rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.team-card-more span { display: inline-block; transition: transform .15s; }
.team-card:hover { text-decoration: none; background: var(--surface-hover); border-top-color: var(--heading); box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.team-card:hover .team-card-more { color: var(--heading); }
.team-card:hover .team-card-more span { transform: translateX(4px); }
@media (max-width: 760px) { .team-cards { grid-template-columns: 1fr; } .team-card { min-height: 0; } }

.group-title { margin: 3rem 0 1.25rem; padding-bottom: .4rem; border-bottom: 2px solid var(--line); }
.group-title:first-child { margin-top: 0; }

.pi { display: grid; grid-template-columns: 260px 1fr; gap: 36px; align-items: start; }
.pi img { width: 100%; border-radius: var(--radius); }
.pi h3 { font-size: 1.4rem; }
.pi ul { padding-left: 1.2rem; margin: .6rem 0 1rem; }
.pi li { margin-bottom: .15rem; }
.pi li.strong { font-weight: 700; }
@media (max-width: 760px) { .pi { grid-template-columns: 1fr; } .pi img { max-width: 260px; } }

.member-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 28px; }
.member { text-align: center; }
.member img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; object-position: top; border-radius: var(--radius); background: var(--bg-soft); margin-bottom: .7rem; }
.member .name { font-weight: 700; color: var(--heading); }
.member .name-ko { color: var(--muted); }
.member .contact { font-size: .9rem; }

.alumni-block { margin-bottom: 1.4rem; }
.alumni-block .name { font-weight: 700; color: var(--heading); font-size: 1.05rem; }
.alumni-block p { margin: .1rem 0; }
.alumni-list { columns: 2; column-gap: 40px; padding-left: 1.2rem; }
.alumni-list li { break-inside: avoid; margin-bottom: .2rem; }
@media (max-width: 640px) { .alumni-list { columns: 1; } }

.cta { margin-top: 3rem; text-align: center; }
.button {
  display: inline-block; padding: 12px 28px; border-radius: 0; background: var(--button); color: #fff; font-weight: 700;
}
.button:hover { background: #2f86c6; text-decoration: none; }

/* ---------- Publications ---------- */
.publications ol { padding-left: 1.6rem; }
.publications ol > li { margin-bottom: 1rem; padding-left: .3rem; }
.publications ol > li::marker { color: var(--muted); font-weight: 600; }
.publications .related { display: block; font-size: .92rem; color: var(--muted); margin-top: .2rem; }

/* ---------- Projects ---------- */
.project-list { list-style: none; padding: 0; margin: 0 0 2.5rem; }
.project-list li { padding: 16px 0; border-bottom: 1px solid var(--line); }
.project-list .p-title { font-weight: 700; color: var(--heading); display: block; }
.project-list .p-meta { color: var(--muted); font-size: .93rem; }
.role { display: inline-block; font-size: .78rem; font-weight: 700; padding: 1px 8px; border-radius: 0; margin-left: 4px; vertical-align: 1px; }
.role.pi { border: 1px solid var(--accent); color: var(--accent); }
.role.co { border: 1px solid #4a5d74; color: var(--muted); }

/* ---------- Collaborators ---------- */
.collaborators img { margin: 0 auto; max-width: 900px; width: 100%; }

/* ---------- Footer ---------- */
.site-footer { background: var(--navy-dark); color: rgba(255,255,255,.78); padding: 28px 0; text-align: center; font-size: .95rem; }
.site-footer a { color: #fff; }
.site-footer .sep { margin: 0 12px; opacity: .5; }
@media (max-width: 560px) { .site-footer .sep { display: block; height: 0; overflow: hidden; } }

/* ---------- Research ---------- */
.research-intro { font-size: clamp(1.25rem, 2.4vw, 1.6rem); font-weight: 600; line-height: 1.45; color: var(--heading); max-width: 860px; margin: 0 0 2rem; }
.themes { list-style: none; counter-reset: theme; padding: 0; margin: 0; border-top: 2px solid var(--accent); }
.theme { counter-increment: theme; display: grid; grid-template-columns: 300px 1fr; gap: 32px; padding: 28px 0; border-bottom: 1px solid var(--line); }
.theme h2 { font-size: 1.3rem; margin: 0; }
.theme h2::before { content: counter(theme, decimal-leading-zero); display: block; font-size: .85rem; color: var(--accent); margin-bottom: 4px; letter-spacing: .05em; }
.theme-impact { font-size: 1.1rem; margin: 0 0 .6rem; }
.theme-meta { font-size: .93rem; margin: 0 0 .3rem; color: var(--muted); }
.theme-meta .dot { margin: 0 8px; color: var(--line); }
.theme-partners { font-size: .93rem; color: var(--muted); margin: 0; }
@media (max-width: 760px) {
  .theme { grid-template-columns: 1fr; gap: 10px; }
}
.keyword-row { display: flex; flex-wrap: wrap; gap: 8px; margin: -0.8rem 0 2.5rem; }
.keyword { display: inline-block; padding: 4px 10px; border: 1px solid var(--line); background: var(--surface); color: var(--muted); font-size: .88rem; }
.keyword-main { border-color: var(--accent); color: var(--heading); font-weight: 600; }

/* ---------- Research areas (Home cards + Research page) ---------- */
.area-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.area-card {
  display: flex; flex-direction: column; background: var(--surface); border-top: 4px solid var(--accent); color: var(--text);
  transition: background .15s, border-color .15s, box-shadow .15s;
}
.area-card:hover { text-decoration: none; background: var(--surface-hover); border-top-color: var(--heading); box-shadow: 0 6px 20px rgba(0,0,0,.35); }
.area-media { position: relative; aspect-ratio: 16 / 10; background: #0d1a2b; overflow: hidden; border-bottom: 1px solid var(--line); }
.flow-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.area-body { display: flex; flex-direction: column; gap: 8px; flex: 1; padding: 22px 24px 24px; }
.area-num { font-size: .85rem; font-weight: 700; letter-spacing: .05em; color: var(--accent); }
.area-title { font-size: 1.35rem; margin: 0; color: var(--heading); }
.area-title a { color: inherit; }
.area-title a:hover { text-decoration: none; color: var(--accent); }
.area-media { display: block; }
.area-papers-label { margin: 10px 0 0; font-size: .78rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); }
.area-papers { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 6px; }
.area-papers a { display: block; font-size: .86rem; line-height: 1.4; color: var(--text); }
.area-papers a:hover { text-decoration: none; }
.area-papers a:hover .paper-title { color: var(--heading); text-decoration: underline; }
.paper-venue { display: block; font-weight: 700; color: var(--accent); font-size: .8rem; }
.paper-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; color: var(--muted); }
.area-key { margin: 0 0 1.8rem; max-width: 860px; }
.area-key .paper-title { -webkit-line-clamp: unset; display: inline; }
.area-key .paper-venue { display: inline; margin-right: .5em; font-size: .9rem; }
.area-key .area-papers a { font-size: .95rem; }
.area-summary { margin: 0; font-size: .98rem; line-height: 1.55; color: var(--muted); }
.area-topics { list-style: none; margin: 2px 0 0; padding: 0; display: flex; flex-wrap: wrap; gap: 6px; }
.area-topics li { padding: 2px 8px; border: 1px solid var(--accent); color: var(--heading); font-size: .8rem; font-weight: 600; line-height: 1.5; }
.area-more { margin-top: auto; padding-top: 8px; font-size: .9rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: var(--accent); }
.area-more span { display: inline-block; transition: transform .15s; }
.area-card:hover .area-more { color: var(--heading); }
.area-card:hover .area-more span { transform: translateX(4px); }
@media (max-width: 900px) { .area-cards { grid-template-columns: 1fr; } }

.area { margin-top: 3rem; padding-top: 2.5rem; border-top: 1px solid var(--line); scroll-margin-top: 90px; }
.area-head h2 { font-size: 1.8rem; margin: .2rem 0 .5rem; }
.area-lead { font-size: 1.1rem; max-width: 860px; margin: 0 0 1.6rem; }
.area-art { position: relative; aspect-ratio: 5 / 2; background: #0d1a2b; margin: 0 0 1rem; border: 1px solid var(--line); }
.area > .area-topics { margin: 0 0 1rem; }
.area .themes { border-top-width: 1px; }
.area .theme:last-child { border-bottom: none; }
.area .theme h2::before { display: none; }
.area .theme h2 { font-size: 1.15rem; }
@media (max-width: 760px) { .area-art { aspect-ratio: 16 / 10; } }
.area-more:hover { text-decoration: none; }
