/* ============================================================
   PORTFOLIO — style.css
   Design Philosophy: "Analytical Humanism"
   — Sociology's humanistic depth + Data Science's precision + HCI usability

   Color System:
     Midnight Slate   #1A1C23  (dark bg / light text)
     Paper White      #F7F8FA  (light bg)
     Sociological Rust #C75D4A (accent: CTAs, warmth)
     Data Teal        #2E8B99  (accent: tech, data)
============================================================ */


/* ============================================================
   0. DESIGN TOKENS & VARIABLES
============================================================ */
:root {
  /* Surface colors — light mode default */
  --bg:           #F7F8FA;
  --bg-card:      #FFFFFF;
  --bg-nav:       rgba(247, 248, 250, 0.88);
  --bg-elevated:  #EDEEF2;

  /* Text colors — light mode */
  --text-main:    #1A1C23;
  --text-sub:     #4A5568;
  --text-muted:   #7F8C9A;
  --text-micro:   #A0AAB5;

  /* Accent colors (invariant across themes) */
  --rust:         #C75D4A;
  --rust-light:   rgba(199, 93, 74, 0.12);
  --teal:         #2E8B99;
  --teal-light:   rgba(46, 139, 153, 0.12);

  /* Borders */
  --border:       rgba(26, 28, 35, 0.08);
  --border-mid:   rgba(26, 28, 35, 0.14);

  /* Typography */
  --font-serif:   'Playfair Display', 'Nanum Myeongjo', Georgia, serif;
  --font-sans:    'Inter', 'Noto Sans KR', system-ui, -apple-system, sans-serif;

  /* Spacing scale */
  --space-xs:  0.375rem;  /*  6px */
  --space-sm:  0.75rem;   /* 12px */
  --space-md:  1.5rem;    /* 24px */
  --space-lg:  3rem;      /* 48px */
  --space-xl:  6rem;      /* 96px */
  --space-2xl: 10rem;     /* 160px */

  /* Layout */
  --nav-h:       64px;
  --max-w:       1200px;
  --max-w-prose: 72ch;
  --radius:      10px;
  --radius-sm:   6px;
  --radius-lg:   16px;
  --radius-pill: 999px;

  /* Transitions */
  --ease:        cubic-bezier(0.25, 0.8, 0.25, 1);
  --ease-in:     cubic-bezier(0.4, 0, 1, 1);
  --ease-out:    cubic-bezier(0, 0, 0.2, 1);
  --t-fast:      0.18s;
  --t-med:       0.30s;
  --t-slow:      0.50s;

  /* Shadows */
  --shadow-sm:   0 1px 3px rgba(26, 28, 35, 0.06), 0 1px 2px rgba(26, 28, 35, 0.04);
  --shadow-md:   0 4px 12px rgba(26, 28, 35, 0.08), 0 2px 6px rgba(26, 28, 35, 0.05);
  --shadow-lg:   0 12px 32px rgba(26, 28, 35, 0.10), 0 4px 12px rgba(26, 28, 35, 0.06);
}

/* Dark mode — media query (OS preference) */
@media (prefers-color-scheme: dark) {
  :root {
    --bg:         #1A1C23;
    --bg-card:    #22252E;
    --bg-nav:     rgba(26, 28, 35, 0.88);
    --bg-elevated:#2A2D38;
    --text-main:  #F0F2F5;
    --text-sub:   #B0BAC8;
    --text-muted: #7A8696;
    --text-micro: #505A68;
    --border:     rgba(240, 242, 245, 0.07);
    --border-mid: rgba(240, 242, 245, 0.12);
    --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.25);
    --shadow-md:  0 4px 12px rgba(0, 0, 0, 0.30);
    --shadow-lg:  0 12px 32px rgba(0, 0, 0, 0.35);
  }
}

/* Dark mode — manual toggle via JS (data-theme attribute) */
[data-theme="dark"] {
  --bg:         #1A1C23;
  --bg-card:    #22252E;
  --bg-nav:     rgba(26, 28, 35, 0.88);
  --bg-elevated:#2A2D38;
  --text-main:  #F0F2F5;
  --text-sub:   #B0BAC8;
  --text-muted: #7A8696;
  --text-micro: #505A68;
  --border:     rgba(240, 242, 245, 0.07);
  --border-mid: rgba(240, 242, 245, 0.12);
  --shadow-sm:  0 1px 3px rgba(0, 0, 0, 0.25);
  --shadow-md:  0 4px 12px rgba(0, 0, 0, 0.30);
  --shadow-lg:  0 12px 32px rgba(0, 0, 0, 0.35);
}

[data-theme="light"] {
  --bg:         #F7F8FA;
  --bg-card:    #FFFFFF;
  --bg-nav:     rgba(247, 248, 250, 0.88);
  --bg-elevated:#EDEEF2;
  --text-main:  #1A1C23;
  --text-sub:   #4A5568;
  --text-muted: #7F8C9A;
  --text-micro: #A0AAB5;
  --border:     rgba(26, 28, 35, 0.08);
  --border-mid: rgba(26, 28, 35, 0.14);
  --shadow-sm:  0 1px 3px rgba(26, 28, 35, 0.06), 0 1px 2px rgba(26, 28, 35, 0.04);
  --shadow-md:  0 4px 12px rgba(26, 28, 35, 0.08), 0 2px 6px rgba(26, 28, 35, 0.05);
  --shadow-lg:  0 12px 32px rgba(26, 28, 35, 0.10), 0 4px 12px rgba(26, 28, 35, 0.06);
}


/* ============================================================
   1. RESET & BASE
============================================================ */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: 1rem;
  line-height: 1.65;
  color: var(--text-main);
  background-color: var(--bg);
  transition: background-color var(--t-med) var(--ease),
              color var(--t-med) var(--ease);
  overflow-x: hidden;
}

img, svg { display: block; max-width: 100%; }

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

ul { list-style: none; }

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

em { font-style: italic; }

/* Selection */
::selection {
  background: var(--teal);
  color: #F7F8FA;
}


/* ============================================================
   2. LAYOUT UTILITIES
============================================================ */
.container {
  width: 100%;
  max-width: var(--max-w);
  margin-inline: auto;
  padding-inline: var(--space-lg);
}

.section {
  padding-block: var(--space-xl);
}

.section-header {
  margin-bottom: var(--space-lg);
  max-width: 640px;
}

.section-header--centered {
  text-align: center;
  margin-inline: auto;
}

.section-footer-cta {
  margin-top: var(--space-lg);
  display: flex;
  justify-content: center;
}


/* ============================================================
   3. TYPOGRAPHY
============================================================ */
.section-eyebrow {
  display: block;
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: var(--space-sm);
}

.section-title {
  font-family: var(--font-serif);
  font-size: clamp(1.75rem, 3.5vw, 2.6rem);
  font-weight: 700;
  line-height: 1.2;
  color: var(--text-main);
  margin-bottom: var(--space-md);
}

.section-desc {
  font-size: 1rem;
  color: var(--text-sub);
  line-height: 1.7;
  max-width: 560px;
}


/* ============================================================
   4. BUTTONS
============================================================ */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
  padding: 0.75rem 1.625rem;
  border-radius: var(--radius-pill);
  font-family: var(--font-sans);
  font-size: 0.9rem;
  font-weight: 500;
  letter-spacing: 0.01em;
  transition: all var(--t-fast) var(--ease);
  white-space: nowrap;
}

.btn-primary {
  background: var(--rust);
  color: #F7F8FA;
}
.btn-primary:hover {
  background: #b54f3d;
  transform: translateY(-1px);
  box-shadow: 0 6px 20px rgba(199, 93, 74, 0.35);
}

.btn-ghost {
  color: rgba(247, 248, 250, 0.88);
  border: 1.5px solid rgba(247, 248, 250, 0.28);
}
.btn-ghost:hover {
  background: rgba(247, 248, 250, 0.10);
  border-color: rgba(247, 248, 250, 0.55);
  transform: translateY(-1px);
}

.btn-outline {
  color: var(--text-main);
  border: 1.5px solid var(--border-mid);
}
.btn-outline:hover {
  border-color: var(--teal);
  color: var(--teal);
  transform: translateY(-1px);
}

.btn-arrow {
  transition: transform var(--t-fast) var(--ease);
}
.btn:hover .btn-arrow { transform: translateX(4px); }


/* ============================================================
   5. TAGS / PILLS
============================================================ */
.tag {
  display: inline-block;
  padding: 0.25rem 0.625rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  background: var(--teal-light);
  color: var(--teal);
  border: 1px solid rgba(46, 139, 153, 0.20);
  transition: background var(--t-fast) var(--ease);
}


/* ============================================================
   6. NAVIGATION
============================================================ */
.nav {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: var(--nav-h);
  z-index: 100;
  /* Default: transparent over dark hero */
  background: transparent;
  border-bottom: 1px solid transparent;
  transition: background var(--t-med) var(--ease),
              border-color var(--t-med) var(--ease),
              backdrop-filter var(--t-med) var(--ease);
}

.nav--scrolled {
  background: var(--bg-nav);
  border-bottom-color: var(--border);
  backdrop-filter: blur(16px) saturate(1.4);
  -webkit-backdrop-filter: blur(16px) saturate(1.4);
  box-shadow: var(--shadow-sm);
}

.nav-container {
  max-width: var(--max-w);
  height: 100%;
  margin-inline: auto;
  padding-inline: var(--space-lg);
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

/* Logo */
.nav-logo {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 700;
  color: rgba(247, 248, 250, 0.95);
  letter-spacing: -0.01em;
  flex-shrink: 0;
  transition: color var(--t-fast) var(--ease),
              opacity var(--t-fast) var(--ease);
}
.nav-logo:hover { opacity: 0.75; }

.nav--scrolled .nav-logo {
  color: var(--text-main);
}

/* Nav links */
.nav-links {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  margin-left: auto;
}

.nav-link {
  padding: 0.35rem 0.75rem;
  border-radius: var(--radius-sm);
  font-size: 0.875rem;
  font-weight: 500;
  color: rgba(247, 248, 250, 0.75);
  transition: color var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease);
}
.nav-link:hover,
.nav-link.active {
  color: rgba(247, 248, 250, 0.98);
  background: rgba(247, 248, 250, 0.08);
}

.nav--scrolled .nav-link {
  color: var(--text-sub);
}
.nav--scrolled .nav-link:hover,
.nav--scrolled .nav-link.active {
  color: var(--text-main);
  background: var(--bg-elevated);
}

/* Nav actions */
.nav-actions {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  flex-shrink: 0;
}

/* Theme toggle button */
.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: var(--radius-pill);
  color: rgba(247, 248, 250, 0.75);
  transition: color var(--t-fast) var(--ease),
              background var(--t-fast) var(--ease);
}
.theme-toggle:hover {
  color: rgba(247, 248, 250, 1);
  background: rgba(247, 248, 250, 0.10);
}
.nav--scrolled .theme-toggle {
  color: var(--text-muted);
}
.nav--scrolled .theme-toggle:hover {
  color: var(--text-main);
  background: var(--bg-elevated);
}

/* Icon visibility based on theme */
.icon-moon { display: block; }
.icon-sun  { display: none; }

[data-theme="dark"]  .icon-moon { display: none; }
[data-theme="dark"]  .icon-sun  { display: block; }
[data-theme="light"] .icon-moon { display: block; }
[data-theme="light"] .icon-sun  { display: none; }

/* Hamburger (mobile) */
.nav-hamburger {
  display: none;
  flex-direction: column;
  justify-content: space-between;
  width: 22px;
  height: 16px;
}
.nav-hamburger span {
  display: block;
  width: 100%;
  height: 2px;
  border-radius: 2px;
  background: rgba(247, 248, 250, 0.80);
  transition: all var(--t-med) var(--ease);
}
.nav--scrolled .nav-hamburger span {
  background: var(--text-sub);
}
.nav-hamburger.open span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}
.nav-hamburger.open span:nth-child(2) {
  opacity: 0;
}
.nav-hamburger.open span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

/* Mobile overlay */
.mobile-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 90;
  opacity: 0;
  transition: opacity var(--t-med) var(--ease);
}
.mobile-overlay.active {
  opacity: 1;
}


/* ============================================================
   7. HERO SECTION
   Always dark, independent of theme setting.
============================================================ */
.section-hero {
  position: relative;
  min-height: 100svh;
  display: flex;
  align-items: center;
  /* Fixed dark background — this section is always Midnight Slate */
  background: #1A1C23;
  overflow: hidden;
}

/* Full-bleed canvas for particle network */
#network-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: 0.9;
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: var(--max-w);
  width: 100%;
  margin-inline: auto;
  padding-inline: var(--space-lg);
  padding-top: var(--nav-h);
}

.hero-eyebrow {
  font-family: var(--font-sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: var(--space-md);
}

.hero-headline {
  font-family: var(--font-serif);
  font-size: clamp(1.9rem, 4.2vw, 3.2rem);
  font-weight: 700;
  line-height: 1.18;
  color: #F0F2F5;
  letter-spacing: -0.01em;
  margin-bottom: var(--space-md);
  max-width: 680px;
}

.hero-headline em {
  font-style: italic;
  color: var(--teal);
}

.hero-amp {
  font-style: normal;
  color: var(--rust);
  display: inline-block;
}

.hero-subline {
  font-size: clamp(0.95rem, 1.5vw, 1.05rem);
  color: rgba(176, 186, 200, 0.85);
  line-height: 1.75;
  max-width: 520px;
  margin-bottom: var(--space-lg);
}

.hero-actions {
  display: flex;
  align-items: center;
  gap: var(--space-md);
  flex-wrap: wrap;
}

/* Scroll indicator */
.hero-scroll {
  position: absolute;
  bottom: 2.5rem;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.5rem;
  z-index: 2;
}

.hero-scroll-label {
  font-size: 0.65rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  color: rgba(176, 186, 200, 0.50);
}

.hero-scroll-line {
  width: 1px;
  height: 50px;
  background: linear-gradient(to bottom, rgba(46, 139, 153, 0.60), transparent);
  animation: scrollPulse 2.2s ease-in-out infinite;
}

@keyframes scrollPulse {
  0%, 100% { opacity: 0.4; transform: scaleY(1); }
  50%       { opacity: 1;   transform: scaleY(1.15); }
}


/* ============================================================
   8. ABOUT SECTION
============================================================ */
.section-about {
  background: var(--bg);
}

.about-layout {
  display: grid;
  grid-template-columns: 340px 1fr;
  gap: var(--space-xl);
  align-items: start;
}

/* Photo column */
.photo-wrap {
  position: relative;
  padding-top: 0.5rem;
}

.photo-placeholder {
  width: 100%;
  aspect-ratio: 3 / 4;
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  border: 1px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  position: relative;
}

.photo-placeholder::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg,
    rgba(46, 139, 153, 0.06) 0%,
    transparent 60%,
    rgba(199, 93, 74, 0.04) 100%);
}

.photo-hint {
  font-size: 0.875rem;
  color: var(--text-micro);
  font-style: italic;
  letter-spacing: 0.04em;
  position: relative;
  z-index: 1;
}

/* Decorative accent line */
.photo-accent-line {
  position: absolute;
  top: 1rem;
  left: -1rem;
  width: 3px;
  height: 80px;
  background: linear-gradient(to bottom, var(--teal), transparent);
  border-radius: 2px;
}

/* Text column */
.about-text-col {
  padding-top: 1rem;
}

.about-lead {
  font-family: var(--font-serif);
  font-size: 1.2rem;
  font-style: italic;
  color: var(--text-main);
  line-height: 1.7;
  margin-bottom: var(--space-md);
}

.about-body {
  font-size: 0.975rem;
  color: var(--text-sub);
  line-height: 1.75;
  margin-bottom: var(--space-lg);
}

.about-meta {
  display: flex;
  flex-direction: column;
  gap: 0;
  border-top: 1px solid var(--border);
  padding-top: var(--space-md);
}

.meta-row {
  display: grid;
  grid-template-columns: 140px 1fr;
  gap: 1rem;
  padding-block: 0.65rem;
  border-bottom: 1px solid var(--border);
  font-size: 0.875rem;
}

.meta-key {
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.01em;
}

.meta-val {
  color: var(--text-sub);
}


/* ============================================================
   9. SELECTED WORKS / RESEARCH CARDS
============================================================ */
.section-works {
  background: var(--bg-elevated);
  position: relative;
}

.section-works::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--border);
}

.project-gallery {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-md);
}

/* ── Research Card ── */
.research-card {
  position: relative;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  box-shadow: var(--shadow-sm);
  transition: transform var(--t-med) var(--ease),
              box-shadow var(--t-med) var(--ease);
  animation-delay: var(--card-delay, 0ms);
}

.research-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-lg);
}

/* Card visual area */
.card-visual {
  width: 100%;
  height: 200px;
  overflow: hidden;
  position: relative;
  flex-shrink: 0;
}

.card-visual--teal {
  background: linear-gradient(135deg,
    rgba(46, 139, 153, 0.08) 0%,
    rgba(46, 139, 153, 0.04) 100%);
}

[data-theme="dark"] .card-visual--teal,
@media (prefers-color-scheme: dark) {
  .card-visual--teal {
    background: linear-gradient(135deg,
      rgba(46, 139, 153, 0.15) 0%,
      rgba(46, 139, 153, 0.06) 100%);
  }
}

.card-visual--rust {
  background: linear-gradient(135deg,
    rgba(199, 93, 74, 0.08) 0%,
    rgba(199, 93, 74, 0.03) 100%);
}

.card-visual--mixed {
  background: linear-gradient(135deg,
    rgba(46, 139, 153, 0.06) 0%,
    rgba(199, 93, 74, 0.05) 100%);
}

.abstract-viz {
  width: 100%;
  height: 100%;
}

/* Card body */
.card-body {
  padding: 1.5rem;
  display: flex;
  flex-direction: column;
  flex: 1;
  gap: 0.75rem;
}

.card-meta-row {
  display: flex;
  align-items: center;
  gap: 0.75rem;
}

.card-year {
  font-size: 0.72rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
}

.card-venue {
  font-size: 0.72rem;
  color: var(--text-micro);
  font-style: italic;
}

.card-title {
  font-family: var(--font-serif);
  font-size: 1.05rem;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-main);
}

.card-excerpt {
  font-size: 0.86rem;
  color: var(--text-sub);
  line-height: 1.65;
  flex: 1;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.375rem;
}

.card-cta {
  display: inline-flex;
  align-items: center;
  gap: 0.375em;
  font-size: 0.825rem;
  font-weight: 600;
  color: var(--teal);
  margin-top: auto;
  padding-top: 0.5rem;
  transition: gap var(--t-fast) var(--ease);
}
.card-cta:hover { gap: 0.625em; }

/* ── Data-driven Insight Hover Overlay ── */
.insight-overlay {
  position: absolute;
  inset: 0;
  background: rgba(46, 139, 153, 0.94);
  backdrop-filter: blur(4px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  padding: 2rem;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity var(--t-med) var(--ease),
              transform var(--t-med) var(--ease);
  pointer-events: none;
}

.insight-overlay--rust {
  background: rgba(199, 93, 74, 0.92);
}

.research-card:hover .insight-overlay {
  opacity: 1;
  transform: translateY(0);
}

.insight-eyebrow {
  font-size: 0.65rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(247, 248, 250, 0.60);
  margin-bottom: 0.75rem;
}

.insight-quote {
  font-family: var(--font-serif);
  font-style: italic;
  font-size: 1rem;
  line-height: 1.6;
  color: #F0F2F5;
  margin-bottom: 1.5rem;
}

.insight-methods {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem;
  font-size: 0.72rem;
  font-weight: 500;
  color: rgba(247, 248, 250, 0.65);
}

.insight-methods .dot {
  color: rgba(247, 248, 250, 0.35);
}


/* ============================================================
   10. EXPERIENCE / TIMELINE
============================================================ */
.section-experience {
  background: var(--bg-elevated);
  position: relative;
}

.section-experience::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--border);
}

.timeline {
  position: relative;
  max-width: 760px;
  padding-left: 2.5rem;
}

/* Vertical line */
.timeline::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0.5rem;
  bottom: 0.5rem;
  width: 2px;
  background: linear-gradient(to bottom,
    rgba(46, 139, 153, 0.55),
    rgba(199, 93, 74, 0.35),
    transparent);
  border-radius: 2px;
}

.timeline-item {
  position: relative;
  padding: 0 0 2.5rem 2rem;
}

.timeline-item:last-child {
  padding-bottom: 0;
}

/* Dot marker */
.timeline-marker {
  position: absolute;
  left: -0.45rem;
  top: 0.45rem;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: var(--teal);
  border: 2.5px solid var(--bg-elevated);
  box-shadow: 0 0 0 2px var(--teal);
  transition: background var(--t-fast) var(--ease),
              box-shadow var(--t-fast) var(--ease);
}

.timeline-item:hover .timeline-marker {
  background: var(--rust);
  box-shadow: 0 0 0 2px var(--rust);
}

.timeline-period {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--teal);
  margin-bottom: 0.35rem;
}

.timeline-title {
  font-family: var(--font-serif);
  font-size: 1.1rem;
  font-weight: 600;
  color: var(--text-main);
  margin-bottom: 0.2rem;
  line-height: 1.4;
}

.timeline-org {
  font-size: 0.875rem;
  font-weight: 600;
  color: var(--rust);
  margin-bottom: 0.5rem;
  letter-spacing: 0.01em;
}

.timeline-desc {
  font-size: 0.9rem;
  color: var(--text-sub);
  line-height: 1.65;
}


/* ============================================================
   11. PUBLICATIONS
============================================================ */
.section-publications {
  background: var(--bg);
}

.pub-layout {
  display: flex;
  flex-direction: column;
  gap: var(--space-xl);
}

.pub-group-title {
  font-family: var(--font-sans);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  gap: 0.625rem;
  margin-bottom: var(--space-md);
}

.pub-group-marker {
  display: inline-block;
  width: 18px;
  height: 3px;
  border-radius: 2px;
  background: var(--teal);
  flex-shrink: 0;
}

.pub-group-marker--rust {
  background: var(--rust);
}

.pub-list {
  display: flex;
  flex-direction: column;
}

.pub-item {
  padding-block: 1.5rem;
  border-bottom: 1px solid var(--border);
  transition: background var(--t-fast) var(--ease),
              padding-left var(--t-fast) var(--ease);
}
.pub-item:first-child { border-top: 1px solid var(--border); }

.pub-item:hover {
  padding-left: 0.75rem;
  background: var(--bg-elevated);
  border-radius: var(--radius-sm);
  border-color: transparent;
  margin-inline: -0.75rem;
  padding-inline: 0.75rem;
}

.pub-item--essay {
  opacity: 0.85;
}

.pub-header-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 0.4rem;
}

.pub-authors {
  font-size: 0.875rem;
  color: var(--text-sub);
}

.pub-authors strong {
  color: var(--text-main);
  font-weight: 600;
}

.pub-year {
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text-muted);
  letter-spacing: 0.04em;
  flex-shrink: 0;
}

.pub-title {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-main);
  margin-bottom: 0.35rem;
}

.pub-venue {
  font-size: 0.83rem;
  color: var(--text-muted);
  margin-bottom: 0.75rem;
}

.pub-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  flex-wrap: wrap;
}

.pub-pill {
  display: inline-block;
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.03em;
  border: 1px solid var(--border-mid);
  color: var(--text-sub);
  transition: all var(--t-fast) var(--ease);
}
.pub-pill:hover {
  border-color: var(--teal);
  color: var(--teal);
}

.pub-badge {
  display: inline-block;
  padding: 0.22rem 0.65rem;
  border-radius: var(--radius-pill);
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-left: auto;
}

.pub-badge--peer {
  background: var(--teal-light);
  color: var(--teal);
  border: 1px solid rgba(46, 139, 153, 0.20);
}

.pub-badge--essay {
  background: var(--rust-light);
  color: var(--rust);
  border: 1px solid rgba(199, 93, 74, 0.20);
}


/* ============================================================
   11. SKILLS & TOOLKIT
============================================================ */
.section-skills {
  background: var(--bg-elevated);
  position: relative;
}

.section-skills::before {
  content: '';
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 1px;
  background: var(--border);
}

.skills-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: var(--space-lg);
}

.skill-cat-title {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--text-muted);
  margin-bottom: var(--space-md);
  padding-bottom: 0.75rem;
  border-bottom: 2px solid var(--teal);
  width: fit-content;
}

.skill-list {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.skill-item {
  display: flex;
  flex-direction: column;
  gap: 0.5rem;
}

.skill-label-row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
}

.skill-name {
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-main);
  display: flex;
  align-items: baseline;
  gap: 0.5rem;
}

.skill-detail {
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--text-muted);
}

/* Skill bar */
.skill-track {
  width: 100%;
  height: 4px;
  background: var(--border-mid);
  border-radius: var(--radius-pill);
  overflow: hidden;
}

.skill-fill {
  height: 100%;
  width: 0%;       /* starts at 0, animated by JS */
  border-radius: var(--radius-pill);
  background: linear-gradient(90deg, var(--teal) 0%, #3da8b7 100%);
  transition: width 1.1s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Animated state (triggered by Intersection Observer) */
.skill-item.in-view .skill-fill {
  width: calc(var(--fill-pct, 0) * 1%);
}


/* ============================================================
   12. CONTACT
============================================================ */
.section-contact {
  background: var(--bg);
}

.contact-wrapper {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: var(--space-xl);
  align-items: start;
}

.contact-text-col {
  max-width: 460px;
}

.contact-desc {
  font-size: 0.975rem;
  color: var(--text-sub);
  line-height: 1.75;
}

.contact-links-col {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.contact-card {
  display: grid;
  grid-template-columns: 120px 1fr auto;
  align-items: center;
  gap: 1rem;
  padding: 1.125rem 1.25rem;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: all var(--t-fast) var(--ease);
}

.contact-card:hover {
  border-color: var(--teal);
  transform: translateX(4px);
  box-shadow: var(--shadow-md);
}

.contact-card-label {
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.10em;
  text-transform: uppercase;
  color: var(--text-muted);
}

.contact-card-value {
  font-size: 0.9rem;
  color: var(--text-main);
  font-weight: 500;
}

.contact-card-arrow {
  font-size: 1rem;
  color: var(--teal);
  opacity: 0;
  transform: translateX(-4px);
  transition: all var(--t-fast) var(--ease);
}

.contact-card:hover .contact-card-arrow {
  opacity: 1;
  transform: translateX(0);
}


/* ============================================================
   13. FOOTER
============================================================ */
.site-footer {
  background: #1A1C23;
  color: rgba(176, 186, 200, 0.60);
  padding-block: var(--space-lg);
  border-top: 1px solid rgba(240, 242, 245, 0.06);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: var(--space-lg);
}

.footer-name {
  font-family: var(--font-serif);
  font-size: 1rem;
  font-weight: 700;
  color: rgba(240, 242, 245, 0.80);
  margin-bottom: 0.2rem;
}

.footer-role {
  font-size: 0.75rem;
  color: rgba(176, 186, 200, 0.45);
  letter-spacing: 0.04em;
}

.footer-center {
  text-align: center;
}

.footer-philosophy {
  font-family: var(--font-serif);
  font-size: 0.875rem;
  font-style: italic;
  color: rgba(176, 186, 200, 0.45);
}

.footer-right {
  text-align: right;
}

.footer-copy {
  font-size: 0.8rem;
  margin-bottom: 0.25rem;
}

.footer-built {
  font-size: 0.75rem;
  color: rgba(176, 186, 200, 0.35);
}

.footer-built a {
  color: rgba(46, 139, 153, 0.65);
  transition: color var(--t-fast) var(--ease);
}
.footer-built a:hover { color: var(--teal); }


/* ============================================================
   14. SCROLL REVEAL ANIMATIONS
   Elements start invisible and animate in via JS
   (Intersection Observer adds .is-visible class)
============================================================ */
.reveal-up,
.reveal-left,
.reveal-right,
.reveal-hero {
  opacity: 0;
  transition-timing-function: var(--ease-out);
  transition-property: opacity, transform;
  transition-duration: var(--t-slow);
  transition-delay: var(--reveal-delay, 0ms);
}

.reveal-up    { transform: translateY(28px); }
.reveal-left  { transform: translateX(-28px); }
.reveal-right { transform: translateX(28px); }
.reveal-hero  { transform: translateY(20px); }

.reveal-up.is-visible,
.reveal-left.is-visible,
.reveal-right.is-visible,
.reveal-hero.is-visible {
  opacity: 1;
  transform: none;
}

/* Staggered card delays */
.research-card.reveal-up {
  transition-delay: var(--card-delay, 0ms);
}

/* Staggered skill category delays */
.skill-category.reveal-up {
  transition-delay: var(--skill-delay, 0ms);
}


/* ============================================================
   15. RESPONSIVE — TABLET (≤ 1024px)
============================================================ */
@media (max-width: 1024px) {
  .container {
    padding-inline: var(--space-md);
  }

  .about-layout {
    grid-template-columns: 280px 1fr;
    gap: var(--space-lg);
  }

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

  .research-card:last-child {
    grid-column: 1 / -1;
    max-width: 560px;
    margin-inline: auto;
    width: 100%;
  }

  .skills-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: var(--space-md);
  }

  .skill-category:last-child {
    grid-column: 1 / -1;
  }

  .contact-wrapper {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

  .footer-inner {
    grid-template-columns: 1fr;
    text-align: center;
    gap: var(--space-md);
  }

  .footer-right { text-align: center; }
}


/* ============================================================
   16. RESPONSIVE — MOBILE (≤ 768px)
============================================================ */
@media (max-width: 768px) {
  :root {
    --space-xl: 4rem;
    --space-lg: 2rem;
  }

  /* Mobile nav */
  .nav-links {
    position: fixed;
    top: var(--nav-h);
    right: 0;
    bottom: 0;
    width: min(320px, 85vw);
    background: var(--bg-nav);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    flex-direction: column;
    align-items: flex-start;
    padding: var(--space-lg);
    gap: 0.25rem;
    z-index: 95;
    margin-left: 0;
    transform: translateX(110%);
    transition: transform var(--t-med) var(--ease);
    border-left: 1px solid var(--border);
  }

  .nav-links.open {
    transform: translateX(0);
  }

  .nav-link {
    width: 100%;
    padding: 0.75rem 1rem;
    font-size: 1rem;
    color: var(--text-sub);
    border-radius: var(--radius);
  }

  .nav-link:hover {
    color: var(--text-main);
    background: var(--bg-elevated);
  }

  .nav--scrolled .nav-link {
    color: var(--text-sub);
  }

  .mobile-overlay {
    display: block;
  }

  .nav-hamburger {
    display: flex;
  }

  /* Hero */
  .hero-headline {
    font-size: clamp(2.2rem, 9vw, 3.5rem);
  }

  .hero-actions {
    flex-direction: column;
    align-items: flex-start;
  }

  /* About */
  .about-layout {
    grid-template-columns: 1fr;
    gap: var(--space-lg);
  }

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

  .photo-accent-line {
    display: none;
  }

  /* Works */
  .project-gallery {
    grid-template-columns: 1fr;
  }

  .research-card:last-child {
    grid-column: auto;
    max-width: none;
  }

  /* Skills */
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .skill-category:last-child {
    grid-column: auto;
  }

  /* Meta rows */
  .meta-row {
    grid-template-columns: 110px 1fr;
    font-size: 0.825rem;
  }

  /* Timeline */
  .timeline {
    padding-left: 1.75rem;
  }

  .timeline-item {
    padding-left: 1.5rem;
  }

  /* Pub */
  .pub-header-row {
    flex-direction: column;
    gap: 0.25rem;
  }

  /* Contact */
  .contact-card {
    grid-template-columns: 100px 1fr auto;
    gap: 0.75rem;
  }
}


/* ============================================================
   17. RESPONSIVE — SMALL MOBILE (≤ 480px)
============================================================ */
@media (max-width: 480px) {
  .container {
    padding-inline: 1.25rem;
  }

  .hero-headline {
    font-size: clamp(1.9rem, 10vw, 2.8rem);
  }

  .nav-container {
    padding-inline: 1.25rem;
  }

  .contact-card {
    grid-template-columns: 1fr;
    gap: 0.25rem;
  }

  .contact-card-arrow {
    display: none;
  }

  .footer-inner {
    gap: 1.5rem;
  }
}


/* ============================================================
   18. REDUCED MOTION
============================================================ */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  .hero-scroll-line {
    animation: none;
    opacity: 0.4;
  }

  html { scroll-behavior: auto; }
}
