/* ==========================================================================
   Boogaloo Bias site styles

   Palette is sampled from the artwork itself:
     void   #040807  the hero video's background (so the video edge disappears)
     signal #57D5FF  the logo and detection-box cyan
     match  #FF00E3  the recognition GUI's high-confidence box (used only for
                     the "target over the drop zone" state)
   Type:
     Big Shoulders  headlines (civic/municipal signage voice)
     Instrument Sans  reading text
     Hack  the recognition system's own on-screen font, used only where the
           system "speaks" (the scan interface)
   The one ornament is the detection bracket from the logo and the GUI.
   ========================================================================== */

@font-face { font-family: "Big Shoulders"; src: url("../fonts/web/big-shoulders-bold.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/web/instrument-sans-regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/web/instrument-sans-italic.woff") format("woff"); font-weight: 400; font-style: italic; font-display: swap; }
@font-face { font-family: "Instrument Sans"; src: url("../fonts/web/instrument-sans-bold.woff") format("woff"); font-weight: 700; font-display: swap; }
@font-face { font-family: "Hack"; src: url("../fonts/web/hack-regular.woff") format("woff"); font-weight: 400; font-display: swap; }
@font-face { font-family: "Hack"; src: url("../fonts/web/hack-bold.woff") format("woff"); font-weight: 700; font-display: swap; }

:root {
  --void: #040807;
  --panel: #0E1C21;
  --wire: #2A4B57;
  --fog: #A7BCC4;
  --signal: #57D5FF;
  --signal-deep: #00698C;
  --match: #FF00E3;
  --paper: #FFFFFF;
  --rule: #D5DEE2;
  --ink: #0C1A1F;
  --ink-muted: #4A5F68;
  --error: #B42318;

  --display: "Big Shoulders", "Arial Narrow", "Helvetica Neue Condensed", Impact, sans-serif;
  --sans: "Instrument Sans", system-ui, -apple-system, "Segoe UI", Roboto, Arial, sans-serif;
  --mono: "Hack", ui-monospace, Menlo, Consolas, monospace;

  /* Type scale (16px root): 14, 16, 18, 21, 24, 36, 48, 72 */
  --t-small: 0.875rem;
  --t-base: 1.125rem;
  --t-md: 1.3125rem;
  --t-lg: 1.5rem;

  --nav-h: 4.5rem;
  --gutter: clamp(1.25rem, 4vw, 3rem);
  --measure: 38rem;
  --section-y: clamp(4rem, 9vw, 7.5rem);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + 1rem); }
body {
  margin: 0;
  background: var(--void);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 1.0625rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}
@media (min-width: 48rem) { body { font-size: var(--t-base); } }
img, video, iframe { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; }
h1, h2, h3 { margin: 0; }
p { margin: 0; }
figure { margin: 0; }
ul { margin: 0; padding: 0; }

:focus-visible { outline: 3px solid var(--signal); outline-offset: 3px; }
.section--paper :focus-visible, .form :focus-visible { outline-color: var(--signal-deep); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.skip-link {
  position: absolute; left: 1rem; top: -4rem; z-index: 100;
  background: var(--signal); color: var(--void); padding: 0.75rem 1rem; font-weight: 700; text-decoration: none;
}
.skip-link:focus { top: 1rem; }

.wrap { width: 100%; max-width: 75rem; margin-inline: auto; padding-inline: var(--gutter); }
.wrap--wide { max-width: 92rem; }

/* ---------- Detection brackets (the one ornament) ---------- */
.target { position: relative; }
.target::before {
  content: "";
  position: absolute;
  inset: var(--target-inset, 0);
  pointer-events: none;
  --c: var(--target-color, var(--signal));
  --b: var(--target-weight, 3px);
  --l: var(--target-length, 1.75rem);
  background:
    linear-gradient(var(--c), var(--c)) top left / var(--l) var(--b),
    linear-gradient(var(--c), var(--c)) top left / var(--b) var(--l),
    linear-gradient(var(--c), var(--c)) top right / var(--l) var(--b),
    linear-gradient(var(--c), var(--c)) top right / var(--b) var(--l),
    linear-gradient(var(--c), var(--c)) bottom left / var(--l) var(--b),
    linear-gradient(var(--c), var(--c)) bottom left / var(--b) var(--l),
    linear-gradient(var(--c), var(--c)) bottom right / var(--l) var(--b),
    linear-gradient(var(--c), var(--c)) bottom right / var(--b) var(--l);
  background-repeat: no-repeat;
}

/* ---------- Buttons ---------- */
.actions { display: flex; flex-wrap: wrap; gap: 0.75rem; margin-top: 2rem; }
.btn {
  display: inline-flex; align-items: center; gap: 0.6rem;
  min-height: 3rem; padding: 0.8rem 1.4rem;
  border: 2px solid transparent; border-radius: 2px;
  font: 700 1rem/1.2 var(--sans); letter-spacing: 0.01em;
  text-decoration: none; cursor: pointer;
  transition: background-color 120ms, color 120ms, border-color 120ms;
}
.btn--signal { background: var(--signal); color: var(--void); }
.btn--signal:hover { background: var(--paper); }
.btn--ghost { border-color: rgba(255, 255, 255, 0.55); color: var(--paper); background: transparent; }
.btn--ghost:hover { border-color: var(--signal); color: var(--signal); }
.btn--ink { background: var(--ink); color: var(--paper); }
.btn--ink:hover { background: var(--signal-deep); }

/* ---------- Navigation ---------- */
.site-nav {
  position: fixed; inset: 0 0 auto 0; z-index: 50;
  height: var(--nav-h);
  background: var(--void);
  border-bottom: 1px solid var(--wire);
  transition: background-color 200ms, border-color 200ms;
}
.page-home .site-nav:not(.is-scrolled):not(.is-open) { background: transparent; border-bottom-color: transparent; }
.site-nav__inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 1.5rem; }
.site-nav__brand img { width: auto; height: 1.6rem; }
.site-nav__menu ul { list-style: none; display: flex; gap: 0.25rem 1.75rem; }
.site-nav__menu a {
  display: block; padding: 0.4rem 0;
  color: var(--fog); text-decoration: none; font-size: 0.9375rem; font-weight: 700;
  border-bottom: 2px solid transparent;
}
.site-nav__menu a:hover { color: var(--paper); }
.site-nav__menu a[aria-current="page"] { color: var(--paper); border-bottom-color: var(--signal); }
.site-nav__toggle { display: none; }

@media (max-width: 61.99rem) {
  .site-nav__brand img { height: 1.3rem; }
  .js .site-nav__toggle {
    display: inline-flex; align-items: center; justify-content: center;
    width: 2.75rem; height: 2.75rem; margin-right: -0.5rem;
    background: none; border: 0; color: var(--paper); cursor: pointer;
  }
  .js .site-nav__menu {
    display: none;
    position: absolute; inset: var(--nav-h) 0 auto 0;
    background: var(--void); border-bottom: 1px solid var(--wire);
    padding: 0.5rem var(--gutter) 1.5rem;
  }
  .js .site-nav.is-open .site-nav__menu { display: block; }
  .site-nav__menu ul { flex-direction: column; }
  .site-nav__menu a { font-size: var(--t-md); padding: 0.6rem 0; }
  /* Without JavaScript the links simply wrap under the logo */
  .no-js .site-nav { height: auto; position: absolute; }
  .no-js .site-nav__inner { flex-wrap: wrap; padding-block: 1rem; }
  .no-js .site-nav__menu ul { flex-direction: row; flex-wrap: wrap; }
}

/* ---------- Sections ---------- */
.section { padding-block: var(--section-y); }
.section--paper { background: var(--paper); color: var(--ink); }
.section--void { background: var(--void); color: var(--paper); }
.section__title {
  font: 700 clamp(2.25rem, 4.6vw, 3.5rem)/1 var(--display);
  letter-spacing: 0.005em;
  margin-bottom: clamp(2rem, 4vw, 3rem);
  max-width: 20ch;
}

/* Reading text */
.prose { max-width: var(--measure); }
.prose h2 { font: 700 clamp(2.25rem, 4.6vw, 3.5rem)/1 var(--display); letter-spacing: 0.005em; margin-bottom: 1.5rem; }
.prose h3 { font: 700 var(--t-md)/1.3 var(--sans); margin-bottom: 0.5rem; }
.prose p + p { margin-top: 1.1em; }
.prose a { color: var(--signal-deep); text-decoration-thickness: 1px; text-underline-offset: 0.18em; }
.prose a:hover { text-decoration-thickness: 2px; }
.prose--dark { color: var(--fog); }
.prose--dark h2, .prose--dark h3 { color: var(--paper); }
.prose--dark a { color: var(--signal); }
.prose--lead { max-width: 44rem; font-size: clamp(1.1875rem, 1.6vw, var(--t-md)); line-height: 1.65; }

/* Image + text, side by side */
.split { display: grid; gap: clamp(2.5rem, 6vw, 5rem); align-items: center; }
@media (min-width: 56rem) { .split { grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); } }
.split__media img { margin-inline: auto; max-height: 32rem; width: auto; }
.split__media--camera img { max-height: 22rem; }

/* ---------- Home: hero ---------- */
.hero {
  position: relative; overflow: hidden;
  min-height: max(36rem, 100vh);
  display: flex; align-items: center;
  background: var(--void) url("../img/hero-poster.jpg") center bottom / cover no-repeat;
  color: var(--paper);
}
@supports (min-height: 100svh) { .hero { min-height: max(36rem, 100svh); } }
.hero__video { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; object-position: center bottom; }
.hero__inner { position: relative; padding-block: calc(var(--nav-h) + 3rem) 22vh; }
.hero__target {
  display: inline-block;
  padding: clamp(1rem, 2.5vw, 2rem) clamp(1.25rem, 3vw, 2.5rem);
  --target-length: clamp(1.5rem, 3vw, 2.75rem);
  --target-weight: 4px;
}
/* On wider screens, pull the frame left so the headline aligns with the content edge */
@media (min-width: 48rem) { .hero__target { margin-left: calc(-1 * clamp(1.25rem, 3vw, 2.5rem)); } }
.hero__target::before { animation: lock-on 640ms steps(5, end) 250ms both; }
.hero__title {
  font: 700 clamp(3.25rem, 9.5vw, 9.5rem)/0.92 var(--display);
  letter-spacing: 0.005em;
  max-width: 13ch;
  text-wrap: balance;
}
.hero__lede { margin-top: 1.5rem; font-size: clamp(1.125rem, 1.8vw, var(--t-lg)); color: var(--fog); max-width: 30ch; }
@keyframes lock-on {
  from { opacity: 0; transform: scale(1.18); }
  40% { opacity: 1; }
  to { opacity: 1; transform: scale(1); }
}
@media (prefers-reduced-motion: reduce) {
  .hero__target::before { animation: none; }
  * { transition: none !important; }
}

/* ---------- Home: features as camera feeds ---------- */
.feeds { list-style: none; display: grid; gap: 3rem 2rem; }
@media (min-width: 48rem) { .feeds { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
.feed__link { display: flex; flex-direction: column; height: 100%; text-decoration: none; color: var(--ink); }
.feed__frame { display: block; padding: 0.6rem; margin: -0.6rem -0.6rem 0.9rem; --target-length: 1.4rem; }
.feed__frame img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; }
.target--hover::before { opacity: 0; transform: scale(1.06); transition: opacity 140ms, transform 140ms steps(3, end); }
.feed__link:hover .target--hover::before, .feed__link:focus-visible .target--hover::before { opacity: 1; transform: scale(1); }
.feed__title { font: 700 2rem/1 var(--display); margin-bottom: 0.6rem; }
.feed__text { color: var(--ink-muted); font-size: 1rem; flex-grow: 1; }
.feed__cue { margin-top: 1rem; font-weight: 700; color: var(--signal-deep); text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.feed__link:hover .feed__cue { text-decoration-thickness: 2px; }

/* ---------- Home: image bands ---------- */
.band { display: grid; }
.band + .band { margin-top: var(--section-y); }
.band__image { width: 100%; aspect-ratio: 2.2 / 1; object-fit: cover; }
.band__panel { background: var(--panel); padding: clamp(1.75rem, 4vw, 3rem); }
@media (min-width: 62rem) {
  .band { grid-template-columns: repeat(12, minmax(0, 1fr)); }
  .band__image { grid-column: 1 / -1; grid-row: 1; }
  .band__panel { grid-column: 2 / span 6; grid-row: 1; align-self: end; margin-bottom: -4rem; position: relative; }
  .band--flip .band__panel { grid-column: 6 / span 6; }
  .band { margin-bottom: 4rem; }
}

/* ---------- Inner page header ---------- */
.page-head { background: var(--void); color: var(--paper); padding: calc(var(--nav-h) + clamp(3rem, 7vw, 5.5rem)) 0 clamp(3rem, 6vw, 4.5rem); }
.page-head__title { font: 700 clamp(3rem, 7.5vw, 6rem)/0.95 var(--display); letter-spacing: 0.005em; max-width: 16ch; }
.page-head__lede { margin-top: 1.25rem; max-width: var(--measure); color: var(--fog); font-size: clamp(1.125rem, 1.6vw, var(--t-md)); }
.page-head__lede a { color: var(--signal); text-underline-offset: 0.18em; }

/* ---------- About: FAQ ---------- */
.faq { max-width: 46rem; }
.faq__item { border-top: 1px solid var(--rule); padding-block: 1.75rem; }
.faq__item:last-child { border-bottom: 1px solid var(--rule); }
.faq__q { font: 700 var(--t-md)/1.35 var(--sans); margin-bottom: 0.6rem; }
.faq__more { margin-top: 2.5rem; }
.faq__more a { color: var(--signal-deep); text-underline-offset: 0.18em; }

/* ---------- Resources ---------- */
.section--library { padding-top: clamp(2.5rem, 5vw, 3.5rem); }
.filters { display: flex; flex-wrap: wrap; gap: 0.5rem; margin-bottom: clamp(2.5rem, 5vw, 3.5rem); }
.filters__btn {
  min-height: 2.75rem; padding: 0.55rem 1rem;
  border: 1px solid #7C929B; border-radius: 2px; background: var(--paper); color: var(--ink);
  font: 700 0.9375rem/1.2 var(--sans); cursor: pointer;
}
.filters__btn:hover { border-color: var(--ink); }
.filters__btn[aria-pressed="true"] { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.library { list-style: none; display: grid; gap: 3.5rem 2rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.library__link { display: flex; flex-direction: column; height: 100%; color: var(--ink); text-decoration: none; }
.library__img { width: 100%; aspect-ratio: 16 / 10; object-fit: cover; margin-bottom: 1rem; background: var(--rule); }
.library__cat { font-size: var(--t-small); color: var(--ink-muted); margin-bottom: 0.35rem; }
.library__title { font: 700 1.75rem/1.05 var(--display); margin-bottom: 0.6rem; }
.library__summary { font-size: 1rem; color: var(--ink); flex-grow: 1; }
.library__source { margin-top: 0.9rem; font-size: var(--t-small); color: var(--ink-muted); }
.library__cue { margin-top: 0.75rem; font-weight: 700; color: var(--signal-deep); text-decoration: underline; text-underline-offset: 0.2em; text-decoration-thickness: 1px; }
.library__link:hover .library__title { color: var(--signal-deep); }
.library__link:hover .library__cue { text-decoration-thickness: 2px; }

/* ---------- Facial recognition: scan interface ---------- */
.page-head--scan { padding-bottom: clamp(3.5rem, 7vw, 5.5rem); }
.scan { margin-top: clamp(2.5rem, 5vw, 3.5rem); max-width: 52rem; }
.scan__zone.dropzone {
  display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 1rem;
  min-height: clamp(16rem, 34vw, 22rem);
  padding: 2rem;
  border: 1px solid var(--wire); border-radius: 0;
  background: rgba(14, 28, 33, 0.6);
  color: var(--paper);
  cursor: pointer;
  --target-length: 2.5rem;
  --target-weight: 4px;
  --target-inset: -1px;
  transition: background-color 120ms;
}
.scan__zone.dropzone:hover { background: var(--panel); }
.scan__zone.dropzone.dz-drag-hover { --target-color: var(--match); border-color: var(--match); background: var(--panel); }
.scan__zone.dropzone.dz-drag-hover .dz-message { opacity: 1; }
.scan__zone .dz-message { margin: 0; display: flex; flex-direction: column; align-items: center; gap: 0.75rem; text-align: center; font-family: var(--mono); }
.scan__icon { color: var(--signal); }
.scan__prompt { font-size: clamp(1rem, 2vw, 1.25rem); font-weight: 700; }
.scan__note { font-size: var(--t-small); color: var(--fog); }
.scan__status { min-height: 1.6em; margin-top: 1rem; font-family: var(--mono); font-size: 0.9375rem; color: var(--signal); }
.scan__zone.is-scanning .dz-preview .dz-image { animation: scan-pulse 1.2s steps(2, end) infinite; }
@keyframes scan-pulse { 50% { opacity: 0.55; } }
/* Dropzone preview tidy-up */
.scan__zone .dz-preview .dz-image { border-radius: 0; }
.scan__zone .dz-preview .dz-details, .scan__zone .dz-preview .dz-error-message { font-family: var(--mono); }

/* Example videos */
.example { display: grid; gap: 1.75rem 3rem; align-items: start; }
.example + .example { margin-top: clamp(3.5rem, 7vw, 5.5rem); padding-top: clamp(3.5rem, 7vw, 5.5rem); border-top: 1px solid var(--rule); }
@media (min-width: 62rem) { .example { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); } }
.example__video { position: relative; aspect-ratio: 16 / 9; background: var(--void); }
.example__video iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.example__text h3 { font: 700 2rem/1 var(--display); margin-bottom: 0.4rem; }
.example__date { color: var(--ink-muted); font-size: var(--t-small); margin-bottom: 1rem; }

/* ---------- Results ---------- */
.result { background: var(--void); color: var(--paper); padding: calc(var(--nav-h) + 2rem) 0 var(--section-y); }
.result__image {
  display: block; width: auto; max-width: 100%; height: auto; margin-inline: auto;
  /* keep the result and the buttons below it on one screen */
  max-height: calc(100vh - var(--nav-h) - 9rem);
  border: 1px solid var(--wire);
}
.result__footer { max-width: calc((100vh - var(--nav-h) - 9rem) * 16 / 9); margin-inline: auto; }
.result__footer { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 1rem 2rem; margin-top: 1.5rem; }
.result__note { display: flex; align-items: center; gap: 0.6rem; color: var(--fog); font-size: var(--t-small); }

/* ---------- Contact form ---------- */
.form { max-width: 36rem; }
.form__field + .form__field { margin-top: 1.5rem; }
.form label { display: block; font-weight: 700; font-size: 0.9375rem; margin-bottom: 0.4rem; }
.form__input {
  width: 100%; padding: 0.8rem 1rem;
  border: 1px solid #7C929B; border-radius: 2px; background: var(--paper); color: var(--ink);
  font: 400 1.0625rem/1.5 var(--sans);
}
.form__input:hover { border-color: var(--ink); }
.form__input--area { min-height: 10rem; resize: vertical; }
.alert { border-left: 4px solid var(--error); background: #FDF1F0; color: var(--ink); padding: 1rem 1.25rem; margin-bottom: 2rem; }
.alert ul { padding-left: 1.1rem; }

/* ---------- Video dialog ---------- */
.video-dialog { width: min(92vw, 70rem); padding: 0; border: 0; background: transparent; overflow: visible; }
.video-dialog::backdrop { background: rgba(4, 8, 7, 0.9); }
.video-dialog__frame { position: relative; aspect-ratio: 16 / 9; background: var(--void); }
.video-dialog__frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.video-dialog__close {
  display: block; margin: 0 0 0.75rem auto; padding: 0.5rem 0.9rem;
  background: none; border: 2px solid rgba(255, 255, 255, 0.55); border-radius: 2px;
  color: var(--paper); font: 700 0.9375rem var(--sans); cursor: pointer;
}
.video-dialog__close:hover { border-color: var(--signal); color: var(--signal); }

/* ---------- Footer ---------- */
.site-footer { background: var(--void); color: var(--fog); border-top: 1px solid var(--wire); padding-block: 3rem; }
.site-footer__inner { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 2rem 3rem; }
.site-footer__label { font-size: var(--t-small); margin-bottom: 1rem; }
.site-footer__logos { display: flex; flex-wrap: wrap; align-items: center; gap: 1.5rem 2.5rem; }
.site-footer__logos img { height: 2.75rem; width: auto; }
.site-footer__license { display: flex; align-items: center; gap: 0.75rem; color: var(--fog); font-size: 0.8125rem; text-decoration: none; max-width: 22rem; }
.site-footer__license img { height: 1.25rem; width: auto; }
.site-footer__license:hover span { color: var(--paper); text-decoration: underline; }

/* ---------- Cookie notice (static/src/cookie-consent.js) ---------- */
.cookie-consent-modal { font-family: var(--sans); }
.cookie-consent-modal .modal-content-wrap .modal-content { background: var(--panel); border: 1px solid var(--wire); border-radius: 2px; color: var(--fog); }
.cookie-consent-modal .modal-content-wrap .modal-content .modal-header h3 { font: 700 1.75rem/1 var(--display); color: var(--paper); }
.cookie-consent-modal .modal-content-wrap .modal-content .modal-footer .btn,
.cookie-consent-modal .modal-content-wrap .modal-content .btn {
  min-height: 2.75rem; padding: 0.6rem 1.1rem; border-radius: 2px; font: 700 0.9375rem var(--sans); cursor: pointer;
}
.cookie-consent-modal .modal-content-wrap .modal-content .btn-primary { background: var(--signal); border: 2px solid var(--signal); color: var(--void); }
.cookie-consent-modal .modal-content-wrap .modal-content .btn-secondary { background: transparent; border: 2px solid rgba(255, 255, 255, 0.55); color: var(--paper); }
