/* =========================================================
   Dreaming the Sound of Contact — project page styles (v3)
   Editorial flow. Cards used sparingly for emphasis (pipeline
   aurora, BibTeX). Concept figure + overlaid contact-pulse as
   the hero visual.
   ========================================================= */
:root {
  --bg: #f8f5f2;
  --card: #ffffff;
  --card-cream: #fdf1e9;
  --card-lav:   #f0ecff;
  --card-mint:  #e4f5ed;

  --ink: #1a1420;
  --ink-muted: #7b7486;
  --ink-invert: #fdfbff;

  --accent: #6e7bff;
  --accent-peach: #ff9e8c;
  --accent-lav: #b39cff;
  --accent-mint: #7cd4b5;
  --accent-sun: #ffc97a;

  --success: #3ec29c;
  --danger: #ff7b9a;

  /* Gradient systems */
  --grad-aurora: linear-gradient(120deg, #ffb8a9 0%, #c7b8ff 35%, #7cd4b5 70%, #ffd49c 100%);
  --grad-cta:    linear-gradient(92deg, #7b88ff 0%, #c398ff 55%, #ff9e8c 100%);
  --grad-ours:   linear-gradient(92deg, #c6cdff, #dcd1ff);
  --grad-base:   linear-gradient(92deg, #ffd4cc, #ffc0cf);
  --grad-bibtex: linear-gradient(135deg, #2a2340 0%, #1a1a3a 50%, #2e1e3e 100%);

  --radius:    22px;
  --radius-sm: 14px;
  --radius-xs: 10px;
  --shadow:    0 1px 2px rgba(26,20,32,.03), 0 10px 30px rgba(26,20,32,.06);
  --shadow-lg: 0 1px 3px rgba(26,20,32,.04), 0 20px 60px rgba(110,123,255,.12);
  --max-w: 1040px;
  --gap: 24px;
  --gap-sm: 14px;

  --hairline: 1px solid rgba(26,20,32,.08);
}

* { box-sizing: border-box; }

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: 'Plus Jakarta Sans', 'Inter', -apple-system, BlinkMacSystemFont, system-ui, sans-serif;
  font-size: 15px;
  line-height: 1.55;
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  background-image:
    radial-gradient(1200px 600px at -10% -20%, rgba(179,156,255,.18), transparent 60%),
    radial-gradient(1000px 500px at 110% 10%,  rgba(255,158,140,.14), transparent 55%),
    radial-gradient(900px 500px at 50% 110%,   rgba(124,212,181,.14), transparent 55%);
  background-attachment: fixed;
}

.page {
  max-width: var(--max-w);
  margin: 0 auto;
  padding: 48px 24px 60px;
  display: flex;
  flex-direction: column;
  gap: var(--gap);
}

/* Section primitive (editorial, no box) ---------------- */
.section { position: relative; }
.section--divided { margin-top: 6px; }
.section--divided.card { /* when a divided block is also a card, the card supplies its own padding */ }

/* Card primitive (used sparingly) ---------------------- */
.card {
  position: relative;
  background: var(--card);
  border-radius: var(--radius);
  padding: 26px 28px;
  box-shadow: var(--shadow);
  overflow: hidden;
}
.card--aurora {
  background: var(--grad-aurora);
  background-size: 180% 180%;
  animation: aurora-drift 18s ease-in-out infinite alternate;
  color: var(--ink);
}
.card--bibtex {
  background: var(--grad-bibtex);
  color: var(--ink-invert);
}

@keyframes aurora-drift {
  0%   { background-position:   0% 40%; }
  50%  { background-position: 100% 70%; }
  100% { background-position:  30% 20%; }
}

/* Kicker label ------------------------------------------ */
.kicker {
  display: inline-block;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--accent);
  margin: 0 0 12px;
  padding: 5px 12px;
  border-radius: 999px;
  background: linear-gradient(92deg, rgba(240,236,255,.9), rgba(253,241,233,.9));
  border: 1px solid rgba(110,123,255,.18);
}
.card--aurora .kicker {
  background: rgba(255,255,255,.55);
  border-color: rgba(255,255,255,.7);
  color: #5b3aa0;
}
.card--bibtex .kicker {
  background: rgba(255,255,255,.08);
  border-color: rgba(255,255,255,.12);
  color: var(--accent-peach);
}

/* Typography -------------------------------------------- */
h1, h2, h3 { margin: 0; line-height: 1.1; color: var(--ink); letter-spacing: -.022em; }
.card--bibtex h1, .card--bibtex h2, .card--bibtex h3 { color: #fff; }
h1 { font-size: 52px; font-weight: 800; }
h2 { font-size: 24px; font-weight: 700; margin-bottom: 8px; }
h3 { font-size: 17px; font-weight: 700; }
p  { margin: 0 0 10px; color: var(--ink); }
p.muted, .muted { color: var(--ink-muted); }
.num { font-variant-numeric: tabular-nums; }

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }

/* Pill button (gradient-filled with arrow icon) --------- */
.btn-row { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 22px; }
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13px; font-weight: 600; color: #fff;
  padding: 9px 8px 9px 18px;
  border-radius: 999px;
  background: var(--grad-cta);
  border: none;
  box-shadow: 0 6px 18px rgba(110,123,255,.28);
  transition: transform .18s ease, box-shadow .18s ease;
  cursor: pointer;
}
.btn:hover { transform: translateY(-2px); box-shadow: 0 12px 28px rgba(110,123,255,.34); text-decoration: none; color: #fff; }
.btn__arrow {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: 999px;
  background: #ff9e8c;
  color: #fff;
  font-size: 14px; line-height: 1;
}
.btn--ghost {
  background: rgba(255,255,255,.75);
  color: var(--ink);
  border: 1px solid rgba(26,20,32,.1);
  box-shadow: none;
  backdrop-filter: blur(6px);
  -webkit-backdrop-filter: blur(6px);
}
.btn--ghost:hover { box-shadow: 0 10px 24px rgba(26,20,32,.08); color: var(--ink); background: #fff; }
.btn--ghost .btn__arrow { background: #f3eef9; color: var(--ink); }
.btn--inactive { opacity: .55; cursor: not-allowed; pointer-events: none; }

/* Grid helpers ------------------------------------------ */
.row { display: grid; gap: var(--gap-sm); }
.row--2 { grid-template-columns: 2fr 1fr; }
.row--hero { grid-template-columns: 1.1fr 1fr; align-items: center; gap: 36px; }
.row--task { grid-template-columns: .85fr 2fr; align-items: stretch; gap: 24px; }

/* Mono / code ------------------------------------------- */
code, pre, .mono {
  font-family: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ============ HERO (editorial, no card) ================ */
.hero { padding: 0; }
.hero h1 {
  font-size: 54px;
  background: linear-gradient(92deg, #1a1420 20%, #6e7bff 60%, #ff9e8c 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  padding-bottom: 4px;
}
.hero__subtitle { font-size: 18px; color: var(--ink-muted); margin-top: 14px; max-width: 44ch; }
.hero__authors { margin-top: 12px; font-size: 13px; color: var(--ink-muted); }

/* ---- Hero visual: concept figure (transparent, no card) ---- */
.hero__visual {
  position: relative;
  margin-left: auto;
  width: 100%;
  max-width: 380px;
  aspect-ratio: 744 / 1024;
}
.hero__visual img {
  width: 100%; height: 100%;
  display: block;
  object-fit: contain;
  /* Figure PNG has alpha bg — blends into the page. No border, no shadow. */
}

/* ---- Cute robot mascot brand mark ------------------------- */
.contact-pulse {
  position: relative;
  display: inline-block;
  margin-bottom: 16px;
}
.contact-pulse .arm-anim {
  width: 220px; height: 120px;
  display: block;
  overflow: visible;
}
.contact-pulse .label {
  font-size: 10px; letter-spacing: .12em; text-transform: uppercase;
  color: var(--ink-muted);
  display: block; margin-top: 2px;
}

/* Mascot gentle bob. */
.arm-anim .mascot {
  transform-origin: 72px 110px;
  transform-box: view-box;
  animation: mascot-bob 3.6s ease-in-out infinite;
}
@keyframes mascot-bob {
  0%, 100% { transform: translateY(0); }
  50%      { transform: translateY(-1.6px); }
}

/* Shadow squishes on bob. */
.arm-anim .shadow { animation: shadow-squish 3.6s ease-in-out infinite; transform-origin: 72px 110px; transform-box: view-box; }
@keyframes shadow-squish {
  0%, 100% { transform: scaleX(1);   opacity: .14; }
  50%      { transform: scaleX(.92); opacity: .08; }
}

/* Antenna wiggles. */
.arm-anim .antenna {
  transform-origin: 72px 48px;
  transform-box: view-box;
  animation: antenna-wobble 2.4s ease-in-out infinite;
}
@keyframes antenna-wobble {
  0%, 100% { transform: rotate(-5deg); }
  50%      { transform: rotate(5deg);  }
}

/* Occasional blink. */
.arm-anim .eye {
  transform-origin: center;
  transform-box: fill-box;
  animation: blink 4.6s ease-in-out infinite;
}
@keyframes blink {
  0%, 94%, 100% { transform: scaleY(1);  }
  96%, 98%      { transform: scaleY(.1); }
}

/* Right arm swings down to tap floor. */
.arm-anim .tap-arm {
  transform-origin: 102px 72px;
  transform-box: view-box;
  animation: arm-tap 2.4s cubic-bezier(.5,.05,.5,1) infinite;
}
@keyframes arm-tap {
  0%, 35%, 78%, 100% { transform: rotate(-6deg); }
  48%, 58%           { transform: rotate(6deg);  }
}

/* Hand flashes on impact. */
.arm-anim .hand { animation: hand-flash 2.4s ease-in-out infinite; }
@keyframes hand-flash {
  0%, 44%, 68%, 100% { fill: #b39cff; r: 5;   }
  50%, 56%           { fill: #ff9e8c; r: 6.2; }
}

/* Sound-wave arcs expand upward from tap point. */
.arm-anim .wave {
  opacity: 0;
  transform-origin: 175px 107px;
  transform-box: view-box;
  animation: wave-emit 2.4s ease-out infinite;
}
.arm-anim .wave.w1 { animation-delay: 0s;    }
.arm-anim .wave.w2 { animation-delay: .1s;   }
.arm-anim .wave.w3 { animation-delay: .2s;   }
@keyframes wave-emit {
  0%, 46%  { transform: scale(.15); opacity: 0;  }
  52%      { transform: scale(.55); opacity: .9; }
  95%,100% { transform: scale(1.7); opacity: 0;  }
}

/* Impact sparks — tiny colored dots that pop on tap. */
.arm-anim .spark {
  opacity: 0;
  transform-origin: center;
  transform-box: fill-box;
  animation: spark-pop 2.4s ease-out infinite;
}
.arm-anim .spark.s1 { animation-delay: 0s;   }
.arm-anim .spark.s2 { animation-delay: .04s; }
.arm-anim .spark.s3 { animation-delay: .06s; }
.arm-anim .spark.s4 { animation-delay: .02s; }
@keyframes spark-pop {
  0%, 46%  { opacity: 0; transform: scale(.4); }
  52%      { opacity: 1; transform: scale(1.3); }
  66%,100% { opacity: 0; transform: scale(1.6); }
}

@keyframes pulse-out {
  0%   { transform: translate(-50%,-50%) scale(.3); opacity: .95; }
  60%  { opacity: .25; }
  100% { transform: translate(-50%,-50%) scale(5); opacity: 0; }
}
@keyframes dot-throb {
  0%,100% { transform: translate(-50%,-50%) scale(1);   }
  50%     { transform: translate(-50%,-50%) scale(1.3); }
}

/* ============ ABSTRACT (editorial, no card) ============ */
.abstract h2 { max-width: 24ch; }
.abstract__body { max-width: 70ch; }

/* ============ PIPELINE (keep the aurora card) ========== */
.pipeline { padding: 24px 28px; }
.pipeline img {
  width: 100%; height: auto; display: block;
  margin-top: 14px;
  border-radius: var(--radius-sm);
  background: rgba(255,255,255,.55);
  padding: 8px;
}
.pipeline h2 { margin-top: 2px; max-width: 22ch; }
.pipeline p { color: #3a2f4a; max-width: 640px; margin-bottom: 0; }

/* ============ TASK RESULTS (sections, not cards) ======= */
.results {
  display: flex; flex-direction: column;
  gap: 22px;
  padding-top: 4px;
}
.section-heading {
  display: flex; align-items: baseline; gap: 14px;
  margin-bottom: 4px;
}
.section-heading h2 { font-size: 24px; margin-bottom: 0; }
.section-heading .muted { margin-bottom: 0; font-size: 13px; }

.task {
  padding-top: 18px;
  border-top: var(--hairline);
}
.task:first-child { border-top: none; padding-top: 0; }
.task h3 { margin-top: 0; font-size: 18px; }
.task__meta { display: flex; flex-direction: column; gap: 8px; }
.task__head { display: flex; align-items: center; gap: 12px; }
.task__icon {
  flex: 0 0 34px; width: 34px; height: 34px;
  border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--card-lav), var(--card-cream));
  color: var(--accent);
  box-shadow: 0 4px 14px rgba(110,123,255,.15);
}
.task--whiteboard .task__icon { background: linear-gradient(135deg, #e4f5ed, #f0ecff); color: #3ec29c; }
.task--carrot     .task__icon { background: linear-gradient(135deg, #fdf1e9, #ffe4d6); color: #ff8060; }
.task--lamp       .task__icon { background: linear-gradient(135deg, #fff3d4, #f0ecff); color: #c8942a; }

.task__plot {
  width: 100%; height: auto; display: block;
  margin-top: 8px; border-radius: var(--radius-sm);
  background: #fff;
  border: var(--hairline);
  padding: 4px;
}
.score { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 4px; }
.score__pill {
  font-size: 11px; font-weight: 700;
  padding: 5px 11px; border-radius: 999px;
  background: #fff; color: var(--ink);
  letter-spacing: .02em;
}
.score__pill--ours { background: var(--grad-ours); color: #4339a8; border: 1px solid rgba(179,156,255,.35); }
.score__pill--base { background: var(--grad-base); color: #b0325a; border: 1px solid rgba(255,158,140,.35); }

.task__videos {
  display: grid; grid-template-columns: 1fr 1fr; gap: 12px;
}
.task__videos figure { margin: 0; display: flex; flex-direction: column; gap: 6px; }
.task__videos figcaption {
  font-size: 11px; font-weight: 700;
  color: var(--ink-muted); letter-spacing: .08em; text-transform: uppercase;
}
.task__videos video {
  width: 100%; height: auto; display: block;
  border-radius: var(--radius-sm);
  background: #1a1420;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  box-shadow: 0 6px 22px rgba(26,20,32,.1);
}

/* Video coming-soon placeholder (no poster; site-only repo) */
.video-placeholder {
  width: 100%;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-sm);
  background: linear-gradient(135deg, #ece7f2, #ddd5e4);
  border: 1px solid rgba(26,20,32,.08);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  color: rgba(26,20,32,.42);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  font-weight: 700;
  box-shadow: 0 6px 22px rgba(26,20,32,.06);
}
.video-placeholder svg { opacity: .55; }

/* ============ RESULTS TABLE (editorial) ================ */
.results-table {
  width: 100%; border-collapse: collapse; margin-top: 12px;
  font-size: 14px;
}
.results-table th, .results-table td {
  padding: 10px 12px; text-align: right;
  border-bottom: 1px solid rgba(26,20,32,.06);
}
.results-table thead th {
  font-size: 11px; text-transform: uppercase; letter-spacing: .1em;
  color: var(--ink-muted); font-weight: 700;
  border-bottom: 2px solid rgba(26,20,32,.12);
}
.results-table tbody th { text-align: left; color: var(--ink-muted); font-weight: 600; }
.results-table tbody tr:last-child td,
.results-table tbody tr:last-child th { border-bottom: none; }

/* ============ BIBTEX (card, for code emphasis) ========= */
.bibtex { display: flex; flex-direction: column; }
.bibtex__head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.bibtex pre {
  margin: 0; padding: 16px 18px;
  background: rgba(255,255,255,.05);
  border-radius: var(--radius-sm);
  font-size: 11.5px; line-height: 1.65;
  color: #e6ddff;
  overflow-x: auto;
  white-space: pre;
  border: 1px solid rgba(255,255,255,.08);
}
.bibtex .btn {
  padding: 6px 8px 6px 14px;
  font-size: 12px;
  background: #fff; color: var(--ink);
  box-shadow: none;
}
.bibtex .btn__arrow { background: #ff9e8c; color: #fff; }

/* ============ FOOTER =================================== */
.page-footer {
  display: flex; gap: 14px; flex-wrap: wrap;
  justify-content: space-between; align-items: center;
  margin-top: 20px;
  font-size: 12px; color: var(--ink-muted);
  padding: 18px 6px 0;
  border-top: var(--hairline);
}

/* Scroll-reveal ----------------------------------------- */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity .7s ease-out, transform .7s ease-out; }
.reveal.is-visible { opacity: 1; transform: none; }
@media (prefers-reduced-motion: reduce) {
  .reveal { opacity: 1; transform: none; transition: none; }
  .card--aurora, .contact-pulse .ring, .contact-pulse .dot { animation: none !important; }
}

/* Responsive -------------------------------------------- */
@media (max-width: 820px) {
  .page { padding: 36px 18px 60px; gap: 32px; }
  h1 { font-size: 38px; }
  .hero h1 { font-size: 40px; }
  h2 { font-size: 22px; }
  .row--2, .row--hero, .row--task { grid-template-columns: 1fr; }
  .task__videos { grid-template-columns: 1fr; }
  .hero__visual { max-width: 340px; margin: 0 auto; }
}
