@import url('./style/status.css');

@view-transition {
  navigation: auto;
}

@font-face {
  font-family: 'Inter Display';
  src: url('./fonts/inter-display-latin.woff2') format('woff2-variations');
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
}

@font-face {
  font-family: 'Lato';
  src: url('./fonts/lato-400-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

@font-face {
  font-family: 'Lato';
  src: url('./fonts/lato-700-latin.woff2') format('woff2');
  font-style: normal;
  font-weight: 700;
  font-display: swap;
}

:root {
  color-scheme: light;
  --max-content: 78rem;
  --max-line: 52rem;
  --side-padding: 1rem;
  --grid-line: 28px;

  --background-1: hsl(0 0% 100%);
  --background-2: hsl(0 0% 96%);
  --background-3: hsl(0 0% 90%);
  --background-4: hsl(0 0% 86%);
  --foreground-1: hsl(230deg 9.52% 24.71%);
  --foreground-2: hsl(0 0% 27%);
  --foreground-3: hsl(0 0% 48%);
  --foreground-4: hsl(0 0% 61%);
  --highlight: hsl(0 0% 0% / 6%);
  --orange-1: hsl(26 94% 53%);
  --orange-2: hsl(26 88% 45%);
  --green-2: hsl(100 58% 42%);
  --red-1: hsl(7 98% 56%);
  --red-2: hsl(7 92% 54%);
}

html.page-home body {
  --orange-1: hsl(282.39deg 83.61% 46.78%);
  --orange-2: hsl(269.8deg 88% 45%);
  --green-2: hsl(100deg 10.06% 14.31%);
  --red-1: hsl(11.09deg 91.01% 40.67%);
  --red-2: hsl(7deg 92% 54%);

  position: relative;
}

html.page-home body::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  backdrop-filter: hue-rotate(246deg);
  mask-image: linear-gradient(134deg, transparent, black);
}

html.page-home main {
  --orange-2: hsl(274.84deg 89.76% 44.17%);
}

html.page-home .site-footer {
  --orange-2: hsl(259.73deg 87.66% 44.61%);
}

html.page-status .site-footer {
  --orange-2: hsl(17.05deg 95.3% 51.19%);
}

html.page-home[data-theme='dark'] {
  filter: hue-rotate(138deg) invert(1);
}

html.page-home[data-theme='dark'] body::after {
  backdrop-filter: hue-rotate(347deg);
  mask-image: linear-gradient(134deg, transparent, black);
}

html.page-home[data-theme='dark'] .home-status {
  filter: invert(1.1) brightness(1.1) hue-rotate(222deg)
    drop-shadow(0px 0px 34px #eee) blur(60px);
}

html.page-status[data-theme='dark'] {
  --orange-2: hsl(0deg 99.39% 35.18%);
  --green-2: hsl(123.16deg 83.12% 41.43%);

  filter: hue-rotate(48deg) invert(1);
}

html.page-status[data-theme='dark'] .status-notes,
html.page-status[data-theme='dark'] .status-artifacts {
  border: 1px solid var(--background-3);
}

* {
  box-sizing: border-box;
}

html {
  /* Uncomment one in DevTools to enable an experimental palette. */
  /* --palette: lagoon; */
  /* --palette: glow; */

  min-height: 100%;
  container-name: page-theme;
}

html.page-home {
  overflow-x: clip;
}

body {
  display: flex;
  min-height: 100vh;
  margin: 0;
  flex-direction: column;
  background: var(--background-2);
  color: var(--foreground-1);
  font-family: 'Inter Display', sans-serif;
  font-size: 16px;
  font-optical-sizing: auto;
  line-height: 1.65;
}

main {
  width: 100%;
  max-width: var(--max-content);
  flex: 1 0 auto;
  min-height: 42vh;
  margin: 0 auto;
  padding: 0 var(--side-padding) 4rem;
}

html.page-status main {
  font-family: 'Lato', sans-serif;
}

a {
  border-radius: 3px;
  color: var(--orange-2);
  text-decoration: underline transparent;
  text-underline-offset: 0.15em;
  transition: color 120ms ease, text-decoration-color 120ms ease;
}

a:hover {
  text-decoration-color: currentColor;
}

a:focus-visible,
button:focus-visible {
  outline: 2px solid var(--orange-1);
  outline-offset: 3px;
}

p,
ul,
ol,
summary {
  margin: 0 0 1rem;
}

h2,
h3,
h4 {
  color: var(--foreground-2);
}

h2 {
  margin: 0 0 1rem;
  font-size: clamp(1.55rem, 3vw, 2rem);
  line-height: 1.2;
}

h3,
h4 {
  margin: 1.5rem 0 0.75rem;
  line-height: 1.35;
}

code {
  border-radius: 4px;
  background: var(--highlight);
  padding: 0.12em 0.35em;
  font: 0.88em/1.5 ui-monospace, 'Cascadia Code', monospace;
  overflow-wrap: anywhere;
}

pre {
  margin: 1rem 0;
  padding: 1rem 1.1rem;
  overflow-x: auto;
  border: 1px solid var(--background-3);
  border-radius: 6px;
  background: var(--background-1);
}

pre code {
  padding: 0;
  background: transparent;
  white-space: pre;
}

svg {
  fill: currentColor;
}

.skip-link {
  position: absolute;
  top: 0.75rem;
  left: 0.75rem;
  z-index: 10;
  transform: translateY(-180%);
  padding: 0.5rem 0.75rem;
  background: var(--background-1);
}

.skip-link:focus-visible {
  transform: none;
}

.site-header {
  width: calc(100% - (2 * var(--side-padding)));
  max-width: var(--max-line);
  margin: 0 auto;
  padding: clamp(1.5rem, 5vw, 2.5rem) 0;
}

.site-brand {
  width: min(13.5rem, 70vw);
  view-transition-name: site-brand;
  margin: 0;
  line-height: 0;
}

.site-brand a {
  display: inline-block;
  color: inherit;
}

.site-brand img {
  display: block;
  width: 100%;
  height: auto;
}

.site-tagline {
  margin: 0.9rem 0 0;
  view-transition-name: site-tagline;
  color: var(--foreground-2);
  font-size: clamp(1rem, 2.4vw, 1.2rem);
  font-weight: 250;
  letter-spacing: -0.025em;
  line-height: 1.3;
}

.site-header-home {
  padding-top: clamp(2.25rem, 7vw, 5rem);
}

.site-header-home .site-brand {
  width: min(21.875rem, 82vw);
}

.site-header-home .site-tagline {
  margin-top: clamp(1.25rem, 3vw, 2.4rem);
  font-size: clamp(1.35rem, 4vw, 1.9rem);
}

.home-status {
  --home-status-okay: var(--green-2);
  --home-status-warning: var(--orange-1);
  --home-status-error: var(--red-1);
  --home-status-border: hsl(48.34deg 0.47% 27.62% / 47%);

  position: relative;
  left: 50%;
  width: 100vw;
  margin: clamp(3rem, 8vw, 3.5rem) 0 0 -50vw;
}

.home-status-link,
.home-status-ribbon {
  display: flex;
  width: 100%;
}

.home-status-link {
  border-radius: 0;
  text-decoration: none;
  box-shadow: 0 0 32px #453a3a75;
}

@container page-theme style(--palette: lagoon) {
  html.page-home[data-theme='light'] body::after {
    backdrop-filter: hue-rotate(230deg);
    mask-image: linear-gradient(344deg, transparent, black);
  }

  html.page-home[data-theme='light'] main {
    --orange-2: hsl(259.73deg 100% 56.03%);
  }

  html.page-home[data-theme='light'] .home-status-link {
    box-shadow: 0 0 32px #2c2a2e75;
  }
}

@container page-theme style(--palette: glow) {
  html.page-home[data-theme='light'] body::after {
    backdrop-filter: hue-rotate(255deg);
    mask-image: linear-gradient(108deg, transparent, black);
  }

  html.page-home[data-theme='light'] .home-status {
    filter: hue-rotate(300deg);
  }
}

.home-status-link:focus-visible {
  outline-offset: 4px;
}

.home-status-ribbon {
  height: clamp(1.35rem, 15.4vw, 7.05rem);
  background: var(--background-3);
  cursor: pointer;
  position: relative;
}

.home-status-ribbon::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
/*  backdrop-filter: hue-rotate(246deg);
  mask-image: linear-gradient(134deg, transparent, black);
*/}


.home-status-segment {
  --duration-warning-color: var(--home-status-warning);
  --duration-error-color: var(--home-status-error);

  position: relative;
  min-width: 0;
  height: 100%;
  flex-basis: 0;
  flex-shrink: 1;
}

.home-status-segment::after {
  content: '';
  position: absolute;
  inset: 0;
  border: 1px solid transparent;
  border-width: 0 2px;
  pointer-events: none;
}

.home-status-segment:hover::after {
  border-color: var(--home-status-border);
  transform: scaleX(1.4);
  background: #d4d7da3d;
}

.home-status-segment.is-okay {
  --home-status-segment-color: var(--home-status-okay);

  background: var(--home-status-segment-color);
}

.home-status-segment.is-warning {
  --home-status-segment-color: var(--home-status-warning);

  background: var(--home-status-segment-color);
  box-shadow: 0 0 6px 0 #6120af, 0 0 1px 0 #20af4d;
  transform: scale(1.05) skewX(-0.4deg);
}

.home-status-segment.is-error {
  --home-status-segment-color: var(--home-status-error);
  --duration-warning-color: var(--home-status-error);

  background: var(--home-status-segment-color);
  box-shadow: 0 0 1px 0 #3d20af;
}

.home-status-segment.has-duration-warning {
  background: linear-gradient(
    90deg,
    var(--home-status-segment-color) 0 var(--duration-warning-stop),
    var(--duration-warning-color) var(--duration-warning-stop) 100%
  );
}

.home-status-segment.has-duration-error {
  background: linear-gradient(
    90deg,
    var(--home-status-segment-color) 0 var(--duration-warning-stop),
    var(--duration-warning-color)
      var(--duration-warning-stop) var(--duration-error-stop),
    var(--duration-error-color) var(--duration-error-stop) 100%
  );
}

.home-status-segment.is-error:hover::after {
  border-color: hsl(53.38deg 19.32% 58.56% / 17%);
  background: #f45227a8;
  box-shadow: 0 0 3px 0 #3d20af;
}

.home-page {
  max-width: var(--max-line);
  margin: clamp(3rem, 8vw, 5.5rem) auto 0;
}

.home-page h2 {
  margin-bottom: clamp(2rem, 5vw, 3.5rem);
  font-size: clamp(2.25rem, 7vw, 4.6rem);
  font-weight: 680;
  letter-spacing: -0.055em;
  line-height: 0.94;
}

.artifact-list {
  margin: 0 0 clamp(2.25rem, 5vw, 3.5rem);
  padding: 0.15rem 0 0.15rem clamp(1rem, 3vw, 1.6rem);
  border-left: 3px solid var(--orange-1);
  font-size: clamp(1.05rem, 2.6vw, 1.3rem);
}

.artifact-list p {
  margin-bottom: 0.55rem;
}

.artifact-list p:last-child {
  margin-bottom: 0;
}

.artifact-list a code {
  background: transparent;
  padding: 0;
  color: inherit;
  font-size: 0.9em;
  font-weight: 650;
}

.more-artifacts {
  margin-top: clamp(2.25rem, 5vw, 3.5rem);
}

.package-status-prompt {
  position: relative;
  display: inline-flex;
  margin-top: clamp(1.75rem, 5vw, 3rem);
}

.package-status-link {
  font-size: clamp(1.25rem, 3vw, 1.65rem);
  font-weight: 650;
  letter-spacing: -0.025em;
  text-decoration-color: currentColor;
  text-decoration-thickness: 0.08em;
}

.package-status-link::after {
  content: ' →';
  display: inline-block;
  transition: transform 160ms ease-out;
}

.package-status-link:hover::after,
.package-status-link:focus-visible::after {
  transform: translateX(0.25em);
}

.site-footer {
  width: calc(100% - (2 * var(--side-padding)));
  max-width: var(--max-line);
  margin: 0 auto;
  padding: 2.5rem 0 3.5rem;
  border-top: 1px solid var(--background-3);
  color: var(--foreground-3);
  font-size: 0.82rem;
}

.footer-brand {
  display: inline-block;
  color: hsl(0 0% 0%);
  font-family: 'Inter Display', sans-serif;
  font-size: 1.25rem;
  font-weight: 900;
  line-height: 1;
  text-decoration: none;
}

.site-footer p {
  margin-bottom: 0.75rem;
}

.footer-built {
  visibility: hidden;
  opacity: 0;
  transition: opacity 240ms ease-out;
}

.footer-built.is-visible {
  visibility: visible;
  opacity: 1;
}

.site-footer nav {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 0.35rem 1rem;
}

.theme-switch {
  --theme-switch-rotation: 22.5deg;
  --theme-switch-duration: 180ms;
  --theme-switch-easing: cubic-bezier(0.2, 0.8, 0.2, 1);

  display: flex;
  flex: 0 0 auto;
  align-items: center;
  gap: 0.15rem;
  margin: -0.45rem -0.55rem -0.45rem -0.15rem;
  padding: 0;
  border: 0;
  border-radius: 0.45rem;
  background: transparent;
  color: hsl(0deg 0% 7.77%);
  font: inherit;
  line-height: inherit;
  cursor: pointer;
}

.theme-switch-scene {
  display: block;
  position: relative;
  width: 2.25rem;
  height: 2rem;
  perspective: 8rem;
}

.theme-switch-label {
  color: inherit;
  font-weight: 500;
}

.theme-switch-cylinder {
  display: block;
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
}

.theme-switch-icon {
  --theme-switch-offset: 0deg;
  --theme-switch-radius: 1.05rem;

  position: absolute;
  top: 50%;
  left: 50%;
  width: 13px;
  height: 13px;
  backface-visibility: hidden;
  transform: translate(-50%, -50%)
    rotate3d(
      1,
      -1,
      0,
      calc(var(--theme-switch-rotation) + var(--theme-switch-offset))
    )
    translateZ(var(--theme-switch-radius));
  transition: transform var(--theme-switch-duration) var(--theme-switch-easing);
}

.theme-switch-moon {
  --theme-switch-offset: -45deg;
}

.button-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.2ex;
  margin: 0;
  padding: 0;
  list-style: none;
}

.button {
  all: unset;
  appearance: none;
  display: flex;
  align-items: center;
  margin: 0;
  padding: 3px 8px;
  border-radius: 3px;
  color: var(--foreground-2);
  line-height: 22px;
  white-space: nowrap;
  cursor: pointer;
}

.button:hover {
  background: var(--background-4);
}

.button:disabled {
  opacity: 0.4;
  cursor: default;
}

.pager-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.pager-pagination {
  position: relative;
  top: -15px;
  display: flex;
  align-self: end;
  align-items: center;
  gap: 1rem;
}

.pager-pagination .button-group {
  font-size: 24px;
}

.pager-pagination .pager-nav-symbol {
  position: relative;
  top: -2px;
}

.pager-pagination .date-indicator {
  margin-left: 0.5rem;
  color: var(--foreground-3);
  font-size: 14px;
}

.screenreader-only {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

@media (max-width: 38rem) {
  .pager-header {
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 0.75rem;
  }

  .pager-pagination {
    top: 0;
    width: auto;
    min-width: 0;
    flex: 1 1 auto;
    align-self: auto;
    justify-content: flex-end;
    gap: clamp(0.25rem, 2vw, 1rem);
  }

  .pager-pagination .date-indicator {
    margin-left: 0;
    white-space: nowrap;
  }

  .status-heading {
    flex: 0 0 auto;
    margin-bottom: 0;
  }

  .status-notes,
  .status-artifacts {
    margin-right: calc(-0.35 * var(--side-padding));
    margin-left: calc(-0.35 * var(--side-padding));
    padding-right: var(--side-padding);
    padding-left: var(--side-padding);
  }
}

@media (max-width: 445px) {
  .pager-pagination .date-indicator {
    display: none;
  }
}

::view-transition-group(site-brand) {
  animation-duration: 420ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

::view-transition-group(site-tagline) {
  animation-duration: 360ms;
  animation-timing-function: cubic-bezier(0.22, 1, 0.36, 1);
}

::view-transition-old(site-brand),
::view-transition-new(site-brand),
::view-transition-old(site-tagline),
::view-transition-new(site-tagline) {
  mix-blend-mode: normal;
}

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

  .theme-switch-icon {
    transition-duration: var(--theme-switch-duration) !important;
  }

  ::view-transition-group(site-brand),
  ::view-transition-group(site-tagline) {
    animation-duration: 0.01ms;
  }
}
