/* =====================================================================
   THEME — "Josun" (loaded last on every page)
   Ivory paper, ink text, one antique-gold accent. Serif display type,
   letter-spaced small caps for labels, hairlines instead of shadows.
   Gold is decorative (rules, labels); bronze carries text for contrast.
   ===================================================================== */
:root {
  --ivory: #f7f3ec;
  --paper: #fbf9f5;
  --ink: #23201c;
  --ink-2: #57514a;
  --ink-3: #847c72;
  --gold: #b5945f;
  --gold-rgb: 181, 148, 95;
  --bronze: #7a5d36;
  --hair: rgba(35, 32, 28, 0.13);
  --hair-strong: rgba(35, 32, 28, 0.28);
  --night: #1c1a17;

  --color-primary: var(--ink);
  --color-primary-light: var(--ink-2);
  --color-primary-dark: #000;
  --color-primary-rgb: 35, 32, 28;
  --color-secondary: var(--ink);
  --color-secondary-light: var(--ink-2);
  --color-secondary-dark: #000;
  --color-secondary-rgb: 35, 32, 28;
  --color-accent: var(--bronze);
  --color-accent-light: var(--gold);
  --color-accent-dark: var(--ink);
  --color-accent-rgb: 181, 148, 95;

  --progress-0-25: var(--gold);
  --progress-26-50: var(--gold);
  --progress-51-75: var(--gold);
  --progress-76-100: var(--gold);

  --color-white: var(--paper);
  --color-gray-50: var(--ivory);
  --color-gray-100: #efe9df;
  --color-gray-200: var(--hair);
  --color-gray-300: var(--hair-strong);

  --bg-primary: var(--ivory);
  --bg-secondary: #f1ece3;
  --bg-dark: var(--night);
  --bg-hero: var(--ivory);

  --text-primary: var(--ink);
  --text-secondary: var(--ink-2);
  --text-muted: var(--ink-3);
  --text-light: #f4efe6;
  --text-accent: var(--bronze);

  --font-primary: 'Pretendard Variable', 'Pretendard', -apple-system, 'Segoe UI', 'Apple SD Gothic Neo', 'Hiragino Sans', sans-serif;
  --font-heading: 'Cormorant Garamond', 'Noto Serif KR', 'Noto Serif JP', Georgia, serif;
  --font-mono: var(--font-primary);

  --radius-sm: 0;
  --radius-md: 0;
  --radius-lg: 0;
  --radius-xl: 0;
  --radius-2xl: 0;
  --radius-full: 0;

  --shadow-sm: none;
  --shadow-md: none;
  --shadow-lg: none;
  --shadow-xl: none;

  --nav-height: 76px;
  --section-padding: 7.5rem;
  --label: 0.72rem;
  --tracking: 0.22em;
}

/* ── Base ── */
body {
  background: var(--ivory);
  color: var(--ink);
  font-size: 15.5px;
  line-height: 1.75;
  letter-spacing: 0.005em;
}
p { color: var(--ink-2); }
h1, h2, h3, h4, h5, h6 { font-weight: 500; letter-spacing: 0.005em; color: var(--ink); }
a { color: var(--bronze); }
a:hover { color: var(--ink); }
::selection { background: rgba(var(--gold-rgb), 0.28); color: var(--ink); }
:focus-visible { outline: 1px solid var(--gold); outline-offset: 4px; }
::-webkit-scrollbar-track { background: var(--ivory); }
::-webkit-scrollbar-thumb { background: rgba(35, 32, 28, 0.25); }

.section--alt { background: var(--ivory); border-top: 1px solid var(--hair); }

/* Section header: centered, serif, gold hairline with a small lozenge */
.section__header { margin-bottom: 4.5rem; }
.section__title {
  font-family: var(--font-heading);
  font-size: clamp(2.1rem, 4vw, 2.9rem);
  font-weight: 500;
  letter-spacing: 0.01em;
  padding-bottom: 1.4rem;
}
.section__title::after {
  width: 64px;
  height: 1px;
  bottom: 0;
  border-radius: 0;
  background: linear-gradient(90deg, transparent, var(--gold) 30%, var(--gold) 70%, transparent);
}
.section__title::before {
  content: '';
  position: absolute;
  left: 50%;
  bottom: -3px;
  width: 6px;
  height: 6px;
  background: var(--ivory);
  border: 1px solid var(--gold);
  transform: translateX(-50%) rotate(45deg);
  z-index: 1;
}
.section__subtitle {
  font-size: var(--label);
  letter-spacing: var(--tracking);
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: 1.6rem;
}

/* ── Navigation ── */
.nav {
  background: rgba(247, 243, 236, 0.97);
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  border-bottom: 1px solid var(--hair);
}
.nav--scrolled { box-shadow: none; }
.nav__logo {
  font-family: var(--font-heading);
  font-size: 1.3rem;
  font-weight: 500;
  color: var(--ink);
  letter-spacing: 0.04em;
}
.nav__logo-img { height: 26px; }
.nav__logo-accent { color: var(--bronze); font-style: italic; }
.nav__lang { background: none; padding: 0; gap: 0; }
.lang-btn {
  background: none;
  padding: 4px 8px;
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--ink-3);
  border-bottom: 1px solid transparent;
}
.lang-btn--active, .lang-btn--active:hover { background: none; color: var(--ink); border-bottom-color: var(--gold); }
.nav__link {
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-2);
  padding: 6px 10px;
  border-bottom: 1px solid transparent;
}
.nav__link:hover { background: none; color: var(--ink); }
.nav__link--active { background: none; color: var(--ink); border-bottom-color: var(--gold); }
.nav__toggle span { height: 1px; }

/* ── Hero: a quiet, centered title page ── */
.hero {
  min-height: min(88vh, 920px);
  background: var(--ivory);
  text-align: center;
  border-bottom: 1px solid var(--hair);
}
.hero::before {
  inset: calc(var(--nav-height) + 28px) 28px 28px;
  background: none;
  border: 1px solid rgba(var(--gold-rgb), 0.45);
}
.hero::after {
  content: '';
  position: absolute;
  inset: calc(var(--nav-height) + 34px) 34px 34px;
  border: 1px solid rgba(var(--gold-rgb), 0.18);
  pointer-events: none;
}
.hero__content { max-width: 880px; margin: 0 auto; padding: 4rem 0; }
.hero__badge {
  background: none;
  border: none;
  backdrop-filter: none;
  padding: 0;
  color: var(--bronze);
  font-size: var(--label);
  letter-spacing: 0.3em;
  text-transform: uppercase;
  margin-bottom: 2.2rem;
}
.hero__badge::before, .hero__badge::after { content: ''; width: 36px; height: 1px; background: var(--gold); }
.hero__badge-dot { display: none; }
.hero__affiliation { color: var(--ink-3); font-size: var(--label); letter-spacing: var(--tracking); }
.hero__title {
  font-family: var(--font-heading);
  font-size: clamp(3rem, 7.5vw, 5.4rem);
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.02;
  margin: 0.6rem 0 1rem;
}
.hero__title-accent { color: var(--ink); }
.hero__role {
  font-family: var(--font-heading);
  font-style: italic;
  font-size: 1.45rem;
  color: var(--bronze);
  font-weight: 400;
  margin-bottom: 2rem;
}
.hero__description {
  color: var(--ink-2);
  max-width: 560px;
  margin: 0 auto 2.6rem;
  font-size: 0.98rem;
  line-height: 1.9;
}
.hero__links { justify-content: center; gap: 0.4rem 1.1rem; }
.hero__link {
  color: var(--ink);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  border-bottom-color: rgba(var(--gold-rgb), 0.6);
}
.hero__link:hover { color: var(--bronze); border-bottom-color: var(--gold); }
.hero__link-sep { color: var(--gold); }

/* Film hero: a slow background loop under a warm dark veil, ivory type on top */
.hero--film { background: #0e0d0c; border-bottom: none; isolation: isolate; }
.hero__media {
  position: absolute;
  inset: 0;
  z-index: -1;
  background: #0e0d0c url(../assets/video/hero-quantum.jpg) center / cover no-repeat;
}
.hero__video { width: 100%; height: 100%; object-fit: cover; display: block; }
.hero__media::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse at center, rgba(18, 15, 12, 0.48) 0%, rgba(18, 15, 12, 0.78) 75%),
    linear-gradient(rgba(18, 15, 12, 0.25), rgba(18, 15, 12, 0.25));
}
.hero--film::before { border-color: rgba(var(--gold-rgb), 0.6); }
.hero--film::after { border-color: rgba(var(--gold-rgb), 0.28); }
.hero--film .hero__badge { color: #d9bf8c; }
.hero--film .hero__affiliation { color: rgba(247, 243, 236, 0.72); }
.hero--film .hero__title-accent { color: #f7f3ec; }
.hero--film .hero__role { color: #d9bf8c; }
.hero--film .hero__description { color: rgba(247, 243, 236, 0.86); }
.hero--film .hero__link { color: #f7f3ec; }
.hero--film .hero__link:hover { color: #d9bf8c; }
@media (prefers-reduced-motion: reduce) { .hero__video { display: none; } }

/* ── Shared components ── */
.card, .area-card, .project-card, .experiment-card, .publication-item,
.talk-card, .future-card, .collab-card, .timeline__content, .overview__stat-card,
.overview__highlight-item, .rmap__detail {
  background: var(--paper);
  border: 1px solid var(--hair);
  border-radius: 0;
  box-shadow: none;
}
.card:hover, .area-card:hover, .project-card:hover, .experiment-card:hover,
.publication-item:hover, .talk-card:hover, .future-card:hover, .collab-card:hover,
.timeline__content:hover, .overview__stat-card:hover, .overview__highlight-item:hover {
  box-shadow: none;
  transform: none;
  border-color: rgba(var(--gold-rgb), 0.7);
}

.project-card__title, .experiment-card__title, .publication-item__title,
.talk-card__title, .future-card__title, .collab-card__name, .timeline__title,
.area-card__title, .card__title, .overview__highlight-text h4 {
  font-family: var(--font-heading);
  font-weight: 500;
  letter-spacing: 0.005em;
}
.project-card__title, .future-card__title, .talk-card__title, .area-card__title { font-size: 1.4rem; line-height: 1.25; }
.publication-item__title { font-size: 1.2rem; line-height: 1.35; }

/* Labels and tags: letter-spaced small caps, no pills */
.tag, .project-card__status, .future-card__priority, .talk-card__type, .collab-card__type,
.pub-type, .area-card__direction-tag, .rmap__node-tag, .rmap__detail-tag, .collab-section-label {
  background: none !important;
  border-radius: 0 !important;
  font-size: 0.64rem;
  font-weight: 500;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}
.tag, .area-card__direction-tag, .rmap__node-tag, .rmap__detail-tag {
  border: 1px solid var(--hair) !important;
  color: var(--ink-2) !important;
  padding: 3px 8px;
}
.project-card__status, .future-card__priority, .talk-card__type, .collab-card__type, .pub-type,
.tag--success, .tag--danger, .tag--accent, .tag--primary {
  color: var(--bronze) !important;
  border: none !important;
  padding-left: 0;
}
.pub-type i { display: none; }

/* Progress: a single gold hairline */
.progress__track { height: 2px; background: var(--hair); }
.progress__bar { background: var(--gold) !important; }
.progress__bar::after { display: none; }
.progress__label, .progress__value { font-size: var(--label); letter-spacing: 0.12em; text-transform: uppercase; font-weight: 500; }

/* Numbers in serif */
.stat__number, .experiment-card__number, .publication-item__year, .experiment-card__year {
  font-family: var(--font-heading);
  font-weight: 500;
  color: var(--bronze);
}
.stat__label { font-size: var(--label); letter-spacing: var(--tracking); }
.publication-item__year { background: none !important; border-radius: 0; font-size: 1.1rem; }
.publication-item__venue { font-style: italic; color: var(--bronze); }

.btn { border-radius: 0; letter-spacing: 0.18em; text-transform: uppercase; font-size: 0.7rem; font-weight: 500; }
.btn--primary, .btn--accent { background: var(--ink); color: var(--ivory); }
.btn--primary:hover, .btn--accent:hover { background: var(--bronze); color: var(--ivory); }
.btn--outline { border: 1px solid var(--ink); color: var(--ink); }
.btn--outline:hover { background: var(--ink); color: var(--ivory); }

/* Overview icons and area art: toned to sepia so color never fights the gold */
.overview__highlight-icon, .card__icon, .future-card__icon, .area-card__icon {
  background: none !important;
  border-radius: 0 !important;
}
.overview__highlight-icon img, .area-card__icon img, .future-card__icon img, .rmap__node-icon, .rmap__detail-icon {
  filter: grayscale(1) sepia(0.45) contrast(0.95);
}
.area-card__visual { filter: grayscale(1) sepia(0.55) contrast(0.9) brightness(1.04); border-radius: 0; }

/* Timeline */
.timeline::before, .timeline__line { background: rgba(var(--gold-rgb), 0.6) !important; width: 1px !important; }
.timeline__dot { background: var(--ivory) !important; border: 1px solid var(--gold) !important; border-radius: 0 !important; transform: rotate(45deg); box-shadow: none !important; }
.timeline__date { color: var(--bronze); font-size: var(--label); letter-spacing: 0.16em; text-transform: uppercase; }

/* Research map */
.rmap__node-inner { border-radius: 0 !important; background: var(--paper) !important; border: 1px solid var(--hair) !important; box-shadow: none !important; }
.rmap__node-inner--center { background: var(--night) !important; border-color: var(--gold) !important; }
.rmap__node-inner--center .rmap__node-label { color: var(--ivory) !important; font-family: var(--font-heading); letter-spacing: 0.06em; }
.rmap__node--active .rmap__node-inner, .rmap__node--highlight .rmap__node-inner { border-color: var(--gold) !important; }
.rmap__svg .rmap__line-bg { stroke: var(--hair); stroke-width: 1; }
.rmap__svg .rmap__line { stroke: rgba(var(--gold-rgb), 0.55); stroke-width: 1; }
.rmap__svg .rmap__line--highlight,
.rmap__svg .rmap__line--inter.rmap__line--highlight { stroke: var(--bronze); stroke-width: 1.5; filter: none; }
.rmap__svg .rmap__line-bg.rmap__line--highlight { stroke: rgba(var(--gold-rgb), 0.35); stroke-width: 2; }
.research-map .section__title { display: block; width: fit-content; margin-left: auto; margin-right: auto; }
.rmap__legend-dot, .rmap__legend-line { background: var(--gold) !important; box-shadow: none !important; }
.rmap__tooltip { background: var(--night) !important; color: var(--ivory) !important; border-radius: 0 !important; box-shadow: none !important; }

/* Area cards: one gold hairline on top instead of a color per card */
.area-card::before, .area-card:nth-child(n)::before { background: var(--gold) !important; height: 1px !important; }
.area-card--expanded::before { height: 2px !important; }

/* Collaborations */
.collab-card__members { background: none !important; border-left: 1px solid var(--hair); }
.collab-card__member { background: none !important; border-radius: 0 !important; border-bottom: 1px solid var(--hair); }
.collab-card__member-role { color: var(--bronze) !important; background: none !important; }
.collab-section-label { color: var(--ink-2); border-bottom: 1px solid var(--hair); padding-bottom: 10px; }
.collab-section-label::before { background: var(--gold) !important; box-shadow: none !important; border-radius: 0 !important; transform: rotate(45deg); }

/* ── Footer: night with gold ── */
.footer { background: var(--night) !important; color: rgba(244, 239, 230, 0.6); border-top: 1px solid rgba(var(--gold-rgb), 0.4); }
.footer__logo { font-family: var(--font-heading); font-size: 1.5rem; font-weight: 500; color: var(--ivory); letter-spacing: 0.06em; }
.footer__logo span { color: var(--gold) !important; font-style: italic; }
.footer__link { color: rgba(244, 239, 230, 0.55); background: none !important; border-radius: 0 !important; }
.footer__link:hover { color: var(--gold); transform: none; }
.footer__bottom { color: rgba(244, 239, 230, 0.4); font-size: var(--label); letter-spacing: 0.12em; border-top-color: rgba(244, 239, 230, 0.08); }

/* ── Motion: slower, softer; none if the reader prefers less ── */
.fade-in { transform: translateY(8px); transition-duration: 0.9s; }
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  .fade-in, .section-enter { opacity: 1 !important; transform: none !important; }
}

@media (max-width: 768px) {
  :root { --section-padding: 5rem; --nav-height: 64px; }
  .hero::before { inset: calc(var(--nav-height) + 14px) 14px 14px; }
  .hero::after { inset: calc(var(--nav-height) + 19px) 19px 19px; }
  .hero__content { padding: 3rem 12px; }
  .nav__links { background: var(--ivory) !important; box-shadow: none !important; border-bottom: 1px solid var(--hair); }
  .nav__logo { font-size: 1.05rem; gap: 6px; }
  .nav__logo-img { height: 22px; }
  .nav__lang { margin-left: auto; margin-right: 6px; }
  .lang-btn { padding: 4px 5px; letter-spacing: 0.08em; }
}

/* Map labels live in small boxes: keep the small caps but tighten them */
.rmap__node-tag { font-size: 0.55rem !important; letter-spacing: 0.05em !important; padding: 2px 5px !important; line-height: 1.4; }
.rmap__node-inner:not(.rmap__node-inner--center) { height: auto !important; min-height: 130px; }
@media (max-width: 768px) { .rmap__node-inner:not(.rmap__node-inner--center) { min-height: 90px; } }
@media (max-width: 480px) {
  .rmap__node-inner:not(.rmap__node-inner--center) { min-height: 72px; padding: 4px; }
  .rmap__node-label { font-size: 8.5px; line-height: 1.2; }
}

/* Area cards: short film loops, toned to sit together */
.area-card__visual--film { height: 140px; filter: sepia(0.2) saturate(0.85); background: #0e0d0c; border-bottom: 1px solid var(--hair); }
.area-card__visual--film video { width: 100%; height: 100%; object-fit: cover; display: block; }
@media (max-width: 768px) { .area-card__visual--film { height: 120px; } }
/* Phones: the card padding shrinks, so the visual must too, flush with the card top */
@media (max-width: 768px) {
  .area-card { padding-top: 0; }
  .area-card__visual { width: calc(100% + var(--space-6) * 2); margin-left: calc(-1 * var(--space-6)); }
}
/* Expanded card: show the whole film frame instead of a thin slice */
.area-card--expanded .area-card__visual--film { height: auto; aspect-ratio: 960 / 350; max-height: 380px; }
/* Direction rows: one gold rule for every area */
.area-card .area-card__direction { border-left-color: var(--gold) !important; }
