/* Meridian Briefings — design system */
:root {
  --radius: 14px;
  --max-width: 1100px;
  --max-prose: 760px;
}
:root[data-theme="dark"] {
  --bg: #18181b;
  --bg-elevated: #202023;
  --bg-sunken: #121214;
  --fg: #f4f4f5;
  --muted: #a1a1aa;
  --accent: #22d3ee;
  --accent-ink: #052e33;
  --border: #2e2e33;
  --shadow: 0 8px 24px rgba(0,0,0,0.35);
}
:root[data-theme="light"] {
  --bg: #fafafa;
  --bg-elevated: #ffffff;
  --bg-sunken: #f1f1f3;
  --fg: #18181b;
  --muted: #52525b;
  --accent: #0e7490;
  --accent-ink: #ffffff;
  --border: #e4e4e7;
  --shadow: 0 8px 24px rgba(0,0,0,0.08);
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
  transition: background .2s ease, color .2s ease;
}
a { color: inherit; text-decoration: none; }
.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--accent); color: var(--accent-ink);
  padding: .5rem 1rem; z-index: 100;
}
.skip-link:focus { left: 0; }

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--max-width); margin: 0 auto; padding: 0 1.25rem;
  height: 64px; display: flex; align-items: center; justify-content: space-between;
}
.brand { display: flex; align-items: center; gap: .5rem; font-weight: 800; font-size: 1.1rem; }
.nav-desktop { display: flex; align-items: center; gap: 1.5rem; }
.nav-desktop a { color: var(--muted); font-weight: 600; padding-bottom: 4px; border-bottom: 2px solid transparent; }
.nav-desktop a.active, .nav-desktop a:hover { color: var(--accent); border-bottom-color: var(--accent); }
.icon-btn {
  background: none; border: none; color: var(--muted); font-size: 1.1rem; cursor: pointer;
  padding: .25rem .4rem; border-radius: 8px;
}
.icon-btn:hover { color: var(--accent); background: var(--bg-elevated); }

.menu-toggle { display: none; flex-direction: column; gap: 4px; background: none; border: none; cursor: pointer; padding: 8px; }
.menu-toggle span { width: 22px; height: 2px; background: var(--fg); display: block; transition: .2s; }

@media (max-width: 720px) {
  .nav-desktop { display: none; }
  .menu-toggle { display: flex; }
}

/* Drawer */
.drawer-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.5); opacity: 0; pointer-events: none; transition: .2s; z-index: 49;
}
.drawer-overlay.open { opacity: 1; pointer-events: all; }
.drawer {
  position: fixed; top: 0; right: -280px; width: 260px; height: 100%; background: var(--bg-elevated);
  border-left: 1px solid var(--border); padding: 5rem 1.5rem 1.5rem; display: flex; flex-direction: column; gap: 1rem;
  transition: right .25s ease; z-index: 50;
}
.drawer.open { right: 0; }
.drawer a, .drawer button {
  background: none; border: none; text-align: left; font-size: 1rem; color: var(--fg); cursor: pointer; padding: .5rem 0;
}

/* Search overlay */
.search-overlay {
  position: fixed; inset: 0; background: rgba(0,0,0,0.6); display: none; align-items: flex-start; justify-content: center;
  padding-top: 10vh; z-index: 60;
}
.search-overlay.open { display: flex; }
.search-box {
  background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
  width: min(560px, 92vw); padding: 1rem; box-shadow: var(--shadow);
}
.search-box-row { display: flex; gap: .5rem; align-items: center; }
#search-input {
  flex: 1; background: var(--bg-sunken); border: 1px solid var(--border); color: var(--fg);
  padding: .7rem .9rem; border-radius: 10px; font-size: 1rem;
}
#search-results { margin-top: .75rem; display: flex; flex-direction: column; gap: .4rem; max-height: 50vh; overflow-y: auto; }
.search-result { display: flex; flex-direction: column; padding: .6rem .7rem; border-radius: 8px; }
.search-result:hover { background: var(--bg-sunken); }
.search-result span { color: var(--muted); font-size: .8rem; }
.search-empty { color: var(--muted); padding: .5rem; }

main { max-width: var(--max-width); margin: 0 auto; padding: 2.5rem 1.25rem 4rem; }

/* Hero */
.hero { padding: 1rem 0 2rem; }
.eyebrow { color: var(--accent); font-weight: 700; letter-spacing: .04em; font-size: .85rem; display: flex; align-items: center; gap: .4rem; }
.pulse-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); display: inline-block; animation: pulse 2s infinite; }
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: .35; } }
.hero h1 { font-size: 2.4rem; line-height: 1.15; margin: .5rem 0 .75rem; max-width: 820px; }
.hero-sub { color: var(--muted); font-size: 1.05rem; max-width: 620px; margin: 0 0 1rem; }
.card-meta { display: flex; align-items: center; gap: .5rem; color: var(--muted); font-size: .85rem; margin: .75rem 0; flex-wrap: wrap; }
.dot { opacity: .5; }
.badge {
  display: inline-flex; align-items: center; gap: .3rem; font-weight: 700; font-size: .72rem; letter-spacing: .03em;
  padding: .25rem .55rem; border-radius: 999px; background: color-mix(in srgb, var(--badge-color) 18%, transparent);
  color: var(--badge-color);
}
.btn {
  display: inline-block; background: var(--accent); color: var(--accent-ink); font-weight: 700;
  padding: .75rem 1.3rem; border-radius: 10px; margin-top: .5rem;
}
.btn:hover { filter: brightness(1.08); }

.hero-image { margin: 1.5rem 0 3rem; }
.hero-art {
  border-radius: var(--radius); aspect-ratio: 16/7; display: flex; align-items: center; justify-content: center;
  background: radial-gradient(circle at 30% 20%, color-mix(in srgb, var(--badge-color) 35%, var(--bg-sunken)), var(--bg-sunken) 70%);
  border: 1px solid var(--border);
}
.hero-art span { font-size: 4rem; filter: drop-shadow(0 4px 12px rgba(0,0,0,.3)); }
.hero-image-art { aspect-ratio: 21/9; }
.hero-image-art span { font-size: 5rem; }
.briefing-hero { margin: 1.5rem 0; aspect-ratio: 21/9; }

/* Section header + grid */
.section-header { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 1.25rem; }
.section-header h2 { margin: 0; }
.link-more { color: var(--accent); font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1.25rem; }
.card {
  display: block; background: var(--bg-elevated); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden; transition: transform .15s ease, box-shadow .15s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow); }
.card .hero-art { border-radius: 0; border: none; aspect-ratio: 16/9; }
.card .hero-art span { font-size: 2.8rem; }
.card-body { padding: 1rem 1.1rem 1.25rem; }
.card-title { font-size: 1.1rem; margin: .3rem 0 .4rem; line-height: 1.3; }
.card-excerpt { color: var(--muted); font-size: .92rem; margin: 0; }

/* Archive */
.page-header { padding: 1rem 0 1.5rem; }
.filter-row { display: flex; gap: .5rem; flex-wrap: wrap; margin-bottom: 1.5rem; }
.filter-chip {
  background: var(--bg-elevated); border: 1px solid var(--border); color: var(--muted);
  padding: .4rem .9rem; border-radius: 999px; cursor: pointer; font-size: .85rem; font-weight: 600;
}
.filter-chip.active, .filter-chip:hover { color: var(--accent); border-color: var(--accent); }
.archive-list { display: flex; flex-direction: column; gap: .75rem; }
.archive-row {
  display: flex; justify-content: space-between; gap: 1rem; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius); padding: 1rem 1.25rem; align-items: center;
}
.archive-row:hover { border-color: var(--accent); }
.archive-row-main h3 { margin: .3rem 0; font-size: 1.05rem; }
.archive-row-main p { margin: 0; color: var(--muted); font-size: .9rem; }
.archive-row-meta { text-align: right; color: var(--muted); font-size: .82rem; white-space: nowrap; display: flex; flex-direction: column; gap: .2rem; }
@media (max-width: 600px) {
  .archive-row { flex-direction: column; align-items: flex-start; }
  .archive-row-meta { text-align: left; flex-direction: row; gap: .75rem; }
}

/* Article */
.briefing { max-width: var(--max-prose); margin: 0 auto; }
.briefing h1 { font-size: 2rem; line-height: 1.2; margin: .5rem 0; }
.prose h2 { font-size: 1.3rem; margin-top: 2rem; }
.prose p { color: var(--fg); }
.prose ul { color: var(--fg); }
.tag-row { display: flex; gap: .5rem; flex-wrap: wrap; margin: 2rem 0 1.5rem; }
.tag { background: var(--bg-elevated); border: 1px solid var(--border); color: var(--muted); font-size: .8rem; padding: .25rem .65rem; border-radius: 999px; }

/* Footer */
.site-footer {
  border-top: 1px solid var(--border); padding: 2rem 1.25rem; text-align: center; color: var(--muted); font-size: .85rem;
}
.site-footer a { color: var(--accent); }
.site-footer p { margin: .3rem 0; }
