/* ── tokens ───────────────────────────────────────── */
:root {
  --paper:  #edeff3;
  --grid:   #dde2ea;
  --ink:    #10151f;
  --muted:  #414a5c;   /* 本文の副次テキスト。以前より濃く */
  --faint:  #626b7d;
  --hair:   #c6cdd9;
  --eeg:    #2f31b8;
  --voice:  #a81e44;
  --measure: 44rem;
}
* { margin: 0; padding: 0; box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  background: var(--paper);
  color: var(--ink);
  font-family: "Inter Tight", "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
  line-height: 1.68;
  -webkit-font-smoothing: antialiased;
}
.wrap { max-width: var(--measure); margin: 0 auto; padding: 0 1.5rem 5rem; }

/* ── links ────────────────────────────────────────── */
a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--voice); padding-bottom: 1px; }
a:hover { color: var(--voice); }
a:focus-visible { outline: 2px solid var(--eeg); outline-offset: 3px; border-radius: 2px; }

/* ── language switch ──────────────────────────────── */
.lang {
  display: flex; gap: .75rem; align-items: baseline;
  font-family: "JetBrains Mono", monospace; font-size: .75rem;
  letter-spacing: .04em; padding-top: 1.5rem;
}
.lang a { border-bottom-color: var(--hair); color: var(--muted); }
.lang a:hover { color: var(--voice); border-bottom-color: var(--voice); }
.lang .on { color: var(--ink); border-bottom: 1px solid var(--voice); padding-bottom: 1px; }
.lang .sep { color: var(--faint); }

/* ── signature trace (top page) ───────────────────── */
.trace { position: relative; margin: 0 -1.5rem; padding: 2rem 1.5rem 0; }
/* 方眼だけを下方向にフェードさせる。波形と凡例はフェードの対象外 */
.trace::before {
  content: ""; position: absolute; inset: 0; pointer-events: none;
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 2rem 2rem; background-position: center;
  -webkit-mask-image: linear-gradient(to bottom, transparent 4%, rgba(0,0,0,.35) 20%, #000 38%, #000 92%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 4%, rgba(0,0,0,.35) 20%, #000 38%, #000 92%, transparent 100%);
}
.trace svg, .trace .axis { position: relative; }
.trace svg { display: block; width: 100%; height: auto; overflow: visible; }
.sig {
  fill: none; stroke: url(#grad); stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  stroke-dasharray: 4400; stroke-dashoffset: 4400;
  animation: draw 2.4s cubic-bezier(.16,.9,.3,1) forwards;
}
.sig-ch {
  fill: none; stroke: url(#grad); stroke-width: 1.8; stroke-linecap: round;
  opacity: .72;
  stroke-dasharray: 900; stroke-dashoffset: 900;
  animation: draw 1.3s cubic-bezier(.16,.9,.3,1) .05s forwards;
}
.sig-ch.mid { opacity: 1; stroke-width: 2; }
.sig-ch:nth-of-type(2) { animation-delay: .13s; }
.sig-ch:nth-of-type(3) { animation-delay: .26s; }
.node .edges { stroke: #6b2d86; stroke-width: 1.4; opacity: .34; }
.node .box { fill: none; stroke: #6b2d86; stroke-width: 1.6; opacity: .42; }
.sig { animation-delay: 1.75s; animation-duration: 1.5s; }
@keyframes draw { to { stroke-dashoffset: 0; } }
@keyframes nodein { from { opacity: 0; transform: scale(.7); } to { opacity: 1; transform: scale(1); } }
.node { transform-origin: 500px 90px; animation: nodein .5s cubic-bezier(.2,.8,.3,1) 1.35s both; }
.axis {
  display: flex; justify-content: space-between; align-items: center;
  margin: 0 0 .9rem;
  font-family: "JetBrains Mono", monospace; font-size: 2rem; font-weight: 500;
  letter-spacing: .06em; text-transform: uppercase; line-height: 1;
}
.axis .l, .axis .r { display: inline-flex; align-items: center; gap: .6rem; }
.axis svg { width: 2.6rem; height: 2.6rem; flex: none; }
.axis .l { color: var(--eeg); }
.axis .r { color: var(--voice); }

/* ── thin band (cv pages) ─────────────────────────── */
.band { height: 3px; margin: 1.25rem -1.5rem 0;
        background: linear-gradient(to right, var(--eeg), #6b2d86 46%, var(--voice) 78%); }

/* ── header ───────────────────────────────────────── */
header { padding-top: 1.75rem; }
.kanji {
  font-size: 1.0625rem; letter-spacing: .3em; color: var(--muted);
  font-family: "Hiragino Kaku Gothic ProN", "Yu Gothic", "Noto Sans JP", sans-serif;
}
h1 {
  font-weight: 700; font-size: clamp(2.3rem, 8.5vw, 3.5rem);
  line-height: 1.04; letter-spacing: -.03em; margin: .3rem 0 1rem;
}
.lede { font-size: 1.0625rem; max-width: 34ch; }
.lede-en { margin-top: .6rem; color: var(--muted); font-size: .9375rem; max-width: 42ch; }
.affil { margin-top: .9rem; color: var(--muted); font-size: .9375rem; }

/* ── sections ─────────────────────────────────────── */
section { margin-top: 3rem; }
h2 {
  font-family: "JetBrains Mono", monospace; font-size: .6875rem; font-weight: 500;
  letter-spacing: .14em; text-transform: uppercase; color: var(--muted);
  padding-bottom: .5rem; border-bottom: 1px solid var(--hair); margin-bottom: 1.5rem;
}

/* research topics */
.topic { display: grid; grid-template-columns: .75rem 1fr; gap: 0 1rem; margin-bottom: 2rem; }
.topic:last-child { margin-bottom: 0; }
.dot { width: .5rem; height: .5rem; margin-top: .65rem; border-radius: 1px; }
.dot.eeg { background: var(--eeg); }
.dot.voice { background: var(--voice); }
.topic h3 { font-weight: 600; font-size: 1.1875rem; letter-spacing: -.015em; line-height: 1.35; }
.topic .en {
  font-family: "JetBrains Mono", monospace; font-size: .75rem; font-weight: 400;
  letter-spacing: 0; color: var(--voice); display: block; margin-top: .2rem;
}
.topic h3 .en.cool { color: var(--eeg); }
.topic p { margin-top: .55rem; color: var(--ink); }
.topic p.en-text { margin-top: .8rem; color: var(--muted); font-size: .9375rem; }

/* entry lists */
ul, ol { list-style: none; }
.rows > li { display: grid; grid-template-columns: 9rem 1fr; gap: 0 1.25rem;
             padding: .8rem 0; border-bottom: 1px solid var(--hair); }
.rows > li:last-child { border-bottom: 0; }
.meta { font-family: "JetBrains Mono", monospace; font-size: .8125rem;
        color: var(--muted); padding-top: .2rem; }
.rows .t { line-height: 1.5; }

/* 説明行（論文以外の各項目に付く注記） */
.rows .sub { display: block; color: var(--muted); font-size: .875rem; margin-top: .25rem; line-height: 1.55; }

/* 国際会議の査読の有無 */
.pubs .peer { display: block; margin-top: .35rem;
              font-family: "JetBrains Mono", monospace; font-size: .75rem;
              letter-spacing: .02em; color: var(--muted); }
.pubs .peer.no { color: var(--faint); }

/* publications */
.pubs > li { padding: .95rem 0; border-bottom: 1px solid var(--hair); }
.pubs > li:last-child { border-bottom: 0; }
.pubs .cite { line-height: 1.55; }

/* inline chip list */
.chips { display: flex; flex-wrap: wrap; gap: .4rem .5rem; }
.chips li { font-family: "JetBrains Mono", monospace; font-size: .8125rem;
            color: var(--muted); border: 1px solid var(--hair); border-radius: 2px;
            padding: .1rem .5rem; background: rgba(255,255,255,.55); }

.links { display: flex; flex-wrap: wrap; gap: .55rem 1.5rem; margin-top: 1.25rem; }
.links a { font-family: "JetBrains Mono", monospace; font-size: .875rem; }

footer { margin-top: 3.5rem; padding-top: 1rem; border-top: 1px solid var(--hair);
         font-family: "JetBrains Mono", monospace; font-size: .75rem; color: var(--muted);
         display: flex; flex-wrap: wrap; gap: .4rem 1.25rem; }

@media (max-width: 32rem) {
  .rows > li { grid-template-columns: 1fr; gap: .15rem; }
  .axis { font-size: 1.05rem; margin-bottom: .6rem; }
  .axis svg { width: 1.5rem; height: 1.5rem; }
  .axis .l, .axis .r { gap: .4rem; }
}
@media (prefers-reduced-motion: reduce) {
  .sig, .sig-ch { animation: none; stroke-dashoffset: 0; }
  .node { animation: none; opacity: 1; }
}
