/* hmm.fyi newsroom. One file, system type, no JS framework. */

:root,
html[data-theme="light"] {
  --bg: #F5F5F5;
  --text: #202020;
  --muted: #6F6F6F;
  --muted-2: #707070;
  --accent: #1A6BF0;
  --focus: #1A6BF0;
  --accent-soft: #E8F0FE;
  --on-accent: #FFFFFF;
  --breaking: #FFB800;
  --on-break: #000000;
  --surface: #FFFFFF;
  --surface-hover: #EBEBEB;
  --line: #E4E4E4;
  --line-hover: #B4B4B4;
  --radius: 14px;
  --max: 800px;
  --measure: 62ch;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 130ms;
  --enter: 140ms;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text", system-ui, sans-serif;
  color-scheme: light;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121212;
    --text: #F3F3F3;
    --muted: #A3A3A3;
    --muted-2: #8A8A8A;
    --accent: #4B8EFF;
    --focus: #7AACFF;
    --accent-soft: #1A2740;
    --on-accent: #FFFFFF;
    --breaking: #FFB800;
    --on-break: #000000;
    --surface: #1C1C1C;
    --surface-hover: #323232;
    --line: #5C5C5C;
    --line-hover: #8A8A8A;
    color-scheme: dark;
  }
}

html[data-theme="dark"] {
  --bg: #121212;
  --text: #F3F3F3;
  --muted: #A3A3A3;
  --muted-2: #8A8A8A;
  --accent: #4B8EFF;
  --focus: #7AACFF;
  --accent-soft: #1A2740;
  --on-accent: #FFFFFF;
  --breaking: #FFB800;
  --on-break: #000000;
  --surface: #1C1C1C;
  --surface-hover: #323232;
  --line: #5C5C5C;
  --line-hover: #8A8A8A;
  color-scheme: dark;
}

* { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  background: var(--bg);
}

html, body {
  margin: 0;
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

body { overflow-x: hidden; }

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

a { color: inherit; text-decoration: none; }

a:focus-visible,
.card:focus-visible,
.theme-toggle:focus-visible,
.topic-select:focus-visible,
.topic-control button:focus-visible,
.break-toggle:focus-visible {
  outline: 2px solid var(--focus);
  outline-offset: 2px;
}

.topic-select:focus:not(:focus-visible),
.topic-control button:focus:not(:focus-visible) {
  outline: none;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding: 0 16px;
}

/* Chrome */

.site-sticky {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--bg);
}

.site-header {
  border-bottom: 1px solid var(--line);
  background: var(--bg);
}

.header-inner {
  display: grid;
  grid-template-columns: 1fr auto;
  align-items: center;
  column-gap: 16px;
  row-gap: 0;
  padding: 6px 16px 4px;
}

.wordmark {
  display: inline-flex;
  align-items: baseline;
  flex: 0 0 auto;
  line-height: 1;
  grid-column: 1;
  grid-row: 1;
}

.wordmark-hmm {
  font-size: 1.2rem;
  font-weight: 800;
  letter-spacing: -0.055em;
}

.wordmark-fyi {
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--muted-2);
  letter-spacing: -0.04em;
  transition: color var(--dur) var(--ease);
}

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

.beats {
  display: flex;
  flex-wrap: nowrap;
  gap: 0 18px;
  grid-column: 1 / -1;
  margin: 0;
  padding: 4px 4px 6px;
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
  scroll-padding: 4px;
  -webkit-overflow-scrolling: touch;
}

.beats::-webkit-scrollbar { display: none; }

.beats a {
  display: inline-flex;
  align-items: center;
  flex: 0 0 auto;
  min-height: 32px;
  padding: 2px 0;
  font-size: 0.82rem;
  font-weight: 600;
  color: var(--muted-2);
  letter-spacing: -0.01em;
  white-space: nowrap;
  box-shadow: inset 0 -2px 0 transparent;
  transition: color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.beats a:hover {
  color: var(--accent);
  box-shadow: inset 0 -2px 0 var(--accent);
}

.beats a.is-current {
  color: var(--text);
  font-weight: 700;
  box-shadow: inset 0 -2px 0 var(--text);
}

.theme-switch {
  display: flex;
  gap: 8px 10px;
  flex: 0 0 auto;
  justify-self: end;
  padding: 4px 2px;
  grid-column: 2;
  grid-row: 1;
}

.theme-toggle {
  appearance: none;
  margin: 0;
  padding: 2px 0;
  min-height: 32px;
  border: 0;
  background: none;
  font: inherit;
  font-size: 0.82rem;
  font-weight: 500;
  letter-spacing: -0.01em;
  color: var(--muted-2);
  cursor: pointer;
  white-space: nowrap;
  transition: color var(--dur) var(--ease);
}

.theme-toggle:hover { color: var(--text); }

.theme-toggle.is-current {
  color: var(--text);
  font-weight: 600;
}

/* Index scan path */

.hero {
  padding: 28px 0 0;
  animation: enter var(--enter) var(--ease) both;
}

.kicker {
  margin: 0 0 8px;
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--muted);
}

.hero h1,
.article-page h1 {
  margin: 0 0 12px;
  font-weight: 800;
  overflow-wrap: break-word;
}

.hero-hed {
  font-size: clamp(2rem, 4.2vw, 2.6rem);
  letter-spacing: -0.04em;
  line-height: 1.1;
  max-width: 11.2em;
  text-wrap: balance;
}

.beat-hed {
  font-size: clamp(1.85rem, 3.6vw, 2.25rem);
  letter-spacing: -0.035em;
  line-height: 1.1;
}

.lede {
  margin: 0;
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1.45;
  overflow-wrap: break-word;
}

/* Breaking */

.breaking-strip {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: flex-start;
  gap: 8px 12px;
  margin: 24px 0 0;
  padding: 16px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  animation: enter var(--enter) var(--ease) both;
}

.breaking-strip-label {
  flex: 0 0 auto;
  background: var(--breaking);
  color: var(--on-break);
  font-size: 0.72rem;
  font-weight: 800;
  font-stretch: condensed;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  padding: 4px 4px;
  border-radius: 14px;
}

.breaking-strip-items {
  display: grid;
  gap: 8px;
  flex: 0 1 auto;
  min-width: 0;
  max-width: 100%;
}

.breaking-strip-items a {
  font-weight: 700;
  letter-spacing: -0.03em;
  line-height: 1.25;
  overflow-wrap: break-word;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color var(--dur) var(--ease), text-decoration-color var(--dur) var(--ease);
}

.breaking-strip-items a:hover {
  color: var(--accent);
  text-decoration-color: var(--accent);
}

/* Filters */

.filters {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 16px 20px;
  margin: 16px 0 0;
  min-height: 36px;
  background: var(--bg);
  animation: enter var(--enter) var(--ease) both;
}

.topic-control {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0;
}

.topic-control label {
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted-2);
}

.topic-select,
.topic-control select {
  font: inherit;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  min-height: 36px;
  max-width: 16rem;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease);
}

.topic-select:hover,
.topic-select:active,
.topic-control select:hover,
.topic-control select:active {
  border-color: var(--line-hover);
}

.topic-control noscript { display: inline; }

.topic-control button {
  font: inherit;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 6px 10px;
  min-height: 36px;
  cursor: pointer;
  transition: border-color var(--dur) var(--ease);
}

.topic-control button:hover,
.topic-control button:active {
  border-color: var(--line-hover);
}

.break-toggle {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  padding: 4px 0;
  font-size: 0.86rem;
  font-weight: 600;
  color: var(--muted-2);
  letter-spacing: -0.01em;
  white-space: nowrap;
  box-shadow: inset 0 -2px 0 transparent;
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}

.break-toggle:hover {
  color: var(--text);
  box-shadow: inset 0 -2px 0 var(--text);
}

.break-toggle.is-on {
  background: var(--breaking);
  color: var(--on-break);
  font-weight: 700;
  letter-spacing: -0.05em;
  padding: 4px 10px;
  border-radius: 999px;
  box-shadow: none;
}

.break-toggle.is-on:hover {
  color: var(--on-break);
  box-shadow: inset 0 0 0 1px var(--on-break);
}

/* Cards */

.feed { margin: 20px 0 64px; }

.cards { display: grid; gap: 12px; }

.card,
.article-page {
  display: block;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}

.card {
  padding: 18px 22px 20px;
  transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  animation: enter var(--enter) var(--ease) both;
}

.card:hover {
  background: var(--surface-hover);
  border-color: var(--line-hover);
  box-shadow: inset 4px 0 0 var(--accent);
}

.card h2 {
  margin: 0 0 6px;
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.15;
  overflow-wrap: break-word;
  transition: color var(--dur) var(--ease);
}

.card:hover h2 { color: var(--accent); }

.summary {
  margin: 0;
  color: var(--muted);
  font-size: 0.95rem;
  line-height: 1.4;
  overflow-wrap: break-word;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}

.empty-card {
  padding: 28px 2px 8px;
  text-align: left;
  color: var(--muted);
  animation: enter var(--enter) var(--ease) both;
}

.empty-card strong {
  display: block;
  margin-bottom: 6px;
  color: var(--text);
  font-size: 1.05rem;
  font-weight: 600;
  letter-spacing: -0.02em;
}

.empty-card p {
  margin: 0;
  font-size: 0.95rem;
  color: var(--muted);
}

.meta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: center;
  margin-bottom: 12px;
  color: var(--muted-2);
  font-size: 0.72rem;
}

.meta-row time {
  color: var(--muted-2);
  font-weight: 500;
}

.breaking-badge {
  display: inline-flex;
  align-items: center;
  background: var(--breaking);
  color: var(--on-break);
  font-size: 0.7rem;
  font-weight: 800;
  font-stretch: condensed;
  letter-spacing: -0.05em;
  text-transform: uppercase;
  padding: 4px 4px;
  border-radius: 14px;
}

.project-tag {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 700;
  font-size: 0.72rem;
  padding: 3px 7px;
  border-radius: 999px;
  transition: color var(--dur) var(--ease), background-color var(--dur) var(--ease);
}

a.project-tag:hover {
  background: var(--accent);
  color: var(--on-accent);
}

/* Article */

.article-page {
  margin: 32px 0 64px;
  padding: 32px 32px 36px;
  animation: enter var(--enter) var(--ease) both;
}

.article-page .meta-row { margin-bottom: 14px; }

.article-page h1 {
  margin: 0 0 22px;
  font-size: clamp(1.7rem, 3.6vw, 2.15rem);
  letter-spacing: -0.035em;
  line-height: 1.15;
}

.brief .dek {
  font-size: 1.2rem;
  line-height: 1.4;
  max-width: var(--measure);
}

.brief .kicker { margin-bottom: 10px; }
.brief .dek p { margin: 0 0 0.8em; }
.brief .dek p:last-child { margin-bottom: 0; }

.back {
  display: inline-flex;
  align-items: center;
  min-height: 36px;
  margin-bottom: 12px;
  color: var(--accent);
  font-weight: 600;
  font-size: 0.92rem;
  text-decoration: underline;
  text-decoration-color: transparent;
  text-underline-offset: 3px;
  transition: color var(--dur) var(--ease), text-decoration-color var(--dur) var(--ease);
}

.back:hover { text-decoration-color: var(--accent); }

.body {
  font-size: 1.14rem;
  line-height: 1.4;
  color: var(--text);
  max-width: var(--measure);
}

/* Dark reading type: light-on-dark optically thins, so open tracking and leading. */
html[data-theme="dark"] .body,
html[data-theme="dark"] .brief .dek,
html[data-theme="dark"] .summary {
  letter-spacing: 0.01em;
  line-height: 1.6;
}

@media (prefers-color-scheme: dark) {
  html:not([data-theme="light"]) .body,
  html:not([data-theme="light"]) .brief .dek,
  html:not([data-theme="light"]) .summary {
    letter-spacing: 0.01em;
    line-height: 1.6;
  }
}

.body p { margin: 0 0 1.1em; }
.body p:last-child { margin-bottom: 0; }

.brief a,
.body a,
.notes a {
  color: inherit;
  font-weight: 500;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  overflow-wrap: anywhere;
  transition: text-decoration-color var(--dur) var(--ease);
}

.brief a:hover,
.body a:hover,
.notes a:hover {
  text-decoration-color: var(--accent);
}

.sources a,
.source-link {
  color: var(--accent);
  font-weight: 600;
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  transition: color var(--dur) var(--ease);
}

.sources a:hover,
.source-link:hover {
  color: var(--text);
}

.commit {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 10px;
  margin: 36px 0 0;
  color: var(--muted);
  font-size: 0.9rem;
  font-weight: 500;
  line-height: 1.55;
}

.commit-label {
  color: var(--muted-2);
  font-size: 0.72rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.commit code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.86em;
  color: var(--text);
  background: transparent;
  padding: 0;
  overflow-wrap: anywhere;
  text-decoration: none;
}

.notes {
  margin-top: 28px;
  padding-top: 48px;
  border-top: 1px solid var(--line);
  max-width: var(--measure);
}

.notes .kicker { margin-bottom: 14px; }

.sources {
  margin-top: 48px;
  padding-top: 28px;
  border-top: 1px solid var(--line);
  max-width: var(--measure);
}

.sources .kicker { margin-bottom: 16px; }

.sources ul { margin: 0; padding: 0; list-style: none; display: grid; gap: 14px; }
.sources a { overflow-wrap: anywhere; }

/* Footer */

.site-footer { border-top: 1px solid var(--line); }

.footer-inner { padding: 48px 16px 64px; }

.site-footer p {
  margin: 0;
  font-size: 0.8rem;
  font-weight: 500;
  color: var(--muted-2);
}

/* Motion */

@keyframes enter {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

html.snap .hero,
html.snap .breaking-strip,
html.snap .filters,
html.snap .card,
html.snap .empty-card,
html.snap .article-page {
  animation: none;
}

@media (prefers-reduced-motion: reduce) {
  .hero,
  .breaking-strip,
  .filters,
  .card,
  .empty-card,
  .article-page {
    animation: none;
  }

  .card {
    transition: background-color var(--dur) var(--ease), border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
  }
}

@media (max-width: 640px) {
  .header-inner {
    padding: 6px 16px 2px;
    column-gap: 12px;
  }

  .beats { gap: 0 14px; }

  .beats a {
    min-height: 30px;
    font-size: 0.8rem;
  }

  .theme-toggle {
    min-height: 30px;
    font-size: 0.82rem;
  }

  .breaking-strip {
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    margin-top: 16px;
    padding: 12px;
  }

  .hero { padding-top: 16px; }

  .hero .kicker { margin-bottom: 4px; }

  .hero h1 { margin-bottom: 8px; }

  .lede { font-size: 1rem; }

  .filters {
    margin-top: 12px;
    gap: 12px 16px;
  }

  .topic-select,
  .topic-control select {
    max-width: 11rem;
    min-height: 32px;
    padding: 4px 8px;
  }

  .break-toggle { min-height: 32px; }

  .feed { margin: 16px 0 48px; }

  .card { padding: 16px 16px 18px; }

  .empty-card { padding: 20px 2px 4px; }

  .article-page { padding: 20px 16px 28px; }

  .notes { padding-top: 40px; }
}
