:root {
  --purple: #56228b;
  --brown: #8b4513;
  --ink: #1f1726;
  --paper: #f7f2ea;
  --paper2: #fffdf9;
  --paper3: #f1e9dd;
  --line: #e2d7c7;
  --muted: #5d5262;
  --rail: 236px;
  --bar: 46px;
  --rA: 18px 26px 20px 24px;
  --rB: 24px 16px 26px 18px;
}

* {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  overflow-x: hidden;
  background-color: var(--paper);
  background-image:
    radial-gradient(circle at 12% 16%, rgba(139, 69, 19, 0.07), transparent 44%),
    radial-gradient(circle at 88% 6%, rgba(86, 34, 139, 0.08), transparent 46%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: "EB Garamond", "Crimson Text", Georgia, "Songti SC", "Noto Serif SC", "SimSun", serif;
  font-size: 17.5px;
  line-height: 1.82;
  letter-spacing: 0.01em;
}

p {
  margin: 0 0 14px;
}

a {
  color: var(--purple);
  text-underline-offset: 3px;
}

.announce {
  position: fixed;
  z-index: 30;
  top: 0;
  left: 0;
  right: 0;
  height: var(--bar);
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 0 18px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  background: var(--ink);
  color: #f6efe4;
  font-size: 16px;
  letter-spacing: 0.12em;
}

.announce .dot {
  color: var(--brown);
}

.announce .kw {
  overflow: hidden;
  text-overflow: ellipsis;
  color: #d6c7de;
}

.rail {
  position: fixed;
  z-index: 20;
  top: var(--bar);
  left: 0;
  bottom: 0;
  width: var(--rail);
  padding: 18px 16px 28px;
  border-right: 1px solid var(--line);
  background-image: linear-gradient(180deg, #fffdf9 0%, #f3ebdf 100%);
  overflow-y: auto;
}

.mark {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: var(--rA);
  background: var(--paper2);
  text-decoration: none;
}

.mark svg {
  display: block;
}

.rail-list,
.side-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rail-list {
  margin-top: 22px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.rail-list a {
  display: block;
  min-height: 44px;
  padding: 11px 13px;
  border: 1px solid transparent;
  border-radius: 14px 20px 14px 20px;
  color: var(--ink);
  font-size: 17px;
  line-height: 1.35;
  text-decoration: none;
}

.rail-list a:hover,
.rail-list a:focus-visible {
  border-color: var(--line);
  background: var(--paper2);
  color: var(--purple);
}

.stage {
  margin-left: var(--rail);
  padding-top: var(--bar);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, 1.12fr) minmax(0, 0.88fr);
  align-items: center;
  gap: 34px;
  min-height: 70vh;
  padding: 54px 48px 46px;
}

.badge {
  display: inline-block;
  margin: 0 0 18px;
  padding: 7px 17px;
  border: 1px solid var(--brown);
  border-radius: 22px 28px 20px 30px;
  color: var(--brown);
  font-size: 16px;
  letter-spacing: 0.1em;
  background: rgba(255, 253, 249, 0.7);
}

h1 {
  margin: 0;
  max-width: 20ch;
  font-size: clamp(2rem, 4.6vw, 3.5rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.01em;
  color: var(--ink);
}

.hero-art {
  margin: 0;
}

.hero-art svg {
  display: block;
  width: 100%;
  height: auto;
  max-height: 62vh;
  animation: drift 11s ease-in-out infinite alternate;
}

@keyframes drift {
  to {
    transform: translateY(-14px) rotate(-1.5deg);
  }
}

.sheet {
  display: grid;
  grid-template-columns: 196px minmax(0, 1fr);
  gap: 40px;
  padding: 42px 48px 76px;
  border-top: 1px solid var(--line);
}

.side {
  position: sticky;
  top: calc(var(--bar) + 18px);
  align-self: start;
}

.side-list {
  padding-left: 14px;
  border-left: 2px solid var(--line);
}

.side-list a {
  display: block;
  min-height: 40px;
  padding: 9px 8px;
  border-radius: 12px 18px 12px 18px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.45;
  text-decoration: none;
}

.side-list a:hover,
.side-list a:focus-visible {
  background: var(--paper2);
  color: var(--purple);
}

.text > article {
  padding: 26px 28px;
  margin: 0 0 26px;
  border: 1px solid var(--line);
  border-radius: 0;
  background: var(--paper2);
  scroll-margin-top: calc(var(--bar) + 22px);
}

.text h2 {
  margin: 0 0 12px;
  font-size: clamp(1.5rem, 2.4vw, 1.95rem);
  line-height: 1.34;
  color: var(--purple);
  scroll-margin-top: calc(var(--bar) + 22px);
}

.text h2::before {
  content: "";
  display: inline-block;
  width: 10px;
  height: 10px;
  margin-right: 10px;
  vertical-align: 2px;
  background: var(--brown);
}

.text h3 {
  margin: 22px 0 10px;
  font-size: 1.24rem;
  line-height: 1.4;
  color: var(--brown);
}

.text p.subtitle {
  margin: 0;
  padding: 0 0 2px 20px;
  border-left: 3px solid var(--brown);
  color: var(--muted);
  font-size: 17px;
}

.text ul,
.text ol {
  margin: 0 0 16px;
  padding-left: 1.25em;
}

.text li {
  margin: 0 0 8px;
}

.text img {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 16px 0;
  border: 1px solid var(--line);
  border-radius: 0;
}

.text blockquote {
  margin: 18px 0;
  padding: 12px 20px;
  border-left: 4px solid var(--purple);
  background: var(--paper);
  color: var(--muted);
}

.text table {
  width: 100%;
  border-collapse: collapse;
  margin: 0 0 16px;
  font-size: 16.5px;
}

.text th,
.text td {
  border: 1px solid var(--line);
  padding: 9px 12px;
  text-align: left;
}

.foot {
  margin-left: var(--rail);
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px 22px;
  padding: 44px 48px 36px;
  border-top: 3px solid var(--purple);
  background: var(--paper3);
}

.foot-brand {
  grid-column: 1 / -1;
  margin: 0 0 10px;
  font-size: clamp(2.1rem, 6vw, 4.2rem);
  line-height: 1.06;
  font-weight: 700;
  color: var(--brown);
  letter-spacing: 0.02em;
  overflow-wrap: anywhere;
}

.foot-col {
  margin: 0;
  font-size: 16px;
  color: var(--muted);
  overflow-wrap: anywhere;
}

.foot a {
  display: inline-block;
  min-height: 40px;
  padding: 8px 0;
  color: var(--purple);
}

.foot small {
  grid-column: 1 / -1;
  margin-top: 10px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 16px;
  color: var(--muted);
}

.reveal {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity 0.62s ease, transform 0.62s ease;
}

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

@media (max-width: 980px) {
  .hero {
    padding: 44px 30px 40px;
    gap: 24px;
  }

  .sheet {
    grid-template-columns: 168px minmax(0, 1fr);
    gap: 26px;
    padding: 34px 30px 62px;
  }

  .foot {
    padding: 38px 30px 30px;
  }
}

@media (max-width: 820px) {
  :root {
    --rail: 0px;
  }

  .announce {
    padding: 0 14px;
    font-size: 16px;
    letter-spacing: 0.06em;
  }

  .announce .kw {
    display: none;
  }

  .announce .dot {
    display: none;
  }

  .rail {
    position: fixed;
    top: var(--bar);
    left: 0;
    right: 0;
    bottom: auto;
    width: auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
    overflow-x: auto;
    overflow-y: hidden;
    background-image: linear-gradient(90deg, #fffdf9, #f4ece0);
  }

  .mark {
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
  }

  .rail-list {
    margin-top: 0;
    flex-direction: row;
    gap: 6px;
    padding-bottom: 2px;
  }

  .rail-list a {
    white-space: nowrap;
    min-height: 42px;
    padding: 10px 14px;
    font-size: 16px;
  }

  .stage {
    margin-left: 0;
    padding-top: calc(var(--bar) + 62px);
  }

  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding: 26px 20px 30px;
  }

  h1 {
    max-width: none;
    font-size: clamp(1.85rem, 8.4vw, 2.6rem);
  }

  .hero-art {
    max-width: 320px;
  }

  .hero-art svg {
    max-height: none;
  }

  .sheet {
    grid-template-columns: 1fr;
    gap: 22px;
    padding: 26px 20px 54px;
  }

  .side {
    position: static;
  }

  .side-list {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-left: 0;
    border-left: 0;
  }

  .side-list a {
    border: 1px solid var(--line);
    padding: 10px 12px;
    min-height: 42px;
    background: var(--paper2);
  }

  .text > article {
    padding: 20px 18px;
    margin-bottom: 20px;
  }

  .foot {
    margin-left: 0;
    grid-template-columns: 1fr;
    padding: 30px 20px 26px;
  }

  .foot small {
    margin-top: 6px;
  }
}

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

  .hero-art svg {
    animation: none;
  }

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

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