/*
    Embedship global styles
 */

:root {
  color-scheme: light dark;
  --embedship-bg-color: #121212;
  --embedship-fg-color: #ffffff;
  --embedship-accent-color: #6ea8fe;
  --embedship-header-bg-color: transparent;
  --embedship-header-border-color: color-mix(
    in srgb,
    var(--embedship-fg-color) 15%,
    transparent
  );
}

body[data-resolved-theme="light"] {
  --embedship-bg-color: #fafafa;
  --embedship-fg-color: #1a1a1a;
  --embedship-accent-color: #000000;
  --embedship-header-bg-color: #ffffff;
  --embedship-header-border-color: color-mix(
    in srgb,
    var(--embedship-fg-color) 12%,
    transparent
  );
  color-scheme: only light;
}

body[data-resolved-theme="dark"] {
  --embedship-bg-color: linear-gradient(#121212, #075d6c);
  --embedship-fg-color: #f5f5f5;
  --embedship-accent-color: #1096ad;
  --embedship-header-bg-color: #000000;
  --embedship-header-border-color: color-mix(
    in srgb,
    var(--embedship-accent-color) 35%,
    transparent
  );
  color-scheme: only dark;
}

html,
body {
  height: 100%;
}

body {
  margin: 0 auto;
  max-width: 1800px;
  font-family: system-ui;
  background: var(--embedship-bg-color);
  color: var(--embedship-fg-color);
}

.embedship-coming-soon-page {
  display: flex;
  flex-direction: column;
  min-height: 100%;
}

.embedship-main {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 2rem;
  text-align: center;
}

.embedship-message {
  font-size: clamp(1.25rem, 3vw, 1.75rem);
  line-height: 1.4;
  opacity: 0.85;
}

.embedship-message p {
  margin: 0;
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-old(root) {
  z-index: 1;
}

::view-transition-new(root) {
  z-index: 2;
  animation: embedship-theme-reveal 450ms cubic-bezier(0.22, 1, 0.36, 1)
    forwards;
  will-change: clip-path;
}

@keyframes embedship-theme-reveal {
  from {
    clip-path: circle(
      0% at var(--embedship-reveal-x, 50%) var(--embedship-reveal-y, 50%)
    );
  }
  to {
    clip-path: circle(
      var(--embedship-reveal-radius, 150%) at var(--embedship-reveal-x, 50%)
        var(--embedship-reveal-y, 50%)
    );
  }
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-new(root) {
    animation-duration: 1ms;
  }
}

@media (pointer: coarse) {
  ::view-transition-new(root) {
    animation-duration: 300ms;
  }
}

.embedship-title {
  color: var(--embedship-accent-color);
  margin: 0;
  padding: 0.4rem;
  font-size: 1.3rem;
}

.embedship-visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.embedship-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0.5rem;
  background: var(--embedship-header-bg-color);
  border-bottom: 1px solid var(--embedship-header-border-color);
}

.embedship-theme-toggle {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background-color: color-mix(
    in srgb,
    var(--embedship-fg-color) 8%,
    transparent
  );
  border: 1px solid
    color-mix(in srgb, var(--embedship-fg-color) 18%, transparent);
  border-radius: 999px;
}

@media (hover: hover) and (pointer: fine) {
  .embedship-theme-toggle {
    backdrop-filter: blur(8px);
  }
}

.embedship-theme-toggle__option {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 32px;
  height: 32px;
  padding: 0;
  color: var(--embedship-fg-color);
  background-color: transparent;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  opacity: 0.55;
  transition:
    opacity 150ms ease,
    background-color 150ms ease,
    color 150ms ease;
}

.embedship-theme-toggle__option:hover,
.embedship-theme-toggle__option:focus-visible {
  opacity: 1;
  background-color: color-mix(
    in srgb,
    var(--embedship-fg-color) 10%,
    transparent
  );
}

.embedship-theme-toggle__option[aria-checked="true"] {
  opacity: 1;
  color: var(--embedship-accent-color);
  background-color: color-mix(
    in srgb,
    var(--embedship-accent-color) 18%,
    transparent
  );
}

.embedship-theme-toggle__option:focus-visible {
  outline: 2px solid var(--embedship-accent-color);
  outline-offset: 2px;
}

.embedship-theme-toggle__icon {
  display: block;
}
