/* ============================================================
   CineLogger — unauthenticated home / login screen
   Single-screen marketing + login. Self-contained: this file
   owns its own type ramp, colour tokens and the three ambient
   animations. Loaded only by auth/home.html (base.html's
   {% block head_extra %}). Implements
   local_references/design_handoff_cinelogger_home.
   ============================================================ */

/* ---- Self-hosted fonts (CSP font-src 'self' — no CDN) ---- */
@font-face {
  font-family: "DM Sans";
  font-style: normal;
  font-weight: 100 900;
  font-display: swap;
  src: url("../fonts/dm-sans-latin.woff2") format("woff2");
}
@font-face {
  font-family: "DM Mono";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/dm-mono-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/barlow-condensed-400-latin.woff2") format("woff2");
}
@font-face {
  font-family: "Barlow Condensed";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("../fonts/barlow-condensed-600-latin.woff2") format("woff2");
}

.home {
  --home-bg: #05070d;
  --home-bg-sunken: #0a0b0e;
  --home-bg-input: #0b0c10;
  --home-surface: #12141a;
  --home-text: #e7e5e2;
  --home-text-2: #a9a7a2;
  /* Bottom of the ramp lifted so functional text clears WCAG AA (4.5:1) on
     --home-bg / --home-surface; the editorial mono-caps character is unchanged. */
  --home-text-3: #8a8d94;
  --home-text-4: #888d96;
  --home-text-5: #868b94;
  --home-text-6: #83888f;
  --home-text-mute: #8d9199;
  --home-accent: #e8a852;
  --home-accent-cta-hover: #f2ba6f;
  --home-accent-link-hover: #f5c880;
  --home-accent-ink: #17140e;
  --home-ok: #6fbf8b;
  --home-error: #d9694a;

  --home-sans: "DM Sans", "Helvetica Neue", Helvetica, Arial, sans-serif;
  --home-display: "Barlow Condensed", "Arial Narrow", "Helvetica Neue", sans-serif;
  --home-mono: "DM Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;

  --home-col: 1280px;
  --home-pad: 48px;

  position: relative;
  min-height: 100vh;
  overflow: hidden;
  background: var(--home-bg);
  color: var(--home-text);
  font-family: var(--home-sans);
  font-size: 16px;
  line-height: 1.5;
}

.home *,
.home *::before,
.home *::after {
  box-sizing: border-box;
}

/* .home-row is display:grid, which would otherwise beat the [hidden] UA rule
   when the preview filter hides a row. */
.home [hidden] {
  display: none !important;
}

.home a {
  color: var(--home-accent);
  text-decoration: none;
}

.home a:hover {
  color: var(--home-accent-link-hover);
}

/* ---- Decorative layers ---- */
/* Two backdrops. home.js sets data-backdrop on .home: a fresh weighted random
   pick on every page load (AURORA_LOAD_CHANCE), overridable for the current view
   with the header toggle, never remembered.
   - "spotlight": radial glow + soft 2D film grain, all CSS.
   - "aurora": a WebGL animated simplex-noise gradient painted to .home-aurora. */
.home-aurora,
.home-beam,
.home-spot,
.home-vignette,
.home-grain {
  position: absolute;
  pointer-events: none;
  z-index: 0;
}

.home-aurora {
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0;
  transition: opacity 500ms ease;
}

.home[data-backdrop="aurora"] .home-aurora {
  opacity: 1;
}

.home[data-backdrop="aurora"] .home-beam,
.home[data-backdrop="aurora"] .home-spot,
.home[data-backdrop="aurora"] .home-grain {
  opacity: 0;
}

.home[data-backdrop="aurora"] .home-beam {
  animation: none;
}

/* Orange radial spotlight cast from above the fold. */
.home-spot {
  top: 0;
  left: 50%;
  width: 1120px;
  height: 1120px;
  transform: translateX(-50%);
  background: radial-gradient(
    circle 900px at 50% 500px,
    rgba(249, 115, 22, 0.4),
    rgba(249, 115, 22, 0.08) 45%,
    transparent 70%
  );
}

.home-beam {
  top: -180px;
  left: 50%;
  width: 1500px;
  height: 900px;
  transform: translateX(-58%) rotate(-8deg);
  background: radial-gradient(
    ellipse 50% 40% at 20% 20%,
    rgba(232, 168, 82, 0.13),
    rgba(232, 168, 82, 0.03) 45%,
    transparent 72%
  );
  filter: blur(10px);
  animation: home-beam-breathe 9s ease-in-out infinite;
}

.home-vignette {
  inset: 0;
  background: radial-gradient(
    ellipse 80% 60% at 50% 0%,
    transparent 40%,
    rgba(0, 0, 0, 0.55) 100%
  );
}

/* Animated film grain rendered to a canvas by home.js and stretched with the
   browser's default smoothing (no pixelated scaling) so it reads as soft grain
   rather than blocks. Falls back to a flat transparent element if JS is off. */
.home-grain {
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.15;
  transition: opacity 500ms ease;
}

.home-spot {
  transition: opacity 500ms ease;
}

@keyframes home-beam-breathe {
  0%,
  100% {
    opacity: 0.5;
  }
  50% {
    opacity: 0.78;
  }
}

@keyframes home-strip-drift {
  from {
    transform: translateX(0);
  }
  to {
    transform: translateX(-50%);
  }
}

/* ---- Header ---- */
/* Plain and part of the page -- no background or border, scrolls with the
   content, and shares the same column width as .home-main. */
.home-header {
  position: relative;
  z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px 24px;
  max-width: var(--home-col);
  margin: 0 auto;
  padding: 26px var(--home-pad);
}

.home-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  color: inherit;
  text-decoration: none;
}

.home-reel {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 20px;
}

.home-reel span {
  width: 4px;
  border-radius: 1px;
  background: var(--home-accent);
}

.home-reel span:nth-child(1) {
  height: 10px;
}

.home-reel span:nth-child(2) {
  height: 18px;
}

.home-reel span:nth-child(3) {
  height: 14px;
  background: rgba(232, 168, 82, 0.45);
}

.home-wordmark {
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.01em;
}

.home-wordmark span {
  color: var(--home-accent);
}

.home-header-right {
  display: flex;
  align-items: center;
  gap: 28px;
}

/* Header backdrop toggle: two mono-caps pills styled like .home-chip. */
.home-backdrop {
  display: flex;
  gap: 4px;
  padding: 3px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.03);
}

.home-backdrop-opt {
  font-family: var(--home-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 5px 12px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--home-text-3);
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease;
}

.home-backdrop-opt:hover {
  color: var(--home-text-2);
}

.home-backdrop-opt[aria-pressed="true"] {
  background: var(--home-accent);
  color: var(--home-accent-ink);
}

.home-backdrop-opt:focus-visible {
  outline: 2px solid var(--home-accent);
  outline-offset: 2px;
}

.no-js .home-backdrop {
  display: none;
}

.home-signin-link {
  font-size: 14px;
  color: #b6b3ae;
}

.home-signin-link:hover {
  color: var(--home-accent-link-hover);
}

/* ---- Flash bar ---- */
.home-flash-wrap {
  position: relative;
  z-index: 1;
  max-width: var(--home-col);
  margin: 0 auto;
  padding: 0 var(--home-pad);
  display: grid;
  gap: 8px;
}

.home-flash {
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 10px;
  padding: 12px 16px;
  font-size: 13.5px;
  color: var(--home-text-2);
}

/* ---- Main two-column wrap ---- */
.home-main {
  position: relative;
  z-index: 1;
  max-width: var(--home-col);
  margin: 0 auto;
  padding: 34px var(--home-pad) 0;
  display: flex;
  flex-wrap: wrap;
  gap: 48px 72px;
  align-items: flex-start;
}

.home-lede {
  flex: 1 1 540px;
  min-width: 0;
}

/* ---- Left column ---- */
.home-eyebrow {
  margin: 0 0 20px;
  font-family: var(--home-mono);
  font-size: 11px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--home-accent);
}

.home-h1 {
  margin: 0 0 20px;
  font-family: var(--home-display);
  font-weight: 600;
  font-size: clamp(46px, 5.2vw, 74px);
  line-height: 0.96;
  letter-spacing: -0.015em;
  text-wrap: balance;
}

.home-h1 span {
  color: var(--home-text-mute);
}

.home-sub {
  margin: 0 0 40px;
  max-width: 46ch;
  font-size: 17px;
  line-height: 1.6;
  color: var(--home-text-2);
  text-wrap: pretty;
}

/* Marketing break-even meter -- the one idea, shown before sign-in. The numbers
   are an illustration, not a live figure (there's no user yet). */
.home-meter {
  display: flex;
  align-items: center;
  gap: 26px;
  margin-bottom: 44px;
  padding: 24px;
  background: var(--home-surface);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 12px;
}

.home-meter-gauge {
  position: relative;
  flex-shrink: 0;
  display: grid;
  place-items: center;
}

.home-meter-arc { stroke: var(--home-ok); }

.home-meter-pct {
  position: absolute;
  font-family: var(--home-display);
  font-size: 30px;
  font-weight: 600;
  color: var(--home-ok);
}

.home-meter-body { display: flex; flex-direction: column; gap: 6px; }

.home-meter-kicker {
  margin: 0;
  font-family: var(--home-mono);
  font-size: 11px;
  letter-spacing: 0.13em;
  text-transform: uppercase;
  color: var(--home-accent);
}

.home-meter-line { margin: 0; font-size: 16px; color: var(--home-text); }
.home-meter-line strong { color: var(--home-text); }

.home-meter-sub {
  margin: 4px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--home-text-3);
}

@media (max-width: 560px) {
  .home-meter { flex-direction: column; align-items: flex-start; text-align: left; }
}

/* ---- Log preview ---- */
.home-preview-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.home-preview-label {
  margin: 0;
  font-family: var(--home-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--home-text-4);
}

.home-chips {
  display: flex;
  gap: 6px;
}

.home-chip {
  font-family: var(--home-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 6px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  background: transparent;
  color: var(--home-text-3);
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease,
    border-color 120ms ease;
}

.home-chip.is-selected {
  background: var(--home-accent);
  border-color: var(--home-accent);
  color: var(--home-accent-ink);
}

.home-preview-card {
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 12px;
  background: linear-gradient(180deg, #14161c, #101217);
  overflow: hidden;
}

.home-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 15px 20px;
  white-space: nowrap;
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.home-row-thumb {
  width: 34px;
  height: 46px;
  border-radius: 3px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  overflow: hidden;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.11) 0 3px,
    rgba(255, 255, 255, 0.03) 3px 7px
  );
}

.home-row-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-row-mid {
  min-width: 0;
  overflow: hidden;
}

.home-row-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 15px;
  font-weight: 500;
}

.home-row-year {
  color: var(--home-text-5);
  font-weight: 400;
}

.home-row-place {
  display: block;
  margin-top: 3px;
  overflow: hidden;
  text-overflow: ellipsis;
  font-size: 12.5px;
  color: var(--home-text-3);
}

.home-row-right {
  display: flex;
  align-items: center;
  gap: 14px;
}

.home-row-venue {
  font-family: var(--home-mono);
  font-size: 11px;
  color: var(--home-accent);
  border: 1px solid rgba(232, 168, 82, 0.32);
  border-radius: 999px;
  padding: 4px 10px;
}

.home-row-date {
  font-family: var(--home-mono);
  font-size: 12px;
  color: var(--home-text-6);
}

.home-preview-empty {
  padding: 22px 20px;
  font-size: 13px;
  color: var(--home-text-3);
  border-bottom: 1px solid rgba(255, 255, 255, 0.05);
}

.home-totals {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
}

.home-total {
  padding: 18px 20px 20px;
}

.home-total + .home-total {
  border-left: 1px solid rgba(255, 255, 255, 0.05);
}

.home-total-v {
  margin: 0;
  font-family: var(--home-display);
  font-size: 30px;
  font-weight: 600;
  line-height: 1;
}

.home-total-l {
  margin: 7px 0 0;
  font-family: var(--home-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--home-text-4);
}

/* ---- Login card ---- */
.home-login {
  flex: 1 1 340px;
  max-width: 440px;
  border: 1px solid rgba(255, 255, 255, 0.09);
  border-radius: 16px;
  background: linear-gradient(180deg, #16181f 0%, #101217 100%);
  padding: 34px 32px 30px;
  box-shadow: 0 40px 80px -40px rgba(0, 0, 0, 0.9);
  /* No-JS fallback for the "Sign in" hash jump: keep the header's worth of space
     above the card so a raw #login jump doesn't scroll it off the top. home.js
     replaces this with a smarter "only scroll if needed" handler. */
  scroll-margin-top: 160px;
}

.home-login-kicker {
  margin: 0 0 4px;
  font-family: var(--home-display);
  font-size: 15px;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--home-accent);
}

.home-login-title {
  margin: 0 0 4px;
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.01em;
}

.home-login-sub {
  margin: 0 0 26px;
  font-size: 13.5px;
  color: var(--home-text-3);
}

.home-field + .home-field {
  margin-top: 18px;
}

.home-label {
  display: block;
  margin-bottom: 8px;
  font-family: var(--home-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--home-text-4);
}

.home-label-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.home-label-row .home-label {
  margin-bottom: 0;
}

.home-reveal {
  padding: 0;
  border: 0;
  background: none;
  cursor: pointer;
  font-family: var(--home-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--home-text-5);
  transition: color 120ms ease;
}

.home-reveal:hover {
  color: var(--home-accent);
}

.home-input {
  width: 100%;
  margin-top: 8px;
  padding: 12px 14px;
  font-family: inherit;
  font-size: 14.5px;
  color: var(--home-text);
  background: var(--home-bg-input);
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 8px;
  outline: none;
}

.home-label + .home-input {
  margin-top: 0;
}

.home-input::placeholder {
  color: #4c5058;
}

.home-input:focus {
  border-color: rgba(232, 168, 82, 0.6);
  box-shadow: 0 0 0 3px rgba(232, 168, 82, 0.12);
}

.home-input.is-error {
  border-color: rgba(217, 105, 74, 0.6);
}

.home-field-error {
  display: block;
  margin-top: 8px;
  font-size: 12px;
  color: var(--home-error);
}

.home-cta {
  width: 100%;
  margin-top: 22px;
  padding: 13px;
  border: 0;
  border-radius: 999px;
  background: var(--home-accent);
  color: var(--home-accent-ink);
  font-family: var(--home-sans);
  font-size: 15px;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 120ms ease;
}

.home-cta:hover {
  background: var(--home-accent-cta-hover);
}

.home-login-switch {
  margin: 18px 0 0;
  text-align: center;
  font-size: 13.5px;
  color: var(--home-text-3);
}

.home-login-note {
  margin-top: 26px;
  padding-top: 20px;
  border-top: 1px dashed rgba(255, 255, 255, 0.12);
  font-family: var(--home-mono);
  font-size: 11px;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--home-text-4);
  line-height: 1.7;
}

/* ---- Filmstrip band ---- */
.home-filmstrip {
  position: relative;
  z-index: 1;
  margin-top: 64px;
  background: var(--home-bg-sunken);
  border-top: 1px solid rgba(255, 255, 255, 0.07);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  overflow: hidden;
}

.home-filmstrip-track {
  display: flex;
  width: max-content;
  animation: home-strip-drift 46s linear infinite;
}

.home-tile {
  flex: none;
  width: 128px;
  height: 176px;
  margin: 18px 8px;
  border-radius: 4px;
  border: 1px solid rgba(255, 255, 255, 0.07);
  overflow: hidden;
  background-image: repeating-linear-gradient(
    135deg,
    rgba(255, 255, 255, 0.085) 0 4px,
    rgba(255, 255, 255, 0.02) 4px 9px
  );
}

.home-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.home-filmstrip-mask {
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(
    90deg,
    #0c0d10 0%,
    transparent 14%,
    transparent 86%,
    #0c0d10 100%
  );
}

/* ---- Footer ---- */
/* The one-line app footer (_app_footer.html, .app-footer in style.css) is the
   last child of .home so it renders inside this page's dark shell. Held to the
   same centred column + padding as .home-header / .home-main so it lines up with
   the header rather than running the full viewport width. */
.home .site-footer {
  position: relative;
  z-index: 1;
  max-width: var(--home-col);
  margin: 0 auto;
  /* Plain, like .home-header: this page's ground is --home-bg under the
     vignette/grain, so an opaque fill + the app's cool hairline would read as
     a seam. Let the ambient layers carry through. */
  background: transparent;
  border-top: 0;
}

.home .app-footer {
  padding-inline: var(--home-pad);
}

/* ---- Responsive ---- */
@media (max-width: 480px) {
  .home {
    --home-pad: 20px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .home-beam,
  .home-filmstrip-track {
    animation: none;
  }
}
