@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;
  --mute: #5b5b5b;
  --rule: #d9d9d9;
  --pad: clamp(1rem, 3.6vw, 3.2rem);
  --maxw: 1200px;
}

*,
*::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: 'Noto Sans JP', system-ui, -apple-system, 'Hiragino Sans', 'Yu Gothic', sans-serif;
  font-size: 17px;
  line-height: 1.8;
  font-weight: 400;
}

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

h1,
h2,
h3,
h4 {
  margin: 0;
  font-family: 'Noto Serif JP', 'Hiragino Mincho ProN', 'Yu Mincho', serif;
  font-weight: 600;
  line-height: 1.28;
  letter-spacing: -0.01em;
}

p {
  margin: 0 0 1.1rem;
}

a {
  color: inherit;
}

menu,
ol,
ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.skip {
  position: absolute;
  left: -9999px;
  top: 0;
  z-index: 99;
  padding: 0.9rem 1.3rem;
  background: var(--ink);
  color: var(--paper);
  font-size: 0.9rem;
  text-decoration: none;
}

.skip:focus {
  left: 1rem;
  top: 1rem;
}

/* 顶部细条 */
.ticker {
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 0.7rem;
  margin: 0;
  padding: 0.58rem var(--pad);
  background: var(--ink);
  color: var(--paper);
  font-size: 0.72rem;
  line-height: 1.4;
  letter-spacing: 0.24em;
}

.ticker::before {
  content: "";
  flex: none;
  width: 6px;
  height: 6px;
  background: var(--paper);
}

/* 粘性锚点条 */
.bar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  padding: 0.6rem var(--pad);
  background: var(--paper);
  border-bottom: 1px solid var(--ink);
}

.mark {
  display: grid;
  place-items: center;
  flex: none;
  width: 44px;
  height: 44px;
  overflow: hidden;
  background: var(--ink);
  color: var(--paper);
  font-family: 'Noto Serif JP', serif;
  font-size: 1.2rem;
  line-height: 1;
  text-decoration: none;
}

.mark img {
  width: 44px;
  height: 44px;
  object-fit: cover;
}

.jump {
  display: flex;
  flex: 1 1 auto;
  justify-content: flex-end;
  min-width: 0;
}

.drawer {
  position: relative;
}

.drawer > summary {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 1.2rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 0.88rem;
  letter-spacing: 0.16em;
  list-style: none;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease;
}

.drawer > summary::-webkit-details-marker {
  display: none;
}

.drawer > summary:hover,
.drawer > summary:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

.drawer > menu {
  display: grid;
  gap: 0.4rem;
}

.drawer > menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.45rem 1.1rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 0.9rem;
  letter-spacing: 0.06em;
  text-decoration: none;
  transition: background 0.22s ease, color 0.22s ease;
}

.drawer > menu a:hover,
.drawer > menu a:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

@media (max-width: 899px) {
  .drawer[open] > menu {
    position: absolute;
    right: 0;
    top: calc(100% + 0.5rem);
    z-index: 50;
    min-width: min(76vw, 320px);
    padding: 0.75rem;
    background: var(--paper);
    border: 1px solid var(--ink);
  }

  .drawer[open] > menu a {
    width: 100%;
  }
}

@media (min-width: 900px) {
  .drawer > summary {
    display: none;
  }

  .drawer > menu {
    display: flex;
    flex-wrap: wrap;
    justify-content: flex-end;
    gap: 0.45rem;
  }
}

/* 首屏 */
.hero {
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  min-height: 70vh;
  border-bottom: 1px solid var(--ink);
}

.hero-media {
  position: relative;
  margin: 0;
  overflow: hidden;
  border-right: 1px solid var(--ink);
  background: var(--paper) radial-gradient(var(--ink) 1px, transparent 1px) 0 0 / 13px 13px;
  clip-path: polygon(0 0, 100% 0, 100% 86%, 0 100%);
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(1) contrast(1.06);
}

.hero-copy {
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  gap: 1.3rem;
  padding: clamp(2rem, 5vw, 4.5rem) var(--pad);
  text-align: right;
}

.hero-copy h1 {
  max-width: 14ch;
  font-size: clamp(1.9rem, 4.6vw, 3.6rem);
}

.lede {
  max-width: 34ch;
  margin: 0;
  color: var(--mute);
  font-size: 0.95rem;
  line-height: 1.75;
}

.pills {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.45rem;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.35rem 1.1rem;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-size: 0.85rem;
  letter-spacing: 0.05em;
  text-decoration: none;
  transition: background 0.22s ease, color 0.22s ease;
}

.pill:hover,
.pill:focus-visible {
  background: var(--ink);
  color: var(--paper);
}

/* 正文 + 右栏 */
.spread {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17rem;
  gap: clamp(1.5rem, 3.4vw, 3.2rem);
  max-width: var(--maxw);
  margin: 0 auto;
  padding: clamp(1.8rem, 4vw, 3.4rem) var(--pad) 4rem;
}

.content {
  min-width: 0;
}

.content > article {
  padding-block: clamp(1.6rem, 2.6vw, 2.4rem);
  border-top: 1px solid var(--ink);
  scroll-margin-top: 6rem;
}

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

.content h2 {
  margin-bottom: 0.5rem;
  font-size: clamp(1.35rem, 2.4vw, 1.9rem);
}

.content h3 {
  margin: 1.6rem 0 0.5rem;
  font-size: 1.1rem;
}

.content hr {
  margin: 0 0 1.2rem;
  border: 0;
  border-top: 1px solid var(--ink);
}

.content p {
  max-width: 66ch;
}

.content ul,
.content ol {
  max-width: 66ch;
  margin: 0 0 1.2rem;
}

.content ul li,
.content ol li {
  position: relative;
  margin: 0.35rem 0;
  padding-left: 1.2rem;
}

.content ul li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.78em;
  width: 6px;
  height: 1px;
  background: var(--ink);
}

.content ol {
  counter-reset: o;
}

.content ol li {
  counter-increment: o;
}

.content ol li::before {
  content: counter(o) ".";
  position: absolute;
  left: 0;
  top: 0;
  font-size: 0.85rem;
}

.content a {
  text-decoration: underline;
  text-underline-offset: 0.22em;
}

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

.content strong {
  font-weight: 700;
}

.content blockquote {
  margin: 1.4rem 0;
  padding-left: 1.1rem;
  border-left: 3px solid var(--ink);
  font-family: 'Noto Serif JP', serif;
}

.content img {
  width: 100%;
  margin: 1.2rem 0;
  filter: grayscale(1);
}

.content figure {
  margin: 1.2rem 0;
}

.content table {
  width: 100%;
  margin: 1.2rem 0;
  border-collapse: collapse;
  font-size: 0.92rem;
}

.content th,
.content td {
  padding: 0.6rem 0.5rem;
  border-bottom: 1px solid var(--ink);
  text-align: left;
}

.content pre {
  overflow-x: auto;
  padding: 1rem;
  background: #f4f4f4;
  font-size: 0.85rem;
}

@media (min-width: 900px) {
  .content {
    counter-reset: sec;
  }

  .content > article {
    position: relative;
    padding-left: 3.4rem;
    counter-increment: sec;
  }

  .content > article::before {
    content: counter(sec, decimal-leading-zero);
    position: absolute;
    left: 0;
    top: calc(clamp(1.6rem, 2.6vw, 2.4rem) + 0.55rem);
    color: var(--mute);
    font-size: 0.7rem;
    letter-spacing: 0.22em;
  }

  .content > article:first-child::before {
    top: 0.55rem;
  }
}

/* 右栏 */
.rail {
  position: sticky;
  top: 5.6rem;
  align-self: start;
  padding: 1rem;
  background: var(--paper);
  border: 1px solid var(--ink);
  box-shadow: 0 14px 30px -24px rgba(0, 0, 0, 0.9);
}

.rail-title {
  margin-bottom: 0.5rem;
  font-size: 0.95rem;
  letter-spacing: 0.18em;
}

.rail hr {
  margin: 0 0 0.7rem;
  border: 0;
  border-top: 1px solid var(--ink);
}

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0.3rem 0;
  border-bottom: 1px solid var(--rule);
  font-size: 0.88rem;
  text-decoration: none;
  transition: padding-left 0.2s ease;
}

.rail-list li:last-child a {
  border-bottom: 0;
}

.rail-list a:hover,
.rail-list a:focus-visible {
  padding-left: 0.4rem;
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

/* 页脚 */
.foot {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 2rem;
  padding: clamp(2rem, 4.5vw, 3.6rem) var(--pad) 0;
  background: var(--ink);
  color: var(--paper);
}

.foot article {
  min-width: 0;
}

.wordmark {
  margin: 0;
  font-family: 'Noto Serif JP', serif;
  font-size: clamp(2rem, 6vw, 4.6rem);
  font-weight: 700;
  line-height: 0.92;
  letter-spacing: -0.04em;
}

.foot-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  border-bottom: 1px solid #333333;
  color: var(--paper);
  font-size: 0.92rem;
  text-decoration: none;
}

.foot-list li:last-child a {
  border-bottom: 0;
}

.foot-list a:hover,
.foot-list a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 0.24em;
}

.foot-util {
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
}

.totop {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0.4rem 1.1rem;
  border: 1px solid var(--paper);
  border-radius: 999px;
  color: var(--paper);
  font-size: 0.85rem;
  letter-spacing: 0.1em;
  text-decoration: none;
  transition: background 0.2s ease, color 0.2s ease;
}

.totop:hover,
.totop:focus-visible {
  background: var(--paper);
  color: var(--ink);
}

.colophon {
  grid-column: 1 / -1;
  margin-top: 1rem;
  padding: 1.1rem 0;
  border-top: 1px solid #333333;
  color: #bdbdbd;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
}

.colophon p {
  margin: 0;
}

/* 滚动显现 */
.js-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.55s ease, transform 0.55s ease;
}

.js-reveal.in {
  opacity: 1;
  transform: none;
}

@media (max-width: 899px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
  }

  .hero-media {
    min-height: 30vh;
    border-right: 0;
    border-bottom: 1px solid var(--ink);
    clip-path: polygon(0 0, 100% 0, 100% 92%, 0 100%);
  }

  .hero-copy {
    align-items: flex-start;
    padding-top: 1.6rem;
    text-align: left;
  }

  .hero-copy h1 {
    max-width: 20ch;
  }

  .pills {
    justify-content: flex-start;
  }

  .spread {
    grid-template-columns: 1fr;
    padding-bottom: 3rem;
  }

  .rail {
    position: static;
    order: 2;
  }

  .rail-list {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0 1rem;
  }

  .foot {
    grid-template-columns: 1fr;
    gap: 1.4rem;
  }

  .foot-util {
    justify-content: flex-start;
  }

  .colophon {
    grid-column: auto;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  .js-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
}

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