:root {
  --bg: #f6f1e8;
  --paper: #ffffff;
  --ink: #17191f;
  --muted: #5c6468;
  --soft: #e7eadf;
  --line: #d9d2bf;
  --teal: #18736c;
  --teal-dark: #0f4f4a;
  --violet: #70598e;
  --copper: #b65f39;
  --gold: #b58a22;
  --moss: #72843f;
  --clay: #c97950;
  --wash: #f2ead8;
  --shadow: 0 18px 48px rgba(22, 27, 31, 0.1);
  --max: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.46), transparent 360px),
    repeating-linear-gradient(90deg, rgba(181, 138, 34, 0.035) 0 1px, transparent 1px 52px),
    var(--bg);
  color: var(--ink);
  font-family: "Inter", "Noto Sans JP", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.75;
  letter-spacing: 0;
}

img {
  max-width: 100%;
  display: block;
}

a {
  color: var(--teal-dark);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  color: var(--copper);
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  border-bottom: 1px solid rgba(206, 216, 209, 0.75);
  background: rgba(244, 246, 243, 0.9);
  backdrop-filter: blur(18px);
}

.nav-shell {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
}

.brand {
  color: var(--ink);
  font-family: "Source Serif 4", "Noto Serif JP", Georgia, serif;
  font-size: 1.08rem;
  font-weight: 650;
  text-decoration: none;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 6px;
  flex-wrap: wrap;
}

.nav-links a {
  padding: 8px 10px;
  border-radius: 6px;
  color: var(--ink);
  font-size: 0.92rem;
  text-decoration: none;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  background: rgba(35, 109, 103, 0.1);
  color: var(--teal-dark);
}

.language-link {
  border: 1px solid var(--line);
  background: rgba(255, 255, 255, 0.55);
}

.hero {
  position: relative;
  min-height: 84svh;
  overflow: hidden;
  color: #f7fbf8;
  background: #11171a;
}

.hero-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(11, 17, 19, 0.9), rgba(11, 17, 19, 0.62) 56%, rgba(11, 17, 19, 0.25)),
    linear-gradient(0deg, rgba(11, 17, 19, 0.82), rgba(11, 17, 19, 0.08) 45%);
}

.hero-inner {
  position: relative;
  z-index: 1;
  width: min(var(--max), calc(100% - 32px));
  min-height: 84svh;
  margin: 0 auto;
  padding: 116px 0 72px;
  display: flex;
  align-items: center;
}

.hero-copy {
  width: min(760px, 100%);
}

.eyebrow {
  margin: 0 0 18px;
  color: #b8d9d4;
  font-size: 0.94rem;
  font-weight: 700;
}

.hero h1,
.page-hero h1 {
  margin: 0;
  font-family: "Source Serif 4", "Noto Serif JP", Georgia, serif;
  font-size: 4rem;
  line-height: 1.05;
  font-weight: 680;
}

.hero-lede {
  max-width: 710px;
  margin: 24px 0 0;
  color: #e5ece7;
  font-size: 1.16rem;
}

.hero-actions,
.section-actions {
  margin-top: 30px;
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 10px 16px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  font-weight: 700;
  text-decoration: none;
}

.button:hover {
  border-color: rgba(255, 255, 255, 0.55);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
}

.button.primary {
  border-color: #b6d6d2;
  background: #e9f4f1;
  color: #103f3c;
}

.button.primary:hover {
  background: #ffffff;
  color: #103f3c;
}

.button.dark {
  border-color: var(--teal);
  background: var(--teal-dark);
  color: #ffffff;
}

.button.dark:hover {
  background: var(--teal);
  color: #ffffff;
}

.hero-portrait {
  position: absolute;
  z-index: 2;
  right: max(28px, calc((100vw - var(--max)) / 2));
  bottom: 34px;
  width: clamp(220px, 24vw, 320px);
  margin: 0;
  padding: 8px 8px 6px;
  border: 1px solid rgba(239, 188, 99, 0.88);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(15, 79, 74, 0.96), rgba(181, 138, 34, 0.92));
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.28);
}

.hero-portrait img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-portrait figcaption {
  padding: 7px 4px 0;
  background: transparent;
  color: #f7fbf8;
  font-size: 0.78rem;
}

.page-hero {
  padding: 88px 0 54px;
  background: #172120;
  color: #f7fbf8;
  position: relative;
  overflow: hidden;
}

.page-hero::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(135deg, rgba(24, 115, 108, 0.5), transparent 56%),
    linear-gradient(90deg, rgba(112, 89, 142, 0.18), rgba(198, 121, 80, 0.22));
}

.page-hero .container {
  position: relative;
  z-index: 1;
}

.page-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  opacity: 0.7;
}

.page-hero p {
  max-width: 820px;
  color: #dfeae6;
  font-size: 1.08rem;
}

.band {
  padding: 76px 0;
}

.band.paper {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, 0.95), rgba(248, 247, 241, 0.95)),
    var(--paper);
}

.band.compact {
  padding: 48px 0;
}

.container {
  width: min(var(--max), calc(100% - 32px));
  margin: 0 auto;
}

.section-heading {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(260px, 0.55fr);
  gap: 32px;
  align-items: end;
  margin-bottom: 32px;
}

.section-heading h2,
.article h2 {
  margin: 0;
  font-family: "Source Serif 4", "Noto Serif JP", Georgia, serif;
  font-size: 2.2rem;
  line-height: 1.18;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
}

.profile-grid {
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 28px;
  align-items: start;
}

.profile-text {
  font-size: 1.04rem;
}

.fact-list {
  display: grid;
  gap: 12px;
}

.fact {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.fact dt {
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.fact dd {
  margin: 4px 0 0;
}

.thread-grid,
.link-grid,
.course-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.thread-card,
.link-card,
.course-card,
.paper-card,
.source-card {
  border: 1px solid var(--line);
  border-top: 4px solid rgba(181, 138, 34, 0.72);
  border-radius: 8px;
  background: var(--paper);
  box-shadow: 0 1px 0 rgba(20, 28, 24, 0.03);
}

.thread-card,
.link-card,
.course-card,
.source-card {
  padding: 20px;
}

.thread-card h3,
.link-card h3,
.course-card h3,
.source-card h3 {
  margin: 0 0 10px;
  font-size: 1.02rem;
}

.thread-card p,
.link-card p,
.course-card p,
.source-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.course-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
}

.course-card {
  display: grid;
  gap: 12px;
  min-width: 0;
}

.course-card > * {
  min-width: 0;
}

.course-meta {
  color: var(--muted);
  font-size: 0.78rem;
  font-weight: 700;
}

.course-formula {
  display: block;
  max-width: 100%;
  box-sizing: border-box;
  min-height: 44px;
  padding: 10px 12px;
  border: 1px solid rgba(181, 138, 34, 0.26);
  border-radius: 8px;
  background: rgba(181, 138, 34, 0.08);
  color: var(--ink);
  font-family: Georgia, "Times New Roman", serif;
  font-size: 1.02rem;
  line-height: 1.35;
  letter-spacing: 0;
  text-align: center;
  overflow-x: auto;
  overflow-y: hidden;
  overflow-wrap: anywhere;
}

.course-formula mjx-container[jax="SVG"] {
  display: block;
  max-width: 100%;
  margin: 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 2px;
}

.course-formula svg {
  max-width: none;
}

.access-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(280px, 0.8fr);
  gap: 24px;
  align-items: start;
}

.map-panel {
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper);
  box-shadow: var(--shadow);
}

.map-panel iframe {
  width: 100%;
  min-height: 460px;
  border: 0;
  display: block;
}

.access-note {
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.route-list {
  display: grid;
  gap: 14px;
}

.route-step {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 14px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
}

.route-step strong {
  color: var(--teal-dark);
}

.route-step p {
  margin: 0;
  color: var(--muted);
}

.source-list {
  margin: 0;
  padding-left: 1.2em;
}

.source-list li + li {
  margin-top: 8px;
}

.article {
  display: grid;
  gap: 36px;
}

.article-section {
  display: grid;
  grid-template-columns: minmax(220px, 0.35fr) minmax(0, 1fr);
  gap: 36px;
  align-items: start;
  padding: 32px 0;
  border-top: 1px solid var(--line);
}

.article-section:first-child {
  border-top: 0;
  padding-top: 0;
}

.article-section h2 {
  color: var(--teal-dark);
}

.equation-panel {
  margin: 24px 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #f8faf7;
  overflow-x: auto;
}

.tag-row,
.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 0;
}

.tag,
.filter-button {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8faf7;
  color: var(--muted);
  font-size: 0.82rem;
  font-weight: 700;
}

.filter-button {
  cursor: pointer;
  color: var(--ink);
}

.filter-button:hover,
.filter-button.is-active {
  border-color: var(--teal);
  background: rgba(35, 109, 103, 0.1);
  color: var(--teal-dark);
}

.related-papers {
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
}

.related-papers strong {
  margin-right: 4px;
  color: var(--muted);
  font-size: 0.86rem;
}

.related-papers a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #f8faf7;
  color: var(--teal-dark);
  font-size: 0.82rem;
  font-weight: 700;
  text-decoration: none;
}

.related-papers a:hover {
  border-color: var(--teal);
  background: rgba(35, 109, 103, 0.1);
}

.publication-tools {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  flex-wrap: wrap;
  margin-bottom: 24px;
}

.search-field {
  min-width: min(360px, 100%);
  min-height: 42px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: var(--paper);
  color: var(--ink);
  font: inherit;
}

.paper-list {
  display: grid;
  gap: 14px;
}

.paper-card {
  padding: 18px;
}

.paper-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  align-items: center;
  color: var(--muted);
  font-size: 0.88rem;
}

.paper-card h3 {
  margin: 8px 0 8px;
  font-size: 1.08rem;
  line-height: 1.35;
}

.paper-card p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

.paper-card .paper-summary {
  color: var(--ink);
}

.paper-abstract {
  margin-top: 10px;
  padding-top: 10px;
  border-top: 1px solid rgba(217, 210, 191, 0.7);
  color: var(--muted);
  font-size: 0.92rem;
}

.paper-abstract summary {
  cursor: pointer;
  color: var(--teal-dark);
  font-weight: 700;
}

.paper-abstract p {
  margin-top: 8px;
}

.paper-visual-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
  margin-top: 14px;
}

.paper-visual {
  margin: 0;
  overflow: hidden;
  border: 1px solid rgba(217, 210, 191, 0.82);
  border-radius: 8px;
  background: #fbfaf5;
}

.paper-visual img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 11;
  object-fit: contain;
  background: #fff;
}

.paper-visual figcaption {
  padding: 9px 10px 10px;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.45;
}

.paper-visual-compact {
  width: min(100%, 420px);
  justify-self: start;
}

.paper-visual-compact img {
  aspect-ratio: 16 / 8;
}

.research-visual-strip {
  display: grid;
  grid-template-columns: minmax(0, 0.92fr) minmax(0, 1.08fr);
  gap: 14px;
  margin: 18px 0;
}

.research-visual-strip figure {
  margin: 0;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(20, 28, 24, 0.08);
}

.research-visual-strip img {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: contain;
}

.research-visual-strip figcaption {
  padding: 8px 10px;
  background: rgba(23, 33, 32, 0.92);
  color: #edf4ef;
  font-size: 0.82rem;
}

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

.album-grid.preview {
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 10px;
}

.photo-card {
  margin: 0;
  border: 1px solid var(--line);
  border-top: 4px solid rgba(198, 121, 80, 0.72);
  border-radius: 8px;
  overflow: hidden;
  background: var(--paper);
}

.photo-card a {
  display: block;
  color: inherit;
  text-decoration: none;
}

.photo-card img {
  width: 100%;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  background: var(--soft);
  transition: transform 0.16s ease;
}

.photo-card a:hover img {
  transform: scale(1.025);
}

.photo-card figcaption {
  padding: 10px 12px 12px;
  border-top: 1px solid var(--line);
}

.photo-card figcaption:empty {
  display: none;
}

.photo-title {
  display: block;
  font-weight: 700;
  line-height: 1.35;
}

.photo-note {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 0.88rem;
}

.timeline-list {
  display: grid;
  gap: 14px;
}

.timeline-item {
  display: grid;
  grid-template-columns: minmax(130px, 0.26fr) minmax(0, 1fr);
  gap: 20px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--paper);
}

.timeline-item time {
  color: var(--teal-dark);
  font-weight: 800;
}

.timeline-item h3 {
  margin: 0 0 6px;
  font-size: 1.02rem;
}

.timeline-item p {
  margin: 0;
  color: var(--muted);
  font-size: 0.94rem;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  background: #11171a;
  color: #dbe5e0;
  padding: 34px 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
}

.site-footer a {
  color: #cde8e2;
}

.small {
  color: var(--muted);
  font-size: 0.9rem;
}

.site-footer .small {
  color: #aebcb7;
}

.no-results {
  padding: 20px;
  border: 1px dashed var(--line);
  border-radius: 8px;
  color: var(--muted);
}

@media (max-width: 980px) {
  .hero h1,
  .page-hero h1 {
    font-size: 3rem;
  }

  .hero {
    min-height: auto;
    padding-bottom: 30px;
  }

  .hero-inner {
    min-height: auto;
    padding: 92px 0 24px;
    align-items: flex-start;
  }

  .hero-portrait {
    position: relative;
    right: auto;
    bottom: auto;
    width: min(360px, calc(100% - 32px));
    margin: 0 auto;
  }

  .section-heading,
  .profile-grid,
  .access-grid,
  .article-section,
  .timeline-item {
    grid-template-columns: 1fr;
  }

  .thread-grid,
  .link-grid,
  .course-grid,
  .source-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .album-grid.preview {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  body {
    font-size: 15px;
  }

  .nav-shell {
    align-items: flex-start;
    flex-direction: column;
    padding: 12px 0;
  }

  .nav-links {
    justify-content: flex-start;
  }

  .hero-inner {
    padding: 68px 0 22px;
  }

  .hero-portrait {
    width: min(330px, calc(100% - 32px));
  }

  .hero h1,
  .page-hero h1 {
    font-size: 2.36rem;
  }

  .hero-lede,
  .page-hero p {
    font-size: 1rem;
  }

  .band {
    padding: 54px 0;
  }

  .thread-grid,
  .link-grid,
  .course-grid,
  .source-grid,
  .album-grid,
  .album-grid.preview {
    grid-template-columns: 1fr;
  }

  .research-visual-strip {
    grid-template-columns: 1fr;
  }

  .map-panel iframe {
    min-height: 340px;
  }

  .route-step {
    grid-template-columns: 1fr;
  }

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