/* Oddspark — near-black broadcast/research aesthetic.
   Palette: void #0a0a0b, orange #ff6a00, acid #e8ff2f.
   Type: Space Grotesk display, JetBrains Mono labels, system sans body.
   Fonts self-hosted in /fonts (latin subsets, variable, font-display: swap). */

@font-face {
  font-family: "Space Grotesk";
  src: url("/fonts/SpaceGrotesk.woff2") format("woff2");
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "JetBrains Mono";
  src: url("/fonts/JetBrainsMono.woff2") format("woff2");
  font-weight: 100 800;
  font-style: normal;
  font-display: swap;
}

:root {
  --void: #0a0a0b;
  --panel: #121214;
  --rule: #232326;
  --text: #ededee;
  --dim: #9a9aa2;
  --orange: #ff6a00;
  --acid: #e8ff2f;
  --red: #ff4d4d;
  --mono: "JetBrains Mono", ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  --sans: system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --display: "Space Grotesk", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--void);
  color: var(--text);
  font-family: var(--sans);
  line-height: 1.6;
}

::selection { background: var(--orange); color: var(--void); }

a { color: var(--acid); }

/* Visible focus for keyboard users, everywhere. */
a:focus-visible,
button:focus-visible,
input:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--acid);
  outline-offset: 3px;
  border-radius: 2px;
}

main { display: block; }

section {
  max-width: 72rem;
  margin-inline: auto;
  padding: 4rem 1.25rem;
}

h1, h2, h3 { line-height: 1.05; margin: 0 0 1rem; text-wrap: balance; font-family: var(--display); font-weight: 700; }
p { margin: 0 0 1rem; }

.data-label {
  font-family: var(--mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  margin: 0 0 0.75rem;
}

/* --- Header ----------------------------------------------------------- */

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem 1rem;
  padding: 0.6rem 1.25rem;
  background: rgba(10, 10, 11, 0.88);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--rule);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  color: var(--text);
  text-decoration: none;
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.02em;
}
.brand-mark { color: var(--orange); }

.site-nav { display: flex; flex-wrap: wrap; gap: 0.25rem 1.1rem; }
.site-nav a {
  color: var(--dim);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding: 0.3rem 0.1rem;
}
.site-nav a:hover { color: var(--acid); }

/* --- Hero ------------------------------------------------------------- */

/* Full-bleed portrait: subject on the right third, void-dark left half
   carries the copy. Scrim is a --void gradient (never a dark overlay flip),
   anchored to the copy side; bottom fades back to void for section flow.
   AVIF + WebP + JPEG via image-set(), plain JPEG declaration first. */
.hero {
  position: relative;
  padding-top: 6rem;
  padding-bottom: 6rem;
  padding-inline: 0;
  max-width: none;
  background-image: url("/img/oddspark-hero-portrait-v1.jpg");
  background-image: image-set(
    "/img/oddspark-hero-portrait-v1.avif" type("image/avif"),
    "/img/oddspark-hero-portrait-v1.webp" type("image/webp"),
    "/img/oddspark-hero-portrait-v1.jpg" type("image/jpeg")
  );
  background-size: cover;
  background-position: right center;
  background-repeat: no-repeat;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, var(--void) 0%, rgba(10, 10, 11, 0.95) 35%, rgba(10, 10, 11, 0.55) 55%, rgba(10, 10, 11, 0.12) 75%),
    linear-gradient(0deg, var(--void) 0%, transparent 22%);
  pointer-events: none;
}
.hero > * { position: relative; max-width: 72rem; padding-inline: 1.25rem; box-sizing: border-box; margin-inline: auto; }
/* Copy stays anchored to the left/dark half of the photo: block-level caps
   must not center themselves inside the measure, and the column stays narrow
   enough to keep every line on the void side of the portrait. */
.hero h1, .hero .lede, .hero .watch-group { margin-inline: 0; }
.hero .lede, .hero .watch-group { max-width: 46rem; }
.hero h1 { max-width: none; }

@media (max-width: 30rem) {
  .hero > * { padding-inline: 1rem; }
}

/* Small and mid screens: the subject sits behind the copy; deepen the
   scrim so text contrast holds over the face. */
@media (max-width: 48rem) {
  .hero { background-position: 78% center; }
  .hero::before {
    background:
      linear-gradient(90deg, rgba(10, 10, 11, 0.95) 0%, rgba(10, 10, 11, 0.85) 100%),
      linear-gradient(0deg, var(--void) 0%, transparent 22%);
  }
}

.hero h1 {
  font-size: clamp(2.8rem, 8vw, 5.25rem);
  font-weight: 700;
  letter-spacing: -0.03em;
}
.hero h1 em { font-style: normal; color: var(--orange); }

.lede {
  font-size: clamp(1.05rem, 2.4vw, 1.35rem);
  color: var(--dim);
  max-width: 42ch;
}

/* Decorative motion: none on the hero photo. Copy and controls never animate. */
@media (prefers-reduced-motion: no-preference) {
  html { scroll-behavior: smooth; }
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

/* --- Watch links ------------------------------------------------------- */

.watch-group { margin-top: 2.5rem; }
.group-label {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--dim);
  margin-bottom: 0.75rem;
}

.platform-list {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 0;
  padding: 0;
}

.platform {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  min-height: 2.75rem;
  padding: 0.55rem 1rem;
  border: 1px solid var(--rule);
  background: var(--panel);
  color: var(--text);
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.85rem;
}
.platform svg { color: var(--orange); flex: none; }
.platform:hover { border-color: var(--orange); color: var(--acid); }
.platform:hover svg { color: var(--acid); }

/* --- Research feature -------------------------------------------------- */

.research {
  border-block: 1px solid var(--rule);
  background:
    linear-gradient(90deg, rgba(255, 106, 0, 0.07), transparent 55%);
}
.research h2 { font-size: clamp(1.9rem, 5vw, 3.2rem); font-weight: 700; letter-spacing: -0.02em; }
.research p:not(.data-label) { color: var(--dim); max-width: 52ch; font-size: 1.05rem; }

.button {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  padding: 0.7rem 1.4rem;
  font-family: var(--mono);
  font-size: 0.9rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}
.button--research {
  background: var(--orange);
  color: var(--void);
  font-weight: 700;
}
.button--research:hover { background: var(--acid); }

/* --- Project cards ------------------------------------------------------ */

.projects h2 { font-size: clamp(1.9rem, 5vw, 3.2rem); font-weight: 700; letter-spacing: -0.02em; }

.card-grid {
  list-style: none;
  margin: 2rem 0 0;
  padding: 0;
  display: grid;
  gap: 1rem;
  grid-template-columns: 1fr;
}
@media (min-width: 40rem) {
  .card-grid { grid-template-columns: 1fr 1fr; }
}

.card {
  --accent: var(--orange);
  position: relative;
  border: 1px solid var(--rule);
  border-top: 3px solid var(--accent);
  background: var(--panel);
  padding: 1.25rem;
  min-width: 0;
}
.card--idea { --accent: var(--orange); }
.card--polls { --accent: var(--acid); }
.card--pulsekin { --accent: #ffd23f; }
.card--random { --accent: #ff9e4d; }

.card h3 { font-size: 1.5rem; font-weight: 700; color: var(--accent); }
.card p:not(.data-label) { color: var(--dim); }

.card-cta {
  display: inline-flex;
  align-items: center;
  min-height: 2.75rem;
  margin-top: 0.5rem;
  padding: 0.5rem 0.9rem;
  border: 1px solid var(--accent);
  color: var(--accent);
  font-family: var(--mono);
  font-size: 0.85rem;
  text-decoration: none;
}
.card-cta::after { content: " →"; }
.card-cta:hover { background: var(--accent); color: var(--void); }

/* Whole-card click target via stretched link. */
.stretched { position: absolute; inset: 0; }

/* --- Contact ------------------------------------------------------------ */

.contact h2 { font-size: clamp(1.9rem, 5vw, 3.2rem); font-weight: 700; letter-spacing: -0.02em; }
.contact > p { color: var(--dim); max-width: 52ch; }

#contact-form { max-width: 34rem; margin-top: 1.5rem; }

.field { margin-bottom: 1.25rem; }
.field label {
  display: block;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  margin-bottom: 0.4rem;
}
.field input,
.field textarea {
  width: 100%;
  padding: 0.65rem 0.75rem;
  background: var(--panel);
  border: 1px solid var(--rule);
  color: var(--text);
  font: inherit;
  border-radius: 0;
}
.field input:hover,
.field textarea:hover { border-color: var(--dim); }
.field [aria-invalid="true"] { border-color: var(--red); }

.field-error {
  margin: 0.35rem 0 0;
  font-size: 0.85rem;
  color: var(--red);
}
.field-error::before { content: "✕ "; }

.form-status { min-height: 1.5rem; font-weight: 600; }
.form-status[data-kind="ok"] { color: var(--acid); }
.form-status[data-kind="ok"]::before { content: "✓ "; }
.form-status[data-kind="err"] { color: var(--red); }
.form-status[data-kind="err"]::before { content: "✕ "; }

/* Honeypot: clipped out of view but still in the tree (not display:none). */
.hp {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.button--submit {
  background: var(--acid);
  color: var(--void);
  font-weight: 700;
  border: none;
}
.button--submit:hover { background: var(--orange); }
.button--submit[disabled] { opacity: 0.6; cursor: wait; }

/* --- Tips band ----------------------------------------------------------- */

.tips {
  border: 1px solid var(--rule);
  border-top: 3px solid var(--acid);
  background:
    linear-gradient(135deg, rgba(232, 255, 47, 0.07), transparent 55%),
    var(--panel);
  padding: 2rem 1.5rem;
}
.tips h2 { font-size: clamp(1.9rem, 5vw, 3.2rem); font-weight: 700; letter-spacing: -0.02em; }
.tips p:not(.data-label) { color: var(--dim); max-width: 56ch; font-size: 1.05rem; }
.tips strong { color: var(--text); }

.button--tips {
  background: var(--acid);
  color: var(--void);
  font-weight: 700;
}
.button--tips:hover { background: var(--orange); }

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

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 2rem 1.25rem 3rem;
  max-width: 72rem;
  margin-inline: auto;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.platform-list--footer .platform {
  min-height: 2.25rem;
  padding: 0.35rem 0.7rem;
  font-size: 0.75rem;
  background: transparent;
}

.hearn {
  color: var(--dim);
  text-decoration: none;
  font-size: 0.85rem;
  display: inline-flex;
  align-items: baseline;
  gap: 0.35rem;
  min-height: 1.5rem;
  padding: 0.5rem 0.25rem;
}
.hearn:hover { color: var(--text); }
.hearn-mark {
  height: 0.95em;
  width: auto;
  vertical-align: baseline;
  transform: translateY(0.12em);
}

/* --- Small screens -------------------------------------------------------- */

@media (max-width: 30rem) {
  section { padding: 3rem 1rem; }
  .hero { padding-top: 3rem; }
  .site-nav { gap: 0.25rem 0.8rem; }
}
