@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/source-serif-4-cyrillic-400-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/source-serif-4-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/source-serif-4-cyrillic-600-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/source-serif-4-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/source-serif-4-cyrillic-500-italic.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Source Serif 4";
  font-style: italic;
  font-weight: 500;
  font-display: swap;
  src: url("/fonts/source-serif-4-latin-500-italic.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/source-sans-3-cyrillic-400-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/fonts/source-sans-3-latin-400-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/source-sans-3-cyrillic-600-normal.woff2") format("woff2");
  unicode-range: U+0301, U+0400-045F, U+0490-0491, U+04B0-04B1, U+2116;
}
@font-face {
  font-family: "Source Sans 3";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/fonts/source-sans-3-latin-600-normal.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

:root {
  color-scheme: light;
  --bg: #efeae2;
  --surface: #f7f4ee;
  --ink: #1c1916;
  --muted: #4a453e;
  --faint: #6f685e;
  --line: rgba(28, 25, 22, 0.14);
  --accent: #1f3d36;
  --brass: #a68455;
  --serif: "Source Serif 4", "Palatino Linotype", Palatino, "Times New Roman", serif;
  --sans: "Source Sans 3", "Segoe UI", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.5;
  color: var(--ink);
  background:
    radial-gradient(900px 420px at 0% -10%, rgba(255, 255, 255, 0.75), transparent 55%),
    var(--bg);
}

p { margin: 0; }
button, input, textarea, select { font: inherit; color: inherit; }
button { cursor: pointer; }
::selection { background: #eadcc4; }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.skip {
  position: absolute;
  left: 12px;
  top: -48px;
  background: var(--surface);
  color: var(--ink);
  padding: 8px 12px;
  border-radius: 8px;
  z-index: 5;
}
.skip:focus { top: 12px; }

.page {
  max-width: 1080px;
  margin: 0 auto;
  padding: 22px 28px 56px;
}

.topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  margin-bottom: 22px;
}

.langs {
  display: flex;
  gap: 4px;
  padding: 4px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid var(--line);
  border-radius: 999px;
}
.langs button {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-weight: 600;
  font-size: 13px;
  letter-spacing: 0.08em;
  padding: 8px 12px;
  border-radius: 999px;
}
.langs button[aria-pressed="true"] {
  background: var(--accent);
  color: #f6f3ec;
}

.layout {
  display: grid;
  grid-template-columns: minmax(260px, 320px) minmax(0, 1fr);
  gap: 56px;
  align-items: start;
}

.identity {
  position: sticky;
  top: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 12px 12px 20px;
  box-shadow: 0 20px 50px rgba(36, 28, 18, 0.06);
}

.portrait {
  aspect-ratio: 1;
  border-radius: 16px;
  overflow: hidden;
  background: #fff;
}
.portrait img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center center;
}

.id-body { padding: 4px 8px 0; }

.kicker {
  margin: 16px 0 0;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
}

h1 {
  margin: 8px 0 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(34px, 4vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.025em;
}
h1::after {
  content: "";
  display: block;
  width: 42px;
  height: 2px;
  margin-top: 12px;
  background: var(--brass);
}

.role {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-style: italic;
  font-weight: 500;
  font-size: 1.12rem;
  line-height: 1.35;
}
.location {
  margin: 6px 0 0;
  color: var(--muted);
}

.spoken, .contacts {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  list-style: none;
  padding: 0;
  margin: 16px 0 0;
}
.contacts { margin-top: 14px; gap: 2px; }
.lang-name { font-weight: 600; }
.lang-level { color: var(--muted); }
.lang-level::before {
  content: "·";
  margin: 0 6px;
  color: var(--faint);
}
.contacts a,
.contacts .presence {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
}
.contacts a {
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(31, 61, 54, 0.4);
}
.contacts .ico,
.contacts .logo {
  width: 16px;
  height: 16px;
  flex: none;
  display: block;
}
.contacts img.logo { border-radius: 3px; }

.cv {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  margin-top: 18px;
  padding: 14px 16px;
  background: var(--accent);
  color: #f6f3ec;
  text-decoration: none;
  border-radius: 14px;
  font-weight: 600;
}
.cv span { line-height: 1.25; }
.cv small {
  font-weight: 500;
  letter-spacing: 0.04em;
  opacity: 0.8;
  white-space: nowrap;
}
.cv:hover { background: #17332c; }

.availability {
  margin: 14px 0 0;
  color: var(--muted);
  font-size: 0.98rem;
  line-height: 1.45;
}
.blue-card {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  color: var(--ink);
  font-size: 0.84rem;
  line-height: 1.2;
  white-space: nowrap;
}
.blue-card img {
  width: 22px;
  height: 14px;
  flex: none;
  border-radius: 2px;
  display: block;
}

.story { hyphens: auto; }
.story > .section:first-child { margin-top: 6px; }

.section { margin-top: 36px; }
.section h2 {
  margin: 0 0 14px;
  font-family: var(--sans);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}

.summary {
  font-family: var(--serif);
  font-size: 1.28rem;
  font-weight: 400;
  line-height: 1.48;
  white-space: pre-line;
}
.role, .location, .kicker, .availability, .blue-card { overflow-wrap: break-word; }

.group + .group { margin-top: 18px; }
.group h3 {
  margin: 0 0 8px;
  font-family: var(--sans);
  font-size: 1rem;
  font-weight: 600;
}
.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  list-style: none;
  padding: 0;
  margin: 0;
}
.chips li {
  background: rgba(255, 255, 255, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 11px;
  font-size: 0.95rem;
}

.entry {
  display: grid;
  grid-template-columns: 11.5rem minmax(0, 1fr);
  gap: 6px 22px;
  padding: 16px 0;
  border-top: 1px solid var(--line);
}
.when {
  margin: 0;
  padding-top: 4px;
  color: var(--muted);
  font-size: 0.92rem;
}
.entry h3 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.28rem;
  font-weight: 600;
  line-height: 1.25;
  letter-spacing: -0.015em;
}
.org { margin: 4px 0 0; color: var(--muted); }
.scan {
  display: inline-flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 8px;
  color: var(--accent);
  font-size: 0.92rem;
  font-weight: 600;
  text-underline-offset: 3px;
}
.scan small { color: var(--muted); font-weight: 500; }
.entry ul { margin: 8px 0 0; padding-left: 1.15rem; }
.entry li { margin: 4px 0; }
.entry li, .summary, .doc { overflow-wrap: break-word; }

.doc {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  align-items: baseline;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  color: inherit;
  text-decoration: none;
}
.doc strong { font-weight: 600; }
.meta { color: var(--muted); font-size: 0.92rem; white-space: nowrap; }
.doc:hover strong { color: var(--accent); }

.interests { font-size: 1.02rem; }

.footer {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  margin-top: 42px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}
.footer a { color: var(--muted); }

.legal {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 4px 16px;
}
.legal button {
  border: 0;
  background: transparent;
  padding: 8px 0;
  color: var(--muted);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: rgba(31, 61, 54, 0.35);
}

.legal-dialog {
  width: min(36rem, calc(100vw - 28px));
  max-height: min(78vh, 40rem);
  margin: auto;
  padding: 22px 22px 26px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--surface);
  color: var(--ink);
  box-shadow: 0 24px 60px rgba(36, 28, 18, 0.18);
}
.legal-copy {
  clear: both;
  max-height: min(60vh, 32rem);
  overflow: auto;
}
.legal-dialog::backdrop { background: rgba(28, 25, 22, 0.46); }
.legal-dialog form {
  float: right;
  margin: 0 0 8px 12px;
}
.legal-dialog h2 {
  margin: 0 0 16px;
  font-family: var(--serif);
  font-size: 1.7rem;
  font-weight: 600;
  letter-spacing: -0.02em;
  line-height: 1.15;
  text-transform: none;
  color: var(--ink);
}
.legal-dialog h3 {
  margin: 16px 0 4px;
  font-family: var(--sans);
  font-size: 0.98rem;
  font-weight: 600;
}
.legal-dialog p { margin: 0 0 8px; }
.legal-dialog a { color: var(--accent); }
.legal-close {
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 0.92rem;
  font-weight: 600;
}

@media (max-width: 860px) {
  .page {
    padding: 12px 16px calc(36px + env(safe-area-inset-bottom, 0px));
    padding-left: max(16px, env(safe-area-inset-left, 0px));
    padding-right: max(16px, env(safe-area-inset-right, 0px));
  }
  .topbar { margin-bottom: 14px; }
  .langs button {
    min-width: 44px;
    min-height: 40px;
  }
  .layout { grid-template-columns: 1fr; gap: 8px; }
  .identity {
    position: static;
    display: grid;
    grid-template-columns: 124px minmax(0, 1fr);
    column-gap: 14px;
    align-items: start;
    padding: 14px 14px 16px;
    text-align: left;
  }
  .portrait {
    width: 124px;
    grid-column: 1;
    grid-row: 1 / span 4;
    margin: 0;
    align-self: start;
  }
  .id-body { display: contents; }
  .identity .kicker,
  .identity h1,
  .identity .role,
  .identity .location { grid-column: 2; }
  .identity .kicker { margin-top: 2px; }
  .identity h1 { font-size: 32px; }
  .identity h1::after { margin-top: 8px; }
  .identity .role { margin-top: 8px; font-size: 1.02rem; }
  .identity .spoken,
  .identity .contacts,
  .identity .cv,
  .identity .availability,
  .identity .blue-card { grid-column: 1 / -1; }
  .spoken {
    flex-direction: row;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 14px;
    margin-top: 14px;
  }
  .contacts { align-items: flex-start; margin-top: 8px; }
  .contacts a,
  .contacts .presence { min-height: 40px; }
  .cv { margin-top: 12px; }
  .blue-card {
    font-size: clamp(0.72rem, 3.1vw, 0.84rem);
  }
  .story > .section:first-child { margin-top: 18px; }
  .section { margin-top: 28px; }
  .summary { font-size: 1.12rem; }
  .entry {
    grid-template-columns: 1fr;
    gap: 2px;
    padding: 14px 0;
  }
  .when { padding-top: 0; }
  .entry h3 { font-size: 1.16rem; }
  .doc { flex-direction: column; gap: 2px; }
  .meta { white-space: normal; }
  .footer { flex-direction: column; align-items: flex-start; }
  .legal button { min-height: 44px; }
  .legal-dialog {
    width: min(36rem, calc(100vw - 20px));
    max-height: calc(100vh - 24px - env(safe-area-inset-bottom, 0px));
  }
  .legal-copy { max-height: calc(100vh - 150px - env(safe-area-inset-bottom, 0px)); }
  .legal-close { min-height: 40px; }
}

@media (max-width: 420px) {
  .page { padding-left: max(12px, env(safe-area-inset-left, 0px)); padding-right: max(12px, env(safe-area-inset-right, 0px)); }
  .identity { grid-template-columns: 104px minmax(0, 1fr); column-gap: 12px; }
  .portrait { width: 104px; }
  .identity h1 { font-size: 28px; }
  .identity .role { font-size: 0.98rem; }
}

@media print {
  body { background: white; }
  .skip, .langs, .legal, .legal-dialog { display: none !important; }
  .layout { display: block; }
  .identity { display: block; position: static; box-shadow: none; }
  .id-body { display: block; }
  .portrait { width: 180px; }
  a { color: inherit; text-decoration: none; }
}
