@import url('https://fonts.googleapis.com/css2?family=Noto+Sans+JP:wght@300;400;500;700&family=Noto+Serif+JP:wght@400;500;600;700&display=swap');

:root {
  --ink: #000000;
  --paper: #ffffff;
  --ash: #6b6b6b;
  --rule: #dcdcdc;
  --soft: #f4f4f4;
  --serif: "Noto Serif JP", "Songti SC", "Times New Roman", serif;
  --sans: "Noto Sans JP", "Hiragino Sans", "Microsoft YaHei", system-ui, sans-serif;
  --pad: clamp(18px, 4vw, 56px);
}

*, *::before, *::after { box-sizing: border-box; }

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.8;
  font-weight: 400;
  letter-spacing: .01em;
  overflow-x: hidden;
}

img { display: block; max-width: 100%; }
a { color: inherit; }
p { margin: 0 0 1.1em; }
ul { list-style: none; margin: 0; padding: 0; }

hr {
  border: 0;
  border-top: 3px solid var(--ink);
  width: 52px;
  margin: 12px 0 24px;
}

:focus-visible {
  outline: 3px solid var(--ink);
  outline-offset: 2px;
}

/* ---------- 顶部栏：图标角落 + 横向索引 + 右侧按钮 ---------- */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 60px;
  padding: 6px 10px 6px 10px;
  background: var(--paper);
  border-bottom: 2px solid var(--ink);
}

.mark {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 600;
  text-decoration: none;
  line-height: 1;
}

.topbar nav {
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  scrollbar-width: none;
}
.topbar nav::-webkit-scrollbar { display: none; }

.topbar nav ul {
  display: flex;
  align-items: stretch;
  gap: 2px;
}

.topbar nav a.nav-link {
  position: relative;
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 11px;
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  white-space: nowrap;
  border-bottom: 2px solid transparent;
}

.topbar nav a.nav-link::after {
  content: "";
  position: absolute;
  left: 11px;
  right: 11px;
  bottom: 6px;
  height: 2px;
  background: var(--ink);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform .22s ease;
}

.topbar nav a.nav-link:hover::after,
.topbar nav a.nav-link.on::after { transform: scaleX(1); }

.cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 16px;
  background: var(--ink);
  color: var(--paper);
  font-size: 16px;
  font-weight: 500;
  letter-spacing: .04em;
  text-decoration: none;
  transition: background .2s ease, color .2s ease, box-shadow .2s ease;
}
.cta:hover { background: var(--paper); color: var(--ink); box-shadow: inset 0 0 0 2px var(--ink); }

/* ---------- 主栅格 ---------- */

main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20rem;
  gap: 0 clamp(26px, 4vw, 64px);
  padding: 0 var(--pad) 72px;
}

/* ---------- 首屏 ---------- */

.hero {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 5fr 7fr;
  min-height: 88vh;
  margin: 0 calc(var(--pad) * -1) clamp(28px, 5vw, 56px);
  border-bottom: 4px solid var(--ink);
}

.hero-fig {
  position: relative;
  margin: 0;
  overflow: hidden;
  background: var(--ink);
  clip-path: polygon(0 0, 100% 0, 86% 100%, 0 100%);
}

.hero-fig.is-empty {
  background:
    repeating-linear-gradient(135deg, #000 0 10px, #fff 10px 20px);
}

.hero-fig img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.08);
  transform: scale(1.02);
  will-change: transform;
}

.hero-fig figcaption {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 2;
  padding: 4px 10px;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: .22em;
  line-height: 1.6;
}

.hero-txt {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: clamp(30px, 6vw, 80px) clamp(20px, 5vw, 64px);
  text-align: center;
}

.band {
  display: block;
  width: 72px;
  height: 8px;
  background: var(--ink);
}

h1 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(2rem, 6.2vw, 4.2rem);
  line-height: 1.08;
  letter-spacing: -.01em;
  max-width: 16ch;
}

.hero-desc {
  max-width: 36ch;
  color: #1c1c1c;
  margin: 0;
}

/* ---------- 正文 ---------- */

.content {
  grid-column: 1;
  min-width: 0;
  max-width: 70ch;
  padding-top: clamp(24px, 4vw, 44px);
}

.content > section {
  padding: clamp(30px, 5vw, 54px) 0;
  border-top: 1px solid var(--rule);
}

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

.content section[id] { scroll-margin-top: 88px; }

.content h2 {
  margin: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(1.5rem, 3vw, 2.05rem);
  line-height: 1.32;
  letter-spacing: -.005em;
}

.content h3 {
  margin: 30px 0 10px;
  font-family: var(--serif);
  font-weight: 600;
  font-size: 1.24rem;
  line-height: 1.4;
}

.content p { font-size: 17px; }

.content > section > p:first-of-type::first-letter {
  float: left;
  padding: .06em .12em 0 0;
  font-family: var(--serif);
  font-size: 3.1em;
  font-weight: 600;
  line-height: .82;
}

.content blockquote {
  margin: 30px 0;
  padding: 6px 0 6px 22px;
  border-left: 5px solid var(--ink);
  font-family: var(--serif);
  font-size: 1.15rem;
  line-height: 1.7;
}

.content ul, .content ol {
  margin: 0 0 1.1em;
  padding-left: 1.3em;
}
.content ul { list-style: square; }
.content ol { list-style: decimal; }

.content a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 2px;
}

.content a:hover { background: var(--ink); color: var(--paper); }

.content figure { margin: 28px 0; }
.content figcaption {
  margin-top: 8px;
  color: var(--ash);
  font-size: 16px;
  line-height: 1.6;
}

.content table {
  width: 100%;
  border-collapse: collapse;
  font-size: 16px;
}
.content th, .content td {
  border: 1px solid var(--ink);
  padding: 10px 12px;
  text-align: left;
}

/* ---------- 右侧栏 ---------- */

.rail {
  grid-column: 2;
  align-self: start;
  position: sticky;
  top: 88px;
  padding-top: clamp(24px, 4vw, 44px);
}

.rail-box {
  padding: 20px 18px 24px;
  background: var(--paper);
  border: 2px solid var(--ink);
  box-shadow: 9px 9px 0 var(--ink);
}

.rail-box h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 1.15rem;
  font-weight: 600;
  letter-spacing: .06em;
}

.rail-box hr { width: 40px; border-top-width: 3px; margin: 10px 0 8px; }

.rail-list li { border-bottom: 1px solid var(--rule); }
.rail-list li:last-child { border-bottom: 0; }

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 16px;
  text-decoration: none;
  transition: padding-left .2s ease;
}
.rail-list a::before {
  content: "";
  width: 12px;
  height: 1px;
  background: var(--ink);
  margin-right: 10px;
  flex: 0 0 auto;
}
.rail-list a:hover { padding-left: 6px; }

/* ---------- 页脚 ---------- */

.site-foot {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 30px clamp(20px, 3vw, 44px);
  padding: clamp(36px, 5vw, 68px) var(--pad) 0;
  background: var(--ink);
  color: var(--paper);
}

.site-foot h2 {
  margin: 0;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .24em;
}

.site-foot hr { border-top-color: var(--paper); width: 34px; border-top-width: 2px; margin: 10px 0 12px; }

.foot-brand p {
  margin: 12px 0 0;
  font-family: var(--serif);
  font-size: 1.35rem;
  line-height: 1.4;
}

.foot-brand .mark { margin-bottom: 6px; }

.site-foot ul a {
  display: flex;
  align-items: center;
  min-height: 44px;
  color: #e6e6e6;
  font-size: 16px;
  text-decoration: none;
  border-bottom: 1px solid #2c2c2c;
  transition: color .2s ease, padding-left .2s ease;
}
.site-foot ul li:last-child a { border-bottom: 0; }
.site-foot ul a:hover { color: var(--paper); padding-left: 6px; }

.foot-bar {
  grid-column: 1 / -1;
  margin-top: 10px;
  padding: 22px 0 26px;
  border-top: 1px solid #333;
  text-align: center;
}
.foot-bar p { margin: 0; font-size: 16px; color: #cfcfcf; letter-spacing: .08em; }

/* ---------- 滚动浮现 ---------- */

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .62s ease, transform .62s ease;
}
.reveal.in { opacity: 1; transform: none; }

/* ---------- 断点 ---------- */

@media (max-width: 1060px) {
  main { grid-template-columns: minmax(0, 1fr); }
  .content { max-width: none; }
  .rail {
    grid-column: 1;
    position: static;
    padding-top: 40px;
  }
  .rail-box { box-shadow: 7px 7px 0 var(--ink); }
}

@media (max-width: 860px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }
  .hero-txt { order: -1; }
  .hero-fig {
    clip-path: none;
    aspect-ratio: 16 / 11;
    border-top: 3px solid var(--ink);
  }
  .hero-fig figcaption { left: 12px; bottom: 12px; }
  .site-foot { grid-template-columns: 1fr 1fr; }
  .foot-brand { grid-column: 1 / -1; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .topbar { padding-right: 8px; }
  .cta { padding: 0 12px; font-size: 16px; }
  .content p { font-size: 16px; }
  .content > section > p:first-of-type::first-letter { font-size: 2.7em; }
  .site-foot { grid-template-columns: 1fr; gap: 22px; }
  .foot-bar { margin-top: 4px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .hero-fig img { transform: none; }
  .topbar nav a.nav-link::after { transition: none; }
}

button[aria-expanded]{min-width:44px;min-height:44px}
