/* ------------------------------------------------------------------
   MFD '26 look: palette and type taken from events.mko-systems.ru/mfd
   page bg #000622 · text #ffffff · accent #f87646 · menu/footer #303030
   menu hover #2b61bf · cards: 32px radius, 1px coral border, navy gradient
   font: Open Sans (bundled locally, SIL OFL 1.1 — see fonts/LICENSE)
   ------------------------------------------------------------------ */
@font-face { font-family: "Open Sans Variable"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url(fonts/open-sans-cyrillic-wght-normal.woff2) format("woff2-variations");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Open Sans Variable"; font-style: normal; font-weight: 300 800; font-display: swap;
  src: url(fonts/open-sans-latin-wght-normal.woff2) format("woff2-variations");
  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: "Open Sans Variable"; font-style: italic; font-weight: 300 800; font-display: swap;
  src: url(fonts/open-sans-cyrillic-wght-italic.woff2) format("woff2-variations");
  unicode-range: U+0301,U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116; }
@font-face { font-family: "Open Sans Variable"; font-style: italic; font-weight: 300 800; font-display: swap;
  src: url(fonts/open-sans-latin-wght-italic.woff2) format("woff2-variations");
  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 {
  --bg: #000622;
  --bar: #303030;
  --fg: #ffffff;
  --muted: rgba(255, 255, 255, .68);
  --faint: rgba(255, 255, 255, .45);
  --accent: #f87646;
  --accent-rgb: 248, 118, 70;
  --blue: #2b61bf;
  --line: rgba(255, 255, 255, .14);
  --card-grad: linear-gradient(0.129turn, rgba(4, 14, 39, 1) 0%, rgba(65, 108, 164, .23) 100%);
  --r-card: 32px;
  --r-small: 20px;
  --font: "Open Sans Variable", "Open Sans", system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; background: var(--bg); }
body { margin: 0; background: var(--bg); color: var(--fg); font: 400 17px/1.6 var(--font); }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }
::selection { background: var(--accent); color: var(--bg); }

/* small coral caps labels — like "КОНФЕРЕНЦИЯ" / "УЧАСТИЕ БЕСПЛАТНОЕ" on the site */
.crumbs, .index h2, .collection h2, .article-toc summary, .pager .lbl, .card-meta {
  font-size: .78rem; font-weight: 500; letter-spacing: .14em; text-transform: uppercase; color: var(--accent);
}

/* --- site button: 1px white border, square corners, coral fill on hover --- */
.topnav summary, .pager .home, .lang-switch {
  display: inline-flex; align-items: center; justify-content: center;
  padding: .45rem 1rem; border: 1px solid #fff; border-radius: 0;
  color: #fff; font-size: .78rem; font-weight: 500; letter-spacing: .08em; text-transform: uppercase;
  background: transparent; cursor: pointer; text-decoration: none;
  transition: background-color .2s ease-in-out, border-color .2s ease-in-out, color .2s ease-in-out;
}
.topnav summary:hover, .pager .home:hover { background: var(--accent); border-color: var(--accent); color: #fff; text-decoration: none; }

/* --- top bar (site menu: #303030, white caps items, blue hover) --- */
.topbar {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
  min-height: 64px; padding: .7rem 1.5rem; background: var(--bar);
}
.topbar .brand {
  color: #fff; font-weight: 700; font-size: .9rem; letter-spacing: .08em; text-transform: uppercase;
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; transition: color .3s ease-in-out;
}
.topbar .brand:hover { color: var(--blue); text-decoration: none; }
.brand-short { display: none; }
.topbar-right { display: flex; align-items: center; gap: .6rem; flex-shrink: 0; }
.topnav details { position: relative; }
.topnav summary { list-style: none; user-select: none; white-space: nowrap; }
.topnav summary::-webkit-details-marker { display: none; }
.topnav details[open] summary { background: var(--accent); border-color: var(--accent); }
.topnav .toc-list {
  position: absolute; right: 0; top: calc(100% + .7rem);
  width: min(30rem, 92vw); max-height: 70vh; overflow: auto;
  margin: 0; padding: .6rem .8rem;
  background: var(--bar); border: 1px solid rgba(255, 255, 255, .12); box-shadow: 0 18px 44px rgba(0, 0, 0, .55);
}
.topnav .toc-list .num { background: var(--bar); }
.topnav .toc-list li a:hover .t { color: var(--blue); }

/* --- language switch --- */
.lang-switch { padding: 0; overflow: hidden; }
.lang-switch > * { padding: .45rem .8rem; color: #fff; font-weight: 600; text-decoration: none; transition: background-color .2s ease-in-out; }
.lang-switch .on { background: #fff; color: var(--bg); }
.lang-switch a:hover { background: var(--accent); color: #fff; text-decoration: none; }

/* --- article list as a timeline (like the programme block on the site) --- */
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-list li { position: relative; }
.toc-list li::before { content: ""; position: absolute; left: calc(1.6rem - 1px); top: 0; bottom: 0; width: 2px; background: var(--accent); }
.toc-list li:first-child::before { top: 50%; }
.toc-list li:last-child::before { bottom: 50%; }
.toc-list li:only-child::before { display: none; }
.toc-list li a {
  position: relative; display: grid; grid-template-columns: 1.8rem 1fr; grid-template-rows: auto auto;
  gap: 0 1rem; padding: .7rem .7rem; color: #fff; text-decoration: none; font-size: .93rem; line-height: 1.35;
}
.toc-list .num {
  grid-row: 1 / span 2; align-self: center; position: relative; z-index: 1;
  width: 1.8rem; height: 1.8rem; border-radius: 50%; border: 1px solid var(--accent); background: var(--bg);
  display: flex; align-items: center; justify-content: center; font-size: .76rem; font-weight: 600;
}
.toc-list .t { font-weight: 500; transition: color .2s ease-in-out; }
.toc-list .au { color: var(--muted); font-size: .85em; }
.toc-list li a:hover .t { color: var(--accent); }
.toc-list li.current .num { background: var(--accent); border-color: var(--accent); }
.toc-list li.current .t { font-weight: 700; }

/* --- layout --- */
main { max-width: 48rem; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; }

/* --- index --- */
.index h1 { font-size: 2.4rem; line-height: 1.15; font-weight: 700; text-transform: uppercase; margin: 1rem 0 1.2rem; }
.index .lead { font-size: 1.1rem; line-height: 1.6; }
.index h2 { margin: 3rem 0 1.2rem; }
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; }
.card a {
  display: grid; grid-template-columns: 3rem 1fr; gap: 1rem;
  padding: 1.5rem 1.75rem; border-radius: var(--r-card); border: 1px solid var(--accent);
  background: var(--card-grad); color: #fff; text-decoration: none;
  transition: transform .15s ease-in-out, box-shadow .2s ease-in-out;
}
.card a:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(var(--accent-rgb), .18); text-decoration: none; }
.card .num { font-size: 2rem; font-weight: 800; line-height: 1; color: var(--accent); padding-top: .1rem; }
.card-body { display: flex; flex-direction: column; gap: .35rem; }
.card-title { font-size: 1.08rem; font-weight: 700; line-height: 1.35; text-transform: uppercase; letter-spacing: .01em; }
.card-author { color: var(--muted); font-size: .92rem; }
.card-excerpt { font-size: .97rem; line-height: 1.55; color: rgba(255, 255, 255, .86); }
.card-meta { color: var(--faint); font-weight: 500; margin-top: .35rem; }

/* --- article --- */
.crumbs { margin: 0 0 1.4rem; }
.crumbs a { color: var(--accent); }
.crumbs .sep { margin: 0 .5rem; opacity: .6; }
.article h1 { font-size: 2.1rem; line-height: 1.2; font-weight: 700; text-transform: uppercase; margin: 0 0 1rem; }
.byline { display: flex; flex-wrap: wrap; gap: .2rem .7rem; align-items: baseline; font-size: .95rem; color: var(--muted); margin: 0 0 1.6rem; }
.byline .author { color: #fff; font-weight: 600; }
.byline .author-meta::before { content: "·"; margin-right: .7rem; }
.translation-note { font-size: .88rem; color: var(--muted); margin: -.8rem 0 1.6rem; }
.index .translation-note { margin: -.4rem 0 1.2rem; }
.translation-note a { color: var(--accent); }

.article-toc { margin: 0 0 2.2rem; padding: 1.1rem 1.4rem; border: 1px solid var(--accent); border-radius: var(--r-small); background: var(--card-grad); font-size: .93rem; }
.article-toc summary { cursor: pointer; list-style: none; }
.article-toc summary::-webkit-details-marker { display: none; }
.article-toc summary::before { content: "▾"; display: inline-block; margin-right: .5rem; transition: transform .2s; }
.article-toc details:not([open]) summary::before { transform: rotate(-90deg); }
.article-toc ul { list-style: none; margin: .8rem 0 0; padding: 0; }
.article-toc li { padding: .2rem 0; }
.article-toc li.lvl3 { padding-left: 1.2rem; font-size: .92em; }
.article-toc a { color: #fff; }
.article-toc a:hover { color: var(--accent); text-decoration: none; }

.article-body > p { margin: 0 0 1.15rem; }
.article-body h2 { font-size: 1.35rem; line-height: 1.3; font-weight: 700; text-transform: uppercase; margin: 2.6rem 0 1rem; }
.article-body h3 { font-size: 1.08rem; line-height: 1.35; font-weight: 600; color: var(--accent); margin: 2rem 0 .7rem; }
.article-body h2 + h3 { margin-top: 1rem; }
.article-body ul, .article-body ol { margin: 0 0 1.15rem; padding-left: 1.5rem; }
.article-body li { margin: .35rem 0; }
.article-body li::marker { color: var(--accent); }
.article-body a { text-decoration: underline; text-decoration-color: rgba(var(--accent-rgb), .5); text-underline-offset: 3px; overflow-wrap: anywhere; }
.article-body a:hover { text-decoration-color: var(--accent); }
.article-body figure { margin: 1.8rem 0; text-align: center; }
.article-body figure img { max-width: 100%; height: auto; border-radius: 12px; border: 1px solid var(--line); background: #fff; }
.article-body figcaption { font-size: .86rem; color: var(--muted); margin-top: .6rem; line-height: 1.45; }
.article-body figure + figure { margin-top: -.6rem; }
.article-body figure.placeholder img { max-height: 160px; width: auto; opacity: .5; }
.article-body figcaption.note { font-style: italic; }
.article-body code { font: .9em ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; background: rgba(255, 255, 255, .08); padding: .1em .35em; border-radius: 4px; }

.source { font-size: .85rem; color: var(--muted); border-top: 1px solid var(--line); padding-top: 1.1rem; margin: 2.6rem 0 1.6rem; }

.pager { display: grid; grid-template-columns: 1fr auto 1fr; gap: 1rem; align-items: stretch; margin: 0 0 2.8rem; }
.pager a { text-decoration: none; color: #fff; }
.pager .prev, .pager .next {
  display: flex; flex-direction: column; gap: .35rem; padding: 1rem 1.25rem;
  border: 1px solid var(--accent); border-radius: var(--r-small); background: var(--card-grad);
  transition: transform .15s ease-in-out, box-shadow .2s ease-in-out;
}
.pager .next { text-align: right; }
.pager .prev:hover, .pager .next:hover { transform: translateY(-2px); box-shadow: 0 12px 34px rgba(var(--accent-rgb), .18); text-decoration: none; }
.pager .lbl { font-size: .72rem; }
.pager .ttl { font-size: .95rem; line-height: 1.35; font-weight: 500; }
.pager .home { align-self: center; }
.pager .empty { border: none; background: none; }

.collection { margin-top: 1rem; }
.collection h2 { margin: 0 0 .8rem; }

/* --- footer (site footer: #303030, light 300 text, white underlined links) --- */
.site-footer { background: var(--bar); margin-top: 2rem; padding: 2.2rem 1.5rem 2.6rem; font-size: .85rem; font-weight: 300; line-height: 1.6; color: #fff; }
.site-footer p { max-width: 48rem; margin: 0 auto; }
.site-footer a { color: #fff; text-decoration: none; border-bottom: 1px solid #fff; }
.site-footer a:hover { color: var(--accent); border-bottom-color: var(--accent); }

@media (max-width: 640px) {
  body { font-size: 16px; }
  main { padding: 1.8rem 1rem 3rem; }
  .topbar { padding: .6rem 1rem; gap: .6rem; }
  .topbar .brand { font-size: .8rem; letter-spacing: .06em; }
  .brand-full { display: none; }
  .brand-short { display: inline; }
  .topnav summary, .pager .home, .lang-switch > * { padding: .4rem .7rem; font-size: .72rem; }
  .index h1, .article h1 { font-size: 1.55rem; }
  .card a { grid-template-columns: 2.2rem 1fr; gap: .8rem; padding: 1.1rem 1.2rem; border-radius: 14px; }
  .card .num { font-size: 1.5rem; }
  .article-toc, .pager .prev, .pager .next { border-radius: 14px; }
  .pager { grid-template-columns: 1fr; }
  .pager .home { justify-self: center; order: 3; }
  .pager .empty { display: none; }
  .pager .next { text-align: left; }
}
@media print {
  .topbar, .pager, .collection, .site-footer, .article-toc, .translation-note { display: none; }
  html, body { background: #fff; color: #000; font-size: 12pt; }
  a, .crumbs, .article-body h3, .byline .author { color: #000; }
  .article-body figure img { border-color: #ccc; }
}
