@font-face {
  font-family: Alumni; src: url('fonts/alumni-sans-cyrillic.woff2') format('woff2');
  font-weight: 300 700; font-display: swap; unicode-range: U+0400-052F, U+2116;
}
@font-face {
  font-family: Alumni; src: url('fonts/alumni-sans-latin.woff2') format('woff2');
  font-weight: 300 700; font-display: swap;
}
@font-face {
  font-family: Golos; src: url('fonts/golos-text-cyrillic.woff2') format('woff2');
  font-weight: 400 700; font-display: swap; unicode-range: U+0400-052F, U+2116;
}
@font-face {
  font-family: Golos; src: url('fonts/golos-text-latin.woff2') format('woff2');
  font-weight: 400 700; font-display: swap;
}

:root {
  color-scheme: light;
  --paper: #f4f7f8;
  --surface: #fff;
  --ink: #17181d;
  --muted: #535d68;
  --line: #d3dbe1;
  --steel: #aeb8c4;
  --brand: #7b001a;
  --accent: #7b001a;
  --accent-fog: #f1e1e6;
  --neutral: #e8edf0;
  --on-brand: #fff;
  --container: 1220px;
  --gutter: clamp(18px, 4.9vw, 72px);
  --display: Alumni, 'Arial Narrow', sans-serif;
  --body: Golos, Arial, sans-serif;
}

[data-theme='dark'] {
  color-scheme: dark;
  --paper: #17181d;
  --surface: #22242b;
  --ink: #f4f7f8;
  --muted: #b9c2cb;
  --line: #3d444e;
  --steel: #aeb8c4;
  --brand: #a90f3f;
  --accent: #ff9db9;
  --accent-fog: #412632;
  --neutral: #2e343d;
}

*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 400 15px/1.55 var(--body); }
a { color: inherit; text-decoration: none; }
button, input { color: inherit; font: inherit; }
button { cursor: pointer; }
button[hidden] { display: none; }
h1, h2, h3, p { margin: 0; }
::selection { background: var(--accent-fog); color: var(--ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
main:focus { outline: none; }
.skip { position: absolute; z-index: 2; top: 10px; left: 12px; padding: 10px 14px; transform: translateY(-200%); background: var(--surface); }
.skip:focus { transform: none; }
.visually-hidden { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }

.top { background: var(--surface); border-bottom: 1px solid var(--line); }
.top-inner, main, .footer { max-width: calc(var(--container) + var(--gutter) * 2); margin-inline: auto; padding-inline: var(--gutter); }
.top-inner { min-height: 76px; display: flex; align-items: center; justify-content: space-between; gap: 26px; }
.brand { display: flex; align-items: center; gap: 12px; color: var(--ink); font-size: .78rem; font-weight: 700; letter-spacing: .10em; line-height: 1.2; }
.brand-mark { display: grid; width: 39px; height: 39px; place-items: center; border-radius: 50%; background: var(--brand); color: white; font: 500 1.9rem/1 var(--display); }
.brand small { display: block; margin-top: 4px; color: var(--muted); font-size: .7rem; font-weight: 500; letter-spacing: .02em; }
.tabs { display: flex; align-self: stretch; gap: clamp(18px, 3.7vw, 53px); }
.tabs a { display: flex; position: relative; align-items: center; color: var(--muted); font-size: .9rem; font-weight: 500; white-space: nowrap; }
.tabs a[aria-current], .tabs a:hover { color: var(--accent); }
.tabs a[aria-current]::after { content: ''; position: absolute; inset: auto 0 -1px; height: 3px; background: var(--accent); }
.theme { display: flex; min-height: 42px; align-items: center; gap: 8px; padding: 6px 11px; border: 1px solid var(--line); border-radius: 6px; background: var(--surface); font-size: .76rem; white-space: nowrap; }
.theme:hover { border-color: var(--accent); }
.theme-icon { display: block; width: 14px; height: 14px; border: 1px solid currentColor; border-radius: 50%; background: linear-gradient(90deg, currentColor 50%, transparent 50%); }

main { min-height: calc(100vh - 166px); padding-block: clamp(36px, 5.5vw, 80px) 78px; }
.intro { border-bottom: 1px solid var(--line); padding-bottom: clamp(24px, 3.2vw, 44px); margin-bottom: 32px; }
h1 { font: 400 clamp(3.35rem, 8.3vw, 6rem)/.92 var(--display); letter-spacing: -.028em; overflow-wrap: anywhere; text-wrap: balance; }
.intro h1 span { color: var(--accent); }
.intro p { margin-top: 16px; max-width: 70ch; color: var(--muted); font-size: clamp(.9rem, 1.4vw, 1.05rem); }

.library-layout { display: grid; grid-template-columns: minmax(180px, 228px) minmax(0, 1fr); align-items: start; gap: clamp(24px, 4.1vw, 62px); }
.section-sidebar { position: sticky; top: 20px; }
.section-sidebar h2 { margin: 7px 12px 14px; font-size: .82rem; font-weight: 600; color: var(--muted); }
.section-list { display: grid; gap: 4px; }
.section-list a { display: flex; min-height: 43px; justify-content: space-between; align-items: center; gap: 10px; padding: 9px 12px; border-radius: 6px; font-size: .86rem; }
.section-list a:hover { background: var(--neutral); }
.section-list a[aria-current] { color: var(--accent); background: var(--accent-fog); font-weight: 600; }
.section-count { min-width: 16px; text-align: right; font-size: .75rem; color: var(--muted); font-variant-numeric: tabular-nums; }
.section-list a[aria-current] .section-count { color: inherit; }
.search-form { display: flex; align-items: center; min-height: 52px; gap: 15px; padding: 0 16px; border: 1px solid var(--line); border-radius: 7px; background: var(--surface); }
.search-form:focus-within { border-color: var(--accent); }
.search-form input { min-width: 0; width: 100%; height: 50px; padding: 0; border: 0; outline: 0; background: transparent; font-size: .92rem; }
.search-form input::placeholder { color: var(--muted); }
.search-form input::-webkit-search-cancel-button { display: none; }
.search-form button { padding: 7px 0; border: 0; background: transparent; color: var(--accent); font-size: .78rem; }
.search-icon { position: relative; flex: 0 0 14px; height: 14px; border: 1.5px solid var(--muted); border-radius: 50%; margin-right: 4px; }
.search-icon::after { content: ''; position: absolute; width: 6px; height: 1.5px; background: var(--muted); transform: rotate(45deg); left: 10px; top: 11px; }
.group { margin-top: 35px; }
.group + .group { margin-top: 43px; }
.group-heading { margin-bottom: 16px; }
.group-heading h2, .empty h2, .detail-panel h2 { font: 500 clamp(2rem, 3.7vw, 2.8rem)/.95 var(--display); letter-spacing: -.013em; }
.group-heading p { margin-top: 7px; color: var(--muted); font-size: .86rem; }
.material-grid, .product-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.material-card, .product-card, .detail-panel, .empty { border: 1px solid var(--line); border-radius: 13px 13px 5px 5px; background: var(--surface); }
.material-card, .product-card { min-width: 0; }
.material-card:hover { border-color: var(--accent); }
.material-link { display: flex; height: 100%; flex-direction: column; border-radius: inherit; }
.cover { position: relative; min-height: 168px; display: flex; flex-direction: column; justify-content: space-between; isolation: isolate; overflow: hidden; padding: 18px 22px; border-radius: 12px 12px 0 0; background: #7b001a; color: #fff; }
.cover-harvard { background: #252933; }
.cover::before, .cover::after { content: ''; position: absolute; width: 215px; height: 215px; pointer-events: none; z-index: -1; }
.cover::before { right: -45px; top: -6px; transform: rotate(32deg); border: 1px solid #ffffff6b; box-shadow: inset 0 0 0 20px #ffffff0b, inset 0 0 0 21px #ffffff40; }
.cover::after { right: 12px; top: 37px; border-radius: 50%; border: 1px solid #ffffff5f; }
.cover-harvard::before { border-radius: 50%; right: -17px; top: 13px; }
.cover-harvard::after { border-radius: 0; transform: rotate(45deg); right: -15px; top: 34px; }
.cover span { color: #fff2f5; font-size: .65rem; font-weight: 500; letter-spacing: .11em; }
.cover strong { font: 400 3.6rem/.72 var(--display); letter-spacing: -.025em; }
.card-body { padding: 16px 20px 18px; flex: 1; display: flex; flex-direction: column; align-items: flex-start; }
.status { display: inline-flex; width: fit-content; padding: 4px 8px; border-radius: 5px; background: var(--neutral); color: var(--ink); font-size: .71rem; font-weight: 500; }
.status-ready { background: var(--accent-fog); color: var(--accent); }
.card-body h3 { margin-top: 9px; font: 500 clamp(1.75rem, 3vw, 2.15rem)/.98 var(--display); }
.card-body p { margin: 5px 0 16px; color: var(--muted); font-size: .83rem; }
.card-action { display: flex; width: 100%; justify-content: space-between; align-items: center; margin-top: auto; padding-top: 10px; border-top: 1px solid var(--line); color: var(--accent); font-size: .79rem; font-weight: 600; }
.arrow { font-family: var(--body); font-size: 1.05em; }

.empty { margin-top: 20px; padding: 24px; }
.empty.compact { margin-top: 0; border-style: dashed; background: transparent; padding: 15px 19px; }
.empty p { color: var(--muted); }
.empty h2 + p { margin: 8px 0 17px; }
.product-card { display: flex; gap: 10px; flex-direction: column; align-items: flex-start; padding: clamp(19px, 3.1vw, 35px); border-top: 3px solid var(--accent); }
.product-card h2 { font: 500 clamp(2rem, 4.5vw, 3.4rem)/.92 var(--display); text-wrap: balance; }
.product-card p { margin-bottom: 12px; color: var(--muted); }
.product-card .button { margin-top: auto; }
.product-format { color: var(--accent); font-size: .75rem; font-weight: 600; }
.detail { width: min(100%, 785px); }
.back { display: inline-flex; gap: 8px; color: var(--accent); font-size: .88rem; margin-bottom: 16px; }
.back:hover, .detail-meta a:hover { text-decoration: underline; text-underline-offset: .17em; }
.detail-panel { padding: clamp(22px, 5vw, 56px); }
.detail-meta { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.detail-meta a { color: var(--accent); font-size: .83rem; }
.detail-panel h1 { margin: 15px 0 10px; font-size: clamp(3.15rem, 7vw, 5.5rem); }
.lead { color: var(--muted); font-size: 1.1rem; }
.detail-description { margin-top: 22px; max-width: 66ch; }
.detail-panel h2 { margin-top: 27px; }
.contents { padding-left: 1.3em; }
.facts { display: flex; gap: 24px; flex-wrap: wrap; margin: 26px 0; padding: 16px 0; border-block: 1px solid var(--line); }
.facts dt { color: var(--muted); font-size: .75rem; }
.facts dd { margin: 4px 0 0; }
.actions { display: flex; gap: 9px; flex-wrap: wrap; margin-top: 20px; }
.button { display: inline-flex; min-height: 44px; align-items: center; justify-content: center; gap: 9px; border: 1px solid transparent; border-radius: 6px; padding: 9px 15px; font-size: .83rem; font-weight: 600; }
.button.primary { background: var(--brand); color: var(--on-brand); }
.button.primary:hover { background: #a90f3f; }
[data-theme='dark'] .button.primary:hover { background: #7b001a; }
.button.secondary { border-color: var(--line); background: var(--surface); color: var(--accent); }
.button.secondary:hover { border-color: var(--accent); }
.demo-note { color: var(--muted); font-size: .83rem; }
.footer { display: flex; justify-content: space-between; gap: 14px; padding-block: 20px; border-top: 1px solid var(--line); color: var(--muted); font-size: .75rem; }
.noscript { max-width: var(--container); padding-inline: var(--gutter); margin: 1rem auto; }

@media (max-width: 760px) {
  .top-inner { display: grid; grid-template-columns: 1fr auto; gap: 0 16px; padding-top: 12px; }
  .tabs { grid-row: 2; grid-column: 1 / -1; gap: clamp(14px, 6vw, 34px); }
  .tabs a { min-height: 48px; font-size: .83rem; }
  .library-layout { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .section-sidebar { position: static; }
  .section-sidebar h2 { margin: 0 0 8px; }
  .section-list { display: flex; flex-wrap: wrap; gap: 6px; }
  .section-list a { min-height: 39px; padding: 7px 10px; border: 1px solid var(--line); font-size: .77rem; }
  .section-list a[aria-current] { border-color: transparent; }
  .section-count { min-width: 9px; }
  .intro { margin-bottom: 23px; }
}

@media (max-width: 480px) {
  .material-grid, .product-grid { grid-template-columns: 1fr; }
  .cover { min-height: 137px; }
  .cover strong { font-size: 3rem; }
  .group + .group { margin-top: 32px; }
  .footer { flex-wrap: wrap; }
}
