@import url('https://fonts.googleapis.com/css2?family=Cormorant:wght@400;500;600;700&family=Montserrat:wght@300;400;500;600;700&display=swap');

:root {
  --ink: #1f1f1f;
  --paper: #ffffff;
  --stone: #f5f5f7;
  --line: #1f1f1f;
  --soft: #dcdcdc;
  --bar: 72px;
  --serif: "Cormorant", "Songti SC", "STSong", Georgia, serif;
  --sans: "Montserrat", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
}

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

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

body {
  margin: 0;
  padding-bottom: calc(var(--bar) + env(safe-area-inset-bottom) + 12px);
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0 0 .5em; line-height: 1.25; }
p { margin: 0 0 1em; }
hr { margin: 0 0 16px; border: 0; border-top: 1px solid var(--line); }
:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: flex;
  align-items: center;
  overflow: hidden;
  min-height: 70vh;
  padding: clamp(26px, 7vw, 64px);
  padding-bottom: clamp(44px, 10vw, 96px);
  border-bottom: 1px solid var(--line);
  background: var(--paper);
}

.hero-bg {
  position: absolute;
  left: -2vw;
  bottom: -.18em;
  z-index: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(76px, 21vw, 210px);
  line-height: .82;
  letter-spacing: -.03em;
  color: #ededed;
  white-space: nowrap;
  pointer-events: none;
  user-select: none;
}

.hero-in {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 14px;
  align-items: start;
  max-width: 640px;
}

.hero-mark {
  display: block;
  width: 56px;
  height: 56px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--stone);
  transition: transform .25s ease;
}

.hero-mark img { width: 100%; height: 100%; object-fit: cover; }
.hero-mark:hover { transform: scale(1.04); }

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

h1 {
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(30px, 7.4vw, 62px);
  letter-spacing: -.015em;
  margin-bottom: .35em;
  overflow-wrap: break-word;
}

.hero-sub {
  max-width: 32ch;
  margin: 0;
  color: #4a4a4a;
}

.hero-no {
  position: absolute;
  top: clamp(16px, 5vw, 40px);
  right: clamp(16px, 5vw, 44px);
  z-index: 1;
  padding: 2px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: .26em;
}

/* ---------- layout ---------- */
.wrap {
  display: grid;
  gap: 20px;
  max-width: 1160px;
  margin: 0 auto;
  padding: clamp(20px, 5vw, 44px) clamp(16px, 4vw, 40px);
}

.body { min-width: 0; }

/* ---------- aside ---------- */
.rail {
  padding: 14px 14px 16px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--stone);
}

.rail h2 {
  margin-bottom: .5em;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .16em;
}

.rail hr { border-top-color: #cfcfcf; margin-bottom: 6px; }

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

.rail-list a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 16px;
  transition: background .2s ease, transform .2s ease;
}

.rail-list a:hover { background: #ffffff; transform: translateX(3px); }
.rail-list a.on { background: #ffffff; font-weight: 600; }

/* ---------- section ---------- */
section { counter-reset: sec; }

section > article {
  position: relative;
  counter-increment: sec;
  margin-bottom: 16px;
  padding: clamp(18px, 4vw, 34px) clamp(16px, 3.4vw, 30px);
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
  scroll-margin-top: 18px;
  transition: transform .28s ease, border-color .28s ease;
}

section > article:last-child { margin-bottom: 0; }

section > article::before {
  content: counter(sec, decimal-leading-zero);
  display: block;
  margin-bottom: 8px;
  font-family: var(--serif);
  font-size: 16px;
  letter-spacing: .24em;
  color: #9a9a9a;
}

section > article:hover { transform: scale(1.008); border-color: #000; }

section h2 {
  margin-top: 0;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(21px, 4vw, 28px);
}

section h3 { font-size: 18px; margin-top: 1.4em; }
section ul, section ol { margin: 0 0 1em; padding-left: 1.25em; }
section li { margin-bottom: .4em; }

section blockquote {
  margin: 0 0 1em;
  padding: 6px 0 6px 14px;
  border-left: 2px solid var(--line);
  color: #444;
}

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

/* ---------- footer ---------- */
.foot {
  margin-top: 12px;
  padding: 30px clamp(16px, 4vw, 40px) 18px;
  border-top: 1px solid var(--line);
  background: var(--stone);
}

.foot-grid {
  display: grid;
  gap: 18px;
  max-width: 1160px;
  margin: 0 auto;
}

.foot address {
  font-family: var(--serif);
  font-style: normal;
  font-weight: 600;
  font-size: 20px;
  line-height: 1.35;
  overflow-wrap: break-word;
}

.foot ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 2px;
  align-content: start;
}

.foot ul a {
  display: flex;
  align-items: center;
  min-height: 44px;
  font-size: 16px;
  transition: text-decoration-color .2s ease, transform .2s ease;
}

.foot ul a:hover { text-decoration: underline; transform: scale(1.02); transform-origin: left center; }

.copy {
  max-width: 1160px;
  margin: 18px auto 0;
  padding-top: 12px;
  border-top: 1px solid var(--soft);
  text-align: center;
  font-size: 16px;
  color: #555;
}

/* ---------- bottom bar ---------- */
.bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 60;
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 6px;
  height: var(--bar);
  padding: 0 max(8px, env(safe-area-inset-left)) env(safe-area-inset-bottom);
  border-top: 1px solid var(--line);
  background: rgba(255, 255, 255, .95);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}

.bar-link, .bar-more > summary {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  font-size: 16px;
  border-radius: 8px;
}

.bar-link { justify-self: start; }
.bar-link:hover, .bar-more > summary:hover { background: var(--stone); }

.bar-brand {
  justify-self: center;
  font-family: var(--serif);
  font-weight: 600;
  font-size: clamp(16px, 3.8vw, 19px);
  letter-spacing: .01em;
  white-space: nowrap;
  padding: 0 6px;
  min-height: 44px;
  display: flex;
  align-items: center;
}

.bar-more { justify-self: end; position: relative; }
.bar-more > summary { list-style: none; cursor: pointer; }
.bar-more > summary::-webkit-details-marker { display: none; }
.bar-more[open] > summary { background: var(--stone); }

.bar-more menu {
  position: absolute;
  right: 0;
  bottom: calc(100% + 12px);
  margin: 0;
  padding: 8px;
  min-width: 186px;
  list-style: none;
  display: grid;
  gap: 2px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--paper);
}

.bar-more menu a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  border-radius: 8px;
  font-size: 16px;
  transition: background .2s ease, transform .2s ease;
}

.bar-more menu a:hover { background: var(--stone); transform: scale(1.02); }

/* ---------- motion ---------- */
@keyframes rise {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}

.hero-in { animation: rise .6s cubic-bezier(.2, .7, .3, 1) both; }
.hero-no { animation: rise .6s .12s both; }
.rail { animation: rise .55s .06s both; }

section > article { animation: rise .5s both; }
section > article:nth-child(1) { animation-delay: .10s; }
section > article:nth-child(2) { animation-delay: .15s; }
section > article:nth-child(3) { animation-delay: .20s; }
section > article:nth-child(4) { animation-delay: .25s; }
section > article:nth-child(5) { animation-delay: .30s; }
section > article:nth-child(6) { animation-delay: .35s; }
section > article:nth-child(7) { animation-delay: .40s; }

.foot { animation: rise .5s .18s both; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  * { animation: none !important; transition: none !important; }
}

/* ---------- wide ---------- */
@media (min-width: 720px) {
  .hero-in { gap: 20px; }
  .hero-mark { width: 72px; height: 72px; }
  .foot-grid { grid-template-columns: 1.4fr 1fr 1fr; }
}

@media (min-width: 900px) {
  .wrap {
    grid-template-columns: 232px minmax(0, 1fr);
    align-items: start;
    gap: 32px;
    padding-top: 56px;
  }
  .rail { position: sticky; top: 24px; }
  .body { padding-bottom: 8px; }
  .hero { min-height: 66vh; }
}

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