/* Yamada Lab: site styles. Layout lives here; routine updates never touch this file. */
:root {
  --ink: #0b1220;
  --ink-2: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --paper: #ffffff;
  --tint: #f3f6f8;
  /* accent colors come from themes.css */
  --cyan: #22d3ee;
  --teal: #14b8a6;
  --violet: #a78bfa;
  --magenta: #e879f9;
  --radius: 18px;
  --wrap: 1180px;
  --sans: "Inter", "Avenir Next", "Segoe UI", system-ui, -apple-system, "Helvetica Neue", Arial, sans-serif;
  --header-h: 72px;
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: calc(var(--header-h) + 16px); }
body {
  margin: 0; font-family: var(--sans); color: var(--ink); background: var(--paper);
  font-size: 17px; line-height: 1.65; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility;
}
img { max-width: 100%; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { color: var(--accent-ink); text-decoration: underline; text-underline-offset: 3px; }
h1, h2, h3 { line-height: 1.15; letter-spacing: -0.02em; margin: 0 0 .5em; }
h2 { font-size: clamp(1.5rem, 2.4vw, 2rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
.wrap { width: min(100% - 48px, var(--wrap)); margin-inline: auto; }
.skip { position: absolute; left: -999px; }
.skip:focus { left: 16px; top: 16px; z-index: 100; background: #fff; padding: 8px 12px; border-radius: 8px; }
.kicker { font-size: .78rem; font-weight: 600; letter-spacing: .14em; text-transform: uppercase; color: var(--accent); margin-bottom: .9em; }
.kicker-light { color: rgba(255,255,255,.75); }
.display { font-size: clamp(1.8rem, 3.6vw, 3rem); font-weight: 700; max-width: 22ch; text-wrap: balance; }
/* the central question stays on one line when there is room (wraps on phones) */
@media (min-width: 760px) { .display, .callout-question p:last-child { max-width: none !important; white-space: nowrap; } }

/* ---------- header ---------- */
.site-header {
  position: sticky; top: 0; z-index: 50; height: var(--header-h);
  background: rgba(255,255,255,.86); backdrop-filter: saturate(160%) blur(14px); -webkit-backdrop-filter: saturate(160%) blur(14px);
  border-bottom: 1px solid rgba(15,23,42,.06);
}
.header-inner { height: 100%; display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.brand { display: flex; align-items: center; color: var(--ink); }
.brand:hover { text-decoration: none; color: var(--ink); }
.brand-text { display: flex; flex-direction: column; line-height: 1; }
.brand-name { font-size: 1.75rem; letter-spacing: .14em; text-transform: uppercase; white-space: nowrap; }
.brand-name strong { font-weight: 800; }
.brand-lab { font-weight: 800; letter-spacing: .14em; }
.brand-tag { font-size: .68rem; color: var(--muted); letter-spacing: .12em; text-transform: uppercase; margin-top: 6px; }
.site-nav { display: flex; gap: 6px; }
.site-nav a { color: var(--ink-2); font-weight: 500; font-size: .95rem; padding: 8px 14px; border-radius: 999px; }
.site-nav a:hover { background: rgba(var(--accent-rgb),.08); color: var(--ink); text-decoration: none; }
.site-nav a[aria-current="page"] { color: var(--ink); background: rgba(var(--accent-rgb),.12); }
.nav-toggle { display: none; background: none; border: 0; width: 40px; height: 40px; cursor: pointer; padding: 10px 8px; }
.nav-toggle span { display: block; height: 2px; background: currentColor; margin: 6px 0; border-radius: 2px; transition: transform .2s; }

/* Transparent header over the hero on the homepage */
/* Homepage: header stays fixed; transparent over the hero, solid white once scrolled past it */
.home .site-header { position: fixed; left: 0; right: 0; transition: background-color .25s, border-color .25s, color .25s; }
.home .site-header:not(.scrolled) { background: transparent; border-color: transparent; backdrop-filter: none; -webkit-backdrop-filter: none; color: #fff; }
.home .site-header:not(.scrolled) .brand, .home .site-header:not(.scrolled) .brand:hover { color: #fff; }
.home .site-header:not(.scrolled) .brand-tag { color: rgba(255,255,255,.7); }
.home .site-header:not(.scrolled) .site-nav a { color: rgba(255,255,255,.86); }
.home .site-header:not(.scrolled) .site-nav a:hover { background: rgba(255,255,255,.12); color: #fff; }

/* ---------- hero ---------- */
.hero { position: relative; min-height: clamp(620px, 100svh, 960px); display: flex; align-items: flex-end; color: #fff; background: #050a14; overflow: hidden; isolation: isolate; }
.hero-media { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; z-index: -2; }
canvas.hero-media { cursor: crosshair; }
.hero-shade { position: absolute; inset: 0; z-index: -1; pointer-events: none;
  background:
    linear-gradient(180deg, rgba(5,10,20,.55) 0%, rgba(5,10,20,0) 22%),
    linear-gradient(90deg, rgba(5,10,20,.82) 0%, rgba(5,10,20,.45) 45%, rgba(5,10,20,0) 75%),
    linear-gradient(0deg, rgba(5,10,20,.7) 0%, rgba(5,10,20,0) 40%); }
.hero-content { padding: 140px 0 120px; pointer-events: none; }
.hero-content a { pointer-events: auto; }
.hero-title { font-size: clamp(2.6rem, 6.6vw, 5.6rem); font-weight: 750; letter-spacing: -0.035em; line-height: 1.02; max-width: 13ch; margin-bottom: .35em; }
.hero-title em { font-style: normal; background: linear-gradient(90deg, var(--g1), var(--g2) 55%, var(--g3)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.hero-lede { font-size: clamp(1.1rem, 1.6vw, 1.35rem); max-width: 38ch; color: rgba(255,255,255,.86); margin-bottom: 2em; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.hero-caption { position: absolute; right: 24px; bottom: 18px; margin: 0; font-size: .75rem; color: rgba(255,255,255,.55); max-width: 46ch; text-align: right; pointer-events: none; }

.btn { display: inline-flex; align-items: center; gap: 8px; font-weight: 600; font-size: .98rem; padding: 13px 24px; border-radius: 999px; background: var(--ink); color: #fff; border: 1px solid transparent; transition: transform .15s, background .15s; }
.btn:hover { text-decoration: none; color: #fff; transform: translateY(-1px); background: #1e293b; }
.btn-light { background: #fff; color: var(--ink); }
.btn-light:hover { background: var(--soft-bg); color: var(--ink); }
.btn-ghost { background: rgba(255,255,255,.06); color: #fff; border-color: rgba(255,255,255,.4); backdrop-filter: blur(6px); }
.btn-ghost:hover { background: rgba(255,255,255,.16); }

/* ---------- recruiting banner ---------- */
.recruit { display: block; background: linear-gradient(90deg, var(--banner-a), var(--banner-b)); color: #fff; font-weight: 500; }
.recruit:hover { text-decoration: none; color: #fff; filter: brightness(1.1); }
.recruit-inner { display: flex; align-items: center; gap: 12px; padding: 14px 0; flex-wrap: wrap; }
.recruit-cta { margin-left: auto; font-weight: 600; color: var(--on-dark-link); }
.pulse { width: 10px; height: 10px; border-radius: 50%; background: rgb(var(--pulse-rgb)); box-shadow: 0 0 0 0 rgba(var(--pulse-rgb),.7); animation: pulse 2s infinite; flex: none; }
@keyframes pulse { 70% { box-shadow: 0 0 0 12px rgba(var(--pulse-rgb),0); } 100% { box-shadow: 0 0 0 0 rgba(var(--pulse-rgb),0); } }

/* ---------- sections ---------- */
.section { padding: clamp(64px, 9vw, 120px) 0; }
.section-tint { background: var(--tint); }
.section-head { margin-bottom: 48px; }
.section-head-row { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 24px; }
.section-head-row h2 { margin: 0; }
.section-head-row a { font-weight: 600; font-size: .95rem; }

.axes { display: grid; grid-template-columns: repeat(3, 1fr); gap: 24px; }
.axis-card { position: relative; display: flex; flex-direction: column; padding: 32px; border-radius: var(--radius); background: #fff; border: 1px solid var(--line); color: var(--ink-2); transition: transform .2s, box-shadow .2s, border-color .2s; }
.axis-card:hover { text-decoration: none; color: var(--ink-2); transform: translateY(-4px); box-shadow: 0 24px 48px -24px rgba(15,23,42,.25); border-color: transparent; }
.axis-card h3 { font-size: 1.6rem; color: var(--ink); margin-bottom: .2em; }
.axis-icon { width: 88px; height: 88px; margin-bottom: 20px; }
.axis-num { position: absolute; top: 28px; right: 30px; font-size: .85rem; font-weight: 600; color: var(--muted); letter-spacing: .1em; }
.axis-sub { font-weight: 600; color: var(--accent); font-size: .95rem; }
.axis-card .more { margin-top: auto; font-weight: 600; color: var(--ink); font-size: .95rem; }

.split { display: grid; grid-template-columns: 1fr 1fr; gap: clamp(32px, 6vw, 96px); }
.news-list { list-style: none; padding: 0; margin: 0; }
.news-list li { display: grid; grid-template-columns: 96px 1fr; gap: 20px; padding: 18px 0; border-top: 1px solid var(--line); }
.news-list li:last-child { border-bottom: 1px solid var(--line); }
.news-list time { font-size: .85rem; font-weight: 600; color: var(--muted); padding-top: 2px; white-space: nowrap; }
.news-body p { margin: 0; }
.news-list-full li { grid-template-columns: 120px 1fr; padding: 24px 0; font-size: 1.05rem; }

.cta { background: radial-gradient(1200px 400px at 85% 120%, rgba(var(--glow-b-rgb),.25), transparent 60%), radial-gradient(900px 400px at 0% -40%, rgba(var(--glow-a-rgb),.28), transparent 60%), var(--ink); color: #fff; }
.cta-inner { display: flex; align-items: center; justify-content: space-between; gap: 32px; flex-wrap: wrap; }
.cta h2 { font-size: clamp(1.8rem, 3.4vw, 2.8rem); }
.cta p { color: rgba(255,255,255,.75); max-width: 52ch; margin: 0; }
.cta .btn { background: #fff; color: var(--ink); }

/* ---------- inner pages ---------- */
.page-head { padding: clamp(56px, 8vw, 104px) 0 clamp(40px, 5vw, 64px); background:
  radial-gradient(700px 300px at 92% 0%, rgba(var(--glow-b-rgb),.16), transparent 70%),
  radial-gradient(800px 340px at 70% 120%, rgba(var(--glow-a-rgb),.16), transparent 70%), var(--tint); border-bottom: 1px solid var(--line); }
.page-head h1 { font-size: clamp(2.4rem, 5vw, 4rem); font-weight: 750; letter-spacing: -0.03em; }
.lede { font-size: clamp(1.1rem, 1.5vw, 1.3rem); color: var(--ink-2); max-width: 60ch; margin: 0; }
.lede.lede-wide { max-width: none; }
.page-body { padding: clamp(48px, 6vw, 80px) 0 clamp(72px, 9vw, 120px); }
.prose > * { max-width: 72ch; }
.prose h2 { margin-top: 2.2em; }
.prose ul, .prose ol { padding-left: 1.2em; }
.prose li { margin-bottom: .4em; }

.callout-question { max-width: none !important; border-left: 4px solid; border-image: linear-gradient(var(--g1), var(--g3)) 1; padding: 8px 0 8px 28px; margin: 0 0 48px; }
.callout-question p:last-child { font-size: clamp(1.4rem, 2.6vw, 2.1rem); font-weight: 650; letter-spacing: -.02em; line-height: 1.25; color: var(--ink); margin: 0; max-width: 30ch; }

.axes-long { max-width: none !important; display: grid; gap: 20px; margin: 24px 0; }
.axis-long { display: grid; grid-template-columns: 120px 1fr; gap: 32px; padding: 32px; border: 1px solid var(--line); border-radius: var(--radius); background: #fff; }
.axis-long .axis-icon { width: 110px; height: 110px; margin: 0; }
.axis-long .axis-num { position: static; margin: 0 0 .4em; }
.axis-long h3 { font-size: 1.45rem; }
.axis-long ul { margin: 0; padding-left: 1.1em; }
.axis-long > div:last-child { max-width: 70ch; }

.trajectory { max-width: none !important; list-style: none; padding: 0 !important; margin: 28px 0 36px; display: flex; flex-wrap: wrap; gap: 0; }
.trajectory li { flex: 1 1 140px; position: relative; padding: 18px 18px 18px 26px; margin: 0 !important; font-weight: 650; color: #fff; font-size: 1.05rem;
  clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%, 16px 50%); }
.trajectory li:first-child { clip-path: polygon(0 0, calc(100% - 16px) 0, 100% 50%, calc(100% - 16px) 100%, 0 100%); }
/* Research page: every block shares one column width, so the eye stays on the same left/right edges while scrolling */
.prose-col { --col: 860px; }
.page-body.prose-col > * { max-width: var(--col) !important; }
.trajectory li:nth-child(1) { background: var(--t1); color: var(--t1-ink); } .trajectory li:nth-child(2) { background: var(--t2); color: var(--t2-ink); }
.trajectory li:nth-child(3) { background: var(--t3); color: var(--t3-ink); } .trajectory li:nth-child(4) { background: var(--t4); color: var(--t4-ink); } .trajectory li:nth-child(5) { background: var(--t5); color: var(--t5-ink); }
.trajectory span { display: block; font-size: .72rem; letter-spacing: .14em; opacity: .75; font-weight: 600; }

/* publications */
.pub-meta { color: var(--muted); }
.year-jump { display: flex; flex-wrap: wrap; gap: 8px; margin: 8px 0 40px; }
.year-jump a { font-size: .85rem; font-weight: 600; padding: 4px 12px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); }
.year-jump a:hover { border-color: var(--accent); text-decoration: none; }
.pub-year { display: grid; grid-template-columns: 120px 1fr; gap: 24px; border-top: 1px solid var(--line); padding-top: 24px; margin-bottom: 24px; }
.pub-year h2 { font-size: 1.6rem; color: var(--muted); }
.pub-list { list-style: none; margin: 0; padding: 0; }
.pub { padding: 0 0 22px; }
.pub p { margin: 0 0 .2em; }
.pub-title { font-weight: 650; font-size: 1.05rem; line-height: 1.35; }
.pub-title a { color: var(--ink); }
.pub-title a:hover { color: var(--accent); }
.pub-authors { color: var(--ink-2); font-size: .92rem; }
.pub-authors strong { color: var(--ink); }
.pub-venue { color: var(--muted); font-size: .92rem; }
.pub-list-compact .pub { border-top: 1px solid var(--line); padding: 18px 0; }
.pub-list-compact .pub-authors { display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden; }
.badge { display: inline-block; font-size: .7rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; padding: 2px 9px; border-radius: 999px; border: 1px solid var(--line); color: var(--ink-2); margin-left: 6px; vertical-align: 1px; font-style: normal; }
a.badge:hover { border-color: var(--accent); text-decoration: none; }
.pub-type { display: inline-block; font-size: .68rem; font-weight: 700; letter-spacing: .1em; text-transform: uppercase; padding: 2px 10px; border-radius: 999px; margin: 0 0 8px !important; border: 1px solid var(--line); color: var(--ink-2); }
.pub-type-article { background: var(--soft-bg); border-color: var(--soft-border); color: var(--accent-ink); }
.pub-type-perspective, .pub-type-review { background: var(--alt-bg); border-color: var(--alt-border); color: var(--alt-ink); }
.badge-preprint { background: var(--alt-bg); border-color: var(--alt-border); color: var(--alt-ink); }
.badge-open { background: var(--soft-bg); border-color: var(--soft-border); color: var(--accent-ink); margin: 0 0 12px; }

/* people */
.pi { display: grid; grid-template-columns: 220px 1fr; gap: 48px; align-items: start; margin-bottom: 72px; }
.pi h2 { font-size: clamp(1.8rem, 3vw, 2.4rem); }
.pi p { max-width: 68ch; color: var(--ink-2); }
.person-links { display: flex; flex-wrap: wrap; gap: 8px 20px; font-weight: 600; font-size: .95rem; }
.avatar { width: 120px; aspect-ratio: 1; border-radius: 50%; overflow: hidden; display: grid; place-items: center;
  background: radial-gradient(circle at 30% 30%, var(--logo-1), var(--logo-2) 55%, var(--logo-3)); color: #fff; font-weight: 700; font-size: 2rem; margin-bottom: 16px; }
.avatar img { width: 100%; height: 100%; object-fit: cover; }
.avatar-lg { width: 220px; font-size: 3.6rem; border-radius: 28px; }
.avatar-open { background: var(--tint); color: var(--accent); border: 2px dashed var(--soft-border); }
.people-h { border-top: 1px solid var(--line); padding-top: 32px; margin-bottom: 28px; }
.people-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 32px; margin-bottom: 64px; }
.person h3 { margin-bottom: .2em; }
.person-role { color: var(--accent); font-weight: 600; font-size: .92rem; }
.person-bio { color: var(--ink-2); font-size: .92rem; }
.person-open { color: var(--ink); }
.person-open:hover { text-decoration: none; color: var(--ink); }
.person-open:hover .avatar-open { border-color: var(--accent); }
.alumni { padding-left: 1.1em; }

/* join */
.positions { max-width: none !important; display: grid; grid-template-columns: repeat(3, 1fr); gap: 20px; margin-bottom: 56px; }
.position { padding: 28px; border-radius: var(--radius); border: 1px solid var(--line); background: #fff; }
.position p:last-child { margin: 0; color: var(--ink-2); font-size: .97rem; }

/* ---------- footer ---------- */
.site-footer { background: #070c17; color: rgba(255,255,255,.72); font-size: .93rem; padding: 64px 0 28px; }
.site-footer a { color: var(--on-dark-link); }
.footer-grid { display: grid; grid-template-columns: 2fr 1fr 1fr; gap: 40px; }
.footer-title { color: #fff; font-weight: 650; margin-bottom: .7em; }
.footer-links { list-style: none; padding: 0; margin: 0; display: grid; gap: 6px; }
.footer-base { display: flex; justify-content: space-between; gap: 16px; flex-wrap: wrap; border-top: 1px solid rgba(255,255,255,.1); margin-top: 48px; padding-top: 20px; font-size: .82rem; color: rgba(255,255,255,.5); }
.footer-base a { color: rgba(255,255,255,.6); }

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .axes, .positions { grid-template-columns: 1fr; }
  .split { grid-template-columns: 1fr; }
  .pi { grid-template-columns: 1fr; gap: 24px; }
  .avatar-lg { width: 160px; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
}
@media (max-width: 820px) {
  .nav-toggle { display: block; color: inherit; }
  .brand-name { font-size: 1.35rem; }
  .site-nav { position: fixed; inset: var(--header-h) 0 auto 0; flex-direction: column; gap: 0; padding: 12px 24px 24px; background: #fff; border-bottom: 1px solid var(--line); box-shadow: 0 20px 40px -20px rgba(15,23,42,.3); transform: translateY(-8px); opacity: 0; pointer-events: none; transition: .2s; }
  .site-nav a, .home .site-header:not(.scrolled) .site-nav a { color: var(--ink); padding: 12px 8px; border-radius: 8px; }
  .nav-open .site-nav { transform: none; opacity: 1; pointer-events: auto; }
  .nav-open .nav-toggle span:first-child { transform: translateY(4px) rotate(45deg); }
  .nav-open .nav-toggle span:last-child { transform: translateY(-4px) rotate(-45deg); }
  .axis-long { grid-template-columns: 1fr; gap: 12px; padding: 24px; }
  .axis-long .axis-icon { width: 72px; height: 72px; }
  .pub-year { grid-template-columns: 1fr; gap: 4px; }
  .news-list li, .news-list-full li { grid-template-columns: 1fr; gap: 4px; }
  .hero-caption { left: 24px; text-align: left; }
  .footer-grid { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) { * { animation: none !important; transition: none !important; scroll-behavior: auto !important; } }

/* justified running text: PI bio, Join us body (cards excluded) */
.pi p:not(.kicker):not(.person-links),
.page-body.prose-col > p,
.page-body.prose-col > ul li,
.page-body.prose-col > ol li { text-align: justify; hyphens: auto; }
@media (max-width: 760px) {
  .pi p:not(.kicker):not(.person-links),
  .page-body.prose-col > p,
  .page-body.prose-col > ul li,
  .page-body.prose-col > ol li { text-align: left; hyphens: manual; }
}

/* trajectory on phones: one full-width row per step, chevrons point down and interlock */
@media (max-width: 760px) {
  .trajectory { flex-direction: column; }
  .trajectory li { flex: none; display: flex; align-items: baseline; gap: 12px; padding: 26px 20px 24px;
    clip-path: polygon(0 0, 50% 18px, 100% 0, 100% calc(100% - 18px), 50% 100%, 0 calc(100% - 18px)); }
  .trajectory li:first-child { padding-top: 16px; clip-path: polygon(0 0, 100% 0, 100% calc(100% - 18px), 50% 100%, 0 calc(100% - 18px)); }
  .trajectory li + li { margin-top: -15px !important; }
  .trajectory span { display: inline; }
}
