:root {
  --r-background-color: #000000;
  --r-main-color: #f2f2f2;
  --r-heading-color: #ffffff;
  --r-link-color: #8ec5ff;
  --r-selection-background-color: #1f4e79;
  --r-progress-color: #ffb347;
}

body:not(.reveal-viewport) {
  background:
    radial-gradient(circle at top left, rgba(65, 116, 153, 0.12), transparent 34rem),
    #f5f7fd;
}

body:not(.reveal-viewport) .navbar {
  background: #2b435b;
}

body:not(.reveal-viewport) .quarto-title-block,
body:not(.reveal-viewport) main.content {
  max-width: 1180px;
}

body:not(.reveal-viewport) .quarto-title-block {
  margin: 0 auto;
  padding-top: 1.5rem;
}

body:not(.reveal-viewport) main.content {
  margin: 0 auto;
  padding-bottom: 4rem;
}

/* Notebook pages (notebooks/*.qmd): the main column stays in its grid cell
   next to the table of contents, figures fit the column. */
body.notebook-page main.content {
  max-width: none;
  margin: 0;
}

body.notebook-page main.content img {
  max-width: 100%;
  height: auto;
}

.course-index {
  max-width: 1080px;
  margin: 0 auto;
  padding: 2.2rem 1rem 4rem;
  color: #25313a;
}

.course-profile {
  display: flex;
  gap: 1.35rem;
  align-items: center;
  padding: 0 0 1.8rem;
  border-bottom: 1px solid rgba(43, 67, 91, 0.17);
}

.course-profile-photo {
  width: 132px;
  height: 132px;
  flex: 0 0 132px;
  border: 3px solid #ffffff;
  border-radius: 50%;
  object-fit: cover;
  object-position: center 18%;
  box-shadow: 0 8px 24px rgba(43, 67, 91, 0.18);
}

.course-profile-copy h1 {
  margin: 0.1rem 0 0.45rem;
  color: #25313a;
  font-size: clamp(1.7rem, 4vw, 2.55rem);
  line-height: 1.08;
}

.course-profile-copy p {
  max-width: 760px;
  margin: 0;
  color: #53616f;
  line-height: 1.55;
}

.course-kicker {
  color: #1f6f8b !important;
  font-size: 0.78rem;
  font-weight: 750;
  text-transform: uppercase;
}

.course-profile-links,
.lecture-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.48rem;
  margin-top: 0.85rem;
}

.course-profile-links a,
.lecture-links a,
.lecture-link-pending,
.exercise-back-link {
  display: inline-flex;
  align-items: center;
  min-height: 2.15rem;
  padding: 0.38rem 0.68rem;
  border: 1px solid #bdcad4;
  border-radius: 7px;
  background: rgba(255, 255, 255, 0.82);
  color: #27475d;
  font-size: 0.9rem;
  font-weight: 680;
  text-decoration: none;
}

.course-profile-links a:hover,
.lecture-links a:hover,
.exercise-back-link:hover {
  border-color: #1f6f8b;
  background: #ffffff;
  color: #175873;
  text-decoration: none;
}

.course-intro {
  padding: 2rem 0 1rem;
}

.course-intro-primary {
  padding-top: 0;
  padding-bottom: 1.8rem;
  border-bottom: 1px solid rgba(43, 67, 91, 0.17);
}

.course-intro h1 {
  margin: 0.1rem 0 0.55rem;
  color: #25313a;
  font-size: clamp(1.7rem, 4vw, 2.55rem);
  line-height: 1.08;
}

.course-intro h2 {
  margin: 0 0 0.5rem;
  color: #25313a;
}

.course-intro p {
  max-width: 760px;
  margin: 0;
  color: #53616f;
  line-height: 1.55;
}

.lecture-accordion {
  display: grid;
  gap: 0.72rem;
  margin-top: 0.55rem;
}

.lecture-row {
  border: 1px solid rgba(43, 67, 91, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.88);
  box-shadow: 0 10px 26px rgba(43, 67, 91, 0.06);
  overflow: hidden;
}

.lecture-row summary {
  display: flex;
  gap: 0.85rem;
  align-items: center;
  min-height: 4.3rem;
  padding: 0.82rem 3rem 0.82rem 1rem;
  color: #25313a;
  cursor: pointer;
  font-size: 1.12rem;
  font-weight: 740;
  list-style: none;
  position: relative;
}

.lecture-row summary::-webkit-details-marker {
  display: none;
}

.lecture-row summary::after {
  content: "+";
  position: absolute;
  right: 1rem;
  color: #1f6f8b;
  font-size: 1.55rem;
  font-weight: 450;
  line-height: 1;
}

.lecture-row[open] summary::after {
  content: "−";
}

.lecture-index {
  color: #1f6f8b;
  font-size: 0.83rem;
  font-variant-numeric: tabular-nums;
}

.lecture-row-body {
  padding: 0 1rem 1rem 2.95rem;
  border-top: 1px solid rgba(43, 67, 91, 0.10);
}

.lecture-row-body p {
  margin: 0.82rem 0 0;
  color: #53616f;
  line-height: 1.48;
}

.lecture-link-pending {
  border-style: dashed;
  background: rgba(238, 244, 249, 0.7);
  color: #7b8995;
  font-weight: 560;
}

.exercise-page {
  max-width: 880px;
  margin: 0 auto;
}

.exercise-back-link {
  margin-bottom: 1rem;
}

.project-page {
  width: min(1120px, calc(100% - 2rem));
  margin: 0 auto 3rem;
}

.project-page > h1 {
  margin-bottom: 0.5rem;
  color: #25313a;
  font-size: clamp(1.8rem, 4vw, 2.65rem);
  line-height: 1.08;
}

.project-page > h1 + p,
.project-page > h2 + p {
  max-width: 880px;
  color: #53616f;
  line-height: 1.55;
}

.project-requirements {
  margin: 1.25rem 0 2.2rem;
  padding: 1rem 1.15rem;
  border-left: 4px solid #1f6f8b;
  background: rgba(238, 244, 249, 0.72);
}

.project-requirements h3 {
  margin: 0 0 0.55rem;
  color: #25313a;
  font-size: 1.06rem;
}

.project-requirements ul {
  margin: 0;
  padding-left: 1.25rem;
  columns: 2 320px;
  column-gap: 2.2rem;
}

.project-requirements li {
  margin-bottom: 0.35rem;
  break-inside: avoid;
}

.project-list {
  display: grid;
  gap: 0.75rem;
  margin-top: 0.75rem;
}

.project-card {
  border: 1px solid rgba(43, 67, 91, 0.17);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 10px 26px rgba(43, 67, 91, 0.055);
  overflow: hidden;
}

.project-card summary {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto;
  gap: 0.8rem;
  align-items: center;
  min-height: 4.1rem;
  padding: 0.78rem 3.1rem 0.78rem 1rem;
  color: #25313a;
  cursor: pointer;
  font-weight: 720;
  list-style: none;
  position: relative;
}

.project-card summary::-webkit-details-marker {
  display: none;
}

.project-card summary::after {
  content: "+";
  position: absolute;
  right: 1rem;
  color: #1f6f8b;
  font-size: 1.5rem;
  font-weight: 450;
  line-height: 1;
}

.project-card[open] summary::after {
  content: "−";
}

.project-number {
  color: #1f6f8b;
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
}

.project-title {
  min-width: 0;
  font-size: 1.04rem;
  line-height: 1.25;
}

.project-result {
  border: 1px solid rgba(31, 111, 139, 0.24);
  border-radius: 999px;
  padding: 0.22rem 0.55rem;
  background: rgba(238, 244, 249, 0.76);
  color: #53616f;
  font-size: 0.74rem;
  font-weight: 620;
  white-space: nowrap;
}

.project-card-body {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, 0.9fr);
  gap: 0.9rem 1.8rem;
  padding: 1rem 1.15rem 1.15rem 3.8rem;
  border-top: 1px solid rgba(43, 67, 91, 0.10);
  color: #53616f;
}

.project-passport p,
.project-deliverable,
.project-key-result {
  margin: 0 0 0.68rem;
  line-height: 1.48;
}

.project-card-body strong,
.project-actions h3 {
  color: #25313a;
}

.project-actions {
  grid-row: span 2;
}

.project-actions h3 {
  margin: 0 0 0.45rem;
  font-size: 0.92rem;
}

.project-actions ol {
  margin: 0;
  padding-left: 1.25rem;
}

.project-actions li {
  margin-bottom: 0.32rem;
  line-height: 1.42;
}

.project-deliverable,
.project-key-result {
  grid-column: 1;
}

.project-key-result {
  margin-bottom: 0;
  padding-top: 0.65rem;
  border-top: 1px solid rgba(43, 67, 91, 0.12);
}

@media (max-width: 620px) {
  .course-index {
    padding-top: 1.25rem;
  }

  .course-profile {
    align-items: flex-start;
  }

  .course-profile-photo {
    width: 88px;
    height: 88px;
    flex-basis: 88px;
  }

  .lecture-row summary {
    font-size: 1rem;
  }

  .lecture-row-body {
    padding-left: 1rem;
  }

  .project-page {
    width: min(100% - 1rem, 1120px);
  }

  .project-card summary {
    grid-template-columns: 1.7rem minmax(0, 1fr);
    padding-right: 2.7rem;
  }

  .project-result {
    grid-column: 2;
    justify-self: start;
  }

  .project-card-body {
    grid-template-columns: 1fr;
    padding-left: 1rem;
  }

  .project-actions {
    grid-row: auto;
  }

  .project-deliverable,
  .project-key-result {
    grid-column: auto;
  }
}

.reveal {
  font-size: 32px;
}

.reveal h1,
.reveal h2,
.reveal h3,
.reveal h4 {
  text-transform: none;
  letter-spacing: 0.01em;
  font-weight: 600;
}

.reveal .subtitle,
.reveal .quarto-title-author,
.reveal .quarto-title-affiliation {
  color: #d0d0d0;
}

.reveal .slide-logo {
  display: block !important;
  position: fixed !important;
  top: 18px !important;
  left: 18px !important;
  right: auto !important;
  bottom: auto !important;
  max-height: 54px !important;
  max-width: 140px !important;
  z-index: 1000 !important;
}

.reveal .slide-number {
  color: #d8d8d8 !important;
  font-size: 0.55em !important;
}

.code-copy-button,
.code-copy-button-tooltip,
.reveal .code-copy-button,
.reveal .code-copy-button-tooltip {
  display: none !important;
}

.reveal .progress {
  color: #ffb347 !important;
}

.reveal .progress span {
  background: #ffb347 !important;
}

.reveal ul,
.reveal ol {
  display: block !important;
  text-align: left !important;
  margin-left: 1em !important;
  padding-left: 0.8em !important;
}
.reveal .columns {
  align-items: center;
}

.reveal img.slide-image-center {
  display: block;
  margin-right: auto !important;
  margin-left: auto !important;
}

/* Widget controls */
.fit-widget input:not([type="range"]),
.fit-widget select,
.fit-widget button {
  color: #111 !important;
  background: #f2f2f2 !important;
  border: 1px solid #999 !important;
}

.fit-widget input[type="range"] {
  border: none !important;
  background: transparent !important;
}

.fit-widget button {
  font-weight: 600;
}

.fit-widget label,
.fit-widget .observablehq,
.fit-widget .observablehq--inspect {
  color: #fff !important;
}

.clt-widget input:not([type="range"]),
.clt-widget select,
.clt-widget button {
  color: #111 !important;
  background: #f2f2f2 !important;
  border: 1px solid #999 !important;
}

.clt-widget input[type="range"] {
  width: 280px !important;
  border: none !important;
  background: transparent !important;
  accent-color: #ffb347;
}

.clt-widget label,
.clt-widget .observablehq,
.clt-widget .observablehq--inspect {
  color: #fff !important;
}

.clt-widget .observablehq--inspect {
  display: none !important;
}

.clt-widget .observablehq {
  margin: 0.15rem 0;
}

.clt-widget .clt-panel {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.35rem;
}

.clt-widget .clt-summary {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.85rem;
  font-size: 0.62em;
  color: #f2f2f2;
}

.reveal .table-scroll {
  max-height: 11.5em;
  overflow-y: auto;
  margin: 0.3em auto 0.5em auto;
  padding-right: 0.15em;
}

.reveal .table-scroll table {
  width: 100%;
  font-size: 0.62em;
}

/* Callouts */
.reveal .slides section .callout {
  margin-top: 0.8em;
  margin-bottom: 0.8em;
  border-radius: 16px;
  border-left-width: 6px;
  background: rgba(255, 255, 255, 0.06);
  box-shadow: none;
}

.reveal .slides section .callout .callout-header {
  background: transparent !important;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  padding-bottom: 0.35em;
  margin-bottom: 0.45em;
}

.reveal .slides section .callout .callout-title {
  font-size: 0.95em;
  font-weight: 700;
  letter-spacing: 0.02em;
  text-transform: none;
}

.reveal .slides section .callout .callout-body {
  font-size: 0.88em;
  line-height: 1.35;
}

.reveal .slides section .defbox {
  border-left-color: #4ea1ff !important;
  background: rgba(78, 161, 255, 0.1) !important;
}

.reveal .slides section .thmbox {
  border-left-color: #b388ff !important;
  background: rgba(179, 136, 255, 0.1) !important;
}

.reveal .slides section .exbox {
  border-left-color: #ffb74d !important;
  background: rgba(255, 183, 77, 0.12) !important;
}

.reveal .slides section .solbox {
  border-left-color: #66bb6a !important;
  background: rgba(102, 187, 106, 0.1) !important;
}

.reveal .slides section .remarkbox {
  border-left-color: #90a4ae !important;
  background: rgba(144, 164, 174, 0.12) !important;
}

.reveal .slides section .proofbox {
  border-left-color: #ef5350 !important;
  background: rgba(239, 83, 80, 0.1) !important;
}

.reveal .slides section .callout p,
.reveal .slides section .callout li {
  margin-top: 0.25em;
  margin-bottom: 0.25em;
}

.reveal .slides section .callout ul,
.reveal .slides section .callout ol {
  margin-top: 0.35em;
  margin-bottom: 0.1em;
}

/* Slide menu (sidebar) colors */
.slide-menu-wrapper .slide-menu {
  background-color: #16354d !important;
}

.slide-menu-wrapper .slide-menu-items {
  border-bottom: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.slide-menu-wrapper .slide-menu-item,
.slide-menu-wrapper .slide-menu-item-vertical,
.slide-menu-wrapper .slide-menu-panel,
.slide-menu-wrapper .slide-menu-toolbar > li {
  color: #d7e6f4 !important;
}

.slide-menu-wrapper .slide-menu-item,
.slide-menu-wrapper .slide-tool-item {
  border-top: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.slide-menu-wrapper .active-menu-panel li.selected {
  background-color: #23608c !important;
  color: #ffffff !important;
}

.slide-menu-wrapper .active-menu-panel li.active {
  color: #ffffff !important;
}

.reveal .slide-menu-button {
  left: 10px !important;
  bottom: 10px !important;
  padding: 2px !important;
  border-radius: 8px !important;
  background: rgba(22, 53, 77, 0.8) !important;
  border: 1px solid rgba(255, 255, 255, 0.2) !important;
}

.reveal .slide-menu-button .fa-bars::before {
  background-image: url('data:image/svg+xml,<svg xmlns="http://www.w3.org/2000/svg" width="16" height="16" fill="rgb(255, 191, 97)" class="bi bi-list" viewBox="0 0 16 16"><path fill-rule="evenodd" d="M2.5 12a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5zm0-4a.5.5 0 0 1 .5-.5h10a.5.5 0 0 1 0 1H3a.5.5 0 0 1-.5-.5z"/></svg>') !important;
}

.reveal .compat-widget {
  width: 100%;
  padding: 0.55em;
  border: 1px solid rgba(142, 197, 255, 0.30);
  border-radius: 8px;
  background: rgba(12, 20, 30, 0.78);
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.22);
  color: #f5f7fd;
  font-size: 0.54em;
}

.reveal .compat-controls {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.55em;
  margin-bottom: 0.5em;
}

.reveal .compat-control {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 0.45em;
  color: #dbe7f7;
  font-weight: 700;
}

.reveal .compat-control input[type="range"] {
  width: 100%;
  accent-color: #ffb347;
}

.reveal .compat-control output {
  min-width: 3.4em;
  color: #ffcc80;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

.reveal .compat-plot {
  display: block;
  width: 100%;
  height: auto;
}

.reveal .compat-summary {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35em;
  margin-top: 0.45em;
}

.reveal .compat-summary span {
  min-height: 1.8em;
  padding: 0.22em 0.35em;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #dbe7f7;
  font-variant-numeric: tabular-nums;
}

.reveal .compat-summary .compat-decision-ok {
  color: #83f2c1;
}

.reveal .compat-summary .compat-decision-bad {
  color: #ffb4a8;
}


.reveal .slides section {
  text-align: left !important;
  padding-left: 0 !important;
  padding-right: 0 !important;
}

.reveal .slides section > * {
  margin-left: 0 !important;
  margin-right: 0 !important;
}

.reveal h1,
.reveal h2,
.reveal h3,
.reveal h4,
.reveal p,
.reveal ul,
.reveal ol,
.reveal li {
  text-align: left !important;
}

.reveal .bayes-figure {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0;
}

.reveal .bayes-figure p {
  margin: 0;
}

.reveal .bayes-figure img {
  max-width: 100%;
  max-height: 68vh;
  border: none;
  box-shadow: none;
  background: transparent;
}

.reveal .centered-figure {
  --figure-width: 80%;
  --figure-max-height: 72vh;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 100%;
  margin: 0 auto;
}

.reveal .centered-figure p {
  position: relative;
  width: 100%;
  margin: 0;
  text-align: center !important;
  overflow: visible;
}

.reveal .centered-figure img {
  display: block;
  position: relative;
  left: 50%;
  transform: translateX(-50%);
  width: var(--figure-width) !important;
  margin: 0 !important;
  max-width: none;
  max-height: var(--figure-max-height);
  border: none;
  box-shadow: none;
  background: transparent;
}

.reveal .ojs-plot-center,
.reveal .ojs-plot-center .observablehq {
  display: flex;
  justify-content: center;
  width: 100%;
}

/* temporary debug background */
/* debug: границы области слайда */
/*:root {
  --r-background-color: #00ff00;
}
.reveal .slides section {
  outline: 2px dashed red !important;
  outline-offset: 0 !important;
}
*/
