/*!
 * Personal academic site — charcoal dark + light mode
 */

/* ========================= */
/* DARK THEME (default)      */
/* ========================= */

:root,
html[data-theme="dark"] {
  color-scheme: dark;

  --bg-0: #0f1419;
  --bg-1: #151c23;
  --bg-2: #1b242c;
  --card-bg: #1f2933;
  --header-bg-start: #263340;
  --header-bg-end: #1f2933;
  --card-border: #344452;
  --primary-text: #e8eef3;
  --secondary-text: #b8c5d0;
  --tertiary-text: #8fa3b3;
  --accent: #5ec4b0;
  --accent-hover: #7ed9c8;
  --accent-muted: rgba(94, 196, 176, 0.18);
  --social-bg: #2a3844;
  --btn-bg: #3d6b62;
  --btn-bg-hover: #4d8579;
  --shadow: rgba(0, 0, 0, 0.35);
  --header-inset: rgba(255, 255, 255, 0.04);
  --header-overlay: linear-gradient(
    135deg,
    rgba(8, 18, 22, 0.9) 0%,
    rgba(12, 32, 28, 0.82) 45%,
    rgba(10, 16, 26, 0.92) 100%
  );
}

/* ========================= */
/* LIGHT THEME               */
/* ========================= */

html[data-theme="light"] {
  color-scheme: light;

  --bg-0: #eef2f5;
  --bg-1: #e4eaef;
  --bg-2: #d8e1e8;
  --card-bg: #ffffff;
  --header-bg-start: #dce8ee;
  --header-bg-end: #f5f8fa;
  --card-border: #c5d3dc;
  --primary-text: #1a2832;
  --secondary-text: #3d4f5c;
  --tertiary-text: #5c7080;
  --accent: #2a7a6d;
  --accent-hover: #1f6358;
  --accent-muted: rgba(42, 122, 109, 0.12);
  --social-bg: #c5d8e0;
  --btn-bg: #2a7a6d;
  --btn-bg-hover: #1f6358;
  --shadow: rgba(26, 40, 50, 0.12);
  --header-inset: rgba(255, 255, 255, 0.6);
  --header-overlay: linear-gradient(
    135deg,
    rgba(236, 244, 248, 0.9) 0%,
    rgba(220, 235, 230, 0.85) 50%,
    rgba(232, 240, 245, 0.92) 100%
  );
}

/* ========================= */
/* BODY                      */
/* ========================= */

body {
  font-family: "Lato", "Roboto", sans-serif;
  font-size: 16.5px;
  line-height: 1.65;
  color: var(--primary-text);
  padding-top: 20px;
  background: linear-gradient(
    180deg,
    var(--bg-0) 0%,
    var(--bg-1) 45%,
    var(--bg-2) 100%
  );
  min-height: 100vh;
  transition: background 0.35s ease, color 0.25s ease;
}

h1, h2, h3, h4, h5, h6 {
  color: var(--primary-text);
}

p {
  color: var(--primary-text);
}

a {
  color: var(--accent);
  transition: color 0.25s ease-in-out;
}

a:hover {
  color: var(--accent-hover);
}

/* ========================= */
/* HEADER                    */
/* ========================= */

.header {
  position: relative;
  margin: 16px 16px 30px 16px;
  padding: 22px 30px;
  border-radius: 14px;
  border: 1px solid var(--card-border);
  box-shadow:
    0 0 0 1px var(--header-inset) inset,
    0 6px 18px var(--shadow),
    0 1px 0 var(--header-inset);
  background-color: var(--header-bg-end);
  background-image: var(--header-overlay), url('../images/header-nature.jpg');
  background-size: cover;
  background-position: center 40%;
  background-repeat: no-repeat;
  overflow: hidden;
  transition: border-color 0.35s ease, box-shadow 0.35s ease;
}

.header .container {
  position: relative;
  z-index: 1;
  padding-left: 30px;
  padding-right: 30px;
}

.header .profile-image {
  border: 3px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.35);
}

html[data-theme="light"] .header .profile-image {
  border-color: rgba(255, 255, 255, 0.65);
  box-shadow: 0 4px 12px rgba(26, 40, 50, 0.15);
}

.header .row {
  display: flex;
  align-items: center;
}

.header .col {
  display: flex;
  align-items: center;
}

.header .profile-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-left: 20px;
}

.header .profile-content .name {
  color: var(--primary-text);
  font-size: 34px;
  margin-bottom: 2px;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.45);
}

html[data-theme="light"] .header .profile-content .name {
  text-shadow: 0 1px 2px rgba(255, 255, 255, 0.8);
}

.header .profile-content .desc {
  color: var(--secondary-text);
  font-size: 20px;
  margin-bottom: 8px;
}

.header .profile-content .note {
  color: var(--tertiary-text);
  font-size: 13px;
}

.header .profile-content .social a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: var(--social-bg);
  color: var(--primary-text);
  font-size: 1.15rem;
  text-decoration: none;
  transition: background 0.25s ease, color 0.25s ease;
}

.header .profile-content .social a i {
  font-size: 1.15rem;
  line-height: 1;
}

.header .profile-content .social a .fa-linkedin-in,
.header .profile-content .social a .fa-orcid {
  font-size: 1.25rem;
}

.header .profile-content .social a:hover {
  background: var(--accent);
  color: #fff;
}

.header-nav ul {
  list-style: none;
  padding: 0;
  margin: 0 0 10px 0;
  text-align: right;
}

.header-nav li {
  display: inline-block;
  margin-left: 12px;
}

.header-nav a {
  font-weight: 500;
}

.header-actions {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  gap: 10px;
}

/* Theme toggle */
.theme-toggle-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--card-border);
  background: var(--card-bg);
  color: var(--primary-text);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.25s ease, border-color 0.25s ease, color 0.25s ease;
}

.theme-toggle-btn:hover {
  background: var(--accent-muted);
  border-color: var(--accent);
  color: var(--accent);
}

.theme-toggle-btn i {
  font-size: 0.95em;
}

.btn-cta-primary {
  background: var(--btn-bg);
  border: none;
  color: #fff;
  font-weight: 600;
}

.btn-cta-primary:hover {
  background: var(--btn-bg-hover);
  color: #fff;
}

/* ========================= */
/* TOP ROW: ABOUT + EDU      */
/* ========================= */

.top-intro-row {
  margin-bottom: 20px;
}

.top-intro-row .about-col {
  margin-bottom: 15px;
}

/* Slightly larger type for About + Education (readability in light/dark) */
.top-intro-row .section .heading {
  font-size: 1.725rem;
}

.top-intro-row .about .content p,
.top-intro-row .about .content li {
  font-size: 17px;
  line-height: 1.68;
  color: var(--primary-text);
}

.top-intro-row .education-sidebar .heading {
  font-size: 1.625rem;
}

.top-intro-row .education-sidebar .item .title {
  font-size: 17px;
  font-family: "Montserrat", sans-serif;
  font-weight: 800;
  line-height: 1.45;
}

.top-intro-row .education-sidebar .item .university {
  font-size: 14.5px;
  line-height: 1.5;
  color: var(--secondary-text);
}

.education-sidebar .item {
  margin-bottom: 14px;
}

.education-sidebar .item:last-child {
  margin-bottom: 0;
}

.education-sidebar .item .title {
  font-size: 16px;
  font-family: "Montserrat", sans-serif;
  font-weight: 800;
  line-height: 1.4;
}

.education-sidebar .item .title .education-honor {
  font-family: "Lato", "Roboto", sans-serif;
  font-weight: 400;
}

.education-sidebar .item .university {
  font-size: 13.5px;
  color: var(--secondary-text);
  line-height: 1.45;
  margin-top: 4px;
}

.education-sidebar .heading {
  font-size: 1.25rem;
  margin-bottom: 12px;
}

/* ========================= */
/* SECTION CARDS             */
/* ========================= */

.section {
  margin-bottom: 15px;
}

#news.section,
#publications.section {
  margin-top: 20px;
}

.section .section-inner {
  background: var(--card-bg);
  border: 1px solid var(--card-border);
  padding: 20px;
  border-radius: 12px;
  transition: background 0.35s ease, border-color 0.35s ease;
}

.section .heading {
  font-size: 1.625rem;
  font-weight: 700;
  margin-bottom: 14px;
  padding-bottom: 8px;
  border-bottom: 2px solid var(--accent-muted);
}

.projects .project-title {
  font-size: 18px;
  font-weight: 600;
  color: var(--primary-text);
  margin-bottom: 10px;
  margin-top: 5px;
  letter-spacing: 0.2px;
}

/* ========================= */
/* NEWS                      */
/* ========================= */

.news-list {
  list-style: none;
  padding: 0;
  margin: 0;
}

.news-list li {
  padding: 12px 0;
  border-bottom: 1px solid var(--card-border);
  line-height: 1.6;
}

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

.news-list li:first-child {
  padding-top: 0;
}

.news-date {
  font-weight: 700;
  color: var(--accent);
  white-space: nowrap;
}

/* ========================= */
/* EXPERIENCE / EDUCATION    */
/* ========================= */

.experience .item .title,
.education .item .title {
  font-size: 17px;
  font-weight: 600;
  color: var(--primary-text);
}

.education .item .university,
.experience .item .title .year {
  font-size: 14.5px;
  color: var(--secondary-text);
}

.experience .appointment-heading {
  font-size: 17px;
  font-weight: 900;
}

.experience .appointment-heading::before {
  content: "\2022";
  color: var(--accent);
  margin-right: 8px;
}

.experience .item .university {
  font-size: 13.5px;
}

.about .content p,
.desc p {
  font-size: 16px;
  line-height: 1.6;
}

/* ========================= */
/* PROJECTS — 50% image | 50% text */
/* ========================= */

#projects .project-row {
  margin-bottom: 2rem;
  padding-bottom: 2rem;
  border-bottom: 1px solid var(--card-border);
}

#projects .project-row:last-child {
  margin-bottom: 0;
  padding-bottom: 0;
  border-bottom: none;
}

#projects .project-body {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 1.25rem;
  width: 100%;
}

/* Wrapper has no box — border hugs the image only */
#projects .project-image-wrap {
  flex: 0 0 50%;
  width: 50%;
  max-width: 50%;
  padding: 0;
  margin: 0;
  border: none;
  background: none;
  line-height: 0;
}

#projects .project-image {
  display: block;
  width: 100%;
  height: auto;
  margin: 0;
  border-radius: 8px;
  border: 1px solid var(--card-border);
  background: var(--bg-0);
  box-sizing: border-box;
}

#projects .project-desc-col {
  flex: 0 0 50%;
  width: 50%;
  max-width: 50%;
  display: flex;
  align-items: center;
}

#projects .project-desc-col .desc {
  width: 100%;
}

#projects .project-desc-col .desc p {
  margin: 0;
  line-height: 1.6;
}

@media (max-width: 767.98px) {
  #projects .project-body {
    flex-direction: column;
    align-items: stretch;
  }

  #projects .project-image-wrap,
  #projects .project-desc-col {
    flex: 0 0 100%;
    width: 100%;
    max-width: 100%;
  }

}

/* ========================= */
/* PAPERS                    */
/* ========================= */

.paper-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--primary-text);
}

.paper-authors {
  font-size: 14.5px;
  color: var(--secondary-text);
  display: block;
}

.paper-venue {
  font-size: 14px;
  color: var(--tertiary-text);
  display: block;
}

.me {
  color: var(--accent);
  font-weight: 600;
}

.paper {
  margin-bottom: 1rem;
}

.pub-subheading {
  font-size: 1.05rem;
  font-weight: 700;
  margin: 1.25rem 0 0.75rem;
  color: var(--primary-text);
  border-bottom: 1px solid var(--accent-muted);
  padding-bottom: 4px;
}

.service-list {
  list-style: none;
  padding: 0;
  margin: 0 0 0.5rem 0;
}

.service-list li {
  font-size: 14.5px;
  line-height: 1.55;
  padding: 4px 0 4px 1rem;
  position: relative;
  color: var(--primary-text);
}

.service-list li::before {
  content: "•";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* CV-style awards & service */
.cv-block {
  margin-top: 0;
}

.cv-entry {
  display: flex;
  gap: 10px;
  margin-bottom: 14px;
  align-items: flex-start;
}

.cv-icon {
  color: var(--accent);
  margin-top: 3px;
  flex-shrink: 0;
}

.cv-entry-body {
  flex: 1;
  min-width: 0;
}

.cv-entry-line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.cv-entry-line strong {
  font-weight: 600;
  color: var(--primary-text);
}

.cv-year,
.cv-year-inline {
  color: var(--secondary-text);
  font-weight: 500;
  white-space: nowrap;
}

.cv-sub {
  font-size: 13.5px;
  color: var(--secondary-text);
  font-style: italic;
  margin-top: 3px;
  padding-left: 0;
}

.cv-subheading {
  font-size: 1rem;
  font-weight: 700;
  margin: 1.25rem 0 0.5rem;
  color: var(--primary-text);
}

.cv-subheading:first-child {
  margin-top: 0;
}

.cv-enum {
  margin: 0 0 0.5rem 0;
  padding-left: 1.35rem;
}

.cv-enum li {
  font-size: 14.5px;
  line-height: 1.55;
  margin-bottom: 6px;
  color: var(--primary-text);
}

/* ========================= */
/* ICONS                     */
/* ========================= */

.svg-inline--fa {
  color: var(--accent);
}

.list ul li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  line-height: 1.6;
  color: var(--primary-text);
}

.list ul li .svg-inline--fa {
  margin-right: 0;
  margin-top: 2px;
  font-size: 0.9em;
}

/* ========================= */
/* FOOTER                    */
/* ========================= */

.footer {
  background: var(--card-bg);
  border-top: 1px solid var(--card-border);
  color: var(--secondary-text);
  margin-top: 20px;
  transition: background 0.35s ease;
}

.footer a {
  color: var(--accent);
}

/* ========================= */
/* MOBILE                    */
/* ========================= */

@media (max-width: 991.98px) {
  .top-intro-row .education-sidebar .item .title {
    font-size: 16.5px;
  }

  .top-intro-row .education-sidebar .item .university {
    font-size: 15px;
  }

  .education-sidebar .item .title {
    font-size: 16px;
  }

  .education-sidebar .item .university {
    font-size: 14px;
  }
}

@media (max-width: 767.98px) {
  .header {
    text-align: center;
  }

  .header .col {
    flex-direction: column;
  }

  .header .profile-content {
    margin-left: 0;
    margin-top: 12px;
    align-items: center;
  }

  .header-actions {
    align-items: center;
    width: 100%;
  }

  .header-nav ul {
    text-align: center;
  }

  .header-nav li {
    margin: 4px 8px;
  }

  .project-image-wrap {
    margin-bottom: 14px;
    padding-right: 0;
  }

  .project-desc-col {
    padding-left: 0;
  }
}
