:root {
  --ink: #17202a;
  --muted: #617082;
  --line: #dde5ee;
  --soft-line: #edf2f7;
  --panel: #ffffff;
  --paper: #f7f9fc;
  --nav: #f1f5f9;
  --accent: #0f766e;
  --accent-2: #b7791f;
  --accent-soft: #e6f4f1;
  --code: #f3f6f9;
  --shadow: 0 18px 46px rgba(20, 35, 55, 0.08);
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  letter-spacing: 0;
}

a {
  color: #0b6f9c;
  text-decoration: none;
}

a:hover {
  color: #084f6d;
  text-decoration: underline;
}

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

.site-shell {
  display: grid;
  grid-template-columns: 306px minmax(0, 1fr);
  min-height: 100vh;
}

.sidebar {
  position: sticky;
  top: 0;
  align-self: start;
  height: 100vh;
  overflow-y: auto;
  background: var(--nav);
  border-right: 1px solid var(--line);
  padding: 28px 22px;
}

.brand {
  display: grid;
  gap: 5px;
  padding: 0 8px 22px;
  border-bottom: 1px solid var(--line);
  color: var(--ink);
  text-decoration: none;
}

.brand:hover {
  text-decoration: none;
}

.brand-logo {
  width: 178px;
  height: auto;
  border-radius: 0;
}

.brand-name {
  display: none;
  margin-top: 8px;
  font-size: 25px;
  font-weight: 800;
}

.sidebar nav {
  display: grid;
  gap: 4px;
  margin-top: 22px;
}

.nav-link,
.nav-sublink {
  display: block;
  border-radius: 7px;
  color: var(--ink);
  text-decoration: none;
}

.nav-link {
  padding: 9px 10px;
  font-weight: 750;
}

.nav-link.is-active,
.nav-link:hover {
  background: #ffffff;
  color: var(--accent);
  text-decoration: none;
}

.nav-group {
  margin: 8px 0 14px 12px;
  padding-left: 14px;
  border-left: 1px solid var(--line);
}

.nav-group-title {
  margin: 10px 0 5px;
  color: #445367;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.05em;
  text-transform: uppercase;
}

.nav-sublink {
  margin: 2px 0;
  padding: 7px 8px;
  color: #506176;
  font-size: 16px;
  line-height: 1.35;
}

.nav-sublink.is-current,
.nav-sublink:hover {
  background: var(--accent-soft);
  color: var(--accent);
  text-decoration: none;
}

.content {
  width: min(100%, 1080px);
  padding: 42px 52px 36px;
}

.page-hero {
  margin-bottom: 32px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--line);
}

.home-hero {
  display: grid;
  grid-template-columns: max-content minmax(320px, 1fr);
  column-gap: 38px;
  row-gap: 8px;
  align-items: start;
  margin-bottom: 28px;
  padding-bottom: 26px;
}

.home-hero .eyebrow {
  grid-column: 1 / -1;
  max-width: none;
  margin-bottom: 0;
  font-size: 15px;
  line-height: 1.45;
}

.home-hero h1 {
  grid-column: 1;
  font-size: 40px;
}

.home-hero .lede {
  grid-column: 2;
  max-width: 600px;
  margin-top: 3px;
  font-size: 15px;
  line-height: 1.4;
}

.eyebrow,
.card-kicker {
  margin: 0 0 10px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

h1,
h2,
h3,
h4 {
  color: var(--ink);
  line-height: 1.2;
  letter-spacing: 0;
}

h1 {
  margin: 0;
  font-size: 44px;
  font-weight: 850;
}

h2 {
  margin: 42px 0 14px;
  padding-top: 4px;
  font-size: 25px;
}

h3 {
  margin: 28px 0 10px;
  font-size: 20px;
}

h4 {
  margin: 22px 0 8px;
  font-size: 17px;
}

p {
  margin: 0 0 16px;
}

.lede {
  max-width: 820px;
  margin-top: 16px;
  color: #405064;
  font-size: 19px;
  line-height: 1.6;
}

.profile-band {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 26px;
  align-items: stretch;
  margin: 26px 0;
  padding: 24px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: var(--shadow);
}

.old-profile {
  grid-template-columns: 270px minmax(0, 1fr);
  gap: 24px;
  align-items: start;
  padding: 0;
  background: transparent;
  border: 0;
  border-radius: 0;
  box-shadow: none;
}

.profile-mark {
  min-height: 180px;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 118, 110, 0.12), transparent 42%),
    linear-gradient(315deg, rgba(183, 121, 31, 0.18), transparent 48%),
    #f8fbfd;
  border: 1px solid var(--soft-line);
}

.old-profile .profile-mark {
  width: 270px;
  height: 270px;
  min-height: 270px;
  border-radius: 0;
}

.profile-photo {
  width: 270px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  object-position: center top;
}

.profile-mark span {
  color: var(--ink);
  font-size: 24px;
  font-weight: 850;
  letter-spacing: 0.08em;
}

.profile-copy h2 {
  margin-top: 0;
}

.old-profile .profile-copy h3 {
  margin-top: 0;
  margin-bottom: 10px;
  font-size: 19px;
}

.old-profile .profile-copy p {
  margin-bottom: 12px;
}

.profile-title {
  color: #334155;
  font-weight: 650;
}

.notice {
  margin: 28px 0;
  padding: 16px 18px;
  border-left: 4px solid var(--accent-2);
  background: #fffaf0;
  border-radius: 0 8px 8px 0;
  color: #4c3a1b;
}

.content-section {
  margin-top: 36px;
}

.content-section > h2:first-child {
  margin-top: 0;
}

.highlight-list {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.highlight-item {
  display: grid;
  grid-template-columns: 150px minmax(0, 1fr);
  gap: 22px;
  align-items: stretch;
  padding: 18px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.highlight-icon {
  width: 150px;
  min-height: 150px;
  height: 100%;
  display: grid;
  place-items: center;
  border-radius: 8px;
  background: #f8fafc;
  border: 1px solid var(--soft-line);
}

.highlight-icon img {
  width: 126px;
  height: 126px;
  object-fit: contain;
}

.highlight-item h3 {
  margin-top: 0;
  margin-bottom: 8px;
}

.highlight-item p {
  margin-bottom: 0;
  color: #3d4b5d;
}

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

.research-card {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  padding: 20px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--ink);
  text-decoration: none;
}

.research-card:hover {
  border-color: rgba(15, 118, 110, 0.45);
  box-shadow: var(--shadow);
  text-decoration: none;
}

.research-card h3 {
  margin-top: 0;
}

.research-card p {
  margin-bottom: 0;
  color: var(--muted);
}

.article-page {
  max-width: 900px;
}

.page-toc {
  position: fixed;
  top: 88px;
  right: 0;
  z-index: 20;
  width: 288px;
  overflow: visible;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid var(--line);
  border-right: 0;
  border-radius: 8px 0 0 8px;
  box-shadow: var(--shadow);
  transform: translateX(calc(100% - 36px));
  transition: transform 180ms ease, box-shadow 180ms ease;
  font-size: 13px;
}

.page-toc::before {
  display: none;
}

.toc-links {
  max-height: calc(100vh - 124px);
  display: grid;
  gap: 4px;
  padding: 16px 18px 16px 50px;
  overflow-y: auto;
}

.toc-handle {
  position: absolute;
  top: 18px;
  left: 0;
  z-index: 1;
  width: 36px;
  height: 88px;
  display: grid;
  place-items: center;
  background: var(--accent);
  border-radius: 10px 0 0 10px;
  box-shadow: 0 12px 28px rgba(15, 118, 110, 0.18);
  color: white;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.04em;
  line-height: 1;
  text-transform: uppercase;
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  pointer-events: none;
}

.page-toc:hover,
.page-toc:focus-within,
body.toc-edge-active .page-toc {
  transform: translateX(0);
}

.toc-link {
  padding: 5px 0 5px 4px;
  color: var(--muted);
  line-height: 1.35;
  text-decoration: none;
}

.toc-link:hover,
.toc-link.is-active {
  color: var(--accent);
  text-decoration: none;
}

.toc-link-nested {
  padding-left: 12px;
}

.article-page > h1:first-child {
  margin-bottom: 14px;
  padding-bottom: 20px;
  border-bottom: 1px solid var(--line);
}

.article-page hr {
  height: 1px;
  margin: 28px 0;
  border: 0;
  background: var(--line);
}

.article-page ul,
.article-page ol {
  margin: 0 0 18px 22px;
  padding: 0;
}

.article-page li {
  margin: 6px 0;
  padding-left: 4px;
}

.article-page figure {
  margin: 24px 0 10px;
  padding: 16px;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
}

.article-page figure img,
.article-page p img,
.article-page div img {
  margin: 0 auto;
  border-radius: 6px;
}

.article-page strong + br {
  display: none;
}

.math-block {
  margin: 20px 0;
  padding: 14px 18px;
  overflow-x: auto;
  background: var(--code);
  border: 1px solid var(--soft-line);
  border-radius: 8px;
  color: #263445;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 14px;
  white-space: pre;
}

.table-wrap {
  overflow-x: auto;
  margin: 20px 0;
}

table {
  width: 100%;
  border-collapse: collapse;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}

th,
td {
  padding: 11px 13px;
  border-bottom: 1px solid var(--soft-line);
  text-align: left;
  vertical-align: top;
}

th {
  background: #f1f5f9;
  font-size: 13px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

tr:last-child td {
  border-bottom: 0;
}

code {
  padding: 0.1em 0.32em;
  background: var(--code);
  border-radius: 4px;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92em;
}

.opening-page h2 {
  padding-top: 18px;
  border-top: 1px solid var(--soft-line);
}

.opening-page .page-hero h1 {
  border-bottom: 0;
}

.contact-section {
  padding-bottom: 18px;
}

.site-footer {
  margin-top: 56px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 13px;
}

@media (max-width: 920px) {
  .site-shell {
    grid-template-columns: 1fr;
  }

  .sidebar {
    position: relative;
    height: auto;
    padding: 20px;
  }

  .brand {
    grid-template-columns: minmax(132px, 38vw) minmax(0, 1fr);
    align-items: center;
    column-gap: 12px;
  }

  .brand-name {
    grid-column: 2;
  }

  .brand-name {
    margin-top: 0;
  }

  .content {
    padding: 30px 22px;
  }

  h1 {
    font-size: 36px;
  }

  .home-hero {
    grid-template-columns: max-content minmax(260px, 1fr);
    column-gap: 28px;
  }

  .profile-band,
  .research-grid {
    grid-template-columns: 1fr;
  }

  .old-profile {
    grid-template-columns: 1fr;
  }

  .profile-mark {
    min-height: 120px;
  }

  .old-profile .profile-mark,
  .profile-photo {
    width: min(270px, 100%);
  }
}

@media (max-width: 620px) {
  body {
    font-size: 15px;
  }

  .content {
    padding: 24px 16px;
  }

  h1 {
    font-size: 32px;
  }

  .home-hero {
    grid-template-columns: 1fr;
    margin-bottom: 22px;
  }

  .home-hero h1,
  .home-hero .lede {
    grid-column: 1;
  }

  .home-hero h1 {
    font-size: 34px;
  }

  .home-hero .lede {
    max-width: 100%;
    margin-top: 0;
  }

  h2 {
    font-size: 22px;
  }

  .lede {
    font-size: 17px;
  }

  .highlight-item {
    grid-template-columns: 88px minmax(0, 1fr);
    gap: 14px;
    padding: 14px;
  }

  .highlight-icon {
    width: 88px;
    min-height: 88px;
  }

  .highlight-icon img {
    width: 74px;
    height: 74px;
  }
}
