:root {
  --font-display: 'Outfit', sans-serif;
  --font-body: 'Source Serif 4', Georgia, serif;
  --font-mono: 'JetBrains Mono', monospace;
}

/* ── DARK THEME (default) ── */
[data-theme="dark"] {
  --bg: #0f1117;
  --bg-raised: #161822;
  --bg-card: #1c1e2a;
  --border: #272a38;
  --text: #e4e2ef;
  --text-muted: #c6c4da;
  --accent: #7eb8da;
  --accent-dim: rgba(126, 184, 218, 0.1);
  --accent-glow: rgba(126, 184, 218, 0.05);
  --nav-bg: rgba(15, 17, 23, 0.82);
}

/* ── LIGHT THEME ── */
[data-theme="light"] {
  --bg: #faf8f5;
  --bg-raised: #f0ece6;
  --bg-card: #ffffff;
  --border: #ddd8d0;
  --text: #2b2520;
  --text-muted: #69605a;
  --accent: #c07a3e;
  --accent-dim: rgba(192, 122, 62, 0.1);
  --accent-glow: rgba(192, 122, 62, 0.05);
  --nav-bg: rgba(250, 248, 245, 0.85);
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 20px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  transition: background 0.3s, color 0.3s;
}

::selection { background: var(--accent); color: var(--bg); }

/* ── NAV ── */
nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 100;
  backdrop-filter: blur(20px); -webkit-backdrop-filter: blur(20px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border);
}
nav .nav-inner {
  max-width: 1100px; margin: 0 auto;
  padding: 0 2rem;
  display: flex; justify-content: center; align-items: center;
  height: 60px; position: relative;
}

/* ── THEME TOGGLE ── */
.theme-toggle {
  position: absolute; right: 2rem;
  background: none; border: 1px solid var(--border);
  border-radius: 8px; cursor: pointer;
  width: 38px; height: 38px;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-muted);
  transition: all 0.3s;
}
.theme-toggle:hover { color: var(--accent); border-color: var(--accent); }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-toggle .icon-sun { display: none; }
.theme-toggle .icon-moon { display: block; }
[data-theme="light"] .theme-toggle .icon-sun { display: block; }
[data-theme="light"] .theme-toggle .icon-moon { display: none; }
nav ul { list-style: none; display: flex; gap: 2rem; }
nav a {
  color: var(--text-muted); text-decoration: none;
  font-family: var(--font-display); font-size: 1.1rem;
  font-weight: 400; letter-spacing: 0.03em;
  transition: color 0.3s;
}
nav a:hover { color: var(--accent); }

.nav-toggle {
  display: none; background: none; border: none;
  cursor: pointer; padding: 0.5rem;
}
.nav-toggle span {
  display: block; width: 22px; height: 2px;
  background: var(--text); margin: 5px 0; transition: 0.3s;
}

/* ── SECTIONS ── */
section { padding: 4.5rem 2rem; }
section:nth-of-type(even) { background: var(--bg-raised); }
.container { max-width: 1100px; margin: 0 auto; }

/* ── HERO ── */
.hero {
  display: flex; align-items: center;
  padding-top: 150px;
  position: relative; overflow: hidden;
}
.hero::before {
  content: '';
  position: absolute; top: -40%; right: -20%;
  width: 700px; height: 700px;
  background: radial-gradient(circle, var(--accent-glow) 0%, transparent 70%);
  pointer-events: none;
}
.hero-grid {
  position: relative; z-index: 1;
  display: grid; grid-template-columns: auto 1fr;
  gap: 2.5rem; align-items: start;
}
.hero-content p {
  color: var(--text-muted); margin-bottom: 0.8rem;
  opacity: 0; animation: fadeUp 0.8s ease 0.4s forwards;
}
.hero-content p strong { color: var(--text); font-weight: 600; }
.text-link {
  color: var(--accent); text-decoration: none;
  font-weight: 600; transition: opacity 0.3s;
}
.text-link:hover { opacity: 0.8; }
.hero-actions {
  display: flex; gap: 1rem; flex-wrap: wrap;
  margin-top: 1.2rem;
  opacity: 0; animation: fadeUp 0.8s ease 0.6s forwards;
}

/* ── PROFILE SIDE ── */
.profile-side {
  text-align: center;
  opacity: 0; animation: fadeUp 0.8s ease 0.2s forwards;
}
.profile-photo {
  width: 220px; height: 250px;
  margin: 0 auto 1rem;
  border-radius: 50%; overflow: hidden;
  border: 3px solid var(--border);
  transition: border-color 0.4s;
}
.profile-photo:hover { border-color: var(--accent); }
.profile-photo img {
  width: 100%; height: 100%;
  object-fit: cover;
  object-position: center 20%;
  image-rendering: auto;
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
  transform: translateZ(0);
}
.profile-name {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.8rem; letter-spacing: -0.01em;
  margin-bottom: 0.4rem;
}
.profile-role {
  font-family: var(--font-display); font-size: 1rem;
  color: var(--accent); margin-bottom: 0.15rem;
}
.profile-affiliation {
  font-family: var(--font-display); font-size: 0.96rem;
  color: var(--text-muted); margin-bottom: 1rem;
}
.profile-socials {
  display: flex; justify-content: center; gap: 0.6rem;
}
.profile-socials a {
  display: flex; align-items: center; justify-content: center;
  width: 38px; height: 38px; border-radius: 8px;
  color: var(--text-muted);
  transition: all 0.3s;
}
.profile-socials a:hover { color: var(--accent); }
.profile-socials svg { width: 22px; height: 22px; }
.btn {
  font-family: var(--font-display); font-size: 0.93rem;
  font-weight: 500; padding: 0.8rem 1.8rem;
  border-radius: 6px; text-decoration: none;
  transition: all 0.3s; cursor: pointer; border: none;
  display: inline-flex; align-items: center; gap: 0.5rem;
}
.btn-primary { background: var(--accent); color: var(--bg); }
.btn-primary:hover { filter: brightness(1.15); transform: translateY(-1px); }
.btn-ghost { background: transparent; color: var(--text); border: 1px solid var(--border); }
.btn-ghost:hover { border-color: var(--accent); color: var(--accent); }

/* ── SECTION HEADERS ── */
.section-label {
  font-family: var(--font-mono); font-size: 0.93rem;
  color: var(--accent); letter-spacing: 0.12em;
  text-transform: uppercase; margin-bottom: 0.75rem;
}
.section-title {
  font-family: var(--font-display); font-weight: 600;
  font-size: clamp(1.8rem, 3.5vw, 2.4rem);
  letter-spacing: -0.02em; margin-bottom: 1rem;
}
.section-desc {
  color: var(--text-muted); max-width: 560px;
  margin-bottom: 3.5rem;
}

/* ── HIGHLIGHTS ── */
#highlights { padding-top: 0; padding-bottom: 3rem; }
.about-highlights {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 1.5rem;
}
.highlight-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 1.5rem;
  transition: border-color 0.3s;
}
.highlight-card:hover { border-color: var(--accent); }
.highlight-card .number {
  font-family: var(--font-display); font-weight: 700;
  font-size: 1.8rem; color: var(--accent);
  line-height: 1;
}
.highlight-card .label {
  font-family: var(--font-display); font-size: 0.95rem;
  color: var(--text-muted); margin-top: 0.3rem;
  letter-spacing: 0.02em;
}

/* ── HORIZONTAL TIMELINE (Education) ── */
.timeline-h {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 2rem;
  position: relative;
}
.timeline-h-item {
  position: relative;
}
.timeline-h-dot { display: none; }
.timeline-h-item h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.1rem; margin-bottom: 0.15rem;
}
.timeline-h-item .company {
  font-family: var(--font-display); font-size: 0.98rem;
  color: var(--text-muted);
}
.timeline-h-item p {
  color: var(--text-muted); font-size: 0.9rem;
  margin-top: 0.4rem;
}

/* ── SKILLS ── */
.skills-grid {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 1.5rem;
}
.skill-group {
  background: transparent; border: 1px solid var(--border);
  border-radius: 10px; padding: 2rem;
  transition: border-color 0.3s, transform 0.3s;
}
.skill-group:hover { border-color: var(--accent); transform: translateY(-2px); }
.skill-group h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.3rem; margin-bottom: 1.2rem;
  display: flex; align-items: center; gap: 0.6rem;
}
.skill-group h3 .icon { color: var(--accent); font-size: 1.5rem; }
.skill-tags { display: flex; flex-wrap: wrap; gap: 0.5rem; }
.skill-tag {
  font-family: var(--font-mono); font-size: 0.93rem;
  padding: 0.35rem 0.75rem; border-radius: 4px;
  background: var(--accent-dim); color: var(--accent);
  letter-spacing: 0.02em;
}

/* ── PROJECTS ── */
.projects-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 1.5rem;
}
.project-card {
  background: var(--bg-card); border: 1px solid var(--border);
  border-radius: 10px; padding: 2rem;
  transition: border-color 0.3s, transform 0.3s;
  display: flex; flex-direction: column;
}
.project-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.project-card .project-type {
  font-family: var(--font-mono); font-size: 0.85rem;
  color: var(--accent); letter-spacing: 0.08em;
  text-transform: uppercase; margin-bottom: 0.75rem;
}
.project-card h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.15rem; margin-bottom: 0.75rem;
}
.project-card p {
  color: var(--text-muted); font-size: 0.98rem;
  flex: 1; margin-bottom: 1.2rem;
}
.project-tech {
  display: flex; flex-wrap: wrap; gap: 0.4rem;
}
.project-tech span {
  font-family: var(--font-mono); font-size: 0.85rem;
  padding: 0.25rem 0.6rem; border-radius: 3px;
  background: var(--bg); color: var(--text-muted);
  border: 1px solid var(--border);
}

/* ── PUBLICATIONS ── */
.pub-list { display: flex; flex-direction: column; gap: 1.2rem; }
.pub-item {
  background: transparent; border: 1px solid var(--border);
  border-radius: 10px; padding: 1.8rem 2rem;
  display: grid; grid-template-columns: auto 1fr auto; align-items: start; gap: 1.5rem;
  transition: border-color 0.3s;
}
a.pub-item { text-decoration: none; color: inherit; }
.pub-item:hover { border-color: var(--accent); }
.pub-year {
  font-family: var(--font-mono); font-size: 0.93rem;
  color: var(--accent); white-space: nowrap; padding-top: 0.2rem;
  min-width: 3rem;
}
.pub-item h3 {
  font-family: var(--font-display); font-weight: 500;
  font-size: 1.2rem; margin-bottom: 0.4rem;
  line-height: 1.5;
}
.pub-item .pub-venue {
  font-size: 0.98rem; color: var(--text-muted);
  font-style: italic;
}
.pub-badges {
  display: flex; flex-direction: column; gap: 0.4rem;
  align-self: start; margin-top: 0.2rem;
}
.pub-badge {
  font-family: var(--font-mono); font-size: 0.75rem;
  padding: 0.3rem 0.6rem; border-radius: 4px;
  background: var(--accent-dim); color: var(--accent);
  white-space: nowrap; letter-spacing: 0.04em;
}
.pub-badge-code {
  cursor: pointer; 
  display: inline-flex; align-items: center; gap: 0.35rem;
  background: var(--bg); border: 1px solid var(--border);
  color: var(--text-muted); transition: all 0.3s;
}
.pub-badge-code svg { width: 14px; height: 14px; }
.pub-badge-code:hover {
  border-color: var(--accent); color: var(--accent);
}

/* ── TIMELINE ── */
.timeline { position: relative; padding-left: 2.5rem; }
.timeline::before {
  content: ''; position: absolute;
  left: 0; top: 0.5rem; bottom: 0.5rem;
  width: 1px; background: var(--border);
}
.timeline-item { position: relative; margin-bottom: 2.5rem; }
.timeline-item:last-child { margin-bottom: 0; }
.timeline-item::before {
  content: ''; position: absolute;
  left: -2.5rem; top: 0.6rem;
  width: 9px; height: 9px; border-radius: 50%;
  background: var(--bg); border: 2px solid var(--accent);
}
.timeline-item.current::before {
  background: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-dim);
}
.timeline-date {
  font-family: var(--font-mono); font-size: 0.88rem;
  color: var(--accent); letter-spacing: 0.05em;
  margin-bottom: 0.3rem;
}
.timeline-item h3 {
  font-family: var(--font-display); font-weight: 600;
  font-size: 1.4rem; margin-bottom: 0.15rem;
}
.timeline-item .company {
  font-family: var(--font-display); font-size: 1.2rem;
  color: var(--text-muted); margin-bottom: 0.5rem;
}
.timeline-item p {
  color: var(--text-muted); font-size: 1.2rem;
}
.timeline-tags {
  display: flex; flex-wrap: wrap; gap: 0.4rem; margin-top: 0.7rem;
}
.timeline-tags span {
  font-family: var(--font-mono); font-size: 0.9rem;
  padding: 0.2rem 0.55rem; border-radius: 3px;
  background: var(--accent-dim); color: var(--accent);
}

/* ── CONTACT ── */
.contact-section { text-align: center; border-top: 1px solid var(--border); }
.contact-section .section-desc { margin-left: auto; margin-right: auto; }
.contact-links {
  display: flex; justify-content: center; gap: 1rem; flex-wrap: wrap;
}
.contact-link {
  display: flex; align-items: center; gap: 0.6rem;
  font-family: var(--font-display); font-size: 0.93rem;
  color: var(--text-muted); text-decoration: none;
  padding: 0.7rem 1.4rem; border-radius: 6px;
  border: 1px solid var(--border);
  transition: all 0.3s;
}
.contact-link:hover {
  border-color: var(--accent); color: var(--accent);
  background: var(--accent-dim);
}
.contact-link svg { width: 18px; height: 18px; }

/* ── FOOTER ── */
footer {
  text-align: center; padding: 2rem;
  font-family: var(--font-display); font-size: 0.85rem;
  color: var(--text-muted);
  border-top: 1px solid var(--border);
}

/* ── ANIMATIONS ── */
@keyframes fadeUp {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}
.fade-in {
  opacity: 0; transform: translateY(20px);
  transition: opacity 0.7s ease, transform 0.7s ease;
}
.fade-in.visible { opacity: 1; transform: translateY(0); }

/* ── RESPONSIVE ── */
@media (max-width: 900px) {
  .hero-grid {
    grid-template-columns: 1fr;
    gap: 2.5rem; justify-items: center; text-align: center;
  }
  .hero-content { text-align: left; }
  .about-highlights { grid-template-columns: 1fr 1fr; }
  .timeline-h { grid-template-columns: 1fr; }
  .skills-grid { grid-template-columns: 1fr 1fr; }
  .projects-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  section { padding: 4.5rem 1.25rem; }
  nav ul {
    display: none; position: absolute; top: 60px; left: 0; right: 0;
    flex-direction: column; background: var(--nav-bg);
    padding: 1rem 2rem; gap: 1rem;
    border-bottom: 1px solid var(--border);
  }
  nav ul.open { display: flex; }
  .nav-toggle { display: block; }
  .skills-grid { grid-template-columns: 1fr; }
  .pub-item { grid-template-columns: 1fr; gap: 0.5rem; }
  .pub-badge { justify-self: start; }
  .hero-actions { flex-direction: column; }
  .btn { text-align: center; justify-content: center; }
  .about-highlights { grid-template-columns: 1fr 1fr; gap: 1rem; }
  .service-grid { grid-template-columns: 1fr; }
  .press-item { flex-direction: column; gap: 0.3rem; }
  .press-outlet { min-width: auto; }
  .press-date { text-align: left; }
}

/* ACADEMIC SERVICE */
.service-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 2rem;
}

.service-block {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 2rem;
  transition: border-color 0.3s;
}

.service-block:hover {
  border-color: var(--accent);
}

.service-block h3 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: 1.15rem;
  margin-bottom: 1.2rem;
  display: flex;
  align-items: center;
  gap: 0.6rem;
}

.service-block h3::before {
  content: '';
  display: inline-block;
  width: 3px;
  height: 1.1em;
  background: var(--accent);
  border-radius: 2px;
}

.service-list {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 0;
}

.service-list li {
  font-size: 0.95rem;
  padding: 0.65rem 0 0.65rem 0;
  position: relative;
  line-height: 1.55;
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: baseline;
  gap: 0.8rem;
}

.service-list li:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

.service-list li::before {
  content: '›';
  color: var(--accent);
  font-weight: 600;
  font-size: 1.1rem;
  flex-shrink: 0;
}

.service-note {
  font-family: var(--font-mono);
  font-size: 0.78rem;
  color: var(--accent);
  background: var(--accent-dim);
  padding: 0.15rem 0.5rem;
  border-radius: 3px;
  white-space: nowrap;
}

/* PRESS */
.press-list {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.press-item {
  display: flex;
  align-items: baseline;
  gap: 1.2rem;
  padding: 1rem 0;
  border-bottom: 1px solid var(--border);
  text-decoration: none;
  color: var(--text);
  transition: color 0.2s;
}

.press-item:first-child {
  border-top: 1px solid var(--border);
}

.press-item:hover .press-title {
  color: var(--accent);
}

.press-outlet {
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.95rem;
  font-weight: 500;
  color: var(--text-muted);
  min-width: 160px;
  flex-shrink: 0;
}

.press-title {
  flex: 1;
  font-size: 1.2rem;
  font-weight: 400;
  transition: color 0.2s;
}

.press-date {
  font-size: 0.9rem;
  color: var(--text-muted);
  white-space: nowrap;
  text-align: right;
}
