/* DragonFruit MkDocs theme overrides */

:root {
  --df-accent-primary: #ec2a77;
  --df-accent-primary-hover: #d81d67;

  /* Keep both variants from app tokens available */
  --df-accent-secondary-light: #6ab80a;
  --df-accent-secondary-dark: #baf72e;
}

/* Light scheme (Material default) */
[data-md-color-scheme='default'] {
  --md-primary-fg-color: var(--df-accent-primary);
  --md-primary-fg-color--light: #f26ba2;
  --md-primary-fg-color--dark: #c11f61;

  --md-accent-fg-color: var(--df-accent-secondary-light);
  --md-accent-fg-color--transparent: color-mix(in srgb, var(--df-accent-secondary-light), transparent 88%);
}

/* Dark scheme (Material slate) */
[data-md-color-scheme='slate'] {
  --md-primary-fg-color: var(--df-accent-primary);
  --md-primary-fg-color--light: #f26ba2;
  --md-primary-fg-color--dark: #c11f61;

  --md-accent-fg-color: var(--df-accent-secondary-dark);
  --md-accent-fg-color--transparent: color-mix(in srgb, var(--df-accent-secondary-dark), transparent 84%);

  /* Align docs surfaces closer to DragonFruit app dark tone */
  --md-default-bg-color: #0b0f14;
  --md-default-fg-color: #e6ebf2;
  --md-default-fg-color--light: #c3c7cf;
  --md-default-fg-color--lighter: #a5acb8;
  --md-default-fg-color--lightest: #7f8694;

  --md-code-bg-color: #111216;
  --md-typeset-a-color: var(--df-accent-primary);
}

/* Light polish: keep links on-brand in light mode too */
[data-md-color-scheme='default'] {
  --md-typeset-a-color: var(--df-accent-primary);
}

.md-header {
  background:
    linear-gradient(90deg, color-mix(in srgb, #0b0f14, var(--df-accent-primary) 12%) 0%, color-mix(in srgb, #0b0f14, var(--df-accent-primary) 4%) 100%);
  border-bottom: 1px solid color-mix(in srgb, var(--df-accent-primary), transparent 72%);
}

.md-header__inner {
  background: transparent;
}

.md-header__button.md-logo img,
.md-header__button.md-logo svg {
  filter: drop-shadow(0 0 0.35rem color-mix(in srgb, var(--df-accent-primary), transparent 68%));
}

.md-typeset a:hover {
  color: var(--df-accent-primary-hover);
}

.md-content__inner {
  padding-top: 0;
}

.df-homepage-page .md-search {
  display: none;
}

.df-homepage-page .md-header__button[aria-label*='Switch to'],
.df-homepage-page .md-header__button[title*='Switch to'],
.df-homepage-page .md-header__option[aria-label*='Switch to'] {
  display: none;
}

.df-homepage-page .md-content__inner > h1:first-child {
  display: none;
}

.df-homepage-page .md-main__inner {
  margin-top: 0;
  margin-bottom: 0;
  padding-top: 0;
  padding-bottom: 0;
  min-height: 100%;
}

.df-homepage-page,
.df-homepage-page .md-main,
.df-homepage-page .md-content {
  overflow: hidden;
}

.df-homepage-page {
  background: #0b0f14;
  color-scheme: dark;
  --md-primary-fg-color: var(--df-accent-primary);
  --md-primary-fg-color--light: #f26ba2;
  --md-primary-fg-color--dark: #c11f61;

  --md-accent-fg-color: var(--df-accent-secondary-dark);
  --md-accent-fg-color--transparent: color-mix(in srgb, var(--df-accent-secondary-dark), transparent 84%);

  --md-default-bg-color: #0b0f14;
  --md-default-fg-color: #e6ebf2;
  --md-default-fg-color--light: #c3c7cf;
  --md-default-fg-color--lighter: #a5acb8;
  --md-default-fg-color--lightest: #7f8694;

  --md-code-bg-color: #111216;
  --md-typeset-a-color: var(--df-accent-primary);
}

.df-homepage-page .md-content__inner {
  width: 100%;
  max-width: none;
  margin: 0;
  padding: 0 !important;
}

.df-homepage-page .md-footer {
  display: none;
}

.md-grid {
  max-width: 100%;
}

.md-sidebar--primary .md-nav[data-md-level='0'] > .md-nav__title {
  display: none;
}

.df-homepage-page .md-content {
  height: calc(100dvh - var(--df-home-header-height, 3.6rem));
  min-height: calc(100dvh - var(--df-home-header-height, 3.6rem));
}

.md-grid:has(.df-homepage) {
  max-width: 100%;
}

.md-content__inner:has(.df-homepage) {
  position: relative;
  height: 100%;
  min-height: 100%;
  display: grid;
  align-items: stretch;
  overflow: hidden;
}

.md-content__inner:has(.df-homepage) {
  isolation: isolate;
}

.df-home-backdrop {
  position: absolute;
  inset: 0;
  z-index: 0;
  overflow: hidden;
  pointer-events: none;
}

.df-home-backdrop::after {
  content: '';
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, color-mix(in srgb, #05070b, transparent 18%) 0%, color-mix(in srgb, #05070b, transparent 34%) 40%, color-mix(in srgb, #05070b, transparent 56%) 100%),
    linear-gradient(90deg, color-mix(in srgb, #0b0f14, var(--df-accent-primary) 10%) 0%, transparent 16%, transparent 84%, color-mix(in srgb, #0b0f14, var(--df-accent-primary) 10%) 100%);
}

.df-home-backdrop img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 50%;
  opacity: 1;
  filter: saturate(0.9) brightness(0.45) contrast(0.92) blur(0.75px);
  transform: scale(1.38);
}

.df-homepage {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 1.1rem;
  width: 100%;
  max-width: none;
  min-height: 100%;
  padding: 0;
  margin: 0;
  text-align: center;
}

.df-homepage > :not(.df-home-backdrop) {
  position: relative;
  z-index: 2;
}

.df-home-meta-chip {
  position: absolute !important;
  bottom: 1rem;
  z-index: 3;
  padding: 0.3rem 0.56rem;
  border: 1px solid color-mix(in srgb, #c8d0db, transparent 82%);
  border-radius: 0.7rem;
  background: color-mix(in srgb, #12161d, white 4%);
  color: color-mix(in srgb, #eef2f7, transparent 12%);
  font-size: 0.64rem;
  font-weight: 600;
  letter-spacing: 0.025em;
  text-decoration: none;
  text-transform: none;
  box-shadow: 0 0.35rem 1.1rem color-mix(in srgb, #000, transparent 78%);
  backdrop-filter: blur(10px);
}

.df-home-project-chip {
  left: 1rem;
}

.df-home-license-badge {
  right: 1rem;
}

.df-home-meta-chip:hover,
.df-home-meta-chip:focus-visible {
  border-color: color-mix(in srgb, var(--df-accent-primary), transparent 42%);
  background: color-mix(in srgb, #12161d, var(--df-accent-primary) 10%);
  color: #fff;
}

.df-homepage > h1 {
  margin-bottom: 0;
  font-size: clamp(2.2rem, 5vw, 4rem);
  line-height: 1.05;
}

.df-homepage > p {
  margin: 0;
  max-width: 34rem;
  color: var(--md-default-fg-color--light);
  font-size: 1.02rem;
  line-height: 1.55;
}

.df-home-wordmark {
  width: min(100%, 18rem);
  height: auto;
  margin-bottom: 0.15rem;
  filter: drop-shadow(0 0 1.6rem color-mix(in srgb, var(--df-accent-primary), transparent 72%));
}

.df-home-tagline {
  max-width: 34rem;
  margin: 0;
  color: color-mix(in srgb, #fff, transparent 18%);
  font-size: 1rem;
  font-weight: 500;
  line-height: 1.45;
  text-wrap: balance;
  text-shadow: 0 0.2rem 1.2rem color-mix(in srgb, #000, transparent 72%);
}

.df-home-actions {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.8rem;
  margin-top: 0.35rem;
  position: relative;
}

.df-homepage > .df-home-actions {
  z-index: 50;
}

.df-home-actions .md-button {
  opacity: 1;
  padding-inline: 1.1rem;
  border-color: color-mix(in srgb, var(--df-accent-primary), transparent 8%);
  background: color-mix(in srgb, #0b0f14, var(--df-accent-primary) 22%);
  color: #fff;
  box-shadow: 0 0.65rem 1.9rem color-mix(in srgb, #000, transparent 68%);
}

.df-home-actions .md-button:hover,
.df-home-actions .md-button:focus-visible {
  border-color: var(--df-accent-primary);
  background: color-mix(in srgb, #0b0f14, var(--df-accent-primary) 18%);
  color: #fff;
}

.df-home-actions .md-button--primary {
  background: var(--df-accent-primary);
  border-color: var(--df-accent-primary);
  color: #fff;
}

.df-home-actions .md-button--primary:hover,
.df-home-actions .md-button--primary:focus-visible {
  background: var(--df-accent-primary-hover);
  border-color: var(--df-accent-primary-hover);
}

.df-home-actions .md-button.df-home-download--mobile {
  background: color-mix(in srgb, #0b0f14, white 4%);
  border-color: color-mix(in srgb, #c8d0db, transparent 68%);
  color: color-mix(in srgb, #fff, transparent 26%);
  box-shadow: none;
  opacity: 0.82;
}

.df-home-actions .md-button.df-home-download--mobile:hover,
.df-home-actions .md-button.df-home-download--mobile:focus-visible {
  background: color-mix(in srgb, #0b0f14, white 6%);
  border-color: color-mix(in srgb, #c8d0db, transparent 58%);
  color: #fff;
}

.df-home-release-version {
  color: var(--md-default-fg-color--lighter) !important;
  font-size: 0.78rem !important;
  line-height: 1.3;
  letter-spacing: 0.01em;
  position: relative;
  z-index: 2;
}

/* Split download button + nightly dropdown */
.df-download-split {
  position: relative;
  display: flex;
}

.df-download-split > .md-button--primary {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}

.df-download-split-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0 0.55rem;
  background: var(--df-accent-primary);
  border: 1px solid var(--df-accent-primary);
  border-left: 1px solid color-mix(in srgb, var(--df-accent-primary-hover), transparent 30%);
  border-top-left-radius: 0;
  border-bottom-left-radius: 0;
  border-top-right-radius: 0.1rem;
  border-bottom-right-radius: 0.1rem;
  color: #fff;
  cursor: pointer;
  line-height: 1;
  box-shadow: none;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.df-download-split-toggle:hover,
.df-download-split-toggle:focus-visible,
.df-download-split-toggle[aria-expanded='true'] {
  background: var(--df-accent-primary-hover);
  border-color: var(--df-accent-primary-hover);
  border-left-color: color-mix(in srgb, var(--df-accent-primary-hover), transparent 30%);
  outline: none;
}

.df-download-split-toggle svg {
  width: 0.875rem;
  height: 0.875rem;
  transition: transform 0.2s ease;
  pointer-events: none;
}

.df-download-split-toggle[aria-expanded='true'] svg {
  transform: rotate(180deg);
}

.df-download-dropdown {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  min-width: 100%;
  background: color-mix(in srgb, #12161d, white 4%);
  border: 1px solid color-mix(in srgb, var(--df-accent-primary), transparent 60%);
  border-radius: 0.4rem;
  box-shadow: 0 0.5rem 1.5rem color-mix(in srgb, #000, transparent 55%);
  z-index: 10;
  overflow: hidden;
  backdrop-filter: blur(12px);
}

.df-download-dropdown[hidden] {
  display: none;
}

.df-download-dropdown-item {
  display: flex;
  flex-direction: column;
  padding: 0.65rem 0.9rem;
  text-decoration: none;
  color: #fff;
  white-space: nowrap;
  transition: background 0.15s ease;
}

.df-download-dropdown-item:hover,
.df-download-dropdown-item:focus-visible {
  background: color-mix(in srgb, #12161d, var(--df-accent-primary) 14%);
  color: #fff;
}

.df-download-dropdown-label {
  font-size: 0.88rem;
  font-weight: 600;
}

.df-download-dropdown-sub {
  font-size: 0.72rem;
  color: var(--md-default-fg-color--lighter);
  margin-top: 0.1rem;
}

.df-show-all-nightlies {
  background: none;
  border: none;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  width: 100%;
  border-top: 1px solid color-mix(in srgb, var(--df-accent-primary), transparent 75%);
  color: var(--md-default-fg-color--light);
  font-size: 0.78rem;
}

.df-show-all-nightlies .df-download-dropdown-label {
  font-weight: 500;
}

/* Nightly modal overlay */
.df-modal-overlay {
  position: fixed;
  inset: 0;
  background: color-mix(in srgb, #000, transparent 35%);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  animation: df-modal-fade-in 0.15s ease;
}

.df-modal-overlay[hidden] {
  display: none;
}

.df-modal {
  background: color-mix(in srgb, #12161d, white 4%);
  border: 1px solid color-mix(in srgb, var(--df-accent-primary), transparent 55%);
  border-radius: 0.6rem;
  box-shadow: 0 1rem 3rem color-mix(in srgb, #000, transparent 40%);
  width: min(90vw, 42rem);
  max-height: min(80vh, 35rem);
  display: flex;
  flex-direction: column;
  animation: df-modal-slide-up 0.18s ease;
}

.df-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 1rem 1.25rem;
  border-bottom: 1px solid color-mix(in srgb, #fff, transparent 88%);
}

.df-modal-header h2 {
  margin: 0;
  font-size: 1.1rem;
  font-weight: 700;
  color: #fff;
}

.df-modal-close {
  background: none;
  border: none;
  color: var(--md-default-fg-color--lighter);
  font-size: 1.5rem;
  cursor: pointer;
  padding: 0;
  line-height: 1;
  transition: color 0.15s ease;
}

.df-modal-close:hover {
  color: #fff;
}

.df-modal-body {
  padding: 0.5rem 0;
  overflow-y: auto;
  flex: 1;
}

.df-modal-loading,
.df-modal-empty {
  padding: 2rem 1.25rem;
  text-align: center;
  color: var(--md-default-fg-color--lighter);
  margin: 0;
}

.df-modal-nightly-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.65rem 1.25rem;
}

.df-modal-nightly-row + .df-modal-nightly-row {
  border-top: 1px solid color-mix(in srgb, #fff, transparent 92%);
}

.df-modal-nightly-info {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  min-width: 0;
}

.df-modal-nightly-name {
  font-size: 0.88rem;
  font-weight: 600;
  color: #fff;
  text-decoration: none;
}

.df-modal-nightly-name:hover {
  color: var(--df-accent-primary);
  text-decoration: underline;
}

.df-modal-nightly-meta {
  font-size: 0.72rem;
  color: var(--md-default-fg-color--lighter);
}

.df-modal-nightly-assets {
  display: flex;
  gap: 0.4rem;
  flex-shrink: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.df-modal-asset-link {
  display: inline-block;
  padding: 0.25rem 0.55rem;
  font-size: 0.72rem;
  font-weight: 600;
  border-radius: 0.25rem;
  background: rgba(186, 247, 46, 0.15);
  color: #baf72e;
  text-decoration: none;
  transition: background 0.12s ease;
}

.df-modal-asset-link:hover {
  background: rgba(186, 247, 46, 0.3);
  color: #e2fe8a;
}

.df-modal-no-assets {
  font-size: 0.72rem;
  color: var(--md-default-fg-color--lighter);
}

body.df-modal-open {
  overflow: hidden;
}

@keyframes df-modal-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

@keyframes df-modal-slide-up {
  from { opacity: 0; transform: translateY(0.75rem); }
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 720px) {
  .df-homepage-page .md-content {
    height: calc(100dvh - var(--df-home-header-height, 3.25rem));
    min-height: calc(100dvh - var(--df-home-header-height, 3.25rem));
  }

  .md-content__inner:has(.df-homepage) {
    height: 100%;
    min-height: 100%;
  }

  .df-homepage {
    min-height: 100%;
    padding: 0;
  }

  .df-home-wordmark {
    width: min(100%, 15rem);
  }

  .df-home-tagline {
    max-width: 24rem;
    font-size: 0.92rem;
  }

  .df-home-meta-chip {
    bottom: 0.8rem;
    font-size: 0.6rem;
    padding: 0.28rem 0.5rem;
  }

  .df-home-project-chip {
    left: 0.8rem;
  }

  .df-home-license-badge {
    right: 0.8rem;
  }
}
