/* ----------------------------- */
/* Clean MkDocs Material sidebar */
/* ----------------------------- */

.md-sidebar--primary {
  border-right: 1px solid var(--md-default-fg-color--lightest);
}

/* ----------------------------- */
/* Home page                     */
/* ----------------------------- */

.easybar-hero {
  margin: 0 0 2.4rem;
  padding: clamp(1.5rem, 4vw, 3.4rem);
  overflow: hidden;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 1rem;
  background:
    radial-gradient(
      circle at 90% 15%,
      color-mix(in srgb, var(--md-accent-fg-color) 18%, transparent),
      transparent 32%
    ),
    linear-gradient(
      145deg,
      color-mix(in srgb, var(--md-primary-fg-color) 9%, var(--md-default-bg-color)),
      var(--md-default-bg-color) 68%
    );
}

.md-typeset .easybar-hero h1 {
  max-width: 15ch;
  margin: 0.15rem 0 0.8rem;
  color: var(--md-default-fg-color);
  font-size: clamp(2rem, 5vw, 3.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.02;
}

.md-typeset .easybar-hero > p:not(.easybar-hero__eyebrow) {
  max-width: 48rem;
  font-size: 0.95rem;
}

.md-typeset .easybar-hero__eyebrow {
  margin: 0;
  color: var(--md-accent-fg-color);
  font-size: 0.7rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.md-typeset .easybar-hero .md-button {
  margin: 0.35rem 0.35rem 0.35rem 0;
}

.md-typeset .easybar-hero > p:last-child {
  max-width: none;
  margin: 2rem -2rem -2rem;
  padding: 1.4rem 2rem;
  border-top: 1px solid var(--md-default-fg-color--lightest);
  background: color-mix(in srgb, var(--md-default-bg-color) 78%, transparent);
}

.md-typeset .easybar-hero > p:last-child img {
  display: block;
  width: 100%;
  height: auto;
}

.md-typeset .easybar-showcase {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 1rem;
}

.md-typeset .easybar-showcase figure {
  display: flex;
  min-width: 0;
  margin: 0;
  padding: 1rem;
  flex-direction: column;
  justify-content: center;
  border: 1px solid var(--md-default-fg-color--lightest);
  border-radius: 0.75rem;
  background: var(--md-code-bg-color);
}

.md-typeset .easybar-showcase figcaption {
  margin-top: 0.75rem;
  color: var(--md-default-fg-color--light);
  font-size: 0.72rem;
  text-align: center;
}

.md-typeset .easybar-home-cta {
  margin-top: 2.5rem;
  padding: 1.5rem;
  border: 1px solid var(--md-accent-fg-color--transparent);
  border-radius: 0.75rem;
  background: var(--md-accent-fg-color--transparent);
  text-align: center;
}

.md-typeset .easybar-home-cta h3 {
  margin-top: 0;
}

@media screen and (max-width: 44.9375em) {
  .md-typeset .easybar-showcase {
    grid-template-columns: 1fr;
  }

  .md-typeset .easybar-hero > p:last-child {
    margin-right: -1.5rem;
    margin-bottom: -1.5rem;
    margin-left: -1.5rem;
    padding-right: 1.5rem;
    padding-left: 1.5rem;
  }
}

/* Reset heavy custom styling */
.md-nav--primary .md-nav__link {
  margin: 0;
  padding: 0.28rem 0.55rem;
  border-radius: 0.35rem;
  font-size: 0.72rem;
  line-height: 1.35;
  transition:
    background-color 120ms ease,
    color 120ms ease;
}

/* Normal hover */
.md-nav--primary .md-nav__link:hover {
  background: var(--md-default-fg-color--lightest);
}

/* Active page: subtle pill + left accent */
.md-nav--primary .md-nav__link--active,
.md-nav--primary .md-nav__item--active > .md-nav__link {
  position: relative;
  background: var(--md-accent-fg-color--transparent);
  color: var(--md-accent-fg-color);
  font-weight: 700;
}

.md-nav--primary .md-nav__link--active::before,
.md-nav--primary .md-nav__item--active > .md-nav__link::before {
  content: "";
  position: absolute;
  left: -0.45rem;
  top: 0.35rem;
  bottom: 0.35rem;
  width: 0.15rem;
  border-radius: 999px;
  background: var(--md-accent-fg-color);
}

/* Section labels should stay plain even when their subtree is active */
.md-nav--primary > .md-nav__list > .md-nav__item > .md-nav__link,
.md-nav--primary > .md-nav__list > .md-nav__item > label.md-nav__link,
.md-nav--primary .md-nav__item--section > .md-nav__link,
.md-nav--primary .md-nav__item--section > label.md-nav__link {
  position: static;
}

.md-nav--primary
  > .md-nav__list
  > .md-nav__item.md-nav__item--active
  > .md-nav__link,
.md-nav--primary
  > .md-nav__list
  > .md-nav__item.md-nav__item--active
  > label.md-nav__link,
.md-nav--primary .md-nav__item--section.md-nav__item--active > .md-nav__link,
.md-nav--primary
  .md-nav__item--section.md-nav__item--active
  > label.md-nav__link {
  background: transparent;
  color: var(--md-default-fg-color--light);
}

.md-nav--primary
  > .md-nav__list
  > .md-nav__item.md-nav__item--active
  > .md-nav__link::before,
.md-nav--primary
  > .md-nav__list
  > .md-nav__item.md-nav__item--active
  > label.md-nav__link::before,
.md-nav--primary
  .md-nav__item--section.md-nav__item--active
  > .md-nav__link::before,
.md-nav--primary
  .md-nav__item--section.md-nav__item--active
  > label.md-nav__link::before {
  content: none;
}

/* Top-level sections: Lua Widgets, Runtime, Internals */
.md-nav--primary > .md-nav__list > .md-nav__item > .md-nav__link,
.md-nav--primary > .md-nav__list > .md-nav__item > label.md-nav__link {
  margin-top: 1.1rem;
  margin-bottom: 0.25rem;
  padding: 0;
  background: transparent;
  color: var(--md-default-fg-color--light);
  font-size: 0.78rem;
  font-weight: 800;
  letter-spacing: 0.03em;
  text-transform: uppercase;
}

/* Subsection headings: Guides, Reference, Architecture, Agents */
.md-nav--primary .md-nav__item--section > .md-nav__link,
.md-nav--primary .md-nav__item--section > label.md-nav__link {
  margin-top: 0.85rem;
  margin-bottom: 0.25rem;
  padding: 0;
  background: transparent;
  color: var(--md-default-fg-color--light);
  font-size: 0.68rem;
  font-weight: 800;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}

/* Nested lists: cleaner indentation, no timeline look */
.md-nav--primary .md-nav__list .md-nav__list {
  margin-left: 0.35rem;
  padding-left: 0.45rem;
  border-left: 1px solid var(--md-default-fg-color--lightest);
}

/* Avoid double-heavy nested borders */
.md-nav--primary .md-nav__list .md-nav__list .md-nav__list {
  border-left: none;
}

/* Less giant vertical spacing */
.md-nav--primary .md-nav__item {
  margin: 0.08rem 0;
}

/* Display Retina captures at their approximate macOS point size. */
.md-typeset img.screenshot-compact {
  display: block;
  width: min(100%, var(--screenshot-width));
  height: auto;
  margin: 0 auto;
}

.md-typeset img.screenshot-month {
  --screenshot-width: 374px;
}
.md-typeset img.screenshot-upcoming {
  --screenshot-width: 511px;
}
.md-typeset img.screenshot-inbox {
  --screenshot-width: 457px;
}
.md-typeset img.screenshot-cpu {
  --screenshot-width: 292px;
}
.md-typeset img.screenshot-wifi {
  --screenshot-width: 507px;
}
.md-typeset img.screenshot-tailscale {
  --screenshot-width: 482px;
}
.md-typeset img.screenshot-spaces {
  --screenshot-width: 382px;
}
.md-typeset img.screenshot-spaces-front-app {
  --screenshot-width: 322px;
}
.md-typeset img.screenshot-native-widgets {
  --screenshot-width: 385px;
}
.md-typeset img.screenshot-context {
  --screenshot-width: 422px;
}
.md-typeset img.screenshot-topbar {
  --screenshot-width: 270px;
}
