/* TK Photo Crew sign-in: "through the viewfinder".
   Direction: 9 Cinematic Dark, adapted. True dark field, the form framed by
   viewfinder corner brackets, a camera info readout along the bottom.
   Only login.html and invite.html load this file. */

@font-face { font-family: "Unbounded"; src: url("/static/fonts/unbounded.woff2") format("woff2");
             font-weight: 200 900; font-display: swap; }
@font-face { font-family: "Figtree"; src: url("/static/fonts/figtree.woff2") format("woff2");
             font-weight: 300 900; font-display: swap; }
@font-face { font-family: "Fragment Mono"; src: url("/static/fonts/fragment-mono.woff2") format("woff2");
             font-weight: 400; font-display: swap; }

:root {
  --vf-field: #121212;       /* the dark of a viewfinder, never blue-black */
  --vf-panel: #1a1a19;
  --vf-ink: #f1eee8;         /* 16.2:1 on field */
  --vf-dim: #9c978d;         /*  6.4:1 on field */
  --vf-line: #3a3834;
  --vf-amber: #e9a23b;       /* AF-confirm / tally light. 8.6:1 on field */
  --vf-amber-ink: #17120a;   /* text on amber, 8.6:1 */
  --vf-red: #ff7a6b;         /* errors, 7.4:1 on field */
  --vf-display: "Unbounded", "Arial Black", sans-serif;
  --vf-body: "Figtree", "Segoe UI", sans-serif;
  --vf-mono: "Fragment Mono", ui-monospace, Consolas, monospace;
  --vf-ease: cubic-bezier(.2, .7, .2, 1);
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body.vf {
  margin: 0; background: var(--vf-field); color: var(--vf-ink);
  font: 400 1rem/1.5 var(--vf-body);
  display: grid; grid-template-rows: 1fr auto; min-height: 100dvh;
  /* film grain: a tiny tiling SVG, not an image or a full-screen animation */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 0 0 0 .045 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

.vf-stage {
  display: grid; place-items: center; padding: 40px 16px 24px;
  /* rule-of-thirds grid, as on a camera's viewfinder display */
  --g: #2a2926;
  background:
    linear-gradient(var(--g), var(--g)) 33.333% 0 / 1px 100%,
    linear-gradient(var(--g), var(--g)) 66.666% 0 / 1px 100%,
    linear-gradient(var(--g), var(--g)) 0 33.333% / 100% 1px,
    linear-gradient(var(--g), var(--g)) 0 66.666% / 100% 1px;
  background-repeat: no-repeat;
}

/* The viewfinder: four corner brackets drawn with gradients on one element */
.vf-frame {
  --b: 2px; --len: 34px; --c: var(--vf-ink);
  position: relative; width: 100%; max-width: 420px; padding: 44px 30px 34px;
  background:
    linear-gradient(var(--c), var(--c)) top left / var(--len) var(--b),
    linear-gradient(var(--c), var(--c)) top left / var(--b) var(--len),
    linear-gradient(var(--c), var(--c)) top right / var(--len) var(--b),
    linear-gradient(var(--c), var(--c)) top right / var(--b) var(--len),
    linear-gradient(var(--c), var(--c)) bottom left / var(--len) var(--b),
    linear-gradient(var(--c), var(--c)) bottom left / var(--b) var(--len),
    linear-gradient(var(--c), var(--c)) bottom right / var(--len) var(--b),
    linear-gradient(var(--c), var(--c)) bottom right / var(--b) var(--len);
  background-repeat: no-repeat;
  background-color: var(--vf-field);   /* hides the thirds grid behind the form */
  animation: vf-focus .7s var(--vf-ease) both;
}
/* AF confirmed: the brackets turn amber while the form is in focus */
.vf-frame:focus-within { --c: var(--vf-amber); }

@keyframes vf-focus { from { transform: scale(1.06); opacity: 0; } to { transform: none; opacity: 1; } }

.vf-mark { font: 800 clamp(1.9rem, 8.5vw, 2.6rem)/1 var(--vf-display); letter-spacing: -.02em; margin: 0 0 34px; }
.vf-mark span { display: block; color: var(--vf-amber); }
.vf-lede { color: var(--vf-dim); margin: -8px 0 26px; }
.vf-lede b { color: var(--vf-ink); font-weight: 600; }

.vf-field { display: block; margin-bottom: 18px; }
.vf-field span { display: block; font: .72rem/1 var(--vf-mono); color: var(--vf-dim);
                 letter-spacing: .08em; text-transform: uppercase; margin-bottom: 8px; }
.vf-field input {
  width: 100%; font: 500 1.05rem/1.2 var(--vf-body); color: var(--vf-ink);
  background: var(--vf-panel); border: 1px solid var(--vf-line); border-radius: 0;
  padding: 13px 12px; outline: none; transition: border-color .15s var(--vf-ease);
}
.vf-field input:focus { border-color: var(--vf-amber); }
.vf-field input:-webkit-autofill { -webkit-box-shadow: 0 0 0 40px var(--vf-panel) inset;
                                   -webkit-text-fill-color: var(--vf-ink); }

.vf-shutter {
  width: 100%; margin-top: 8px; padding: 15px 18px; border: 0; border-radius: 2px; cursor: pointer;
  background: var(--vf-amber); color: var(--vf-amber-ink);
  font: 600 .95rem/1 var(--vf-display); letter-spacing: .02em;
  display: flex; align-items: center; justify-content: space-between;
  transition: transform .12s var(--vf-ease), opacity .12s;
}
/* a camera shutter release: outer collar + inner button that presses in */
.vf-shutter::after {
  content: ""; width: 20px; height: 20px; border-radius: 50%; flex: none;
  border: 2px solid currentColor;
  background: radial-gradient(circle, currentColor 0 5px, transparent 5.5px);
  transition: transform .1s var(--vf-ease);
}
.vf-shutter:active { transform: translateY(1px); }
.vf-shutter:active::after { transform: scale(.82); }
.vf-shutter:focus-visible { outline: 2px solid var(--vf-ink); outline-offset: 3px; }

.msg { min-height: 1.2em; margin: 12px 0 0; font-size: .9rem; color: var(--vf-dim); }
.msg.err { color: var(--vf-red); }
.vf-help { margin: 18px 0 0; font-size: .85rem; color: var(--vf-dim); }

/* Camera info readout along the bottom of the screen */
.vf-readout {
  display: flex; gap: 22px; justify-content: center; flex-wrap: wrap;
  padding: 14px 16px 18px; border-top: 1px solid var(--vf-line);
  font: .78rem/1 var(--vf-mono); color: var(--vf-dim); letter-spacing: .04em;
}
.vf-readout b { color: var(--vf-ink); font-weight: 400; }
.vf-readout .vf-ready { color: var(--vf-amber); }
.vf-batt { display: inline-flex; align-items: center; gap: 2px; vertical-align: -1px; }
.vf-batt i { width: 4px; height: 9px; background: var(--vf-ink); }
.vf-batt i:last-child { background: var(--vf-line); }
.vf-batt::after { content: ""; width: 2px; height: 5px; background: var(--vf-dim); }

/* Easter egg: a play button in the readout (sign-in page only) */
.vf-play {
  width: 22px; height: 16px; margin: -4px 0; padding: 0; border: 0; background: none; cursor: pointer;
  display: inline-grid; place-items: center; color: var(--vf-ink); vertical-align: middle;
}
.vf-play::before {                                  /* the triangle */
  content: ""; width: 0; height: 0; margin-left: 2px;
  border-left: 9px solid currentColor; border-top: 5.5px solid transparent; border-bottom: 5.5px solid transparent;
  transition: transform .15s var(--vf-ease);
}
.vf-play:hover { color: var(--vf-amber); }
.vf-play:hover::before { transform: scale(1.15); }
.vf-play:focus-visible { outline: 1px solid var(--vf-amber); outline-offset: 2px; }
.vf-play.on { color: var(--vf-red); }
.vf-play.on::before {                               /* recording dot while the burst runs */
  border: 0; margin: 0; width: 9px; height: 9px; border-radius: 50%; background: currentColor;
}
/* viewfinder blackout as the mirror flips, then focus lock */
.vf-snap { animation: vf-snap .16s steps(1) both; }
@keyframes vf-snap { 0% { opacity: .25; } 100% { opacity: 1; } }
.vf-lock { --c: var(--vf-amber); animation: vf-lock .5s var(--vf-ease); }
@keyframes vf-lock { 0% { transform: scale(1.03); } 100% { transform: none; } }

@media (max-width: 380px) { .vf-readout { gap: 14px; } .vf-frame { padding: 40px 22px 30px; } }
@media (prefers-reduced-motion: reduce) { .vf-frame, .vf-snap, .vf-lock { animation: none; } * { transition: none !important; } }
