:root {
  --bg-color: #f4efe7;
  --surface-color: rgba(255, 250, 244, 0.9);
  --surface-strong: #fffdf9;
  --text-color: #22313f;
  --heading-color: #16202a;
  --muted-text: #5f6f7d;
  --border-color: rgba(34, 49, 63, 0.12);
  --card-shadow: 0 18px 45px rgba(49, 44, 39, 0.12);
  --hero-shadow: 0 20px 50px rgba(16, 30, 45, 0.16);
  --primary-color: #0f766e;
  --primary-hover: #0b5d57;
  --accent-color: #d97706;
  --accent-soft: rgba(217, 119, 6, 0.12);
  --link-color: #0f766e;
  --nav-bg: rgba(244, 239, 231, 0.9);
  --section-width: min(1120px, calc(100% - 2rem));
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

body.dark-mode {
  --bg-color: #111a22;
  --surface-color: rgba(20, 31, 41, 0.92);
  --surface-strong: #16232f;
  --text-color: #edf2f7;
  --heading-color: #f8fafc;
  --muted-text: #9ab0c3;
  --border-color: rgba(226, 232, 240, 0.12);
  --card-shadow: 0 18px 45px rgba(0, 0, 0, 0.3);
  --hero-shadow: 0 22px 56px rgba(0, 0, 0, 0.38);
  --primary-color: #2dd4bf;
  --primary-hover: #18b9a5;
  --accent-color: #f59e0b;
  --accent-soft: rgba(245, 158, 11, 0.16);
  --link-color: #5eead4;
  --nav-bg: rgba(17, 26, 34, 0.92);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  font-family: "Avenir Next", "Segoe UI", sans-serif;
  line-height: 1.65;
  color: var(--text-color);
  background:
    radial-gradient(circle at top left, rgba(217, 119, 6, 0.08), transparent 30%),
    linear-gradient(180deg, rgba(255, 255, 255, 0.5), transparent 22%),
    var(--bg-color);
  transition: background 0.3s ease, color 0.3s ease;
}

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

a {
  color: var(--link-color);
}

button,
input,
iframe {
  font: inherit;
}

h1,
h2,
h3 {
  margin-top: 0;
  color: var(--heading-color);
  line-height: 1.2;
}

p {
  margin-top: 0;
}

.page-shell {
  width: var(--section-width);
  margin: 0 auto;
}

.section-card {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
  backdrop-filter: blur(12px);
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-heading p,
.lede {
  color: var(--muted-text);
  max-width: 62ch;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin-bottom: 0.9rem;
  padding: 0.45rem 0.85rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-color);
  font-size: 0.88rem;
  font-weight: 700;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.btn,
.cv-btn,
#dark-mode-toggle,
.filters button,
.pub-card a,
.download-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.45rem;
  min-height: 44px;
  padding: 0.8rem 1.2rem;
  border: none;
  border-radius: 999px;
  background: var(--primary-color);
  color: #fff;
  text-decoration: none;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
  box-shadow: 0 10px 24px rgba(15, 118, 110, 0.18);
}

.btn:hover,
.cv-btn:hover,
#dark-mode-toggle:hover,
.filters button:hover,
.pub-card a:hover,
.download-btn:hover {
  background: var(--primary-hover);
  transform: translateY(-1px);
}

.btn-secondary {
  background: transparent;
  color: var(--primary-color);
  border: 1px solid var(--border-color);
  box-shadow: none;
}

.btn-secondary:hover {
  background: var(--accent-soft);
}

.navbar {
  position: sticky;
  top: 0;
  z-index: 1000;
  backdrop-filter: blur(16px);
  background: var(--nav-bg);
  border-bottom: 1px solid var(--border-color);
}

.nav-container {
  width: var(--section-width);
  min-height: 78px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.nav-logo {
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.35rem;
  font-weight: 700;
  color: var(--heading-color);
  text-decoration: none;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.nav-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 0.2rem;
  color: var(--text-color);
  text-decoration: none;
  font-size: 0.97rem;
  position: relative;
}

.nav-links a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0.2rem;
  width: 100%;
  height: 2px;
  background: var(--accent-color);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.25s ease;
}

.nav-links a:hover::after,
.nav-links a.active-link::after {
  transform: scaleX(1);
}

.nav-actions {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-left: 0.5rem;
}

#dark-mode-toggle {
  background: transparent;
  color: var(--text-color);
  border: 1px solid var(--border-color);
  box-shadow: none;
}

.hamburger {
  display: none;
  width: 48px;
  height: 48px;
  padding: 0;
  border: 1px solid var(--border-color);
  border-radius: 50%;
  background: var(--surface-strong);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.hamburger span {
  width: 20px;
  height: 2px;
  border-radius: 999px;
  background: var(--text-color);
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.hamburger.active span:nth-child(1) {
  transform: translateY(7px) rotate(45deg);
}

.hamburger.active span:nth-child(2) {
  opacity: 0;
}

.hamburger.active span:nth-child(3) {
  transform: translateY(-7px) rotate(-45deg);
}

.hero {
  width: var(--section-width);
  margin: 2rem auto 1.5rem;
  padding: 2rem;
  display: grid;
  grid-template-columns: minmax(280px, 380px) minmax(0, 1fr);
  gap: 2rem;
  align-items: stretch;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.11), transparent 55%),
    linear-gradient(145deg, rgba(255, 255, 255, 0.85), rgba(255, 249, 243, 0.72));
  border: 1px solid rgba(34, 49, 63, 0.08);
  border-radius: 36px;
  box-shadow: var(--hero-shadow);
}

.hero-image,
.hero-text {
  padding: 1rem;
}

.hero-image {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.profile-img {
  width: min(100%, 300px);
  aspect-ratio: 1;
  object-fit: cover;
  border-radius: 30px;
  border: 4px solid rgba(255, 255, 255, 0.8);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.15);
  opacity: 0;
  transform: scale(0.94);
  animation: zoomIn 1s ease forwards, float 6s ease-in-out infinite 1.1s;
}

.hero-image h1 {
  margin: 1.4rem 0 0.55rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2rem, 3.4vw, 2.8rem);
}

.hero-image p {
  color: var(--muted-text);
  max-width: 26ch;
}

.hero-text {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.fade-slide-in {
  position: relative;
  width: fit-content;
  max-width: 100%;
  margin-bottom: 1rem;
  padding-bottom: 0.65rem;
  font-family: Georgia, "Times New Roman", serif;
  font-size: clamp(2.2rem, 4.5vw, 4rem);
  opacity: 0;
  transform: translateY(20px);
  animation: fadeSlideIn 0.9s ease forwards;
}

.fade-slide-in::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-color), transparent);
  transform: scaleX(0);
  transform-origin: left;
  animation: underlineExpand 1.4s ease 0.55s forwards;
}

.hero-copy {
  font-size: 1.05rem;
  color: var(--muted-text);
  max-width: 58ch;
}

.typewriter {
  min-height: 3.5rem;
  margin: 0.5rem 0 1.5rem;
  font-size: clamp(1.1rem, 2.2vw, 1.45rem);
  font-weight: 600;
  color: var(--heading-color);
  border-right: 3px solid var(--accent-color);
  display: inline-block;
}

.typewriter.finished {
  border-right: none;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.hero-highlights {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 1rem;
}

.highlight-card {
  padding: 1rem;
  background: rgba(255, 255, 255, 0.62);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-md);
}

.highlight-card strong {
  display: block;
  margin-bottom: 0.3rem;
  font-size: 1.45rem;
  color: var(--heading-color);
}

.highlight-card span {
  color: var(--muted-text);
  font-size: 0.95rem;
}

.about,
.cv,
.blog,
.pub-container,
.awards-page,
.cv-page {
  width: var(--section-width);
  margin: 1.5rem auto;
}

.about,
.cv,
.blog,
.awards-page,
.cv-page,
.pub-container {
  padding: 2rem;
}

.about,
.cv,
.blog,
.awards-page,
.cv-page {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
}

.about-grid,
.cv-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(260px, 0.8fr);
  gap: 1.5rem;
}

.info-panel {
  padding: 1.35rem;
  background: var(--surface-strong);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
}

.tag-list,
.timeline-list {
  margin: 1rem 0 0;
  padding: 0;
  list-style: none;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
}

.tag-list li {
  padding: 0.55rem 0.85rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--heading-color);
  font-weight: 600;
}

.timeline-list li {
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--border-color);
}

.timeline-list li:last-child {
  border-bottom: none;
}

.cta-strip {
  width: var(--section-width);
  margin: 1.5rem auto;
  padding: 1.75rem 2rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: linear-gradient(135deg, rgba(15, 118, 110, 0.12), rgba(217, 119, 6, 0.1));
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
}

.cta-strip p {
  margin: 0;
  color: var(--muted-text);
}

.blog-post,
.pub-card,
.award-card,
.gallery-card {
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
  box-shadow: var(--card-shadow);
}

.blog-post {
  padding: 1.4rem;
  margin-bottom: 1rem;
  border-left: 5px solid var(--accent-color);
}

.blog-post:hover,
.pub-card:hover,
.award-card:hover,
.gallery-card:hover {
  transform: translateY(-4px);
}

.blog-post,
.pub-card,
.award-card,
.gallery-card,
.filters button,
.btn,
.cv-btn,
#dark-mode-toggle,
.download-btn {
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.meta {
  color: var(--muted-text);
  font-size: 0.94rem;
}

.pub-container {
  background: var(--surface-color);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: var(--card-shadow);
}

.pub-header {
  margin-bottom: 1.6rem;
  text-align: center;
}

.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  align-items: center;
  justify-content: center;
  margin-bottom: 1.5rem;
}

.search-bar {
  min-height: 46px;
  min-width: min(100%, 260px);
  padding: 0.8rem 1rem;
  color: var(--text-color);
  background: var(--surface-strong);
  border: 1px solid var(--border-color);
  border-radius: 999px;
}

.pub-grid,
.awards-grid,
.gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  gap: 1.2rem;
}

.pub-card {
  padding: 1.4rem;
}

.pub-title {
  font-size: 1.08rem;
  font-weight: 700;
  color: var(--heading-color);
}

.pub-authors,
.pub-year {
  color: var(--muted-text);
}

.pub-card a {
  margin-top: 0.4rem;
}

.awards,
.gallery {
  margin-top: 1.5rem;
}

.award-image {
  position: relative;
  overflow: hidden;
  cursor: pointer;
}

.award-image img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.award-image .overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(15, 23, 42, 0.58);
  color: #fff;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.25s ease;
}

.award-image:hover .overlay {
  opacity: 1;
}

.award-card p {
  margin: 0;
  padding: 1rem;
}

.gallery-card {
  padding: 1.6rem;
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  text-align: left;
  cursor: pointer;
  background:
    linear-gradient(180deg, transparent, rgba(15, 23, 42, 0.72)),
    linear-gradient(135deg, rgba(15, 118, 110, 0.58), rgba(217, 119, 6, 0.3));
  color: #fff;
}

.gallery-card h3,
.gallery-card p {
  color: #fff;
}

.gallery-card p {
  margin: 0;
  opacity: 0.88;
}

.cv-preview {
  min-height: 640px;
  width: 100%;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  background: var(--surface-strong);
}

.modal,
.modalA,
.modalTA {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 1200;
  padding: 2rem 1rem;
  background: rgba(6, 14, 24, 0.74);
}

.modal-content {
  width: min(920px, 100%);
  margin: auto;
  padding: 1.2rem;
  background: var(--surface-strong);
  border-radius: 24px;
  box-shadow: var(--hero-shadow);
  animation: slideDown 0.28s ease;
}

.close,
.closeTA,
.close-award,
.prevTA,
.nextTA {
  color: #fff;
  cursor: pointer;
}

.close {
  color: var(--text-color);
  float: right;
  font-size: 1.9rem;
  font-weight: 700;
}

.modal iframe {
  width: 100%;
  min-height: 70vh;
  border: 0;
  border-radius: 18px;
}

.modal-footer {
  display: flex;
  justify-content: flex-end;
  margin-top: 1rem;
}

.modalTA,
.modalA {
  align-items: center;
  justify-content: center;
}

.modalTA-content,
#award-modal-img {
  max-width: min(92vw, 1100px);
  max-height: 78vh;
  border-radius: 18px;
  box-shadow: var(--hero-shadow);
}

.closeTA,
.close-award {
  position: absolute;
  top: 1rem;
  right: 1.4rem;
  font-size: 2rem;
  font-weight: 700;
}

.prevTA,
.nextTA {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  font-size: 2rem;
  font-weight: 700;
  padding: 0.5rem 0.8rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.prevTA {
  left: 1.25rem;
}

.nextTA {
  right: 1.25rem;
}

#captionTA {
  position: absolute;
  left: 50%;
  bottom: 1.25rem;
  transform: translateX(-50%);
  color: #fff;
  background: rgba(0, 0, 0, 0.28);
  padding: 0.7rem 1rem;
  border-radius: 999px;
}

.animate-on-scroll {
  opacity: 0;
  transform: translateY(35px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.fade-in-up {
  opacity: 1;
  transform: translateY(0);
}

.site-footer {
  width: var(--section-width);
  margin: 2rem auto 2.5rem;
  padding: 1.2rem 0;
  color: var(--muted-text);
  text-align: center;
}

@keyframes zoomIn {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes float {
  0%,
  100% {
    transform: translateY(0);
  }

  50% {
    transform: translateY(-10px);
  }
}

@keyframes underlineExpand {
  to {
    transform: scaleX(1);
  }
}

@keyframes fadeSlideIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes slideDown {
  from {
    opacity: 0;
    transform: translateY(-20px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1024px) {
  .hero,
  .about-grid,
  .cv-grid {
    grid-template-columns: 1fr;
  }

  .hero-highlights {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 860px) {
  .hamburger {
    display: inline-flex;
  }

  .nav-links {
    position: fixed;
    top: 78px;
    right: 1rem;
    left: 1rem;
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 0.5rem;
    padding: 1rem;
    background: var(--surface-strong);
    border: 1px solid var(--border-color);
    border-radius: 24px;
    box-shadow: var(--hero-shadow);
    opacity: 0;
    pointer-events: none;
    transform: translateY(-12px);
    transition: opacity 0.2s ease, transform 0.2s ease;
  }

  .nav-links.active {
    opacity: 1;
    pointer-events: auto;
    transform: translateY(0);
  }

  .nav-links li,
  .nav-actions {
    width: 100%;
  }

  .nav-links a,
  .nav-actions .cv-btn,
  .nav-actions #dark-mode-toggle {
    width: 100%;
    justify-content: center;
  }

  .nav-actions {
    flex-direction: column;
    margin-left: 0;
  }
}

@media (max-width: 768px) {
  .hero,
  .about,
  .cv,
  .blog,
  .pub-container,
  .awards-page,
  .cv-page,
  .cta-strip {
    padding: 1.4rem;
  }

  .hero {
    margin-top: 1rem;
    border-radius: 28px;
  }

  .hero-text,
  .hero-image {
    padding: 0;
  }

  .hero-highlights {
    grid-template-columns: 1fr;
  }

  .section-heading,
  .cta-strip {
    flex-direction: column;
    align-items: flex-start;
  }

  .modal-content {
    padding: 1rem;
  }
}

@media (max-width: 520px) {
  .nav-container {
    min-height: 72px;
  }

  .nav-logo {
    max-width: 220px;
    font-size: 1.1rem;
  }

  .fade-slide-in {
    font-size: 1.95rem;
  }

  .typewriter {
    min-height: 4.2rem;
  }

  .btn,
  .btn-secondary,
  .cv-btn,
  #dark-mode-toggle,
  .download-btn {
    width: 100%;
  }

  .hero-actions,
  .filters {
    flex-direction: column;
    align-items: stretch;
  }

  .search-bar {
    max-width: none;
    width: 100%;
  }

  .prevTA,
  .nextTA {
    font-size: 1.4rem;
  }

  #captionTA {
    width: calc(100% - 2rem);
    text-align: center;
  }
}
