@font-face {
  font-family: "DM Sans";
  src: url("dm-sans.woff2") format("woff2");
  font-weight: 100 1000;
  font-display: swap;
}

:root {
  --bg: #0c0d14;
  --surface: #191b27;
  --line: #2a2d3e;
  --text: #eaeaf0;
  --muted: #8b8ea6;
  --accent: #7c6aff;
  --gem: #00e68a;
  --bear: #ff8080;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html, body { height: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font: 400 16px/1.5 "DM Sans", system-ui, sans-serif;
  overflow: hidden;
}

/* The one memorable thing: the logo's price line, drawn once across the page, ending in the gem. */
.trace {
  position: fixed;
  inset: 0;
  pointer-events: none;
}

/* A reveal, not stroke-dashoffset: non-scaling-stroke measures dashes in screen pixels, which
   breaks the line into pieces on a stretched viewBox. */
.trace svg {
  display: block;
  width: 100%;
  height: 100%;
  clip-path: inset(0 100% 0 0);
  animation: draw 1.5s cubic-bezier(.45, 0, .2, 1) forwards;
}

.trace path {
  fill: none;
  stroke: var(--accent);
  stroke-width: 2;
  stroke-linejoin: round;
  stroke-linecap: round;
  vector-effect: non-scaling-stroke;
}

.gem {
  position: absolute;
  left: 88%;
  top: 16%;
  width: 14px;
  height: 14px;
  margin: -7px 0 0 -7px;
  border-radius: 50%;
  background: var(--gem);
  box-shadow: 0 0 0 6px rgba(0, 230, 138, .14), 0 0 36px 6px rgba(0, 230, 138, .35);
  transform: scale(0);
  animation: appear .35s cubic-bezier(.3, 1.6, .5, 1) 1.4s forwards;
}

@keyframes draw { to { clip-path: inset(0 0 0 0); } }
@keyframes appear { to { transform: scale(1); } }

main {
  position: relative;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
  width: min(100%, 25rem);
  margin-left: clamp(1.5rem, 12vw, 11rem);
  padding: 2rem 1.5rem 2rem 0;
}

h1 {
  margin: 0 0 2.5rem;
  font-size: clamp(2.25rem, 4.2vw, 3.25rem);
  font-weight: 500;
  line-height: 1.05;
  letter-spacing: -.025em;
}

label {
  display: block;
  margin-bottom: .5rem;
  font-size: .875rem;
  color: var(--muted);
}

.field { position: relative; }

#password {
  width: 100%;
  height: 3rem;
  padding: 0 4.25rem 0 .875rem;
  border: 1px solid var(--line);
  border-radius: .5rem;
  background: var(--surface);
  color: var(--text);
  font: inherit;
}

#password:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
  border-color: transparent;
}

#password[aria-invalid="true"] { border-color: var(--bear); }

#reveal {
  position: absolute;
  top: .375rem;
  right: .375rem;
  height: 2.25rem;
  padding: 0 .625rem;
  border: 0;
  border-radius: .375rem;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: .875rem;
  cursor: pointer;
}

#reveal:hover { color: var(--text); }
#reveal:focus-visible { outline: 2px solid var(--accent); }

#message {
  min-height: 1.5rem;
  margin: .5rem 0;
  font-size: .875rem;
  color: var(--bear);
}

#submit {
  width: 100%;
  height: 3rem;
  border: 0;
  border-radius: .5rem;
  background: var(--accent);
  color: #fff;
  font: inherit;
  font-weight: 600;
  cursor: pointer;
}

#submit:hover { background: #8e7eff; }
#submit:focus-visible { outline: 2px solid var(--text); outline-offset: 2px; }
#submit:disabled { opacity: .6; cursor: progress; }

/* A phone: the line takes the top of the screen, the form sits within thumb reach below it. */
@media (max-width: 760px) {
  .trace { bottom: auto; height: 38svh; }
  main {
    width: auto;
    margin: 0;
    padding: 38svh 1.5rem 2rem;
    justify-content: flex-start;
  }
  h1 { margin-bottom: 1.75rem; }
}

@media (max-height: 560px) {
  body { overflow: auto; }
  .trace { display: none; }
  main { padding-top: 2rem; }
}

@media (prefers-reduced-motion: reduce) {
  .trace svg { animation: none; clip-path: none; }
  .gem { animation: none; transform: scale(1); }
}
