/* ==========================================================================
   Portfolio — bright, bubbly, a little techy.
   Tokens live in :root. Motion only touches transform/opacity and is switched
   off under prefers-reduced-motion.
   ========================================================================== */

:root {
  /* Palette */
  --bg: #FBFBFF;
  --bg-tint: #F3F1FF;
  --card: #FFFFFF;
  --ink: #14122B;
  --muted: #5B5A7A;
  --line: #E6E4F5;

  --violet: #7C3AED;
  --blue: #2563EB;
  --cyan: #06B6D4;
  --pink: #F43F8E;
  --lime: #84CC16;
  --yellow: #FACC15;

  --violet-lt: #EFE7FF;
  --cyan-lt: #DDF8FB;
  --pink-lt: #FFE4EF;
  --lime-lt: #ECFCCB;
  --yellow-lt: #FEF6C7;

  --grad: linear-gradient(100deg, var(--pink), var(--violet) 55%, var(--cyan));

  /* Type */
  --font-head: "Space Grotesk", "Inter", system-ui, sans-serif;
  --font-body: "Inter", system-ui, -apple-system, sans-serif;
  --font-mono: "JetBrains Mono", ui-monospace, Menlo, monospace;

  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.0625rem);
  --text-h1: clamp(2.5rem, 1.6rem + 4.2vw, 4.75rem);
  --text-h2: clamp(1.9rem, 1.4rem + 2.2vw, 3rem);
  --text-h3: 1.2rem;

  /* Shape & space */
  --radius: 22px;
  --radius-sm: 12px;
  --gutter: clamp(16px, 4vw, 40px);
  --measure: 1120px;
  --space-section: clamp(4rem, 3rem + 4vw, 7rem);

  /* Motion */
  --dur-fast: 150ms;
  --dur: 320ms;
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ── Base ────────────────────────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; }
/* overflow-x: clip stops the off-canvas menu widening the page without
   turning <html> into a scroll container; hidden is the fallback. */
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; overflow-x: hidden; overflow-x: clip; }
body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: 1.6;
  color: var(--ink);
  background-color: var(--bg);
  overflow-x: hidden; overflow-x: clip;
}
/* Soft pastel gradient photo behind the whole page. It sits on a fixed layer
   and is blurred so the small source image never shows compression blocks. */
body::before {
  content: ""; position: fixed; inset: -48px; z-index: -1; pointer-events: none;
  background: url("images/background.jpg") center / cover no-repeat;
  filter: blur(28px);
}

h1, h2, h3 { font-family: var(--font-head); line-height: 1.1; letter-spacing: -0.02em; margin: 0; }
h1 { font-size: var(--text-h1); font-weight: 700; }
h2 { font-size: var(--text-h2); font-weight: 700; }
h3 { font-size: var(--text-h3); font-weight: 700; }
p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; }
img, svg { display: block; max-width: 100%; }

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

.skip-link {
  position: absolute; left: 12px; top: -60px; z-index: 100;
  padding: 10px 16px; background: var(--ink); color: #fff; border-radius: 10px;
  text-decoration: none; font-weight: 600;
}
.skip-link:focus { top: 12px; }

.mono { font-family: var(--font-mono); font-size: 0.8rem; color: var(--muted); letter-spacing: 0.01em; }
.grad {
  background: var(--grad); -webkit-background-clip: text; background-clip: text;
  color: transparent;
}
.eyebrow {
  font-family: var(--font-mono); font-size: 0.85rem; font-weight: 600;
  color: var(--violet); margin-bottom: 12px;
}
.eyebrow--light { color: var(--lime-lt); }

/* Headline underline that wiggles — a thick wavy gradient line. */
.underline-wiggle {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 12' preserveAspectRatio='none'%3E%3Cpath d='M0 7 Q15 1 30 7 T60 7 T90 7 T120 7' fill='none' stroke='%23F43F8E' stroke-width='5' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat; background-position: 0 100%; background-size: 100% 0.22em;
  padding-bottom: 0.08em;
}

/* ── Buttons, pills, chips ──────────────────────────────────────────────── */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 13px 22px; border-radius: 999px;
  font-family: var(--font-head); font-weight: 700; font-size: 0.98rem;
  text-decoration: none; border: 2px solid transparent;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out);
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
/* A light sweep crosses the button on hover. */
.btn { position: relative; overflow: hidden; }
.btn::after {
  content: ""; position: absolute; top: 0; bottom: 0; left: 0; width: 45%;
  background: linear-gradient(100deg, transparent, rgba(255,255,255,0.35), transparent);
  transform: translateX(-180%); transition: transform 520ms var(--ease-out);
  pointer-events: none;
}
.btn:hover::after { transform: translateX(320%); }
.btn--primary { background: var(--ink); color: #fff; box-shadow: 4px 4px 0 var(--pink); }
.btn--primary:hover { box-shadow: 6px 6px 0 var(--pink); }
.btn--ghost { background: var(--card); color: var(--ink); border-color: var(--ink); box-shadow: 4px 4px 0 var(--cyan); }
.btn--ghost:hover { box-shadow: 6px 6px 0 var(--cyan); }
.btn--light { background: #fff; color: var(--ink); box-shadow: 4px 4px 0 var(--lime); }
.btn--outline-light { border-color: rgba(255,255,255,0.7); color: #fff; }
.btn--outline-light:hover { background: rgba(255,255,255,0.12); }

.pill {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 999px;
  font-family: var(--font-mono); font-size: 0.74rem; font-weight: 600;
  white-space: nowrap;
}
.pill--violet { background: var(--violet-lt); color: var(--violet); }
.pill--cyan   { background: var(--cyan-lt);   color: #0E7490; }
.pill--pink   { background: var(--pink-lt);   color: #BE185D; }
.pill--lime   { background: var(--lime-lt);   color: #3F6212; }

.chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.chips li {
  font-family: var(--font-mono); font-size: 0.74rem;
  padding: 4px 10px; border-radius: 8px;
  background: var(--bg-tint); color: var(--muted); border: 1px solid var(--line);
  transition: transform var(--dur) var(--ease-out);
}
/* Chips hop one after another when their card is hovered. */
.card:hover .chips li { transform: translateY(-3px); }
.card:hover .chips li:nth-child(2) { transition-delay: 40ms; }
.card:hover .chips li:nth-child(3) { transition-delay: 80ms; }
.card:hover .chips li:nth-child(4) { transition-delay: 120ms; }

.link-arrow {
  font-family: var(--font-head); font-weight: 700; font-size: 0.95rem;
  text-decoration: none; color: var(--violet);
  display: inline-flex; align-items: center; gap: 4px;
}
.link-arrow::after { content: "→"; transition: transform var(--dur-fast) var(--ease-out); }
.link-arrow:hover::after { transform: translateX(4px); }

/* ── Placeholder images ────────────────────────────────────────────────── */
/* Swap any .ph for a real <img>; the modifier sets the aspect ratio. */
.ph {
  position: relative;
  display: grid; place-items: center;
  width: 100%;
  border: 2px dashed rgba(124, 58, 237, 0.45);
  border-radius: var(--radius-sm);
  background:
    linear-gradient(135deg, var(--violet-lt), var(--cyan-lt));
  color: var(--violet);
  overflow: hidden;
}
.ph::after {
  content: "image";
  position: absolute; bottom: 8px; right: 10px;
  font-family: var(--font-mono); font-size: 0.66rem; opacity: 0.7;
}
.ph__icon { width: 28%; max-width: 44px; aspect-ratio: 1; opacity: 0.8; }
.ph--16x9   { aspect-ratio: 16 / 9; }
.ph--wide   { aspect-ratio: 21 / 9; }
.ph--square { aspect-ratio: 1; }
.ph--portrait { aspect-ratio: 3 / 4; }
.ph--circle { aspect-ratio: 1; border-radius: 50%; }
.ph--circle::after { display: none; }

/* Real images in former placeholder slots. Pair with a ph--* shape class. */
.pic { display: block; width: 100%; height: auto; object-fit: cover; border-radius: var(--radius-sm); border: 2px solid var(--ink); background: #fff; }
.pic--logo { object-fit: contain; padding: 6px; }
/* Text badge: a square tile that names an organization in place of its seal. */
.badge {
  display: grid; place-items: center; aspect-ratio: 1; padding: 5px; box-sizing: border-box;
  border: 2px solid var(--ink); border-radius: var(--radius-sm); background: #fff; color: var(--ink);
  font-family: var(--font-head); font-weight: 700; font-size: 0.68rem; line-height: 1.15;
  text-align: center; letter-spacing: -0.01em; overflow-wrap: anywhere;
}
.pic--botball { object-position: 50% 58%; }
.pic--avatar { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; border-radius: 50%; object-fit: cover; object-position: 50% 50%; }
/* Extra portraits script.js stacks over the headshot, one per direction she
   can look. One is shown while the cursor is chasing the portrait. */
.pic--look { opacity: 0; background: transparent; pointer-events: none; }
.pic--look.is-looking { opacity: 1; }
.card--project .pic, .card--photo .pic { border-radius: 0; border: 0; border-bottom: 2px solid var(--ink); }


/* ── Hero ────────────────────────────────────────────────────────────────── */
.hero { position: relative; overflow: hidden; padding: clamp(3rem, 2rem + 5vw, 7rem) var(--gutter) clamp(3rem, 2rem + 4vw, 6rem); }
/* The hero fades to the page colour at its foot and Experience fades back
   out, so the clipped blobs never end in a hard line. The squiggle rides the
   seam. */
.hero::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 160px;
  background: linear-gradient(to bottom, rgba(251, 251, 255, 0), rgba(251, 251, 255, 0.94));
  pointer-events: none;
}
#experience { background: linear-gradient(to bottom, rgba(251, 251, 255, 0.94), rgba(251, 251, 255, 0) 220px); }
.squiggle {
  position: relative; z-index: 2; height: 24px; margin: -12px 0; pointer-events: none;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 60 24' preserveAspectRatio='none'%3E%3Cpath d='M0 12 Q15 0 30 12 T60 12' fill='none' stroke='%23F43F8E' stroke-width='4' stroke-linecap='round'/%3E%3C/svg%3E") repeat-x center / 60px 24px;
}
.hero__inner {
  position: relative; z-index: 1;
  max-width: var(--measure); margin: 0 auto;
  display: grid; grid-template-columns: 1.15fr 0.85fr; gap: clamp(32px, 5vw, 72px); align-items: center;
}
.hero__copy > * { animation: rise var(--dur) var(--ease-out) both; }
.hero__copy > :nth-child(1) { animation-delay: 60ms; }
.hero__copy > :nth-child(2) { animation-delay: 140ms; }
.hero__copy > :nth-child(3) { animation-delay: 220ms; }
.hero__copy > :nth-child(4) { animation-delay: 300ms; }
.hero__copy > :nth-child(5) { animation-delay: 380ms; }
.hero__copy > :nth-child(6) { animation-delay: 460ms; }
.deck { font-size: 1.15rem; color: var(--muted); max-width: 52ch; margin-top: 20px; }
.hero__about { max-width: 56ch; margin-top: 14px; line-height: 1.6; }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 28px; }
.hero__pills { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 28px; }

.hero__visual { position: relative; display: grid; gap: 18px; justify-items: end; }
.avatar {
  position: relative; display: block;
  width: clamp(140px, 18vw, 200px); aspect-ratio: 1; border-radius: 50%;
  background: #fff;
  border: 3px solid #fff;
  box-shadow: 0 0 0 3px var(--violet), 8px 8px 0 var(--yellow);
  animation: float 4s ease-in-out infinite;
}

.terminal {
  width: 100%; border-radius: 18px; overflow: hidden;
  background: #1B1838; color: #E8E6FF;
  box-shadow: 10px 10px 0 var(--cyan);
  transform: rotate(-1.2deg);
  animation: rise 500ms var(--ease-out) 250ms both;
}
.terminal__bar { display: flex; align-items: center; gap: 7px; padding: 11px 14px; background: #252149; }
.terminal__bar span { width: 11px; height: 11px; border-radius: 50%; background: var(--pink); }
.terminal__bar span:nth-child(2) { background: var(--yellow); }
.terminal__bar span:nth-child(3) { background: var(--lime); }
.terminal__bar em { margin-left: auto; font-style: normal; font-family: var(--font-mono); font-size: 0.72rem; color: #9D98C8; }
.terminal__body { margin: 0; padding: 16px 18px 20px; font-family: var(--font-mono); font-size: 0.84rem; line-height: 1.75; white-space: pre-wrap; }
.t-prompt { color: var(--cyan); }
.t-out { color: #C9C5F2; }
.t-ok { color: var(--lime); }
.t-cursor { display: inline-block; width: 9px; height: 1.05em; vertical-align: text-bottom; background: var(--pink); animation: blink 1s steps(2) infinite; }
/* While script.js is typing, lines wait their turn. The newlines between them
   still take up space, so the card never changes height. */
#terminal-lines.is-typing .t-line:not(.is-shown) { display: none; }

/* Interactive shell (shell.js). The real <input> is visually hidden; what
   you type is mirrored into .t-typed in front of the blinking cursor. */
.terminal__body { max-height: 340px; overflow-y: auto; overscroll-behavior: contain; }
.terminal.is-live { cursor: text; }
.t-input {
  position: absolute; width: 1px; height: 1px; opacity: 0; overflow: hidden;
  border: 0; padding: 0; margin: 0; white-space: nowrap;
}
.t-typed { color: #fff; }
.terminal.is-live .t-typed:empty::before { content: "type help"; color: #6F6A9E; }
.terminal.is-live:focus-within .t-typed:empty::before { content: ""; }
.t-err { color: #FB7185; }
.t-dim { color: #9D98C8; }

/* The gradient on the hero name slides slowly. */
.hero h1 .grad { background-size: 200% 100%; animation: shimmer 7s linear infinite; }

/* A dashed ring orbits the portrait. */
.avatar { overflow: visible; }
.avatar::before {
  content: ""; position: absolute; inset: -16px; border-radius: 50%;
  border: 2px dashed var(--violet); opacity: 0.6;
  animation: spin 28s linear infinite;
}

/* Shooting stars (stars.js) streak across the top of the hero on a canvas
   behind the copy. Space makes them hop. */
.stars { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; }

/* Soft gradient blobs behind the hero. */
.blob { position: absolute; border-radius: 50%; filter: blur(60px); opacity: 0.55; pointer-events: none; animation: drift 14s ease-in-out infinite; }
.blob--pink { width: 420px; height: 420px; background: var(--pink); top: -140px; left: -120px; }
.blob--cyan { width: 380px; height: 380px; background: var(--cyan); right: -120px; top: 40px; animation-duration: 18s; animation-delay: -6s; }
.blob--lime { width: 300px; height: 300px; background: var(--lime); bottom: -160px; left: 40%; opacity: 0.4; animation-duration: 11s; animation-delay: -3s; }

/* ── Sections ────────────────────────────────────────────────────────────── */
.section { padding: var(--space-section) var(--gutter); }
.section > * { max-width: var(--measure); margin-left: auto; margin-right: auto; }
/* Tinted sections are a frosted band that feathers out at the top and
   bottom, so there is no hard line where it meets the photo background. */
.section--tint {
  background: linear-gradient(
    to bottom,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.62) 14%,
    rgba(255, 255, 255, 0.62) 86%,
    rgba(255, 255, 255, 0) 100%
  );
}
.section__head { margin-bottom: clamp(28px, 4vw, 48px); }
.section__deck { color: var(--muted); max-width: 60ch; margin-top: 12px; font-size: 1.05rem; }

/* ── Cards ───────────────────────────────────────────────────────────────── */
.card {
  position: relative; /* lets the peeking dog paint behind cards in DOM order */
  background: var(--card);
  border: 2px solid var(--ink);
  border-radius: var(--radius);
  box-shadow: 6px 6px 0 var(--violet);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out);
}
.card:hover { transform: translate(-2px, -2px); box-shadow: 10px 10px 0 var(--violet); }
.card__content { padding: 20px 22px 24px; }
.card__meta { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin-bottom: 10px; }
.card__org { color: var(--muted); font-weight: 500; margin: 4px 0 10px; }
.card h3 + p, .card p + p { margin-top: 8px; }
.card__links { display: flex; flex-wrap: wrap; gap: 10px 18px; margin-top: 16px; }
.bullets { display: grid; gap: 6px; margin-top: 10px; padding-left: 1.1em; list-style: "✦ "; color: var(--ink); }
.bullets li::marker { color: var(--pink); }

.grid { display: grid; gap: 22px; }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }

/* Experience: a timeline with a logo column and a gradient spine. */
.timeline { position: relative; display: grid; gap: 28px; }
.timeline::before {
  content: ""; position: absolute; left: 35px; top: 20px; bottom: 20px; width: 3px;
  background: var(--grad); border-radius: 3px; opacity: 0.6;
  transform: scaleY(0); transform-origin: top;
  transition: transform 1.4s var(--ease-out) 150ms;
}
/* The list itself never fades — it carries data-reveal only so the spine
   knows when to draw. Its items reveal on their own. */
.timeline[data-reveal] { opacity: 1; transform: none; transition: none; }
.timeline.is-visible::before { transform: scaleY(1); }
.timeline__item { position: relative; display: grid; grid-template-columns: 72px 1fr; gap: 22px; align-items: start; }
.timeline__logo { width: 72px; position: relative; z-index: 1; background: #fff; box-shadow: 4px 4px 0 var(--yellow); }
.timeline__body { padding: 22px 24px 26px; box-shadow: 6px 6px 0 var(--cyan); }
.timeline__body:hover { box-shadow: 10px 10px 0 var(--cyan); }

/* Projects: equal cards, each with its own accent color. */
.bento { display: grid; grid-template-columns: repeat(4, 1fr); gap: 22px; }
.card--project { overflow: hidden; display: flex; flex-direction: column; }
.card--project .ph { border-radius: 0; border: 0; border-bottom: 2px solid var(--ink); }
/* Project images get a taller slot so the photo dominates the card. */
.card--project .ph--16x9 { aspect-ratio: 1; }
.bento .card--project:nth-child(3n+1) { box-shadow: 6px 6px 0 var(--pink); }
.bento .card--project:nth-child(3n+1):hover { box-shadow: 10px 10px 0 var(--pink); }
.bento .card--project:nth-child(3n+2) { box-shadow: 6px 6px 0 var(--cyan); }
.bento .card--project:nth-child(3n+2):hover { box-shadow: 10px 10px 0 var(--cyan); }
.bento .card--project:nth-child(3n) { box-shadow: 6px 6px 0 var(--lime); }
.bento .card--project:nth-child(3n):hover { box-shadow: 10px 10px 0 var(--lime); }

/* Project cards: the first sentence shows; the rest sits behind "Learn more". */
.more { margin-top: 8px; }
.more summary {
  display: inline-flex; align-items: center; gap: 4px; list-style: none;
  cursor: pointer; font-weight: 600; font-size: 0.95rem; color: var(--violet);
}
.more summary::-webkit-details-marker { display: none; }
.more summary::after { content: "↓"; transition: transform var(--dur-fast) var(--ease-out); }
.more summary:hover { text-decoration: underline; }
.more summary:focus-visible { outline: 2px solid var(--pink); outline-offset: 3px; border-radius: 4px; }
.more[open] summary::after { transform: rotate(180deg); }
.more__close, .more[open] .more__open { display: none; }
.more[open] .more__close { display: inline; }
.more p { margin-top: 8px; }

/* Courses: badge on the left, text on the right. */
/* Every course card is as tall as the tallest one, across rows too. */
#courses .grid--3 { grid-auto-rows: 1fr; }
.card--cert { display: grid; grid-template-columns: 56px 1fr; gap: 14px; padding: 16px; box-shadow: 6px 6px 0 var(--yellow); }
.card--cert h3 { font-size: 1.05rem; }
.card--cert .card__org { margin: 2px 0 6px; font-size: 0.92rem; }
.card--cert:hover { box-shadow: 10px 10px 0 var(--yellow); }
.card--cert .pill { margin-bottom: 8px; }
.card--cert .card__meta { margin-bottom: 0; }
.card--cert .card__meta .pill { margin-bottom: 8px; }
.card--cert p:last-of-type { color: var(--muted); font-size: 0.95rem; }
.cert__badge { width: 56px; border-radius: 14px; }
.badge.cert__badge { font-size: 0.6rem; padding: 4px; }

/* Publications: full-width text cards; op-eds sit in a compact list. */
.pubs { display: grid; gap: 22px; }
.card--pub { padding: 22px 24px; box-shadow: 6px 6px 0 var(--pink); }
.card--pub:hover { box-shadow: 10px 10px 0 var(--pink); }
.card--pub .card__content { padding: 0; }
.card--pub .link-arrow { margin-top: 12px; }
.pub-list { list-style: none; padding: 0; margin: 14px 0 0; display: grid; }
.pub-list li {
  display: grid; grid-template-columns: 4ch 1fr; gap: 14px; align-items: baseline;
  padding: 9px 0; border-top: 1px solid var(--line);
}
.pub-list li:first-child { border-top: 0; padding-top: 0; }
.pub-list .mono { color: var(--muted); }
.pub-list__title { font-weight: 500; }
/* Titles link to the full text under /writing. */
a.pub-list__title {
  color: inherit; text-decoration: underline dotted var(--violet);
  text-decoration-thickness: 1.5px; text-underline-offset: 4px;
  transition: color var(--dur-fast);
}
a.pub-list__title:hover, a.pub-list__title:focus-visible { color: var(--violet); text-decoration-style: solid; }

/* Leadership: photo-topped cards. */
.card--photo { overflow: hidden; box-shadow: 6px 6px 0 var(--cyan); }
.card--photo:hover { box-shadow: 10px 10px 0 var(--cyan); }
.card--photo .ph { border-radius: 0; border: 0; border-bottom: 2px solid var(--ink); }

/* Volunteer: logo beside text. */
.card--volunteer { display: grid; grid-template-columns: 88px 1fr; gap: 18px; padding: 20px; box-shadow: 6px 6px 0 var(--lime); }
.card--volunteer:hover { box-shadow: 10px 10px 0 var(--lime); }
.card--volunteer .card__content { padding: 0; }
.card--volunteer .ph { border-radius: 18px; }

/* Fun facts: chunky colored bubbles. */
/* Three to a row; a short last row sits centered instead of hugging the left. */
.facts { --facts-gap: 18px; display: flex; flex-wrap: wrap; justify-content: center; gap: var(--facts-gap); }
.fact {
  flex: 0 1 calc((100% - 2 * var(--facts-gap)) / 3);
  display: grid; gap: 10px; padding: 22px 20px;
  border-radius: 28px; border: 2px solid var(--ink);
  font-weight: 500;
  transition: transform var(--dur) var(--ease-out);
}
.fact:hover { transform: translateY(-4px) rotate(-1deg); }
.fact:nth-child(even):hover { transform: translateY(-4px) rotate(1deg); }
/* Each fact leads with a small picture: an emoji, or a photo if one is chosen. */
.fact__pic { height: 88px; width: auto; max-width: 140px; object-fit: contain; border: 0; border-radius: 0; background: transparent; animation: bob 4.5s ease-in-out infinite; }
.fact .ph.fact__pic { width: 72px; height: 72px; border: 2px dashed rgba(124, 58, 237, 0.45); border-radius: var(--radius-sm); background: linear-gradient(135deg, var(--violet-lt), var(--cyan-lt)); }
.fact .ph.fact__pic::after { display: none; }
.fact__emoji { display: grid; place-items: center; height: 88px; font-size: 3.4rem; line-height: 1; }
.fact:nth-child(2n) .fact__pic { animation-delay: -1.2s; }
.fact:nth-child(3n) .fact__pic { animation-delay: -2.4s; }
.fact:nth-child(4n) .fact__pic { animation-delay: -3.3s; }
.fact:hover .fact__pic { animation: wiggle 600ms var(--ease-out); }
.fact--pink   { background: var(--pink-lt);   box-shadow: 5px 5px 0 var(--pink); }
.fact--cyan   { background: var(--cyan-lt);   box-shadow: 5px 5px 0 var(--cyan); }
.fact--lime   { background: var(--lime-lt);   box-shadow: 5px 5px 0 var(--lime); }
.fact--yellow { background: var(--yellow-lt); box-shadow: 5px 5px 0 var(--yellow); }
.fact--violet { background: var(--violet-lt); box-shadow: 5px 5px 0 var(--violet); }

/* ── Contact & footer ────────────────────────────────────────────────────── */
.contact { padding-top: 0; }
.contact__card {
  position: relative; overflow: hidden;
  padding: clamp(36px, 5vw, 64px);
  border-radius: 32px; color: #fff;
  background: linear-gradient(120deg, #1B1838, #3B1C8A 55%, #0E7490);
  box-shadow: 10px 10px 0 var(--pink);
  text-align: center;
}
.contact__card p { margin: 14px auto 0; max-width: 50ch; color: #D9D5FF; }
.contact__links { display: flex; flex-wrap: wrap; justify-content: center; gap: 12px; margin-top: 28px; }

.footer {
  max-width: var(--measure); margin: 0 auto; padding: 28px var(--gutter) 40px;
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 12px;
  color: var(--muted); font-size: 0.92rem; border-top: 1px solid var(--line);
}
.footer__top { font-family: var(--font-mono); font-size: 0.82rem; text-decoration: none; color: var(--violet); }

/* ── Intro splash ───────────────────────────────────────────────────────── */
/* Shown by CSS from the first paint so the page never flashes before it;
   splash.js (deferred) removes it at once when it should not play, and a
   <noscript> rule hides it when JavaScript is off. The inline script in the
   head adds .no-splash to <html> when the intro should not play at all. */
.splash {
  position: fixed; inset: 0; z-index: 200;
  display: grid; place-items: center;
  background-color: var(--bg);
  background-image: radial-gradient(circle, rgba(124, 58, 237, 0.14) 1px, transparent 1.4px);
  background-size: 22px 22px;
  transition: opacity 250ms var(--ease-out);
  cursor: pointer;
}
.splash.is-done { opacity: 0; pointer-events: none; }
.no-splash .splash { display: none; }

.splash__stage { display: grid; justify-items: center; gap: 22px; --blk: clamp(36px, 7vw, 54px); }
.splash__grid {
  display: grid;
  grid-template-columns: repeat(5, var(--blk));
  grid-auto-rows: var(--blk);
  gap: 8px;
}
.splash__ground {
  width: calc(var(--blk) * 5 + 8px * 4 + 48px); height: 10px; border-radius: 999px;
  background: var(--grad); opacity: 0.7;
  transform: scaleX(0); transition: transform 600ms var(--ease-out) 200ms;
}
.splash.is-building .splash__ground { transform: scaleX(1); }
.splash.is-breaking .splash__ground { transform: scaleX(0); transition-delay: 150ms; }
.splash__caption {
  font-family: var(--font-mono); font-size: 0.9rem; font-weight: 600; color: var(--violet);
  opacity: 0; transition: opacity 400ms var(--ease-out) 900ms;
}
.splash.is-building .splash__caption { opacity: 1; }
.splash.is-breaking .splash__caption { opacity: 0; transition-delay: 0s; }

.splash__skip {
  position: absolute; top: 18px; right: 18px;
  padding: 8px 14px; border-radius: 999px; border: 2px solid var(--ink);
  background: var(--card); color: var(--ink); cursor: pointer;
  font-family: var(--font-mono); font-size: 0.8rem; font-weight: 600;
  box-shadow: 3px 3px 0 var(--ink);
}

/* Blocks drop in one by one, then each flies off along its own vector. */
.blk {
  width: var(--blk); height: var(--blk); border-radius: 11px;
  border: 2px solid var(--ink); box-shadow: 4px 4px 0 var(--ink);
  opacity: 0; transform: translateY(-70px) scale(0.4);
}
.blk--pink   { background: var(--pink); }
.blk--violet { background: var(--violet); }
.blk--cyan   { background: var(--cyan); }
.blk--lime   { background: var(--lime); }
.blk--yellow { background: var(--yellow); }
.splash.is-building .blk { animation: blk-in 420ms var(--ease-out) var(--in-delay) both; }
.splash.is-breaking .blk { animation: blk-out 600ms cubic-bezier(0.5, 0, 1, 0.5) var(--out-delay) both; }

/* The page holds still behind the splash: no scrolling, and the hero's
   load-in waits so it isn't missed. */
body.has-splash { overflow: hidden; }
body.has-splash .hero__copy > *, body.has-splash .terminal { animation-play-state: paused; }

/* ── Reveal & keyframes ─────────────────────────────────────────────────── */
[data-reveal] { opacity: 0; transform: translateY(22px) scale(0.975); transition: opacity var(--dur) var(--ease-out), transform 520ms var(--ease-out); }
[data-reveal].is-visible { opacity: 1; transform: none; }
/* Keep the card hover lift even though reveal also sets transform. */
.card[data-reveal].is-visible:hover { transform: translate(-2px, -2px); }
.fact[data-reveal].is-visible:hover { transform: translateY(-4px) rotate(-1deg); }
.fact[data-reveal].is-visible:nth-child(even):hover { transform: translateY(-4px) rotate(1deg); }

@keyframes rise { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: none; } }
/* Idle bob uses the standalone translate/rotate properties so the transform
   stays free for the cursor-dodge offset script.js applies. */
@keyframes float {
  0%, 100% { translate: 0 0; rotate: -2deg; }
  50%      { translate: 0 -14px; rotate: 2deg; }
}
@keyframes blink { to { opacity: 0; } }
@keyframes shimmer { from { background-position: 0% 50%; } to { background-position: 200% 50%; } }
@keyframes spin { to { transform: rotate(360deg); } }
@keyframes drift {
  0%, 100% { transform: translate(0, 0) scale(1); }
  33%      { transform: translate(40px, -30px) scale(1.08); }
  66%      { transform: translate(-25px, 25px) scale(0.95); }
}
@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }
@keyframes blk-in {
  from { opacity: 0; transform: translateY(-70px) scale(0.4); }
  70%  { opacity: 1; transform: translateY(4px) scale(1.04); }
  to   { opacity: 1; transform: none; }
}
@keyframes blk-out {
  from { opacity: 1; transform: none; }
  to   { opacity: 0; transform: translate(var(--dx), var(--dy)) rotate(var(--rot)) scale(0.5); }
}
@keyframes wiggle {
  0%, 100% { transform: rotate(0); }
  25%      { transform: rotate(-14deg) scale(1.15); }
  60%      { transform: rotate(10deg) scale(1.1); }
}

/* ── Responsive ─────────────────────────────────────────────────────────── */
@media (max-width: 1024px) {
  .bento { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
}

@media (max-width: 820px) {
  .hero__inner { grid-template-columns: 1fr; }
  .hero__visual { justify-items: start; }
  .terminal { transform: none; }
}

@media (max-width: 640px) {
  .bento, .grid--2, .grid--3 { grid-template-columns: 1fr; }
  .fact { flex-basis: 100%; }
  .timeline::before { display: none; }
  .timeline__item { grid-template-columns: 1fr; gap: 12px; }
  .timeline__logo { width: 56px; }
  .card--volunteer { grid-template-columns: 64px 1fr; }
  .card--cert { grid-template-columns: 52px 1fr; }
  .cert__badge { width: 52px; }
  .blob { filter: blur(40px); }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition: none !important; }
  [data-reveal] { opacity: 1; transform: none; }
  .terminal { transform: none; }
}

/* ── Click sparks ─────────────────────────────────────────────────────────── */
/* Short-lived particles script.js throws from any clicked button. */
.spark {
  position: fixed; z-index: 100; pointer-events: none;
  border-radius: 3px; border: 2px solid var(--ink);
  box-shadow: 0 0 0 2px #fff;
  transform: translate(-50%, -50%);
  animation: spark-fly 900ms cubic-bezier(0.15, 0.85, 0.3, 1) forwards;
}
.spark:nth-child(odd) { border-radius: 50%; }
@keyframes spark-fly {
  0%   { opacity: 1; transform: translate(-50%, -50%) scale(0.4) rotate(0deg); }
  15%  { transform: translate(calc(-50% + var(--dx) * 0.35), calc(-50% + var(--dy) * 0.35)) scale(1.3) rotate(calc(var(--spin) * 0.3)); }
  70%  { opacity: 1; }
  100% { opacity: 0; transform: translate(calc(-50% + var(--dx)), calc(-50% + var(--dy) + 24px)) scale(0.7) rotate(var(--spin)); }
}

/* ── Peeking dog (peek.js) ──────────────────────────────────────────────── */
/* A clipped window pressed against one edge of a card; the dog slides up
   inside it, so the card appears to hide the rest of the dog. peek.js rotates
   the window to match the edge (sideways for left/right, upside down for the
   bottom) and inserts it first inside the card's container, so neighbouring
   cards (all positioned, z-index auto) paint over it. */
.bento, .grid, .pubs { position: relative; }
.peek {
  position: absolute;
  width: 112px; height: 86px;
  overflow: hidden; pointer-events: none;
  transform-origin: 50% 50%;
}
.peek__dog {
  display: block;
  translate: 0 100%;
  transform-origin: 50% 100%;
  pointer-events: auto; cursor: pointer; touch-action: manipulation;
}
/* The tail pokes up beside the head and swings from its base. Press the dog
   (peek.js adds --wag) and it wags. */
.peek__tail { transform-origin: 82px 68px; }
.peek__dog--wag .peek__tail { animation: peek-wag 160ms ease-in-out infinite alternate; }
@keyframes peek-wag { from { transform: rotate(-28deg); } to { transform: rotate(22deg); } }
.peek__dog--up {
  animation:
    peek-up 450ms cubic-bezier(0.34, 1.56, 0.64, 1) forwards,
    peek-wobble 900ms ease-in-out 450ms infinite alternate;
}
.peek__dog--down { animation: peek-down 320ms ease-in forwards; }
@keyframes peek-up { from { translate: 0 100%; } to { translate: 0 4%; } }
@keyframes peek-down { from { translate: 0 4%; } to { translate: 0 100%; } }
@keyframes peek-wobble { from { rotate: -5deg; } to { rotate: 5deg; } }
