:root {
  color-scheme: light;
  --bg1: #eef4fc;
  --bg2: #fdf3ee;
  --ink: #0f1115;
  --ink-2: #52514e;
  --card: #ffffff;
  --border: #e3e2de;
  --accent: #2a78d6;
  --accent-2: #1c5cab;
  --critter: #2a78d6;
  --critter-dark: #1c5cab;
  --eye: #ffffff;
  --pupil: #0f1115;
  --blush: #e87ba4;
  --danger: #c53030;
  --shadow: 0 20px 50px rgba(20, 40, 80, .12), 0 2px 6px rgba(20, 40, 80, .06);
}
@media (prefers-color-scheme: dark) {
  :root:where(:not([data-theme="light"])) {
    color-scheme: dark;
    --bg1: #10151d; --bg2: #1a1413; --ink: #f5f5f3; --ink-2: #b8b7ae; --card: #1a1a19; --border: #33332f;
    --accent: #3987e5; --accent-2: #6da7ec; --critter: #3987e5; --critter-dark: #256abf; --pupil: #0b0b0b;
    --danger: #ff8a8a; --shadow: 0 20px 50px rgba(0, 0, 0, .45);
  }
}
:root[data-theme="dark"] {
  color-scheme: dark;
  --bg1: #10151d; --bg2: #1a1413; --ink: #f5f5f3; --ink-2: #b8b7ae; --card: #1a1a19; --border: #33332f;
  --accent: #3987e5; --accent-2: #6da7ec; --critter: #3987e5; --critter-dark: #256abf; --pupil: #0b0b0b;
  --danger: #ff8a8a; --shadow: 0 20px 50px rgba(0, 0, 0, .45);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-height: 100%; }
body {
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  color: var(--ink);
  background: radial-gradient(1200px 600px at 10% -10%, var(--bg1), transparent 60%),
              radial-gradient(900px 600px at 110% 110%, var(--bg2), transparent 60%),
              var(--bg1);
  min-height: 100vh;
  overflow-x: hidden;
}

.stage { min-height: 100vh; display: grid; place-items: center; align-content: center; gap: 8px; padding: 32px 16px; }

/* brand */
.brand { text-align: center; }
.logo { display: inline-flex; margin-bottom: 6px; }
.logo span { width: 26px; height: 26px; border-radius: 50%; background: var(--accent); display: block; transition: transform .6s cubic-bezier(.5, -0.5, .3, 1.5), opacity .4s; }
.logo span + span { margin-left: -9px; opacity: .45; }
.stage.hiding .logo span + span { transform: translateX(-17px); opacity: 0; }
h1 { margin: 0; font-size: clamp(34px, 7vw, 52px); letter-spacing: -.02em; line-height: 1.05; }
.tagline { margin: 6px 0 0; font-size: clamp(16px, 3.4vw, 20px); color: var(--ink-2); font-style: italic; min-height: 1.6em; }
.tagline span { display: inline-block; transition: opacity .5s, filter .5s, transform .5s; }
.tagline .dont.gone { opacity: 0; filter: blur(6px); transform: translateY(4px) scale(.96); }
.stage.hiding .tagline .see { opacity: .35; }
.stage.hiding .tagline .dont { color: var(--ink); font-weight: 600; }

/* scene: critter peeking over the card */
.scene { position: relative; width: min(380px, 100%); margin-top: 118px; }
.card {
  position: relative; z-index: 2; background: var(--card); border: 1px solid var(--border);
  border-radius: 22px; padding: 30px 26px 24px; box-shadow: var(--shadow);
}
.critter {
  position: absolute; z-index: 1; left: 50%; bottom: calc(100% - 26px); width: 240px; transform: translateX(-50%);
  background: none; border: 0; padding: 0; cursor: pointer; -webkit-tap-highlight-color: transparent;
}
.critter:focus-visible { outline: 3px solid var(--accent); outline-offset: 6px; border-radius: 16px; }
.critter svg { display: block; width: 100%; height: auto; overflow: visible; }
.paws {
  position: absolute; z-index: 3; left: 50%; bottom: calc(100% - 26px); width: 240px; transform: translateX(-50%);
  overflow: visible; pointer-events: none;
}
.body-wrap { transition: transform .55s cubic-bezier(.4, 1.6, .5, 1); transform-origin: 120px 150px; }
.body { fill: var(--critter); }
.ear { fill: var(--critter-dark); }
.white { fill: var(--eye); }
.pupil, .glint { transition: transform .12s ease-out; }
.pupil { fill: var(--pupil); }
.glint { fill: #fff; }
.lid { fill: var(--critter); transition: height .09s ease-in; }
.eye.blink .lid { height: 46px; }
.mouth { fill: none; stroke: #0f1115; stroke-width: 3.5; stroke-linecap: round; transition: d .3s; }
.blush { fill: var(--blush); opacity: .55; }
.paw ellipse { fill: var(--critter-dark); }
.paw .finger { stroke: rgba(0, 0, 0, .25); stroke-width: 2.5; stroke-linecap: round; fill: none; }
.paw { transition: transform .45s cubic-bezier(.4, 1.5, .5, 1); transform-box: fill-box; transform-origin: center; }

/* hover: curious lean */
.critter:hover .body-wrap { transform: translateY(-4px) rotate(-2deg); }

/* password: paws cover the eyes — "now you don't" */
.stage.hiding .paw.left { transform: translate(30px, -62px) rotate(18deg) scale(1.25); }
.stage.hiding .paw.right { transform: translate(-30px, -62px) rotate(-18deg) scale(1.25); }
.stage.hiding .mouth { d: path("M110 114 Q120 110 130 114"); }
/* show password: one paw slides down, peeking through fingers — "now you see it" */
.stage.hiding.peeking .paw.right { transform: translate(-22px, -30px) rotate(-38deg) scale(1.1); }
.stage.hiding.peeking .tagline .see { opacity: 1; font-weight: 600; color: var(--ink); }

/* reading the e-mail: lean in */
.stage.reading .body-wrap { transform: translateY(-6px) scale(1.02); }

/* wrong password: "nope" head shake */
.stage.nope .body-wrap { animation: nope .5s; }
@keyframes nope { 20% { transform: translateX(-10px) rotate(-4deg); } 40% { transform: translateX(10px) rotate(4deg); } 60% { transform: translateX(-7px); } 80% { transform: translateX(5px); } }
.stage.nope .card { animation: nudge .5s; }
@keyframes nudge { 30% { transform: translateX(-6px); } 60% { transform: translateX(6px); } }

/* success: happy bounce + closed smiling eyes */
.stage.happy .body-wrap { animation: hop .7s; }
.stage.happy .eye .lid { height: 46px; }
.stage.happy .mouth { d: path("M104 108 Q120 130 136 108"); }
@keyframes hop { 30% { transform: translateY(-22px); } 60% { transform: translateY(0); } 80% { transform: translateY(-6px); } }

/* click easter egg: duck behind the card, pop up with a bubble */
.stage.ducked .body-wrap { transform: translateY(150px); transition-duration: .25s; }
.stage.ducked .paw { transform: translateY(60px) scale(.6); opacity: 0; transition-duration: .25s; }
.bubble {
  position: absolute; top: -8px; right: -34px; background: var(--card); color: var(--ink); border: 1px solid var(--border);
  padding: 6px 12px; border-radius: 14px; font-weight: 700; font-size: 15px; box-shadow: var(--shadow);
  opacity: 0; transform: scale(.6) rotate(8deg); transition: opacity .2s, transform .3s cubic-bezier(.4, 1.8, .5, 1); pointer-events: none;
}
.bubble::after { content: ""; position: absolute; left: 14px; bottom: -7px; width: 12px; height: 12px; background: var(--card); border-right: 1px solid var(--border); border-bottom: 1px solid var(--border); transform: rotate(45deg); }
.stage.popped .bubble { opacity: 1; transform: scale(1) rotate(-4deg); }

/* form */
.login { display: grid; gap: 14px; }
.login label { display: grid; gap: 5px; font-weight: 600; font-size: 14px; }
.login input {
  font: inherit; width: 100%; padding: 12px 14px; border-radius: 12px; border: 1px solid var(--border);
  background: transparent; color: var(--ink); transition: border-color .2s, box-shadow .2s;
}
.login input:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 4px color-mix(in srgb, var(--accent) 22%, transparent); }
.pw { position: relative; display: block; }
.pw input { padding-right: 48px; }
.reveal { position: absolute; right: 6px; top: 50%; transform: translateY(-50%); border: 0; background: none; font-size: 18px; cursor: pointer; padding: 6px 8px; border-radius: 8px; filter: grayscale(1); opacity: .7; }
.reveal[aria-pressed="true"] { filter: none; opacity: 1; }
.reveal:focus-visible { outline: 2px solid var(--accent); }
.msg { min-height: 1.4em; margin: -4px 0 0; color: var(--danger); font-size: 14px; }
.go {
  font: inherit; font-weight: 700; border: 0; border-radius: 12px; padding: 13px 18px; cursor: pointer;
  background: var(--accent); color: #fff; transition: transform .15s, background .2s;
}
.go:hover { background: var(--accent-2); }
.go:active { transform: scale(.98); }
.go:disabled { opacity: .6; cursor: progress; }
.go:focus-visible { outline: 3px solid var(--accent); outline-offset: 3px; }
.continue { text-align: center; font-weight: 600; color: var(--accent); text-decoration: none; padding: 6px; }
.continue:hover { text-decoration: underline; }

.foot { margin-top: 18px; color: var(--ink-2); font-size: 13px; text-align: center; }
.foot .hint { transition: opacity .4s; }
.stage.found .foot .hint { opacity: 0; }

@media (max-width: 420px) {
  .critter, .paws { width: 200px; }
  .scene { margin-top: 100px; }
  .bubble { right: -10px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation: none !important; transition-duration: .01ms !important; }
}
