/* ==========================================================================
   AI at Work in IO — unified theme
   Load LAST on every page, after style.css, dark-mode.css, breadcrumb.css:
     <link rel="stylesheet" href="/css/theme.css">
   Selectors are prefixed with `body` where needed so they win over the
   per-page <style> blocks no matter where those sit in the document.
   ========================================================================== */

/* 1. Tokens ------------------------------------------------------------- */
/* html:root beats the :root block in style.css and the copy inlined on /stuff/ */
html:root {
  --bg: #0b0d10;
  --surface: #15181d;
  --surface-2: #1b1f26;
  --border: #262b33;
  --border-strong: #353c47;

  --text: #f2f4f7;
  --secondary: #b4bcc8;   /* body copy, excerpts */
  --tertiary: #8a93a0;    /* meta; still 4.5:1+ on --bg and --surface */

  --teal: #00d9a0;        /* primary accent (logo right half) */
  --teal-hover: #5cf0c6;
  --teal-ink: #06231a;    /* text on a teal fill */
  --teal-soft: rgb(0 217 160 / 0.12);
  --blue: #2f7cf6;        /* secondary accent (logo left half) */

  --note: #f0b84a;
  --note-bg: #17140c;
  --note-border: #4a3d1f;

  --radius: 12px;
  --radius-sm: 8px;
  --content: 780px;       /* reading width */
  --wide: 1120px;         /* grids, header */

  --font-heading: 'Space Grotesk', system-ui, -apple-system, sans-serif;
  --font-body: 'Inter', system-ui, -apple-system, sans-serif;
  --font-mono: 'IBM Plex Mono', ui-monospace, monospace;
}

/* 2. Base --------------------------------------------------------------- */
html body {
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-body);
}
body a { color: var(--text); }
body a:hover { color: var(--teal); }
body :focus-visible {
  outline: 2px solid var(--teal);
  outline-offset: 2px;
  border-radius: 4px;
}
body h1, body h2, body h3 {
  font-family: var(--font-heading);
  letter-spacing: -0.01em;
}
body .container-wide { max-width: var(--wide); padding: 0 24px; }
body .container { max-width: var(--content); padding: 0 24px; }

@media (prefers-reduced-motion: reduce) {
  body *, body *::before, body *::after { transition: none !important; }
}

/* 3. Header -------------------------------------------------------------
   style.css styles every <nav> as the sticky header, which also hits the
   breadcrumb <nav> — that is why the breadcrumb slid over the logo on
   scroll. The header gets the sticky treatment; the breadcrumb is reset
   in section 4. */
body nav:not(.breadcrumb) {
  position: sticky;
  top: 0;
  z-index: 20;
  padding: 0;
  background: rgb(11 13 16 / 0.92);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
}
body nav:not(.breadcrumb) > .container-wide {
  min-height: 72px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 4px 24px;
}
/* The logo PNG includes the wordmark, so it needs ~56px to stay legible */
body .nav-logo { height: 56px; width: auto; display: block; }
body .nav-brand { min-height: 44px; }

body .nav-links { display: flex; gap: 2px; }
body .nav-links a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 12px;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--secondary);
}
body .nav-links a:hover { color: var(--text); }
body .nav-links a[aria-current="page"] {
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--teal);
}

@media (max-width: 640px) {
  body nav:not(.breadcrumb) > .container-wide { padding: 0 16px; }
  body .nav-logo { height: 48px; }
  body .nav-links {
    width: 100%;
    margin: 0 -12px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  body .nav-links::-webkit-scrollbar { display: none; }
  body .nav-links a { white-space: nowrap; }
}

/* 4. Breadcrumb -------------------------------------------------------- */
body nav.breadcrumb {
  position: static;
  padding: 20px 0 0;
  background: none;
  border: 0;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  font: 400 0.8125rem/1.4 var(--font-body);
  color: var(--tertiary);
}
body .breadcrumb a { color: var(--tertiary); }
body .breadcrumb a:hover { color: var(--text); text-decoration: underline; }
body .breadcrumb .bc-sep { color: var(--border-strong); }
body .breadcrumb .bc-current { color: var(--secondary); }

/* 5. Page headers — one pattern everywhere ------------------------------
   eyebrow (mono, teal) → H1 (Space Grotesk) → one-line description     */
body .hero { padding: 36px 0 8px; }
body .hero-label,
body .episode-badge,
body .hm-badge,
body .nd-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--teal);
}
body .hero h1,
body .article-header h1,
body .podcast-hero h1,
body .episode-content h1 {
  font-family: var(--font-heading);
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: var(--text);
}
body .hero p,
body .podcast-hero p,
body .persp-tag {
  font-size: 1.0625rem;
  color: var(--secondary);
  max-width: 640px;
}
body .persp-tag { margin: 16px auto 32px; padding: 0 24px; text-align: center; }
body .article-header { padding: 36px 0 24px; }
body .article-header .meta { font-family: var(--font-mono); color: var(--tertiary); }

/* 6. Buttons ----------------------------------------------------------- */
body .btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 10px;
  font-weight: 500;
}
body .btn-blue { background: var(--teal); color: var(--teal-ink); }
body .btn-blue:hover { background: var(--teal-hover); color: var(--teal-ink); }
body .btn-ghost { border: 1px solid var(--border); color: var(--secondary); background: none; }
body .btn-ghost:hover { border-color: var(--teal); color: var(--text); background: none; }

/* 7. Shared surfaces --------------------------------------------------- */
body .featured,
body .archive-banner {
  background: var(--surface);
  border-color: var(--border);
  border-radius: var(--radius);
}
body .post-item { border-color: var(--border); }
body .post-item h3 { font-family: var(--font-heading); font-weight: 500; }
body .post-item:hover h3 { color: var(--teal); }
body .post-meta, body .section-label { color: var(--tertiary); }
body .tag { color: var(--teal); }

body .article-content,
body .episode-content p,
body .episode-content li { color: var(--secondary); }
body .article-content a,
body .episode-content a { color: var(--teal); }
body .article-content a:hover,
body .episode-content a:hover { color: var(--teal-hover); }
body .article-content blockquote,
body .episode-content blockquote { border-left-color: var(--teal); }
body .back-link:hover { color: var(--teal); }

/* 8. Podcasts page (/podcast/) ----------------------------------------- */
body .podcast-shows { max-width: var(--wide); padding: 8px 24px 72px; }

body .podcast-hero {
  display: block;
  margin: 36px 0 40px;
  text-align: left;
}
body .podcast-logo { display: none; }            /* purple emoji tile */
body .podcast-hero h1 { margin: 0 0 12px; }

body .podcast-show {
  margin: 0 0 48px;
  padding: 0 0 40px;
  border-bottom: 1px solid var(--border);
}
body .show-header { gap: 4px 12px; margin-bottom: 4px; }
body .show-title {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 600;
  color: var(--text);
}
body .show-title a:hover { color: var(--teal); }
body .show-title a[target="_blank"]::after {     /* marks the off-site link */
  content: " ↗";
  font-size: 0.8em;
  color: var(--tertiary);
}
body .show-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--tertiary);
  background: none;
  border: 0;
  padding: 0;
}
body .show-description {
  font-size: 0.94rem;
  color: var(--secondary);
  margin: 0 0 20px;
  max-width: 680px;
}

body .episodes-grid {
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 16px;
}
body .episode-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: none;
  transition: border-color 0.15s ease, transform 0.15s ease;
}
body .episode-card::after { display: none; }
body .episode-card:hover {
  border-color: var(--teal);
  transform: translateY(-1px);
  box-shadow: none;
}
body .episode-accent,
body .episode-accent-streams,
body .episode-accent-future { display: none; }   /* gradient top bars */
body .episode-arrow { display: none; }           /* whole card is the link */

body .episode-body { padding: 20px; gap: 10px; }
body .episode-date-badge {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.04em;
  text-transform: uppercase;
  color: var(--tertiary);
  background: none;
  padding: 0;
}
body .episode-title {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
}
body .episode-card:hover .episode-title { color: var(--teal-hover); }
body .episode-guest { font-size: 0.8125rem; color: var(--secondary); }
body .episode-description {
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--secondary);
  -webkit-line-clamp: 3;
}

body .archive-content .episode-card { opacity: 1; }  /* no dimmed cards */
body .archive-toggle {
  min-height: 44px;
  margin-top: 12px;
  border: 1px dashed var(--border-strong);
  border-radius: 10px;
  font-size: 0.875rem;
  color: var(--secondary);
}
body .archive-toggle:hover {
  background: none;
  border-color: var(--teal);
  color: var(--text);
}

/* 9. Episode pages (/podcast/<slug>/) ---------------------------------- */
body .episode-hero {
  background: none;
  color: var(--text);
  text-align: left;
  margin: 0;
  padding: 36px 0 0;
}
body .episode-hero-inner {
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 4px 20px;
}
body .episode-badge {
  flex-basis: 100%;
  background: none;
  border: 0;
  border-radius: 0;
  padding: 0;
  margin: 0 0 4px;
}
body .episode-badge a { color: var(--teal); }
body .episode-badge a:hover { color: var(--teal-hover); text-decoration: none; }
/* .episode-meta is also used inside podcast cards, so scope it to the hero */
body .episode-hero .episode-hosts,
body .episode-hero .episode-meta {
  margin: 0;
  opacity: 1;
  font-size: 0.875rem;
  color: var(--tertiary);
}
body .episode-content {
  max-width: var(--content);
  margin: 0 auto;
  padding: 0 24px 64px;
}
body .episode-content h1 { margin: 12px 0 8px; }
/* The episode title is an h2.episode-heading with a link — style it as the page title */
body .episode-content h2.episode-heading {
  font-family: var(--font-heading);
  font-size: clamp(1.75rem, 4vw, 2.5rem);
  font-weight: 600;
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 12px 0 8px;
  padding: 0;
  border: 0;
}
body .episode-heading a { color: var(--text); text-decoration: none; }
body .episode-heading a:hover { color: var(--teal); }
body .episode-guests { color: var(--secondary); opacity: 1; }

body .episode-section {
  margin: 0;
  border-bottom: 1px solid var(--border);
}
body .episode-section:first-of-type { margin-top: 32px; border-top: 1px solid var(--border); }
body .episode-section > summary { min-height: 56px; justify-content: space-between; }
body .episode-section > summary::before { display: none; }
body .episode-section > summary::after {
  content: "";
  width: 8px;
  height: 8px;
  border-right: 2px solid var(--tertiary);
  border-bottom: 2px solid var(--tertiary);
  transform: rotate(-45deg);
  transition: transform 0.15s;
  flex-shrink: 0;
  margin-right: 4px;
}
body .episode-section[open] > summary::after { transform: rotate(45deg); }
body .episode-section > summary h2,
body .episode-content .episode-section h2 {
  font-family: var(--font-heading);
  font-size: 1.375rem;
  font-weight: 600;
  margin: 0;
  padding: 0;
  border: 0;
  color: var(--text);
}
body .episode-section > summary:hover h2 { color: var(--teal); }
body .episode-section > ul { margin: 0 0 24px; }

/* 10. Home (/) --------------------------------------------------------- */
body .hm-wrap { max-width: var(--content); padding: 0 24px; }
body .hm-badge {
  display: inline;
  background: none;
  border: 0;
  padding: 0;
  font-size: 0.75rem;
}
body .hm-date { font-family: var(--font-mono); font-size: 0.75rem; color: var(--tertiary); }
body .hm-title { font-family: var(--font-heading); color: var(--text); }
body .hm-body > p,
body .hm-body li { color: var(--secondary); }
body .hm-body a { color: var(--teal); }

body .hm-body details > summary::before { color: var(--teal); }
body .hm-body details.sig {
  background: var(--surface);
  border-color: var(--border);
  border-radius: var(--radius);
}
body .hm-body details.sig > summary {
  font-family: var(--font-body);
  font-size: 1.0625rem;
  font-weight: 600;
  color: var(--text);
}
body .hm-body details.sig > summary:hover { color: var(--teal); text-decoration: none; }
body .hm-body details.wk-sec > summary { color: var(--text); }
body .hm-body details.wk-sec { border-left-color: var(--border); }
body .hm-more a,
body .hm-links a { color: var(--teal); }

/* 11. News (/daily/) --------------------------------------------------- */
body .nd-hero {
  background: none;
  color: var(--text);
  text-align: left;
  padding: 36px 0 0;
}
body .nd-hero-inner { max-width: var(--content); margin: 0 auto; padding: 0 24px; }
body .ds { max-width: var(--content); padding: 0 24px; }
body .nd-content { max-width: var(--content); margin: 0 auto; padding: 0 24px 64px; }
body .nd-badge {
  display: block;
  background: none;
  border: 0;
  padding: 0;
  margin: 0 0 4px;
}
body .nd-meta { opacity: 1; font-size: 0.875rem; color: var(--tertiary); }

body .ds-arrow,
body .ds-chip { background: var(--surface); border-color: var(--border); border-radius: 10px; }
body a.ds-chip:hover { border-color: var(--teal); }
body .ds-current { background: var(--teal-soft); border-color: var(--teal); }
body .ds-current .ds-dow,
body .ds-current .ds-mon { color: var(--teal); }
body .ds-flag { color: var(--note); }

body .nd-content p { color: var(--secondary); }
body .nd-content a { color: var(--teal); }
body .nd-content details.story { border-color: var(--border); }
body .nd-content details.story > summary::before { color: var(--teal); }
body .nd-content details.story > summary h2 {
  font-family: var(--font-body);
  font-size: 1.125rem;
  font-weight: 600;
  color: var(--text);
}
body .nd-content details.story > summary:hover h2 { color: var(--teal); text-decoration: none; }
body .nd-content details.story-scoring { background: var(--surface); border-color: var(--border); }

/* 12. Resources (/stuff/) ---------------------------------------------- */
/* The page inlines its own reset and :root; these bring it back in line. */
body > .container h1 {
  font-size: clamp(2rem, 4.5vw, 2.75rem);
  letter-spacing: -0.02em;
}
body .subtitle { color: var(--secondary); font-size: 1.0625rem; }
body .list a { color: var(--text); }
body .list a:hover { color: var(--teal); text-decoration: none; }
body .list .desc { color: var(--secondary); }
body .list .meta { color: var(--tertiary); }

/* 13. AI disclaimer — one component ------------------------------------ */
body .episode-disclaimer,
body .hm-body > p.hm-warn {
  margin: 40px 0 0;
  padding: 14px 16px;
  background: var(--note-bg);
  border: 1px solid var(--note-border);
  border-radius: 10px;
  font-family: var(--font-body);
  font-size: 0.875rem;
  line-height: 1.55;
  color: var(--secondary);
  opacity: 1;
}
body .episode-disclaimer em,
body .hm-body > p.hm-warn em { font-style: normal; color: var(--secondary); }
body .episode-content a.episode-warn,
body .episode-disclaimer a.episode-warn,
body .warn-link {
  font-family: var(--font-mono);
  font-size: 0.75rem;
  font-weight: 500;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--note);
  text-decoration: none;
}

/* 14. Footer ----------------------------------------------------------- */
body footer,
body .footer {
  border-top: 1px solid var(--border);
  padding: 32px 0 40px;
  font-family: var(--font-mono);
  font-size: 0.75rem;
  color: var(--tertiary);
}
