@font-face {
  font-family: 'Onest';
  src: url('assets/fonts/onest-cyrillic.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0400-045F,U+0490-0491,U+04B0-04B1,U+2116;
}
@font-face {
  font-family: 'Onest';
  src: url('assets/fonts/onest-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  unicode-range: U+0000-00FF,U+2000-206F,U+20AC,U+2212;
}


* { box-sizing: border-box; }
body { margin: 0; background: var(--background); color: var(--text); font-family: 'Onest', -apple-system, BlinkMacSystemFont, sans-serif; -webkit-font-smoothing: antialiased; font-size: var(--font-body); letter-spacing: -.025em; }
button, input { font: inherit; appearance: none; -webkit-appearance: none; }
button { cursor: pointer; color: inherit; }
a { color: inherit; }
svg { display: block; width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; flex-shrink: 0; }
.ui-icon { display: inline-block; width: var(--font-lead); height: var(--font-lead); vertical-align: middle; flex-shrink: 0; }
button { -webkit-tap-highlight-color: transparent; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--active); outline-offset: var(--space-1); }
.container { width: min(calc(100% - var(--page-gutter) * 2), var(--page-max-width)); margin-inline: auto; }
.sr-only { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; border: 0; }
.skip-link { position: fixed; left: var(--space-5); top: var(--space-4); z-index: 10; padding: var(--space-3) var(--space-4); background: var(--accent); color: var(--color-101212); transform: translateY(-180%); }
.skip-link:focus { transform: translateY(0); }
.header-inner { min-height: 76px; display: flex; align-items: center; gap: var(--space-7); }
.brand { display: inline-flex; align-items: center; gap: var(--space-4); text-decoration: none; flex-shrink: 0; }
.brand-mark { width: 42px; height: 42px; stroke: none; overflow: visible; }
.logo-body { fill: var(--text); }
.logo-sector { fill: var(--accent); }
.brand span { font-size: var(--font-2xl); font-weight: 650; letter-spacing: -1.3px; }
.navigation { display: flex; align-self: stretch; align-items: center; gap: var(--space-6); }
.nav-item { border: 0; background: none; min-height: 40px; padding: var(--space-2) 0; display: inline-flex; align-items: center; gap: var(--space-2); font-size: var(--font-body); font-weight: 450; letter-spacing: -.035em; white-space: nowrap; }
.nav-item:hover, .nav-item.is-active { color: var(--active); text-decoration: underline; text-underline-offset: 7px; }
.new-badge { color: var(--color-101212); background: var(--accent); font-size: var(--font-xs); font-weight: 650; line-height: 1; padding: var(--space-half) var(--space-compact); border-radius: var(--radius-sm); letter-spacing: -.015em; }
.header-tools { margin-left: auto; display: flex; align-items: center; gap: var(--space-4); min-width: 0; }
.search-field { border: var(--border-width) solid var(--line); border-radius: var(--radius-control); display: flex; align-items: center; gap: var(--space-2); padding: 0 var(--space-1) 0 var(--space-3); margin: 0; width: clamp(200px, 18vw, 270px); height: var(--control-size); background: var(--background); }
.search-submit { display: grid; place-items: center; flex-shrink: 0; width: var(--space-6); height: var(--space-6); padding: 0; border: 0; border-radius: var(--radius-sm); background: none; color: var(--muted); cursor: pointer; }
.search-submit:hover { color: var(--text); background: var(--surface); }
.search-field:focus-within { border-color: var(--active); }
.search-field svg { width: 17px; height: 17px; }
.search-field input { min-width: 0; width: 100%; background: none; color: var(--text); border: 0; padding: 0; outline: none; font-size: var(--font-sm); line-height: 20px; letter-spacing: -.015em; }
.search-field input::placeholder { color: var(--subtle); }
.icon-button { width: 36px; height: 36px; flex: 0 0 36px; display: inline-flex; align-items: center; justify-content: center; padding: 0; background: var(--surface); border: 1px solid var(--glass-border); border-radius: 50%; transition: background-color 160ms ease, border-color 160ms ease; }
.icon-button:hover:not(:disabled) { color: var(--active); }
.icon-button:disabled { opacity: .35; cursor: default; }
.theme-toggle { width: 34px; height: 34px; flex-basis: 34px; }
.theme-toggle svg { width: 18px; height: 18px; }
.theme-sun { display: none; }
[data-theme="dark"] .theme-moon { display: none; }
[data-theme="dark"] .theme-sun { display: block; }
.radar-section { padding-top: var(--space-1); }
.radar-toolbar { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); margin-bottom: var(--space-2); min-height: 40px; }
.editorial-tabs { display: flex; gap: var(--space-6); align-self: stretch; }
.editorial-tab { position: relative; background: none; border: 0; color: var(--muted); padding: var(--space-2) 0; min-height: 40px; font-size: var(--font-body); font-weight: 550; white-space: nowrap; letter-spacing: -.025em; }
.editorial-tab::after, .task-tab::after { content: ''; position: absolute; left: 0; right: 0; bottom: 0; height: 2px; background: transparent; }
.editorial-tab.is-active { color: var(--active); }
.editorial-tab.is-active::after, .task-tab.is-active::after { background: var(--active); }
.editorial-tab:hover { color: var(--text); }
.carousel-controls { display: flex; gap: var(--space-3); }
.carousel-controls svg { width: 17px; height: 17px; }
.story-carousel { display: flex; gap: var(--space-4); overflow-x: auto; overflow-y: hidden; scroll-snap-type: x mandatory; overscroll-behavior-x: contain; scrollbar-width: none; scroll-padding-inline: 0; margin-right: calc(var(--page-gutter) * -1); padding-right: var(--page-gutter); padding-bottom: var(--space-2); }
.story-carousel::-webkit-scrollbar { display: none; }
.story { flex: 0 0 clamp(300px, 30.4vw, 510px); min-width: 0; scroll-snap-align: start; }
.story-lead { flex-basis: clamp(500px, 53vw, 880px); }
.story-link { background: none; border: 0; text-align: left; display: block; width: 100%; padding: 0; }
.story-media { position: relative; display: block; height: clamp(240px, 26.4vw, 423px); border-radius: var(--radius-control); overflow: hidden; background: var(--surface); }
.story-media img { display: block; width: 100%; height: 100%; object-fit: cover; object-position: center top; }
.story-title { display: block; margin-top: var(--space-3); font-size: var(--font-lg); font-weight: 600; line-height: 1.3; letter-spacing: -.65px; text-wrap: pretty; }
.story-lead .story-title { font-size: var(--font-xl); letter-spacing: -.8px; }
.story-link:hover .story-title { text-decoration: underline; text-underline-offset: 4px; }
.story-meta { display: block; margin-top: var(--space-compact); font-size: var(--font-body); line-height: 1.5; color: var(--muted); letter-spacing: -.025em; }
.story-label { text-transform: uppercase; font-size: var(--font-caption); letter-spacing: .4px; margin-top: var(--space-2); }
.media-play { display: flex; align-items: center; justify-content: center; position: absolute; left: var(--space-4); bottom: var(--space-4); width: 34px; height: 34px; border: 1px solid var(--color-white); border-radius: 50%; background: var(--color-151515bf); color: var(--color-white); }
.media-play svg { width: 17px; height: 17px; fill: currentColor; margin-left: var(--space-half); }
.empty-state { color: var(--muted); padding: var(--space-7) 0; line-height: 1.6; }
.task-section { margin-top: var(--space-5); padding-top: var(--space-5); border-top: 1px solid var(--line); }
h2 { font-size: var(--font-3xl); letter-spacing: -1.3px; line-height: 1.2; margin: 0; font-weight: 650; }
.task-tabs { display: flex; gap: var(--space-6); margin-top: var(--space-2); margin-bottom: 0; overflow-x: auto; scrollbar-width: none; }
.task-tab { position: relative; border: 0; background: none; color: var(--muted); font-size: var(--font-body); padding: var(--space-3) 0; white-space: nowrap; letter-spacing: -.025em; }
.task-tab.is-active { color: var(--active); font-weight: 600; }
.task-tab:hover { color: var(--text); }
.task-list { min-width: 0; border-top: 1px solid var(--line); }
.prototype-note { font-size: var(--font-xs); color: var(--subtle); padding: var(--space-5) 0 var(--space-3); line-height: 1.5; }
.preview-dialog { width: min(520px, calc(100% - 32px)); max-height: calc(100% - 48px); border: 1px solid var(--line); border-radius: var(--space-3); padding: var(--space-5); background: var(--background); color: var(--text); }
.preview-dialog::backdrop { background: var(--overlay); }
.dialog-topline { display: flex; justify-content: space-between; align-items: center; gap: var(--space-4); margin-bottom: var(--space-5); }
.dialog-eyebrow { font-size: var(--font-caption); color: var(--muted); letter-spacing: .6px; }
.preview-dialog h2 { font-size: var(--font-xl); }
.preview-dialog p { font-size: var(--font-body); color: var(--muted); line-height: 1.6; margin: var(--space-4) 0 0; }
.preview-dialog .dialog-note { font-size: var(--font-sm); }
.dialog-back { border: 1px solid var(--line); border-radius: var(--radius); color: var(--text); padding: var(--space-2) var(--space-3); background: none; margin-top: var(--space-5); font-size: var(--font-label); min-height: 36px; }
.dialog-back:hover { border-color: var(--active); }
.noscript-note { font-size: var(--font-label); color: var(--muted); line-height: 1.5; }
@media (min-width: 1850px) { .story-carousel { margin-right: 0; padding-right: 0; } }
@media (max-width: 1250px) {
  .header-inner { gap: var(--space-5); }
  .navigation { gap: var(--space-4); }
  .nav-item { font-size: var(--font-label); }
  .brand span { font-size: var(--font-xl); }
  .brand-mark { width: 32px; height: 32px; }
  .header-tools { gap: var(--space-2); }
  .search-field { width: 180px; }
}
@media (max-width: 1050px) {
  .header-inner { flex-wrap: wrap; min-height: 0; gap: 0 var(--space-5); padding-top: var(--space-3); }
  .navigation { order: 3; width: 100%; gap: var(--space-5); min-height: 48px; }
  .nav-item { min-height: 44px; }
  .search-field { width: 220px; }
  .radar-section { padding-top: var(--space-2); }
  .story-media { height: 290px; }
  .story-lead { flex-basis: 62vw; }
  .story { flex-shrink: 0; }
  .story:not(.story-lead) { flex-basis: 39vw; }
}
@media (max-width: 680px) {
  
  .header-inner { gap: var(--space-2) var(--space-4); padding-top: var(--space-3); }
  .brand span { font-size: var(--font-xl); }
  .brand { gap: var(--space-2); }
  .brand-mark { width: 32px; height: 32px; }
  .header-tools { gap: var(--space-2); flex-wrap: wrap; }
  .search-field { width: 100%; height: var(--control-size); }
  .navigation { gap: var(--space-5); min-height: 48px; overflow-x: auto; scrollbar-width: none; }
  .nav-item { font-size: var(--font-sm); flex-shrink: 0; }
  .theme-toggle { flex-basis: 28px; width: 28px; height: 28px; }
  .radar-section { padding-top: var(--space-7); }
  .radar-toolbar { margin-bottom: var(--space-2); gap: var(--space-2); }
  .editorial-tabs { gap: var(--space-4); }
  .editorial-tab { font-size: var(--font-caption); min-height: 36px; }
  .carousel-controls { gap: var(--space-1); }
  .carousel-controls .icon-button { width: 28px; height: 28px; flex-basis: 28px; }
  .carousel-controls svg { width: 15px; height: 15px; }
  .story, .story:not(.story-lead), .story-lead { flex-basis: 86vw; }
  .story-carousel { gap: var(--space-3); }
  .story-media { height: auto; aspect-ratio: 16 / 9; }
  .story-title, .story-lead .story-title { font-size: var(--font-lead); line-height: 1.3; margin-top: var(--space-3); }
  .story-meta { font-size: var(--font-caption); }
  .task-section { margin-top: var(--space-5); padding-top: var(--space-5); }
  h2 { font-size: var(--font-xl); letter-spacing: -.5px; }
  .task-tabs { gap: var(--space-5); margin-top: var(--space-2); }
  .task-tab { font-size: var(--font-sm); flex-shrink: 0; }
}
@media (max-width: 390px) {
  
  .brand span { font-size: var(--font-lg); }
  .brand-mark { width: 27px; height: 27px; }
  .header-inner { column-gap: var(--space-2); }
  .header-tools { gap: var(--space-1); }
  .navigation { justify-content: space-between; gap: var(--space-3); }
  .nav-item { font-size: var(--font-caption); gap: var(--space-1); }
  .new-badge { font-size: var(--font-2xs); padding: var(--space-half) var(--space-1); }
  .editorial-tabs { gap: var(--space-3); }
  .editorial-tab { font-size: var(--font-xs); }
  .carousel-controls .icon-button { width: 25px; height: 25px; flex-basis: 25px; }
}
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { scroll-behavior: auto !important; transition: none !important; } }
@media (prefers-reduced-transparency: reduce) { .search-field, .icon-button { backdrop-filter: none; -webkit-backdrop-filter: none; background: var(--surface); } }

/* GPTCourses additions. The v3 tokens and shared component geometry above are retained. */
.catalog-explainer { color: var(--muted); font-size: var(--font-label); line-height: 1.6; margin: var(--space-3) 0 var(--space-4); max-width: 780px; }
.active-filters { display: flex; flex-wrap: wrap; gap: var(--space-2); margin-bottom: var(--space-3); }
.active-filters:empty { display: none; }
.active-filters button { border: 1px solid var(--line); border-radius: var(--radius-sm); background: var(--surface); color: var(--text); padding: var(--space-compact) var(--space-2); font-size: var(--font-caption); }
.load-more { margin-top: var(--space-5); }
.source-link { display: inline-block; margin: 0 var(--space-3) var(--space-4) 0; text-decoration: none; }
.source-link[hidden], .load-more[hidden] { display: none; }
@media (max-width: 680px) { }
.navigation a { text-decoration: none; }
.navigation a:hover { text-decoration: underline; }
.demo-badge { position: absolute; left: var(--space-4); top: var(--space-4); padding: var(--space-1) var(--space-2); background: var(--color-paper); color: var(--color-ink); border-radius: var(--radius-sm); font-size: var(--font-xs); font-weight: 550; }
.catalog-heading { display: flex; align-items: baseline; justify-content: space-between; gap: var(--space-4); }
.catalog-mode { color: var(--muted); font-size: var(--font-caption); white-space: nowrap; }
.reset-filters { border: 0; border-bottom: 1px solid var(--line); background: none; padding: var(--space-1) 0; font-size: var(--font-sm); color: var(--muted); }
.result-count { color: var(--muted); font-size: var(--font-caption); margin: 0 0 var(--space-3); }
.course-details { display: grid; grid-template-columns: 1fr 1.4fr; gap: var(--space-3) var(--space-4); font-size: var(--font-sm); line-height: 1.5; margin: var(--space-5) 0 0; }
.course-details:empty { display: none; }
.course-details dt { color: var(--muted); }
.course-details dd { margin: 0; }
#catalog { scroll-margin-top: var(--space-4); }
.catalog-intro { padding-block: var(--space-7) var(--space-5); }
.catalog-intro h1 { margin: 0 0 var(--space-4); font-size: clamp(var(--font-3xl),4vw,var(--font-5xl)); line-height: 1.15; letter-spacing: -.045em; font-weight: 600; }
.catalog-intro > p { margin: 0; font-size: var(--font-md); color: var(--muted); line-height: 1.6; }
@media (max-width: 1050px) { .header-inner { flex-wrap: wrap; } .catalog-heading { align-items: flex-start; flex-direction: column; gap: var(--space-2); } }
@media (max-width: 680px) {
  .catalog-mode { font-size: var(--font-xs); }
  .demo-badge { top: var(--space-3); left: var(--space-3); font-size: var(--font-2xs); }
}

/* Mobile header uses normal grid flow; no absolute positioning or reserved offsets. */
@media (max-width: 680px) {
  .site-header .header-inner { display: grid; grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "brand theme" "navigation navigation" "search search"; gap: var(--space-3); padding-block: var(--space-3); }
  .site-header .brand { grid-area: brand; }
  .site-header .header-tools { display: contents; }
  .site-header .theme-toggle { grid-area: theme; justify-self: end; width: var(--control-size); height: var(--control-size); }
  .site-header .navigation { grid-area: navigation; min-height: var(--control-size); }
  .site-header .search-field { grid-area: search; position: static; width: 100%; height: var(--control-size); }
  .site-header .search-field input { font-size: var(--font-md); }
  .radar-section { padding-top: var(--space-5); }
}
