@import url('https://fonts.googleapis.com/css2?family=Kalam:wght@400;700&family=Patrick+Hand&display=swap');

:root {
  --ink: #000000;
  --paper: #ffffff;
  --wash: #f2f2f2;
  --hand: 'Kalam', 'Patrick Hand', cursive;
  --sans: ui-sans-serif, system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --pad: clamp(16px, 4vw, 40px);
  --line: 1px solid var(--ink);
  --hard: 10px 10px 0 var(--ink);
}

*, *::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.75;
  letter-spacing: 0.01em;
  overflow-x: clip;
}

a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
p { margin: 0 0 16px; }

article[id] { scroll-margin-top: 104px; }

.masthead {
  border-bottom: var(--line);
  padding: 10px var(--pad);
}

.mast-grid {
  max-width: 1200px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto minmax(0, 1fr);
  align-items: center;
  gap: 10px;
}

.brand {
  justify-self: center;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 6px 10px;
  font-weight: 800;
  font-size: clamp(19px, 2.4vw, 24px);
  letter-spacing: 0.2em;
  line-height: 1.2;
  border-bottom: 3px solid var(--ink);
}

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

.nav-l { min-width: 0; }
.nav-r { min-width: 0; }

.nav-l ol, .nav-r ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
}

.nav-l ol { justify-content: flex-start; }
.nav-r ol { justify-content: flex-end; }

.nav-l a, .nav-r a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 11px;
  font-size: 16px;
  line-height: 1.3;
  transition: background-color 0.22s, color 0.22s;
}

.nav-l a:hover, .nav-r a:hover { background: var(--ink); color: var(--paper); }

.subbar {
  position: sticky;
  top: 0;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 8px var(--pad);
  background: var(--paper);
  border-bottom: var(--line);
}

.nav-bar { min-width: 0; }

.nav-bar ol {
  list-style: none;
  display: flex;
  gap: 6px;
  margin: 0;
  padding: 2px 0;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.nav-bar ol::-webkit-scrollbar { display: none; }

.nav-bar a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 15px;
  white-space: nowrap;
  font-size: 16px;
  line-height: 1.2;
  border: var(--line);
  border-radius: 999px;
  transition: background-color 0.22s, color 0.22s;
}

.nav-bar a:hover, .nav-bar a.on { background: var(--ink); color: var(--paper); }

.search { position: relative; min-width: 0; }

.search input {
  width: 132px;
  max-width: 100%;
  min-height: 44px;
  padding: 8px 4px;
  font: inherit;
  font-size: 16px;
  color: inherit;
  background: transparent;
  border: 0;
  border-bottom: var(--line);
  border-radius: 0;
}

.search input:focus {
  outline: 2px solid var(--ink);
  outline-offset: 2px;
}

.hits {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  min-width: 200px;
  max-width: 74vw;
  margin: 0;
  padding: 6px;
  list-style: none;
  background: var(--paper);
  border: var(--line);
  box-shadow: 6px 6px 0 var(--ink);
  z-index: 40;
}

.hits a {
  display: block;
  padding: 11px 8px;
  font-size: 16px;
}

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

main { display: block; }

.hero {
  position: relative;
  max-width: 1200px;
  margin: 0 auto;
  padding: clamp(26px, 5vw, 60px) var(--pad) clamp(52px, 8vw, 88px);
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  align-items: center;
  gap: 2rem;
  min-height: 70vh;
  overflow: hidden;
}

.hero-copy { min-width: 0; }

h1 {
  margin: 0 0 18px;
  font-size: clamp(2.2rem, 6vw, 4.2rem);
  line-height: 1.04;
  letter-spacing: -0.03em;
  font-weight: 800;
  overflow-wrap: break-word;
}

.hero-desc {
  max-width: 34ch;
  margin: 0;
  font-size: 17px;
  line-height: 1.7;
  border-top: 2px solid var(--ink);
  padding-top: 14px;
}

.hero-art {
  position: relative;
  margin: 0;
  height: clamp(280px, 44vh, 420px);
  min-width: 0;
  will-change: transform;
}

.art-a, .art-b {
  position: absolute;
  display: block;
  overflow: hidden;
  background: var(--wash);
  border: var(--line);
}

.art-a {
  inset: 0 36% 18% 0;
  box-shadow: var(--hard);
}

.art-b {
  right: 0;
  bottom: 0;
  width: 52%;
  aspect-ratio: 3 / 4;
  box-shadow: calc(-1 * 10px) 10px 0 var(--ink);
}

.art-a img, .art-b img { width: 100%; height: 100%; object-fit: cover; }

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

.band {
  position: absolute;
  left: -4%;
  right: -4%;
  bottom: 0;
  height: 13px;
  background: var(--ink);
  transform: rotate(-1.4deg);
  transform-origin: center;
}

.reader {
  max-width: 1200px;
  margin: 0 auto;
  padding: 0 var(--pad) clamp(56px, 8vw, 88px);
  display: grid;
  grid-template-columns: 208px minmax(0, 1fr);
  align-items: start;
  gap: 2rem;
}

.rail {
  position: sticky;
  top: 76px;
  min-width: 0;
  border-top: 3px solid var(--ink);
  padding-top: 12px;
}

.rail small {
  display: block;
  font-family: var(--hand);
  font-size: 16px;
  line-height: 1.2;
  letter-spacing: 0.1em;
}

.rail h2 {
  margin: 4px 0 12px;
  font-size: 18px;
  line-height: 1.3;
  letter-spacing: 0.02em;
}

.rail ol {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 0;
}

.rail a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 0;
  font-size: 16px;
  border-bottom: var(--line);
  transition: padding-left 0.2s, background-color 0.2s, color 0.2s;
}

.rail a:hover { background: var(--ink); color: var(--paper); padding-left: 10px; }

.prose {
  min-width: 0;
  overflow-wrap: break-word;
}

.prose > article {
  padding: clamp(22px, 3vw, 34px) 0;
  border-top: 2px solid var(--ink);
}

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

.prose h2 {
  margin: 0 0 16px;
  font-size: clamp(1.5rem, 3.2vw, 2.1rem);
  line-height: 1.2;
  letter-spacing: -0.02em;
}

.prose h3 {
  margin: 26px 0 12px;
  font-size: 1.2rem;
  line-height: 1.4;
}

.prose p, .prose li { max-width: 68ch; }
.prose ul, .prose ol { margin: 0 0 18px; padding-left: 22px; }
.prose li { margin-bottom: 8px; }

.prose a {
  border-bottom: 1px solid var(--ink);
  transition: background-color 0.2s, color 0.2s;
  overflow-wrap: anywhere;
}

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

.prose figure {
  margin: 26px 0;
  border: var(--line);
  box-shadow: 8px 8px 0 var(--ink);
  background: var(--wash);
  overflow: hidden;
}

.prose figure img { width: 100%; height: auto; }

.prose figcaption {
  font-family: var(--hand);
  font-size: 16px;
  padding: 8px 12px;
  border-top: var(--line);
  background: var(--paper);
}

.prose blockquote {
  margin: 26px 0;
  padding: 14px 18px;
  border-left: 5px solid var(--ink);
  background: var(--wash);
}

.prose blockquote p:last-child { margin-bottom: 0; }

.prose table {
  width: 100%;
  max-width: 100%;
  border-collapse: collapse;
  table-layout: fixed;
  font-size: 16px;
  margin: 20px 0;
}

.prose th, .prose td {
  border: var(--line);
  padding: 8px 10px;
  text-align: left;
  vertical-align: top;
  overflow-wrap: anywhere;
}

.prose th { background: var(--wash); }

.prose time {
  font-family: var(--hand);
  font-size: 16px;
  display: inline-block;
  border-bottom: var(--line);
}

.prose hr { border: 0; border-top: var(--line); margin: 26px 0; }

.prose pre {
  max-width: 100%;
  overflow-x: auto;
  padding: 12px;
  border: var(--line);
  font-size: 16px;
}

.site-foot {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px 2rem;
  padding: 0 max(20px, calc((100% - 1200px) / 2)) 24px;
  border-top: 3px solid var(--ink);
}

.cta {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  padding: clamp(26px, 5vw, 52px) 0 clamp(18px, 3vw, 30px);
  border-bottom: var(--line);
}

.cta-brand {
  margin: 0;
  font-size: clamp(2rem, 7vw, 3.6rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.03em;
  overflow-wrap: anywhere;
}

.cta-top {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 12px 24px;
  font-size: 16px;
  border: var(--line);
  border-radius: 999px;
  transition: background-color 0.22s, color 0.22s;
}

.cta-top:hover { background: var(--ink); color: var(--paper); }

.site-foot dl { margin: 0; min-width: 0; }

.site-foot dt {
  font-family: var(--hand);
  font-size: 16px;
  letter-spacing: 0.08em;
  padding-bottom: 6px;
  margin-bottom: 8px;
  border-bottom: var(--line);
}

.site-foot dd {
  margin: 0;
  font-size: 16px;
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.site-foot dd a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 10px 0;
  border-bottom: 1px solid #d8d8d8;
}

.site-foot dd a:hover {
  background: var(--ink);
  color: var(--paper);
  padding-left: 8px;
}

.copy {
  grid-column: 1 / -1;
  margin: 0;
  padding-top: 14px;
  border-top: var(--line);
  font-family: var(--hand);
  font-size: 16px;
}

.js .reveal {
  opacity: 0;
  transform: translate3d(0, 16px, 0);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

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

@media (max-width: 980px) {
  .nav-l a, .nav-r a { padding: 10px 8px; font-size: 16px; }
  .reader { grid-template-columns: 180px minmax(0, 1fr); }
}

@media (max-width: 860px) {
  .mast-grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 4px;
    justify-items: start;
  }
  .brand { justify-self: start; order: -1; }
  .nav-l, .nav-r { width: 100%; }
  .nav-l ol, .nav-r ol { gap: 0 4px; justify-content: flex-start; }
  .nav-l a, .nav-r a { padding: 10px 12px 10px 0; }

  .subbar { grid-template-columns: minmax(0, 1fr); gap: 4px; padding-bottom: 6px; }
  .search { order: -1; }
  .search input { width: 100%; }

  .hero {
    grid-template-columns: minmax(0, 1fr);
    min-height: 0;
    gap: 1.6rem;
    padding-bottom: 46px;
  }
  .hero-art { height: 260px; }

  .reader { grid-template-columns: minmax(0, 1fr); gap: 1.4rem; }
  .rail { position: static; }
  .rail ol { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 0 14px; }

  .site-foot { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .site-foot dl:last-of-type { grid-column: 1 / -1; }
}

@media (max-width: 420px) {
  body { font-size: 16px; }
  .hero-art { height: 230px; }
  .rail ol { grid-template-columns: 1fr; }
  .site-foot { grid-template-columns: minmax(0, 1fr); }
  .site-foot dl:last-of-type { grid-column: auto; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .js .reveal { opacity: 1; transform: none; transition: none; }
  * { transition-duration: 0.01ms !important; }
}

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