:root {
  --bg: #f7f5f0;
  --bg-raised: #fffdf9;
  --text: #1c1a16;
  --text-muted: #6b6559;
  --border: #ddd7c9;
  --accent: #a3402b;
  --accent-soft: #c96a4e;
  --font-display: "Fraunces", Georgia, serif;
  --font-sans: "Work Sans", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  color-scheme: light dark;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #17150f;
    --bg-raised: #201d17;
    --text: #ede8dd;
    --text-muted: #a39d8d;
    --border: #38332a;
    --accent: #dd8567;
    --accent-soft: #c96a4e;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text);
  text-decoration-color: var(--border);
  text-underline-offset: 3px;
}
a:hover { color: var(--accent); }

.section-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
}

/* Hero */
.hero {
  border-bottom: 1px solid var(--border);
  padding: 72px 0 48px;
}

.hero-inner {
  max-width: 860px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  gap: 40px;
  align-items: flex-start;
}

.portrait-wrap {
  flex-shrink: 0;
}

.portrait {
  width: 152px;
  height: 152px;
  object-fit: cover;
  object-position: 50% 12%;
  border: 1px solid var(--border);
}

.hero-text h1 {
  font-family: var(--font-display);
  font-optical-sizing: auto;
  font-size: 2.75rem;
  font-weight: 600;
  margin: 0 0 4px;
  letter-spacing: -0.01em;
}

.tagline {
  font-family: var(--font-sans);
  font-weight: 500;
  font-size: 0.8rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--text-muted);
  margin: 0 0 20px;
}

.bio {
  font-size: 1.05rem;
  color: var(--text-muted);
  max-width: 56ch;
  margin: 0 0 20px;
}

.links {
  display: flex;
  flex-wrap: wrap;
  gap: 0;
  font-size: 0.9rem;
  font-weight: 500;
}

.pill {
  color: var(--text);
  padding: 0;
}
.pill:hover {
  color: var(--accent);
}
.pill:not(:last-child)::after {
  content: "\00B7";
  color: var(--border);
  margin: 0 10px;
  font-weight: 400;
}

/* Section heads (shared) */
.section-head {
  margin-bottom: 28px;
  padding-top: 4px;
  border-top: 2px solid var(--text);
}

.section-head h2 {
  font-family: var(--font-display);
  font-size: 1.6rem;
  font-weight: 600;
  margin: 10px 0 0;
}

.section-sub {
  color: var(--text-muted);
  font-size: 0.95rem;
  margin: 0;
  max-width: 60ch;
}

/* Recent Clips: row list */
.clips {
  padding: 48px 0 24px;
}

.clip-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.clip-card {
  display: flex;
  gap: 22px;
  align-items: flex-start;
  padding: 22px 0;
  border-bottom: 1px solid var(--border);
}

.clip-list li:last-child .clip-card { border-bottom: none; }

.clip-thumb {
  width: 100px;
  height: 100px;
  object-fit: cover;
  flex-shrink: 0;
  background: var(--border);
  filter: grayscale(35%);
}

.clip-body { min-width: 0; }

.clip-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.75rem;
  margin-bottom: 6px;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.clip-outlet {
  color: var(--accent);
  font-weight: 600;
}

.clip-date {
  color: var(--text-muted);
}

.clip-title {
  font-family: var(--font-display);
  font-size: 1.2rem;
  font-weight: 600;
  line-height: 1.3;
  margin: 0 0 6px;
}

.clip-title a { color: var(--text); text-decoration: none; }
.clip-title a:hover { color: var(--accent); }

.clip-desc {
  color: var(--text-muted);
  font-size: 0.93rem;
  margin: 0;
}

.clip-placeholder,
.clip-error {
  color: var(--text-muted);
  font-size: 0.95rem;
  padding: 12px 0;
}

/* Data & Charts */
.charts {
  padding: 24px 0 72px;
}

/* Wider than the rest of the page's text column: these charts render
   noticeably shorter the more horizontal room they get (Flourish embeds
   especially, since they don't reflow -- narrow width means wrapped
   labels and a taller forced aspect), so a wider column here directly
   trims how tall the tallest cards end up. */
.charts .section-inner {
  max-width: 1100px;
}

/* A masonry-style layout: two independent columns, each filling
   top-to-bottom by its own content height. Chart heights vary a lot (a
   compact map next to a tall multi-city line chart), and both CSS Grid's
   row-stretch and a full-width escape hatch for the tall ones fought that
   variety -- this just lets each column be whatever length its own
   charts need, no stretching or special-casing required. */
.chart-grid {
  list-style: none;
  margin: 0;
  padding: 0;
  column-count: 2;
  column-gap: 24px;
}

.chart-card {
  background: var(--bg-raised);
  border: 1px solid var(--border);
  padding: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  break-inside: avoid;
  margin-bottom: 24px;
}

.chart-frame-wrap {
  overflow: hidden;
  background: #ffffff;
  min-height: 260px;
  padding: 10px;
  border: 1px solid var(--border);
}

.chart-frame-wrap iframe {
  width: 100% !important;
  border: 0;
  display: block;
}

.chart-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.05em;
}

.chart-credit {
  color: var(--accent);
  font-weight: 600;
}

.chart-title {
  font-family: var(--font-display);
  font-size: 1.1rem;
  font-weight: 600;
  margin: 0;
  line-height: 1.3;
}

.chart-title a { color: var(--text); text-decoration: none; }
.chart-title a:hover { color: var(--accent); }

.chart-desc {
  color: var(--text-muted);
  font-size: 0.9rem;
  margin: 0;
}

/* Contact */
.contact {
  padding: 24px 0 72px;
}

/* Footer */
.site-footer {
  border-top: 1px solid var(--border);
  padding: 24px 0 48px;
  color: var(--text-muted);
  font-size: 0.85rem;
}

@media (max-width: 700px) {
  .chart-grid { column-count: 1; }
}

@media (max-width: 640px) {
  .hero { padding: 56px 0 40px; }
  .hero-inner { flex-direction: column; gap: 24px; }
  .hero-text h1 { font-size: 2.1rem; }
  .portrait { width: 112px; height: 112px; }
  .clip-card { gap: 16px; }
  .clip-thumb { width: 76px; height: 76px; }
}
