:root {
  --ink: #16223a;
  --muted: #5d6b82;
  --accent: #1f6feb;
  --bg: #f7f9fc;
  --card: #ffffff;
  --line: #e3e9f2;
  --radius: 14px;
  --maxw: 1080px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  color: var(--ink);
  background: var(--bg);
  line-height: 1.6;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

.site-header {
  display: flex;
  align-items: center;
  gap: 1rem;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 1.1rem 1.25rem;
}
.brand { font-weight: 800; font-size: 1.15rem; color: var(--ink); }
.site-nav { display: flex; gap: 1rem; margin-left: auto; }
.sponsor-pill {
  margin-left: 1rem;
  font-size: 0.85rem;
  font-weight: 600;
  background: var(--ink);
  color: #fff;
  padding: 0.4rem 0.8rem;
  border-radius: 999px;
}
.sponsor-pill:hover { text-decoration: none; opacity: 0.9; }

.site-main { max-width: var(--maxw); margin: 0 auto; padding: 1rem 1.25rem 4rem; }

.hero { padding: 2.5rem 0; }
.eyebrow {
  text-transform: uppercase;
  letter-spacing: 0.08em;
  font-size: 0.8rem;
  font-weight: 700;
  color: var(--accent);
  margin: 0 0 0.5rem;
}
.hero h1 { font-size: clamp(2rem, 5vw, 3.2rem); line-height: 1.1; margin: 0 0 1rem; }
.lede { font-size: 1.2rem; color: var(--muted); max-width: 46ch; }

.pillars {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1rem;
  margin: 2.5rem 0;
}
.pillar {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.25rem;
}
.pillar h2 { margin: 0 0 0.4rem; font-size: 1.15rem; }
.pillar p { margin: 0; color: var(--muted); }

.sponsor-note { color: var(--muted); }

.site-footer {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 2rem 1.25rem 3rem;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 0.95rem;
}
.muted { color: var(--muted); }

/* ---- Header tools, switchers, buttons ---------------------------------- */
.header-tools { display: flex; align-items: center; gap: 0.6rem; margin-left: auto; }
.site-nav { margin-left: 1.25rem; }
.ghost-btn, .primary-btn, .link-btn {
  font-size: 0.9rem; font-weight: 600; border-radius: 8px; cursor: pointer;
  padding: 0.4rem 0.8rem; border: 1px solid var(--line); background: #fff; color: var(--ink);
}
.ghost-btn:hover { text-decoration: none; border-color: var(--accent); color: var(--accent); }
.primary-btn { background: var(--accent); color: #fff; border-color: var(--accent); }
.primary-btn:hover { text-decoration: none; opacity: 0.92; }
.link-btn { border: none; background: none; color: var(--muted); padding: 0 0.3rem; }

.switch { position: relative; }
.switch > summary {
  list-style: none; cursor: pointer; font-weight: 700; font-size: 0.85rem;
  padding: 0.35rem 0.6rem; border: 1px solid var(--line); border-radius: 8px; background: #fff;
}
.switch > summary::-webkit-details-marker { display: none; }
.switch ul {
  position: absolute; right: 0; margin: 0.3rem 0 0; padding: 0.4rem; list-style: none;
  background: #fff; border: 1px solid var(--line); border-radius: 10px; min-width: 180px;
  box-shadow: 0 8px 24px rgba(20,34,58,0.12); z-index: 20;
}
.switch ul a { display: block; padding: 0.35rem 0.5rem; border-radius: 6px; color: var(--ink); }
.switch ul a:hover { background: var(--bg); text-decoration: none; }
.switch ul a[aria-current] { color: var(--accent); font-weight: 700; }

/* ---- Messages ---------------------------------------------------------- */
.messages { max-width: var(--maxw); margin: 0.5rem auto 0; padding: 0 1.25rem; list-style: none; }
.msg { padding: 0.7rem 1rem; border-radius: 8px; margin-bottom: 0.5rem; }
.msg.success { background: #e7f6ec; color: #126b34; }
.msg.error { background: #fdeaea; color: #a11; }

/* ---- Cards / grids ----------------------------------------------------- */
.compact { padding: 1.5rem 0; }
.grid-section { margin: 2rem 0; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; }
.card-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 1rem; margin-top: 1rem; }
.card { display: block; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 1.1rem; color: inherit; }
.card:hover { text-decoration: none; border-color: var(--accent); }
.card h3 { margin: 0 0 0.4rem; }
.meta { font-size: 0.85rem; color: var(--muted); }
.tag { font-size: 0.7rem; font-weight: 700; background: var(--accent); color: #fff; padding: 0.1rem 0.45rem; border-radius: 999px; margin-left: 0.4rem; }

/* ---- Content / prose --------------------------------------------------- */
.narrow { max-width: 640px; }
.guide { max-width: 720px; }
.guide-head .lede { max-width: none; }
.guide-actions { display: flex; align-items: center; gap: 0.6rem; flex-wrap: wrap; margin: 1rem 0; }
.hero-img { width: 100%; border-radius: var(--radius); margin: 1rem 0; }
.prose { font-size: 1.06rem; }
.prose h2 { margin-top: 1.8rem; }
.prose img { max-width: 100%; border-radius: 8px; }
.embed { margin: 1rem 0; }
.embed iframe { max-width: 100%; }

/* ---- Lists ------------------------------------------------------------- */
.link-list { list-style: none; padding: 0; }
.link-list > li { padding: 0.6rem 0; border-bottom: 1px solid var(--line); }

/* ---- Forms ------------------------------------------------------------- */
.stack-form { display: flex; flex-direction: column; gap: 0.5rem; max-width: 480px; margin: 1.2rem 0; }
.stack-form label { font-weight: 600; font-size: 0.92rem; }
.stack-form input[type=email], .stack-form input[type=text], .stack-form textarea {
  padding: 0.6rem 0.7rem; border: 1px solid var(--line); border-radius: 8px; font-size: 1rem; font-family: inherit;
}
.stack-form .checkbox { font-weight: 400; display: flex; gap: 0.5rem; align-items: flex-start; }
.inline-form { display: inline; }
.small { font-size: 0.85rem; }
.sponsor-block { margin: 1.6rem 0; padding-bottom: 1rem; border-bottom: 1px solid var(--line); }
