/* ─── Swiss/Academic Design System ──────────────────────────────────────── */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&family=JetBrains+Mono:wght@400;500&family=Syne:wght@400;600;800&display=swap');

:root {
  /* Light Theme (Default) */
  --bg: #ffffff;
  --bg-offset: #f9f9f9;
  --bg-hover: #f1f1f1;
  --text: #1a1a1a;
  --text-dim: #666666;
  --border: #e0e0e0;
  --accent: #00529b;
  --accent-dim: rgba(0, 82, 155, 0.1);
  --selection: #e0f0ff;
  --error: #c0392b;

  --water-deep: #003b70;
  --water-mid: #00529b;
  --water-light: #4d96db;
  --water-foam: #dff3ff;
  --water-opacity: 0.4;
  --water-overlay-opacity: 0.5;

  --font-sans: 'Inter', -apple-system, BlinkMacSystemFont, "Segoe UI", Helvetica, Arial, sans-serif;
  --font-heading: 'Syne', sans-serif;
  --font-mono: 'JetBrains Mono', monospace;

  --container-w: 1000px;
  --nav-h: 60px;
  --radius: 6px;
  --shadow: 0 4px 12px rgba(0, 0, 0, 0.05);

  /* A snappy, slightly-overshooting "back ease out" — used on hover/click
     feedback for interactive elements (buttons, toggles, icons) for a more
     confident, punchy feel than a plain ease. Motion-only nod to Persona 5's
     UI language, not a palette/layout change — see CLAUDE.md Pixel dog
     "Wink flourish" for the same easing used on the dog's sparkle. */
  --ease-snap: cubic-bezier(0.34, 1.56, 0.64, 1);
}

[data-theme="dark"] {
  --bg: #121212;
  --bg-offset: #1a1a1a;
  --bg-hover: #222222;
  --text: #eeeeee;
  --text-dim: #999999;
  --border: #333333;
  --accent: #4aa9ff;
  --accent-dim: rgba(74, 169, 255, 0.15);
  --selection: #264a73;
  --shadow: 0 8px 24px rgba(0, 0, 0, 0.2);
  --error: #e57368;

  --water-deep: #0a2f52;
  --water-mid: #1c5fa8;
  --water-light: #6fb3ef;
  --water-foam: #eaf7ff;
  --water-opacity: 0.32;
  --water-overlay-opacity: 0.45;
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ─── Base ───────────────────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

::selection { background: var(--selection); }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--nav-h);
  background: var(--bg);
  transition: background 0.3s ease;
}

body {
  position: relative;
  isolation: isolate;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ─── Water background (toon/cel-shaded shader, see js/water-bg.js) ────── */
.water-bg {
  position: fixed;
  inset: 0;
  z-index: -1;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

/* Sits directly above .water-bg (same z-index, later in DOM = painted on
   top of it) and below all normal page content — a flat page-background-
   colored scrim that mutes the shader's band contrast without hiding the
   motion/pattern entirely. Tune via --water-overlay-opacity per theme. */
.water-overlay {
  position: fixed;
  inset: 0;
  z-index: -1;
  background: var(--bg);
  opacity: var(--water-overlay-opacity);
  pointer-events: none;
}

/* ─── Pixel dog (see js/pixel-dog.js) ────────────────────────────────────── */
/* pointer-events stays none always — the dog is never allowed to block a
   real click on the page; js/pixel-dog.js does its own coordinate-based hit
   testing against the dog's current position instead. */
.pixel-dog {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 500;
  pointer-events: none;
  will-change: transform;
}

.dog-alert-indicator {
  position: fixed;
  z-index: 501;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow);
  cursor: pointer;
  opacity: 0;
  transform: scale(0.7);
  pointer-events: none;
  transition: opacity 0.25s ease, transform 0.25s ease;
  animation: dogAlertBob 1.1s ease-in-out infinite;
}

.dog-alert-indicator.visible {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

@keyframes dogAlertBob {
  0%, 100% { margin-top: 0; }
  50% { margin-top: -4px; }
}

.dog-toggle {
  position: fixed;
  left: 16px;
  bottom: 16px;
  z-index: 501;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--bg-offset);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: var(--shadow);
  transition: transform 0.15s var(--ease-snap), color 0.15s ease, border-color 0.15s ease, opacity 0.2s ease;
}

.dog-toggle svg { width: 19px; height: 16px; animation: none; }

.dog-toggle:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-2px); }

.dog-toggle.is-off { opacity: 0.4; }
.dog-toggle.is-off:hover { opacity: 0.7; }

@media (max-width: 720px) {
  .dog-toggle { left: 10px; bottom: 10px; width: 34px; height: 34px; }
  .dog-toggle svg { width: 17px; height: 14px; }
}

@keyframes propBob {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-2px); }
}

.dog-props {
  display: flex;
  flex-direction: column;
  gap: 10px;
  flex-shrink: 0;
  padding-top: 2px;
}

.dog-props.is-off { display: none; }

.dog-prop {
  width: 32px;
  height: 32px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--bg-offset);
  color: var(--text-dim);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: transform 0.15s var(--ease-snap), color 0.15s ease, opacity 0.2s ease, border-color 0.15s ease, box-shadow 0.15s ease;
}

.prop-sprite { width: 17px; height: 17px; image-rendering: pixelated; animation: propBob 2.6s ease-in-out infinite; }
.dog-prop:nth-child(2) .prop-sprite { animation-delay: 0.5s; }
.dog-prop:nth-child(3) .prop-sprite { animation-delay: 1s; }

.dog-prop:hover:not(:disabled) {
  color: var(--accent);
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow);
}

.dog-prop:active:not(:disabled) { transform: translateY(1px) scale(0.9); }

.dog-prop:disabled {
  opacity: 0.35;
  cursor: not-allowed;
  transform: none;
}

.news-row { display: flex; align-items: flex-start; gap: 14px; }
.news-row .news-container { flex: 1; min-width: 0; }

@media (max-width: 520px) {
  .news-row { flex-direction: column; }
  .dog-props { flex-direction: row; }
}

section { padding: 5rem 0; border-bottom: 1px solid var(--border); }
section:last-of-type { border-bottom: none; }

a { color: inherit; text-decoration: none; transition: color 0.2s, border-color 0.2s; }
ul { list-style: none; }
img, svg { max-width: 100%; display: block; }

.container { max-width: var(--container-w); margin: 0 auto; padding: 0 2rem; }

h1, h2, h3 { font-family: var(--font-heading); color: var(--text); font-weight: 700; line-height: 1.2; }
p { margin-bottom: 1.2rem; }

/* ─── Navigation ─────────────────────────────────────────── */
.site-nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 1000;
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  transition: background 0.3s, border-color 0.3s;
}

.nav-inner {
  max-width: var(--container-w);
  margin: 0 auto;
  padding: 0 2rem;
  display: flex;
  justify-content: space-between;
  align-items: center;
  height: 100%;
}

.nav-brand {
  font-family: var(--font-heading);
  font-weight: 800;
  font-size: 0.95rem;
  letter-spacing: -0.01em;
  color: var(--text);
}

.nav-links { display: flex; gap: 2rem; align-items: center; }

.nav-links a { font-size: 0.85rem; font-weight: 500; color: var(--text-dim); }
.nav-links a:hover, .nav-links a.active { color: var(--text); }

.theme-toggle {
  background: none;
  border: none;
  color: var(--text-dim);
  cursor: pointer;
  padding: 0.5rem;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: background 0.2s, color 0.2s;
}

.theme-toggle:hover { background: var(--bg-hover); color: var(--text); }

.lang-dropdown { position: relative; font-family: var(--font-mono); font-size: 0.72rem; }
.lang-dropdown > summary {
  list-style: none;
  cursor: pointer;
  color: var(--text-dim);
  padding: 0.3rem 0.55rem;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  user-select: none;
  transition: color 0.2s, border-color 0.2s;
}
.lang-dropdown > summary::-webkit-details-marker { display: none; }
.lang-dropdown > summary:hover,
.lang-dropdown[open] > summary { color: var(--text); border-color: var(--accent); }
.lang-caret { font-size: 0.65rem; }
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 1001;
  min-width: 9.5rem;
  display: flex;
  flex-direction: column;
  padding: 0.35rem;
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}
.nav-links .lang-menu a {
  padding: 0.4rem 0.6rem;
  border-bottom: none;
  border-radius: 4px;
  color: var(--text-dim);
  font-family: var(--font-sans);
  font-size: 1.05rem;
  line-height: 1;
  font-weight: 500;
}
.nav-links .lang-menu a:hover,
.nav-links .lang-menu a[aria-current="page"] { color: var(--text); background: var(--bg-hover); }

html:lang(ja) body { font-family: 'Noto Sans JP', var(--font-sans); }

@keyframes togglePop {
  0% { transform: scale(1); }
  45% { transform: scale(1.22); }
  100% { transform: scale(1); }
}
.theme-toggle.pop { animation: togglePop 0.35s var(--ease-snap); }

.mobile-menu-toggle {
  display: none;
  width: 36px; height: 36px;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  border: 0;
  border-radius: 50%;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}

.mobile-menu-toggle span { display: block; width: 17px; height: 1.5px; background: currentColor; transition: transform 200ms ease; }

/* ─── Typography helpers ────────────────────────────────── */
.focus-description { opacity: 0.8; margin-bottom: 2rem; }

.txt-highlight { color: var(--accent); font-weight: 700; }

.section-title {
  font-size: 1.5rem;
  margin-bottom: 2.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 2px solid var(--border);
}

.callout {
  margin-top: 2rem;
  padding: 1rem;
  background: var(--accent-dim);
  border-radius: var(--radius);
  border-left: 4px solid var(--accent);
  font-size: 0.95rem;
}

/* ─── Buttons ────────────────────────────────────────────── */
.btn-minimal {
  display: inline-block;
  font-size: 0.8rem;
  font-weight: 600;
  color: var(--accent);
  border-bottom: 1px solid transparent;
  transition: border-color 0.2s, transform 0.2s var(--ease-snap);
}
.btn-minimal:hover { border-color: var(--accent); transform: translateX(3px); }

.btn-solid {
  display: inline-block;
  font-size: 0.82rem;
  font-weight: 600;
  color: #fff;
  background: var(--accent);
  padding: 0.65rem 1.3rem;
  border-radius: var(--radius);
  transition: opacity 0.2s, transform 0.2s var(--ease-snap);
}

.btn-solid:hover { opacity: 0.88; transform: translateY(-2px) scale(1.03); }
.btn-solid:active { transform: translateY(0) scale(0.97); transition-duration: 0.1s; }

/* ─── Bio / About ────────────────────────────────────────── */
.bio-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 4rem; align-items: start; }

.bio-content p { font-size: 1.1rem; line-height: 1.8; }

.hero-actions { display: flex; gap: 1rem; flex-wrap: wrap; margin-top: 1.75rem; }

.social-icons { display: flex; gap: 1.5rem; margin-top: 1.5rem; }

.social-icons svg { width: 20px; height: 20px; fill: var(--text-dim); transition: fill 0.2s, transform 0.2s var(--ease-snap); }
.social-icons a:hover svg { fill: var(--accent); transform: translateY(-2px); }

/* ─── News ───────────────────────────────────────────────── */
.news-title { font-size: 0.9rem; margin-bottom: 1rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); }

.news-container {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  max-height: 340px;
  overflow-y: auto;
  padding: 1rem;
  background: var(--bg-offset);
}

.news-item {
  padding: 0.75rem 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 80px 1fr;
  gap: 1rem;
  align-items: baseline;
}

.news-item:last-child { border-bottom: none; }

.news-date { font-family: var(--font-mono); font-size: 0.7rem; color: var(--text-dim); text-transform: uppercase; }
.news-text { font-size: 0.85rem; }
.news-text a { color: var(--accent); border-bottom: 1px solid transparent; }
.news-text a:hover, .news-text a:focus-visible { border-color: var(--accent); }
.news-text strong { font-weight: 600; }

/* ─── Publications ───────────────────────────────────────── */
.pub-list { display: flex; flex-direction: column; gap: 2rem; }

.pub-item {
  position: relative;
  padding: 1.5rem 0;
  border-bottom: 1px solid var(--border);
  display: grid;
  grid-template-columns: 160px 1fr;
  gap: 1.5rem;
  align-items: center;
}
.pub-item:last-child { border-bottom: none; padding-bottom: 0; }

.pub-img {
  width: 100%;
  aspect-ratio: 4/3;
  object-fit: cover;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--bg-offset);
}

.pub-title { margin-bottom: 0.3rem; font-size: 1.1rem; font-weight: 600; }
.pub-authors { font-size: 0.9rem; margin-bottom: 0.25rem; opacity: 0.85; }
.pub-authors strong { color: var(--text); font-weight: 600; }
.pub-venue { font-family: var(--font-mono); font-size: 0.75rem; color: var(--accent); text-transform: uppercase; }

/* ─── Experience ─────────────────────────────────────────── */
.exp-list { display: flex; flex-direction: column; }

.exp-item { position: relative; padding: 1.75rem 0; border-bottom: 1px solid var(--border); display: grid; grid-template-columns: 44px 1fr; gap: 1.25rem; }
.exp-item:last-child { border-bottom: none; padding-bottom: 0; }

/* ─── City hover peek ────────────────────────────────────── */
.city-peek {
  display: none;
  position: absolute;
  top: 50%;
  left: 100%;
  width: 170px;
  height: 120px;
  margin-left: 18px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--border);
  box-shadow: var(--shadow);
  opacity: 0;
  transform: translate(24px, -50%);
  transition: opacity 0.3s ease, transform 0.3s ease;
  pointer-events: none;
  z-index: 5;
}

.city-peek img { width: 100%; height: 100%; object-fit: cover; }

@media (min-width: 1360px) {
  .city-peek { display: block; }
  .exp-item:hover .city-peek,
  .edu-block:hover .city-peek,
  .exp-minor:hover .city-peek,
  .pub-item:hover .city-peek { opacity: 1; transform: translate(0, -50%); }
}

.exp-badge {
  width: 44px; height: 44px;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--bg-offset);
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  color: var(--text-dim);
  text-align: center;
  line-height: 1.1;
}

.exp-badge i { font-size: 20px; }

.badge-white { background: #ffffff !important; }

/* For icons whose devicon ".colored" is hardcoded black (e.g. Apple/Core ML)
   sitting on a themed (not forced-white) background: recolor the glyph to
   follow the theme's text color instead of patching the background white,
   so it stays visible in dark mode without breaking the pill's normal look. */
.icon-on-tint { color: var(--text) !important; }
.exp-badge img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; }
.exp-badge img.badge-contain { width: 76%; height: 76%; object-fit: contain; border-radius: 0; }

.exp-top-row { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 0.4rem; margin-bottom: 0.15rem; }

.exp-role { font-family: var(--font-heading); font-size: 1.1rem; font-weight: 700; }
.exp-org { color: var(--accent); font-weight: 600; font-family: var(--font-sans); }
.exp-date { font-family: var(--font-mono); font-size: 0.75rem; color: var(--text-dim); white-space: nowrap; }
.exp-place { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim); margin-bottom: 0.6rem; }

.exp-lab {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--text-dim);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.6rem;
}
.exp-lab-sep { opacity: 0.45; }
.exp-supervisors a { color: var(--accent); border-bottom: 1px solid transparent; }
.exp-supervisors a:hover, .exp-supervisors a:focus-visible { border-color: var(--accent); }
.exp-field { display: inline-flex; align-items: center; gap: 0.3rem; }

.field-icon { width: 15px; height: 15px; flex-shrink: 0; color: var(--accent); }
.field-icon rect, .field-icon circle, .field-icon path, .field-icon polygon { fill: currentColor; }

.field-icon--diffusion rect { animation: diffuseFade 2.4s ease-in-out infinite; }
.field-icon--diffusion rect:nth-child(1) { animation-delay: 0s; }
.field-icon--diffusion rect:nth-child(2) { animation-delay: 0.5s; }
.field-icon--diffusion rect:nth-child(3) { animation-delay: 1s; }
.field-icon--diffusion rect:nth-child(4) { animation-delay: 0.2s; }
.field-icon--diffusion rect:nth-child(5) { animation-delay: 0.7s; }
.field-icon--diffusion rect:nth-child(6) { animation-delay: 1.2s; }
.field-icon--diffusion rect:nth-child(7) { animation-delay: 0.4s; }
.field-icon--diffusion rect:nth-child(8) { animation-delay: 0.9s; }
.field-icon--diffusion rect:nth-child(9) { animation-delay: 1.4s; }
@keyframes diffuseFade { 0%, 100% { opacity: 0.15; } 50% { opacity: 1; } }

.field-icon--multimodal .mm-image rect { fill: none; stroke: currentColor; }
.field-icon--multimodal .mm-text { animation: mmFadeText 3.2s ease-in-out infinite; }
.field-icon--multimodal .mm-image { animation: mmFadeImage 3.2s ease-in-out infinite; }
@keyframes mmFadeText { 0%, 45% { opacity: 1; } 50%, 95% { opacity: 0; } 100% { opacity: 1; } }
@keyframes mmFadeImage { 0%, 45% { opacity: 0; } 50%, 95% { opacity: 1; } 100% { opacity: 0; } }

.field-icon--graphics polygon { stroke: currentColor; stroke-width: 0.8; stroke-linejoin: round; animation: cubeGlow 3s ease-in-out infinite; }
.field-icon--graphics .cube-top { animation-delay: 0s; }
.field-icon--graphics .cube-left { animation-delay: 1s; }
.field-icon--graphics .cube-right { animation-delay: 2s; }
@keyframes cubeGlow { 0%, 100% { fill-opacity: 0.9; } 40% { fill-opacity: 0.2; } }

.exp-summary { font-size: 0.95rem; opacity: 0.85; margin-bottom: 0.6rem; }

.exp-bullets { display: flex; flex-direction: column; gap: 0.4rem; }
.exp-bullets li { padding-left: 1rem; position: relative; font-size: 0.92rem; opacity: 0.85; }
.exp-bullets li::before { content: "–"; position: absolute; left: 0; color: var(--accent); }

.exp-minor { position: relative; padding: 0.6rem 0; display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 0.5rem; font-size: 0.9rem; opacity: 0.85; }
.exp-minor strong { color: var(--text); font-weight: 600; }

.exp-minor__left { display: flex; align-items: center; gap: 0.6rem; }
.exp-badge--sm { width: 26px; height: 26px; flex-shrink: 0; }

/* ─── Education ──────────────────────────────────────────── */
.edu-block { position: relative; display: flex; justify-content: space-between; flex-wrap: wrap; gap: 1rem; margin-bottom: 1rem; }
.edu-school { font-family: var(--font-heading); font-size: 1.3rem; font-weight: 700; }
.edu-date { font-family: var(--font-mono); font-size: 0.8rem; color: var(--text-dim); }
.edu-degrees { margin-bottom: 1.25rem; opacity: 0.85; }
.edu-degrees div { margin-bottom: 0.3rem; }
.edu-degrees strong { color: var(--text); }

/* ─── Tags (Skills) ──────────────────────────────────────── */
.tag-group { margin-bottom: 2rem; }
.tag-group__title { font-size: 0.75rem; text-transform: uppercase; letter-spacing: 0.05em; color: var(--text-dim); margin-bottom: 0.9rem; }

.tag-list { display: flex; flex-wrap: wrap; gap: 0.75rem; }

.tag {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  background: var(--bg-offset);
  border: 1px solid var(--border);
  padding: 0.35rem 0.85rem;
  border-radius: 20px;
  font-size: 0.8rem;
  color: var(--text-dim);
}

.tag i { font-size: 14px; }
.tag img { width: 14px; height: 14px; object-fit: contain; }

/* ─── Contact ────────────────────────────────────────────── */
.contact-form { display: flex; flex-direction: column; gap: 1.25rem; max-width: 560px; }

.form-row { display: flex; flex-direction: column; gap: 0.4rem; }
.form-row label { font-size: 0.8rem; font-weight: 600; color: var(--text-dim); }

.form-row input,
.form-row textarea {
  font-family: var(--font-sans);
  font-size: 0.95rem;
  color: var(--text);
  background: var(--bg-offset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 0.65rem 0.85rem;
  resize: vertical;
}

.form-row input:focus,
.form-row textarea:focus { outline: none; border-color: var(--accent); }

.contact-form button {
  align-self: flex-start;
  border: none;
  cursor: pointer;
  font-family: var(--font-sans);
}

.contact-form button:disabled { opacity: 0.6; cursor: default; }

.form-status {
  margin: 0;
  font-size: 0.9rem;
  min-height: 1.4em;
}

@keyframes snapIn {
  0% { opacity: 0; transform: translateY(-6px) scale(0.94); }
  60% { opacity: 1; transform: translateY(1px) scale(1.02); }
  100% { opacity: 1; transform: translateY(0) scale(1); }
}
.form-status--success, .form-status--error { animation: snapIn 0.35s var(--ease-snap); }

.form-status--success { color: var(--accent); }
.form-status--error { color: var(--error); }

.hp-field { position: absolute; left: -9999px; width: 1px; height: 1px; overflow: hidden; }

.site-footer { padding: 3rem 0; border-top: 1px solid var(--border); margin-top: 2rem; text-align: left; opacity: 0.5; font-size: 0.8rem; }

/* ─── Reveal ─────────────────────────────────────────────── */
.reveal { opacity: 0; transform: translateY(14px); transition: opacity 0.5s ease, transform 0.5s ease; }
.reveal.is-visible { opacity: 1; transform: translateY(0); }

/* ─── Mobile ─────────────────────────────────────────────── */
@media (max-width: 850px) {
  .bio-grid { grid-template-columns: 1fr; gap: 2rem; }
  .nav-links { gap: 1rem; }
  .nav-brand { font-size: 0.85rem; }
}

@media (max-width: 700px) {
  .nav-links {
    position: fixed;
    top: calc(var(--nav-h) + 10px);
    left: 1rem; right: 1rem;
    display: flex;
    visibility: hidden;
    align-items: stretch;
    flex-direction: column;
    gap: 0;
    padding: 0.7rem;
    border: 1px solid var(--border);
    border-radius: 10px;
    background: var(--bg);
    box-shadow: 0 18px 50px rgba(0, 0, 0, 0.16);
    opacity: 0;
    transform: translateY(-8px);
    transition: opacity 200ms var(--ease-snap), transform 200ms var(--ease-snap), visibility 200ms;
  }

  .site-nav.menu-open .nav-links { visibility: visible; opacity: 1; transform: translateY(0); }

  .nav-links a { padding: 0.7rem 0.75rem; border-bottom: 1px solid var(--border); font-size: 0.86rem; }
  .nav-links a:last-of-type { border-bottom: 0; }

  .theme-toggle { align-self: flex-end; margin-top: 0.4rem; }

  .mobile-menu-toggle { display: flex; }

  .site-nav.menu-open .mobile-menu-toggle span:first-child { transform: translateY(3.25px) rotate(45deg); }
  .site-nav.menu-open .mobile-menu-toggle span:last-child { transform: translateY(-3.25px) rotate(-45deg); }

  .exp-item { grid-template-columns: 1fr; }
  .exp-badge { display: none; }

  .pub-item { grid-template-columns: 1fr; }
}

/* ─── Projects page (ported from the legacy portfolio, card layout kept) ─── */
.projects-intro { padding-bottom: 1.5rem; }
.projects-intro .section-title { border-bottom: none; padding-bottom: 0; }
.projects-back { margin-top: 1rem; font-size: 0.85rem; }
.projects-back a { color: var(--accent); }

.project-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 1.5rem;
}
.project-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  background: var(--bg-offset);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  transition: border-color 0.2s ease, transform 0.2s var(--ease-snap);
}
.project-card:hover { border-color: var(--accent); transform: translateY(-3px); }
.project-media {
  aspect-ratio: 16 / 10;
  background: var(--bg-hover);
  border-bottom: 1px solid var(--border);
}
.project-media img,
.project-media video { width: 100%; height: 100%; object-fit: cover; display: block; }
.project-body {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  flex: 1;
  padding: 1rem 1.1rem 1.1rem;
}
.project-title { font-family: var(--font-heading); font-size: 1rem; font-weight: 700; line-height: 1.3; }
.project-tech { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim); }
.project-footer { margin-top: auto; padding-top: 0.75rem; }
.project-link { font-size: 0.82rem; font-weight: 600; color: var(--accent); }
.project-unavailable { font-family: var(--font-mono); font-size: 0.72rem; color: var(--text-dim); opacity: 0.7; }

/* Down-the-time-hole button at the end of the home page */
.projects-cta { text-align: center; padding-top: 2rem; }
.projects-cta-btn { font-size: 0.92rem; padding: 0.85rem 1.6rem; }
