:root {
  --brand: #24527a;
  --brand-dark: #173b59;
  --accent: #3aa6a0;
  --surface: #ffffff;
  --surface-soft: #f4f7fa;
  --text: #263238;
  --muted: #60727d;
  --border: #dbe4ea;
  --shadow: 0 10px 30px rgba(25, 55, 75, .10);
}

html { scroll-behavior: smooth; }
body { background: var(--surface-soft); color: var(--text); }
a { color: var(--brand); }
a:focus-visible, button:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }

.skip-link {
  position: fixed; left: 1rem; top: -5rem; z-index: 1000;
  padding: .7rem 1rem; background: #fff; color: #111; border-radius: .4rem;
}
.skip-link:focus { top: 1rem; }

.site-header {
  position: sticky; top: 0; z-index: 100;
  min-height: 64px; display: flex; align-items: center; gap: 1rem;
  padding: .65rem max(1rem, calc((100vw - 1170px) / 2));
  background: rgba(255,255,255,.96); border-bottom: 1px solid var(--border);
  box-shadow: 0 3px 16px rgba(20,45,65,.06); backdrop-filter: blur(12px);
}
.site-brand {
  flex: 0 0 46px; width: 46px; height: 46px;
  display: grid; place-items: center; text-decoration: none;
  border-radius: 14px; transition: transform .2s ease, filter .2s ease;
}
.site-brand img { display: block; width: 46px; height: 46px; }
.site-brand:hover { transform: translateY(-1px) scale(1.03); filter: drop-shadow(0 5px 8px rgba(20, 90, 125, .24)); }
.site-nav { display: flex; flex: 1; gap: .25rem; }
.site-nav a {
  padding: .55rem .65rem; border-radius: .45rem; color: var(--text);
  font-weight: 600; text-decoration: none;
}
.site-nav a:hover, .site-nav a.active { background: var(--surface-soft); color: var(--brand); }
.header-actions { display: flex; gap: .35rem; }
.icon-button, .nav-toggle, .back-to-top {
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  border-radius: .5rem; cursor: pointer;
}
.icon-button, .nav-toggle { width: 42px; height: 42px; }
.nav-toggle { display: none; }

.wrapper { margin-top: 28px; box-shadow: var(--shadow); }
.main-wrapper { background: var(--surface); }
.sidebar-wrapper { background: var(--brand); }
.sidebar-wrapper .profile-container { background: var(--brand-dark); }
.sidebar-wrapper .tagline { max-width: 235px; margin-left: auto; margin-right: auto; font-size: .92rem; line-height: 1.42; color: rgba(255,255,255,.82); }
.sidebar-wrapper a { color: #fff; }
.sidebar-wrapper .container-block-title { color: #fff; }
.sidebar-wrapper .education-container .item, .sidebar-wrapper .interests-container .item { margin-bottom: 1rem; }

.hero {
  padding: 1.5rem; margin-bottom: 2rem; border-radius: .8rem;
  background: linear-gradient(135deg, var(--brand-dark), var(--brand));
  color: #fff; box-shadow: var(--shadow);
}
.hero h1 { margin-top: 0; font-size: clamp(2rem, 5vw, 3.2rem); color: #fff; }
.hero p { font-size: 1.08rem; max-width: 760px; opacity: .94; }
.hero-actions { display: flex; flex-wrap: wrap; gap: .7rem; margin-top: 1.25rem; }
.button-link {
  display: inline-flex; align-items: center; gap: .45rem; padding: .7rem 1rem;
  border-radius: .5rem; background: #fff; color: var(--brand-dark);
  font-weight: 700; text-decoration: none;
}
.button-link.secondary { background: transparent; color: #fff; border: 1px solid rgba(255,255,255,.65); }

.card-grid { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); gap: 1rem; }
.content-card {
  padding: 1.2rem; border: 1px solid var(--border); border-radius: .75rem;
  background: var(--surface); box-shadow: 0 5px 20px rgba(20,45,65,.05);
}
.content-card h3 { margin-top: 0; color: var(--brand-dark); }
.tag-list { display: flex; flex-wrap: wrap; gap: .45rem; margin: .75rem 0; }
.tag { padding: .28rem .6rem; border-radius: 2rem; background: var(--surface-soft); color: var(--brand-dark); font-size: .86rem; font-weight: 700; }
.page-intro { margin-bottom: 2rem; font-size: 1.05rem; color: var(--muted); }
.filter-bar { display: flex; flex-wrap: wrap; gap: .5rem; margin: 1rem 0 1.5rem; }
.filter-button {
  padding: .45rem .8rem; border: 1px solid var(--border); border-radius: 2rem;
  background: var(--surface); color: var(--text); cursor: pointer;
}
.filter-button.active { background: var(--brand); color: #fff; border-color: var(--brand); }
.details-toggle { border: 0; background: none; color: var(--brand); font-weight: 700; padding: .25rem 0; cursor: pointer; }
.collapsible[hidden] { display: none; }

.back-to-top {
  position: fixed; right: 1.2rem; bottom: 1.2rem; width: 44px; height: 44px;
  opacity: 0; pointer-events: none; transition: .2s;
  box-shadow: var(--shadow);
}
.back-to-top.visible { opacity: 1; pointer-events: auto; }

body.dark {
  --surface: #14212a; --surface-soft: #0e1820; --text: #e7eef2;
  --muted: #afbec7; --border: #2b3d48; --brand: #58b8df; --brand-dark: #1d536d;
  --shadow: 0 10px 30px rgba(0,0,0,.28);
}
body.dark .site-header { background: rgba(14,24,32,.96); }
body.dark .main-wrapper, body.dark .content-card { color: var(--text); }
body.dark .section-title, body.dark .job-title, body.dark .degree { color: var(--text); }
body.dark .level-bar { background: #30424d; }

/* Clear, high-contrast section icons */
.main-wrapper .section-title {
  display: flex;
  align-items: center;
  gap: .75rem;
  line-height: 1.22;
  text-wrap: balance;
}
.section-title .fa-stack,
.section-title .section-icon {
  position: relative;
  flex: 0 0 2.65rem;
  width: 2.65rem;
  height: 2.65rem;
  display: inline-grid;
  place-items: center;
  border-radius: .72rem;
  overflow: hidden;
  color: #fff;
  background: linear-gradient(145deg, #287ca8, #3aa6a0);
  box-shadow: 0 5px 14px rgba(36, 82, 122, .22);
  font-size: 1rem;
  line-height: 1;
}
.section-title .fa-stack .fa-circle { display: none !important; }
.section-title .fa-stack .fa-stack-1x {
  position: static;
  width: auto;
  line-height: 1;
  color: #fff;
  transform: none;
  text-align: center;
}
.section-title .section-icon i { color: #fff; font-size: 1.42rem; line-height: 1; }
body.dark .section-title .fa-stack,
body.dark .section-title .section-icon {
  background: linear-gradient(145deg, #58b8df, #278f91);
  box-shadow: 0 5px 16px rgba(0, 0, 0, .35);
}

@media (max-width: 820px) {
  .site-header { flex-wrap: wrap; }
  .nav-toggle { display: inline-block; }
  .site-nav { display: none; order: 4; flex: 0 0 100%; flex-direction: column; padding-bottom: .5rem; }
  .site-nav.open { display: flex; }
  .header-actions { margin-left: auto; }
  .card-grid { grid-template-columns: 1fr; }
  .wrapper { margin-top: 14px; }
  .main-wrapper .section-title { align-items: center; font-size: 1.55rem; gap: .8rem; }
  .section-title .fa-stack, .section-title .section-icon { flex-basis: 3rem; width: 3rem; height: 3rem; border-radius: .8rem; font-size: 1.12rem; }
  .section-title .section-icon i { font-size: 1.58rem; }
}
@media (max-width: 480px) {
  .main-wrapper { padding-left: 22px; padding-right: 22px; }
  .main-wrapper .section-title { font-size: 1.38rem; line-height: 1.18; gap: .68rem; }
  .section-title .section-icon { flex-basis: 2.85rem; width: 2.85rem; height: 2.85rem; }
  .section-title .section-icon i { font-size: 1.52rem; }
  .summary { font-size: 1rem; line-height: 1.65; }
}
@media print {
  body { background: #fff !important; color: #000 !important; }
  .wrapper { box-shadow: none; margin: 0; }
  .main-wrapper { padding-top: 0; }
  .content-card { break-inside: avoid; box-shadow: none; }
}


.profile-hero { display: grid; grid-template-columns: minmax(190px, 280px) 1fr; gap: 1.4rem; align-items: stretch; margin-bottom: 2rem; }
.profile-hero .hero { margin-bottom: 0; border-radius: .8rem .8rem 0 0; }
.profile-portrait { width: 100%; height: 100%; min-height: 370px; object-fit: cover; object-position: center 25%; border-radius: .8rem; box-shadow: var(--shadow); }
.profile-hero-content { display: flex; flex-direction: column; }
.social-links { display: flex; flex-wrap: wrap; gap: .55rem; padding: .9rem 1rem; background: var(--surface); border: 1px solid var(--border); border-radius: 0 0 .8rem .8rem; }
.social-links a { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .7rem; border-radius: 2rem; background: var(--surface-soft); font-weight: 700; text-decoration: none; }
.research-feature { display: grid; grid-template-columns: minmax(220px, 290px) 1fr; gap: 1.5rem; align-items: stretch; margin: 0 0 2rem; }
.research-cover { width: 100%; margin: 0; display: flex; flex-direction: column; }
.research-cover img { width: 100%; border-radius: .75rem; box-shadow: var(--shadow); }
.research-hero { margin: 0; min-height: 100%; display: flex; flex-direction: column; justify-content: center; }
.research-hero h2 { margin-top: 0; color: #fff; font-size: clamp(2rem, 4vw, 3rem); }
.research-cover figcaption, .visual-note { margin-top: .55rem; color: var(--muted); font-size: .9rem; }
.visual-strip { display: grid; grid-template-columns: 1fr 1fr; gap: 1rem; margin: 1rem 0 .5rem; }
.visual-strip img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: .75rem; box-shadow: var(--shadow); }
@media (max-width: 700px) { .profile-hero, .research-feature { grid-template-columns: 1fr; } .profile-portrait { height: 420px; min-height: 0; } .research-cover { max-width: 340px; margin: 0 auto; } .visual-strip { grid-template-columns: 1fr; } }
@media print { .profile-portrait { max-height: 250px; min-height: 0; } .research-cover, .visual-strip { display: none; } }


/* Competency-based skills */
.competency-intro { color: var(--muted); margin-bottom: 1.2rem; }
.competency-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.competency-card { padding: 1.2rem; border: 1px solid var(--border); border-radius: .75rem; background: var(--surface); box-shadow: 0 5px 20px rgba(20,45,65,.05); }
.competency-card h3 { margin: 0 0 1rem; color: var(--brand-dark); font-size: 1.12rem; }
.competency-card h3 i { color: var(--accent); margin-right: .35rem; }
.competency-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: .55rem; list-style: none; margin: 0; padding: 0; }
.competency-list li { position: relative; padding: .55rem .65rem .55rem 1.55rem; border: 1px solid var(--border); border-radius: .55rem; background: var(--surface-soft); color: var(--text); font-size: .96rem; line-height: 1.3; }
.competency-list li::before { content: "✓"; position: absolute; left: .58rem; color: var(--accent); font-weight: 800; }
.level-bar { display: none; }

/* Calls to action */
.opportunity-cta, .contact-hero { display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; padding: 1.5rem; margin: 2rem 0; border-radius: .8rem; color: #fff; background: linear-gradient(135deg, var(--brand-dark), #2d7998); box-shadow: var(--shadow); }
.opportunity-cta h2, .contact-hero h1 { color: #fff; margin-top: .2rem; }
.opportunity-cta p, .contact-hero p { max-width: 760px; }
.cv-download-dark { background: var(--brand); color: #fff; }
.nav-contact { background: var(--brand) !important; color: #fff !important; }

/* Photo slideshow */
.slideshow { position: relative; overflow: hidden; min-height: 500px; border-radius: .8rem; background: #0c1720; box-shadow: var(--shadow); }
.slide { display: none; margin: 0; height: 500px; }
.slide.active { display: block; animation: slideFade .45s ease; }
.slide img { width: 100%; height: 100%; object-fit: cover; object-position: center; }
.slide figcaption { position: absolute; left: 0; right: 0; bottom: 0; padding: 2.5rem 1.2rem 1rem; color: #fff; background: linear-gradient(transparent, rgba(0,0,0,.8)); }
.slide-control { position: absolute; top: 50%; transform: translateY(-50%); z-index: 3; width: 44px; height: 44px; border: 0; border-radius: 50%; background: rgba(255,255,255,.88); color: #173b59; cursor: pointer; }
.slide-control.previous { left: 1rem; }
.slide-control.next { right: 1rem; }
.slide-dots { position: absolute; z-index: 4; left: 50%; bottom: .7rem; transform: translateX(-50%); display: flex; gap: .4rem; }
.slide-dot { width: 9px; height: 9px; border: 0; padding: 0; border-radius: 50%; background: rgba(255,255,255,.55); cursor: pointer; }
.slide-dot.active { background: #fff; transform: scale(1.25); }
@keyframes slideFade { from { opacity: .25; } to { opacity: 1; } }

/* Contact and footer */
.contact-hero { display: block; }
.contact-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem; }
.contact-card { display: flex; align-items: center; gap: 1rem; padding: 1.2rem; border: 1px solid var(--border); border-radius: .75rem; background: var(--surface); color: var(--text); text-decoration: none; transition: transform .2s ease, box-shadow .2s ease; }
.contact-card:hover { transform: translateY(-3px); box-shadow: var(--shadow); text-decoration: none; }
.contact-card > i { width: 42px; color: var(--brand); font-size: 1.7rem; text-align: center; }
.contact-card span { display: flex; flex-direction: column; min-width: 0; }
.contact-card small { color: var(--muted); overflow-wrap: anywhere; }
.contact-note { padding: 1.3rem; border-radius: .75rem; background: var(--surface-soft); }
.project-status { margin-top: .75rem; color: var(--muted); font-size: .9rem; }
.footer { padding: 2rem max(1rem, calc((100vw - 1170px) / 2)); background: #0d1b24; color: #dbe8ef; }
.footer-inner { display: flex; justify-content: space-between; gap: 2rem; text-align: left; }
.footer-inner p { margin: .35rem 0 0; color: #a9bcc7; }
.footer-links { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: .65rem 1rem; }
.footer-links a { color: #fff; }
.footer-bottom { margin-top: 1.3rem; padding-top: 1rem; border-top: 1px solid #29404e; color: #91a8b4; text-align: left; }

.content-card, .competency-card { transition: transform .2s ease, box-shadow .2s ease; }
.content-card:hover, .competency-card:hover { transform: translateY(-2px); box-shadow: var(--shadow); }
.tag { font-weight: 600; font-size: .9rem; opacity: .95; }

@media (max-width: 760px) {
  .competency-grid, .contact-grid { grid-template-columns: 1fr; }
  .competency-list { grid-template-columns: 1fr; }
  .opportunity-cta, .footer-inner { align-items: flex-start; flex-direction: column; }
  .footer-links { justify-content: flex-start; }
  .slideshow, .slide { min-height: 420px; height: 420px; }
}
@media (prefers-reduced-motion: reduce) {
  .slide.active { animation: none; }
  .content-card, .competency-card, .contact-card { transition: none; }
}
@media print {
  .photo-story, .opportunity-cta, .contact-hero { display: none; }
  .competency-grid { display: block; }
  .competency-card { margin-bottom: .7rem; break-inside: avoid; }
}
