/* Homepage geometry follows Zensical's published hero stylesheet, adapted
   for Titancore's palette and copy: https://zensical.org/ */
:root {
  --ts-blue: #4795ea;
  --ts-blue-light: #71befe;
  --ts-night: #0b0c0f;
}

[data-md-color-scheme="default"] {
  --md-primary-fg-color: #1b5fa8;
  --md-primary-fg-color--light: #eaf3ff;
  --md-primary-fg-color--dark: #124a80;
  --md-accent-fg-color: #1b5fa8;
}

[data-md-color-scheme="slate"] {
  --md-primary-fg-color: #4795ea;
  --md-primary-fg-color--light: #172554;
  --md-primary-fg-color--dark: #71befe;
  --md-accent-fg-color: #71befe;
}

html:has(.ts-home),
body:has(.ts-home) {
  height: 100%;
  margin: 0;
  overflow: hidden;
}

body:has(.ts-home) {
  background-color: var(--ts-night);
  color: #fff;
}

body:has(.ts-home) .md-main,
body:has(.ts-home) .md-main__inner,
body:has(.ts-home) .md-content,
body:has(.ts-home) .md-content__inner {
  max-width: none;
  margin: 0;
  padding: 0;
  background-color: transparent;
  min-height: 0;
}

body:has(.ts-home) .md-main {
  height: calc(100vh - 48px);
  height: calc(100svh - 48px);
}

body:has(.ts-home) .md-main__inner {
  display: block;
  height: 100%;
  margin-top: 0;
}

body:has(.ts-home) .md-content,
body:has(.ts-home) .md-content__inner {
  height: 100%;
}

body:has(.ts-home) .md-content__button,
body:has(.ts-home) .md-sidebar--secondary {
  display: none;
}

body:has(.ts-home) .md-header {
  background-color: transparent;
  box-shadow: none;
  color: #fff;
  backdrop-filter: none;
}

body:has(.ts-home) .md-header__option {
  display: none;
}

body:has(.ts-home) .md-header__title,
body:has(.ts-home) .md-header__button,
body:has(.ts-home) .md-header__source,
body:has(.ts-home) .md-source {
  color: #fff;
}

body:has(.ts-home) .md-header__source,
body:has(.ts-home) .md-source {
  display: none;
}

body:has(.ts-home) .md-search__button {
  background-color: rgba(226, 228, 233, 0.12);
  color: rgba(226, 228, 233, 0.82);
}

body:has(.ts-home) .md-search__button::before {
  background-color: #c5c5c5;
}

body:has(.ts-home) .md-search__button::after {
  background-color: rgba(255, 255, 255, 0.1);
  color: rgba(226, 228, 233, 0.82);
}

body:has(.ts-home) .md-search__input,
body:has(.ts-home) .md-search__icon {
  color: #fff;
}

body:has(.ts-home) .md-search__input::placeholder {
  color: rgba(226, 228, 233, 0.82);
}

body:has(.ts-home) .md-footer {
  display: none;
}

.ts-home {
  position: relative;
  height: calc(100vh - 49px);
  height: calc(100svh - 49px);
  min-height: 480px;
  overflow: visible;
  margin-top: -7px;
  background-color: transparent;
  color: #fff;
}

.mdx-hero {
  position: fixed;
  z-index: 0;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100svh;
  background-color: var(--ts-night);
}

body:not(:has(.ts-home)) > .mdx-hero {
  visibility: hidden;
}

.mdx-hero::before {
  /* Published fallback frame, hue-shifted to Titancore blue:
     https://zensical.org/assets/attractor-3996-1980.png */
  position: absolute;
  inset: -2%;
  display: none;
  background-image: url("../assets/titancore-attractor.png");
  background-position: 50%;
  background-repeat: no-repeat;
  background-size: cover;
  content: "";
  filter: hue-rotate(190deg) saturate(0.9) brightness(0.86);
  animation: ts-attractor-drift 38s ease-in-out infinite alternate;
}

.no-webgl .mdx-hero::before,
.mdx-hero:not(:has(canvas))::before {
  display: block;
}

.mdx-hero canvas {
  filter: hue-rotate(190deg) saturate(0.9) brightness(0.9);
}

.ts-site-tabs {
  position: relative;
  z-index: 2;
  box-shadow: inset 0 -0.05rem 0 rgba(255, 255, 255, 0.1);
}

.ts-site-tabs .md-tabs__item {
  color: #fff;
}

.ts-site-tabs .md-tabs__item--active {
  border-bottom-color: var(--ts-blue-light);
}

.ts-site-tabs .md-tabs__link {
  text-decoration: none;
}

.md-typeset .ts-site-tabs .md-tabs__list {
  display: flex;
  padding: 0;
  margin: 0;
  margin-inline-start: 8px;
  overflow: auto;
  list-style: none;
}

.md-typeset .ts-site-tabs .md-tabs__item {
  display: block;
  height: 48px;
  padding-inline: 12px;
  margin: 0;
}

.md-typeset .ts-site-tabs .md-tabs__link {
  display: flex;
  margin-top: 16px;
  color: #fff;
  font-size: 14px;
  opacity: 0.7;
}

.md-typeset .ts-site-tabs .md-tabs__link:hover,
.md-typeset .ts-site-tabs .md-tabs__item--active .md-tabs__link {
  color: #fff;
  opacity: 1;
}

.mdx-teaser {
  position: absolute;
  z-index: 3;
  bottom: 96px;
  width: 100%;
}

.mdx-teaser .md-grid {
  padding: 0 16px;
}

.mdx-teaser h1 {
  max-width: 420px;
  margin: 0;
  color: #fff;
  font-size: 48px;
  font-weight: 700;
  letter-spacing: -0.05em;
  line-height: 1.2;
  text-shadow: 0 0 16px #000;
}

.mdx-teaser p {
  max-width: 500px;
  color: #fff;
  font-size: 18px;
  line-height: 1.5;
  text-shadow: 0 0 8px #000;
}

.mdx-teaser small {
  color: rgba(230, 235, 242, 0.82);
  opacity: 1;
}

.mdx-teaser a {
  color: inherit;
}

.mdx-teaser a:focus,
.mdx-teaser a:hover {
  color: #fff;
}

.mdx-teaser .md-button {
  border-radius: 999px;
  background-color: rgba(255, 255, 255, 0.12);
  color: #fff;
  backdrop-filter: blur(4px);
  transition: all 0.25s;
}

.mdx-teaser .md-button:focus,
.mdx-teaser .md-button:hover {
  color: #fff;
}

.mdx-teaser .md-button--primary {
  background: linear-gradient(
    35deg,
    rgba(27, 95, 168, 0.94),
    rgba(113, 190, 254, 0.82)
  );
}

.mdx-teaser .md-button--primary:focus,
.mdx-teaser .md-button--primary:hover {
  background: linear-gradient(35deg, #1b5fa8, #71befe);
  color: #fff;
}

.mdx-parameters {
  position: absolute;
  z-index: 2;
  right: 0;
  bottom: 16px;
  left: 0;
  font-family: var(--md-code-font-family);
}

.mdx-parameters .md-grid {
  display: flex;
  justify-content: flex-start;
  padding-left: 16px;
}

.mdx-parameters,
.mdx-position {
  color: rgba(230, 235, 242, 0.82);
  font-size: 10px;
}

.mdx-parameters code,
.mdx-position code {
  padding: 2px 4px;
  border-radius: 0;
  background-color: transparent;
  color: inherit;
  font-size: inherit;
  box-shadow: none;
}

.mdx-parameters sub,
.mdx-position sub {
  color: #fff;
}

.mdx-parameter {
  padding: 2px 4px;
  color: inherit;
  cursor: ns-resize;
  outline: none;
  touch-action: none;
  user-select: none;
}

.mdx-parameter,
.mdx-parameter sub {
  transition: all 0.25s;
}

.mdx-parameter--active {
  border-radius: 4px;
  background: rgba(71, 149, 234, 0.2);
  color: var(--ts-blue-light);
}

.mdx-parameter--active sub {
  color: var(--ts-blue-light);
}

.mdx-position {
  position: absolute;
  right: 0;
  bottom: 16px;
  left: 0;
  font-family: var(--md-code-font-family);
}

.mdx-position .md-grid {
  display: flex;
  justify-content: flex-end;
  padding-right: 16px;
}

.mdx-position code {
  padding: 2px 4px;
}

@keyframes ts-attractor-drift {
  from {
    transform: scale(1.02) translate3d(-0.25%, 0.15%, 0);
  }

  to {
    transform: scale(1.08) translate3d(0.25%, -0.15%, 0);
  }
}

@media (max-width: 600px) {
  .mdx-parameters {
    display: none;
  }

  .mdx-teaser {
    bottom: 56px;
  }

  .mdx-teaser h1 {
    font-size: 36px;
  }

  .mdx-teaser p {
    font-size: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .mdx-hero::before {
    animation: none;
  }
}
