/* Magpie app entry experience — Build -219a (F2 entry, locked by
   Jeff 2026-11-20). Signed-out cold open only: the locked v5 intro
   film full-screen, then the F2 sign-in surface (renderSignin in
   app.js) — real logo over the settled film frame, borderless
   fields, gradient Sign in pill. Signed-in sessions never render
   either surface (boot restores the session before first paint).
   The intro film is a normal web asset under /assets/intro/ so it
   can be swapped without an app store resubmission.
   Build -227: the first-paint splash (bottom of this file) was
   redesigned — solid dark ground, wordmark only — after the old
   native launch-screen art (app icon pasted on black) was traced
   to the baked iOS Splash imageset; the native art in mobile/
   was regenerated to the same design for the next native build. */

/* ---------- Intro film stage ---------- */

.intro-stage {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: #ffffff;
  overflow: hidden;
}

.intro-video,
.intro-poster {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #ffffff;
}

/* Desktop film (2026-11-25, replaces the same-day contain fix Jeff
   rejected): wide viewports (min-aspect-ratio 9/16, the same
   breakpoint renderIntro in app.js uses to pick the cut) play a
   true landscape 16:9 montage, so the cover rule above fills the
   stage with no bars and no cropped faces. Portrait viewports
   (every phone, the app) keep the portrait v5 film and the cover
   rendering above, byte for byte. */

/* Visible Skip control: a solid pale pill, readable over any
   frame of the film, clear of the phone's top safe area. */
.intro-skip {
  position: absolute;
  top: calc(16px + env(safe-area-inset-top));
  right: 16px;
  z-index: 3;
  appearance: none;
  border: 0;
  cursor: pointer;
  padding: 9px 20px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #0b0d0c;
  font-family: "Instrument Sans", sans-serif;
  font-size: 0.92rem;
  font-weight: 700;
  box-shadow: 0 2px 14px rgba(11, 13, 12, 0.22);
}

/* ---------- F2 sign-in surface ---------- */

.entry-stage {
  position: fixed;
  inset: 0;
  z-index: 500;
  background: #ffffff;
  overflow-y: auto;
  overflow-x: hidden;
}

/* The settled film frame: the v5 poster itself. The wash below
   keeps the footage faintly visible — never vivid, never dark —
   and washes the poster's own baked-in mock controls down so the
   real controls on top are the only ones that read. */
.entry-bg {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  background: #ffffff;
}

.entry-wash {
  position: fixed;
  inset: 0;
  background: linear-gradient(180deg, rgba(255,255,255,0.86) 0%, rgba(255,255,255,0.80) 45%, rgba(255,255,255,0.92) 100%);
}

/* Pop art magpies (Jeff's order, 2026-11-30; flight rework same
   day): the film frame and wash are gone from the sign-in surface.
   The page is clean white and four pop art magpies FLY ACROSS it
   on arced crossings, wings flapping (the up and down poses swap
   twice a second over a small body bob). The art carries real
   transparency, so birds pass over each other and the scrollbar
   with no white box. Crossings occupy about 60% of each cycle;
   the bird rests off-screen for the remainder, so passes feel
   like visits, not a screensaver. The form (.entry-ui, z-index 2)
   stays above them and fully readable. Pointer reactions are
   layered on by entryBirdsStart in app.js. */
.entry-birds {
  position: fixed;
  inset: 0;
  overflow: hidden;
  z-index: 1;
  pointer-events: none;
}
.entry-bird { position: absolute; will-change: transform; }
.eb-flap { position: relative; animation: eb-bob 0.46s ease-in-out infinite; }
.eb-flap.eb-flip { transform: scaleX(-1); }
.eb-pose { display: block; width: 100%; height: auto; }
.eb-pose-down { position: absolute; left: 0; top: 6%; }
.eb-pose-up { animation: eb-flap-up 0.46s steps(1, end) infinite; }
.eb-pose-down { animation: eb-flap-down 0.46s steps(1, end) infinite; }
@keyframes eb-flap-up { 0%, 49.9% { opacity: 1; } 50%, 100% { opacity: 0; } }
@keyframes eb-flap-down { 0%, 49.9% { opacity: 0; } 50%, 100% { opacity: 1; } }
@keyframes eb-bob {
  0%, 100% { margin-top: 0; }
  50% { margin-top: 5px; }
}
.eb1 { width: clamp(150px, 26vw, 250px); animation: eb-path1 19s linear infinite; }
.eb2 { width: clamp(120px, 20vw, 200px); animation: eb-path2 26s linear infinite; animation-delay: -11s; }
.eb3 { width: clamp(96px, 15vw, 150px); animation: eb-path3 23s linear infinite; animation-delay: -16s; }
.eb4 { width: clamp(76px, 11vw, 110px); animation: eb-path1 29s linear infinite; animation-delay: -23s; }
@keyframes eb-path1 {
  0% { left: -26%; top: 12%; transform: rotate(2deg); }
  15% { left: 8%; top: 5%; transform: rotate(-2deg); }
  30% { left: 42%; top: 10%; transform: rotate(1deg); }
  45% { left: 76%; top: 4%; transform: rotate(-2deg); }
  60%, 100% { left: 106%; top: 9%; transform: rotate(0deg); }
}
@keyframes eb-path2 {
  0% { left: 106%; top: 66%; transform: rotate(-2deg); }
  15% { left: 72%; top: 59%; transform: rotate(2deg); }
  30% { left: 38%; top: 67%; transform: rotate(-1deg); }
  45% { left: 6%; top: 60%; transform: rotate(1deg); }
  60%, 100% { left: -24%; top: 65%; transform: rotate(0deg); }
}
@keyframes eb-path3 {
  0% { left: -22%; top: 84%; transform: rotate(2deg); }
  18% { left: 16%; top: 78%; transform: rotate(-2deg); }
  36% { left: 52%; top: 85%; transform: rotate(1deg); }
  52% { left: 84%; top: 79%; transform: rotate(-1deg); }
  62%, 100% { left: 106%; top: 83%; transform: rotate(0deg); }
}
@media (prefers-reduced-motion: reduce) {
  .entry-bird, .eb-flap, .eb-pose-up, .eb-pose-down { animation: none; }
  .eb-pose-down { opacity: 0; }
  .eb1 { left: 4%; top: 8%; }
  .eb2 { left: 74%; top: 58%; }
  .eb3 { left: 6%; top: 76%; }
  .eb4 { left: 82%; top: 12%; }
}

.entry-ui {
  position: relative;
  z-index: 2;
  width: 100%;
  max-width: 430px;
  min-height: 100%;
  margin: 0 auto;
  padding: calc(28px + env(safe-area-inset-top)) 34px calc(26px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  box-sizing: border-box;
}

/* Real Magpie logo, centered, modest: about 40% of the frame
   width at phone size, never on a white box or pill. */
.entry-logo {
  width: 40%;
  max-width: 172px;
  min-width: 120px;
  height: auto;
  margin: 6vh auto 34px;
  display: block;
  background: transparent;
  border: 0;
  box-shadow: none;
}

/* Borderless fields: label above in caps, the value as plain
   text on the frame — no boxes, cards, panels or underlines. */
.entry-field { margin: 0 0 26px; }
.entry-field label {
  display: block;
  font-size: 0.82rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: #26312b;
  margin: 0 0 7px;
}
.entry-ui .entry-field input {
  width: 100%;
  padding: 0;
  border: 0;
  border-radius: 0;
  background: transparent;
  color: #0b0d0c;
  font-size: 1.06rem;
  box-shadow: none;
}
.entry-ui .entry-field input::placeholder { color: #7c8a83; opacity: 1; }
.entry-ui .entry-field input:focus {
  outline: none;
  border: 0;
  box-shadow: none;
  text-decoration: underline;
  text-decoration-color: rgba(1, 155, 252, 0.55);
  text-underline-offset: 5px;
}

/* Specificity note (rendered-walk catch, 2026-11-20): intro.css loads
   before theme-v2/theme-v3, whose plain .btn rules (black pill) were
   overriding this gradient at equal specificity. The .entry-ui prefix
   keeps the locked F2 gradient pill. */
.entry-ui .entry-signin-btn {
  width: 100%;
  padding: 16px 20px;
  margin-top: 2px;
  font-size: 1.05rem;
  border-radius: 999px;
  background: linear-gradient(93deg, #006afc 0%, #019bfc 38%, #03c9ab 74%, #2fe07e 100%);
  color: #ffffff;
  border: 0;
  box-shadow: none;
}

.entry-forgot {
  text-align: center;
  margin: 18px 0 0;
  font-size: 0.98rem;
}
.entry-forgot a { color: #26312b; font-weight: 600; text-decoration: none; }

.entry-stay {
  text-align: center;
  margin: 10px 0 0;
  font-size: 0.82rem;
  color: #5c6d64;
}

/* Google + emailed sign-in link: below the password block, same
   quiet borderless style — text-weight actions, no boxes. */
.entry-alt { margin-top: 30px; text-align: center; }
.entry-google {
  display: inline-block;
  color: #0b0d0c;
  font-weight: 700;
  font-size: 0.98rem;
  text-decoration: none;
  padding: 6px 4px;
}
.entry-alt-note {
  font-size: 0.88rem;
  color: #41534a;
  margin: 14px 0 16px;
  text-align: left;
}
.entry-alt .entry-field { text-align: left; margin-bottom: 12px; }
.entry-quiet-btn {
  appearance: none;
  background: transparent;
  border: 0;
  cursor: pointer;
  padding: 6px 4px;
  font-family: "Instrument Sans", sans-serif;
  font-size: 0.98rem;
  font-weight: 700;
  color: #006afc;
}
.entry-note { font-size: 0.86rem; color: #41534a; margin: 8px 0 0; min-height: 1em; }

.entry-ui .error-box { margin-bottom: 18px; }

/* Bottom block, per the F2 frame: pinned to the bottom of the
   surface when there is room, in normal flow when there is not. */
.entry-bottom {
  margin-top: auto;
  padding-top: 36px;
  text-align: center;
}
.entry-new { color: #41534a; font-size: 0.95rem; margin: 0 0 8px; }
.entry-join { margin: 0; font-size: 1rem; }
.entry-join a { color: #006afc; font-weight: 700; text-decoration: none; }
.entry-join span { color: #7c8a83; margin: 0 6px; }
.entry-more { margin: 14px 0 0; font-size: 0.88rem; }
.entry-more a { color: #41534a; font-weight: 600; }
.entry-more-note { display: block; color: #7c8a83; font-size: 0.8rem; margin-top: 3px; }

/* Build -260: "Get the app" badges at the foot of the sign-in
   surface (phone browsers only; app.js decides, CSS just lays
   them out). Quiet and centered like the rest of entry-bottom;
   the Play PNG keeps its own ratio, height-matched to Apple. */
.entry-app { margin-top: 30px; }
.entry-app-line { font-size: 0.82rem; font-weight: 700; letter-spacing: 0.09em; text-transform: uppercase; color: #26312b; margin: 0 0 10px; }
.entry-app-badges { display: flex; justify-content: center; align-items: center; gap: 10px; }
.entry-app-badges a { display: inline-block; line-height: 0; }
.entry-app-badges img { display: block; height: 40px; width: auto; }

/* Splash / first paint (Build -227): a designed splash, not a
   pasted asset: solid dark ground (#0b0d0c), the real Magpie
   wordmark centered, nothing else. No app icon, no box, no
   square. Rendered by index.html before app.js boots; the same
   rules are inlined in index.html so the first paint is already
   this design. It covers the full viewport (fixed) so no shell
   chrome peeks around it while the session restores; app.js
   replaces it on first render: signed-in sessions land on Home,
   signed-out on the intro film. */
.splash-first-paint {
  position: fixed;
  inset: 0;
  z-index: 900;
  display: flex;
  align-items: center;
  justify-content: center;
  background: #0b0d0c;
}
.splash-first-paint img { width: 200px; max-width: 56vw; height: auto; }

/* The splash is exempt from theme-v2's #app > * rise animation:
   it must be at full opacity, solid, from the very first frame,
   never a grey fade-in (reviewer catch, Build -227). The ID +
   class selector outranks theme-v2's ID + universal rule. */
#app > .splash-first-paint { animation: none; }

/* Build -225: while the first-paint splash is on screen, hide the
   static shell chrome (top bar + footer) so the paint reads as one
   clean splash. Keyed to the splash element's presence only: the
   moment app.js replaces #app's contents on first render, the
   splash node is gone and the chrome returns on its own. No JS
   change; browsers without :has() keep the previous behavior. */
body:has(.splash-first-paint) .topbar,
body:has(.splash-first-paint) .footer { display: none; }

/* Reduced motion: no film (renderIntro hands straight to the
   sign-in surface in JS as well) and no transitions here. */
@media (prefers-reduced-motion: reduce) {
  .intro-video { display: none; }
}
