/* =========================================================
   Wataru Ikeda — showcase
   An event camera's view of the world, laid out for scanning:
   ON events (warm) / OFF events (cool) on near-black.
   ========================================================= */

:root {
  --bg: #0a0b0d;
  --bg-2: #111317;
  --fg: #ecebe6;
  --fg-2: #b8b7b1;
  --muted: #84838d;
  --line: rgba(236, 235, 230, 0.1);
  --line-2: rgba(236, 235, 230, 0.2);
  --on: #ff5c38;
  --off: #408cff;

  --f-sans: "Inter Tight", "Noto Sans JP", system-ui, sans-serif;
  --f-jp: "Inter Tight", "Noto Sans JP", system-ui, sans-serif;
  --f-mono: "JetBrains Mono", ui-monospace, "SFMono-Regular", monospace;

  --max: 1120px;
  --gutter: clamp(16px, 4vw, 40px);
  --ease: cubic-bezier(0.2, 0.7, 0.1, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 72px;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-jp);
  font-size: 15px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, p, ul, ol, dl, dd, figure { margin: 0; padding: 0; }
ul, ol { list-style: none; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
em { font-style: normal; }
::selection { background: var(--on); color: var(--bg); }
:focus-visible { outline: 1px solid var(--on); outline-offset: 3px; }
:lang(ja) h3, :lang(ja) .hero-lede, :lang(ja) .statement { word-break: auto-phrase; }

.sr {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.skip {
  position: fixed; top: 8px; left: 8px; z-index: 200;
  padding: 8px 14px; background: var(--fg); color: var(--bg);
  font: 500 12px/1 var(--f-mono);
  transform: translateY(-200%);
}
.skip:focus { transform: none; }

.grain {
  position: fixed; inset: 0; z-index: 90; pointer-events: none; opacity: 0.035;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}

.progress { position: fixed; top: 0; left: 0; right: 0; height: 2px; z-index: 120; pointer-events: none; }
.progress span {
  display: block; height: 100%;
  background: linear-gradient(90deg, var(--off), var(--on));
  transform-origin: 0 50%; transform: scaleX(var(--p, 0));
}

/* ---------- nav ---------- */
.nav {
  position: fixed; inset: 0 0 auto 0; z-index: 100;
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  height: 56px; padding: 0 var(--gutter);
  border-bottom: 1px solid transparent;
  transition: background 0.3s, border-color 0.3s, transform 0.4s var(--ease);
}
.nav.is-scrolled {
  background: rgba(10, 11, 13, 0.8);
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  border-bottom-color: var(--line);
}
.nav.is-hidden { transform: translateY(-100%); }
.nav-logo { font: 600 16px/1 var(--f-sans); letter-spacing: -0.02em; }
.nav-logo i { font-style: normal; color: var(--on); margin: 0 1px; }

.nav-links {
  display: flex; gap: 22px;
  font: 500 12px/1 var(--f-mono); letter-spacing: 0.02em;
}
.nav-links a { position: relative; display: inline-flex; gap: 5px; padding: 6px 0; color: var(--fg-2); transition: color 0.2s; }
.nav-links a span { color: var(--muted); font-size: 10px; }
.nav-links a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--on); transform: scaleX(0); transform-origin: left; transition: transform 0.3s var(--ease);
}
.nav-links a:hover, .nav-links a.is-active { color: var(--fg); }
.nav-links a:hover::after, .nav-links a.is-active::after { transform: scaleX(1); }

.nav-right { display: flex; align-items: center; gap: 12px; }
.lang { display: flex; font: 500 11px/1 var(--f-mono); border: 1px solid var(--line-2); border-radius: 99px; padding: 2px; }
.lang a { padding: 5px 8px; border-radius: 99px; color: var(--muted); }
.lang a[aria-current] { background: var(--fg); color: var(--bg); }
.lang a:not([aria-current]):hover { color: var(--fg); }
.classic-link { font: 500 12px/1 var(--f-mono); color: var(--fg-2); padding: 8px 2px; }
.classic-link:hover { color: var(--on); }
.pill {
  display: inline-flex; align-items: center; gap: 5px;
  font: 500 12px/1 var(--f-mono); padding: 8px 12px; border-radius: 99px;
  background: var(--fg); color: var(--bg); transition: background 0.2s;
}
.pill:hover { background: var(--on); }
.arrow { display: inline-block; transition: transform 0.3s var(--ease); }
a:hover .arrow { transform: translate(2px, -2px); }

.nav-toggle { display: none; width: 36px; height: 36px; position: relative; border: 1px solid var(--line-2); border-radius: 50%; }
.nav-toggle span:not(.sr) { position: absolute; left: 11px; right: 11px; height: 1px; background: var(--fg); transition: transform 0.3s var(--ease); }
.nav-toggle span:nth-child(1) { top: 14px; }
.nav-toggle span:nth-child(2) { top: 20px; }
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(3px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { transform: translateY(-3px) rotate(-45deg); }

.menu {
  position: fixed; inset: 0; z-index: 99; background: var(--bg);
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 80px var(--gutter) 28px;
}
.menu[hidden] { display: none; }
.menu nav { display: flex; flex-direction: column; }
.menu nav a {
  display: flex; align-items: baseline; gap: 12px;
  font: 500 28px/1.2 var(--f-sans); letter-spacing: -0.02em;
  padding: 12px 0; border-bottom: 1px solid var(--line);
}
.menu nav a span { font: 500 11px/1 var(--f-mono); color: var(--muted); }
.menu-foot { display: flex; gap: 20px; font: 500 13px/1 var(--f-mono); color: var(--fg-2); }

@media (max-width: 960px) {
  .nav-links { display: none; }
  .nav-toggle { display: block; }
}
@media (max-width: 560px) {
  .nav .pill, .nav .classic-link { display: none; }
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  height: min(76vh, 680px); min-height: 520px;
  overflow: hidden; isolation: isolate;
  border-bottom: 1px solid var(--line);
}
.sensor { position: absolute; inset: 0; z-index: -1; }
.sensor canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.sensor-events { image-rendering: pixelated; image-rendering: crisp-edges; }
.sensor::after {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background:
    radial-gradient(120% 90% at 70% 45%, transparent 45%, rgba(10, 11, 13, 0.7) 100%),
    linear-gradient(90deg, rgba(10, 11, 13, 0.75) 0%, rgba(10, 11, 13, 0.3) 45%, transparent 60%);
}

.hud {
  position: absolute; top: 72px; z-index: 2;
  font: 400 10.5px/1.7 var(--f-mono); letter-spacing: 0.05em; color: var(--fg-2);
  font-variant-numeric: tabular-nums;
}
.hud-tl { left: var(--gutter); }
.hud-tr { right: var(--gutter); text-align: right; }
.hud span { color: var(--fg); }
.hud .unit { font-style: normal; }
.rec { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--on); margin-right: 7px; vertical-align: 1px; animation: blink 1.4s steps(2) infinite; }
@keyframes blink { 50% { opacity: 0.15; } }

.hero-content {
  position: absolute; left: 0; right: 0; bottom: 84px;
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
  pointer-events: none;
}
.hero-kicker {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  font: 500 12px/1 var(--f-mono); letter-spacing: 0.06em; color: var(--fg-2);
}
.hero-kicker::before { content: ""; width: 22px; height: 1px; background: var(--on); }
.hero-title {
  font: 600 clamp(44px, 6.4vw, 88px)/0.95 var(--f-sans);
  letter-spacing: -0.04em;
}
.hero-title .line { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.04em; }
.hero-title .line + .line { margin-left: 0.22em; }
.hero-title .line > span { display: inline-block; }
.hero-title sup {
  margin-left: 0.4em; vertical-align: 0.9em;
  font: 500 clamp(12px, 1.1vw, 15px)/1 var(--f-jp); letter-spacing: 0.16em; color: var(--fg-2);
}
.hero-lede {
  margin-top: 16px; max-width: 34em;
  font: 400 clamp(15px, 1.25vw, 18px)/1.65 var(--f-jp); color: var(--fg-2);
}
.hero-lede em { color: var(--fg); border-bottom: 1px solid var(--on); }

.hero-foot {
  position: absolute; left: var(--gutter); right: var(--gutter); bottom: 22px; z-index: 2;
  display: flex; justify-content: space-between; align-items: center; gap: 20px;
  font: 400 10.5px/1.5 var(--f-mono); letter-spacing: 0.04em; color: var(--muted);
}
.legend { display: flex; gap: 16px; }
.legend li { display: flex; align-items: center; gap: 7px; }
.legend i { width: 6px; height: 6px; display: inline-block; }
.legend .on { background: var(--on); }
.legend .off { background: var(--off); }
.legend .pose { border: 1px solid var(--fg); }
.scroll-cue { display: flex; align-items: center; gap: 8px; color: var(--fg-2); }
.scroll-cue i { width: 1px; height: 18px; background: var(--fg-2); }

@media (max-width: 900px) {
  .sensor::after {
    background:
      radial-gradient(120% 80% at 50% 40%, transparent 30%, rgba(10, 11, 13, 0.8) 100%),
      linear-gradient(0deg, rgba(10, 11, 13, 0.95) 0%, rgba(10, 11, 13, 0.45) 45%, transparent 70%);
  }
  .hud-tr p:nth-child(3), .hero-hint, .scroll-cue { display: none; }
}
@media (max-width: 560px) {
  .hero { height: 78svh; }
  .hud { top: 66px; font-size: 9.5px; }
  .hero-content { bottom: 56px; }
  .hero-title .line { display: block; }
  .hero-title .line + .line { margin-left: 0; }
  .legend li:nth-child(3) { display: none; }
}

/* intro */
.js .hero-title .line > span { transform: translateY(105%); }
.js .reveal-up { opacity: 0; transform: translateY(10px); }
.js .hud { opacity: 0; }
.is-ready .hero-title .line > span { transform: none; transition: transform 1s var(--ease); }
.is-ready .hero-title .line:nth-child(2) > span { transition-delay: 0.06s; }
.is-ready .reveal-up { opacity: 1; transform: none; transition: opacity 0.8s var(--ease) 0.35s, transform 0.8s var(--ease) 0.35s; }
.is-ready .hud { opacity: 1; transition: opacity 0.8s 0.6s; }

/* viewfinder corners framing the sensor */
.viewfinder { position: absolute; inset: 62px calc(var(--gutter) - 12px) 44px; pointer-events: none; z-index: 1; }
.viewfinder i { position: absolute; width: 14px; height: 14px; border: 0 solid var(--line-2); }
.viewfinder i:nth-child(1) { top: 0; left: 0; border-top-width: 1px; border-left-width: 1px; }
.viewfinder i:nth-child(2) { top: 0; right: 0; border-top-width: 1px; border-right-width: 1px; }
.viewfinder i:nth-child(3) { bottom: 0; left: 0; border-bottom-width: 1px; border-left-width: 1px; }
.viewfinder i:nth-child(4) { bottom: 0; right: 0; border-bottom-width: 1px; border-right-width: 1px; }
.hero { cursor: crosshair; }
.hero a { cursor: pointer; }

/* ---------- latest ---------- */
.latest {
  max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter);
  display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 24px; align-items: stretch;
}
.latest-label {
  padding: 18px 0; font: 500 12px/1.9 var(--f-mono); color: var(--on);
  display: flex; align-items: baseline; gap: 8px;
}
.latest-label::before {
  content: ""; width: 6px; height: 6px; border-radius: 50%; background: var(--on);
  animation: blink 1.4s steps(2) infinite; transform: translateY(-1px);
}
.latest-list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); }
.latest-list li { border-left: 1px solid var(--line); }
.latest-list a {
  display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 10px; height: 100%;
  padding: 16px 18px; transition: background 0.2s;
}
.latest-list a:hover { background: var(--bg-2); }
.latest-list a:hover b { color: var(--on); }
.latest-list time { font: 500 11px/1.9 var(--f-mono); color: var(--fg-2); }
.latest-meta { font-size: 11.5px; line-height: 1.9; color: var(--muted); }
.latest-list b {
  flex-basis: 100%; margin-top: 4px; font-size: 13.5px; font-weight: 500; line-height: 1.5;
  transition: color 0.2s;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
@media (max-width: 860px) {
  .latest { grid-template-columns: 1fr; gap: 0; }
  .latest-label { padding: 16px 0 6px; }
  .latest-list { grid-template-columns: 1fr; border-top: 1px solid var(--line); }
  .latest-list li { border-left: 0; border-bottom: 1px solid var(--line); }
  .latest-list a { padding: 12px 0; }
}

/* ---------- sections ---------- */
.section {
  max-width: var(--max); margin: 0 auto;
  padding: 72px var(--gutter) 0;
}
.section-head {
  display: flex; align-items: baseline; gap: 14px;
  padding-bottom: 14px; margin-bottom: 4px;
  border-bottom: 1px solid var(--line-2);
}
.section-head { position: relative; }
/* an "edge" sweeping along the rule fires a short train of ON/OFF pixels */
.section-head::after {
  content: ""; position: absolute; left: 0; bottom: -2px; width: 96px; height: 3px;
  background: repeating-linear-gradient(90deg, var(--on) 0 3px, transparent 3px 7px, var(--off) 7px 10px, transparent 10px 15px);
  opacity: 0; pointer-events: none;
}
.section-head.is-in::after { animation: sweep 1.4s var(--ease) 0.1s both; }
@keyframes sweep {
  0% { opacity: 0; transform: translateX(0); }
  12% { opacity: 1; }
  80% { opacity: 1; }
  100% { opacity: 0; transform: translateX(calc(var(--w, 1040px) - 96px)); }
}
.section-index { font: 500 12px/1 var(--f-mono); color: var(--on); }
.section-title {
  flex: 1; display: flex; align-items: baseline; justify-content: space-between; gap: 16px;
  font: 600 24px/1.2 var(--f-sans); letter-spacing: -0.02em;
}
.section-title small { font: 400 12px/1.4 var(--f-jp); color: var(--muted); letter-spacing: 0.06em; }
.split { white-space: nowrap; }
.split .ch { display: inline-block; }
.split .sp { display: inline-block; width: 0.26em; }

.js .reveal { opacity: 0; transform: translateY(12px); }
.js .reveal.is-in { opacity: 1; transform: none; transition: opacity 0.6s var(--ease), transform 0.6s var(--ease); transition-delay: var(--d, 0s); }

.link {
  color: var(--fg); border-bottom: 1px solid var(--line-2);
  transition: color 0.2s, border-color 0.2s;
}
.link:hover { color: var(--on); border-color: var(--on); }
.me { font-weight: 600; color: var(--fg); }
.authors { color: var(--fg-2); font-size: 13.5px; line-height: 1.6; }
.venue { color: var(--muted); font-size: 12.5px; line-height: 1.6; }
.footnote { margin-top: 12px; font: 400 11px/1 var(--f-mono); color: var(--muted); }

/* shared row: label column + content + aside */
.award, .pub, .exp-item summary, .grant-table li {
  display: grid; gap: 4px 24px;
  grid-template-columns: 136px minmax(0, 1fr) auto;
}

/* ---------- about ---------- */
.about-grid {
  display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 36px;
  padding-top: 28px;
}
.portrait-frame { aspect-ratio: 1; border-radius: 50%; overflow: hidden; }
.portrait img { width: 100%; height: 100%; object-fit: cover; }
.portrait figcaption {
  display: flex; justify-content: space-between; margin-top: 10px;
  font: 400 11px/1 var(--f-mono); color: var(--muted);
}
.portrait figcaption span:first-child { font-family: var(--f-jp); color: var(--fg-2); }

.statement { font-size: 16.5px; line-height: 1.85; color: var(--fg); max-width: 46em; }
.statement em { color: var(--on); }

.facts {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 32px;
  margin-top: 20px; border-top: 1px solid var(--line);
}
.facts > div {
  display: grid; grid-template-columns: 88px minmax(0, 1fr); gap: 12px;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.facts dt { font: 400 11px/2 var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.facts dd { font-size: 14px; }
.facts dd small { display: block; font: 400 11px/1.4 var(--f-mono); color: var(--muted); }
.facts .links { display: flex; flex-wrap: wrap; gap: 4px 14px; }

.tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 16px; }
.tags li {
  font: 400 11.5px/1 var(--f-mono); padding: 7px 10px;
  border: 1px solid var(--line-2); border-radius: 99px; color: var(--fg-2);
}

.stats {
  display: grid; grid-template-columns: repeat(4, minmax(0, 1fr));
  margin-top: 20px; border: 1px solid var(--line); border-radius: 10px; overflow: hidden;
}
.stats li { padding: 14px 16px; border-right: 1px solid var(--line); display: flex; align-items: baseline; gap: 10px; }
.stats li:last-child { border-right: 0; }
.stats b { font: 500 30px/1 var(--f-sans); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.stats span { font: 400 11px/1.35 var(--f-mono); color: var(--fg-2); }
.stats small { display: block; font-family: var(--f-jp); color: var(--muted); }

@media (max-width: 560px) {
  .section-title { flex-wrap: wrap; row-gap: 2px; }
}
@media (max-width: 760px) {
  .about-grid { grid-template-columns: 1fr; gap: 20px; }
  .portrait { width: 132px; }
  .facts { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .stats li:nth-child(2) { border-right: 0; }
  .stats li:nth-child(-n + 2) { border-bottom: 1px solid var(--line); }
}

/* ---------- awards ---------- */
.award {
  grid-template-columns: 136px minmax(0, 1fr) 240px;
  padding: 18px 0; border-bottom: 1px solid var(--line);
}
.award-date { font: 400 12px/1.9 var(--f-mono); color: var(--muted); }
.award-main { display: flex; flex-direction: column; gap: 3px; }
.award-main h3 { font-size: 16.5px; font-weight: 600; line-height: 1.5; }
.award-main h3::before { content: "★ "; color: var(--on); }
.award-paper { font-size: 14px; color: var(--fg); line-height: 1.6; }
.award-stat { display: flex; flex-direction: column; gap: 6px; }
.award-pct { font: 500 26px/1 var(--f-sans); letter-spacing: -0.03em; font-variant-numeric: tabular-nums; }
.award-pct small { font-size: 0.5em; color: var(--fg-2); margin-left: 2px; letter-spacing: 0; }
.award-note { font-size: 11.5px; line-height: 1.55; color: var(--muted); }
.dots svg { display: block; width: 100%; height: auto; }
.dots rect { fill: rgba(236, 235, 230, 0.16); }
.dots rect.k { fill: var(--on); }

@media (max-width: 860px) {
  .award { grid-template-columns: minmax(0, 1fr); }
  .award-stat { max-width: 320px; }
}

/* ---------- publications ---------- */
.filters { display: flex; flex-wrap: wrap; gap: 6px; padding: 16px 0 10px; }
.filters button {
  font: 500 12px/1 var(--f-mono); padding: 8px 12px;
  border: 1px solid var(--line-2); border-radius: 99px; color: var(--fg-2);
  transition: background 0.2s, color 0.2s, border-color 0.2s;
}
.filters sup { font-size: 9px; margin-left: 3px; vertical-align: 5px; color: var(--muted); }
.filters button:hover { border-color: var(--fg); color: var(--fg); }
.filters button[aria-selected="true"] { background: var(--fg); color: var(--bg); border-color: var(--fg); }
.filters button[aria-selected="true"] sup { color: var(--bg); }

.pub-list { border-top: 1px solid var(--line); }
.pub { position: relative; padding: 14px 0; border-bottom: 1px solid var(--line); transition: background 0.2s; }
.pub::before {
  content: ""; position: absolute; left: -12px; top: 14px; bottom: 14px; width: 2px;
  background: linear-gradient(var(--on), var(--off));
  transform: scaleY(0); transform-origin: top; transition: transform 0.35s var(--ease);
}
.pub:hover::before { transform: scaleY(1); }
.pub[hidden] { display: none; }
.pub:hover { background: linear-gradient(90deg, transparent, var(--bg-2) 8%, var(--bg-2) 92%, transparent); }
.pub.same-year .pub-year { visibility: hidden; }
.pub-year { font: 500 12px/1.9 var(--f-mono); color: var(--muted); }
.pub-main { display: flex; flex-direction: column; gap: 2px; }
.pub-main h3 { font-size: 15.5px; font-weight: 600; line-height: 1.5; }
.pub-main h3 a:hover { color: var(--on); }
.pub-main h3 .arrow { font-size: 0.8em; margin-left: 4px; color: var(--muted); }
.pub-tags { display: flex; flex-wrap: wrap; align-content: flex-start; justify-content: flex-end; gap: 4px; max-width: 260px; }
.pub-tags li {
  font: 400 10.5px/1 var(--f-mono); padding: 5px 8px; border-radius: 99px;
  border: 1px solid var(--line-2); color: var(--fg-2); white-space: nowrap;
}
:lang(ja) .pub-tags li { font-family: var(--f-mono), "Noto Sans JP", sans-serif; }
.pub-tags .hl { border-color: rgba(64, 140, 255, 0.55); color: #9cc2ff; }
.pub-tags .award-tag { border-color: rgba(255, 92, 56, 0.65); color: #ffab98; }
.pub-tags .award-tag::before { content: "★ "; }
.pub-tags a:hover { color: var(--on); }

@media (max-width: 860px) {
  .pub { grid-template-columns: 56px minmax(0, 1fr); }
  .pub-tags { grid-column: 2; justify-content: flex-start; max-width: none; margin-top: 6px; }
}

/* ---------- experience ---------- */
.exp-item { border-bottom: 1px solid var(--line); }
.exp-item summary {
  grid-template-columns: 136px minmax(0, 1fr) 24px;
  align-items: baseline; padding: 16px 0 8px; list-style: none; cursor: pointer;
}
.exp-item summary::-webkit-details-marker { display: none; }
.exp-period { font: 400 12px/1.9 var(--f-mono); color: var(--muted); grid-row: 1 / span 2; }
.exp-org { font-size: 17px; font-weight: 600; line-height: 1.4; transition: color 0.2s; }
.exp-role { grid-column: 2; font-size: 13.5px; color: var(--fg-2); }
.exp-toggle { grid-column: 3; grid-row: 1; position: relative; width: 14px; height: 14px; align-self: center; }
.exp-toggle::before, .exp-toggle::after {
  content: ""; position: absolute; left: 1px; right: 1px; top: 50%; height: 1px; background: var(--fg-2);
  transition: transform 0.3s var(--ease);
}
.exp-toggle::after { transform: rotate(90deg); }
.exp-item[open] .exp-toggle::after { transform: rotate(0); }
.exp-item summary:hover .exp-org { color: var(--on); }

.exp-body { display: grid; grid-template-columns: 136px minmax(0, 1fr); gap: 6px 24px; padding: 0 0 16px; }
.exp-body > * { grid-column: 2; }
.exp-body ul:not(.chips) li {
  position: relative; padding: 1px 0 1px 16px; font-size: 13.5px; color: var(--fg-2);
}
.exp-body ul:not(.chips) li::before {
  content: ""; position: absolute; left: 2px; top: 0.75em; width: 5px; height: 5px; background: var(--on);
}
.exp-body ul:not(.chips) li:nth-child(even)::before { background: var(--off); }
.chips { display: flex; flex-wrap: wrap; gap: 4px; }
.chips li { font: 400 10.5px/1 var(--f-mono); padding: 5px 8px; border: 1px solid var(--line-2); border-radius: 99px; color: var(--fg-2); }
.exp-ref { font-size: 12.5px; line-height: 1.8; color: var(--muted); }

@media (max-width: 760px) {
  .exp-item summary { grid-template-columns: minmax(0, 1fr) 24px; }
  .exp-period { grid-row: auto; grid-column: 1; }
  .exp-org, .exp-role { grid-column: 1; }
  .exp-toggle { grid-column: 2; grid-row: 1 / span 3; }
  .exp-body { grid-template-columns: minmax(0, 1fr); }
  .exp-body > * { grid-column: 1; }
}

/* ---------- grants & more ---------- */
.grant-table { padding-top: 16px; }
.grant-table .sub {
  display: flex; gap: 10px; align-items: baseline;
  font-size: 13px; font-weight: 600; color: var(--fg-2); padding: 8px 0;
}
.grant-table .sub span { font: 400 10.5px/1 var(--f-mono); color: var(--muted); text-transform: uppercase; }
.grant-table ul { border-top: 1px solid var(--line); margin-bottom: 16px; }
.grant-table li { align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--line); }
.g-period { grid-column: 1; grid-row: 1; font: 400 12px/1.9 var(--f-mono); color: var(--muted); }
.g-name { grid-column: 2; grid-row: 1; font-size: 14.5px; font-weight: 500; }
.g-amt { grid-column: 3; grid-row: 1; text-align: right; font: 500 15px/1.5 var(--f-sans); font-variant-numeric: tabular-nums; }
.g-amt small { display: block; font-size: 11.5px; font-weight: 400; color: var(--fg-2); }

.cards { margin-top: 40px; }
.card-index { display: none; }
.card + .card { margin-top: 40px; }
.card h3 {
  display: flex; gap: 12px; align-items: baseline;
  font-size: 17px; font-weight: 600; color: var(--fg); padding: 0 0 10px;
}
.card h3 span { font: 400 11.5px/1 var(--f-mono); color: var(--muted); text-transform: uppercase; letter-spacing: 0.04em; }
.card ul { border-top: 1px solid var(--fg-2); }
.card li {
  display: grid; gap: 4px 24px; grid-template-columns: 136px minmax(0, 1fr);
  align-items: baseline; padding: 11px 0; border-bottom: 1px solid var(--line);
  font-size: 14.5px; line-height: 1.6;
}
.card time { grid-column: 1; grid-row: 1; font: 400 12px/1.9 var(--f-mono); color: var(--muted); }

@media (max-width: 560px) {
  .grant-table li { grid-template-columns: minmax(0, 1fr) auto; }
  .card li { grid-template-columns: minmax(0, 1fr); }
  .card time { grid-row: auto; }
  .g-period { grid-column: 1 / -1; }
  .g-name { grid-column: 1; grid-row: 2; }
  .g-amt { grid-column: 2; grid-row: 2; }
}

/* ---------- footer ---------- */
.footer {
  margin-top: 88px; border-top: 1px solid var(--line);
  background:
    radial-gradient(50% 120% at 0% 100%, rgba(64, 140, 255, 0.08), transparent 70%),
    radial-gradient(50% 120% at 100% 100%, rgba(255, 92, 56, 0.08), transparent 70%),
    var(--bg);
}
.footer-inner { max-width: var(--max); margin: 0 auto; padding: 48px var(--gutter) 24px; }
.footer .section-index { display: block; margin-bottom: 14px; }
.footer-lead { font-size: 15px; color: var(--fg-2); }
.footer-mail {
  margin-top: 8px;
  font: 500 clamp(22px, 3vw, 32px)/1.2 var(--f-sans); letter-spacing: -0.02em;
  word-break: break-all;
}
.footer-grid {
  display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 20px;
  margin-top: 28px;
}
.footer-links { display: flex; flex-wrap: wrap; gap: 6px; }
.footer-links a {
  display: inline-flex; gap: 6px; align-items: center;
  font: 500 12px/1 var(--f-mono); padding: 9px 12px;
  border: 1px solid var(--line-2); border-radius: 99px; transition: background 0.2s, color 0.2s;
}
.footer-links a:hover { background: var(--fg); color: var(--bg); }
.footer-meta { text-align: right; font: 400 11px/1.8 var(--f-mono); color: var(--muted); font-variant-numeric: tabular-nums; }
.footer-meta [data-clock] { color: var(--fg); }
.to-top:hover { color: var(--on); }

@media (max-width: 560px) {
  .footer-meta { text-align: left; }
}

/* ---------- print: a clean CV-like list ---------- */
@media print {
  :root { --bg: #fff; --bg-2: #fff; --fg: #111; --fg-2: #333; --muted: #666; --line: #ddd; --line-2: #bbb; }
  body { background: #fff; color: #111; font-size: 10.5pt; }
  .nav, .menu, .progress, .grain, .hero, .latest, .filters, .exp-toggle, .dots, .stats, .tags, .footer-links, .footer-meta, .skip { display: none !important; }
  .js .reveal, .js .reveal-up { opacity: 1 !important; transform: none !important; }
  .pub[hidden] { display: grid !important; }
  .section { padding-top: 24px; max-width: none; }
  .section-head::after { display: none; }
  .award, .pub, .exp-item, .grant-table li { break-inside: avoid; }
  .pub-tags .hl, .pub-tags .award-tag { color: #111; border-color: #999; }
  .footer { margin-top: 24px; background: none; }
}

/* ---------- reduced motion ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { animation: none !important; transition-duration: 0.01ms !important; transition-delay: 0s !important; }
  .js .reveal, .js .reveal-up, .js .hud, .js .hero-title .line > span { opacity: 1; transform: none; }
}
