/* =========================================================================
   Effective Altruism Amsterdam — shared stylesheet
   Sections: tokens, base, header/nav, footer, layout, components, pages
   ========================================================================= */

/* ---------- Design tokens ---------- */
:root {
  --bg: #ffffff;
  --surface: #f4f7fb;
  --surface-2: #e9eff7;
  --text: #14202e;
  --muted: #55647a;
  --accent: #2f6db3;
  --accent-strong: #245a97;
  --accent-soft: #e3edf9;
  --warm: #d98324;
  --border: #dce3ed;
  --shadow: 0 1px 2px rgba(20, 32, 46, 0.06), 0 8px 24px rgba(20, 32, 46, 0.06);

  /* Call-to-action band — kept as its own set so the dark theme can go darker
     instead of inverting into light-blue-on-white. */
  --cta-bg: #2f6db3;
  --cta-text: #ffffff;
  --cta-subtext: #dbe8f7;
  --cta-button-bg: #ffffff;
  --cta-button-text: #245a97;
  --cta-button-hover: #eaf1fa;

  --container: 68rem;
  --prose: 42rem;
  --radius: 0.75rem;
  --radius-sm: 0.5rem;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f141b;
    --surface: #161d27;
    --surface-2: #1e2836;
    --text: #e8eef6;
    --muted: #a2b1c4;
    --accent: #78aee6;
    --accent-strong: #9cc6f2;
    --accent-soft: #1b2735;
    --warm: #e9a94f;
    --border: #263141;
    --shadow: 0 1px 2px rgba(0, 0, 0, 0.4), 0 8px 24px rgba(0, 0, 0, 0.3);

    --cta-bg: #17324f;
    --cta-text: #eef4fb;
    --cta-subtext: #b6cbe2;
    --cta-button-bg: #78aee6;
    --cta-button-text: #0f141b;
    --cta-button-hover: #9cc6f2;
  }
}

/* ---------- Base ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  font-size: 1rem;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

h1,
h2,
h3,
h4 {
  line-height: 1.2;
  letter-spacing: -0.02em;
  margin: 0 0 0.6em;
}

h1 {
  font-size: clamp(2rem, 5vw, 2.9rem);
}
h2 {
  font-size: clamp(1.5rem, 3.2vw, 2rem);
}
h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1.1rem;
}

a {
  color: var(--accent);
  text-underline-offset: 0.15em;
}

a:hover {
  color: var(--accent-strong);
}

img {
  max-width: 100%;
  height: auto;
  display: block;
}

hr {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 2.5rem 0;
}

:focus-visible {
  outline: 3px solid var(--accent);
  outline-offset: 2px;
  border-radius: 2px;
}

.skip-link {
  position: absolute;
  left: -9999px;
  top: 0;
  background: var(--accent);
  color: #fff;
  padding: 0.6rem 1rem;
  z-index: 100;
}

.skip-link:focus {
  left: 0;
}

/* ---------- Layout helpers ---------- */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding-inline: 1.25rem;
}

.section {
  padding-block: clamp(2.5rem, 6vw, 4.5rem);
}

.section-alt {
  background: var(--surface);
  border-block: 1px solid var(--border);
}

.section-head {
  max-width: var(--prose);
  margin-bottom: 2rem;
}

.section-head p {
  color: var(--muted);
  margin-bottom: 0;
}

.eyebrow {
  display: block;
  font-size: 0.8rem;
  font-weight: 700;
  letter-spacing: 0.09em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 0.5rem;
}

.prose {
  max-width: var(--prose);
}

.prose ul,
.prose ol {
  padding-left: 1.25rem;
}

.prose li {
  margin-bottom: 0.5rem;
}

.lead {
  font-size: clamp(1.1rem, 2.2vw, 1.3rem);
  color: var(--muted);
}

.text-muted {
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr));
}

.grid-2 {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(18rem, 1fr));
}

/* For rows of exactly four items: fits 4 across on desktop and 2 on tablet,
   so the last card never sits alone on its own row. */
.grid-4 {
  display: grid;
  gap: 1.25rem;
  grid-template-columns: repeat(auto-fit, minmax(12.5rem, 1fr));
}

/* ---------- Header & navigation ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(10px);
  border-bottom: 1px solid var(--border);
}

.header-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: 0.75rem 1.25rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  color: var(--text);
  text-decoration: none;
  font-weight: 700;
}

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 2.1rem;
  height: 2.1rem;
  border-radius: 0.5rem;
  background: var(--accent);
  color: #fff;
  font-size: 0.8rem;
  letter-spacing: 0.02em;
  flex: none;
}

.brand-logo {
  height: 2.1rem;
  width: auto;
}

.brand-text {
  font-size: 0.98rem;
  letter-spacing: -0.01em;
}

@media (max-width: 24rem) {
  .brand-text {
    display: none;
  }
}

.nav-toggle {
  display: none;
  align-items: center;
  gap: 0.4rem;
  background: none;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--text);
  font: inherit;
  font-size: 0.9rem;
  padding: 0.45rem 0.75rem;
  cursor: pointer;
}

.nav-list {
  display: flex;
  align-items: center;
  gap: 0.25rem;
  list-style: none;
  margin: 0;
  padding: 0;
}

.nav-link {
  display: inline-block;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-size: 0.95rem;
  text-decoration: none;
  background: none;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

.nav-link:hover,
.nav-link:focus-visible {
  color: var(--text);
  background: var(--surface-2);
}

.nav-link[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
}

.nav-cta {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  margin-left: 0.35rem;
}

.nav-cta:hover,
.nav-cta:focus-visible {
  background: var(--accent-strong);
  color: #fff;
}

/* Dropdown */
.has-dropdown {
  position: relative;
}

.dropdown-toggle::after {
  content: "";
  display: inline-block;
  margin-left: 0.4rem;
  border: 0.3em solid transparent;
  border-top-color: currentColor;
  transform: translateY(0.15em);
}

.dropdown {
  position: absolute;
  top: calc(100% + 0.4rem);
  left: 0;
  min-width: 14rem;
  list-style: none;
  margin: 0;
  padding: 0.4rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-0.25rem);
  transition: opacity 0.15s ease, transform 0.15s ease, visibility 0.15s;
}

/* Opens on hover/keyboard focus (works without JS) and on click (with JS). */
.has-dropdown:hover .dropdown,
.has-dropdown:focus-within .dropdown,
.dropdown-toggle[aria-expanded="true"] + .dropdown {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown a {
  display: block;
  padding: 0.5rem 0.7rem;
  border-radius: var(--radius-sm);
  color: var(--text);
  font-size: 0.93rem;
  text-decoration: none;
}

.dropdown a:hover,
.dropdown a:focus-visible {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.dropdown a[aria-current="page"] {
  color: var(--accent);
  font-weight: 600;
}

/* Mobile navigation */
@media (max-width: 52rem) {
  .nav-toggle {
    display: inline-flex;
  }

  .site-nav {
    display: none;
    position: absolute;
    left: 0;
    right: 0;
    top: 100%;
    background: var(--bg);
    border-bottom: 1px solid var(--border);
    box-shadow: var(--shadow);
    padding: 0.75rem 1.25rem 1.25rem;
  }

  .site-nav.is-open {
    display: block;
  }

  .nav-list {
    flex-direction: column;
    align-items: stretch;
    gap: 0.15rem;
    max-width: var(--container);
    margin: 0 auto;
  }

  .nav-link {
    width: 100%;
    text-align: left;
    padding: 0.65rem 0.7rem;
  }

  .nav-cta {
    margin: 0.4rem 0 0;
    text-align: center;
  }

  .dropdown {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    box-shadow: none;
    border: 0;
    border-left: 2px solid var(--border);
    border-radius: 0;
    margin: 0.1rem 0 0.4rem 0.7rem;
    padding: 0;
    min-width: 0;
  }

  .dropdown-toggle::after {
    float: right;
    transform: translateY(0.5em);
  }
}

/* ---------- Buttons ---------- */
.button,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  padding: 0.7rem 1.35rem;
  border-radius: var(--radius-sm);
  font-weight: 600;
  font-size: 0.98rem;
  text-decoration: none;
  border: 1px solid transparent;
  cursor: pointer;
}

.button {
  background: var(--accent);
  color: #fff;
}

.button:hover {
  background: var(--accent-strong);
  color: #fff;
}

.button-secondary {
  background: transparent;
  color: var(--text);
  border-color: var(--border);
}

.button-secondary:hover {
  background: var(--surface-2);
  color: var(--text);
}

.button-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

/* ---------- Cards ---------- */
.card {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.5rem;
  box-shadow: var(--shadow);
}

.section-alt .card {
  background: var(--bg);
}

.card h3 {
  margin-bottom: 0.5rem;
}

.card p:last-child {
  margin-bottom: 0;
}

.card-link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.card-link:hover {
  border-color: var(--accent);
  color: inherit;
}

.card-icon {
  display: inline-grid;
  place-items: center;
  width: 2.5rem;
  height: 2.5rem;
  border-radius: var(--radius-sm);
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.2rem;
  margin-bottom: 0.9rem;
}

.card-meta {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.35rem;
}

.arrow::after {
  content: " →";
  white-space: nowrap;
}

/* ---------- Hero ---------- */
.hero {
  position: relative;
  background: linear-gradient(155deg, var(--accent-soft), var(--bg) 65%);
  border-bottom: 1px solid var(--border);
  overflow: hidden;
}

/* HERO IMAGE — drop img/hero.jpg in place and uncomment the block below.
   The overlay keeps the text readable on top of a photo.
.hero {
  background-image: linear-gradient(155deg, rgba(20, 32, 46, 0.78), rgba(20, 32, 46, 0.55)),
    url("img/hero.jpg");
  background-size: cover;
  background-position: center;
}
.hero, .hero h1, .hero .lead { color: #fff; }
.hero .eyebrow { color: #cfe1f6; }
*/

.hero-inner {
  max-width: var(--container);
  margin: 0 auto;
  padding: clamp(3rem, 8vw, 5.5rem) 1.25rem;
}

.hero h1 {
  max-width: 18ch;
}

.hero .lead {
  max-width: 46ch;
}

.hero-note {
  margin-top: 1.5rem;
  font-size: 0.95rem;
  color: var(--muted);
}

/* ---------- Page header (interior pages) ---------- */
.page-header {
  background: var(--surface);
  border-bottom: 1px solid var(--border);
}

.page-header .container {
  padding-block: clamp(2rem, 5vw, 3.25rem);
}

.page-header h1 {
  margin-bottom: 0.5rem;
}

.page-header p {
  max-width: var(--prose);
  color: var(--muted);
  margin-bottom: 0;
  font-size: 1.05rem;
}

.breadcrumb {
  font-size: 0.85rem;
  color: var(--muted);
  margin-bottom: 0.75rem;
}

.breadcrumb a {
  color: var(--muted);
}

/* ---------- Stats ---------- */
.stat {
  text-align: left;
}

.stat-number {
  display: block;
  font-size: clamp(1.9rem, 4vw, 2.4rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  color: var(--accent);
  line-height: 1.1;
}

.stat-label {
  display: block;
  font-weight: 600;
  margin-top: 0.35rem;
}

.stat-note {
  display: block;
  font-size: 0.9rem;
  color: var(--muted);
  margin-top: 0.25rem;
}

/* ---------- Embeds ---------- */
.embed {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg);
  min-height: 24rem;
}

.embed iframe {
  display: block;
  width: 100%;
  border: 0;
}

.embed-placeholder {
  display: grid;
  place-items: center;
  text-align: center;
  min-height: 24rem;
  padding: 2rem 1.5rem;
  background: repeating-linear-gradient(
    45deg,
    var(--surface),
    var(--surface) 12px,
    var(--surface-2) 12px,
    var(--surface-2) 24px
  );
}

.embed-placeholder p {
  max-width: 34rem;
  color: var(--muted);
}

.embed-placeholder strong {
  color: var(--text);
}

/* ---------- Team ---------- */
.person {
  text-align: center;
}

.person-photo {
  width: 6.5rem;
  height: 6.5rem;
  margin: 0 auto 0.9rem;
  border-radius: 50%;
  object-fit: cover;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--accent);
  font-size: 1.6rem;
  font-weight: 700;
}

.person h3 {
  margin-bottom: 0.15rem;
}

.person .role {
  color: var(--accent);
  font-size: 0.9rem;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.person p {
  font-size: 0.95rem;
  color: var(--muted);
}

/* ---------- Misc components ---------- */
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  list-style: none;
  margin: 0 0 1.5rem;
  padding: 0;
}

.pill {
  display: inline-block;
  padding: 0.3rem 0.8rem;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-strong);
  font-size: 0.85rem;
  font-weight: 600;
}

.callout {
  border-left: 3px solid var(--accent);
  background: var(--surface);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  padding: 1.1rem 1.25rem;
  margin: 1.75rem 0;
}

.callout p:last-child {
  margin-bottom: 0;
}

.steps {
  list-style: none;
  counter-reset: step;
  padding: 0;
  margin: 0;
}

.steps li {
  counter-increment: step;
  position: relative;
  padding-left: 3rem;
  margin-bottom: 1.5rem;
}

.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0;
  top: 0;
  width: 2rem;
  height: 2rem;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-weight: 700;
  font-size: 0.9rem;
}

.steps h3 {
  margin-bottom: 0.3rem;
}

.faq {
  border-top: 1px solid var(--border);
  padding-top: 1.25rem;
  margin-top: 1.25rem;
}

.faq summary {
  cursor: pointer;
  font-weight: 600;
  margin-bottom: 0.6rem;
}

.cta-band {
  background: var(--cta-bg);
  color: var(--cta-text);
}

.cta-band .container {
  padding-block: clamp(2.25rem, 5vw, 3.5rem);
  text-align: center;
}

.cta-band h2 {
  color: var(--cta-text);
}

.cta-band p {
  color: var(--cta-subtext);
  max-width: 40rem;
  margin-inline: auto;
}

.cta-band .button {
  background: var(--cta-button-bg);
  color: var(--cta-button-text);
}

.cta-band .button:hover {
  background: var(--cta-button-hover);
  color: var(--cta-button-text);
}

.cta-band .button-row {
  justify-content: center;
}

.definition-list {
  margin: 0;
}

.definition-list dt {
  font-weight: 600;
  margin-top: 1.1rem;
}

.definition-list dd {
  margin: 0.2rem 0 0;
  color: var(--muted);
}

/* ---------- Footer ---------- */
.site-footer {
  background: var(--surface);
  border-top: 1px solid var(--border);
  margin-top: 0;
}

.footer-grid {
  display: grid;
  gap: 2rem;
  grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr));
  padding-block: 3rem 2rem;
}

.footer-grid h2 {
  font-size: 0.85rem;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--muted);
  margin-bottom: 0.9rem;
}

.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-grid li {
  margin-bottom: 0.5rem;
}

.footer-grid a {
  color: var(--text);
  text-decoration: none;
  font-size: 0.95rem;
}

.footer-grid a:hover {
  color: var(--accent);
  text-decoration: underline;
}

.footer-about p {
  color: var(--muted);
  font-size: 0.95rem;
  max-width: 24rem;
}

.footer-bottom {
  border-top: 1px solid var(--border);
  padding-block: 1.25rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
  justify-content: space-between;
  align-items: center;
  font-size: 0.88rem;
  color: var(--muted);
}

.footer-bottom p {
  margin: 0;
}
