/* ============================================================
   Machines We Imagine: stylesheet
   ------------------------------------------------------------
   Everything visual lives here. The palette is defined once as
   CSS variables below. Change a hex there and it updates
   everywhere. Sizes use clamp(min, preferred, max) so the page
   scales smoothly between phone and desktop.
   ============================================================ */

:root {
  --pink:   #F2CED1;  /* page background */
  --ink:    #30348C;  /* main indigo: text, buttons, lines */
  --indigo: #44428C;  /* slightly lighter indigo, secondary body copy */
  --violet: #5C548C;  /* muted violet, quieter text */
  --mauve:  #9885A6;  /* lightest: section numbers, small labels */
  --line:   rgba(48, 52, 140, 0.22);  /* hairline rules */
  --card-line: rgba(48, 52, 140, 0.35); /* card outlines */
  --card-bg: rgba(242, 206, 209, 0.72); /* cards: pink at 72% so the sketch shows through */
  --gutter: clamp(20px, 4vw, 48px);     /* left/right page margin */
}

/* ---- base ---- */
html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--pink);
  color: var(--ink);
  font-family: 'DM Sans', system-ui, sans-serif;
  -webkit-font-smoothing: antialiased;
}

p { text-wrap: pretty; }

a { color: var(--ink); text-decoration: none; border-bottom: 1px solid rgba(48,52,140,0.4); }
a:hover { opacity: 0.55; }

/* The p5 canvas sits in this fixed, full-screen layer behind everything.
   sketch.js puts the canvas here. pointer-events:none lets clicks pass through. */
#bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
}

/* All page content sits above the sketch */
.page { position: relative; z-index: 1; min-height: 100vh; }

/* ---- reusable bits ---- */

/* Small tracked-uppercase label (eyebrows, buttons, footer) */
.label {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

/* Every section: centered column, hairline on top, breathing room */
.section {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(48px, 9vh, 110px) 0;
  border-top: 1px solid var(--line);
  scroll-margin-top: 80px; /* so anchor jumps clear the sticky header */
}

/* The "EYEBROW ..... 01" row at the top of each section */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  margin-bottom: clamp(32px, 6vh, 64px);
}
.section-head .eyebrow { color: var(--violet); }
.section-head .num { font-family: 'Space Grotesk', sans-serif; color: var(--mauve); }

/* Outlined card on translucent pink */
.card {
  box-shadow: inset 0 0 0 1px var(--card-line); /* 1px outline, square corners */
  background: var(--card-bg);
  padding: clamp(24px, 3.4vw, 44px);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* Solid indigo panel (funding, join-us band) */
.panel {
  background: var(--ink);
  color: var(--pink);
  padding: clamp(28px, 4vw, 56px);
}

/* Outlined button on indigo panels */
.button-outline {
  border: 0;
  box-shadow: inset 0 0 0 1px var(--pink);
  color: var(--pink);
  padding: 13px 22px;
  align-self: start;
  white-space: nowrap;
}
.button-outline:hover { opacity: 0.55; }
/* when the outline button is a <button> (e.g. Join us), match the <a> look exactly */
button.button-outline { background: transparent; cursor: pointer; font-family: 'DM Sans', sans-serif; font-size: 11px; }

/* Solid indigo button on pink */
.button-solid {
  border: 0;
  background: var(--ink);
  color: var(--pink);
  padding: 14px 24px;
}
.button-solid:hover { opacity: 0.78; }

/* Display headings: Space Grotesk, tight */
h1, h2, h3 { font-family: 'Space Grotesk', sans-serif; font-weight: 500; margin: 0; }

/* ---- header ---- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 18px var(--gutter);
  background: rgba(242, 206, 209, 0.86);
  border-bottom: 1px solid var(--line);
}
.site-header .wordmark { height: 18px; width: auto; display: block; }
.site-header a { border: 0; }

.menu-button {
  display: flex;
  align-items: center;
  gap: 12px;
  background: transparent;
  border: 0;
  box-shadow: inset 0 0 0 1px var(--ink);
  padding: 9px 14px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
  color: var(--ink);
}
.menu-button:hover { opacity: 0.6; }
.menu-button .lines { display: flex; flex-direction: column; gap: 4px; width: 16px; }
.menu-button .lines span { height: 1px; background: currentColor; display: block; }

/* ---- full-screen nav overlay ---- */
.nav-overlay {
  position: fixed;
  inset: 0;
  z-index: 60;
  background: var(--ink);
  color: var(--pink);
  display: none; /* menu.js switches this to flex when open */
  flex-direction: column;
  justify-content: center;
  padding: clamp(24px, 6vw, 96px);
  animation: rise 350ms cubic-bezier(0.16, 1, 0.3, 1);
}
.nav-overlay.open { display: flex; }

.nav-overlay .top-row {
  position: absolute;
  top: 18px;
  left: var(--gutter);
  right: var(--gutter);
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
}
.nav-overlay .close-button {
  background: transparent;
  border: 0;
  box-shadow: inset 0 0 0 1px var(--pink);
  color: var(--pink);
  padding: 9px 14px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}
.nav-overlay .close-button:hover { opacity: 0.6; }

.nav-overlay ol { list-style: none; margin: 0; padding: 0; display: flex; flex-direction: column; gap: 2px; }
.nav-overlay li { border-top: 1px solid rgba(242, 206, 209, 0.28); }
.nav-overlay li a {
  display: flex;
  align-items: baseline;
  gap: clamp(16px, 3vw, 40px);
  padding: clamp(10px, 1.6vw, 18px) 0;
  border: 0;
  color: var(--pink);
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  font-size: clamp(28px, 5vw, 56px);
  letter-spacing: -0.5px;
  line-height: 1;
}
.nav-overlay li a:hover { opacity: 0.55; }
.nav-overlay li .num { font-family: 'DM Sans', sans-serif; font-size: 11px; letter-spacing: 0.18em; opacity: 0.6; min-width: 2.4em; }

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* ---- hero ---- */
.hero { max-width: 1180px; margin: 0 auto; padding: clamp(60px, 12vh, 150px) 0 clamp(60px, 10vh, 120px); }
.hero .logo { width: clamp(180px, 30vw, 320px); height: auto; display: block; margin-bottom: clamp(32px, 6vh, 64px); }
.hero h1 {
  font-size: clamp(34px, 5.6vw, 78px);
  line-height: 1.02;
  letter-spacing: -1px;
  max-width: 20ch;
  margin-bottom: clamp(28px, 5vh, 48px);
}
.hero .intro {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: clamp(24px, 4vw, 56px);
  max-width: 980px;
}
.hero .intro p { margin: 0; font-size: clamp(16px, 1.25vw, 19px); line-height: 1.62; }
.hero .intro p + p { color: var(--violet); }

main { padding: 0 var(--gutter); }

/* ---- announcement band (autumn meetings) ---- */
.announce {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(26px, 3.4vw, 44px);
  background: var(--ink);
  color: var(--pink);
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(22px, 3vw, 48px);
  align-items: start;
}
.announce-head { display: flex; flex-direction: column; gap: 12px; }
.announce h2 {
  font-size: clamp(24px, 2.8vw, 38px);
  line-height: 1.08;
  letter-spacing: -0.6px;
  max-width: 16ch;
}
.announce .label { color: rgba(242, 206, 209, 0.7) !important; }
.announce-note { margin: 0; font-size: 16px; line-height: 1.6; max-width: 40ch; opacity: 0.8; }
.announce .button-outline { color: var(--pink) !important; margin-top: 6px; white-space: normal; }

.meeting-list { list-style: none; margin: 0; padding: 0; }
.meeting-list li {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 6px 18px;
  padding: 14px 0;
  border-top: 1px solid rgba(242, 206, 209, 0.28);
}
.meeting-list li:last-child { border-bottom: 1px solid rgba(242, 206, 209, 0.28); }
.meeting-list time {
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  font-size: clamp(17px, 1.6vw, 21px);
  letter-spacing: -0.3px;
  margin-right: auto;
}
.meeting-when {
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(17px, 1.6vw, 21px);
}
.meeting-room {
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  opacity: 0.72;
  white-space: nowrap;
}

/* ---- who we are ---- */
.leads {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(440px, 100%), 1fr));
  gap: clamp(20px, 3vw, 32px);
  margin-bottom: clamp(32px, 6vh, 56px);
}
.leads .card { gap: 14px; }
.leads h2 { font-size: clamp(24px, 2.6vw, 34px); line-height: 1.1; letter-spacing: -0.5px; }
.leads .role { margin: 0; font-size: 15px; line-height: 1.55; color: var(--violet); }
.leads .bio { margin: 0; font-size: 16px; line-height: 1.62; }
.leads .site-link { align-self: start; font-size: 13px; }

.join-band {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  background: var(--ink);
  color: var(--pink);
  padding: clamp(22px, 3vw, 40px);
}
.join-band p {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  font-size: clamp(19px, 2vw, 26px);
  letter-spacing: -0.3px;
  line-height: 1.25;
  max-width: 34ch;
}

/* ---- remit ---- */
.remit-list { display: flex; flex-direction: column; gap: clamp(32px, 6vh, 64px); }
.remit-list h2 { font-size: clamp(22px, 2.6vw, 36px); line-height: 1.12; letter-spacing: -0.5px; max-width: 26ch; }
.remit-list p { margin: 0; font-size: 17px; line-height: 1.62; max-width: 72ch; }
.remit-list p.quiet { color: var(--violet); }

/* ---- activities: three cells separated by hairlines ---- */
.activities {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 1px;                 /* the 1px gaps show the line color below */
  background: var(--line);
  box-shadow: inset 0 0 0 1px var(--line);
}
.activities > div {
  background: rgba(242, 206, 209, 0.82);
  padding: clamp(24px, 2.8vw, 38px);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.activities .roman { font-family: 'Space Grotesk', sans-serif; font-size: 12px; letter-spacing: 0.14em; color: var(--mauve); }
.activities h3 { font-size: 24px; letter-spacing: -0.3px; line-height: 1.15; }
.activities p { margin: 0; font-size: 16px; line-height: 1.6; color: var(--indigo); }

/* ---- funding panel ---- */
.funding-panel {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}
.funding-panel h2 { font-size: clamp(24px, 3vw, 42px); line-height: 1.1; letter-spacing: -0.6px; max-width: 22ch; }
.funding-panel .body { display: flex; flex-direction: column; gap: 18px; }
.funding-panel .body p { margin: 0; font-size: 17px; line-height: 1.62; }

/* ---- current work / research ---- */
.two-col {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(24px, 4vw, 56px);
  align-items: start;
}
.two-col h2 { font-size: clamp(26px, 3vw, 44px); line-height: 1.06; letter-spacing: -0.7px; }
.two-col .body-text { margin: 0; font-size: 17px; line-height: 1.62; }

.project-meta {
  margin: 0;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 10px 20px;
  font-size: 15px;
  line-height: 1.5;
}
.project-meta dt { font-size: 11px; letter-spacing: 0.18em; text-transform: uppercase; color: var(--mauve); padding-top: 3px; }
.project-meta dd { margin: 0; }

.research-subtitle { font-size: clamp(19px, 1.8vw, 24px); line-height: 1.2; letter-spacing: -0.3px; }
.research-body { margin: 0; font-size: 17px; line-height: 1.62; color: var(--indigo); }

/* ---- contact ---- */
.contact-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
  gap: clamp(24px, 4vw, 56px);
  align-items: end;
}
.contact-row h2 { font-size: clamp(26px, 3.4vw, 48px); line-height: 1.04; letter-spacing: -0.8px; max-width: 20ch; }
.contact-row .body { display: flex; flex-direction: column; gap: 18px; align-items: start; }
.contact-row .body p { margin: 0; font-size: 15px; line-height: 1.6; color: var(--violet); }
.contact-row .social-link { font-size: 13px; }
.site-footer a { color: var(--violet); border-color: rgba(92, 84, 140, 0.4); }

/* ---- join modal ---- */
.modal-backdrop {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: rgba(48, 52, 140, 0.45); /* indigo scrim over the page */
  display: none; /* modal.js switches this to flex when open */
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
}
.modal-backdrop.open { display: flex; animation: rise 300ms cubic-bezier(0.16, 1, 0.3, 1); }

.modal {
  background: var(--pink);
  box-shadow: inset 0 0 0 1px var(--ink);
  padding: clamp(24px, 3.4vw, 44px);
  width: min(480px, 100%);
  display: flex;
  flex-direction: column;
  gap: 18px;
  position: relative;
  overflow: hidden;
  transition: background-color 450ms ease, box-shadow 450ms ease;
}
.modal h2 { font-size: clamp(22px, 2.4vw, 30px); line-height: 1.12; letter-spacing: -0.4px; }
.modal-top { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.modal-close {
  background: transparent;
  border: 0;
  box-shadow: inset 0 0 0 1px var(--ink);
  color: var(--ink);
  padding: 7px 12px;
  cursor: pointer;
  font-family: 'DM Sans', sans-serif;
}
.modal-close:hover { opacity: 0.6; }
.modal-note { margin: 0; font-size: 15px; line-height: 1.6; color: var(--violet); }

/* Success state: modal.js adds .success once the signup is sent.
   The panel floods indigo, the form steps aside, and pink logo
   forms burst out and remake themselves behind the thank-you. */
.modal > :not(.modal-burst) { position: relative; z-index: 1; }
.modal-burst { position: absolute; inset: 0; width: 100%; height: 100%; z-index: 0; pointer-events: none; display: none; }

.modal.success { background: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); color: var(--pink); min-height: min(420px, 80vh); }
.modal.success .modal-burst { display: block; }
.modal.success > h2,
.modal.success > .modal-note,
.modal.success > #join-form { display: none; }
.modal.success .modal-top .label { color: rgba(242, 206, 209, 0.7) !important; }
.modal.success .modal-close { color: var(--pink); box-shadow: inset 0 0 0 1px var(--pink); }

.modal-thanks {
  margin: auto 0;              /* sits in the middle of the tall panel */
  font-family: 'Space Grotesk', sans-serif;
  font-weight: 500;
  font-size: clamp(30px, 4.4vw, 46px);
  line-height: 1.05;
  letter-spacing: -0.8px;
  max-width: 11ch;
  animation: rise 700ms 150ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

@media (prefers-reduced-motion: reduce) {
  .modal, .modal-thanks { transition: none; animation: none; }
}

#join-form { display: flex; flex-direction: column; gap: 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field .label { color: var(--violet); }
.field input,
.field textarea {
  border: 0;
  box-shadow: inset 0 0 0 1px var(--card-line);
  background: rgba(255, 255, 255, 0.5);
  padding: 12px 14px;
  font-family: 'DM Sans', sans-serif;
  font-size: 16px;
  color: var(--ink);
}
.field textarea { resize: vertical; line-height: 1.5; }
.field[hidden] { display: none; }
.field input:focus,
.field textarea:focus { outline: none; box-shadow: inset 0 0 0 1.5px var(--ink); }
#join-form .button-solid { cursor: pointer; font-family: 'DM Sans', sans-serif; margin-top: 4px; }

/* ---- meetup sign-up page (meetup.html) ---- */
.meetup {
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(48px, 10vh, 120px) 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr));
  gap: clamp(32px, 5vw, 72px);
  align-items: start;
}
.meetup-info { display: flex; flex-direction: column; gap: 18px; }
.meetup-info h1 { font-size: clamp(34px, 5vw, 68px); line-height: 1.02; letter-spacing: -1px; }
.meetup-place {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(17px, 1.6vw, 21px);
  line-height: 1.4;
}
.meetup-note { margin: 0; font-size: 17px; line-height: 1.62; color: var(--violet); max-width: 44ch; }

.meetup-form-card h2 { font-size: clamp(22px, 2.4vw, 30px); line-height: 1.12; letter-spacing: -0.4px; }
#meetup-form { display: flex; flex-direction: column; gap: 16px; }
#meetup-form[hidden] { display: none; } /* the display:flex above would otherwise beat [hidden] */
#meetup-form .button-solid { cursor: pointer; font-family: 'DM Sans', sans-serif; margin-top: 4px; }
#meetup-form .button-solid:disabled { cursor: default; opacity: 0.6; }

/* Checkbox row: box on the left, text wrapping beside it */
.check { display: flex; align-items: flex-start; gap: 10px; font-size: 15px; line-height: 1.5; cursor: pointer; }
.check input { margin: 3px 0 0; width: 16px; height: 16px; accent-color: var(--ink); flex-shrink: 0; }

.form-error { color: var(--ink); font-weight: 500; }
.meetup-done {
  margin: 0;
  font-family: 'Space Grotesk', sans-serif;
  font-size: clamp(19px, 2vw, 24px);
  line-height: 1.3;
}

/* ---- footer ---- */
.site-footer {
  border-top: 1px solid var(--line);
  padding: 26px var(--gutter);
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
  justify-content: space-between;
  align-items: center;
  color: var(--violet);
}

/* Show and tell options in the join modal (next-meetup mode) */
.join-extras { display: flex; flex-direction: column; gap: 14px; }
.join-extras[hidden] { display: none; }
