/* Acid Noir — visual shell
   Tired, grainy noir base interrupted by acid color.
   Target screen ratio: ~70% grain, 20% photo, 10% acid. */

/* ---------- Tokens ---------- */

:root {
  /* Grain palette — all under ~25% saturation */
  --precinct-ink: #1c1d20;   /* main background */
  --fog: #d8d2c4;            /* primary text on dark */
  --nicotine: #b5a584;       /* aged paper, case-file cards, secondary text */
  --gaslight-olive: #6b6852; /* 1920s tint, borders, dividers */
  --smog-blue: #56616b;      /* 1970s tint, night-city panels */
  --bruise-mauve: #776470;   /* shadows, hover underlays */

  /* Acid palette — full saturation, flat, sparing */
  --acid-lime: #c8ff1a;      /* primary burst, key CTAs, hijack letters */
  --hot-magenta: #ff2e93;    /* second burst, warnings, "he snaps" */
  --electric-cyan: #19e6ff;  /* modern tech, screens, links on hover */
  --siren-orange: #ff6a13;   /* police lights, alerts, case stamps */
  --ultraviolet: #7b2cff;    /* psychedelic fills, dream sequences */

  /* One acid per section: sections override this */
  --acid: var(--acid-lime);

  /* Type */
  --font-display: "Danfo", "Garamond", serif;
  --font-serif: "EB Garamond", "Garamond", Georgia, serif;
  --font-mono: "Courier Prime", "Courier New", monospace;

  --display-size: clamp(3.5rem, 15vw, 5.5rem);   /* 56–88px mobile */
  --body-size: 17px;
  --mono-size: 13px;

  --gutter: 16px;
  --measure: 34em;
}

@media (min-width: 768px) {
  :root {
    --display-size: clamp(7.5rem, 13vw, 12.5rem); /* 120–200px desktop */
    --body-size: 19px;
    --gutter: 40px;
  }
}

/* ---------- Base ---------- */

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

html {
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--precinct-ink);
  color: var(--fog);
  font-family: var(--font-serif);
  font-size: var(--body-size);
  line-height: 1.55;
  overflow-x: hidden;
}

/* Grain overlay — static CSS noise over everything */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 100;
  pointer-events: none;
  opacity: 0.22;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix type='saturate' values='0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 240px 240px;
}

/* Vignette — the tired edges of the frame */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 99;
  pointer-events: none;
  background: radial-gradient(ellipse at center, transparent 55%, rgb(0 0 0 / 0.45) 100%);
}

a {
  color: inherit;
  text-decoration-color: var(--gaslight-olive);
  text-underline-offset: 0.2em;
}

a:hover,
a:focus-visible {
  color: var(--electric-cyan);
  text-decoration-color: currentColor;
}

:focus-visible {
  outline: 2px solid var(--electric-cyan);
  outline-offset: 3px;
}

img {
  display: block;
  max-width: 100%;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---------- Type roles ---------- */

/* Display — Danfo, tight, never more than ~4 words */
.display {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 400;
  font-size: var(--display-size);
  line-height: 0.88;
  letter-spacing: -0.02em;
  text-transform: uppercase;
}

/* Serif headline — Garamond with one hijacked Danfo letter */
.headline {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 500;
  font-size: clamp(2.25rem, 6vw, 4.25rem);
  line-height: 1.02;
  letter-spacing: -0.015em;
}

/* Accent letter — at most one per headline, always acid */
.hijack {
  font-family: var(--font-display);
  font-style: normal;
  font-weight: 400;
  color: var(--acid);
  /* Danfo runs large; pull it back toward the Garamond x-height */
  font-size: 0.92em;
  line-height: 0;
}

/* Case-file mono — always caps, stamps and labels */
.mono {
  font-family: var(--font-mono);
  font-size: var(--mono-size);
  font-weight: 400;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  line-height: 1.5;
}

.mono--dim {
  color: var(--nicotine);
}

/* Pull quote — EB Garamond Bold Italic */
.pull-quote {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 700;
  font-style: italic;
  font-size: clamp(1.6rem, 3.6vw, 2.4rem);
  line-height: 1.18;
}

.pull-quote .hijack {
  font-size: 1em;
}

/* ---------- Stamps & rules ---------- */

.stamp {
  display: inline-block;
  padding: 0.35em 0.7em 0.3em;
  border: 2px solid var(--acid);
  color: var(--acid);
  transform: rotate(-3deg);
}

.rule {
  height: 0;
  margin: 0;
  border: 0;
  border-top: 1px solid var(--gaslight-olive);
}

.rule--acid {
  border-top-color: var(--acid);
}

/* ---------- Buttons & fields ---------- */

.button {
  display: inline-block;
  padding: 0.95em 1.4em 0.85em;
  border: 2px solid var(--acid);
  background: var(--acid);
  color: var(--precinct-ink);
  cursor: pointer;
  text-decoration: none;
}

.button:hover,
.button:focus-visible {
  background: transparent;
  color: var(--acid);
}

.button--ghost {
  background: transparent;
  color: var(--acid);
}

.button--ghost:hover,
.button--ghost:focus-visible {
  background: var(--acid);
  color: var(--precinct-ink);
}

.field {
  width: 100%;
  min-width: 0;
  padding: 0.95em 1em 0.85em;
  border: 1px solid var(--gaslight-olive);
  border-radius: 0;
  background: rgb(0 0 0 / 0.25);
  color: var(--fog);
  font: inherit;
}

.field::placeholder {
  color: var(--gaslight-olive);
  opacity: 1;
}

.field:focus {
  border-color: var(--acid);
  outline: none;
}

/* ---------- Photo layer ---------- */

/* Photoreal images: near-natural color at -30% saturation, same grain */
.photo {
  position: relative;
  overflow: hidden;
  background: var(--smog-blue);
}

.photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(0.7);
}

/* Featured duotone — one per page only (Ultraviolet + Acid Lime) */
.photo--duotone {
  background: var(--ultraviolet);
}

.photo--duotone img {
  filter: grayscale(1) contrast(1.15);
  mix-blend-mode: multiply;
}

.photo--duotone::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--acid-lime);
  mix-blend-mode: lighten;
  opacity: 0.55;
  pointer-events: none;
}

/* Empty slot until real photography lands */
.photo__placeholder {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  min-height: inherit;
  padding: var(--gutter);
  color: var(--fog);
  text-align: center;
  background:
    repeating-linear-gradient(135deg, transparent 0 14px, rgb(0 0 0 / 0.12) 14px 15px),
    linear-gradient(160deg, var(--smog-blue), var(--precinct-ink));
}

/* ---------- Era panels ---------- */

.era-1920s {
  background: color-mix(in srgb, var(--gaslight-olive) 22%, var(--precinct-ink));
}

.era-1970s {
  background: color-mix(in srgb, var(--smog-blue) 28%, var(--precinct-ink));
}

/* ---------- Footer ---------- */

.site-footer {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 32px;
  padding: 28px var(--gutter);
  border-top: 1px solid var(--gaslight-olive);
  color: var(--nicotine);
}

.site-footer ul {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 24px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer a {
  text-decoration: none;
}

/* =========================================================
   Splash  /
   ========================================================= */

.splash {
  --acid: var(--acid-lime);
  display: grid;
  min-height: 100vh;
  min-height: 100svh;
}

.splash__main {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 28px;
  padding: 48px var(--gutter);
}

.splash__title {
  color: var(--fog);
}

.splash__title .hijack {
  font-size: 1em;
  line-height: inherit;
}

.splash__signup {
  display: grid;
  gap: 10px;
  width: 100%;
  max-width: 520px;
}

.splash__signup-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.splash__signup-row .field {
  flex: 1 1 220px;
}

.splash__signup-row .button {
  flex: 0 0 auto;
}

.splash__note {
  margin: 0;
  min-height: 1.5em;
}

/* =========================================================
   Character study  /detective
   ========================================================= */

.section {
  padding: 72px var(--gutter);
}

.section__inner {
  max-width: 1200px;
  margin: 0 auto;
}

/* --- Character study (embedded 1920×1080 film + its 44px controls bar) --- */

.study {
  --acid: var(--acid-lime);
}

.study__title {
  margin-bottom: 40px;
}

.study__toggle {
  display: inline-flex;
  margin-bottom: 16px;
  border: 1px solid var(--gaslight-olive);
}

.study__toggle button {
  font: inherit;
  letter-spacing: inherit;
  text-transform: inherit;
  padding: 0.7em 1.1em 0.6em;
  border: 0;
  background: transparent;
  color: var(--nicotine);
  cursor: pointer;
}

.study__toggle button + button {
  border-left: 1px solid var(--gaslight-olive);
}

.study__toggle button:hover {
  color: var(--fog);
}

.study__toggle button[aria-pressed="true"] {
  background: var(--acid);
  color: var(--precinct-ink);
}

/* Sits above the site grain and vignette: the film carries its own */
.study__frame {
  position: relative;
  z-index: 101;
  padding-top: calc(56.25% + 44px);
  border: 1px solid var(--gaslight-olive);
  background: #0b0b0a;
}

.study__frame iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: 0;
}
