:root {
  --accent: #4c6b80;
  --accent-dark: #365469;
  --text-muted: #495057;
  --line: #dee2e6;
}

html {
  scroll-behavior: smooth;
}

.simple-home {
  color: #212529;
  background: #fff;
  font-family: "Source Sans 3", system-ui, -apple-system, "Segoe UI", sans-serif;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

.simple-home p {
  color: var(--text-muted);
}

.simple-home h1,
.simple-home h2,
.simple-home h3,
.simple-home .navbar-brand {
  color: #212529;
  letter-spacing: -0.01em;
}

.simple-home h1 {
  line-height: 1.15;
}

.simple-home hr {
  color: var(--line);
  opacity: 1;
}

.skip-link {
  position: fixed;
  z-index: 1100;
  top: 0.75rem;
  left: 0.75rem;
  padding: 0.7rem 1rem;
  color: #fff;
  background: #212529;
  border-radius: 0.375rem;
  transform: translateY(-160%);
  transition: transform 0.15s ease;
}

.skip-link:focus {
  color: #fff;
  transform: translateY(0);
}

.simple-header {
  background: #fff;
}

.simple-header .navbar {
  padding-block: 0.55rem;
}

.simple-header .navbar-brand img {
  width: auto;
  max-width: 142px;
  object-fit: contain;
}

.brand-copy {
  padding-left: 1rem;
  border-left: 1px solid #ced4da;
  font-size: 0.95rem;
  font-weight: 600;
  line-height: 1.25;
}

.brand-copy small {
  color: #6c757d;
  font-size: 0.72rem;
  font-weight: 400;
}

.simple-home .navbar-nav {
  gap: 0.15rem;
}

.simple-home .navbar .nav-link {
  padding: 0.5rem 0.65rem;
  color: var(--text-muted);
  font-size: 0.95rem;
}

.simple-home .navbar .nav-link:hover,
.simple-home .navbar .nav-link:focus {
  color: #000;
}

.simple-home .navbar .nav-link.active {
  color: var(--accent-dark);
  font-weight: 600;
}

.simple-home .lead {
  max-width: 650px;
  color: var(--text-muted);
  font-size: 1.12rem;
}

.simple-home .btn-primary {
  background: var(--accent-dark);
  border-color: var(--accent-dark);
}

.simple-home .btn-primary:hover,
.simple-home .btn-primary:focus {
  background: #294455;
  border-color: #294455;
}

.simple-home .btn {
  font-weight: 500;
}

.simple-home .card {
  border-color: var(--line);
  border-radius: 0.375rem;
  box-shadow: none;
}

.simple-home .card-body {
  padding: 1.35rem;
}

.simple-home .card-text {
  color: var(--text-muted);
}

.simple-figure {
  max-width: 430px;
  margin-inline: auto;
  padding: 0.75rem;
}

.simple-figure svg {
  display: block;
  width: 100%;
  height: auto;
}

.simple-figure path,
.simple-figure circle {
  vector-effect: non-scaling-stroke;
}

.home-triangle {
  fill: none;
  stroke: var(--accent-dark);
  stroke-linejoin: round;
  stroke-width: 2;
}

.home-circumcircle,
.home-incircle,
.home-median,
.home-altitude,
.relation-line {
  fill: none;
}

.home-circumcircle {
  stroke: #cfd7dc;
  stroke-width: 1.1;
}

.home-incircle {
  fill: rgba(76, 107, 128, 0.035);
  stroke: var(--accent);
  stroke-width: 1;
}

.home-median {
  stroke: #c3cdd3;
  stroke-dasharray: 5 5;
  stroke-width: 0.9;
}

.home-altitude {
  stroke: #9caeb9;
  stroke-dasharray: 2 6;
  stroke-width: 0.9;
}

.relation-line {
  stroke: var(--accent);
  stroke-dasharray: 6 5;
  stroke-width: 1.5;
}

.home-vertices circle {
  fill: var(--accent-dark);
}

.home-centres circle {
  fill: var(--accent);
  stroke: #fff;
  stroke-width: 2;
}

.home-vertices text,
.home-centres text {
  fill: #212529;
  font-family: Georgia, "Times New Roman", serif;
  font-size: 14px;
  font-style: italic;
  text-anchor: middle;
}

.home-symbol {
  flex: 0 0 2rem;
  color: var(--accent);
  font-size: 1.15rem;
  font-weight: 600;
  text-align: center;
}

.simple-footer {
  background: #fafbfc;
  border-top: 1px solid var(--line);
}

.exercise-accordion {
  display: grid;
  gap: 0.85rem;
}

.exercise-item {
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line) !important;
  border-radius: 0.375rem !important;
}

.exercise-prompt {
  padding: 1.25rem 1.25rem 0.5rem;
}

.exercise-prompt > p {
  margin-bottom: 0.75rem;
  color: #212529;
}

.exercise-accordion .accordion-button {
  padding: 0.8rem 1.25rem;
  color: var(--accent-dark);
  background: #f8f9fa;
  border-top: 1px solid var(--line);
  box-shadow: none;
  font-size: 0.9rem;
  font-weight: 600;
}

.exercise-accordion .accordion-button:not(.collapsed) {
  color: #212529;
  background: #f1f3f5;
}

.exercise-accordion .accordion-button:focus {
  box-shadow: 0 0 0 0.2rem rgba(76, 107, 128, 0.15);
}

.exercise-accordion .accordion-button::after {
  width: 1rem;
  height: 1rem;
  background-size: 1rem;
}

.solution-label-hide {
  display: none;
}

.exercise-accordion .accordion-button:not(.collapsed) .solution-label-show {
  display: none;
}

.exercise-accordion .accordion-button:not(.collapsed) .solution-label-hide {
  display: inline;
}

.solution-body {
  padding: 1.25rem;
  background: #fff;
  border-top: 1px solid var(--line);
}

.solution-body p:last-child {
  margin-bottom: 0;
}

mjx-container[display="true"] {
  max-width: 100%;
  overflow-x: auto;
  overflow-y: hidden;
  padding-block: 0.2rem;
}

.applet-placeholder {
  position: relative;
  width: 100%;
  aspect-ratio: 900 / 506;
  overflow: hidden;
  background: #f8f9fa;
  border: 1px solid var(--line);
  border-radius: 0.375rem;
}

#ggb-element {
  width: 100%;
  height: 100%;
}

.materials-card .card-body {
  min-height: 15rem;
  padding: 1.75rem;
}

@media (max-width: 991.98px) {
  .simple-home .navbar-collapse {
    padding-top: 0.75rem;
  }

  .simple-home .navbar .nav-link {
    padding-inline: 0;
  }
}

@media (min-width: 992px) {
  .simple-home .navbar .nav-link.active {
    box-shadow: inset 0 -1px 0 var(--accent);
  }
}

@media (max-width: 767.98px) {
  .materials-card .card-body {
    min-height: 0;
  }
}

@media (max-width: 575.98px) {
  .simple-home .display-5 {
    font-size: 2.35rem;
  }

  .simple-header .navbar-brand img {
    max-width: 125px;
    height: auto;
  }

  .simple-figure {
    padding-inline: 0;
  }

  .exercise-prompt,
  .solution-body,
  .exercise-accordion .accordion-button {
    padding-inline: 1.1rem;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
  }
}
