/* The Poliety: editorial design system.
   NYT-style typographic hierarchy, TechCrunch-green accent, no external assets. */

:root {
  --bg: #ffffff;
  --bg-alt: #f7f7f5;
  --ink: #121212;
  --muted: #56564f;
  --faint: #8a8a82;
  --hairline: #e2e2dc;
  --accent: #00794a;
  --accent-bright: #00a562;
  --serif: georgia, "iowan old style", "times new roman", times, serif;
  --sans: -apple-system, blinkmacsystemfont, "segoe ui", helvetica, arial, sans-serif;
  --mono: ui-monospace, sfmono-regular, consolas, "liberation mono", menlo, monospace;
  --measure: 42rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121413;
    --bg-alt: #191c1a;
    --ink: #e9e7e0;
    --muted: #a3a39a;
    --faint: #75756d;
    --hairline: #2b2e2c;
    --accent: #3ecf8e;
    --accent-bright: #3ecf8e;
  }
}

* { box-sizing: border-box; margin: 0; padding: 0; }

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

body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 1.0625rem;
  line-height: 1.55;
}

a { color: inherit; text-decoration: none; }
a:hover { color: var(--accent); }
a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.wrap { max-width: 75rem; margin: 0 auto; padding: 0 1.25rem; }

/* Top bar */
.topbar {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  padding: 0.6rem 0;
  font-family: var(--sans);
  font-size: 0.72rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--muted);
  border-bottom: 1px solid var(--hairline);
}
.topbar a:hover { color: var(--accent); }

/* Masthead */
.masthead { text-align: center; padding: 1.6rem 0 0.9rem; }
.masthead h1 a, .masthead .brand a { color: var(--ink); }
.brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2.4rem, 6vw, 4rem);
  letter-spacing: 0.01em;
  line-height: 1;
}
.brand .the { font-style: italic; font-weight: 400; margin-right: 0.35rem; }
.tagline {
  margin-top: 0.55rem;
  font-family: var(--sans);
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* Navigation */
.nav {
  border-top: 3px double var(--ink);
  border-bottom: 1px solid var(--ink);
  margin-top: 1rem;
}
.nav ul {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 0.25rem 1.9rem;
  padding: 0.55rem 0;
  font-family: var(--sans);
  font-size: 0.78rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.nav a.active { color: var(--accent); }

/* Section kickers and labels */
.kicker {
  font-family: var(--sans);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--accent);
}
.section-head {
  display: flex;
  align-items: baseline;
  gap: 0.75rem;
  border-bottom: 1px solid var(--ink);
  padding-bottom: 0.4rem;
  margin-bottom: 1.1rem;
}
.section-head h2 {
  font-family: var(--serif);
  font-size: 1.35rem;
  font-weight: 700;
}
.section-head .desc {
  font-family: var(--sans);
  font-size: 0.78rem;
  color: var(--muted);
}
.section-head .more {
  margin-left: auto;
  font-family: var(--sans);
  font-size: 0.72rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--accent);
  white-space: nowrap;
}

/* Front page grid */
.front { display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 2.2rem; padding: 1.8rem 0; }
@media (max-width: 54rem) { .front { grid-template-columns: 1fr; } }

.lead .kicker { margin-bottom: 0.4rem; }
.lead h2 {
  font-family: var(--serif);
  font-size: clamp(1.7rem, 3.6vw, 2.6rem);
  line-height: 1.12;
  font-weight: 700;
  margin-bottom: 0.7rem;
}
.lead .dek { font-size: 1.12rem; line-height: 1.5; color: var(--muted); margin-bottom: 0.8rem; }
.lead .body-preview { margin-bottom: 0.9rem; }
.byline { font-family: var(--sans); font-size: 0.75rem; color: var(--faint); letter-spacing: 0.02em; }
.byline b { color: var(--muted); font-weight: 600; }

.lead-secondaries { margin-top: 1.6rem; border-top: 1px solid var(--hairline); display: grid; grid-template-columns: 1fr 1fr; gap: 1.6rem; padding-top: 1.2rem; }
@media (max-width: 40rem) { .lead-secondaries { grid-template-columns: 1fr; } }
.lead-secondaries article h3 { font-size: 1.15rem; line-height: 1.25; margin: 0.3rem 0 0.45rem; }
.lead-secondaries article p { font-size: 0.95rem; color: var(--muted); margin-bottom: 0.4rem; }

/* Wire rail */
.wire { border-left: 1px solid var(--hairline); padding-left: 1.6rem; }
@media (max-width: 54rem) { .wire { border-left: 0; padding-left: 0; border-top: 1px solid var(--ink); padding-top: 1rem; } }
.wire h2 {
  font-family: var(--sans);
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 0.9rem;
}
.wire ol { list-style: none; }
.wire li { padding: 0.7rem 0; border-bottom: 1px solid var(--hairline); }
.wire li:last-child { border-bottom: 0; }
.wire .t { font-family: var(--serif); font-size: 0.98rem; line-height: 1.3; font-weight: 700; display: block; }
.wire .m { font-family: var(--sans); font-size: 0.7rem; color: var(--faint); margin-top: 0.25rem; display: block; }

/* Briefs band */
.briefs { border-top: 1px solid var(--ink); padding: 1.4rem 0 0.6rem; }
.briefs-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 1.8rem; }
@media (max-width: 54rem) { .briefs-grid { grid-template-columns: 1fr; } }
.brief h3 { font-size: 1.18rem; line-height: 1.25; margin: 0.35rem 0 0.5rem; }
.brief p { font-size: 0.95rem; color: var(--muted); margin-bottom: 0.45rem; }

/* Section bands on front page: multi-column flow packs unequal cards tightly */
.band { border-top: 1px solid var(--ink); padding: 1.4rem 0 0.4rem; }
.band-grid { columns: 3; column-gap: 1.8rem; }
@media (max-width: 54rem) { .band-grid { columns: 1; } }
.story { padding-bottom: 1.1rem; break-inside: avoid; }
.story h3 { font-size: 1.05rem; line-height: 1.3; margin-bottom: 0.35rem; }
.story p { font-size: 0.92rem; color: var(--muted); margin-bottom: 0.35rem; }
.story .m, .meta { font-family: var(--sans); font-size: 0.7rem; color: var(--faint); }

/* Open source radar */
.repo-list { list-style: none; }
.repo-list li { display: flex; gap: 0.9rem; align-items: baseline; padding: 0.55rem 0; border-bottom: 1px solid var(--hairline); }
.repo-list li:last-child { border-bottom: 0; }
.repo-name { font-family: var(--mono); font-size: 0.88rem; font-weight: 700; }
.repo-desc { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); flex: 1; min-width: 12rem; }
.repo-meta { font-family: var(--sans); font-size: 0.72rem; color: var(--faint); white-space: nowrap; }
.lang-dot { display: inline-block; width: 0.55em; height: 0.55em; border-radius: 50%; background: var(--accent-bright); margin-right: 0.3em; }

/* Article pages */
.article { max-width: var(--measure); margin: 0 auto; padding: 2.2rem 0 1rem; }
.article .kicker { margin-bottom: 0.5rem; }
.article h1 { font-size: clamp(1.8rem, 4vw, 2.5rem); line-height: 1.13; margin-bottom: 0.8rem; }
.article .dek { font-size: 1.15rem; color: var(--muted); line-height: 1.5; margin-bottom: 1rem; }
.article .byline { border-top: 1px solid var(--hairline); border-bottom: 1px solid var(--hairline); padding: 0.55rem 0; margin-bottom: 1.5rem; }
.article-body p { margin-bottom: 1.1rem; font-size: 1.1rem; line-height: 1.65; }
.article-body p:first-of-type::first-letter {
  font-size: 3.1em;
  line-height: 0.85;
  float: left;
  padding-right: 0.09em;
  font-weight: 700;
}
.sources { margin-top: 1.8rem; border-top: 3px double var(--ink); padding-top: 0.9rem; }
.sources h2 { font-family: var(--sans); font-size: 0.78rem; letter-spacing: 0.12em; text-transform: uppercase; margin-bottom: 0.6rem; }
.sources ul { list-style: none; }
.sources li { font-family: var(--sans); font-size: 0.88rem; padding: 0.25rem 0; }
.sources a { color: var(--accent); }
.sources a:hover { text-decoration: underline; }

/* Section index pages */
.listing { padding: 1.6rem 0; }
.listing .story { border-bottom: 1px solid var(--hairline); padding: 1rem 0; max-width: 52rem; }
.listing .story h3 { font-size: 1.2rem; }

/* Prose pages (about) */
.prose { max-width: var(--measure); margin: 0 auto; padding: 2.2rem 0; }
.prose h1 { font-size: 2rem; margin-bottom: 1rem; }
.prose h2 { font-size: 1.25rem; margin: 1.6rem 0 0.6rem; }
.prose p, .prose li { margin-bottom: 0.9rem; line-height: 1.65; }
.prose ul { padding-left: 1.2rem; }
.prose code { font-family: var(--mono); font-size: 0.88em; background: var(--bg-alt); padding: 0.1em 0.35em; border-radius: 3px; }

/* Footer */
.footer { border-top: 3px double var(--ink); margin-top: 2.5rem; padding: 1.6rem 0 2.4rem; }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 2rem; }
@media (max-width: 54rem) { .footer-grid { grid-template-columns: 1fr; } }
.footer h3 { font-family: var(--sans); font-size: 0.72rem; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); margin-bottom: 0.6rem; }
.footer p, .footer li { font-family: var(--sans); font-size: 0.85rem; color: var(--muted); line-height: 1.6; }
.footer ul { list-style: none; }
.footer a:hover { color: var(--accent); }
.footer .fineprint { margin-top: 1.4rem; padding-top: 0.9rem; border-top: 1px solid var(--hairline); font-size: 0.72rem; color: var(--faint); }

@media print {
  .topbar, .nav, .footer { display: none; }
  body { font-size: 11pt; }
}
