@font-face {
  font-family: "Corsair Cuneiform";
  src: url("corsair-radio/fonts/NotoSansCuneiform-Regular.ttf") format("truetype");
  font-display: block;
  font-style: normal;
  font-weight: 400;
}

:root {
  color-scheme: dark;
  background: #050607;
  font-family: Inter, system-ui, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  min-width: 320px;
  min-height: 100%;
  margin: 0;
}

.cr-gate {
  min-height: 100dvh;
  overflow: hidden;
  color: #d8b678;
  background:
    radial-gradient(ellipse at 50% 42%, rgba(184, 132, 63, 0.11) 0, rgba(70, 48, 25, 0.035) 22rem, transparent 49rem),
    radial-gradient(ellipse at 50% -18%, rgba(124, 130, 127, 0.075), transparent 46%),
    linear-gradient(160deg, #101213 0%, #090a0b 44%, #030405 100%);
}

.cr-gate::before {
  position: fixed;
  inset: 0;
  background:
    repeating-linear-gradient(112deg, transparent 0 11px, rgba(255, 255, 255, 0.006) 12px 13px),
    url("corsair-radio/textures/noise-tile-256.png");
  content: "";
  opacity: 0.24;
  pointer-events: none;
}

.cr-gate::after {
  position: fixed;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(0, 0, 0, 0.42), transparent 22%, transparent 69%, rgba(0, 0, 0, 0.68)),
    radial-gradient(ellipse at center, transparent 28%, rgba(0, 0, 0, 0.18) 60%, rgba(0, 0, 0, 0.78) 100%);
  box-shadow: inset 0 0 14vw rgba(0, 0, 0, 0.74);
  content: "";
  pointer-events: none;
}

.cr-gate__blackout {
  position: fixed;
  z-index: 0;
  inset: 0;
  background: #000;
  opacity: 0;
  pointer-events: none;
  transition: opacity 420ms ease;
}

.cr-gate__main {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(82vw, 29rem);
  min-height: calc(100dvh - 7rem);
  margin: 0 auto;
  align-content: center;
  justify-items: center;
  gap: clamp(2.6rem, 8vh, 5.4rem);
}

.cr-gate__logo {
  width: clamp(8.5rem, 22vw, 13.5rem);
  height: auto;
  filter:
    drop-shadow(0 0 2.4rem rgba(207, 163, 91, 0.13))
    drop-shadow(0 1.5rem 4rem rgba(0, 0, 0, 0.84));
  opacity: 0.82;
  transition: opacity 380ms ease, transform 520ms cubic-bezier(0.22, 1, 0.36, 1);
}

.cr-gate__form {
  width: min(100%, 23rem);
}

.cr-gate__field {
  position: relative;
  display: block;
  height: 4.2rem;
  overflow: hidden;
  border: 1px solid rgba(216, 182, 120, 0.19);
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.56);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.018),
    inset 0 -1.3rem 3rem rgba(0, 0, 0, 0.24),
    0 1.8rem 5rem rgba(0, 0, 0, 0.52);
  transition:
    border-color 180ms ease,
    box-shadow 180ms ease,
    opacity 260ms ease,
    transform 360ms cubic-bezier(0.55, 0, 1, 0.45);
}

.cr-gate__field:focus-within {
  border-color: rgba(216, 182, 120, 0.7);
  box-shadow:
    0 0 0 1px rgba(216, 182, 120, 0.13),
    0 0 2.8rem rgba(207, 163, 91, 0.1);
}

.cr-gate__field input,
.cr-gate__field output {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  margin: 0;
  padding: 0 1.25rem;
  border: 0;
  background: transparent;
  font: 400 clamp(1.35rem, 4vw, 1.8rem)/4.2rem "Corsair Cuneiform", "Segoe UI Historic", serif;
  letter-spacing: 0.36em;
  text-align: center;
}

.cr-gate__field input {
  z-index: 2;
  color: transparent;
  caret-color: #d8b678;
  outline: 0;
}

.cr-gate__field output {
  z-index: 1;
  display: block;
  overflow: hidden;
  color: #d8b678;
  text-overflow: clip;
  white-space: nowrap;
  pointer-events: none;
}

.cr-gate__notice {
  position: fixed;
  z-index: 1;
  right: 1.5rem;
  bottom: max(1.25rem, env(safe-area-inset-bottom));
  left: 1.5rem;
  margin: 0;
  color: rgba(226, 220, 208, 0.48);
  font-size: 0.7rem;
  line-height: 1.5;
  letter-spacing: 0.08em;
  text-align: center;
}

.cr-gate.is-auth-departing .cr-gate__field,
.cr-gate.is-auth-departing .cr-gate__notice {
  opacity: 0;
  transform: scaleX(0.82) translateY(1rem);
}

.cr-gate.is-auth-departing .cr-gate__logo {
  opacity: 1;
  transform: translateY(4.5vh) scale(1.04);
}

.cr-gate.is-auth-departing .cr-gate__blackout { opacity: 1; }

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

@media (max-height: 560px) {
  .cr-gate__main {
    min-height: calc(100dvh - 4rem);
    grid-template-columns: 7rem minmax(12rem, 23rem);
    gap: 2rem;
  }

  .cr-gate__logo {
    width: 7rem;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .cr-gate__logo {
    animation: corsair-breathe 5s ease-in-out infinite;
  }

  @keyframes corsair-breathe {
    50% {
      filter:
        drop-shadow(0 0 3rem rgba(207, 163, 91, 0.2))
        drop-shadow(0 1.5rem 4rem rgba(0, 0, 0, 0.84));
    }
  }
}

.cr-gate__install { width: min(100%, 23rem); margin-top: -1rem; text-align: center; }
.cr-gate__install[hidden] { display: none; }
.cr-gate__install-button {
  display: inline-flex; align-items: center; justify-content: center; gap: 0.7rem;
  min-height: 3.4rem; padding: 0.45rem 1.3rem;
  border: 1px solid rgba(216, 182, 120, 0.25); border-radius: 2px;
  background: rgba(0, 0, 0, 0.48); color: #d8b678;
  font: inherit; font-size: 0.75rem; letter-spacing: 0.12em; cursor: pointer;
}
.cr-gate__install-button img { width: 2.2rem; height: 2.2rem; object-fit: contain; }
.cr-gate__install-button:hover, .cr-gate__install-button:focus-visible {
  border-color: #d8b678; outline: 2px solid rgba(216, 182, 120, 0.2); outline-offset: 3px;
}
.cr-gate__install-help { color: #b9a88b; font-size: 0.75rem; line-height: 1.6; }
.cr-gate.is-auth-departing .cr-gate__install { opacity: 0; pointer-events: none; }
@media (max-height: 560px) {
  .cr-gate__install { grid-column: 2; }
  .cr-gate__main { row-gap: 1rem; padding: 1rem 0; }
  .cr-gate__logo { grid-row: 1 / 3; }
}
