/* The Intelligence — design law: Playfair Display + DM Sans + DM Mono. */
/* White surfaces, soft warm tints, dark readable text. Never dark dominant. */

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

:root {
  --ink: #1a1a1a;
  --ink-mid: #444;
  --ink-soft: #666;
  --ink-mute: #999;
  --ink-faint: #bbb;
  --rule: #e2dfd8;
  --rule-light: #eeece8;
  --bg: #ffffff;
  --bg-warm: #faf9f6;
  --bg-tint: #f5f3ee;
  --accent: #1a1a1a;
  --green: #2d7a52;
  --amber: #b07a00;
  --red: #c0392b;
}

html { font-size: 16px; }
body { font-family: 'DM Sans', sans-serif; background: var(--bg); color: var(--ink); -webkit-font-smoothing: antialiased; line-height: 1.5; }

a { text-decoration: none; color: inherit; }
img { max-width: 100%; height: auto; display: block; }

.container { max-width: 1140px; margin: 0 auto; padding: 0 32px; }

/* ── TOPBAR ── */
.topbar {
  border-bottom: 0.5px solid var(--rule);
  padding: 12px 32px;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 16px;
  background: var(--bg);
  position: sticky;
  top: 0;
  z-index: 100;
}
.topbar-date { font-family: 'DM Mono', monospace; font-size: 10.5px; color: var(--ink-mute); letter-spacing: 0.04em; }
.topbar-brand { text-align: center; }
.topbar-eyebrow { font-size: 9px; letter-spacing: 0.22em; text-transform: uppercase; color: var(--ink-mute); font-weight: 500; display: block; margin-bottom: 2px; }
.topbar-name { font-family: 'Playfair Display', serif; font-size: 28px; font-weight: 700; color: var(--ink); line-height: 1; letter-spacing: -0.02em; }
.topbar-tagline { font-size: 10.5px; color: var(--ink-mute); max-width: 260px; text-align: right; line-height: 1.5; justify-self: end; }

/* ── NAV ── */
.nav-wrap { border-bottom: 0.5px solid var(--rule); background: var(--bg); overflow-x: auto; position: sticky; top: 60px; z-index: 90; }
.nav { display: flex; padding: 0 32px; max-width: 1140px; margin: 0 auto; }
.nav a {
  font-size: 11.5px; font-weight: 500; color: var(--ink-soft);
  padding: 11px 16px; white-space: nowrap; border-bottom: 2px solid transparent;
  transition: color 0.15s, border-color 0.15s; letter-spacing: 0.01em;
}
.nav a:hover { color: var(--ink); }
.nav a.active { color: var(--ink); border-bottom-color: var(--ink); }

/* ── HERO ── */
.hero {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  border-bottom: 0.5px solid var(--rule);
  min-height: 340px;
  cursor: pointer;
}
.hero-img { position: relative; overflow: hidden; background: var(--bg-tint); }
.hero-img img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.4s ease; }
.hero-img:hover img { transform: scale(1.02); }
.hero-img-placeholder { width: 100%; height: 340px; display: flex; align-items: center; justify-content: center; color: var(--ink-faint); font-style: italic; }
.hero-tag {
  position: absolute; top: 16px; left: 16px;
  background: rgba(255,255,255,0.94); font-size: 10px; font-weight: 600;
  letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink);
  padding: 4px 10px; border-radius: 2px;
}
.hero-content {
  padding: 36px 40px;
  display: flex; flex-direction: column; justify-content: space-between;
  border-left: 0.5px solid var(--rule);
}
.hero-label { font-size: 10px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-mute); font-weight: 500; margin-bottom: 14px; }
.hero-title {
  font-family: 'Playfair Display', serif; font-size: 32px; font-weight: 700;
  line-height: 1.22; color: var(--ink); margin-bottom: 16px; letter-spacing: -0.02em;
}
.hero:hover .hero-title { color: var(--ink-mid); }
.hero-desc { font-size: 14px; color: var(--ink-soft); line-height: 1.7; flex: 1; }
.hero-meta { font-size: 11px; color: var(--ink-faint); margin-top: 20px; }

/* ── SECTION HEADER ── */
.section-hd {
  display: flex; align-items: center; justify-content: space-between;
  padding: 20px 0 12px; border-bottom: 0.5px solid var(--rule);
}
.section-hd h2 { font-family: 'Playfair Display', serif; font-size: 16px; font-weight: 600; }
.section-hd a, .section-count { font-size: 11px; color: var(--ink-mute); letter-spacing: 0.04em; }
.section-hd a:hover { color: var(--ink); }

/* ── CARD GRID ── */
.cards { display: grid; grid-template-columns: repeat(3, 1fr); border-bottom: 0.5px solid var(--rule); }
.cards-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  border-top: 0.5px solid var(--rule);
  border-bottom: 0.5px solid var(--rule);
  max-width: 1140px;
  margin: 0 auto;
  padding: 0 32px;
}
.card {
  padding: 20px 24px; border-right: 0.5px solid var(--rule);
  cursor: pointer; transition: background 0.15s;
  display: block;
}
.cards .card:last-child, .cards-grid .card:last-child { border-right: none; }
.card:hover { background: var(--bg-warm); }
.card-tag { font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-mute); font-weight: 600; margin-bottom: 10px; }
.card-thumb {
  width: 100%; aspect-ratio: 16 / 9; object-fit: cover; border-radius: 3px;
  margin-bottom: 12px; background: var(--bg-tint);
}
.card-title { font-family: 'Playfair Display', serif; font-size: 15px; font-weight: 600; line-height: 1.35; color: var(--ink); margin-bottom: 8px; }
.card-desc { font-size: 12px; color: var(--ink-soft); line-height: 1.6; }
.card-meta { font-size: 10.5px; color: var(--ink-faint); margin-top: 12px; }

.empty-row { padding: 28px 32px; max-width: 1140px; margin: 0 auto; color: var(--ink-mute); font-size: 13px; }

/* ── ARTICLE PAGE ── */
.article-page { padding-top: 24px; }
.article-eyebrow { font-size: 11px; letter-spacing: 0.16em; text-transform: uppercase; color: var(--ink-mute); margin-bottom: 14px; }
.article-title { font-family: 'Playfair Display', serif; font-size: 38px; font-weight: 700; line-height: 1.18; letter-spacing: -0.02em; margin-bottom: 14px; max-width: 820px; }
.article-meta { font-size: 12px; color: var(--ink-faint); margin-bottom: 24px; }
.article-video-wrap { background: var(--bg-tint); padding: 24px 0; margin-bottom: 32px; }
.article-video { max-width: 1140px; margin: 0 auto; padding: 0 32px; aspect-ratio: 16 / 9; }
.article-video iframe { width: 100%; height: 100%; border: 0; border-radius: 4px; }

.article-two-col { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 48px; padding-bottom: 64px; }
.article-main { min-width: 0; }
.article-body { font-size: 16px; color: var(--ink); line-height: 1.7; max-width: 720px; }
.article-body h2 { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 600; margin: 32px 0 14px; letter-spacing: -0.01em; }
.article-body h3 { font-family: 'Playfair Display', serif; font-size: 17px; font-weight: 600; margin: 24px 0 10px; }
.article-body p { margin: 12px 0; }
.article-body ul, .article-body ol { margin: 12px 0 12px 24px; }
.article-body li { margin: 6px 0; }
.article-body strong { color: var(--ink); }
.article-body .related-reading {
  margin-top: 40px; padding: 20px 24px; background: var(--bg-warm); border-radius: 6px; border: 0.5px solid var(--rule);
}
.article-body .related-reading h3 { font-size: 13px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-mute); font-family: 'DM Sans', sans-serif; margin: 0 0 12px; }
.article-body .related-reading ul { list-style: none; margin: 0; padding: 0; }
.article-body .related-reading li { margin: 8px 0; }
.article-body .related-reading a { color: var(--ink); border-bottom: 1px solid var(--rule); padding-bottom: 1px; }
.article-body .related-reading a:hover { border-bottom-color: var(--ink); }

/* ── INLINE AD ── */
.inline-ad {
  display: block; margin: 36px 0; padding: 22px 24px;
  background: var(--bg-warm); border: 0.5px solid var(--rule); border-radius: 6px;
}
.inline-ad-eyebrow { font-size: 9.5px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--ink-mute); font-weight: 600; margin-bottom: 6px; }
.inline-ad-name { font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 600; margin-bottom: 4px; }
.inline-ad-geo { font-size: 12px; color: var(--ink-soft); margin-bottom: 12px; }
.inline-ad-cta { display: inline-block; padding: 9px 16px; background: var(--ink); color: #fff; border-radius: 4px; font-size: 13px; font-weight: 500; }
.inline-ad-cta:hover { opacity: 0.88; }
.inline-ad-fallback { background: var(--bg-tint); }

/* ── SIDEBAR AD ── */
.article-side { }
.sidebar-ad { padding: 24px; background: var(--bg-tint); border-radius: 6px; }
.sidebar-ad-eyebrow { font-size: 10px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--ink-mute); font-weight: 600; margin-bottom: 10px; }
.sidebar-ad-headline { font-family: 'Playfair Display', serif; font-size: 18px; font-weight: 600; line-height: 1.3; margin-bottom: 10px; }
.sidebar-ad-body { font-size: 12.5px; color: var(--ink-soft); line-height: 1.6; margin-bottom: 14px; }
.sidebar-ad-cta { display: inline-block; padding: 9px 14px; background: var(--ink); color: #fff; border-radius: 4px; font-size: 12.5px; font-weight: 500; }
.sidebar-ad-cta:hover { opacity: 0.88; }

/* ── PAA DRAWERS ── */
.paa-section { margin-top: 56px; padding-top: 28px; border-top: 0.5px solid var(--rule); }
.paa-heading { font-family: 'Playfair Display', serif; font-size: 22px; font-weight: 600; margin-bottom: 18px; }
.paa-drawer { border: 0.5px solid var(--rule); border-radius: 4px; margin-bottom: 10px; background: var(--bg); transition: background 0.15s; }
.paa-drawer[open] { background: var(--bg-warm); }
.paa-drawer summary { cursor: pointer; padding: 14px 18px; font-size: 14px; font-weight: 500; color: var(--ink); list-style: none; position: relative; padding-right: 36px; }
.paa-drawer summary::-webkit-details-marker { display: none; }
.paa-drawer summary::after { content: '+'; position: absolute; right: 18px; top: 12px; color: var(--ink-mute); font-size: 18px; font-weight: 300; }
.paa-drawer[open] summary::after { content: '−'; }
.paa-body { padding: 6px 18px 18px; }
.paa-prompt { font-size: 13px; color: var(--ink-soft); margin-bottom: 12px; }
.paa-cta {
  padding: 9px 16px; background: var(--ink); color: #fff; border: none; border-radius: 4px;
  font-family: 'DM Sans', sans-serif; font-size: 13px; font-weight: 500; cursor: pointer;
}
.paa-cta:hover { opacity: 0.88; }

/* ── SOFIA CHAT PANEL ── */
.sofia-panel {
  position: fixed; bottom: 0; right: 24px; width: 360px; max-width: calc(100% - 32px);
  background: var(--bg); border: 0.5px solid var(--rule); border-bottom: none;
  border-top-left-radius: 8px; border-top-right-radius: 8px; box-shadow: 0 -4px 20px rgba(0,0,0,0.06);
  display: flex; flex-direction: column; max-height: 70vh; z-index: 200;
}
.sofia-panel-hd { padding: 12px 16px; border-bottom: 0.5px solid var(--rule); display: flex; justify-content: space-between; align-items: center; }
.sofia-panel-title { font-family: 'Playfair Display', serif; font-size: 15px; font-weight: 600; }
.sofia-panel-close { background: transparent; border: none; font-size: 18px; color: var(--ink-mute); cursor: pointer; }
.sofia-panel-body { flex: 1; overflow-y: auto; padding: 12px 16px; }
.sofia-msg { padding: 9px 13px; border-radius: 10px; margin-bottom: 8px; font-size: 13.5px; line-height: 1.5; max-width: 88%; }
.sofia-msg.sofia { background: var(--bg-warm); color: var(--ink); }
.sofia-msg.user { background: var(--ink); color: #fff; margin-left: auto; }
.sofia-panel-input { display: flex; padding: 10px; border-top: 0.5px solid var(--rule); gap: 6px; }
.sofia-panel-input input { flex: 1; border: 0.5px solid var(--rule); border-radius: 4px; padding: 8px 10px; font-family: 'DM Sans', sans-serif; font-size: 13px; outline: none; }
.sofia-panel-input input:focus { border-color: var(--ink); }
.sofia-panel-input button { background: var(--ink); color: #fff; border: none; border-radius: 4px; padding: 0 14px; font-size: 13px; cursor: pointer; }

/* ── FOOTER ── */
.footer {
  padding: 24px 32px; border-top: 0.5px solid var(--rule);
  display: flex; justify-content: space-between; align-items: center;
  background: var(--bg); gap: 16px; flex-wrap: wrap;
}
.footer-left { font-size: 11px; color: var(--ink-mute); line-height: 1.6; }
.footer-right { display: flex; gap: 20px; }
.footer-right a { font-size: 11px; color: var(--ink-faint); transition: color 0.15s; }
.footer-right a:hover { color: var(--ink); }

/* ── 404 ── */
.notfound { padding: 80px 0; text-align: center; }
.notfound h1 { font-family: 'Playfair Display', serif; font-size: 36px; margin-bottom: 14px; }
.notfound p { color: var(--ink-soft); margin-bottom: 8px; }
.notfound a { color: var(--ink); border-bottom: 1px solid var(--rule); }

/* ── RESPONSIVE ── */
@media (max-width: 880px) {
  .topbar { grid-template-columns: 1fr; text-align: center; }
  .topbar-tagline { text-align: center; justify-self: center; max-width: 320px; }
  .topbar-date { text-align: center; }
  .hero { grid-template-columns: 1fr; min-height: auto; }
  .hero-content { border-left: none; border-top: 0.5px solid var(--rule); padding: 24px; }
  .hero-title { font-size: 26px; }
  .cards, .cards-grid { grid-template-columns: 1fr; }
  .cards .card, .cards-grid .card { border-right: none; border-bottom: 0.5px solid var(--rule); }
  .article-two-col { grid-template-columns: 1fr; gap: 32px; }
  .article-title { font-size: 28px; }
  .article-side { order: 2; }
  .sofia-panel { right: 0; width: 100%; border-radius: 0; }
}
