/* Front door styles: CGS tokens only (see cgs-tokens.css). */
html, body {
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
}

#portal {
  display: block;
  width: 100%;
  height: 100%;
  border: 0;
}

/* Loader: the CGS mark and name, with a thin orange sliver moving under them. Branded, calm, clearly alive. */
.loader {
  position: fixed;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--space-s);
  padding: var(--space-m);
  box-sizing: border-box;
  text-align: center;
  background: var(--color-bg);
  border-top: var(--border-bar) solid var(--color-brand);
  transition: opacity var(--duration-fast);
}
.loader[hidden],
.loader-help[hidden],
.fallback[hidden] {
  display: none;
}
.loader.done {
  opacity: 0;
  pointer-events: none;
}
.loader-mark {
  width: var(--size-loader-logo);
  height: var(--size-loader-logo);
  fill: var(--color-brand);
}
.loader-text {
  margin: 0;
  font-family: var(--font-heading);
  font-weight: var(--weight-medium);
  font-size: var(--text-lg);
  color: var(--color-text-strong);
}
.loader-bar {
  position: relative;
  overflow: hidden;
  width: var(--meta-col);
  height: var(--border-thick);
  background: var(--color-border);
}
.loader-bar::after {
  content: "";
  position: absolute;
  inset: 0;
  width: 40%;
  background: var(--color-brand);
  animation: loader-slide var(--duration-pulse) ease-in-out infinite;
}
@keyframes loader-slide {
  from { transform: translateX(-100%); }
  to { transform: translateX(250%); }
}
@media (prefers-reduced-motion: reduce) {
  .loader-bar::after { animation: none; width: 100%; }
}
.loader-help {
  margin: 0;
  font-size: var(--text-md);
  color: var(--color-text-muted);
}

a {
  color: var(--color-brand-text);
}
a:hover {
  filter: brightness(var(--hover-brightness));
}

/* Corner link: not shown on a normal load. It appears only if the portal has not shown within the give-up time. */
.fallback {
  position: fixed;
  right: max(var(--space-s), env(safe-area-inset-right, 0));
  bottom: max(var(--space-s), env(safe-area-inset-bottom, 0));
  padding: var(--space-3xs) var(--space-xs);
  background: var(--color-surface);
  border: var(--border-thin) solid var(--color-border);
  border-radius: var(--radius-none);
  font-size: var(--text-xs);
  opacity: var(--opacity-soft);
}
.fallback:hover,
.fallback:focus-visible {
  opacity: 1;
}
