:root {
  --ink: #13211f;
  --muted: #596662;
  --paper: #f4f0e8;
  --paper-2: #ebe4d8;
  --deep: #143b37;
  --line: rgba(19, 33, 31, 0.16);
  --accent: #b65f40;
  --white: #fff;

  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --font-serif: Georgia, "Times New Roman", serif;

  --text-body: 18px;
  --text-small: 14px;
  --text-meta: 12px;
  --text-card: 16px;

  --shell: min(1180px, calc(100% - 40px));
  --section-space: 104px;
  --section-space-small: 72px;

  --radius-card: 18px;
  --radius-image: 4px 28px 4px 4px;
  --radius-pill: 999px;

  --shadow-image: 0 24px 70px rgba(19, 33, 31, 0.14);
}

/* ---------- Base ---------- */

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  color: var(--ink);
  background: var(--paper);
  font-family: var(--font-sans);
  font-size: 16px;
  font-weight: 400;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

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

.shell {
  width: var(--shell);
  margin: 0 auto;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 10px;
  z-index: 100;
  padding: 10px 14px;
  background: var(--white);
}

.skip-link:focus { left: 10px; }

/* ---------- Global typography system ---------- */

h1, h2, h3 {
  margin-top: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -0.03em;
}

h1 {
  margin-bottom: 0;
  max-width: 9ch;
  font-size: clamp(58px, 8vw, 116px);
}

h2 {
  margin-bottom: 28px;
  font-size: clamp(34px, 4vw, 54px);
}

h3 {
  margin: 8px 0 12px;
  font-size: 26px;
}

.eyebrow,
.micro {
  font-size: var(--text-meta);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.eyebrow {
  margin: 0 0 14px;
  color: var(--accent);
}

.micro {
  font-size: 11px;
}

/* One unified style for main prose across the site */
.prose p,
.book-copy > p:not(.eyebrow) {
  margin-top: 0;
  font-size: var(--text-body);
  line-height: 1.65;
}

/* Main prose is dark, not gray */
.prose p,
.book-copy > p:not(.eyebrow) {
  color: var(--ink);
}

/* Secondary text is muted */
.publication-card p,
.project-card p,
.talk-item p,
.recognition-grid span {
  color: var(--muted);
}

/* ---------- Header / navigation ---------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(244, 240, 232, 0.91);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.nav-wrap {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  text-decoration: none;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.brand-ornament {
  width: 64px;
  height: 64px;
  object-fit: contain;
  flex-shrink: 0;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 20px;
}

.site-nav a {
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
}

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

.menu-button {
  display: none;
  padding: 8px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: transparent;
  font: inherit;
}

/* ---------- Shared section layout ---------- */
/* Spacing system: 104px main sections · 72px compact sections · 28px card/internal padding · 18px small gaps */

.section { padding: var(--section-space) 0; }

.section-small { padding: var(--section-space-small) 0; }

.two-col {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 80px;
}

/* ---------- Hero ---------- */

.hero {
  min-height: 82vh;
  display: grid;
  align-items: center;
  padding: 78px 0 0;
  overflow: hidden;
}

.hero-grid {
  display: grid;
  grid-template-columns: 1.28fr 0.72fr;
  gap: 86px;
  align-items: center;
}

.hero-subtitle {
  max-width: 760px;
  margin: 30px 0 34px;
  color: var(--muted);
  font-size: clamp(18px, 2vw, 24px);
  line-height: 1.55;
}

.portrait-wrap {
  position: relative;
  justify-self: end;
  max-width: 420px;
  margin: 0;
}

.portrait-wrap img {
  width: 100%;
  aspect-ratio: 0.76;
  object-fit: cover;
  object-position: center 28%;
  border-radius: var(--radius-image);
  box-shadow: none;
  filter: saturate(0.88) contrast(0.98);
}

/* ---------- Bio ---------- */

.bio-roles {
  margin: 26px 0 30px;
  padding: 0;
  list-style: none;
  border-top: 1px solid var(--line);
  font-size: var(--text-body);
  line-height: 1.55;
}

.bio-roles li {
  position: relative;
  padding: 11px 0 11px 22px;
  border-bottom: 1px solid var(--line);
}

.bio-roles li::before {
  content: "•";
  position: absolute;
  left: 2px;
  color: var(--accent);
}

.bio-roles a,
.text-link,
.publication-card a,
.contact-links a {
  text-underline-offset: 4px;
}

/* ---------- Featured book ---------- */

.section-book { background: var(--paper-2); }

.book-feature {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr);
  gap: 56px;
  align-items: center;
}

.book-left,
.book-copy {
  min-width: 0;
}

.book-left h2 { margin-bottom: 36px; }

.book-cover { width: 100%; }

.book-mockup {
  width: 100%;
  height: auto;
}

.book-copy { align-self: center; }

/* Keep the book introduction visually equal to Bio prose */
.book-copy > p:not(.eyebrow) {
  margin-bottom: 26px;
}

.recognition-strip {
  display: grid;
  grid-template-columns: 130px 1fr;
  gap: 20px;
  margin: 28px 0 18px;
  padding: 18px 0;
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
  font-size: 16px;
}

.recognition-strip strong,
.translations-title {
  color: var(--accent);
  font-weight: 600;
}

.book-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 28px;
  margin: 18px 0 30px;
}

.text-link { font-weight: 600; }

.translations-title {
  display: block;
  margin-bottom: 10px;
}

.translation-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
}

.translation-tags span {
  padding: 7px 11px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
}

.book-divider {
  border-top: 1px solid var(--line);
}

/* ---------- Publications ---------- */

.cards {
  display: grid;
  gap: 18px;
}

.cards-3 {
  grid-template-columns: repeat(3, 1fr);
}

.publication-card {
  min-height: 245px;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.28);
}

.publication-card h3 {
  font-size: 25px;
}

.publication-card p {
  margin-bottom: 0;
  font-size: var(--text-card);
  line-height: 1.55;
}

.publications-more {
  margin-top: 32px;
}

.publications-more summary {
  display: inline-block;
  cursor: pointer;
  list-style: none;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 5px;
}

.publications-more summary::-webkit-details-marker {
  display: none;
}

.publications-extra {
  margin-top: 32px;
}

/* ---------- Revitalization work ---------- */

.section-ice { background: var(--paper-2); }

.languages-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 440px;
  gap: 48px;
  align-items: start;
}

.languages-image {
  margin: 0;
  width: 100%;
}

.languages-image img {
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: var(--radius-image);
  box-shadow: var(--shadow-image);
}

.project-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
}

.project-card {
  min-height: 260px;
  padding: 28px 28px 28px 0;
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.project-card:nth-child(3n + 2),
.project-card:nth-child(3n + 3) {
  padding-left: 28px;
}

.project-card:nth-child(3n) {
  border-right: 0;
}

.project-card h3 {
  font-size: 25px;
}

.project-card p {
  font-size: var(--text-card);
  line-height: 1.55;
}

.project-card .institution,
.project-card .year {
  display: block;
  line-height: 1.45;
}

.project-card .institution {
  margin-top: 18px;
  color: var(--accent);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.project-card .year {
  margin-top: 4px;
  color: var(--ink);
  font-size: var(--text-small);
  font-weight: 400;
  letter-spacing: 0;
  text-transform: none;
}

/* ---------- Talks ---------- */

.talks-layout {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(0, 1.05fr);
  gap: 64px;
  align-items: start;
}

.talks-photos {
  position: sticky;
  top: 104px;
  display: grid;
  gap: 24px;
}

.talks-photo {
  margin: 0;
}

.talks-photo img {
  width: 100%;
  height: auto;
  border-radius: var(--radius-image);
  box-shadow: var(--shadow-image);
}

.talks-list {
  border-top: 1px solid var(--line);
}

.talk-item {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr) 110px;
  gap: 18px;
  align-items: start;
  padding: 18px 0;
  border-bottom: 1px solid var(--line);
  font-size: 16px;
}

.talk-place,
.talk-date {
  font-weight: 400;
  line-height: 1.5;
}

.talk-place { color: var(--accent); }

.talk-date { color: var(--ink); }

.talk-item p {
  margin: 0;
  font-size: 16px;
  line-height: 1.5;
}

/* ---------- Recognition ---------- */

#recognition {
  padding-top: 0;
  padding-bottom: 0;
  background: var(--paper);
}

.recognition-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  border-top: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}

.recognition-grid article {
  padding: 28px;
  border-right: 1px solid var(--line);
}

.recognition-grid article:last-child {
  border-right: 0;
}

.recognition-grid strong {
  display: block;
  margin-bottom: 8px;
  font-family: var(--font-serif);
  font-size: 23px;
  font-weight: 500;
}

.recognition-grid span {
  font-size: 16px;
  line-height: 1.5;
}

#recognition .section-divider {
  margin-top: var(--section-space-small);
}

/* ---------- Ornamental section divider ---------- */

.section-divider {
  width: 100%;
  overflow: hidden;
  background: var(--paper);
}

.section-divider img {
  display: block;
  width: 100%;
  max-width: none;
  height: auto;
}

/* ---------- Contact / footer ---------- */

.contact-section {
  padding: 48px 0;
  background: var(--paper-2);
  color: var(--ink);
  border-top: 1px solid var(--line);
}

.contact-section .eyebrow {
  color: var(--accent);
}

.contact-section h2 {
  margin-bottom: 0;
  font-size: clamp(30px, 3.5vw, 46px);
}

.contact-grid {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 80px;
  align-items: center;
}

.contact-links {
  display: grid;
  gap: 0;
}

.contact-links a {
  display: flex;
  margin-top: -58px;
  align-items: center;
  gap: 13px;
  width: fit-content;
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: 17px;
  font-weight: 400;
  text-decoration: none;
}

.contact-links a:first-child {
  margin-top: 0;
}

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

.contact-icon {
  display: block;
  width: 112px;
  height: 112px;
  flex: 0 0 112px;
  object-fit: contain;
}

.site-footer {
  padding: 28px 0;
  background: var(--paper-2);
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 13px;
}

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

/* ---------- Tablet ---------- */

@media (max-width: 950px) {
  .hero-grid,
  .two-col,
  .book-feature,
  .contact-grid,
  .talks-layout {
    grid-template-columns: 1fr;
    gap: 52px;
  }

  .languages-content {
    grid-template-columns: 1fr;
    gap: 36px;
  }

  .languages-image {
    max-width: 680px;
  }

  .portrait-wrap {
    justify-self: start;
    max-width: 350px;
  }

  .book-cover,
  .talks-photos {
    max-width: 760px;
  }

  .talks-photos {
    position: static;
    gap: 20px;
  }

  .cards-3,
  .project-grid,
  .recognition-grid {
    grid-template-columns: 1fr 1fr;
  }

  .project-card:nth-child(n) {
    padding: 28px 24px 28px 0;
    border-right: 1px solid var(--line);
  }

  .project-card:nth-child(even) {
    padding-left: 24px;
    border-right: 0;
  }

  .recognition-grid article:nth-child(2) {
    border-right: 0;
  }

  .recognition-grid article:nth-child(-n + 2) {
    border-bottom: 1px solid var(--line);
  }
}

/* ---------- Mobile ---------- */

@media (max-width: 720px) {
  :root {
    --shell: min(100% - 28px, 1180px);
    --section-space: 76px;
    --section-space-small: 60px;
    --text-body: 17px;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 64px;
    right: 14px;
    left: 14px;
    flex-direction: column;
    align-items: stretch;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--paper);
    box-shadow: 0 16px 46px rgba(19, 33, 31, 0.12);
  }

  .site-nav.open { display: flex; }

  .menu-button { display: inline-block; }

  .hero { padding-top: 60px; }

  h1 { font-size: clamp(54px, 17vw, 82px); }

  .cards-3,
  .project-grid,
  .recognition-grid {
    grid-template-columns: 1fr;
  }

  .project-card:nth-child(n) {
    padding: 28px 0;
    border-right: 0;
  }

  .recognition-grid article:nth-child(n) {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .recognition-grid article:last-child {
    border-bottom: 0;
  }

  .recognition-strip {
    grid-template-columns: 1fr;
    gap: 6px;
  }

  .talk-item {
    grid-template-columns: 1fr;
    gap: 4px;
    padding: 16px 0;
  }

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

/* ---------- Analytics consent ---------- */

.analytics-consent {
  position: fixed;
  right: 20px;
  bottom: 20px;
  left: 20px;
  z-index: 1000;
  padding: 22px 0;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--paper);
  box-shadow: 0 14px 50px rgba(19, 33, 31, 0.18);
}

.analytics-consent[hidden] {
  display: none;
}

.analytics-consent-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 0 24px;

  /* Kseniia uses analytics... */
  font-size: 17px;
  font-weight: 600;
  line-height: 1.45;
}

.analytics-consent-actions {
  display: flex;
  align-items: center;
  flex-shrink: 0;
  gap: 12px;
}

.analytics-choice {
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--ink);

  /* Both buttons bold */
  font: inherit;
  font-size: 14px;
  font-weight: 600;

  cursor: pointer;
  text-decoration: none;
  white-space: nowrap;
}

.analytics-choice.allow {
  border-color: var(--accent);
  background: var(--accent);
  color: var(--white);
}

.analytics-choice:hover {
  opacity: 0.78;
}

@media (max-width: 720px) {
  .analytics-consent {
    right: 12px;
    bottom: 12px;
    left: 12px;
    padding: 18px 0;
  }

  .analytics-consent-inner {
    align-items: stretch;
    flex-direction: column;
    gap: 16px;
    padding: 0 18px;
    font-size: 16px;
  }

  .analytics-consent-actions {
    width: 100%;
    gap: 10px;
  }

  .analytics-choice {
    flex: 1;
    white-space: normal;
  }
}
