/* Hacking the Think Tank — Civic Signal design system */

:root {
  --ink: #0A0B12;
  --cobalt: #1F3CE0;
  --cobalt-deep: #1226A8;
  --cobalt-bright: #2440E6;
  --amber: #FFC42E;
  --vermilion: #E1391A;
  --white: #FFFFFF;
  --surface: #F3F6FD;
  --rule: #D5DCEC;
  --body: #2A3046;
  --muted: #5A6275;
  --nav-muted: #4A5168;
  --pad: clamp(20px, 5vw, 80px);
  --maxw: 1280px;
  --font: "Public Sans", system-ui, -apple-system, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; background: var(--ink); }
body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--white);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}
main { flex: 1 0 auto; }
.footer { flex-shrink: 0; }
img { max-width: 100%; display: block; }
a { color: inherit; }

.wrap { max-width: var(--maxw); margin-inline: auto; }

/* ---------- Buttons ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--amber); color: var(--ink);
  font-weight: 700; text-decoration: none; border: 0; cursor: pointer;
  transition: filter .15s ease, transform .15s ease;
}
.btn:hover { filter: brightness(0.94); }
.btn:active { transform: translateY(1px); }
.btn-nav { height: 40px; padding: 0 18px; font-size: 14px; }
.btn-lg { height: 52px; padding: 0 32px; font-size: 16px; }
.btn-cta { height: 60px; padding: 0 40px; font-size: 18px; }

/* ---------- Nav ---------- */
.nav { position: sticky; top: 0; z-index: 100; background: var(--white); border-bottom: 1px solid var(--rule); }
.nav-inner { position: relative; display: flex; align-items: center; justify-content: space-between; max-width: var(--maxw); margin-inline: auto; padding: 0 var(--pad); min-height: 72px; }
.wordmark { display: flex; align-items: center; gap: 12px; font-weight: 800; font-size: 16px; letter-spacing: -0.01em; color: var(--ink); text-decoration: none; }
.wordmark .mark { width: 14px; height: 14px; background: var(--cobalt); flex: 0 0 auto; }
.nav-links { display: flex; align-items: center; gap: 6px; }
.nav-links a:not(.btn) { font-weight: 500; font-size: 14px; color: var(--nav-muted); text-decoration: none; padding: 11px 12px; line-height: 1; border-radius: 4px; }
.nav-links a:not(.btn):hover { color: var(--ink); }
.nav-links a[aria-current="page"] { color: var(--ink); font-weight: 600; }
.nav-toggle { display: none; align-items: center; justify-content: center; width: 44px; height: 44px; margin-right: -10px; background: none; border: 0; cursor: pointer; }
.nav-toggle .bars { display: block; width: 22px; height: 16px; position: relative; }
.nav-toggle .bars::before, .nav-toggle .bars::after, .nav-toggle .bars span { content: ""; position: absolute; left: 0; right: 0; height: 2px; background: var(--ink); }
.nav-toggle .bars::before { top: 0; } .nav-toggle .bars span { top: 7px; } .nav-toggle .bars::after { bottom: 0; }

/* ---------- Hero ---------- */
.hero { background: linear-gradient(135deg, var(--cobalt-deep) 0%, var(--cobalt-bright) 100%); color: var(--white); overflow: hidden; padding-inline: var(--pad); }
.hero-inner { max-width: var(--maxw); margin-inline: auto; padding-block: clamp(48px, 7vw, 88px) clamp(40px, 5vw, 56px); }
.hero-top { display: flex; align-items: center; justify-content: space-between; gap: 56px; }
.hero-copy { flex: 1 1 auto; min-width: 0; }
.hero-art { flex: 0 0 auto; width: min(400px, 32vw); }
.host-logos { display: flex; align-items: center; gap: 28px; margin-bottom: 30px; }
.host-logos a { display: inline-flex; align-items: center; }
.host-logos img { height: 34px; width: auto; }
.host-logos .sep { width: 1px; height: 26px; background: rgba(255,255,255,0.32); }
.headline { font-weight: 900; font-size: clamp(44px, 6.4vw, 88px); line-height: 0.94; letter-spacing: -0.03em; margin: 0; }
.headline span { display: block; }
.headline .accent { color: var(--amber); }
.hero-sub { font-size: clamp(17px, 2vw, 20px); line-height: 1.55; color: rgba(255,255,255,0.85); max-width: 600px; margin: 28px 0 0; }
.hero-actions { display: flex; align-items: center; gap: 24px; flex-wrap: wrap; margin-top: 36px; }
.link-ghost { color: var(--white); font-weight: 600; font-size: 16px; text-decoration: none; }
.link-ghost:hover { text-decoration: underline; }
.hero-meta { display: flex; flex-wrap: wrap; gap: 28px 32px; margin-top: clamp(36px, 4vw, 56px); border-top: 1px solid rgba(255,255,255,0.22); padding-top: 28px; }
.meta-item { display: flex; flex-direction: column; gap: 8px; }
.meta-item + .meta-item { border-left: 1px solid rgba(255,255,255,0.22); padding-left: 32px; }
.meta-label { font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: rgba(255,255,255,0.6); }
.meta-value { font-weight: 700; font-size: 18px; }

/* ---------- Light page hero (Projects) ---------- */
.page-hero { padding: clamp(56px, 7vw, 80px) var(--pad) clamp(40px, 5vw, 56px); border-bottom: 1px solid var(--rule); }
.page-hero .inner { max-width: var(--maxw); margin-inline: auto; }
.headline-dark { font-weight: 900; font-size: clamp(44px, 8vw, 84px); line-height: 0.96; letter-spacing: -0.03em; margin: 0; color: var(--ink); }
.headline-dark .accent { color: var(--vermilion); }
.page-hero .sub { font-size: clamp(17px, 2vw, 20px); line-height: 1.55; color: var(--body); max-width: 620px; margin: 26px 0 0; }
.page-hero .host-logos { animation: none; }

/* ---------- Sections ---------- */
.section { padding: clamp(64px, 8vw, 96px) var(--pad); }
.section.tinted { background: var(--surface); }
.h2 { font-weight: 800; font-size: clamp(30px, 4vw, 40px); line-height: 1.1; letter-spacing: -0.02em; margin: 0; color: var(--ink); }

.split { display: grid; grid-template-columns: 460px 1fr; gap: 80px; max-width: var(--maxw); margin-inline: auto; }
.split .lede { display: flex; flex-direction: column; gap: 20px; }
.accent-bar { width: 56px; height: 5px; background: var(--vermilion); }
.prose p { font-size: 19px; line-height: 1.58; color: var(--body); margin: 0 0 22px; max-width: 640px; }
.prose p:last-child { margin-bottom: 0; }
.prose a { color: var(--cobalt); text-decoration: underline; text-underline-offset: 0.15em; text-decoration-thickness: 1.5px; }
.prose a:hover { text-decoration: none; }

/* ---------- Plan steps ---------- */
.steps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 40px; max-width: var(--maxw); margin-inline: auto; }
.section .h2 + .steps, .section .h2 + .team, .section .h2 + .cols { margin-top: 48px; }
.step { border-top: 3px solid var(--cobalt); padding-top: 24px; }
.step.alt { border-top-color: var(--vermilion); }
.step-head { display: flex; align-items: baseline; gap: 14px; }
.step-num { font-weight: 900; font-size: 44px; line-height: 1; letter-spacing: -0.03em; color: var(--cobalt); }
.step.alt .step-num { color: var(--vermilion); }
.step-when { font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: 0.04em; text-transform: uppercase; color: var(--muted); }
.step-title { font-weight: 700; font-size: 22px; margin: 14px 0 8px; }
.step-body { font-size: 16px; line-height: 1.55; color: var(--body); margin: 0; }

/* ---------- Team ---------- */
.team { display: grid; grid-template-columns: repeat(2, 1fr); gap: 52px 56px; max-width: var(--maxw); margin-inline: auto; }
.member { border-top: 1px solid var(--rule); padding-top: 24px; }
.member h3 { font-weight: 700; font-size: 24px; letter-spacing: -0.01em; margin: 0 0 12px; }
.member-tags { display: flex; gap: 16px; margin-bottom: 12px; }
.member-tags a { font-family: var(--mono); font-weight: 500; font-size: 12px; letter-spacing: 0.06em; color: var(--cobalt); text-decoration: none; }
.member-tags a:hover { text-decoration: underline; }
.member .first, .member .rest { font-size: 15px; line-height: 1.6; color: var(--body); margin: 0; }
.member details { margin-top: 0; }
.member details .rest { margin-top: 14px; }
.member summary { display: inline-flex; align-items: center; gap: 4px; margin-top: 10px; font-weight: 600; font-size: 14px; color: var(--cobalt); cursor: pointer; list-style: none; }
.member summary::-webkit-details-marker { display: none; }
.member summary .less { display: none; }
.member details[open] summary .more { display: none; }
.member details[open] summary .less { display: inline; }

/* Odd-count filler: shown only when there's an odd number of members (desktop) */
.member.placeholder { display: none; }
.team.is-odd .member.placeholder { display: flex; align-items: center; justify-content: center; }
.member.placeholder .ph-shapes { display: flex; align-items: center; gap: 20px; }
.member.placeholder .sh { display: block; flex: 0 0 auto; }
.member.placeholder .sq-cobalt { width: 23px; height: 23px; background: var(--cobalt); }
.member.placeholder .c-amber { width: 27px; height: 27px; border-radius: 50%; background: var(--amber); }
.member.placeholder .t-vermilion { width: 0; height: 0; border-left: 15px solid transparent; border-right: 15px solid transparent; border-bottom: 26px solid var(--vermilion); }

/* ---------- Build index (projects) ---------- */
.index { max-width: var(--maxw); margin-inline: auto; }
.row { display: grid; grid-template-columns: 84px 1fr auto; align-items: center; gap: 32px; padding: 32px 0; border-top: 1px solid var(--rule); text-decoration: none; color: inherit; }
.row:last-child { border-bottom: 1px solid var(--rule); }
.row-num { font-weight: 900; font-size: 44px; line-height: 1; letter-spacing: -0.03em; color: var(--cobalt); }
.row.alt .row-num { color: var(--vermilion); }
.row-title { display: block; font-weight: 700; font-size: 24px; letter-spacing: -0.01em; margin: 0; }
.row-author { display: block; font-family: var(--mono); font-weight: 500; font-size: 13px; letter-spacing: 0.03em; color: var(--muted); margin: 5px 0 0; }
.row-link { font-family: var(--mono); font-weight: 500; font-size: 13px; letter-spacing: 0.03em; color: var(--cobalt); white-space: nowrap; }
.row:hover .row-title { text-decoration: underline; }
.row:hover .row-link { text-decoration: underline; }

/* ---------- Apply columns ---------- */
.cols { display: grid; grid-template-columns: repeat(2, 1fr); gap: 48px; max-width: var(--maxw); margin-inline: auto; }
.col .bar { width: 48px; height: 5px; background: var(--cobalt); margin-bottom: 16px; }
.col.v .bar { background: var(--vermilion); }
.col h3 { font-weight: 700; font-size: 19px; margin: 0 0 16px; }
.col p { font-size: 16px; line-height: 1.55; color: var(--body); margin: 0; }

/* ---------- CTA band ---------- */
.cta { background: var(--cobalt); color: var(--white); padding: clamp(48px, 6vw, 64px) var(--pad); }
.cta-inner { max-width: var(--maxw); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 40px; flex-wrap: wrap; }
.cta h2 { font-weight: 900; font-size: clamp(32px, 5vw, 48px); line-height: 1; letter-spacing: -0.03em; margin: 0; color: var(--white); }
.cta p { margin: 12px 0 0; font-size: 18px; color: rgba(255,255,255,0.8); }

/* ---------- Footer ---------- */
.footer { background: var(--ink); color: var(--white); padding: 40px var(--pad); }
.footer-inner { max-width: var(--maxw); margin-inline: auto; display: flex; align-items: center; justify-content: space-between; gap: 24px 32px; flex-wrap: wrap; }
.footer .wordmark { color: var(--white); }
.footer .wordmark .mark { background: var(--amber); }
.footer-logos { display: flex; align-items: center; gap: 22px; }
.footer-logos a { display: inline-flex; align-items: center; }
.footer-logos img { height: 25px; width: auto; }
.footer-logos .sep { width: 1px; height: 18px; background: rgba(255,255,255,0.28); }

/* ---------- Motion (hero load only; content is always visible by default) ---------- */
/* Transform-only so content is NEVER hidden if animations don't play (crawlers, headless, reduced-motion) */
@keyframes rise { from { transform: translateY(18px); } to { transform: none; } }
.hero-copy > * { animation: rise 0.6s cubic-bezier(0.22, 1, 0.36, 1) both; }
.hero-copy > *:nth-child(2) { animation-delay: 0.06s; }
.hero-copy > *:nth-child(3) { animation-delay: 0.12s; }
.hero-copy > *:nth-child(4) { animation-delay: 0.18s; }
.hero-art { animation: rise 0.7s cubic-bezier(0.22, 1, 0.36, 1) 0.15s both; }

/* ---------- Responsive ---------- */
@media (max-width: 1080px) {
  .hero-art { display: none; }
}
@media (max-width: 980px) {
  .split { grid-template-columns: 1fr; gap: 32px; }
  .steps { grid-template-columns: 1fr; gap: 0; }
  .step { border-top: none; padding-top: 28px; border-top: 1px solid var(--rule); }
  .step:first-child { border-top: 3px solid var(--cobalt); }
}
@media (max-width: 860px) {
  .team { grid-template-columns: 1fr; gap: 36px; }
  .cols { grid-template-columns: 1fr; gap: 36px; }
  .team .member.placeholder { display: none !important; }
}
@media (max-width: 760px) {
  .js .nav-toggle { display: inline-flex; }
  .js .nav-links { display: none; position: absolute; left: 0; right: 0; top: 100%; background: var(--white); border-bottom: 1px solid var(--rule); flex-direction: column; align-items: stretch; gap: 0; padding: 8px var(--pad) 18px; box-shadow: 0 12px 24px rgba(10,11,18,0.06); }
  .js .nav-links.open { display: flex; }
  .js .nav-links a:not(.btn) { padding: 14px 0; font-size: 16px; }
  .js .nav-links .btn { height: 48px; margin-top: 8px; }
  .meta-item + .meta-item { border-left: none; padding-left: 0; }
  .row { grid-template-columns: 56px 1fr; gap: 8px 20px; }
  .row-num { font-size: 36px; }
  .row-link { grid-column: 2; margin-top: 6px; }
}
@media (max-width: 420px) {
  .host-logos { gap: 18px; }
  .host-logos img { height: 28px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-delay: 0ms !important; transition-duration: 0.001ms !important; }
}
