/* ==========================================================================
   Silverfish Media — styles.css
   Design tokens implemented exactly from DESIGN.md front matter.
   Posture: editorial minimalism, flat, one clay accent.
   No gradients. No shadows. No glassmorphism.
   ========================================================================== */

/* --------------------------------------------------------------------------
   Self-hosted fonts (Newsreader / Public Sans / JetBrains Mono).
   Served from the site's own webspace — no third-party font requests.
   -------------------------------------------------------------------------- */
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("./assets/fonts/newsreader-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Newsreader";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("./assets/fonts/newsreader-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("./assets/fonts/public-sans-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "Public Sans";
  font-style: normal;
  font-weight: 300 700;
  font-display: swap;
  src: url("./assets/fonts/public-sans-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./assets/fonts/jetbrains-mono-latin-ext.woff2") format("woff2");
  unicode-range: U+0100-02BA, U+02BD-02C5, U+02C7-02CC, U+02CE-02D7, U+02DD-02FF, U+0304, U+0308, U+0329, U+1D00-1DBF, U+1E00-1E9F, U+1EF2-1EFF, U+2020, U+20A0-20AB, U+20AD-20C0, U+2113, U+2C60-2C7F, U+A720-A7FF;
}
@font-face {
  font-family: "JetBrains Mono";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("./assets/fonts/jetbrains-mono-latin.woff2") format("woff2");
  unicode-range: U+0000-00FF, U+0131, U+0152-0153, U+02BB-02BC, U+02C6, U+02DA, U+02DC, U+0304, U+0308, U+0329, U+2000-206F, U+20AC, U+2122, U+2191, U+2193, U+2212, U+2215, U+FEFF, U+FFFD;
}

/* --------------------------------------------------------------------------
   Design tokens (DESIGN.md front matter, verbatim)
   -------------------------------------------------------------------------- */
:root {
  /* colors */
  --color-primary: #1A1613;
  --color-secondary: #635C54;
  --color-accent: #A6402B;
  --color-neutral: #F4F1EA;
  --color-surface: #FBF9F4;
  --color-border: #DAD4C8;
  --color-silver: #B8B1A4;
  --color-white: #FFFFFF;

  /* typography — families */
  --font-display: "Newsreader", Georgia, serif;
  --font-body: "Public Sans", system-ui, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, monospace;

  /* typography — size (fluid; upper bound is the DESIGN.md value) */
  --text-h1: clamp(2.375rem, 1.55rem + 3.2vw, 3.25rem);
  --text-h2: clamp(1.875rem, 1.45rem + 1.7vw, 2.25rem);
  --text-h3: clamp(1.375rem, 1.28rem + 0.4vw, 1.5rem);
  --text-body-lg: clamp(1.0625rem, 1.02rem + 0.2vw, 1.125rem);
  --text-body-md: 1rem;
  --text-label: 0.75rem;
  --text-button: 0.9375rem;

  /* typography — weight / leading / tracking */
  --weight-display: 500;
  --weight-body: 400;
  --weight-label: 500;
  --weight-button: 600;
  --leading-h1: 1.05;
  --leading-h2: 1.12;
  --leading-h3: 1.2;
  --leading-body: 1.6;
  --leading-label: 1.4;
  --leading-button: 1;
  --tracking-h1: -0.015em;
  --tracking-h2: -0.01em;
  --tracking-label: 0.08em;

  /* rounded */
  --radius-sm: 2px;
  --radius-md: 4px;
  --radius-lg: 8px;

  /* spacing */
  --space-xs: 8px;
  --space-sm: 12px;
  --space-md: 16px;
  --space-lg: 24px;
  --space-xl: 40px;
  --space-2xl: 64px;
  --space-3xl: 96px;

  /* layout measures */
  --shell: 1120px;
  --measure: 68ch;
  --gutter: 24px;

  /* components — tokens */
  --button-padding-y: 14px;
  --button-padding-x: 24px;
  --card-padding: 24px;
  --input-padding: 12px;
  --cookie-padding: 24px;
}

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

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

body {
  margin: 0;
  background: var(--color-neutral);
  color: var(--color-primary);
  font-family: var(--font-body);
  font-size: var(--text-body-md);
  font-weight: var(--weight-body);
  line-height: var(--leading-body);
}

h1,
h2,
h3 {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  color: var(--color-primary);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-h1);
  line-height: var(--leading-h1);
  letter-spacing: var(--tracking-h1);
  margin: 0 0 var(--space-lg);
}

h2 {
  font-size: var(--text-h2);
  line-height: var(--leading-h2);
  letter-spacing: var(--tracking-h2);
  margin: 0 0 var(--space-md);
}

h3 {
  font-size: var(--text-h3);
  line-height: var(--leading-h3);
  margin: 0 0 var(--space-xs);
}

p {
  margin: 0 0 var(--space-md);
  text-wrap: pretty;
}

p:last-child {
  margin-bottom: 0;
}

a {
  color: var(--color-accent);
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--color-primary);
}

:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 2px;
}

::selection {
  background: var(--color-accent);
  color: var(--color-white);
}

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

/* --------------------------------------------------------------------------
   Layout utilities
   -------------------------------------------------------------------------- */
.shell {
  width: 100%;
  max-width: calc(var(--shell) + 2 * var(--gutter));
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.measure {
  max-width: var(--measure);
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
}

.skip-link:focus {
  left: var(--gutter);
  top: var(--space-xs);
  z-index: 200;
  background: var(--color-surface);
  color: var(--color-primary);
  padding: var(--space-sm) var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  text-decoration: none;
}

/* --------------------------------------------------------------------------
   Type helpers
   -------------------------------------------------------------------------- */
.eyebrow {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  font-weight: var(--weight-label);
  line-height: var(--leading-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-secondary);
  margin: 0 0 var(--space-sm);
}

.lede {
  font-size: var(--text-body-lg);
  line-height: var(--leading-body);
  color: var(--color-secondary);
  margin-bottom: var(--space-lg);
}

.section-lede {
  color: var(--color-secondary);
}

/* --------------------------------------------------------------------------
   Wordmark — silverfish (semibold) + media (light)
   -------------------------------------------------------------------------- */
.wordmark {
  display: inline-flex;
  align-items: baseline;
  min-height: 44px;
  font-family: var(--font-display);
  font-size: 1.375rem;
  line-height: 1;
  letter-spacing: -0.01em;
  color: var(--color-primary);
  text-decoration: none;
}

.wordmark:hover {
  color: var(--color-primary);
}

.wordmark-strong {
  font-weight: 600;
}

.wordmark-light {
  font-weight: 300;
}

.wordmark-mark {
  height: 22px;
  width: auto;
  margin-right: 10px;
  flex: none;
  transform: translateY(5px);
}

/* --------------------------------------------------------------------------
   Header & navigation — minimal sticky bar
   -------------------------------------------------------------------------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--color-neutral);
  border-bottom: 1px solid var(--color-border);
}

.header-inner {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--space-lg);
  min-height: 68px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: var(--space-lg);
}

.site-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font-family: var(--font-body);
  font-size: var(--text-button);
  font-weight: var(--weight-button);
  line-height: var(--leading-button);
  color: var(--color-primary);
  text-decoration: none;
  border-bottom: 2px solid transparent;
}

.site-nav a:hover {
  color: var(--color-accent);
}

.site-nav a[aria-current="page"] {
  color: var(--color-primary);
  border-bottom-color: var(--color-accent);
}

.nav-toggle {
  display: none;
  align-items: center;
  min-height: 44px;
  padding: 0 var(--space-sm);
  font-family: var(--font-mono);
  font-size: var(--text-label);
  font-weight: var(--weight-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-primary);
  background: transparent;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  cursor: pointer;
}

/* --------------------------------------------------------------------------
   Sections — one idea per section, whitespace-led
   -------------------------------------------------------------------------- */
.hero {
  padding: var(--space-3xl) 0 var(--space-2xl);
}

.hero .eyebrow {
  margin-bottom: var(--space-md);
}

.section {
  padding: var(--space-2xl) 0;
  border-top: 1px solid var(--color-border);
}

.section-more {
  margin-top: var(--space-xl);
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
}

/* --------------------------------------------------------------------------
   Components
   -------------------------------------------------------------------------- */

/* button-primary — the single high-emphasis action per view */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: var(--button-padding-y) var(--button-padding-x);
  font-family: var(--font-body);
  font-size: var(--text-button);
  font-weight: var(--weight-button);
  line-height: var(--leading-button);
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  text-decoration: none;
  cursor: pointer;
  transition: background-color 120ms ease, color 120ms ease, border-color 120ms ease;
}

.btn-primary {
  background: var(--color-accent);
  color: var(--color-white);
}

.btn-primary:hover {
  background: var(--color-primary);
  color: var(--color-white);
}

/* button-secondary — quiet action */
.btn-secondary {
  background: var(--color-surface);
  color: var(--color-primary);
  border-color: var(--color-border);
}

.btn-secondary:hover {
  background: var(--color-neutral);
  color: var(--color-primary);
}

/* link that behaves like a button (footer "Cookie preferences") */
.linklike {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0;
  font: inherit;
  color: var(--color-accent);
  background: none;
  border: 0;
  text-decoration: underline;
  text-underline-offset: 0.18em;
  cursor: pointer;
}

.linklike:hover {
  color: var(--color-primary);
}

/* card — flat panel for genuine repeated items only (channel tiles) */
.card {
  background: var(--color-surface);
  color: var(--color-primary);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--card-padding);
  transition: background-color 120ms ease;
}

.channel-card:hover {
  background: var(--color-neutral);
}

/* input-field */
.field {
  display: grid;
  gap: var(--space-xs);
}

.field label {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  font-weight: var(--weight-label);
  line-height: var(--leading-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-secondary);
}

.field input,
.field textarea {
  width: 100%;
  background: var(--color-white);
  color: var(--color-primary);
  font-family: var(--font-body);
  font-size: var(--text-body-md);
  line-height: var(--leading-body);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  padding: var(--input-padding);
}

.field input {
  min-height: 44px;
}

.field textarea {
  min-height: 168px;
  resize: vertical;
}

.field input:focus-visible,
.field textarea:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 1px;
  border-color: var(--color-accent);
}

/* honeypot — invisible to humans, tempting to bots */
.hp {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

/* --------------------------------------------------------------------------
   Home: principles, pipeline, channels
   -------------------------------------------------------------------------- */
.pillar-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
  margin-top: var(--space-xl);
}

.pillar-index {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  font-weight: var(--weight-label);
  letter-spacing: var(--tracking-label);
  color: var(--color-secondary);
  margin: 0 0 var(--space-xs);
}

.pillar p {
  color: var(--color-secondary);
}

.pipeline {
  list-style: none;
  margin: var(--space-xl) 0 0;
  padding: 0;
}

.pipeline-step {
  padding: var(--space-lg) 0 0;
  margin-top: var(--space-lg);
  border-top: 1px solid var(--color-border);
}

.pipeline-step:first-child {
  margin-top: 0;
}

.pipeline-index {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  font-weight: var(--weight-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-secondary);
  margin: 0 0 var(--space-xs);
}

.pipeline-step p {
  color: var(--color-secondary);
}

.tile-row {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-lg);
  margin-top: var(--space-xl);
}

/* clean rectangular artwork slot (square or 4:5) — replace with real channel art */
.tile-art {
  display: grid;
  place-items: center;
  aspect-ratio: 4 / 5;
  margin: 0 0 var(--space-md);
  background: var(--color-neutral);
  border-radius: var(--radius-sm);
  font-family: var(--font-display);
  font-size: 3rem;
  font-weight: var(--weight-display);
  color: var(--color-secondary);
}

.channel-links {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md);
  margin-top: var(--space-sm);
  font-size: 0.9375rem;
}

.channel-links a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

.channel-links a[aria-disabled="true"] {
  color: var(--color-secondary);
  text-decoration: none;
  cursor: default;
}

/* --------------------------------------------------------------------------
   Click-to-load embedded media (nothing third-party loads before a click)
   -------------------------------------------------------------------------- */
.embed-block {
  background: var(--color-surface);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  padding: var(--space-xl);
  margin-top: var(--space-xl);
}

.embed-body {
  display: grid;
  gap: var(--space-lg);
}

.embed-frame {
  width: 100%;
  max-width: 320px;
  aspect-ratio: 9 / 16;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-sm);
  background: var(--color-neutral);
}

.embed-frame iframe {
  width: 100%;
  height: 100%;
  border: 0;
  display: block;
}

.embed-actions {
  margin-top: var(--space-md);
}

/* --------------------------------------------------------------------------
   Forms (contact)
   -------------------------------------------------------------------------- */
.form-grid {
  display: grid;
  gap: var(--space-lg);
  max-width: 560px;
}

.form-note {
  border-top: 1px solid var(--color-border);
  padding-top: var(--space-md);
  color: var(--color-secondary);
  font-size: 0.9375rem;
}

.form-status {
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
  background: var(--color-surface);
  padding: var(--space-lg);
  margin-bottom: var(--space-lg);
}

.form-status:empty {
  display: none;
}

.contact-aside {
  margin-top: var(--space-2xl);
}

.identity-line {
  color: var(--color-secondary);
  font-size: 0.9375rem;
}

/* --------------------------------------------------------------------------
   Prose pages (legal, about)
   -------------------------------------------------------------------------- */
.prose {
  max-width: var(--measure);
}

.prose h2 {
  margin-top: var(--space-2xl);
}

.prose h3 {
  margin-top: var(--space-lg);
}

.prose ul,
.prose ol {
  margin: 0 0 var(--space-md);
  padding-left: 1.25rem;
}

.prose li {
  margin-bottom: var(--space-xs);
}

.prose li::marker {
  color: var(--color-secondary);
}

.table-wrap {
  overflow-x: auto;
  margin: var(--space-lg) 0;
}

table.data {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.9375rem;
}

table.data th {
  font-family: var(--font-mono);
  font-size: var(--text-label);
  font-weight: var(--weight-label);
  letter-spacing: var(--tracking-label);
  text-transform: uppercase;
  color: var(--color-secondary);
  text-align: left;
}

table.data th,
table.data td {
  border-bottom: 1px solid var(--color-border);
  padding: var(--space-sm) var(--space-md) var(--space-sm) 0;
  vertical-align: top;
}

.fill {
  font-family: var(--font-mono);
  font-size: 0.875em;
  color: var(--color-accent);
}

/* --------------------------------------------------------------------------
   Footer
   -------------------------------------------------------------------------- */
.site-footer {
  border-top: 1px solid var(--color-silver);
  margin-top: var(--space-3xl);
  padding: var(--space-2xl) 0 var(--space-xl);
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr;
  gap: var(--space-xl);
}

.footer-blurb {
  color: var(--color-secondary);
  margin-top: var(--space-sm);
}

.footer-legal {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-md) var(--space-lg);
  margin-bottom: var(--space-sm);
}

.footer-legal a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  color: var(--color-primary);
  font-size: 0.9375rem;
  text-decoration: none;
  border-bottom: 1px solid var(--color-border);
}

.footer-legal a:hover {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.footer-legal .linklike {
  font-size: 0.9375rem;
  color: var(--color-primary);
  border-bottom: 1px solid var(--color-border);
  text-decoration: none;
}

.footer-legal .linklike:hover {
  color: var(--color-accent);
  border-bottom-color: var(--color-accent);
}

.footer-contact {
  color: var(--color-secondary);
  font-size: 0.9375rem;
}

.footer-contact a {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
}

/* --------------------------------------------------------------------------
   Cookie banner — the only "layer" on the site
   -------------------------------------------------------------------------- */
.cookie-banner {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  background: var(--color-surface);
  color: var(--color-primary);
  border-top: 1px solid var(--color-border);
}

.cookie-panel {
  max-width: calc(var(--shell) + 2 * var(--gutter));
  margin-inline: auto;
  padding: var(--cookie-padding) var(--gutter);
  border-radius: var(--radius-md);
  font-size: var(--text-body-md);
}

.cookie-title {
  font-family: var(--font-display);
  font-size: var(--text-h3);
  font-weight: var(--weight-display);
  line-height: var(--leading-h3);
  margin: 0 0 var(--space-xs);
}

.cookie-customize fieldset {
  margin: var(--space-md) 0;
  padding: var(--space-md);
  border: 1px solid var(--color-border);
  border-radius: var(--radius-md);
}

.cookie-customize legend {
  padding: 0 var(--space-xs);
}

.check-row {
  display: flex;
  align-items: center;
  gap: var(--space-sm);
  min-height: 44px;
  cursor: pointer;
}

.check-row input {
  width: 18px;
  height: 18px;
  accent-color: var(--color-accent);
  flex: none;
}

.cookie-note {
  color: var(--color-secondary);
  font-size: 0.875rem;
}

.cookie-actions {
  display: flex;
  flex-wrap: wrap;
  gap: var(--space-sm);
  margin-top: var(--space-md);
}

/* --------------------------------------------------------------------------
   Responsive
   -------------------------------------------------------------------------- */
@media (min-width: 880px) {
  .pillar-row,
  .tile-row {
    grid-template-columns: repeat(3, 1fr);
  }

  .embed-body {
    grid-template-columns: 320px 1fr;
    gap: var(--space-xl);
    align-items: start;
  }

  .footer-inner {
    grid-template-columns: 1fr 1fr;
  }
}

@media (max-width: 767px) {
  :root {
    --gutter: 20px;
  }

  .hero {
    padding: var(--space-2xl) 0 var(--space-xl);
  }

  .section {
    padding: var(--space-xl) 0;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    background: var(--color-surface);
    border-bottom: 1px solid var(--color-border);
    padding: var(--space-md) var(--gutter) var(--space-lg);
  }

  .site-nav.is-open {
    display: flex;
  }

  .cookie-actions .btn {
    flex: 1 1 auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    transition: none !important;
    animation: none !important;
  }
}
