:root {
  color-scheme: dark;
}

:root[data-theme="day"] {
  color-scheme: light;
}

::selection {
  background: color-mix(in srgb, var(--purple) 72%, transparent);
  color: #fff;
}

a,
button {
  -webkit-tap-highlight-color: transparent;
}

a:focus-visible,
button:focus-visible {
  outline: 3px solid color-mix(in srgb, var(--purple) 72%, #fff);
  outline-offset: 4px;
}

.theme-toggle {
  min-height: 44px;
  min-width: 91px;
  justify-content: center;
  transition: border-color .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease, transform .2s ease;
}

.theme-toggle:active {
  transform: translateY(1px);
}

.theme-toggle span {
  display: grid;
  width: 20px;
  place-items: center;
}

.orbit-node,
.product,
.secondary,
.principles div,
.cta,
footer {
  transition: background-color .25s ease, border-color .25s ease, color .25s ease, box-shadow .25s ease, transform .25s ease;
}

html[data-theme="day"] header {
  border-color: #b98acb;
  box-shadow: 0 14px 36px #35104020, 0 0 24px #7f1aa021;
}

html[data-theme="day"] .theme-toggle {
  background: #fff;
  border-color: #a96abe;
  box-shadow: 0 7px 20px #35104017;
}

html[data-theme="day"] .theme-toggle:hover {
  background: #f5eafb;
  border-color: var(--purple);
}

html[data-theme="day"] .secondary {
  background: #fff;
  border-color: #b98acb;
  box-shadow: 0 10px 28px #35104013;
}

html[data-theme="day"] .trust-row {
  border-color: #c19dce;
}

html[data-theme="day"] .product {
  background: #fff;
  border-color: #c69bd7;
  box-shadow: 0 24px 58px #32113e18;
}

html[data-theme="day"] .product:hover,
html[data-theme="day"] .product:focus-visible {
  border-color: var(--purple);
  box-shadow: 0 25px 62px #5d14732e, 0 0 0 1px #8119b52b;
}

html[data-theme="day"] .product-icon {
  background: #fbf5fd;
}

html[data-theme="day"] .principles div {
  background: #f0e4f5;
}

html[data-theme="day"] .cta {
  background: #fff;
  border-color: #c69bd7;
  box-shadow: 0 22px 58px #3510401c;
}

html[data-theme="day"] .hero {
  background: transparent;
}

html[data-theme="day"] :is(.company,.principles div) {
  border-color: #c69bd7;
}

.footer-adaptive-logo {
  display: inline-flex;
}

html[data-theme="day"] footer {
  border-color: #c19dce;
  box-shadow: 0 -16px 46px #3510400f;
}

html[data-theme="day"] .signal span {
  border-color: #77159e65;
}

html[data-theme="day"] .scan-edge {
  opacity: .88;
}

/*
 * Header and adaptive-logo behavior must live in an external stylesheet.
 * trejj.net deliberately blocks inline styles through CSP, so placing these
 * rules in the page made both logo variants visible and reverted the menu.
 */
.logo-link {
  padding: 2px 8px;
  border-radius: 12px;
}

.adaptive-logo-night,
.adaptive-logo-day {
  display: none !important;
}

.adaptive-logo-night {
  display: block !important;
}

html[data-theme="day"] .adaptive-logo-night {
  display: none !important;
}

html[data-theme="day"] .adaptive-logo-day {
  display: block !important;
}

body {
  padding-top: 96px;
}

header {
  position: fixed !important;
  top: 12px !important;
  right: max(18px, calc((100vw - 1760px) / 2));
  left: max(18px, calc((100vw - 1760px) / 2));
  width: auto;
  height: 72px;
  padding-inline: clamp(18px, 2.2vw, 38px);
  border: 1px solid color-mix(in srgb, var(--line) 72%, transparent);
  border-radius: 18px;
  box-shadow: 0 14px 45px #0008, 0 0 28px color-mix(in srgb, var(--purple) 13%, transparent);
}

html[data-theme="day"] header {
  box-shadow: 0 14px 45px #55107016, 0 0 28px #9b32bf12;
}

.hero {
  min-height: calc(100vh - 96px);
}

#portfolio,
#company {
  scroll-margin-top: 112px;
}

html[data-theme="day"] .run-top {
  background: linear-gradient(90deg, transparent, #8d1bb2 40%, #3a064c 90%) !important;
  box-shadow: 0 0 7px 2px #fff, 0 0 17px 5px #8f20b9, 0 0 28px 7px #65107f !important;
}

html[data-theme="day"] .run-right {
  background: linear-gradient(180deg, transparent, #8d1bb2 40%, #3a064c 90%) !important;
  box-shadow: 0 0 7px 2px #fff, 0 0 17px 5px #8f20b9, 0 0 28px 7px #65107f !important;
}

html[data-theme="day"] .run-bottom {
  background: linear-gradient(270deg, transparent, #8d1bb2 40%, #3a064c 90%) !important;
  box-shadow: 0 0 7px 2px #fff, 0 0 17px 5px #8f20b9, 0 0 28px 7px #65107f !important;
}

html[data-theme="day"] .run-left {
  background: linear-gradient(0deg, transparent, #8d1bb2 40%, #3a064c 90%) !important;
  box-shadow: 0 0 7px 2px #fff, 0 0 17px 5px #8f20b9, 0 0 28px 7px #65107f !important;
}

@media (max-width: 720px) {
  .theme-toggle {
    min-width: 48px;
  }

  body {
    padding-top: 80px;
  }

  header {
    top: 8px !important;
    right: 8px;
    left: 8px;
    height: 62px;
    padding-inline: 14px;
    border-radius: 15px;
  }

  .hero {
    min-height: auto;
  }
}

@media (min-width: 1536px) {
  main {
    max-width: 1760px;
    padding-inline: clamp(34px, 3vw, 64px);
  }

  footer {
    padding-inline: max(34px, calc((100vw - 1760px) / 2));
  }
}

@media (prefers-reduced-motion: reduce) {
  body,
  .theme-toggle,
  .orbit-node,
  .product,
  .secondary,
  .principles div,
  .cta,
  footer {
    transition-duration: 0s !important;
  }
}
