:root {
  --bg: #f6f5f2;
  --bg-accent: #eef1ea;
  --panel: #ffffff;
  --text: #0e1012;
  --muted: #5f6770;
  --line: #e4e1da;
  --accent: #0d0f11;
  --accent-soft: #f0ede7;
  --shadow: 0 20px 60px rgba(14, 16, 18, 0.08);
  --shadow-soft: 0 10px 30px rgba(14, 16, 18, 0.06);
  --radius: 24px;
  --sidebar-width: 230px;
  --chat-user: #0064ff;
  --chat-user-text: #ffffff;
  --chat-assistant: #e9e9ec;
  --chat-assistant-text: #0e1012;
  --chat-glass: rgba(255, 255, 255, 0.72);
  --chat-border: rgba(13, 15, 17, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  scroll-snap-type: y mandatory;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: "Sohne", "Soehne", "Neue Haas Grotesk", "Graphik",
    "Helvetica Neue", "Segoe UI", Arial, sans-serif;
  color: var(--text);
  background: var(--bg);
  letter-spacing: -0.01em;
  scroll-snap-type: y mandatory;
}

a {
  color: inherit;
  text-decoration: none;
}

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

button {
  font-family: inherit;
}

.sidebar-toggle {
  display: none;
  border: 1px solid rgba(14, 16, 18, 0.18);
  background: rgba(255, 255, 255, 0.72);
  color: var(--accent);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}

.sidebar-scrim {
  position: fixed;
  inset: 0;
  background: rgba(13, 15, 17, 0.1);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease;
  z-index: 15;
}

.sidebar-open .sidebar-scrim {
  opacity: 1;
  pointer-events: auto;
}
.layout {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  position: fixed;
  top: 0;
  left: 0;
  bottom: 0;
  width: var(--sidebar-width);
  padding: 32px 24px;
  display: flex;
  flex-direction: column;
  gap: 24px;
  background: var(--bg);
  border-right: 1px solid var(--line);
}

.sidebar-top {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  transition: gap 0.3s ease;
}


.profile {
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  max-height: 320px;
  overflow: hidden;
  transition: opacity 0.5s ease, transform 0.5s ease, max-height 0.5s ease;
}

.avatar-shell {
  width: 120px;
  padding: 4px;
  border-radius: 999px;
  background: var(--panel);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-soft);
  cursor: pointer;
  touch-action: manipulation;
}

.avatar {
  width: 100%;
  height: 150px;
  object-fit: cover;
  border-radius: 999px;
}

.name-stack {
  display: flex;
  flex-direction: column;
  gap: 4px;
  font-size: 20px;
  font-weight: 700;
  text-align: center;
  transition: color 0.2s ease, opacity 0.2s ease;
  color: rgba(14, 16, 18, 0.78);
}

.name-stack.is-hero-active {
  color: var(--accent);
  opacity: 1;
}

.name-line {
  line-height: 1.1;
  font-weight: 700;
}

.icon-row {
  display: flex;
  gap: 10px;
  align-items: center;
  justify-content: center;
  margin-top: 4px;
  max-height: 60px;
  overflow: hidden;
  transition: opacity 0.5s ease, transform 0.5s ease, max-height 0.5s ease,
    margin 0.5s ease;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--accent);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
  position: relative;
  cursor: pointer;
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

.icon-btn:hover {
  background: var(--accent);
  color: #ffffff;
  transform: translateY(-1px);
}

.icon-btn::after,
.icon-btn::before {
  content: none;
}

.icon-btn:hover::before {
  opacity: 1;
}

.icon-btn:focus-visible::after {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

.icon-btn:focus-visible::before {
  opacity: 1;
}

.sidebar-middle {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
}

.sidebar-divider {
  width: 70%;
  height: 1px;
  background: var(--line);
  margin: 10px auto 14px;
}


.nav-links {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  font-size: 15px;
  align-items: center;
}

.nav-links a {
  color: var(--muted);
  padding: 4px 0;
  transition: color 0.2s ease;
  text-align: center;
  cursor: pointer;
}

.nav-links .nav-main {
  font-size: 14px;
  font-weight: 500;
  color: #8b929a;
}

.nav-links .nav-research {
  color: #545b62;
  font-size: 17px;
}

.nav-links .nav-main.is-active {
  font-weight: 700;
  color: var(--accent);
}

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

.subnav {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 4px 0 12px;
  align-items: flex-start;
  align-self: center;
  padding-left: 12px;
  width: max-content;
}

.subnav a {
  font-size: 15px;
  color: var(--muted);
  padding: 2px 0;
  display: flex;
  align-items: center;
  gap: 6px;
  transition: color 0.2s ease;
  text-align: left;
  cursor: pointer;
}

.subnav a.is-active {
  color: var(--accent);
  font-weight: 600;
}

.sidebar-footer {
  margin-top: auto;
  display: flex;
  justify-content: center;
  opacity: 1;
  pointer-events: auto;
  transform: none;
}

.contact-nav {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 13px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  background: var(--panel);
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
  cursor: pointer;
}

.contact-nav:hover {
  background: var(--accent);
  color: #ffffff;
  transform: translateY(-1px);
}


.content {
  margin-left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
}

.section {
  padding: 120px 72px;
}

.snap-section {
  scroll-snap-align: start;
  scroll-snap-stop: always;
  min-height: 100vh;
}

.section-divider {
  height: 1px;
  background: var(--line);
  margin: 48px 72px 36px;
}

.hero {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  position: relative;
}

.snap-center {
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  padding-top: clamp(64px, 10vh, 96px);
  padding-bottom: clamp(64px, 10vh, 96px);
}

.sidequest.snap-center {
  align-items: stretch;
}

.teaching.snap-center {
  padding-top: clamp(40px, 6vh, 72px);
  padding-bottom: clamp(40px, 6vh, 72px);
}

.hero-text {
  display: flex;
  flex-direction: column;
  gap: 56px;
  max-width: 52rem;
  text-align: center;
  align-items: center;
  transform: translateY(-52px);
}

.hero-lead {
  font-size: clamp(1.6rem, 1.8vw + 1rem, 2.4rem);
  line-height: 1.3;
  margin: 0;
  font-weight: 500;
  max-width: 40rem;
}

.hero-line {
  display: block;
  white-space: nowrap;
}

.hero-break {
  display: block;
}

.hero-body {
  font-size: 1.05rem;
  line-height: 1.7;
  margin: 0;
  color: var(--muted);
  max-width: 44rem;
}

.research {
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: flex-start;
  padding-top: 0;
  padding-bottom: 0;
}

.research-body {
  margin-top: 0;
  display: grid;
  gap: 0;
}

.research-subsection {
  padding: 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 0;
  scroll-snap-align: center;
  scroll-snap-stop: always;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.research-subsection:first-of-type {
  border-top: none;
}

.research-subsection:last-of-type {
  margin-bottom: 64px;
}

.subsection-title {
  margin: 0 0 18px;
  font-size: clamp(1.3rem, 1.2vw + 0.9rem, 2rem);
  letter-spacing: -0.01em;
}

.research-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 0.8fr);
  gap: 24px;
  align-items: stretch;
}

.research-layout.research-layout-single {
  grid-template-columns: minmax(0, 1fr);
}

.research-layout.research-layout-50-50 {
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
}

.research-layout.research-layout-75-25 {
  grid-template-columns: minmax(0, 3fr) minmax(0, 1fr);
}

.research-layout.research-layout-70-30 {
  grid-template-columns: minmax(0, 7fr) minmax(0, 3fr);
}

.research-layout.research-layout-60-40 {
  grid-template-columns: minmax(0, 13fr) minmax(0, 7fr);
}

.research-copy {
  display: grid;
  gap: 16px;
  color: var(--muted);
  line-height: 1.7;
}

.research-copy p {
  margin: 0;
}

.mi-copy {
  gap: 16px;
  padding-top: 8px;
}

.mi-abstract {
  padding-left: 20px;
}

.subsection-subtitle {
  margin: 0;
  font-size: 1rem;
  font-weight: 600;
  color: var(--text);
}

.research-figures {
  display: grid;
  gap: 16px;
}

.research-figures.situation-figures {
  gap: 10px;
  align-self: center;
}

.research-figures.situation-figures .research-figure:first-child {
  margin-top: 12px;
}

.research-figure {
  border: 1px dashed var(--line);
  border-radius: 18px;
  padding: 18px;
  background: #fbfbf9;
  min-height: 220px;
  display: grid;
  gap: 16px;
}

.research-figure.figure-tall {
  height: 100%;
  min-height: 320px;
  align-self: stretch;
}

.research-figure.figure-image {
  border: none;
  background: transparent;
  padding: 0;
}

.research-figure.figure-image img {
  width: 100%;
  height: 100%;
  min-height: 320px;
  object-fit: cover;
  border-radius: 18px;
  display: block;
}

.research-figure.figure-image.figure-image-round img {
  border-radius: 28px;
  clip-path: inset(0 round 28px);
}

.research-figure.figure-image.figure-image-small img {
  height: auto;
  min-height: 0;
  object-fit: contain;
}

.research-figure.abstract-card {
  border-style: solid;
  background: #ffffff;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--muted);
  overflow: hidden;
}

.research-figure.abstract-card p {
  margin: 0;
}

.abstract-image {
  padding: 0;
  align-self: flex-start;
  display: flex;
  border-radius: 28px;
  overflow: hidden;
  min-height: 560px;
  width: 100%;
  background: transparent;
  box-shadow: none;
}

.abstract-image img {
  width: 100%;
  height: 100%;
  max-height: none;
  object-fit: contain;
  display: block;
  background: transparent;
  border-radius: 28px;
  clip-path: inset(0 round 28px);
}

.research-layout.research-layout-60-40 {
  align-items: start;
}

.figure-label {
  font-size: 12px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.figure-network,
.figure-grid {
  display: grid;
  gap: 12px;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  height: 100%;
  grid-auto-rows: 1fr;
}

.figure-network span,
.figure-grid span {
  border-radius: 12px;
  border: 1px solid rgba(13, 15, 17, 0.08);
  background: linear-gradient(160deg, #f5f6f2 0%, #e9ece4 100%);
  min-height: 48px;
}

.figure-network span:nth-child(2),
.figure-grid span:nth-child(2) {
  min-height: 64px;
}

.figure-network span:nth-child(3),
.figure-grid span:nth-child(5) {
  min-height: 80px;
}

.figure-bars {
  display: flex;
  align-items: flex-end;
  gap: 8px;
  height: 140px;
}

.figure-bars span {
  flex: 1;
  border-radius: 10px;
  background: linear-gradient(180deg, #e1e6dd 0%, #f2f3ef 100%);
}

.figure-bars span:nth-child(1) {
  height: 40%;
}

.figure-bars span:nth-child(2) {
  height: 65%;
}

.figure-bars span:nth-child(3) {
  height: 85%;
}

.figure-bars span:nth-child(4) {
  height: 55%;
}

.figure-bars span:nth-child(5) {
  height: 72%;
}

.research-other {
  display: grid;
  gap: 22px;
}


.research-citation {
  display: grid;
  gap: 6px;
}

.research-citation p {
  margin: 0;
}

.citation-detail {
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.6;
}

.pdf-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
  background: #ffffff;
  cursor: pointer;
}

.pdf-link:hover {
  background: var(--accent);
  color: #ffffff;
}

.slide-label {
  font-size: 12px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--muted);
}

.slide-value {
  font-size: 1.05rem;
  line-height: 1.5;
}

.teaching {
  text-align: center;
  padding-bottom: calc(96px + 2vh);
}

.teaching-statement {
  font-size: clamp(1.4rem, 1.4vw + 1rem, 2rem);
  font-weight: 600;
  max-width: 44rem;
  margin: 0 auto 24px;
}

.frame {
  width: min(100%, 920px);
  margin: 0 auto;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  overflow: hidden;
  background: var(--panel);
  box-shadow: var(--shadow);
  position: relative;
}

.frame iframe {
  width: 100%;
  height: clamp(560px, 76vh, 820px);
  border: 0;
  display: block;
}

.teaching-note {
  margin-top: 14px;
  font-size: 1rem;
  color: var(--muted);
}

.sidequest-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 0.9fr);
  gap: 32px;
  align-items: stretch;
  width: 100%;
}

.sidequest-text {
  display: grid;
  gap: 16px;
  color: var(--muted);
  line-height: 1.7;
  height: 100%;
}

.sidequest-title {
  font-size: clamp(1.4rem, 1.6vw + 0.8rem, 2rem);
  margin: 0 0 18px;
  color: var(--text);
  width: 100%;
  text-align: left;
  align-self: flex-start;
}

.sidequest-text p {
  margin: 0;
}

.sidequest-visual {
  border-radius: 20px;
  border: 1px solid var(--line);
  background: #fbfbf9;
  padding: 18px;
  box-shadow: var(--shadow-soft);
  display: flex;
  flex-direction: column;
  gap: 12px;
  align-items: center;
  height: 100%;
}

.sidequest-visual.sidequest-image {
  border: none;
  background: transparent;
  padding: 0;
  box-shadow: none;
  height: 100%;
}

.sidequest-visual.sidequest-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 20px;
  display: block;
}

.sidequest-visual svg {
  width: 100%;
  height: 100%;
  flex: 1;
}

.sidequest-caption {
  font-size: 12px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

.scroll-glass {
  position: fixed;
  left: var(--sidebar-width);
  width: calc(100% - var(--sidebar-width));
  height: 1vh;
  pointer-events: none;
  z-index: 5;
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
}

.scroll-glass-top {
  top: 0;
  background:
    radial-gradient(
      circle at 20% 60%,
      rgba(246, 245, 242, 0.45) 0,
      rgba(246, 245, 242, 0) 60%
    ),
    radial-gradient(
      circle at 70% 30%,
      rgba(246, 245, 242, 0.35) 0,
      rgba(246, 245, 242, 0) 55%
    ),
    linear-gradient(
      to bottom,
      rgba(246, 245, 242, 0.7),
      rgba(246, 245, 242, 0)
    );
}

.scroll-glass-bottom {
  bottom: 0;
  background:
    radial-gradient(
      circle at 30% 50%,
      rgba(246, 245, 242, 0.45) 0,
      rgba(246, 245, 242, 0) 60%
    ),
    radial-gradient(
      circle at 80% 70%,
      rgba(246, 245, 242, 0.35) 0,
      rgba(246, 245, 242, 0) 55%
    ),
    linear-gradient(
      to top,
      rgba(246, 245, 242, 0.7),
      rgba(246, 245, 242, 0)
    );
}

.chat-launcher {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(13, 15, 17, 0.1);
  font-size: 13px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  background: rgba(255, 255, 255, 0.3);
  color: var(--accent);
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(18px) saturate(1.6);
  -webkit-backdrop-filter: blur(18px) saturate(1.6);
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.chat-launcher:hover {
  background: var(--accent);
  color: #ffffff;
  transform: translateY(-1px);
}

.chat-launcher.is-hidden {
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
}

.chat-widget {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: clamp(380px, 38vw, 720px);
  height: clamp(560px, 72vh, 960px);
  display: flex;
  flex-direction: column;
  border-radius: 22px;
  border: 1px solid var(--chat-border);
  background:
    linear-gradient(
      140deg,
      rgba(255, 255, 255, 0.36) 0%,
      rgba(240, 242, 246, 0.18) 45%,
      rgba(255, 255, 255, 0.08) 100%
    );
  box-shadow: 0 22px 70px rgba(14, 16, 18, 0.2);
  backdrop-filter: blur(34px) saturate(1.8);
  -webkit-backdrop-filter: blur(34px) saturate(1.8);
  opacity: 0;
  pointer-events: none;
  transform: translateY(16px) scale(0.98);
  transition: opacity 0.2s ease, transform 0.2s ease;
  z-index: 45;
  overflow: hidden;
}

.chat-widget::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(
      circle at 20% 20%,
      rgba(255, 255, 255, 0.6),
      rgba(255, 255, 255, 0)
    ),
    radial-gradient(
      circle at 80% 10%,
      rgba(210, 231, 255, 0.45),
      rgba(255, 255, 255, 0)
    ),
    radial-gradient(
      circle at 30% 90%,
      rgba(255, 255, 255, 0.4),
      rgba(255, 255, 255, 0)
    );
  opacity: 0.8;
  pointer-events: none;
  z-index: 0;
}

.chat-widget > * {
  position: relative;
  z-index: 1;
}

.chat-widget.is-open {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0) scale(1);
}

.chat-header {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 12px 16px;
  border-bottom: 1px solid rgba(13, 15, 17, 0.08);
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(24px) saturate(1.6);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  justify-content: space-between;
  position: relative;
}

.chat-title {
  font-size: 0.95rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  text-align: center;
  max-width: 70%;
  pointer-events: none;
}

.chat-status {
  width: 8px;
  height: 8px;
  border-radius: 999px;
  background: rgba(13, 15, 17, 0.3);
}

.chat-status.is-live {
  background: #17b26a;
  box-shadow: 0 0 10px rgba(23, 178, 106, 0.6);
}

.chat-status.is-typing {
  background: #0064ff;
  box-shadow: 0 0 12px rgba(0, 100, 255, 0.6);
  animation: chatPulse 1.1s infinite ease-in-out;
}

.chat-minimize {
  width: 16px;
  height: 16px;
  border-radius: 999px;
  border: 1px solid rgba(185, 129, 0, 0.55);
  background: rgb(244, 192, 54);
  color: transparent;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  font-size: 0;
  line-height: 1;
}

.chat-minimize::after {
  content: "−";
  font-size: 11px;
  color: #3a2a00;
  opacity: 0;
  transition: opacity 0.15s ease;
}

.chat-minimize:hover::after,
.chat-minimize:focus-visible::after {
  opacity: 1;
}

.chat-window {
  flex: 1;
  overflow-y: auto;
  padding: 16px 14px 10px;
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.chat-message {
  display: flex;
  gap: 8px;
  max-width: 85%;
}

.chat-message.user {
  align-self: flex-end;
  flex-direction: row-reverse;
}

.chat-message.assistant {
  align-self: flex-start;
}

.chat-bubble {
  padding: 10px 14px;
  border-radius: 18px;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.12);
  line-height: 1.45;
  font-size: 0.92rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.chat-bubble.user {
  background: var(--chat-user);
  color: var(--chat-user-text);
  border-bottom-right-radius: 6px;
}

.chat-bubble.assistant {
  background: var(--chat-assistant);
  color: var(--chat-assistant-text);
  border-bottom-left-radius: 6px;
}

.chat-bubble.thinking {
  display: inline-flex;
  gap: 4px;
  align-items: center;
}

.chat-bubble.thinking span {
  width: 6px;
  height: 6px;
  border-radius: 999px;
  background: rgba(13, 15, 17, 0.35);
  animation: chatPulse 1.2s infinite ease-in-out;
}

.chat-bubble.thinking span:nth-child(2) {
  animation-delay: 0.15s;
}

.chat-bubble.thinking span:nth-child(3) {
  animation-delay: 0.3s;
}

.chat-input {
  padding: 10px 12px 14px;
  border-top: none;
  background: transparent;
  backdrop-filter: blur(18px) saturate(1.5);
  -webkit-backdrop-filter: blur(18px) saturate(1.5);
}

.chat-input-wrap {
  position: relative;
  width: 100%;
  border-radius: 20px;
  overflow: hidden;
}

.chat-input input {
  width: 100%;
  height: 40px;
  padding: 0 46px 0 14px;
  border-radius: 20px;
  border: 1px solid rgba(13, 15, 17, 0.12);
  background: linear-gradient(
    135deg,
    rgba(248, 249, 251, 0.9),
    rgba(235, 237, 240, 0.7)
  );
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.6);
  font-size: 0.9rem;
  outline: none;
}

.chat-input button {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 32px;
  height: 32px;
  border-radius: 999px;
  border: none;
  background: rgba(0, 100, 255, 0.9);
  color: #ffffff;
  font-size: 16px;
  cursor: pointer;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.16);
  transition: transform 0.18s ease, background 0.18s ease;
}

.chat-input button:hover {
  background: var(--chat-user);
  transform: translateY(-50%) scale(1.03);
}

.admin-overlay {
  position: fixed;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  z-index: 60;
  transition: opacity 0.2s ease;
}

.admin-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

.admin-overlay .admin-scrim {
  position: absolute;
  inset: 0;
  background: rgba(13, 15, 17, 0.38);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}

.admin-modal,
.admin-panel {
  position: relative;
  z-index: 1;
  background: rgba(255, 255, 255, 0.94);
  border-radius: 20px;
  border: 1px solid rgba(13, 15, 17, 0.14);
  box-shadow: 0 24px 70px rgba(14, 16, 18, 0.26);
  width: min(520px, 92vw);
  max-height: min(90vh, 720px);
  display: flex;
  flex-direction: column;
  padding: 18px 20px 20px;
  gap: 12px;
}

.admin-panel {
  width: min(1100px, 94vw);
  height: min(82vh, 780px);
  display: none;
  padding: 16px 18px 18px;
}

.admin-overlay.is-authenticated .admin-modal {
  display: none;
}

.admin-overlay.is-authenticated .admin-panel {
  display: flex;
}

.admin-modal-header,
.admin-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.admin-title,
.admin-panel-title {
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: 0.01em;
}

.admin-panel-actions {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.admin-form {
  display: flex;
  gap: 10px;
  align-items: center;
}

.admin-form input {
  flex: 1;
  height: 40px;
  padding: 0 12px;
  border-radius: 12px;
  border: 1px solid rgba(13, 15, 17, 0.14);
  font-size: 0.95rem;
}

.admin-form button,
.admin-export {
  height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid rgba(13, 15, 17, 0.14);
  background: var(--accent);
  color: #ffffff;
  font-size: 0.85rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  cursor: pointer;
}

.admin-export {
  background: rgba(13, 15, 17, 0.08);
  color: var(--accent);
}

.admin-export:hover {
  background: var(--accent);
  color: #ffffff;
}

.admin-close {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid rgba(13, 15, 17, 0.14);
  background: rgba(255, 255, 255, 0.8);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}

.admin-error,
.admin-panel-status {
  color: #8b1f1f;
  font-size: 0.9rem;
  min-height: 1.2em;
}

.admin-panel-status {
  color: var(--muted);
}

.admin-table-wrap {
  flex: 1;
  overflow: auto;
  border-radius: 14px;
  border: 1px solid rgba(13, 15, 17, 0.12);
  background: #ffffff;
}

.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.88rem;
}

.admin-table th,
.admin-table td {
  text-align: left;
  padding: 10px 12px;
  border-bottom: 1px solid rgba(13, 15, 17, 0.08);
  vertical-align: top;
}

.admin-table th {
  position: sticky;
  top: 0;
  background: #f7f6f2;
  font-weight: 600;
  letter-spacing: 0.02em;
  z-index: 1;
}

.admin-chat-cell {
  cursor: pointer;
  color: #1b4bcc;
  text-decoration: underline;
  max-width: 420px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.admin-open {
  overflow: hidden;
}

html.admin-open,
body.admin-open {
  scroll-snap-type: none;
}

@keyframes chatPulse {
  0%,
  100% {
    transform: translateY(0);
    opacity: 0.4;
  }
  50% {
    transform: translateY(-3px);
    opacity: 1;
  }
}

.contact {
  display: flex;
  justify-content: center;
  align-items: center;
  min-height: 60vh;
}

.mail-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 14px 34px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 14px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.mail-btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 24px 70px rgba(14, 16, 18, 0.18);
}

.js .reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.8s ease, transform 0.8s ease;
}

.js .reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

@media (max-width: 1100px) {
  .section {
    padding: 84px 48px;
  }

  .research {
    padding-top: 0;
    padding-bottom: 0;
  }

  .teaching {
    padding-bottom: calc(72px + 2vh);
  }

  .section-divider {
    margin: 36px 48px 28px;
  }
}

@media (max-width: 900px) {
  .layout {
    flex-direction: column;
  }

  .sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: min(260px, 78vw);
    height: 100vh;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    border-right: 1px solid var(--line);
    border-bottom: none;
    padding: 24px 18px;
    z-index: 20;
    gap: 16px;
    background: var(--bg);
    transform: translateX(-100%);
    transition: transform 0.28s ease;
  }

  .sidebar.is-open {
    transform: translateX(0);
  }

  .sidebar-toggle {
    display: inline-flex;
    position: fixed;
    top: 50%;
    left: 10px;
    transform: translateY(-50%);
    width: 28px;
    height: 54px;
    border-radius: 999px;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 500;
    opacity: 0.8;
    z-index: 30;
  }

  .sidebar-open .sidebar-toggle {
    left: calc(min(260px, 78vw) - 12px);
    opacity: 1;
  }

  .content {
    margin-left: 0;
    width: 100%;
  }

  .scroll-glass {
    left: 0;
    width: 100%;
  }

  .hero {
    min-height: auto;
  }

  .hero-text {
    transform: translateY(0);
  }

  .hero-line {
    white-space: normal;
  }

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

  .research-layout {
    grid-template-columns: 1fr;
  }

  .section-divider {
    margin: 28px 20px 24px;
  }
}

@media (max-width: 720px) {
  .section {
    padding: 72px 24px;
  }

  .research {
    padding-top: 0;
    padding-bottom: 0;
  }

  .teaching {
    padding-bottom: calc(64px + 2vh);
  }

  .section-divider {
    margin: 24px 24px 20px;
  }

  .research-head {
    grid-template-columns: 1fr;
  }

  .frame iframe {
    width: 100%;
    height: clamp(520px, 74vh, 700px);
  }

  .chat-widget {
    right: 16px;
    bottom: 16px;
    width: min(94vw, 460px);
    height: min(84vh, 820px);
  }

  .chat-launcher {
    right: 16px;
    bottom: 16px;
  }

  .admin-modal,
  .admin-panel {
    width: min(94vw, 520px);
  }

  .admin-panel {
    height: min(84vh, 720px);
  }

  .admin-form {
    flex-direction: column;
    align-items: stretch;
  }

  .admin-form button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js .reveal {
    transition: none;
  }

  .icon-btn,
  .contact-nav,
  .mail-btn {
    transition: none;
  }
}
.nav-links .nav-main.compact {
  padding: 0;
}
.nav-links .nav-main:hover {
  font-weight: 700;
}
