:root {
  --bg: #fbf8f7;
  --card: #ffffff;
  --soft: #f7eeeb;
  --ink: #271419;
  --muted: #695d61;
  --brand: #68172b;
  --brand-2: #9b5260;
  --line: rgba(104, 23, 43, .14);
  --shadow: 0 16px 36px rgba(50, 13, 24, .10);
  --radius: 24px;
  --max: 1120px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; overflow-x: hidden; background: var(--bg); }
body {
  margin: 0;
  overflow-x: hidden;
  color: var(--ink);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, sans-serif;
  font-size: 16px;
  line-height: 1.65;
  background: radial-gradient(circle at top left, rgba(155,82,96,.14), transparent 360px), linear-gradient(180deg, #fff, var(--bg) 56%, #fff);
}
img, svg { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; }

.skip-link {
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 100;
  transform: translateY(-140%);
  padding: 10px 14px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  font-weight: 800;
}
.skip-link:focus { transform: translateY(0); }

.container {
  width: min(var(--max), calc(100% - 32px));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  padding: 12px 0;
  background: rgba(251,248,247,.86);
  backdrop-filter: blur(14px);
}
.nav-shell {
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  min-height: 64px;
  padding: 9px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,.95);
  box-shadow: 0 10px 26px rgba(50,13,24,.08);
}
.brand {
  display: flex;
  align-items: center;
  gap: 11px;
  min-width: 0;
  margin-right: auto;
  color: var(--brand);
  font-weight: 900;
}
.brand img {
  width: 44px;
  height: 44px;
  flex: 0 0 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--soft);
  object-fit: cover;
  object-position: center 18%;
}
.brand span {
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}
.main-nav a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 13px;
  border-radius: 14px;
  color: var(--muted);
  font-size: 14px;
  font-weight: 800;
}
.main-nav a:hover,
.main-nav a:focus-visible {
  background: var(--brand);
  color: #fff;
  outline: 0;
}
.menu-button { display: none; }
.menu-icon { display: grid; gap: 4px; }
.menu-icon i {
  display: block;
  width: 19px;
  height: 2px;
  border-radius: 20px;
  background: currentColor;
}
.menu-label {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

.hero { padding: 58px 0 34px; }
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(320px, 410px);
  align-items: center;
  gap: 58px;
}
.hero-copy { min-width: 0; }
.eyebrow {
  margin: 0 0 10px;
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .14em;
  text-transform: uppercase;
}
h1, h2, h3, p { overflow-wrap: break-word; }
h1, h2, h3 { margin: 0; color: var(--brand); line-height: 1.08; }
h1 { max-width: 720px; font-size: clamp(48px, 7vw, 78px); letter-spacing: -.06em; }
h1 span { display: inline; }
h2 { max-width: 760px; font-size: clamp(30px, 4vw, 48px); letter-spacing: -.04em; }
h3 { font-size: 18px; letter-spacing: -.01em; }
p { margin: 0; color: var(--muted); }
.lead { max-width: 660px; margin-top: 18px; font-size: 18px; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 20px;
  border-radius: 16px;
  font-weight: 900;
}
.button-primary { background: var(--brand); color: #fff; box-shadow: 0 14px 28px rgba(104,23,43,.22); }
.button-light { border: 1px solid var(--line); background: #fff; color: var(--brand); }
.portrait-card {
  width: 100%;
  max-width: 410px;
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: #fff;
  box-shadow: var(--shadow);
}
.portrait-card img { width: 100%; height: 560px; object-fit: cover; object-position: center 16%; }
.portrait-card figcaption { padding: 14px 16px 18px; background: var(--soft); color: var(--brand); font-weight: 900; text-align: center; }

.quick-links { padding: 12px 0 54px; }
.quick-grid, .card-grid, .social-grid { display: grid; gap: 14px; }
.quick-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.quick-grid a, .content-card, .info-card, .timeline article, .social-grid a {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.95);
  box-shadow: 0 12px 30px rgba(50,13,24,.07);
}
.quick-grid a { padding: 18px; }
.quick-grid span, .link-card span, .timeline time {
  display: block;
  margin-bottom: 6px;
  color: var(--brand-2);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .09em;
  text-transform: uppercase;
}
.quick-grid strong { display: block; color: var(--brand); line-height: 1.35; overflow-wrap: anywhere; }

.section { padding: 74px 0; }
.section-soft { background: rgba(247,238,235,.62); }
.split-layout { display: grid; grid-template-columns: minmax(0, .85fr) minmax(0, 1.15fr); gap: 48px; align-items: start; }
.section-heading.compact { margin-bottom: 24px; }
.content-card, .info-card, .timeline article { padding: 26px; }
.prose p + p { margin-top: 16px; }
.card-grid.three { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.publications-list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.number {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  margin-bottom: 18px;
  border-radius: 50%;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-weight: 900;
}
.info-card p, .timeline p { margin-top: 9px; }
.timeline { display: grid; gap: 14px; }
.link-card { display: block; transition: transform .18s ease, border-color .18s ease; }
.link-card:hover, .link-card:focus-visible { transform: translateY(-2px); border-color: rgba(104,23,43,.36); outline: 0; }
.link-card strong { display: block; color: var(--brand); line-height: 1.45; overflow-wrap: break-word; }
.contact-panel { padding: 34px; border: 1px solid var(--line); border-radius: 32px; background: linear-gradient(135deg, #fff, var(--soft)); box-shadow: var(--shadow); }
.social-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.social-grid a { display: flex; align-items: center; justify-content: center; gap: 10px; min-height: 64px; padding: 14px; color: var(--brand); font-weight: 900; text-align: center; }
.social-grid a:hover, .social-grid a:focus-visible { background: var(--brand); color: #fff; outline: 0; }
.social-grid svg { width: 21px; height: 21px; flex: 0 0 21px; fill: currentColor; }
.site-footer { padding: 28px 0 38px; }
.footer-inner { display: flex; align-items: center; justify-content: space-between; gap: 16px; color: var(--muted); font-size: 14px; }
.footer-inner a { color: var(--brand); font-weight: 900; }

@media (max-width: 900px) {
  .menu-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    flex: 0 0 46px;
    border: 0;
    border-radius: 15px;
    background: var(--brand);
    color: #fff;
    cursor: pointer;
  }
  .main-nav {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    display: none;
    grid-template-columns: 1fr;
    gap: 10px;
    width: 100%;
    padding: 10px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(255,255,255,.98);
    box-shadow: var(--shadow);
  }
  .main-nav.is-open { display: grid; }
  .main-nav a {
    min-height: 48px;
    border: 1px solid rgba(104,23,43,.10);
    border-radius: 14px;
    background: var(--soft);
    color: var(--brand);
    font-size: 15px;
    font-weight: 900;
  }
  .hero { padding-top: 34px; }
  .hero-grid, .split-layout { grid-template-columns: 1fr; gap: 26px; }
  .hero-copy { text-align: center; }
  h1, h2, .lead { margin-left: auto; margin-right: auto; }
  h1 span { display: block; }
  .hero-actions { justify-content: center; }
  .portrait-card { max-width: 430px; margin: 0 auto; }
  .portrait-card img { height: min(112vw, 520px); object-position: center 14%; }
  .quick-grid, .card-grid.three, .publications-list { grid-template-columns: 1fr; }
  .social-grid { grid-template-columns: 1fr 1fr; }
}

@media (max-width: 640px) {
  .container { width: calc(100% - 24px); }
  .site-header { padding: 10px 0; }
  .nav-shell { min-height: 60px; padding: 8px; border-radius: 18px; }
  .brand { max-width: calc(100% - 58px); gap: 10px; }
  .brand img { width: 38px; height: 38px; flex-basis: 38px; }
  .brand span { font-size: 14px; }
  .hero { padding: 28px 0 24px; }
  .hero-copy, h1, h2, .lead { text-align: left; margin-left: 0; margin-right: 0; }
  .eyebrow { font-size: 11px; }
  h1 { max-width: 11ch; font-size: clamp(34px, 10vw, 42px); letter-spacing: -.045em; }
  h2 { font-size: clamp(26px, 8vw, 34px); }
  .lead { margin-top: 14px; font-size: 15.5px; line-height: 1.62; }
  .hero-actions { display: grid; grid-template-columns: 1fr; width: 100%; margin-top: 22px; }
  .button { width: 100%; }
  .portrait-card { width: 100%; max-width: none; border-radius: 24px; }
  .portrait-card img { height: min(104vw, 390px); object-position: center 12%; }
  .portrait-card figcaption { padding: 12px 10px 14px; font-size: 14px; overflow-wrap: break-word; }
  .quick-links { padding-bottom: 36px; }
  .quick-grid a, .content-card, .info-card, .timeline article { padding: 20px; border-radius: 20px; }
  .section { padding: 52px 0; }
  .contact-panel { padding: 20px; border-radius: 24px; }
  .social-grid { grid-template-columns: 1fr; }
  .footer-inner { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 360px) {
  .container { width: calc(100% - 20px); }
  .brand span { font-size: 13px; }
  .menu-button { width: 44px; height: 44px; flex-basis: 44px; }
  h1 { font-size: 32px; }
}

@media (max-width: 640px) {
  .nav-shell { flex-wrap: wrap; }
  .main-nav {
    position: static;
    flex: 1 0 100%;
    margin-top: 4px;
  }
  .main-nav:not(.is-open) { display: none; }
  .main-nav.is-open { display: grid; }
}

/* Mini chat */
.mini-chat {
  position: fixed;
  right: 18px;
  bottom: 18px;
  z-index: 80;
  display: grid;
  justify-items: end;
  gap: 10px;
  width: min(340px, calc(100vw - 32px));
  pointer-events: none;
}
.chat-toggle,
.chat-panel {
  pointer-events: auto;
}
.chat-toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 52px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 16px 34px rgba(104,23,43,.28);
  cursor: pointer;
  font-weight: 900;
}
.chat-toggle svg {
  width: 22px;
  height: 22px;
  fill: currentColor;
}
.chat-panel {
  width: 100%;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255,255,255,.98);
  box-shadow: 0 22px 55px rgba(50,13,24,.18);
}
.chat-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: var(--brand);
}
.chat-close {
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 50%;
  background: var(--soft);
  color: var(--brand);
  cursor: pointer;
  font-size: 22px;
  line-height: 1;
}
.chat-panel p {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
}
.chat-actions {
  display: grid;
  gap: 8px;
  margin-top: 12px;
}
.chat-actions a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 12px;
  border-radius: 13px;
  background: var(--soft);
  color: var(--brand);
  font-size: 14px;
  font-weight: 900;
}
.chat-actions a:first-child {
  background: #1f8f58;
  color: #fff;
}

@media (max-width: 640px) {
  .mini-chat {
    right: 12px;
    bottom: 12px;
    width: min(330px, calc(100vw - 24px));
  }
  .chat-toggle {
    min-height: 50px;
    padding: 0 16px;
  }
  .chat-panel {
    border-radius: 20px;
  }
}
