:root {
  /* Two-tone documentation chrome; the logo keeps its own palette gradient. */
  --r10n-ink: #070113;
  --r10n-paper: #f4f1fb;
}

[data-md-color-scheme="default"] {
  --md-default-bg-color: var(--r10n-paper);
  --md-default-fg-color: var(--r10n-ink);
  --md-primary-fg-color: var(--r10n-ink);
  --md-primary-bg-color: var(--r10n-paper);
  --md-accent-fg-color: var(--r10n-ink);
  --md-typeset-a-color: var(--r10n-ink);
  --r10n-focus: var(--r10n-ink);
}

[data-md-color-scheme="slate"] {
  --md-default-bg-color: var(--r10n-ink);
  --md-default-fg-color: var(--r10n-paper);
  --md-primary-fg-color: var(--r10n-ink);
  --md-primary-bg-color: var(--r10n-paper);
  --md-accent-fg-color: var(--r10n-paper);
  --md-typeset-a-color: var(--r10n-paper);
  --r10n-focus: var(--r10n-paper);
}

/* Links stay plain: same ink as body text, marked only by an underline. */
.md-typeset a {
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 0.15em;
}

/* Light mode puts the header on paper, so use the ink cut of the wordmark. */
[data-md-color-scheme="default"] .md-header__button.md-logo img {
  content: url("../assets/brand/r10n-dark.svg");
}

.md-header__button.md-logo {
  display: block;
  padding: 0.35rem;
  background: transparent;
}

.md-header__button.md-logo img {
  width: 5rem;
  height: auto;
}

@media (max-width: 30rem) {
  .md-header__button.md-logo img {
    width: 3rem;
  }
}

/* Keep the site name accessible without repeating the wordmark visually. */
.md-header__topic:first-child {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* The theme normally reveals the page topic only after scrolling. With the
   duplicate name hidden, retain the page title before and after scrolling. */
.md-header__title .md-header__topic + .md-header__topic {
  z-index: 0;
  pointer-events: auto;
  opacity: 1;
  transform: none;
  transition: none;
}

:focus-visible {
  outline: 2px solid var(--r10n-focus);
  outline-offset: 2px;
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

@media (forced-colors: active) {
  :focus-visible {
    outline-color: CanvasText;
  }
}

/* ---------------------------------------------------------------------------
   Homepage landing
   --------------------------------------------------------------------------- */

.md-main__inner:has(.r10n-landing) {
  display: block;
  max-width: 76rem;
  padding-inline: 1rem;
}

.r10n-landing {
  display: flex;
  flex-direction: column;
  gap: clamp(3.5rem, 8vw, 6.5rem);
  padding-block: clamp(2.5rem, 7vw, 5rem);
}

.r10n-landing a {
  text-decoration: none;
}

/* Hero */
.r10n-hero {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.1rem;
  text-align: center;
}

.r10n-hero__logo {
  width: min(660px, 86vw);
  margin: 0;
}

.r10n-hero__logo img {
  display: block;
  width: 100%;
  height: auto;
}

[data-md-color-scheme="default"] .r10n-hero__logo img {
  content: url("../assets/brand/r10n-dark.svg");
}

.r10n-hero__tagline {
  max-width: 32ch;
  margin: 0;
  font-size: clamp(1.15rem, 2.6vw, 1.55rem);
  font-weight: 500;
  line-height: 1.35;
  text-wrap: balance;
}

.r10n-hero__lede {
  max-width: 48ch;
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.55;
  opacity: 0.7;
}

.r10n-hero__actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.75rem;
  margin-top: 0.4rem;
}

.r10n-hero__install {
  max-width: 100%;
  margin: 0.4rem 0 0;
}

.r10n-hero__install code {
  display: inline-block;
  padding: 0.6rem 0.85rem;
  border: 1px solid color-mix(in srgb, currentcolor 18%, transparent);
  border-radius: 0.5rem;
  background: color-mix(in srgb, currentcolor 5%, transparent);
  font-size: 0.7rem;
  overflow-wrap: anywhere;
}

.r10n-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.72rem 1.35rem;
  border: 1px solid currentcolor;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 600;
  color: inherit;
}

.r10n-button:hover {
  border-color: currentcolor;
  opacity: 0.85;
}

.r10n-button--solid {
  border-color: var(--r10n-ink);
  background: var(--r10n-ink);
  color: var(--r10n-paper);
}

[data-md-color-scheme="slate"] .r10n-button--solid {
  border-color: var(--r10n-paper);
  background: var(--r10n-paper);
  color: var(--r10n-ink);
}

/* Terminal showcase */
.r10n-showcase {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(1.5rem, 4vw, 3rem);
  align-items: center;
}

.r10n-terminal {
  overflow: hidden;
  border: 1px solid color-mix(in srgb, currentcolor 16%, transparent);
  border-radius: 0.9rem;
  background: color-mix(in srgb, currentcolor 4%, transparent);
}

.r10n-terminal__bar {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.6rem 0.8rem;
  border-bottom: 1px solid color-mix(in srgb, currentcolor 12%, transparent);
}

.r10n-terminal__bar span {
  width: 0.55rem;
  height: 0.55rem;
  border: 1px solid currentcolor;
  border-radius: 50%;
  opacity: 0.3;
}

.r10n-terminal__bar b {
  margin-left: auto;
  font-family: var(--md-code-font);
  font-size: 0.65rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  opacity: 0.55;
}

.r10n-terminal__body {
  margin: 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  font-family: var(--md-code-font);
  font-size: 0.76rem;
  line-height: 1.7;
}

.md-typeset .r10n-terminal__body code {
  padding: 0;
  background: none;
  color: inherit;
  font-size: inherit;
}

.r10n-showcase__copy h2 {
  margin: 0 0 0.7rem;
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  letter-spacing: -0.01em;
}

.r10n-showcase__copy p {
  margin: 0 0 1rem;
  font-size: 0.86rem;
  line-height: 1.6;
  opacity: 0.75;
}

.r10n-list {
  display: flex;
  flex-direction: column;
  gap: 0.45rem;
  margin: 0;
  padding: 0;
  list-style: none;
  font-size: 0.82rem;
  opacity: 0.8;
}

.r10n-list li {
  position: relative;
  padding-left: 1.1rem;
}

.r10n-list li::before {
  position: absolute;
  left: 0;
  content: "—";
  opacity: 0.5;
}

/* Sections */
.r10n-section {
  display: flex;
  flex-direction: column;
  gap: 1.25rem;
}

.r10n-section h2,
.r10n-install h2 {
  margin: 0;
  font-size: clamp(1.3rem, 2.4vw, 1.7rem);
  letter-spacing: -0.01em;
}

.r10n-section__lede {
  max-width: 52ch;
  margin: 0;
  font-size: 0.86rem;
  line-height: 1.6;
  opacity: 0.7;
}

.r10n-section__head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
}

.r10n-textlink {
  padding-bottom: 0.1rem;
  border-bottom: 1px solid currentcolor;
  font-size: 0.78rem;
}

/* Cards */
.r10n-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr));
  gap: 0.85rem;
}

.r10n-grid--features {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

@media (max-width: 60rem) {
  .r10n-grid--features {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 36rem) {
  .r10n-grid--features {
    grid-template-columns: 1fr;
  }
}

.r10n-card {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  padding: 1.05rem 1.15rem;
  border: 1px solid color-mix(in srgb, currentcolor 15%, transparent);
  border-radius: 0.75rem;
  color: inherit;
}

.r10n-card:hover {
  border-color: currentcolor;
}

.r10n-card__meta {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.55;
}

.r10n-card__title {
  font-size: 0.95rem;
  font-weight: 600;
}

.r10n-card__body {
  font-size: 0.8rem;
  line-height: 1.45;
  opacity: 0.7;
}

.r10n-card__body code {
  padding: 0;
  background: none;
  font-size: inherit;
}

/* About + install */
.r10n-prose {
  max-width: 62ch;
  font-size: 0.86rem;
  line-height: 1.65;
  opacity: 0.8;
}

.r10n-prose p {
  margin-top: 0;
}

.r10n-install {
  display: flex;
  flex-direction: column;
  gap: 1.2rem;
  padding-top: clamp(2rem, 5vw, 3rem);
  border-top: 1px solid color-mix(in srgb, currentcolor 14%, transparent);
}

.r10n-install__grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
  gap: 0.85rem;
}

.r10n-install__card {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  padding: 1.1rem 1.2rem;
  border: 1px solid color-mix(in srgb, currentcolor 15%, transparent);
  border-radius: 0.75rem;
}

.r10n-install__card span {
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  opacity: 0.55;
}

.md-typeset .r10n-install__card code {
  padding: 0;
  background: none;
  font-size: 0.72rem;
  white-space: pre-wrap;
  word-break: break-word;
}

.r10n-install__note {
  margin: 0;
  font-size: 0.76rem;
  opacity: 0.6;
}

@media (max-width: 44rem) {
  .r10n-showcase {
    grid-template-columns: 1fr;
  }
}

/* The landing page speaks for itself; keep the header topic for screen readers. */
body:has(.r10n-landing) .md-header__topic {
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}
