:root {
  --ink: #171f26;
  --ink-2: #3f4f5c;
  --sky: #c8e0f4;
  --rose: #f5e0e8;
  --r: 14px;
  --sh-1: -6px -6px 14px rgba(255, 255, 255, 0.92), 6px 6px 16px rgba(23, 31, 38, 0.13);
  --sh-2: -3px -3px 8px rgba(255, 255, 255, 0.95), 3px 3px 9px rgba(23, 31, 38, 0.12);
  --sh-in: inset -4px -4px 9px rgba(255, 255, 255, 0.9), inset 4px 4px 10px rgba(23, 31, 38, 0.12);
}

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

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

body {
  margin: 0;
  min-height: 100vh;
  overflow-x: hidden;
  font-family: "EB Garamond", "Crimson Text", "Songti SC", "Noto Serif SC", Georgia, "Times New Roman", serif;
  font-size: 17px;
  line-height: 1.75;
  color: var(--ink);
  background-color: #e9f1f9;
  background-image: linear-gradient(145deg, #eaf3fb 0%, #eff4f9 46%, #f8eef3 100%);
  background-attachment: fixed;
}

a { color: #27475e; text-decoration: none; }
a:hover { color: var(--ink); }
p { margin: 0 0 1em; }
img { max-width: 100%; height: auto; }
:focus-visible { outline: 2px solid #6f9ec4; outline-offset: 3px; border-radius: 8px; }

.frame {
  width: 100%;
  max-width: 1240px;
  margin: 0 auto;
  padding: 0 22px;
  overflow-x: clip;
}

.masthead {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  padding: 20px 0 10px;
  min-width: 0;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  max-width: 100%;
  min-height: 44px;
  padding: 11px 18px;
  border-radius: 16px;
  background: linear-gradient(145deg, #f2f8fd, #dde9f3);
  box-shadow: var(--sh-1);
  color: var(--ink);
  font-size: 1.1rem;
  letter-spacing: 0.22em;
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.brand:hover { transform: translateY(-2px); }
.brand:active { box-shadow: var(--sh-in); transform: translateY(0) scale(0.985); }

.brand-name { min-width: 0; }

.brand-mark {
  width: 30px;
  height: 30px;
  flex: 0 0 auto;
  border-radius: 9px;
  object-fit: cover;
  box-shadow: var(--sh-2);
}

.grid {
  display: grid;
  grid-template-columns: 252px minmax(0, 1fr);
  gap: 44px;
  align-items: start;
  padding-bottom: 56px;
  min-width: 0;
}

.rail {
  position: sticky;
  top: 26px;
  min-width: 0;
  padding: 22px 18px 24px;
  border-radius: var(--r);
  background: linear-gradient(145deg, #eaf3fb, #dbe8f2);
  box-shadow: var(--sh-1);
}

.rail-title {
  margin: 0 0 8px;
  font-size: 1.45rem;
  line-height: 1.3;
  letter-spacing: 0.06em;
  font-weight: 600;
}

.subtitle {
  margin: 0 0 18px;
  font-size: 1rem;
  line-height: 1.6;
  color: var(--ink-2);
}

.rail-nav { min-width: 0; max-width: 100%; }

.rail-nav ul {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin: 0;
  padding: 0;
  min-width: 0;
  max-width: 100%;
  list-style: none;
}

.rail-nav a {
  display: block;
  padding: 13px 16px;
  border-radius: 12px;
  background: linear-gradient(145deg, #f2f8fd, #dfeaf4);
  box-shadow: var(--sh-2);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink);
  transition: transform 0.16s ease, box-shadow 0.16s ease;
}

.rail-nav a:hover { transform: translateY(-2px) scale(1.02); }
.rail-nav a:active { box-shadow: var(--sh-in); transform: scale(0.98); }
.rail-nav a[aria-current] {
  box-shadow: var(--sh-in);
  background: linear-gradient(145deg, #e2eef8, #f3f9fe);
}

.sheet { min-width: 0; }

.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: center;
  text-align: right;
  min-height: 88vh;
  padding: 40px 0 64px;
  min-width: 0;
}

.hero-band {
  position: absolute;
  left: 0;
  right: 26%;
  bottom: 20%;
  height: 26px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sky), var(--rose));
  transform: skewY(-6deg);
  box-shadow: var(--sh-2);
  z-index: 0;
}

.hero-title {
  position: relative;
  z-index: 1;
  margin: 0;
  max-width: 100%;
  font-size: clamp(2.6rem, 8vw, 5.8rem);
  line-height: 1.05;
  letter-spacing: -0.02em;
  font-weight: 600;
  overflow-wrap: break-word;
  text-shadow: -2px -2px 2px rgba(255, 255, 255, 0.9), 2px 2px 5px rgba(23, 31, 38, 0.1);
}

.lede { padding: 26px 0 22px; }

.lede-title {
  margin: 0 0 10px;
  font-size: clamp(1.9rem, 5vw, 3rem);
  line-height: 1.15;
  font-weight: 600;
}

.stamp { margin: 0; color: var(--ink-2); font-size: 1rem; }

.body { display: block; min-width: 0; }

.body > div[id] {
  position: relative;
  margin: 0 0 28px;
  padding: 26px 24px 30px;
  min-width: 0;
  border-radius: 10px;
  background: linear-gradient(145deg, #eff5fb, #dee9f3);
  box-shadow: var(--sh-1), inset 0 -3px 0 0 rgba(200, 224, 244, 0.95);
  scroll-margin-top: 96px;
}

.body > div[id]:last-child { margin-bottom: 0; }

.body h2 {
  margin: 0 0 0.55em;
  font-size: clamp(1.4rem, 2.4vw, 1.72rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
  font-weight: 600;
  overflow-wrap: break-word;
}

.body h3 {
  margin: 1.3em 0 0.5em;
  font-size: 1.16rem;
  line-height: 1.45;
}

.body p, .body li { overflow-wrap: break-word; }

.body ul, .body ol { margin: 0 0 1em; padding-left: 1.3em; }
.body li { margin: 0.35em 0; }

.body blockquote {
  margin: 1.2em 0;
  padding: 14px 18px;
  border-radius: 10px;
  background: #e7f0f9;
  box-shadow: var(--sh-in);
  font-style: italic;
}

.body img { border-radius: 12px; box-shadow: var(--sh-2); }
.body a { text-decoration: underline; text-underline-offset: 3px; }

.body pre {
  overflow-x: auto;
  padding: 14px 16px;
  border-radius: 10px;
  background: #e7f0f9;
  box-shadow: var(--sh-in);
}

.colophon {
  margin-top: 10px;
  padding: 34px 22px 30px;
  border-radius: 26px 26px 0 0;
  background: linear-gradient(145deg, #eaf3fb, #e2edf6);
  box-shadow: var(--sh-1);
  text-align: center;
  min-width: 0;
}

.foot-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  gap: 14px 24px;
  max-width: 1180px;
  margin: 0 auto;
  min-width: 0;
}

.foot-contact {
  font-style: normal;
  color: var(--ink-2);
  font-size: 1rem;
  line-height: 1.5;
  max-width: 100%;
  overflow-wrap: anywhere;
}

.foot-tag {
  display: inline-block;
  margin-right: 8px;
  padding: 2px 9px;
  border-radius: 8px;
  background: linear-gradient(145deg, #f2f8fd, #dde9f3);
  box-shadow: var(--sh-2);
  font-size: 0.9rem;
  color: var(--ink-2);
}

.foot-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  min-width: 0;
  list-style: none;
}

.foot-links a {
  display: block;
  padding: 11px 15px;
  border-radius: 10px;
  background: linear-gradient(145deg, #f2f8fd, #dfeaf4);
  box-shadow: var(--sh-2);
  font-size: 1rem;
  line-height: 1.5;
  color: var(--ink-2);
  transition: transform 0.16s ease, box-shadow 0.16s ease, color 0.16s ease;
}

.foot-links a:hover { color: var(--ink); transform: translateY(-2px); }
.foot-links a:active { box-shadow: var(--sh-in); transform: scale(0.98); }

.foot-brand {
  margin: 26px 0 6px;
  font-size: clamp(2.4rem, 12vw, 6.2rem);
  line-height: 1.05;
  letter-spacing: 0.06em;
  color: rgba(23, 31, 38, 0.16);
  overflow-wrap: break-word;
}

.foot-copy {
  margin: 0;
  font-size: 1rem;
  color: var(--ink-2);
}

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

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

@media (max-width: 900px) {
  .grid {
    grid-template-columns: minmax(0, 1fr);
    gap: 18px;
  }

  .rail {
    position: sticky;
    top: 0;
    z-index: 30;
    padding: 9px 10px;
    border-radius: 0 0 14px 14px;
    overflow: hidden;
  }

  .rail-title, .rail .subtitle { display: none; }

  .rail-nav { margin: 0; }

  .rail-nav ul {
    flex-direction: row;
    gap: 8px;
    overflow-x: auto;
    overscroll-behavior-x: contain;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .rail-nav ul::-webkit-scrollbar { display: none; }
  .rail-nav li { flex: 0 0 auto; }
  .rail-nav a { white-space: nowrap; padding: 12px 14px; }

  .hero {
    min-height: 0;
    padding: 34px 0 44px;
    align-items: flex-start;
    text-align: left;
  }

  .hero-band { right: 32%; bottom: 24%; height: 20px; }

  .body > div[id] { padding: 22px 18px 26px; scroll-margin-top: 78px; }
}

@media (max-width: 620px) {
  .frame { padding: 0 16px; }
  .colophon { padding: 28px 16px 26px; border-radius: 20px 20px 0 0; }
  .foot-head { flex-direction: column; }
  .foot-brand { margin-top: 20px; }
  .body > div[id] { border-radius: 10px; }
  .hero-title { font-size: clamp(2.1rem, 10vw, 3.2rem); }
}

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

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