/* ToleranceArena docs: custom styles on top of the mdBook default theme.
   The colours come from the logo and from assets/README.md: teal marks the measured gap,
   orange marks the failing position. */

/* Accent colours per mdBook theme. The theme name is a class on <html>, and the page ships with
   the default theme (navy) already set. The theme's own link colour on a dark page has a
   contrast ratio near 3.6 : 1. The accent reaches 9 : 1 on navy, coal and ayu, so links use it
   there. */
html.coal,
html.navy,
html.ayu {
  --ta-accent: #3ed0b4;
  --ta-accent-ink: #0a0e11;
  --ta-shadow: rgba(0, 0, 0, 0.45);
  --links: var(--ta-accent);
}

html.light {
  --ta-accent: #0b7a6a;
  --ta-accent-ink: #ffffff;
  --ta-shadow: rgba(0, 0, 0, 0.2);
}

html.rust {
  --ta-accent: #08594d;
  --ta-accent-ink: #ffffff;
  --ta-shadow: rgba(0, 0, 0, 0.2);
  --links: #1d5a8f;
}

/* Show the logo and the figures that match the active theme. The pair of images
   carries a ta-for-light and a ta-for-dark class. */
.ta-for-light {
  display: none !important;
}

html.light .ta-for-light,
html.rust .ta-for-light {
  display: block !important;
}

html.light .ta-for-dark,
html.rust .ta-for-dark {
  display: none !important;
}

/* The page heading for screen readers. The logo already shows the name. */
.ta-sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: -1px;
  padding: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* mdBook sets the root font size to 10px, so 1rem is 10px in this file.
   The selectors start with .content to outrank the theme's img rule. */

/* Logo, centred on the introduction page */
.content .ta-logo {
  display: block;
  width: 100%;
  max-width: 420px;
  height: auto;
  margin: 2rem auto 1.5rem;
}

/* Hero tagline */
.ta-tagline {
  max-width: 58rem;
  margin: 0 auto 2rem;
  text-align: center;
  font-size: 2rem;
  line-height: 1.45;
}

/* Demo recording: full width, rounded corners, soft shadow */
.ta-figure {
  margin: 2.5rem 0;
}

.content .ta-demo {
  display: block;
  width: 100%;
  max-width: 860px;
  height: auto;
  margin: 0 auto;
  border-radius: 8px;
  box-shadow: 0 4px 24px var(--ta-shadow);
}

.content .ta-plot {
  display: block;
  width: 100%;
  max-width: 760px;
  height: auto;
  margin: 0 auto;
}

.ta-caption {
  max-width: 860px;
  margin: 1.2rem auto 0;
  font-size: 1.4rem;
  line-height: 1.55;
}

/* Call-to-action button row */
.cta-row {
  display: flex;
  gap: 1.2rem;
  flex-wrap: wrap;
  justify-content: center;
  margin: 2rem 0 3rem;
}

.cta-btn {
  display: inline-block;
  padding: 1rem 2.4rem;
  border: 2px solid var(--ta-accent);
  border-radius: 6px;
  font-size: 1.6rem;
  font-weight: 600;
  line-height: 1.3;
  text-align: center;
  text-decoration: none !important;
  transition: opacity 0.15s ease-out;
}

.cta-btn:hover {
  opacity: 0.85;
}

.cta-btn:focus-visible {
  outline: 2px solid var(--fg);
  outline-offset: 3px;
}

.cta-btn-primary {
  background: var(--ta-accent);
  color: var(--ta-accent-ink) !important;
}

.cta-btn-secondary {
  background: transparent;
  color: var(--ta-accent) !important;
}

@media (max-width: 480px) {
  .cta-row .cta-btn {
    flex: 1 1 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  .cta-btn {
    transition: none;
  }
}

/* Long unbroken strings in inline code (paths, hashes, flags) must not push a paragraph wider
   than a phone screen. Table cells keep whole words and scroll inside their wrapper instead. */
.content :is(p, li, figcaption) code {
  overflow-wrap: anywhere;
}

/* A wider reading column on large screens: the progress tables are dense. */
@media (min-width: 1200px) {
  :root {
    --content-max-width: 860px;
  }
}
