/* Agents4Academia — "graph paper" system.
   Cool white sheet with a faint plotted grid; Archivo display, IBM Plex Sans
   body, IBM Plex Mono for labels. One working blue (plot), the org banner's
   terracotta as the accent. Event snapshots under events/<slug>/ carry their
   own frozen copy of the old stylesheet and are untouched by this file. */

:root {
  --paper: #ffffff;
  --grid: #e7edf6;
  --ink: #15222f;
  --muted: #55647a;
  --plot: #1c56c6;
  --accent: #c85c45;
  --rule: #dfe6ef;
  --card: #ffffff;
  --max: 47rem;
  --gutter: clamp(1.25rem, 4vw, 2rem);
  --display: "Archivo", "Helvetica Neue", sans-serif;
  --body: "IBM Plex Sans", system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, monospace;
  color-scheme: light;
}

:root[data-theme="dark"] {
  --paper: #0f151d;
  --ink: #e7edf6;
  --muted: #97a5ba;
  --plot: #7aa5f8;
  --accent: #e08a70;
  --rule: #273140;
  --card: #161e29;
  color-scheme: dark;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--body);
  font-size: 1.02rem;
  line-height: 1.65;
  color: var(--ink);
  background-color: var(--paper);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

.wrap {
  max-width: var(--max);
  margin: 0 auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

a { color: var(--plot); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--accent); }
:focus-visible { outline: 2px solid var(--plot); outline-offset: 2px; border-radius: 2px; }

/* ── Inline icons: follow the text color; plotted dot takes the accent ── */
.ico {
  width: 15px;
  height: 15px;
  vertical-align: -2px;
  margin-right: 0.32em;
  flex: none;
}
.ico .dot { fill: var(--accent); }

/* ── Header ── */
.site-header {
  background: color-mix(in srgb, var(--paper) 90%, transparent);
  border-bottom: 1px solid var(--rule);
  backdrop-filter: blur(4px);
  position: sticky;
  top: 0;
  z-index: 10;
}

.site-header .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
  padding-top: 0.85rem;
  padding-bottom: 0.85rem;
  flex-wrap: wrap;
  max-width: 64rem;
}

.brand {
  font-family: var(--display);
  font-weight: 700;
  font-size: 1.05rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  gap: 0.5em;
}
.brand:hover { color: var(--plot); }
.brand .node { width: 27px; height: 27px; flex: none; }

.site-nav {
  display: flex;
  gap: 1.4rem;
  font-family: var(--mono);
  font-size: 0.8rem;
  letter-spacing: 0.07em;
  text-transform: uppercase;
}

.site-nav a {
  color: var(--muted);
  text-decoration: none;
  padding-bottom: 2px;
  border-bottom: 1.5px solid transparent;
}

.site-nav a:hover { color: var(--plot); }

.site-nav a[aria-current="page"] {
  color: var(--ink);
  border-bottom-color: var(--accent);
}

/* ── Page body ── */
main { padding: clamp(2rem, 5vw, 3.5rem) 0 4rem; }

h1 {
  font-family: var(--display);
  font-weight: 700;
  font-size: clamp(2.3rem, 5vw, 3.7rem);
  letter-spacing: -0.02em;
  line-height: 1.08;
  color: var(--ink);
  margin: 0 0 1rem;
}

h2 {
  font-family: var(--display);
  font-weight: 650;
  font-size: 1.3rem;
  letter-spacing: -0.01em;
  color: var(--ink);
  margin: 2.5rem 0 0.75rem;
}

p { margin: 0 0 1rem; }

.eyebrow {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--plot);
  margin: 0 0 0.5rem;
}

.tagline {
  font-size: 1.18rem;
  line-height: 1.55;
  color: var(--muted);
  margin-bottom: 2rem;
}

/* ── Hero: a paper-style centered title block ── */
.hero { padding: 3rem 0 1rem; text-align: center; }
.hero .motto {
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 1.1rem;
}
.hero h1 .four { color: var(--accent); }
.hero .tagline { margin-left: auto; margin-right: auto; margin-bottom: 1.4rem; }
.hero .channels { justify-content: center; margin-top: 0; }
.netline { display: block; width: 300px; max-width: 70%; height: auto; margin: 2.2rem auto 0.5rem; }

/* Paper-style figure with caption */
.figure { margin: 2.5rem 0 2.75rem; text-align: center; }
.figure img, .figure svg.fig-inline { display: block; width: 100%; height: auto; }
.figure figcaption {
  font-family: var(--mono);
  font-size: 0.74rem;
  letter-spacing: 0.05em;
  color: var(--muted);
  margin-top: 0.8rem;
}

/* legacy cover kept for any page still using it */
.cover { margin: 0 0 2.5rem; }
.cover img { display: block; width: 100%; height: auto; }

/* ── CTA buttons (contribute page: GitHub + socials, unmissable) ── */
.cta-row { display: flex; flex-wrap: wrap; gap: 0.8rem; margin: 1.75rem 0 2.25rem; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.55em;
  font-family: var(--display);
  font-weight: 650;
  font-size: 1rem;
  color: var(--ink);
  text-decoration: none;
  border: 1.5px solid var(--ink);
  border-radius: 8px;
  padding: 0.68rem 1.25rem;
}
.btn .ico { width: 19px; height: 19px; margin: 0; }
.btn:hover { border-color: var(--plot); color: var(--plot); }
.btn.primary { background: var(--ink); border-color: var(--ink); color: var(--paper); }
.btn.primary:hover { background: var(--plot); border-color: var(--plot); color: var(--paper); }

/* ── Channel links: icon + label pills ── */
.channels {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin: 1.75rem 0 0.5rem;
  padding: 0;
  list-style: none;
}
.channels { gap: 1.6rem; }
.channels a {
  display: inline-flex;
  align-items: center;
  font-family: var(--mono);
  font-size: 0.98rem;
  letter-spacing: 0.03em;
  color: var(--ink);
  text-decoration: none;
  border-bottom: 1px solid transparent;
  padding-bottom: 2px;
}
.channels a:hover { color: var(--plot); border-bottom-color: var(--plot); }
.channels .ico { width: 21px; height: 21px; margin-right: 0.5em; }

/* ── The lifecycle: five wide cards on the line ── */
.lifecycle {
  list-style: none;
  margin: 1.75rem 0 0.5rem;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0.9rem;
}
.lifecycle li {
  border-top: 2px solid var(--ink);
  padding: 1rem 0.25rem 0.5rem 0;
}
.lifecycle .station {
  display: block;
  color: var(--ink);
  margin-bottom: 0.7rem;
}
.lifecycle .station .ico { width: 21px; height: 21px; margin: 0; }
.lifecycle .stage {
  display: block;
  font-family: var(--mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.2rem;
}
.lifecycle .name {
  font-family: var(--display);
  font-weight: 650;
  font-size: 1.02rem;
  color: var(--ink);
  text-decoration: none;
}
.lifecycle .name:hover { color: var(--plot); }
.lifecycle .desc {
  display: block;
  font-size: 0.79rem;
  color: var(--muted);
  line-height: 1.45;
  margin-top: 0.3rem;
}
@media (max-width: 1000px) { .lifecycle { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 560px) { .lifecycle { grid-template-columns: 1fr; } }

/* ── Definition-list facts (still used on subpages) ── */
.facts { margin: 2rem 0; border-top: 1px solid var(--rule); }
.facts > div {
  display: grid;
  grid-template-columns: 9rem 1fr;
  gap: 1.5rem;
  padding: 0.9rem 0;
  border-bottom: 1px solid var(--rule);
}
.facts dt {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  padding-top: 0.2rem;
}
.facts dd { margin: 0; color: var(--ink); }

@media (max-width: 560px) {
  .facts > div { grid-template-columns: 1fr; gap: 0.15rem; padding: 0.75rem 0; }
}

/* ── Principles page ── */
.principles { list-style: none; margin: 2rem 0; padding: 0; }
.principles li {
  display: grid;
  grid-template-columns: 44px 1fr;
  gap: 1rem;
  padding: 1.35rem 0;
  border-top: 1px solid var(--rule);
  max-width: 46em;
}
.principles li:last-child { border-bottom: 1px solid var(--rule); }
.principles .p-ico {
  width: 40px;
  height: 40px;
  border: 1.6px solid var(--plot);
  border-radius: 50%;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
}
.principles .p-ico .ico { width: 20px; height: 20px; margin: 0; }
.principles h2 { margin: 0.15rem 0 0.35rem; font-size: 1.12rem; }
.principles p { margin: 0; color: var(--ink); }

/* ── Lists ── */
ul.plain { list-style: none; padding: 0; margin: 1rem 0; }
ul.plain li { padding: 0.5rem 0; border-bottom: 1px solid var(--rule); }
ul.plain li:first-child { border-top: 1px solid var(--rule); }

.tba { color: var(--muted); font-style: italic; }

/* ── Acknowledgements ── */
.ack {
  margin-top: 3rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--rule);
  color: var(--muted);
  font-size: 0.95rem;
}
.ack-label {
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  margin: 0 0 0.75rem;
}
.logo-row { display: flex; align-items: center; gap: 2.5rem; flex-wrap: wrap; }
.logo-row img { height: 14px; width: auto; display: block; opacity: 0.75; }
.logo-row a:hover img { opacity: 1; }
.ack .institutions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 1rem 1.5rem;
  margin: 1.1rem 0 0;
  padding: 0;
  list-style: none;
}
.ack .institutions li { display: inline-flex; align-items: center; }
.ack .institutions img {
  height: 48px;
  width: auto;
  display: block;
}
.ack .institutions img.wordmark { height: 17px; margin-right: 0.6rem; }

/* ── Timezone toggle (events) ── */
.tz-toggle {
  display: inline-flex;
  margin-bottom: 1.25rem;
  border: 1px solid var(--plot);
  border-radius: 4px;
  overflow: hidden;
  font-family: var(--mono);
}
.tz-toggle button {
  font-family: inherit;
  font-size: 0.85rem;
  padding: 0.4rem 1rem;
  border: none;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
}
.tz-toggle button + button { border-left: 1px solid var(--plot); }
.tz-toggle button:hover { color: var(--plot); }
.tz-toggle button[aria-pressed="true"] { background: var(--plot); color: #fff; font-weight: 500; }
.tz-toggle button[aria-pressed="true"]::before { content: "\2713\00a0"; }

/* ── Schedule (events) ── */
table.schedule {
  width: 100%;
  border-collapse: collapse;
  margin: 1rem 0 2.5rem;
  font-size: 0.95rem;
  background: var(--card);
}
table.schedule th, table.schedule td {
  padding: 0.6rem 0.75rem;
  border: 1px solid var(--rule);
  vertical-align: top;
  text-align: left;
}
table.schedule th {
  font-family: var(--display);
  font-weight: 650;
  color: var(--ink);
  font-size: 0.9rem;
}
table.schedule td.time, table.schedule th.time {
  width: 5.5rem;
  font-family: var(--mono);
  font-size: 0.85rem;
  white-space: nowrap;
}
table.schedule td.time { color: var(--muted); }
table.schedule .day-row td {
  font-weight: 600;
  color: var(--ink);
  background: rgba(28, 86, 198, 0.05);
}
table.schedule .day-row td > span { display: inline-block; }
table.schedule .day-row .loc { float: right; font-weight: 400; font-size: 0.9rem; color: var(--muted); }

/* ── Resources / projects lists ── */
ul.resources li { padding: 0.9rem 0; }
ul.resources li > a { font-family: var(--display); font-weight: 650; font-size: 1.1rem; }
ul.resources .src {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  margin-left: 0.5rem;
}
ul.resources .blurb { margin: 0.25rem 0 0; font-size: 0.95rem; color: var(--ink); }
ul.resources .contribs { display: flex; gap: 0.4rem; margin: 0.6rem 0 0.1rem; flex-wrap: wrap; }
ul.resources .contribs img {
  display: block;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  border: 1px solid var(--rule);
  background: var(--card);
}
ul.resources .contribs a:hover img { border-color: var(--plot); }

ul.projects li > a { font-size: 1.25rem; }

/* ── People grid ── */
ul.people-grid {
  list-style: none;
  padding: 0;
  margin: 1rem 0 2.5rem;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr));
  gap: 1rem;
}
ul.people-grid li {
  display: flex;
  gap: 0.9rem;
  align-items: flex-start;
  padding: 0.9rem;
  border: 1px solid var(--rule);
  border-radius: 4px;
  background: var(--card);
}
ul.people-grid .mug {
  flex: none;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--rule);
}
ul.people-grid .ph {
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(28, 86, 198, 0.08);
  color: var(--plot);
  font-family: var(--display);
  font-weight: 650;
  font-size: 1.1rem;
}
ul.people-grid .bio { display: flex; flex-direction: column; gap: 0.1rem; min-width: 0; }
ul.people-grid .name {
  font-family: var(--display);
  font-weight: 650;
  font-size: 1.05rem;
  color: var(--ink);
  text-decoration: none;
}
ul.people-grid .name:hover { color: var(--plot); text-decoration: underline; }
ul.people-grid .role {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 0.75rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
ul.people-grid .area { font-size: 0.92rem; line-height: 1.45; }
ul.people-grid .proj { font-size: 0.85rem; color: var(--muted); }
ul.people-grid .proj a { color: var(--plot); }

/* ── Theme toggle ── */
.theme-toggle {
  width: 38px;
  height: 38px;
  border: 1.5px solid var(--accent);
  border-radius: 50%;
  background: transparent;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  padding: 0;
  flex: none;
}
.theme-toggle:hover { background: var(--accent); color: var(--paper); }
.theme-toggle svg { width: 19px; height: 19px; }
.theme-toggle .tt-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .tt-sun { display: block; }
:root[data-theme="dark"] .theme-toggle .tt-moon { display: none; }

/* Dark ground: logos keep a white plate; figures swap to dark variants */
:root[data-theme="dark"] .ack .institutions img,
:root[data-theme="dark"] .logo-row img {
  background: #fff;
  padding: 5px 9px;
  border-radius: 6px;
  box-sizing: content-box;
}
img.dark-only, .dark-only { display: none; }
:root[data-theme="dark"] img.dark-only, :root[data-theme="dark"] .dark-only { display: block; }
:root[data-theme="dark"] img.light-only, :root[data-theme="dark"] .light-only { display: none; }

/* ── Footer ── */
.site-footer {
  padding: 2rem 0 2.5rem;
  font-family: var(--mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--muted);
  border-top: 1px solid var(--rule);
}
.site-footer p { margin: 0.25rem 0; }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}
