/* Small amount of custom CSS for things Tailwind's CDN build doesn't cover
   nicely: the layered background, and the entrance animations. */

:root {
  --bg: #09090b;
  --accent: 129 140 248; /* indigo-400 */
}

html {
  color-scheme: dark;
}

body {
  background-color: var(--bg);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Faint grid, faded out towards the edges. */
.bg-grid {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.045) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.045) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 80% 60% at 50% 0%, #000 40%, transparent 100%);
}

/* Soft coloured bloom behind the card. */
.bg-glow {
  background:
    radial-gradient(ellipse 60% 45% at 50% -10%, rgba(99, 102, 241, 0.22), transparent 70%),
    radial-gradient(ellipse 45% 35% at 85% 15%, rgba(56, 189, 248, 0.1), transparent 70%);
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.animate-rise {
  animation: rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both;
}

.delay-1 { animation-delay: 0.06s; }
.delay-2 { animation-delay: 0.12s; }
.delay-3 { animation-delay: 0.18s; }

@media (prefers-reduced-motion: reduce) {
  .animate-rise {
    animation: none;
  }
}

/* Autofill in Chrome otherwise paints inputs bright blue. */
input:-webkit-autofill,
input:-webkit-autofill:hover,
input:-webkit-autofill:focus {
  -webkit-text-fill-color: #fafafa;
  -webkit-box-shadow: 0 0 0 1000px #131316 inset;
  caret-color: #fafafa;
  transition: background-color 9999s ease-out 0s;
}

/* Same grid, faded downwards — used on interior pages that have no bloom. */
.bg-grid-fade {
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.035) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.035) 1px, transparent 1px);
  background-size: 56px 56px;
  mask-image: linear-gradient(to bottom, #000 0%, transparent 45%);
  -webkit-mask-image: linear-gradient(to bottom, #000 0%, transparent 45%);
}

/* The bust sits behind the login card as a watermark: large, faint, and faded
   at the edges so it reads as lighting rather than a picture. */
.logo-watermark {
  position: fixed;
  right: -3%;
  bottom: -6%;
  z-index: 0;
  height: min(94vh, 760px);
  opacity: 0.085;
  filter: grayscale(1) contrast(1.08);
  mask-image: radial-gradient(ellipse 68% 66% at 42% 34%, #000 42%, transparent 100%);
  -webkit-mask-image: radial-gradient(ellipse 68% 66% at 42% 34%, #000 42%, transparent 100%);
  pointer-events: none;
  user-select: none;
}

/* On narrow screens the bust would sit under the form fields. */
@media (max-width: 720px) {
  .logo-watermark {
    right: -22%;
    bottom: -4%;
    height: 62vh;
    opacity: 0.06;
  }
}

/* The logo tile, used small in the header and larger on the login screen. */
.logo-tile {
  display: block;
  overflow: hidden;
  flex: none;
  background: linear-gradient(180deg, #1c1c22, #101014);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
}

.logo-tile img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  /* Frame the face rather than the centre of the bounding box. */
  object-position: 50% 30%;
  filter: grayscale(1) contrast(1.1) brightness(1.06);
}
