@font-face {
  font-family: "YCY Palatino";
  src: url("./assets/fonts/ycy-palatino.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-synthesis: none;
  font-display: block;
}

@font-face {
  font-family: "YCY Mizuki Ming";
  src: url("./assets/fonts/MizukiMing-Regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-synthesis: none;
  font-display: block;
}

@font-face {
  font-family: "YCY Songti SC";
  src: url("./assets/fonts/songti/songti-sc-light.woff2") format("woff2");
  font-style: normal;
  font-weight: 300;
  font-synthesis: none;
  font-display: block;
}

@font-face {
  font-family: "YCY Songti SC";
  src: url("./assets/fonts/songti/songti-sc-regular.woff2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-synthesis: none;
  font-display: block;
}

:root {
  --bg: #ffffff;
  --band: #faf8f3;
  --text: #171717;
  --muted: #707070;
  --line: #ece9e2;
  --accent: #1f6f5f;
  --page-width: 1280px;
  --shell-gutter: clamp(28px, 3.3vw, 40px);
  --shell-gutter-mobile: clamp(14px, 4.8vw, 24px);
  --serif-text: "YCY Palatino", "YCY Mizuki Ming", "YCY Songti SC";
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: var(--serif-text);
  font-weight: 400;
  font-synthesis-weight: none;
  overflow: hidden;
}

.subpage-body {
  overflow: auto;
}

.academic-body {
  background: #cccccc;
}

.academic-screen {
  width: min(var(--page-width), calc(100% - 32px));
  min-height: 100vh;
  margin: 0 auto;
  background: #ffffff;
}

.brand,
.nav-card,
.top-nav a {
  color: inherit;
  text-decoration: none;
}

.brand {
  color: var(--accent);
  font-weight: 400;
}

.home-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
}

.home-icon svg {
  width: 22px;
  height: 22px;
  display: block;
}

.lang-switch {
  display: flex;
  gap: 10px;
}

.lang-button {
  padding: 8px 10px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font: inherit;
  cursor: pointer;
  border-radius: 999px;
  transition:
    border-color 180ms ease,
    color 180ms ease,
    background 180ms ease;
}

.lang-button.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: rgba(31, 111, 95, 0.03);
}

h1,
p {
  margin-top: 0;
}

.top-band {
  background: var(--band);
  border-bottom: 1px solid var(--line);
}

.home-topbar {
  width: min(var(--page-width), calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
  padding: 24px 0 22px;
  flex-wrap: wrap;
}

.top-nav {
  display: flex;
  gap: 28px;
  flex-wrap: wrap;
}

.top-nav a {
  color: var(--muted);
  font-size: 0.95rem;
  position: relative;
}

.top-nav a:hover {
  color: var(--accent);
}

.top-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: -8px;
  width: 100%;
  height: 1px;
  background: transparent;
  transition: background 180ms ease;
}

.top-nav a:hover::after {
  background: var(--accent);
}

.top-nav a.is-current {
  color: var(--accent);
}

.top-nav a.is-current::after {
  background: var(--accent);
}

.home-band {
  padding-top: 0;
  margin-top: 0;
}

.home-container {
  padding-top: 36px;
  padding-bottom: 44px;
}

.home-hero {
  display: grid;
  gap: 18px;
  align-content: center;
  max-width: 1120px;
  margin-bottom: 22px;
}

html[lang="en"] .home-hero h1 {
  font-size: clamp(1.85rem, 4.2vw, 2.8rem);
  line-height: 1.15;
  letter-spacing: -0.015em;
}

h1 {
  margin: 0;
  font-size: clamp(2rem, 4.8vw, 3.4rem);
  line-height: 1.08;
  font-weight: 300;
  letter-spacing: -0.04em;
}

.home-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 0;
  max-width: 1120px;
}

.home-list-item {
  display: grid;
  gap: 6px;
  padding: 18px 0 20px;
  border-top: 1px solid #ddd7ca;
  text-decoration: none;
  color: #111111;
}

.home-list-item:last-child {
  border-bottom: 1px solid #ddd7ca;
}

.home-list-item:hover {
  border-top-color: #c7c0b3;
}

.home-list-item:hover + .home-list-item {
  border-top-color: #c7c0b3;
}

.home-list-title {
  font-family: var(--serif-text);
  font-size: 1.48rem;
  font-weight: 400;
  letter-spacing: 0.01em;
  line-height: 1.2;
}

.home-list-note {
  color: #6a6a6a;
  font-size: 0.95rem;
  line-height: 1.8;
}

.page-band {
  width: min(var(--page-width), calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 64px;
}

.page-shell {
  display: grid;
  gap: 40px;
}

.page-hero {
  display: grid;
  gap: 14px;
  width: 100%;
}

.page-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: lowercase;
}

.page-intro {
  max-width: none;
  margin: 0;
  color: var(--muted);
  font-size: 1.04rem;
  line-height: 1.85;
}

.academic-top-band {
  background: #ffffff;
  border-bottom: 0;
}

.academic-topbar {
  width: 100%;
  margin: 0;
  background: #ffffff;
  padding-left: var(--shell-gutter);
  padding-right: var(--shell-gutter);
  border-bottom: 1px solid var(--line);
}

.page-index-bar {
  width: 100%;
  margin: 0;
  background: #ffffff;
  padding: 0.52em var(--shell-gutter) 14px;
}

.page-index {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding-left: 0;
  color: #666666;
  font-family: var(--serif-text);
  font-size: 0.95rem;
  line-height: 1.45;
}

.page-index a {
  color: #1f6f5f;
  text-decoration: none;
}

.page-index a:hover {
  text-decoration: underline;
}

.academic-band {
  width: 100%;
  margin: 0;
  background: #ffffff;
  padding: 0 0 48px;
}

.academic-container {
  background: #ffffff;
  padding: 36px 40px 56px;
}

.academic-header {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
}

.academic-intro {
  max-width: none;
  margin: 0;
  color: var(--muted);
  font-size: 1.02rem;
  line-height: 1.85;
}

.academic-header h1 {
  font-family: var(--serif-text);
  font-size: clamp(2.2rem, 4.4vw, 2.55rem);
  line-height: 1.2;
  font-weight: 400;
  letter-spacing: 0;
}

.academic-section {
  margin-top: 26px;
}

.academic-section-title {
  margin: 0 0 10px;
  font-family: var(--serif-text);
  font-size: 1.56rem;
  font-weight: 400;
  color: #111111;
}

.academic-rule {
  width: 100%;
  height: 1px;
  background: #1f6f5f;
  margin-bottom: 16px;
}

.academic-content {
  width: 100%;
}

.academic-content p {
  margin: 0 0 10px;
  color: #222222;
  font-family: var(--serif-text);
  font-size: 1rem;
  line-height: 1.75;
  max-width: none;
}

.publication-list-plain p {
  margin-bottom: 12px;
}

.contact-panel {
  display: grid;
  gap: 14px;
  margin-top: 8px;
}

.contact-row {
  display: grid;
  grid-template-columns: minmax(88px, 0.12fr) minmax(0, 1fr);
  gap: clamp(18px, 3vw, 42px);
  align-items: baseline;
  padding: 0;
}

.contact-item-label {
  color: #5f5a52;
  font-size: 0.92rem;
  line-height: 1.5;
}

.contact-item-value {
  color: #1f6f5f;
  font-size: 1.02rem;
  line-height: 1.5;
  text-decoration: none;
  overflow-wrap: anywhere;
}

.contact-item-value:hover {
  text-decoration: underline;
}

.writing-container {
  padding-bottom: 44px;
}

.writing-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  width: 100%;
  margin-top: 10px;
}

.writing-card {
  container-type: size;
  position: relative;
  display: block;
  min-height: 250px;
  overflow: hidden;
  text-decoration: none;
  color: #111111;
  background-color: #ffffff;
  border: 1px solid var(--line);
  padding: 28px 30px 26px;
  transition:
    border-color 180ms ease;
}

.writing-card::after {
  content: "";
  position: absolute;
  top: 50%;
  right: 56px;
  z-index: 0;
  width: 138px;
  height: 138px;
  transform: translateY(-50%);
  background-image: var(--writing-card-icon);
  background-repeat: no-repeat;
  background-position: center;
  background-size: contain;
  pointer-events: none;
}

@supports (height: 1cqh) {
  .writing-card::after {
    right: 22.5cqh;
    width: 55cqh;
    height: 55cqh;
  }
}

.visual-card {
  --writing-card-icon: url("./assets/camera.png");
}

.text-card {
  --writing-card-icon: url("./assets/paperpen.png");
}

.side-card {
  --writing-card-icon: url("./assets/trophy.png");
}

.writing-card-shade {
  position: absolute;
  inset: 0;
  background: transparent;
}

.writing-card-copy {
  position: absolute;
  left: 30px;
  right: 46%;
  bottom: 26px;
  z-index: 1;
  display: grid;
  gap: 5px;
  text-align: left;
}

.writing-card-title {
  font-family: var(--serif-text);
  font-size: 1.26rem;
  font-weight: 400;
  letter-spacing: 0.02em;
  line-height: 1.28;
  color: #111111;
  text-shadow: none;
}


.writing-card-note {
  color: #74706a;
  font-family: var(--serif-text);
  font-size: 0.88rem;
  line-height: 1.58;
}


.writing-card:hover {
  border-color: #d8d2c6;
}

.text-topic-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.text-article-list {
  display: grid;
  gap: 0;
}

.text-article-entry {
  display: grid;
  gap: 10px;
  padding: 18px 0 22px;
  border-top: 1px solid #e6e1d6;
  text-decoration: none;
  color: #111111;
}

.text-article-entry:last-child {
  border-bottom: 1px solid #e6e1d6;
}

.text-article-entry-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
}

.text-article-entry-title {
  margin: 0;
  font-family: var(--serif-text);
  font-size: 1.18rem;
  font-weight: 400;
  line-height: 1.45;
}

.text-entry-purpose {
  margin: 0;
  color: #8b847a;
  font-family: var(--serif-text);
  font-size: 0.9rem;
  line-height: 1.75;
}

.text-article-entry-intro {
  margin: 0;
  color: #5a5a5a;
  font-family: var(--serif-text);
  font-size: 1rem;
  line-height: 1.75;
  max-width: none;
}

.text-language-note[hidden] {
  display: none;
}

.text-language-note {
  margin: 1rem 0 0;
  padding-top: 0.85rem;
  border-top: 1px solid rgba(79, 107, 85, 0.18);
  color: #4f6b55;
  font-family: var(--serif-text);
  font-size: 0.92rem;
  line-height: 1.8;
  max-width: none;
  width: 100%;
}

.text-article-body {
  max-width: none;
}

.markdown-layout {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
  align-items: start;
}

.markdown-layout > * {
  min-width: 0;
}

.markdown-layout.is-no-toc {
  grid-template-columns: minmax(0, 1fr);
}

.markdown-toc-shell[hidden] {
  display: none;
}

.markdown-toc-shell {
  position: sticky;
  top: 28px;
}

.markdown-toc {
  padding-top: 4px;
}

.markdown-toc-title {
  margin: 0 0 12px;
  color: var(--accent);
  font-family: var(--serif-text);
  font-size: 0.98rem;
  font-weight: 400;
  line-height: 1.4;
}

.markdown-toc-list {
  display: grid;
  gap: 8px;
}

.markdown-toc-link {
  color: var(--accent);
  text-decoration: none;
  font-family: var(--serif-text);
  font-size: 0.95rem;
  line-height: 1.5;
}

.markdown-toc-link:hover {
  color: #174f44;
  text-decoration: underline;
}

.markdown-toc-link.is-sub {
  padding-left: 14px;
  font-size: 0.9rem;
}

.markdown-body {
  color: #1c1c1c;
  font-family: var(--serif-text);
  font-size: 1.04rem;
  line-height: 1.9;
  min-width: 0;
  overflow-wrap: break-word;
}

.markdown-body.is-plain-text {
  max-width: none;
  width: 100%;
}

.markdown-body h1,
.markdown-body h2,
.markdown-body h3,
.markdown-body h4,
.markdown-body h5,
.markdown-body h6 {
  margin: 1.7em 0 0.55em;
  font-family: var(--serif-text);
  font-weight: 400;
  line-height: 1.35;
  letter-spacing: 0;
}

.markdown-body h1 {
  font-size: 2.05rem;
}

.markdown-body h2 {
  font-size: 1.58rem;
}

.markdown-body h3 {
  font-size: 1.28rem;
}

.markdown-body p,
.markdown-body ul,
.markdown-body blockquote,
.markdown-body hr,
.markdown-body pre,
.markdown-body .markdown-table-wrap {
  margin: 0 0 1em;
}

.markdown-body ul {
  padding-left: 1.4em;
}

.markdown-body li {
  margin-bottom: 0.45em;
}

.markdown-body blockquote {
  padding-left: 1em;
  border-left: 2px solid #d8d2c6;
  color: #5f5a52;
}

.markdown-body hr {
  border: 0;
  border-top: 1px solid #d8d2c6;
  margin: 1.4em 0;
}

.markdown-body code {
  padding: 0.08em 0.34em;
  background: #f6f3ed;
  border: 1px solid #ece6da;
  font-family: "SFMono-Regular", Menlo, Consolas, "YCY Mizuki Ming", "YCY Songti SC", monospace;
  font-size: 0.92em;
}

.markdown-body pre {
  padding: 16px 18px;
  overflow: auto;
  background: #f8f5ef;
  border: 1px solid #ece6da;
}

.markdown-body pre code {
  padding: 0;
  background: transparent;
  border: none;
}

.markdown-table-wrap {
  width: 100%;
  overflow-x: auto;
}

.markdown-body table {
  width: 100%;
  border-collapse: collapse;
  border-top: 1px solid #d8d2c6;
  border-bottom: 1px solid #d8d2c6;
  font-size: 0.97em;
}

.markdown-body th,
.markdown-body td {
  padding: 0.62em 0.75em;
  border-bottom: 1px solid #ece6da;
  text-align: left;
  vertical-align: top;
}

.markdown-body thead th {
  font-weight: 400;
  color: #111111;
  background: #faf8f3;
}

.markdown-body tbody tr:last-child td {
  border-bottom: 0;
}

.markdown-body th.is-center,
.markdown-body td.is-center {
  text-align: center;
}

.markdown-body th.is-right,
.markdown-body td.is-right {
  text-align: right;
}

.markdown-body a {
  color: #1f6f5f;
  text-decoration: none;
}

.markdown-body a:hover {
  text-decoration: underline;
}

.markdown-body strong {
  font-weight: 400;
  color: #111111;
}

.markdown-inline-image {
  display: block;
  max-width: 100%;
  height: auto;
  margin: 1.1em auto 1.3em;
}

.markdown-body .katex {
  font-size: 1.03em;
}

.markdown-body .katex-display {
  margin: 1.2em 0 1.55em;
  overflow-x: auto;
  overflow-y: hidden;
  padding: 0.15em 0;
}

.markdown-body .katex-display > .katex {
  max-width: 100%;
}

.math-raw {
  font-family: "Times New Roman", "STIX Two Math", "Cambria Math", "YCY Mizuki Ming", "YCY Songti SC", serif;
}

.research-markdown-body h1 {
  margin: 2.8em 0 1em;
  padding-top: 1.15em;
  border-top: 2px solid #111111;
  font-size: clamp(1.62rem, 5vw, 1.9rem);
  font-weight: 400;
}

.research-markdown-body {
  width: 100%;
  max-width: none;
}

.research-markdown-body h1:first-child {
  margin-top: 0;
  padding-top: 0;
  border-top: 0;
}

.research-markdown-body h2 {
  margin: 1.2em 0 0.85em;
  padding-bottom: 0.42em;
  border-bottom: 1px solid #111111;
  font-size: clamp(1.24rem, 3.8vw, 1.34rem);
  font-weight: 400;
}

.research-markdown-body h1 + h2 {
  margin-top: 0.7em;
}

.research-markdown-body h3,
.research-markdown-body h4,
.research-markdown-body h5,
.research-markdown-body h6 {
  margin-top: 1.2em;
}

.research-markdown-body p,
.research-markdown-body ul,
.research-markdown-body blockquote,
.research-markdown-body pre {
  max-width: none;
}

.research-markdown-body p,
.research-markdown-body ul {
  color: #2b2b2b;
}

.research-markdown-body blockquote {
  margin: 1em 0 1.7em;
  padding: 0.9em 1.1em;
  border-left: 2px solid #111111;
  background: #f7f5ef;
  color: #2b2b2b;
}

.research-markdown-body blockquote p {
  margin: 0;
}

.research-markdown-body blockquote strong {
  color: #111111;
}

.about-markdown-body {
  width: 100%;
  max-width: none;
}

.about-markdown-body h1 {
  margin: 0 0 0.55em;
  font-size: clamp(2.25rem, 4.8vw, 3.35rem);
  font-weight: 400;
  letter-spacing: 0;
}

.about-markdown-body h1 + p {
  margin-bottom: 2.4rem;
  color: #4c4c4c;
  font-size: 1.05rem;
  line-height: 1.85;
}

.about-markdown-body h2 {
  margin: 2.25rem 0 1rem;
  padding-bottom: 0.42em;
  border-bottom: 1px solid #1f6f5f;
  font-size: 1.48rem;
  font-weight: 400;
}

.about-markdown-body p,
.about-markdown-body ul {
  max-width: none;
}

.about-markdown-body li {
  margin-bottom: 0.35em;
}

.visual-subgrid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.visual-featured-entry {
  width: 100%;
  margin: 28px auto 0;
}

.visual-featured-grid {
  grid-template-columns: 1fr;
  gap: 34px;
}

.visual-featured-grid .visual-single-card {
  grid-column: 1 / -1;
  gap: 12px;
}

.visual-featured-grid .visual-thumb {
  aspect-ratio: auto !important;
  height: auto;
  background: transparent;
  border: none;
  overflow: visible;
}

.visual-featured-grid .visual-thumb-image {
  width: 100%;
  height: auto;
  object-fit: contain;
  background: transparent;
}

.visual-subgrid .academic-section {
  margin-top: 0;
}

.visual-mode-grid {
  margin-top: 8px;
}

.visual-gallery-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 26px 20px;
  width: 100%;
  max-width: none;
  align-items: start;
}

.visual-gallery-grid[data-gallery-kind="collection"] {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.visual-masonry-grid {
  display: block;
  column-width: 300px;
  column-gap: 22px;
  width: 100%;
  max-width: none;
}

.visual-entry-card,
.visual-single-card {
  display: grid;
  gap: 12px;
  min-width: 0;
  width: 100%;
}

.visual-masonry-grid .visual-single-card {
  break-inside: avoid;
  margin: 0 0 30px;
}

[data-gallery-kind="collection"] .visual-entry-card {
  align-content: start;
}

.visual-single-card .visual-thumb {
  background: transparent;
  border: none;
  overflow: visible;
}

.visual-thumb {
  position: relative;
  width: 100%;
  background: #f8f7f3;
  border: 1px solid #ddd7ca;
  overflow: hidden;
}

[data-gallery-kind="collection"] .visual-thumb {
  aspect-ratio: 3 / 2;
}

.visual-thumb-image {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
  object-position: center;
  background: #f8f7f3;
}

.visual-single-card .visual-thumb-image {
  width: 100%;
  height: auto;
  object-fit: contain;
  background: #fbfaf7;
}

.film-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 2px 7px;
  border: 1px solid #d0c8bb;
  background: rgba(255, 255, 255, 0.84);
  color: #655f55;
  font-family: var(--serif-text);
  font-size: 0.76rem;
  letter-spacing: 0.06em;
}

.visual-entry-meta,
.visual-caption-line {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px;
  padding-bottom: 2px;
  border-bottom: 1px solid #ece6da;
}

.visual-entry-title {
  margin: 0;
  color: #111111;
  font-family: var(--serif-text);
  font-size: 0.98rem;
  font-weight: 400;
  line-height: 1.45;
}

.visual-entry-action {
  color: #6a645b;
  text-decoration: none;
  font-family: var(--serif-text);
  font-size: 0.88rem;
  white-space: nowrap;
}

.visual-entry-action:hover {
  color: #1f6f5f;
  text-decoration: underline;
}

.visual-entry-text {
  margin: 0;
  color: #555555;
  font-family: var(--serif-text);
  font-size: 0.98rem;
  line-height: 1.75;
  max-width: none;
}

.visual-caption {
  display: grid;
  gap: 10px;
}

.visual-page-tip {
  margin: 0 0 22px;
  color: #6f685d;
  font-family: var(--serif-text);
  font-size: 0.94rem;
  line-height: 1.75;
}

.visual-page-tip strong {
  font-weight: 400;
  color: #4d473f;
}

.visual-thumb-link {
  display: block;
  color: inherit;
  text-decoration: none;
  cursor: pointer;
}

.visual-thumb-hint {
  position: absolute;
  left: 12px;
  bottom: 10px;
  color: #6f685d;
  font-family: var(--serif-text);
  font-size: 0.8rem;
  letter-spacing: 0.02em;
}

.work-field-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 20px;
}

.work-field-card {
  display: block;
  border: 1px solid var(--line);
  padding: 22px 20px 20px;
  text-decoration: none;
  color: #111111;
  background: #ffffff;
}

.work-field-card:hover {
  border-color: #d8d2c6;
}

.work-field-card h3 {
  margin: 0 0 10px;
  font-family: var(--serif-text);
  font-size: 1.42rem;
  font-weight: 400;
  color: #111111;
}

.work-field-card p {
  margin: 0;
  color: #555555;
  font-family: var(--serif-text);
  font-size: 1rem;
  line-height: 1.75;
}

.field-entry {
  margin-bottom: 18px;
}

.field-entry:last-child {
  margin-bottom: 0;
}

.field-entry-title {
  margin: 0 0 6px;
  color: #111111;
  font-family: var(--serif-text);
  font-size: 1.02rem;
  line-height: 1.7;
}

.field-entry-summary {
  margin: 0;
  color: #555555;
  font-family: var(--serif-text);
  font-size: 1rem;
  line-height: 1.75;
}

.inline-page-link {
  color: #1f6f5f;
  text-decoration: none;
}

.inline-page-link:hover {
  text-decoration: underline;
}

@media (max-width: 920px) {
  body {
    overflow: auto;
  }

  .hero-band {
    padding: 44px 0 28px;
  }

  .academic-container {
    padding: 28px 28px 40px;
  }

  .writing-grid {
    grid-template-columns: 1fr;
  }

  .text-topic-grid {
    grid-template-columns: 1fr;
  }

  .markdown-layout {
    grid-template-columns: 1fr;
    gap: 22px;
  }

  .markdown-toc-shell {
    position: static;
  }

  .markdown-body .markdown-inline-image {
    width: auto !important;
    max-width: 100%;
  }

  .visual-subgrid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .visual-gallery-grid,
  .visual-gallery-grid {
    grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
  }

  .visual-masonry-grid {
    column-width: 240px;
  }

  .visual-gallery-grid[data-gallery-kind="collection"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .work-field-grid {
    grid-template-columns: 1fr;
  }

  .home-band {
    padding-top: 28px;
  }

  .home-container {
    padding-top: 28px;
    padding-bottom: 30px;
  }
}

@media (max-width: 640px) {
  /* Mobile shell */
  .hero-band,
  .home-topbar,
  .page-band {
    width: min(100% - 20px, 1080px);
  }

  .academic-screen {
    width: min(100% - 20px, 1080px);
  }

  .academic-screen .home-topbar,
  .academic-screen .page-index-bar,
  .academic-screen .academic-band {
    width: 100%;
  }

  /* Mobile top navigation */
  .home-topbar {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    grid-template-areas:
      "brand lang"
      "nav nav";
    align-items: center;
    gap: 10px 16px;
    padding: 16px 10px 14px;
  }

  .home-topbar .home-icon {
    grid-area: brand;
    align-self: center;
  }

  .top-nav {
    grid-area: nav;
    grid-column: 1 / -1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 10px;
    width: 100%;
  }

  .top-nav a {
    text-align: center;
    white-space: normal;
    text-wrap: balance;
    line-height: 1.35;
    min-height: 2.7em;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2px 4px;
    font-size: 0.87rem;
  }

  .lang-switch {
    grid-area: lang;
    display: flex;
    align-items: center;
    justify-self: end;
    gap: 8px;
    margin-right: 6px;
    align-self: center;
  }

  .lang-button {
    min-width: auto;
    padding: 7px 10px;
    border: 1px solid var(--line);
    border-left: 1px solid var(--line);
    border-radius: 999px;
    font-size: 0.8rem;
    letter-spacing: 0;
  }

  .top-nav a::after {
    bottom: -4px;
  }

  .academic-topbar {
    padding-left: var(--shell-gutter-mobile);
    padding-right: var(--shell-gutter-mobile);
    padding-top: 16px;
    padding-bottom: 14px;
  }

  /* Mobile breadcrumb */
  .page-index-bar {
    padding: 0.68em var(--shell-gutter-mobile) 10px;
    overflow: hidden;
  }

  .page-index {
    flex-wrap: nowrap;
    gap: 6px;
    align-items: center;
    padding-left: 0;
    color: #777777;
    font-size: 0.78rem;
    line-height: 1.45;
    white-space: nowrap;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
  }

  .page-index::-webkit-scrollbar {
    display: none;
  }

  .page-index a,
  .page-index span {
    flex: 0 0 auto;
  }

  .page-index span:last-child {
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  /* Mobile page body */
  .home-hero {
    gap: 14px;
  }

  .hero-band {
    padding: 28px 0 24px;
  }

  .page-band {
    padding: 24px 0 32px;
  }

  .page-shell {
    gap: 28px;
  }

  .academic-container {
    padding: 22px 16px 30px;
  }

  .markdown-body {
    font-size: 1rem;
    line-height: 1.86;
  }

  .markdown-body h1 {
    font-size: 1.72rem;
  }

  .markdown-body h2 {
    font-size: 1.36rem;
  }

  .academic-section-title {
    font-size: 1.32rem;
  }

  .academic-content p {
    line-height: 1.8;
  }

  .contact-row {
    grid-template-columns: minmax(54px, max-content) minmax(0, 1fr);
    gap: clamp(14px, 5vw, 24px);
  }

  .contact-item-value {
    font-size: 1rem;
  }

  .writing-grid {
    gap: 14px;
  }

  .writing-card {
    min-height: 0;
    aspect-ratio: 2 / 1;
    padding: clamp(18px, 5vw, 24px);
  }

  .writing-card-copy {
    left: clamp(18px, 5vw, 24px);
    right: clamp(18px, 5vw, 24px);
    bottom: clamp(16px, 4.5vw, 22px);
    max-width: min(68%, 260px);
  }

  .writing-card-title {
    font-size: clamp(1.12rem, 5vw, 1.32rem);
    line-height: 1.25;
  }

  .writing-card-note {
    font-size: clamp(0.78rem, 3.2vw, 0.88rem);
    line-height: 1.45;
  }

  /* Mobile visual pages */
  .visual-gallery-grid {
    grid-template-columns: 1fr;
  }

  .visual-masonry-grid {
    column-count: 1;
    column-width: auto;
  }
}
