/*
  Academic portfolio theme tokens.
  Dark theme is default. Light theme activates with body.light.
*/
:root {
  --bg: #07090d;
  --surface: #0d1117;
  --surface-2: #101722;
  --text: #e6ebf3;
  --text-strong: #c3ccda;
  --muted: #a8b0bd;
  --line: #1c2532;
  --accent: #5f8db8;
  --accent-soft: #89a9c8;
  --shadow: 0 8px 18px rgba(0, 0, 0, 0.22);
}

body.light {
  --bg: #f4f6f9;
  --surface: #ffffff;
  --surface-2: #f7f9fc;
  --text: #141a24;
  --text-strong: #465264;
  --muted: #5f6978;
  --line: #d8dee8;
  --accent: #3f6e99;
  --accent-soft: #5c84ab;
  --shadow: 0 8px 20px rgba(15, 30, 50, 0.07);
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
}

body {
  font-family: "Inter", "Segoe UI", "Helvetica Neue", Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.75;
  letter-spacing: 0.01em;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}

.nav-wrap {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  text-decoration: none;
  color: var(--text);
  font-weight: 600;
  font-size: 1.05rem;
}

.nav-links {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
}

.nav-links a {
  text-decoration: none;
  color: var(--muted);
  font-size: 0.92rem;
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--text);
}

.toggle-btn {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
}

.hero {
  padding: 6.6rem 0 3.8rem;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.7fr;
  gap: 1.15rem;
  align-items: stretch;
}

.eyebrow {
  color: var(--accent-soft);
  font-size: 0.88rem;
  margin-bottom: 0.8rem;
}

.hero h1 {
  font-size: clamp(2rem, 4vw, 3rem);
  line-height: 1.15;
}

.subtitle {
  color: var(--accent-soft);
  font-size: 1rem;
  margin-top: 0.8rem;
}

.hero-text {
  margin-top: 1.1rem;
  color: var(--muted);
  max-width: 690px;
}

.hero-text p {
  text-align: justify;
  line-height: 1.9;
}

.hero-text p + p {
  margin-top: 1rem;
}

.opportunity-note {
  margin-top: 1.15rem;
  color: color-mix(in srgb, var(--text) 78%, var(--muted));
  padding-left: 0.85rem;
  border-left: 2px solid color-mix(in srgb, var(--accent-soft) 70%, var(--line));
}

.opportunity-note strong {
  font-weight: 620;
  letter-spacing: 0.005em;
  color: inherit;
}

/* Intro links: subtle, elegant, clearly clickable */
.hero-text a {
  color: var(--accent-soft);
  text-decoration: underline;
  text-underline-offset: 0.16em;
  text-decoration-thickness: 1px;
  transition: color 0.2s ease, text-decoration-color 0.2s ease;
}

.hero-text a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

.profile-panel {
  background: var(--surface);
  border: 1px solid color-mix(in srgb, var(--line) 88%, #000000 12%);
  border-radius: 14px;
  width: min(100%, 352px);
  justify-self: end;
  align-self: start;
  margin-top: 7rem;
  padding: 0.76rem 1.04rem 0.82rem 0.84rem;
  box-shadow: 0 10px 20px rgba(0, 0, 0, 0.28);
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  align-items: center;
  gap: 0.74rem;
}

.profile-media {
  width: 100%;
  display: flex;
  justify-content: center;
  align-items: center;
  border-radius: 0;
  padding: 0;
  background: transparent;
}

.profile-placeholder {
  min-height: 320px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: var(--surface-2);
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.95rem;
}

.profile-image {
  width: min(100%, 332px);
  aspect-ratio: 4 / 5;
  max-height: 500px;
  border-radius: 10px;
  border: 1px solid var(--line);
  object-fit: cover;
  object-position: center;
  background: var(--surface-2);
  display: block;
  transform: translateX(2px);
}

.profile-links {
  margin-top: 0.42rem;
  display: flex;
  gap: 0.82rem;
  flex-wrap: wrap;
  justify-content: center;
}

.icon-link {
  width: 40px;
  height: 40px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface-2) 84%, var(--bg));
  color: var(--muted);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: border-color 0.24s ease, color 0.24s ease, transform 0.24s ease, background-color 0.24s ease, box-shadow 0.24s ease;
}

.icon-link:hover {
  color: var(--text);
  border-color: color-mix(in srgb, var(--accent) 55%, var(--line));
  background: color-mix(in srgb, var(--surface-2) 62%, var(--accent) 8%);
  box-shadow: 0 6px 14px rgba(0, 0, 0, 0.2);
  transform: translateY(-1.5px);
}

.icon-link:focus-visible {
  outline: 2px solid color-mix(in srgb, var(--accent) 60%, #ffffff 10%);
  outline-offset: 2px;
}

.icon-svg {
  width: 19px;
  height: 19px;
  display: block;
  vector-effect: non-scaling-stroke;
}

.icon-stroke {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.icon-fill {
  fill: currentColor;
  stroke: none;
}

.section {
  margin-top: 1.1rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 1.95rem;
}

.section h2 {
  font-size: 1.35rem;
  margin-bottom: 0.9rem;
}

.section p,
.section li {
  color: var(--muted);
}

p strong,
li strong {
  color: var(--text-strong);
  font-weight: 600;
}

.section-intro {
  margin-bottom: 1rem;
  max-width: 760px;
}

.card-grid,
.education-grid,
.skills-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.card,
.edu-card,
.skills-card,
.timeline-item,
.pub-card {
  background: var(--surface-2);
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 1.15rem;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.card:hover,
.edu-card:hover,
.skills-card:hover,
.timeline-item:hover,
.pub-card:hover {
  transform: translateY(-2px);
  border-color: color-mix(in srgb, var(--accent) 35%, var(--line));
}

.pub-card + .pub-card {
  margin-top: 0.8rem;
}

.card-image {
  aspect-ratio: 16 / 9;
  border-radius: 8px;
  border: 1px dashed var(--line);
  background: color-mix(in srgb, var(--surface-2) 82%, var(--bg));
  display: grid;
  place-items: center;
  color: var(--muted);
  font-size: 0.9rem;
  margin-bottom: 0.9rem;
}


.card-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  display: block;
}

.card h3,
.edu-card h3,
.skills-card h3,
.timeline-item h3 {
  font-size: 1rem;
  margin-bottom: 0.55rem;
}

.card p + p {
  margin-top: 0.5rem;
}

.card .project-description {
  text-align: justify;
  text-justify: inter-word;
  line-height: 1.66;
  margin-bottom: 0.6rem;
  hyphens: auto;
}

.project-status {
  margin-bottom: 0.4rem;
  color: var(--text-strong);
  font-size: 0.92rem;
  letter-spacing: 0.01em;
}

.skills-card ul {
  margin-left: 1rem;
}

.card-link,
.contact-card a {
  color: var(--accent-soft);
  text-decoration: none;
}

.card-link {
  display: inline-block;
  margin-top: 0.75rem;
  font-weight: 600;
}

.site-footer {
  text-align: center;
  color: var(--muted);
  padding: 2rem 1rem;
}

.back-to-top {
  position: fixed;
  right: 1rem;
  bottom: 1rem;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
}

.back-to-top.show {
  opacity: 1;
  pointer-events: auto;
}

@media (max-width: 960px) {
  .nav-wrap {
    flex-wrap: wrap;
    padding: 0.7rem 0;
  }

  .hero {
    padding-top: 4.9rem;
  }

  .hero-grid,
  .card-grid,
  .education-grid,
  .skills-grid {
    grid-template-columns: 1fr;
  }

  .profile-placeholder {
    min-height: 250px;
  }

  .profile-panel {
    max-width: 352px;
    margin: 0 auto;
    margin-top: 0;
    padding: 0.84rem 1.15rem 0.84rem 0.84rem;
  }

  .profile-image {
    width: min(100%, 312px);
    max-height: 460px;
  }

  .card .project-description {
    line-height: 1.72;
  }

  .section {
    padding: 1.35rem;
  }
}

.project-page {
  padding: 5.4rem 0 2rem;
}

.back-link {
  display: inline-block;
  margin-bottom: 1rem;
  color: var(--accent-soft);
  text-decoration: none;
}

.project-page h1 {
  font-size: clamp(1.5rem, 3vw, 2.1rem);
  line-height: 1.3;
  margin-bottom: 0.8rem;
}

.project-overview {
  margin-bottom: 1rem;
  color: var(--text-strong);
}

.project-page h2 {
  margin-top: 1.25rem;
  margin-bottom: 0.5rem;
  font-size: 1.06rem;
}

.project-page ul,
.project-page ol {
  margin-left: 1.15rem;
}

.media-placeholder {
  min-height: 180px;
  border-radius: 10px;
  border: 1px dashed var(--line);
  background: color-mix(in srgb, var(--surface-2) 82%, var(--bg));
  color: var(--muted);
  display: grid;
  place-items: center;
  padding: 1rem;
  text-align: center;
}
