@font-face {
  font-family: Monocraft;
  src: url('/assets/Monocraft.ttf') format('truetype');
  font-display: swap;
}

:root {
  color-scheme: dark;
  --background: #090d14;
  --foreground: #e5e7eb;
  --muted: #aeb8c7;
  --panel: #0f172ad1;
  --inset: #02061799;
  --border: #ffffff24;
  --border-strong: #ffffff5c;
  --overlay: #0206174d;
  --vignette: #02061766;
  --gold: #ffd679;
  --error: #ff9b93;
}

html[data-theme='day'] {
  color-scheme: light;
  --background: #f7f6f1;
  --foreground: #1f2937;
  --muted: #4b586a;
  --panel: #ffffffd9;
  --inset: #fbfaf7d9;
  --border: #0000001f;
  --border-strong: #0000007a;
  --overlay: #ffffff4d;
  --vignette: #352a1e10;
  --gold: #805000;
  --error: #a3180f;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html { min-width: 320px; background: var(--background); }
body { margin: 0; color: var(--foreground); font: 1rem/1.6 Monocraft, monospace; -webkit-font-smoothing: antialiased; }
button, a { -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
::selection { color: #0f172a; background: #ffd679; }
:focus-visible { outline: 3px solid var(--gold); outline-offset: 3px; }

.scene { position: fixed; inset: 0; overflow: hidden; pointer-events: none; }
.scene__image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transform: scale(1.05);
  filter: blur(3px) saturate(.75);
  transition: opacity 900ms ease, filter 900ms ease, transform 1200ms cubic-bezier(.16, 1, .3, 1);
}
html[data-theme='night'] .scene__image--night,
html[data-theme='day'] .scene__image--day { opacity: 1; }
.scene__shade {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at 50% 40%, transparent 25%, var(--vignette) 100%), var(--overlay);
}

.page {
  position: relative;
  min-height: 100vh;
  min-height: 100svh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 32px 24px 48px;
}
.panel {
  width: min(100%, 496px);
  padding: 28px 44px 30px;
  text-align: center;
  border: 1px solid var(--border);
  border-radius: 24px;
  background: var(--panel);
  box-shadow: 0 24px 80px #00000021;
  transition: opacity 500ms ease, transform 600ms cubic-bezier(.16, 1, .3, 1), background-color 900ms ease;
}
.logo { display: block; width: 148px; height: auto; margin: 0 auto 8px; filter: drop-shadow(0 8px 16px #00000035); }
.soon {
  margin: 0;
  font-size: clamp(3.25rem, 16vw, 4.25rem);
  font-weight: 400;
  line-height: 1.2;
  letter-spacing: -.04em;
  white-space: nowrap;
}
.soon sup { margin-left: .15em; color: var(--gold); font-size: .28em; line-height: 1; vertical-align: 1.7em; letter-spacing: 0; }
.intro { margin: 14px 0 22px; color: var(--muted); text-wrap: balance; }

label { display: block; margin-bottom: 8px; color: var(--muted); font-size: .875rem; text-align: left; }
.field { position: relative; }
.field input {
  width: 100%;
  height: 56px;
  padding: 0 84px 0 18px;
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  background: var(--inset);
  color: var(--foreground);
  font: inherit;
  letter-spacing: .04em;
  caret-color: var(--gold);
}
.field input::-ms-reveal { display: none; }
.field input:focus { outline: 3px solid var(--gold); outline-offset: 2px; }
.reveal {
  position: absolute;
  top: 6px;
  right: 6px;
  height: 44px;
  padding: 0 14px;
  border: 0;
  border-radius: 8px;
  background: none;
  color: var(--muted);
  font: inherit;
  font-size: .875rem;
  cursor: pointer;
}
.reveal:hover { color: var(--foreground); }
.message { min-height: 22px; margin: 10px 0 14px; color: var(--error); font-size: .875rem; line-height: 1.55; text-align: left; }
html[data-state='wrong'] .field input,
html[data-state='wait'] .field input { border-color: var(--error); }
html[data-state='wrong'] .field { animation: knock 320ms ease; }
.enter {
  width: 100%;
  min-height: 54px;
  border: 1px solid #ffe5a6;
  border-radius: 12px;
  background: #f2c567;
  box-shadow: inset 0 1px 0 #ffffff40, 0 3px 0 #ac782e;
  color: #241b0e;
  font: inherit;
  font-size: .9375rem;
  cursor: pointer;
  transition: transform 180ms ease, background-color 180ms ease, box-shadow 180ms ease;
}
.enter:hover:not(:disabled) { background: #ffda86; transform: translateY(-2px); box-shadow: inset 0 1px 0 #ffffff40, 0 5px 0 #ac782e; }
.enter:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 1px 0 #ffffff40, 0 1px 0 #ac782e; }
.enter:disabled { opacity: .6; cursor: default; }
.help { margin: 24px 0 0; padding-top: 20px; border-top: 1px solid var(--border); color: var(--muted); font-size: .875rem; }
.help a { color: var(--gold); text-underline-offset: 4px; }
.footer { margin-top: 20px; font-size: .8125rem; text-align: center; }
.footer p { margin: 0; }

.toggle {
  position: fixed;
  right: 24px;
  bottom: 24px;
  width: 80px;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--panel);
  color: var(--foreground);
  cursor: pointer;
}
.toggle svg { position: absolute; top: 12px; z-index: 1; width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.toggle svg:nth-child(1) { left: 12px; color: var(--background); }
.toggle svg:nth-child(2) { right: 12px; }
.toggle i { position: absolute; top: 5px; left: 5px; width: 32px; height: 32px; border-radius: 50%; background: var(--foreground); transition: transform 400ms cubic-bezier(.2, .8, .2, 1); }
html[data-theme='day'] .toggle i { transform: translateX(36px); }
html[data-theme='day'] .toggle svg:nth-child(1) { color: var(--foreground); }
html[data-theme='day'] .toggle svg:nth-child(2) { color: var(--background); }

/* Right password: the card lifts and spawn comes into focus. */
html[data-state='open'] .panel { opacity: 0; transform: translateY(-28px); pointer-events: none; }
html[data-state='open'] .scene__image { filter: none; transform: scale(1.12); }

@keyframes knock { 25% { transform: translateX(-6px); } 60% { transform: translateX(5px); } 85% { transform: translateX(-2px); } }

@media (min-width: 601px) and (max-height: 800px) {
  .page { padding-block: 16px 24px; }
  .panel { padding-block: 18px 20px; }
  .logo { width: 112px; }
  .soon { font-size: 3.75rem; }
  .intro { margin: 10px 0 14px; }
  .help { margin-top: 18px; padding-top: 14px; }
  .footer { margin-top: 12px; }
}
@media (max-width: 600px) {
  .page { padding: 24px 16px 84px; }
  .panel { padding: 24px 22px 28px; }
  .logo { width: 132px; }
  .toggle { right: 16px; bottom: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition: none !important; }
}
