/* =============================================================================
   DigitalSchwartz.com  —  shared design system
   -----------------------------------------------------------------------------
   Warmer, more personal than a typical corporate site, but tight enough to
   carry professional case studies. Inter font with system fallbacks, a warm
   off-white background, dark warm text, and a single blue accent borrowed
   from the Nexstar CTV work.
   ============================================================================= */

/* ---------- Tokens ---------- */
:root {
  /* Surfaces */
  --bg: #fbfaf7;          /* warm off-white page background */
  --surface: #ffffff;     /* card / panel background */
  --surface-soft: #f4f1ea;/* subtle panel for muted sections */

  /* Text */
  --text: #1a1814;        /* warm near-black */
  --text-soft: #555049;   /* secondary body */
  --text-faint: #8a847b;  /* tertiary / metadata */

  /* Lines */
  --border: #e8e3d8;
  --border-strong: #d6cfc0;

  /* Accent (a single blue, used sparingly) */
  --accent: #0a4ed4;
  --accent-strong: #0844b3;
  --accent-soft: #eef3ff;
  --accent-ink: #062f7d;

  /* Highlight for "live" / red accents */
  --live: #e8203b;

  /* Type */
  --font-body:
    "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", system-ui, Roboto,
    Helvetica, Arial, sans-serif;
  --font-mono:
    "JetBrains Mono", "SF Mono", Menlo, Consolas, monospace;

  /* Spacing scale (rem) */
  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;
  --space-16: 4rem;
  --space-20: 5rem;
  --space-24: 6rem;

  /* Radius */
  --radius-sm: 8px;
  --radius-md: 14px;
  --radius-lg: 20px;
  --radius-pill: 999px;

  /* Shadow */
  --shadow-sm: 0 1px 2px rgba(20, 18, 14, 0.04), 0 1px 3px rgba(20, 18, 14, 0.05);
  --shadow-md: 0 6px 22px rgba(20, 18, 14, 0.06), 0 2px 8px rgba(20, 18, 14, 0.05);
  --shadow-lg: 0 18px 50px rgba(20, 18, 14, 0.10), 0 6px 18px rgba(20, 18, 14, 0.06);

  /* Layout */
  --container: 1120px;
  --container-narrow: 760px;
}

/* ---------- Reset / base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { display: block; max-width: 100%; height: auto; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-strong); text-decoration: underline; text-underline-offset: 3px; }

h1, h2, h3, h4 { margin: 0; line-height: 1.15; letter-spacing: -0.015em; font-weight: 700; }
h1 { font-size: clamp(36px, 5vw, 56px); font-weight: 800; letter-spacing: -0.02em; }
h2 { font-size: clamp(24px, 3vw, 34px); }
h3 { font-size: 20px; }
p  { margin: 0; }

/* ---------- Layout primitives ---------- */
.container {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.container-narrow {
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--space-6);
}
.section { padding: var(--space-20) 0; }
.section-tight { padding: var(--space-12) 0; }
.section-soft { background: var(--surface-soft); }

.stack > * + * { margin-top: var(--space-4); }
.stack-lg > * + * { margin-top: var(--space-8); }

/* ---------- Header / Nav ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50;
  background: rgba(251, 250, 247, 0.88);
  backdrop-filter: saturate(180%) blur(10px);
  -webkit-backdrop-filter: saturate(180%) blur(10px);
  border-bottom: 1px solid var(--border);
}
.site-header__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-3) var(--space-6);
  display: flex; align-items: center; justify-content: space-between;
  gap: var(--space-6);
}
.brand {
  font-weight: 800; font-size: 17px; letter-spacing: -0.01em;
  color: var(--text); text-decoration: none;
}
.brand:hover { color: var(--text); text-decoration: none; }
.brand .dot { color: var(--accent); }

.site-nav {
  display: flex; gap: var(--space-6); align-items: center;
}
.site-nav a {
  color: var(--text-soft); text-decoration: none;
  font-size: 14px; font-weight: 500;
  padding: 6px 2px;
  border-bottom: 2px solid transparent;
}
.site-nav a:hover { color: var(--text); border-bottom-color: var(--border-strong); text-decoration: none; }
.site-nav a.active { color: var(--text); border-bottom-color: var(--accent); }

/* Mobile nav toggle */
.nav-toggle {
  display: none; background: transparent; border: 0; padding: 6px;
  cursor: pointer; color: var(--text);
}
.nav-toggle svg { width: 22px; height: 22px; }

@media (max-width: 780px) {
  .nav-toggle { display: inline-flex; }
  .site-nav {
    position: absolute; top: 100%; left: 0; right: 0;
    flex-direction: column; align-items: stretch;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    padding: var(--space-4) var(--space-6) var(--space-6);
    gap: 0;
    display: none;
  }
  .site-nav.is-open { display: flex; }
  .site-nav a {
    padding: 12px 0;
    border-bottom: 1px solid var(--border);
    border-left: 2px solid transparent;
    padding-left: 0;
  }
  .site-nav a.active { border-bottom-color: var(--border); color: var(--accent); }
}

/* ---------- Hero ---------- */
.hero { padding: var(--space-20) 0 var(--space-12); }
.hero__eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--accent);
  background: var(--accent-soft);
  border: 1px solid #dbe5ff;
  padding: 6px 12px; border-radius: var(--radius-pill);
  margin-bottom: var(--space-6);
}
.hero__eyebrow::before {
  content: ""; width: 7px; height: 7px; border-radius: 2px; background: var(--accent);
}
.hero h1 { color: var(--text); }
.hero h1 .accent-bar {
  display: inline-block; width: 6px; height: 0.85em;
  background: var(--accent); border-radius: 2px; margin-right: 12px;
  transform: translateY(0.05em);
}
.hero__lede {
  font-size: clamp(18px, 1.8vw, 22px);
  color: var(--text-soft);
  margin-top: var(--space-6);
  max-width: 64ch;
  line-height: 1.5;
}
.hero__actions {
  display: flex; flex-wrap: wrap; gap: var(--space-3);
  margin-top: var(--space-8);
}

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  height: 44px; padding: 0 18px;
  border-radius: var(--radius-md);
  font: 600 14px/1 var(--font-body); letter-spacing: 0.02em;
  cursor: pointer; transition: transform 0.12s, background 0.12s, color 0.12s, border-color 0.12s;
  text-decoration: none;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn-primary {
  background: var(--accent); color: #fff; border: 1px solid var(--accent);
}
.btn-primary:hover { background: var(--accent-strong); color: #fff; border-color: var(--accent-strong); }
.btn-ghost {
  background: transparent; color: var(--text); border: 1px solid var(--border-strong);
}
.btn-ghost:hover { background: var(--surface); color: var(--text); border-color: var(--text-soft); }
.btn-link {
  background: transparent; color: var(--accent); border: 0;
  padding: 0; height: auto; gap: 4px;
}
.btn-link:hover { color: var(--accent-strong); transform: none; }
.btn-link::after { content: "→"; transition: transform 0.12s; }
.btn-link:hover::after { transform: translateX(2px); }

/* ---------- Section headings ---------- */
.section-head {
  display: flex; align-items: baseline; justify-content: space-between;
  flex-wrap: wrap; gap: var(--space-3);
  margin-bottom: var(--space-8);
  padding-bottom: var(--space-4);
  border-bottom: 1px solid var(--border);
}
.section-head__title {
  font-size: clamp(22px, 2.4vw, 28px); font-weight: 700; margin: 0;
}
.section-head__eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-faint); margin: 0 0 4px;
}
.section-head__sub {
  font-size: 14px; color: var(--text-soft); max-width: 36ch; text-align: right; margin: 0;
}
@media (max-width: 640px) {
  .section-head { flex-direction: column; align-items: flex-start; }
  .section-head__sub { text-align: left; max-width: 100%; }
}

/* ---------- Cards ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: var(--space-6);
}
.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex; flex-direction: column;
  text-decoration: none; color: inherit;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.card:hover {
  text-decoration: none; color: inherit;
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.card__eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.16em; text-transform: uppercase;
  color: var(--accent); margin-bottom: var(--space-2);
}
.card__title {
  font-size: 18px; font-weight: 700; line-height: 1.25; margin-bottom: var(--space-2);
  letter-spacing: -0.005em;
}
.card__desc {
  font-size: 14px; color: var(--text-soft); line-height: 1.55;
  margin-bottom: var(--space-4);
}
.card__meta {
  margin-top: auto; padding-top: var(--space-4);
  font-size: 12px; color: var(--text-faint);
  display: flex; gap: var(--space-3); flex-wrap: wrap;
}
.card__meta span { display: inline-flex; align-items: center; gap: 5px; }
.card__meta .dot { width: 4px; height: 4px; border-radius: 50%; background: var(--border-strong); }

/* ---------- Prose (long-form content) ---------- */
.prose { max-width: 64ch; color: var(--text); }
.prose > * + * { margin-top: var(--space-4); }
.prose h2 { margin-top: var(--space-12); margin-bottom: var(--space-2); }
.prose h3 { margin-top: var(--space-8); margin-bottom: var(--space-2); }
.prose p { font-size: 17px; line-height: 1.65; color: var(--text); }
.prose ul, .prose ol { padding-left: 1.25em; }
.prose ul li, .prose ol li { font-size: 17px; line-height: 1.65; margin-top: var(--space-2); }
.prose strong { color: var(--text); font-weight: 700; }
.prose blockquote {
  border-left: 3px solid var(--accent);
  padding-left: var(--space-4);
  font-style: normal; color: var(--text-soft);
}

/* ---------- Footer ---------- */
.site-footer {
  margin-top: var(--space-24);
  border-top: 1px solid var(--border);
  background: var(--surface-soft);
}
.site-footer__inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: var(--space-12) var(--space-6);
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: var(--space-8);
}
@media (max-width: 720px) { .site-footer__inner { grid-template-columns: 1fr; } }
.site-footer h4 {
  font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-faint); margin: 0 0 var(--space-3);
}
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: var(--space-2); }
.site-footer a { color: var(--text-soft); }
.site-footer a:hover { color: var(--accent); }
.site-footer__bottom {
  border-top: 1px solid var(--border);
  padding: var(--space-4) var(--space-6);
  text-align: center;
  font-size: 12px; color: var(--text-faint);
}

/* ---------- Utility ---------- */
.text-soft { color: var(--text-soft); }
.text-faint { color: var(--text-faint); }
.eyebrow {
  font-size: 11px; font-weight: 700; letter-spacing: 0.18em; text-transform: uppercase;
  color: var(--text-faint);
}
.divider { height: 1px; background: var(--border); border: 0; margin: var(--space-8) 0; }

/* ---------- Testimonials ---------- */
.testimonial-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: var(--space-6);
}
.testimonial {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  padding: var(--space-6);
  display: flex; flex-direction: column;
}
.testimonial__quote {
  font-size: 15px; line-height: 1.55; color: var(--text);
  margin: 0 0 var(--space-6);
  position: relative;
}
.testimonial__quote::before {
  content: "“"; position: absolute; left: -8px; top: -22px;
  font-size: 48px; line-height: 1; color: var(--border-strong);
  font-family: Georgia, serif;
}
.testimonial__person {
  display: flex; align-items: center; gap: 12px;
  margin-top: auto;
  padding-top: var(--space-4);
  border-top: 1px solid var(--border);
}
.testimonial__avatar {
  position: relative;
  width: 40px; height: 40px; border-radius: 50%; flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: #fff;
  letter-spacing: 0.02em;
  text-decoration: none;
  overflow: hidden;
  transition: transform 0.15s, box-shadow 0.15s;
}
.testimonial__avatar:hover {
  transform: scale(1.06);
  box-shadow: 0 4px 14px rgba(20,18,14,0.18);
  text-decoration: none; color: #fff;
}
.testimonial__avatar img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
.testimonial__name {
  font-size: 14px; font-weight: 700; color: var(--text); line-height: 1.3;
}
.testimonial__role {
  font-size: 12px; color: var(--text-faint); line-height: 1.4;
  margin-top: 1px;
}

/* ---------- Pull quote (re-usable; About page used it too) ---------- */
.pullquote {
  background: var(--accent-soft);
  border: 1px solid #dbe5ff;
  border-radius: var(--radius-lg);
  padding: var(--space-8);
  margin: var(--space-12) 0;
}
.pullquote blockquote { margin: 0; font-size: 19px; line-height: 1.5; color: var(--accent-ink); border: 0; padding: 0; }
.pullquote__cite { display: block; margin-top: var(--space-4); font-size: 13px; color: var(--text-soft); }
.pullquote__cite strong { color: var(--text); }

/* ---------- Case study layout ---------- */
.casestudy h2 { margin-top: var(--space-12); margin-bottom: var(--space-4); }
.casestudy h3 { margin-top: var(--space-8); margin-bottom: var(--space-3); }
.casestudy .casestudy__meta {
  display: flex; flex-wrap: wrap; gap: var(--space-4) var(--space-6);
  margin: var(--space-6) 0 var(--space-10);
  padding: var(--space-4) 0;
  border-top: 1px solid var(--border);
  border-bottom: 1px solid var(--border);
  font-size: 13px;
}
.casestudy .casestudy__meta dt { color: var(--text-faint); font-weight: 600; letter-spacing: 0.06em; text-transform: uppercase; font-size: 11px; }
.casestudy .casestudy__meta dd { color: var(--text); margin: 4px 0 0; font-weight: 500; }
.casestudy .casestudy__meta > div { min-width: 140px; }
.casestudy .casestudy__pillars {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: var(--space-4);
  margin: var(--space-6) 0;
}
.casestudy .pillar {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  padding: var(--space-4);
}
.casestudy .pillar__title {
  font-size: 14px; font-weight: 700; color: var(--text); margin: 0 0 6px;
}
.casestudy .pillar__body {
  font-size: 13px; color: var(--text-soft); line-height: 1.5; margin: 0;
}

/* ---------- App carousel / grid (Nexstar CTV apps) ---------- */
.app-carousel-wrap { position: relative; }
.app-carousel {
  display: flex;
  gap: var(--space-4);
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 4px 4px var(--space-4);
  margin: 0 -4px;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}
.app-carousel::-webkit-scrollbar { height: 10px; }
.app-carousel::-webkit-scrollbar-track { background: transparent; }
.app-carousel::-webkit-scrollbar-thumb { background: var(--border-strong); border-radius: 4px; }
.app-carousel__controls {
  display: flex; gap: var(--space-3);
  margin-top: var(--space-4);
  align-items: center; justify-content: space-between;
  flex-wrap: wrap;
}
.app-carousel__scroll-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--surface);
  border: 1px solid var(--border-strong);
  color: var(--text);
  cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 18px;
  transition: background 0.12s, transform 0.12s, border-color 0.12s;
}
.app-carousel__scroll-btn:hover {
  background: var(--accent); color: #fff; border-color: var(--accent);
  transform: translateY(-1px);
}

.app-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: var(--space-4);
}

.app-card {
  flex: 0 0 240px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  display: flex;
  flex-direction: column;
  scroll-snap-align: start;
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}
.app-grid .app-card { flex: initial; scroll-snap-align: initial; }
.app-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md);
  border-color: var(--border-strong);
}
.app-card__main {
  text-decoration: none; color: inherit;
  display: flex; flex-direction: column;
}
.app-card__main:hover { text-decoration: none; color: inherit; }
.app-card__logo {
  width: 100%;
  aspect-ratio: 5/3;
  object-fit: cover;
  background: linear-gradient(135deg, var(--surface-soft), var(--accent-soft));
  display: block;
}
.app-card__logo--missing {
  display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 700; color: var(--accent-ink);
  background: var(--accent-soft);
}
.app-card__body { padding: 12px 14px 8px; }
.app-card__station {
  font-size: 13px; font-weight: 700; letter-spacing: 0.04em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 4px;
}
.app-card__name {
  font-size: 15px; font-weight: 700; color: var(--text);
  margin-bottom: 2px; line-height: 1.2;
}
.app-card__loc {
  font-size: 12px; color: var(--text-soft);
}
.app-card__platforms {
  display: flex; gap: 6px;
  padding: 0 14px 12px;
}
.app-card__platform {
  width: 26px; height: 26px;
  border-radius: 7px;
  background: var(--surface-soft);
  color: var(--text-soft);
  font-size: 11px; font-weight: 700;
  display: inline-flex; align-items: center; justify-content: center;
  text-decoration: none;
  transition: background 0.12s, color 0.12s;
}
.app-card__platform:hover {
  background: var(--accent); color: #fff;
  text-decoration: none;
}
.app-card__platform[aria-disabled="true"] {
  opacity: 0.35; pointer-events: none;
}

/* Reduce motion */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    transition-duration: 0.001ms !important;
  }
}
