/* ============================================================
   Primitives motion + Nav + Hero
   ============================================================ */

.rv-hidden { transform: translateY(var(--rv-y, 26px)); }

.magnetic { transition: transform 350ms var(--ease); will-change: transform; }
.tilt { transition: transform 250ms var(--ease-soft); transform-style: preserve-3d; }

/* word swapper — ghost sizes the cell. Resting state is the visible base
   (transform:none); entrance animates from a SMALL in-cell offset so a frozen
   first frame (screenshots/print/background) still shows the word. */
.wordswap { position: relative; display: inline-grid; grid-template-areas: "stack"; vertical-align: top; line-height: inherit; padding-bottom: 0.06em; }
.wordswap-ghost { grid-area: stack; visibility: hidden; white-space: nowrap; line-height: inherit; }
.wordswap-word {
  grid-area: stack; white-space: nowrap; line-height: inherit;
  color: var(--tang-ink); opacity: 1; transform: none;
}
.wordswap-word.in { animation: wordIn 400ms var(--ease); }
.wordswap-word.out { animation: wordOut 280ms var(--ease-soft) forwards; }
@keyframes wordIn { from { transform: translateY(20%); } to { transform: none; } }
@keyframes wordOut { from { opacity: 1; transform: none; } to { opacity: 0; transform: translateY(-22%); } }

/* ---------- NAV ---------- */
.nav {
  position: fixed; top: 0; left: 0; right: 0; z-index: 90;
  transition: background 260ms var(--ease-soft), box-shadow 260ms var(--ease-soft), border-color 260ms;
  border-bottom: 1px solid transparent;
}
/* full-width scrim once scrolled, so content passing under the bar is masked */
.nav.is-scrolled {
  background: color-mix(in srgb, var(--paper) 95%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(1.25);
  backdrop-filter: blur(12px) saturate(1.25);
  border-bottom-color: var(--line);
}
.nav-inner {
  display: flex; align-items: center; justify-content: space-between;
  height: 76px; max-width: var(--wrap); margin: 0 auto; padding-inline: var(--gutter);
}
.nav-pill {
  display: flex; align-items: center; gap: 14px;
  padding: 9px 9px 9px 18px; border-radius: 100px;
  background: color-mix(in srgb, var(--card) 80%, transparent);
  -webkit-backdrop-filter: blur(12px) saturate(1.3);
  backdrop-filter: blur(12px) saturate(1.3);
  border: 1.5px solid var(--line);
  transition: box-shadow 250ms, border-color 250ms, background 250ms;
}
/* on the scrim the pill no longer needs its own chip background */
.nav.is-scrolled .nav-pill { background: transparent; border-color: transparent; }
.nav-name { font-family: var(--display); font-weight: 700; font-size: 16px; letter-spacing: -0.02em; white-space: nowrap; }
.nav-name b { color: var(--tang); }
.nav-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); animation: live 2.6s infinite; }
@keyframes live { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 50%, transparent); } 70% { box-shadow: 0 0 0 8px transparent; } 100% { box-shadow: 0 0 0 0 transparent; } }
.nav-cta { font-family: var(--body); font-weight: 600; font-size: 15px; padding: 10px 18px; border-radius: 100px; background: var(--ink); color: var(--paper); border: none; cursor: pointer; transition: background 160ms, transform 200ms var(--ease); white-space: nowrap; }
.nav-cta:hover { background: var(--tang); transform: translateY(-1px); }
.nav-links { display: flex; align-items: center; gap: 4px; }
.nav-link { font-size: 14.5px; font-weight: 600; color: var(--ink-soft); padding: 8px 14px; border-radius: 100px; transition: color 150ms, background 150ms; white-space: nowrap; }
.nav-link:hover { color: var(--ink); background: var(--paper-2); }
@media (max-width: 720px) { .nav-links { display: none; } }

/* ---------- HERO ---------- */
.hero { min-height: 100svh; display: flex; flex-direction: column; justify-content: center; padding-top: 104px; padding-bottom: var(--s5); overflow: clip; }
.hero-grid { display: grid; grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); gap: clamp(28px, 5vw, 72px); align-items: center; }
.hero-top { display: flex; align-items: center; gap: 14px; flex-wrap: wrap; margin-bottom: clamp(16px, 2.6vh, 28px); }
.hero-hello { font-family: var(--mono); font-size: 14px; color: var(--ink-soft); }
.hero-title { font-size: clamp(30px, 4.5vw, 66px); line-height: 0.98; letter-spacing: -0.035em; }
.hero-title .row { display: block; white-space: nowrap; }
.hero-title .why-line { display: block; white-space: nowrap; line-height: 1.14; padding-bottom: 0.04em; }
.hero-title .wordswap { font-style: italic; }
.hero-sub { margin-top: clamp(20px, 2.6vh, 30px); max-width: 500px; }
.hero-cta-row { margin-top: clamp(26px, 3.6vh, 40px); display: flex; gap: 14px; flex-wrap: wrap; align-items: center; }

/* researcher's index card */
.hero-aside { justify-self: center; width: 100%; max-width: 360px; }
.filecard {
  position: relative; background: var(--card);
  border: 2.5px solid var(--ink); border-radius: 4px;
  box-shadow: 8px 9px 0 var(--ink);
  padding: 18px 18px 20px; transform: rotate(1.4deg);
  transition: transform 300ms var(--ease), box-shadow 300ms var(--ease);
}
.filecard::before {
  content: ""; position: absolute; top: -11px; left: 50%; transform: translateX(-50%) rotate(-1.5deg);
  width: 76px; height: 22px; background: color-mix(in srgb, var(--marker) 75%, transparent);
  border: 1.5px solid color-mix(in srgb, var(--ink) 30%, transparent); border-radius: 2px;
}
.hero-aside:hover .filecard { transform: rotate(0deg); box-shadow: 10px 12px 0 var(--ink); }
.filecard-top { display: flex; align-items: center; justify-content: space-between; padding-bottom: 12px; margin-bottom: 12px; border-bottom: 2px dashed var(--line-2); }
.filecard-tab { font-size: 12px; font-weight: 700; letter-spacing: 0.1em; color: var(--ink); }
.filecard-no { font-size: 12px; color: var(--ink-faint); }

/* case photo */
.filecard-photo {
  position: relative; border-radius: 3px; overflow: hidden;
  background: var(--paper-2); aspect-ratio: 5 / 4; margin-bottom: 14px;
  border: 1.5px solid var(--line-2);
}
.filecard-photo-bg {
  position: absolute; left: 50%; bottom: -14%; transform: translateX(-50%);
  width: 78%; aspect-ratio: 1; border-radius: 50%;
  background: radial-gradient(circle at 50% 40%, color-mix(in srgb, var(--marker) 80%, transparent), color-mix(in srgb, var(--marker) 40%, transparent) 62%, transparent 70%);
}
.filecard-img {
  position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
  height: 112%; width: auto; object-fit: contain; object-position: bottom center;
  filter: drop-shadow(0 6px 10px rgba(28,24,21,0.18));
}
.filecard-bubble {
  position: absolute; top: 12px; right: 10px; z-index: 2;
  background: var(--ink); color: var(--paper);
  font-size: 12px; font-weight: 700; padding: 7px 12px; border-radius: 12px 12px 12px 2px;
  transform: rotate(3deg);
}
.filecard-bubble::after {
  content: ""; position: absolute; left: 14px; bottom: -6px;
  border: 6px solid transparent; border-top-color: var(--ink); border-bottom: 0;
}
.filecard-stamp {
  position: absolute; left: 10px; bottom: 10px; z-index: 2;
  font-family: var(--mono); font-size: 11px; font-weight: 700; letter-spacing: 0.06em;
  color: var(--tang-ink); border: 2px solid var(--tang-ink); border-radius: 5px;
  padding: 3px 7px; transform: rotate(-6deg); opacity: 0.92;
  background: color-mix(in srgb, var(--card) 70%, transparent);
}

.filecard-rows { margin: 0; display: flex; flex-direction: column; gap: 11px; }
.filecard-row { display: grid; grid-template-columns: 70px 1fr; gap: 12px; align-items: baseline; }
.filecard-row dt { font-size: 10.5px; text-transform: uppercase; letter-spacing: 0.04em; color: var(--tang-ink); margin: 0; }
.filecard-row dd { margin: 0; font-size: 14.5px; font-weight: 500; line-height: 1.25; color: var(--ink); }
.filecard-live { display: inline-flex; align-items: center; gap: 7px; }
.filecard-livedot { width: 7px; height: 7px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 0 color-mix(in srgb, var(--ok) 55%, transparent); animation: live 2.6s infinite; flex-shrink: 0; }

@media (max-width: 880px) {
  .hero { min-height: auto; }
  .hero-grid { grid-template-columns: 1fr; gap: 40px; }
  .hero-aside { justify-self: start; margin-left: 8px; }
}

.hero-scroll { display: flex; align-items: center; gap: 10px; margin-top: clamp(34px, 6vh, 64px); font-family: var(--mono); font-size: 12.5px; color: var(--ink-faint); text-transform: uppercase; letter-spacing: 0.08em; }
.hero-scroll .line { width: 46px; height: 1.5px; background: var(--line-2); position: relative; overflow: hidden; }
.hero-scroll .line::after { content: ""; position: absolute; inset: 0; width: 40%; background: var(--tang); animation: scrollLine 1.8s var(--ease-soft) infinite; }
@keyframes scrollLine { 0% { transform: translateX(-100%); } 100% { transform: translateX(280%); } }

/* ---------- marquee strip ---------- */
.marquee { border-block: 2px solid var(--ink); background: var(--ink); color: var(--paper); overflow: hidden; padding-block: 14px; }
.marquee-track { display: flex; gap: 0; white-space: nowrap; width: max-content; animation: marq 26s linear infinite; }
.marquee:hover .marquee-track { animation-play-state: paused; }
.marquee-item { font-family: var(--display); font-weight: 700; font-size: clamp(20px, 2.6vw, 32px); letter-spacing: -0.02em; padding-inline: 28px; display: inline-flex; align-items: center; gap: 28px; }
.marquee-item::after { content: "✦"; color: var(--tang); font-size: 0.7em; }
@keyframes marq { to { transform: translateX(-50%); } }
@media (prefers-reduced-motion: reduce) { .marquee-track { animation: none; } }
