:root {
  --ink: #172431;
  --ink-soft: #445563;
  --ocean: #0b3f59;
  --ocean-deep: #071d30;
  --teal: #0c8794;
  --teal-dark: #086875;
  --sage: #7f9a83;
  --sage-dark: #526b58;
  --paper: #eef4f6;
  --surface: #ffffff;
  --surface-soft: #f7fafb;
  --line: #d5e1e5;
  --muted: #657683;
  --serif: "Source Serif 4", Georgia, "Times New Roman", serif;
  --sans: "Source Sans 3", "Avenir Next", "Segoe UI", Arial, sans-serif;
  --shadow: 0 22px 60px rgba(7, 29, 48, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  background:
    radial-gradient(circle at 8% 8%, rgba(12, 135, 148, 0.08), transparent 26rem),
    var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16.5px;
  font-weight: 500;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

a {
  color: var(--teal-dark);
  font-weight: 600;
  text-decoration: none;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

img {
  max-width: 100%;
}

p,
li,
td,
.contact-card {
  overflow-wrap: anywhere;
}

a:hover {
  color: var(--sage-dark);
  text-decoration: underline;
}

.wrap {
  width: min(100%, 1120px);
  margin: 0 auto;
  padding: 0 30px;
}

.cover {
  position: relative;
  display: grid;
  overflow: hidden;
  min-height: 150px;
  background: var(--ocean-deep);
  color: #fff;
  isolation: isolate;
}

.cover::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 5px;
  background: linear-gradient(90deg, var(--sage) 0 34%, var(--teal) 34% 100%);
  content: "";
}

.cover-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 150px;
  padding-top: 14px;
  padding-bottom: 16px;
}

.cover h1 {
  max-width: 700px;
  margin: 0;
  color: #fff;
  font-family: var(--serif);
  font-size: 36px;
  font-size: clamp(28px, 3.2vw, 36px);
  font-weight: 800;
  letter-spacing: -0.045em;
  line-height: 0.98;
  text-shadow: 0 5px 30px rgba(0, 0, 0, 0.34);
}

.cover-role {
  margin: 7px 0 0;
  color: #f7fafb;
  font-size: 17px;
  font-size: clamp(14px, 1.4vw, 17px);
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.15;
}

.cover-role span {
  margin: 0 8px;
  color: var(--sage);
}

.cover-focus {
  max-width: 650px;
  margin: 5px 0 0;
  color: rgba(232, 247, 249, 0.82);
  font-size: 13.5px;
  font-weight: 500;
  line-height: 1.35;
}

.tabs {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 8px 24px rgba(7, 29, 48, 0.07);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
}

.tabs .wrap {
  display: flex;
  flex-wrap: wrap;
}

.tab {
  min-height: 48px;
  padding: 16px 21px 14px;
  border: 0;
  border-bottom: 3px solid transparent;
  background: transparent;
  color: #526470;
  cursor: pointer;
  font-family: var(--sans);
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.085em;
  text-transform: uppercase;
  touch-action: manipulation;
  transition: color 160ms, background 160ms, border-color 160ms;
}

.tab:hover {
  background: rgba(12, 135, 148, 0.055);
  color: var(--teal-dark);
}

.tab.on {
  border-bottom-color: var(--sage);
  background: var(--surface);
  color: var(--ocean-deep);
  font-weight: 800;
}

main {
  min-height: 58vh;
  padding: 42px 0 68px;
}

.panel {
  padding: 38px 42px 46px;
  border: 1px solid rgba(213, 225, 229, 0.95);
  border-radius: 22px;
  background: var(--surface);
  box-shadow: var(--shadow);
}

.panel[hidden] {
  display: none;
}

h2 {
  position: relative;
  margin: 38px 0 0;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--ocean-deep);
  font-family: var(--serif);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.012em;
}

h2::after {
  position: absolute;
  bottom: -2px;
  left: 0;
  width: 72px;
  height: 3px;
  border-radius: 99px;
  background: linear-gradient(90deg, var(--sage), var(--teal));
  content: "";
}

.panel > h2:first-child,
h2:first-of-type {
  margin-top: 4px;
}

h2.plain {
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--ocean-deep);
  font-size: 31px;
}

h2.plain::after {
  display: none;
}

p {
  margin: 13px 0;
}

.intro {
  max-width: 880px;
  margin: 26px 0 8px;
  color: var(--ink-soft);
  font-size: 17px;
  font-weight: 500;
  line-height: 1.72;
}

ul.list {
  margin: 18px 0;
  padding-left: 0;
  list-style: none;
}

ul.list li {
  position: relative;
  margin-bottom: 11px;
  padding-left: 22px;
}

ul.list li::before {
  position: absolute;
  top: 0.72em;
  left: 1px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sage);
  box-shadow: 0 0 0 4px rgba(127, 154, 131, 0.12);
  content: "";
}

ul.list span.sub {
  display: block;
  margin-top: 2px;
  color: var(--muted);
  font-size: 14px;
}

.quiet {
  color: var(--muted);
  font-size: 13.5px;
}

.profile {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 30px;
  align-items: center;
  margin-bottom: 8px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: linear-gradient(120deg, #f8fbfc, #f2f8f9);
}

.profile-photo {
  display: block;
}

.profile img {
  width: 190px;
  height: 218px;
  padding: 6px;
  border: 1px solid #cbdadd;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 12px 30px rgba(7, 29, 48, 0.12);
  object-fit: cover;
  object-position: 50% 18%;
}

.profile .who .role {
  margin: 4px 0 13px;
  color: var(--sage-dark);
  font-size: 16.5px;
  font-weight: 700;
}

.profile .who p {
  margin: 4px 0;
  font-size: 15.5px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 17px;
}

.links .text-link,
.cv-link {
  display: inline-flex;
  min-height: 44px;
  margin: 0;
  padding: 8px 14px;
  border: 1px solid #b9d0d5;
  border-radius: 999px;
  background: #fff;
  color: var(--teal-dark);
  font-family: var(--sans);
  font-size: 10.5px;
  font-weight: 800;
  letter-spacing: 0.105em;
  text-transform: uppercase;
  align-items: center;
  justify-content: center;
  touch-action: manipulation;
  transition: 160ms;
}

.links .text-link:hover,
.cv-link:hover {
  border-color: var(--ocean);
  background: var(--ocean);
  color: #fff;
  text-decoration: none;
}

.profile-icon-link {
  display: inline-grid;
  width: 44px;
  height: 44px;
  border: 1px solid #b9d0d5;
  border-radius: 50%;
  background: #fff;
  place-items: center;
  touch-action: manipulation;
  transition: border-color 160ms, box-shadow 160ms, transform 160ms;
}

.profile-icon {
  width: 24px;
  height: 24px;
  background: var(--icon-color);
  -webkit-mask: var(--icon-image) center / contain no-repeat;
  mask: var(--icon-image) center / contain no-repeat;
}

.orcid-icon {
  --icon-color: #a6ce39;
  --icon-image: url("./assets/orcid.svg");
}

.google-scholar-icon {
  --icon-color: #4285f4;
  --icon-image: url("./assets/google-scholar.svg");
}

.scopus-icon {
  --icon-color: var(--sage-dark);
  --icon-image: url("./assets/scopus.svg");
}

.researchgate-icon {
  --icon-color: #00a99d;
  --icon-image: url("./assets/researchgate.svg");
}

.profile .profile-icon-link img {
  width: 24px;
  height: 24px;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  object-fit: contain;
  object-position: center;
}

.profile .mathscinet-link img {
  width: 23px;
  height: 26px;
}

.profile-icon-link:hover {
  border-color: var(--teal-dark);
  box-shadow: 0 7px 18px rgba(7, 29, 48, 0.13);
  transform: translateY(-2px);
}

table.rec,
table.details {
  width: 100%;
  margin: 17px 0;
  border-collapse: separate;
  border-spacing: 0;
  font-size: 15.5px;
}

table.rec td,
table.details th,
table.details td {
  padding: 13px 14px 13px 8px;
  border-bottom: 1px solid var(--line);
  vertical-align: top;
}

table.rec tr:last-child td,
table.details tr:last-child th,
table.details tr:last-child td {
  border-bottom: 0;
}

table.rec tr:hover td,
table.details tr:hover th,
table.details tr:hover td {
  background: rgba(12, 135, 148, 0.045);
}

table.rec td.yr {
  width: 162px;
  padding-top: 15px;
  color: var(--sage-dark);
  font-size: 11.5px;
  font-weight: 800;
  letter-spacing: 0.045em;
  text-transform: uppercase;
}

table.rec td.no {
  width: 42px;
  padding-top: 15px;
  color: var(--sage-dark);
  font-size: 12px;
  font-weight: 800;
}

table.rec.teaching-list td,
table.rec.teaching-list td.yr {
  padding-top: 4px;
  padding-bottom: 4px;
}

table.rec.teaching-list {
  line-height: 1.38;
}

table.rec.teaching-list span.sub {
  margin-top: 0;
}

table.rec.education-list td,
table.rec.education-list td.yr {
  padding-top: 6px;
  padding-bottom: 6px;
}

table.rec b {
  color: var(--ocean-deep);
  font-weight: 700;
}

table.rec span.sub {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 14px;
}

.tag {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 8px;
  border: 1px solid #b9d0d5;
  border-radius: 999px;
  background: #f5fbfc;
  color: var(--teal-dark);
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  vertical-align: 1px;
}

.note,
.contact-card {
  margin: 18px 0;
  padding: 17px 20px;
  border: 1px solid var(--line);
  border-left: 5px solid var(--teal);
  border-radius: 12px;
  background: var(--surface-soft);
}

table.details th {
  width: 170px;
  color: var(--ocean-deep);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.075em;
  text-align: left;
  text-transform: uppercase;
}

.references {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
  margin: 20px 0;
}

.reference {
  display: grid;
  grid-template-columns: 28px 1fr;
  gap: 9px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface-soft);
}

.reference-number {
  color: var(--sage-dark);
  font-weight: 800;
}

.reference p {
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 14px;
}

.gallery {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
  margin-top: 20px;
}

.gallery figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #fff;
}

.gallery img {
  display: block;
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
}

.gallery figcaption {
  padding: 10px 12px;
  color: var(--muted);
  font-size: 13.5px;
}

footer {
  margin-top: 18px;
  padding: 24px 0;
  border-top: 5px solid var(--teal);
  background: var(--ocean-deep);
  color: rgba(232, 247, 249, 0.7);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.035em;
}

footer .wrap {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
}

.load-error {
  max-width: 700px;
  margin: 60px auto;
  padding: 24px;
  border-left: 5px solid var(--sage);
  border-radius: 12px;
  background: #fff;
}

:focus-visible {
  outline: 3px solid var(--sage-dark);
  outline-offset: 3px;
}

@media (max-width: 820px) {
  .cover,
  .cover-content {
    min-height: 140px;
  }

  .cover h1 {
    font-size: 34px;
    font-size: clamp(27px, 6vw, 34px);
  }

  .panel {
    padding: 30px;
  }

  .profile {
    grid-template-columns: 165px minmax(0, 1fr);
    gap: 24px;
  }

  .profile img {
    width: 165px;
    height: 195px;
  }

  .references {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 650px) {
  body {
    font-size: 16px;
  }

  .wrap {
    padding: 0 20px;
  }

  .cover,
  .cover-content {
    min-height: 130px;
  }

  .cover-content {
    padding-top: 12px;
    padding-bottom: 14px;
  }

  .cover-focus {
    max-width: 92%;
    font-size: 12.5px;
  }

  .tabs {
    position: static;
  }

  .tabs .wrap {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    padding: 0;
  }

  .tab {
    padding: 12px 15px;
    border-bottom: 1px solid var(--line);
    border-left: 3px solid transparent;
    text-align: left;
  }

  .tab.on {
    border-bottom-color: var(--line);
    border-left-color: var(--sage);
  }

  main {
    padding: 24px 0 42px;
  }

  .panel {
    padding: 24px 20px 30px;
    border-radius: 16px;
  }

  .profile {
    grid-template-columns: 1fr;
    padding: 20px;
  }

  .profile img {
    width: 150px;
    height: 176px;
  }

  table.rec td.yr {
    width: 116px;
    white-space: normal;
  }

  .gallery {
    grid-template-columns: 1fr;
  }

  footer .wrap {
    flex-direction: column;
  }
}

@media (max-width: 470px) {
  table.rec,
  table.rec tbody,
  table.rec tr,
  table.rec td {
    display: block;
    width: 100%;
  }

  table.rec tr {
    padding: 12px 0;
    border-bottom: 1px solid var(--line);
  }

  table.rec.teaching-list tr {
    padding: 4px 0;
  }

  table.rec.education-list tr {
    padding: 6px 0;
  }

  table.rec td,
  table.rec td.yr,
  table.rec td.no {
    padding: 0;
    border: 0;
  }

  table.rec td.yr,
  table.rec td.no {
    margin-bottom: 5px;
  }

  table.details th {
    width: 110px;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    scroll-behavior: auto !important;
    transition: none !important;
  }
}
