@import url('https://fonts.googleapis.com/css2?family=Crimson+Text:wght@400;600;700&family=EB+Garamond:wght@400;500;600;700;800&display=swap');

:root {
  --ink: #171f26;
  --ink-hi: #1f2a33;
  --ink-lo: #151d24;
  --ink-sink: #131a20;
  --line: rgba(200, 224, 244, .16);
  --line-soft: rgba(200, 224, 244, .09);
  --blue: #c8e0f4;
  --pink: #f5e0e8;
  --txt: #dde8f0;
  --dim: #94a7b5;
  --sh-d: rgba(0, 0, 0, .55);
  --sh-l: rgba(200, 224, 244, .085);
  --r: 14px;
  --serif: 'EB Garamond', 'Crimson Text', 'Songti SC', 'Noto Serif CJK SC', Georgia, serif;
  --sans: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', system-ui, sans-serif;
}

* { box-sizing: border-box; }

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

html, body { overflow-x: clip; }

body {
  margin: 0;
  color: var(--txt);
  background-color: var(--ink);
  background-image:
    radial-gradient(62vw 52vw at 90% -8%, rgba(200, 224, 244, .11), transparent 62%),
    radial-gradient(56vw 46vw at 2% 104%, rgba(245, 224, 232, .085), transparent 64%);
  background-attachment: fixed;
  background-repeat: no-repeat;
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
}

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

::selection { background: var(--pink); color: var(--ink); }

a { color: var(--blue); }

:focus-visible {
  outline: 2px solid var(--pink);
  outline-offset: 3px;
}

/* ---------- top bar ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px clamp(12px, 3.6vw, 38px);
  background: rgba(23, 31, 38, .88);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line-soft);
}

.brand-link {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: var(--blue);
  background: linear-gradient(145deg, var(--ink-hi), var(--ink-lo));
  box-shadow: -4px -4px 10px var(--sh-l), 4px 4px 12px var(--sh-d);
  transition: transform .15s ease, box-shadow .15s ease;
}

.brand-link:active {
  transform: scale(.96);
  box-shadow: inset -3px -3px 8px var(--sh-l), inset 3px 3px 8px var(--sh-d);
}

.brand-link svg { width: 22px; height: 22px; }
.brand-link img { width: 26px; height: 26px; object-fit: contain; }

.topnav {
  flex: 1 1 auto;
  display: flex;
  gap: 8px;
  min-width: 0;
  padding: 3px 1px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.topnav::-webkit-scrollbar { display: none; }

.topnav a {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  min-height: 44px;
  padding: 0 13px;
  border-radius: 12px;
  color: var(--txt);
  font-size: 16px;
  text-decoration: none;
  white-space: nowrap;
  background: linear-gradient(145deg, #1e2933, var(--ink-lo));
  box-shadow: -3px -3px 9px var(--sh-l), 3px 3px 9px var(--sh-d);
  transition: color .15s ease, box-shadow .15s ease, transform .15s ease;
}

.topnav a svg {
  flex: none;
  width: 15px;
  height: 15px;
  opacity: .7;
}

.topnav a:hover { color: #fff; }
.topnav a:hover svg { opacity: 1; }

.topnav a:active {
  transform: scale(.97);
  box-shadow: inset -2px -2px 6px var(--sh-l), inset 2px 2px 6px var(--sh-d);
}

.cta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--r);
  color: var(--ink);
  font-size: 16px;
  font-weight: 600;
  text-decoration: none;
  background: linear-gradient(145deg, var(--pink), #e3c8d3);
  box-shadow: -3px -3px 10px rgba(245, 224, 232, .2), 4px 4px 12px rgba(0, 0, 0, .5);
  transition: transform .15s ease, box-shadow .15s ease;
}

.cta:active {
  transform: scale(.97);
  box-shadow: inset 2px 2px 6px rgba(0, 0, 0, .2), inset -2px -2px 6px rgba(255, 255, 255, .5);
}

/* ---------- hero ---------- */
.hero {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: flex-end;
  justify-content: flex-end;
  gap: 16px;
  min-height: 100vh;
  min-height: 100svh;
  padding: calc(96px + env(safe-area-inset-top)) clamp(18px, 5vw, 64px) clamp(120px, 17vh, 190px);
  text-align: right;
  overflow: hidden;
}

.hero h1 {
  margin: 0;
  max-width: 17ch;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2.3rem, 7.4vw, 5.3rem);
  line-height: 1.06;
  letter-spacing: .005em;
  color: #f4f9fd;
  text-shadow: 1px 1px 0 rgba(255, 255, 255, .05), -2px -2px 10px rgba(0, 0, 0, .55);
}

.hero-lead {
  margin: 0;
  max-width: 46ch;
  color: var(--blue);
  font-size: 17px;
  line-height: 1.7;
  opacity: .92;
}

.hero-band {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: clamp(74px, 13vh, 132px);
  margin: 0;
  display: flex;
  transform: skewY(-2.2deg);
  transform-origin: right bottom;
  overflow: hidden;
  pointer-events: none;
}

.hero-band i {
  display: block;
  height: 100%;
  animation: drift 11s ease-in-out infinite;
}

.hero-band i:nth-child(1) {
  flex: 3;
  background: linear-gradient(90deg, rgba(200, 224, 244, .42), rgba(200, 224, 244, .08));
  animation-delay: -.4s;
}

.hero-band i:nth-child(2) {
  flex: 2;
  background: linear-gradient(90deg, rgba(245, 224, 232, .34), rgba(245, 224, 232, .06));
  animation-delay: -3.6s;
}

.hero-band i:nth-child(3) {
  flex: 4;
  background: linear-gradient(90deg, rgba(200, 224, 244, .16), rgba(23, 31, 38, 0));
  animation-delay: -7s;
}

@keyframes drift {
  0%, 100% { transform: translateY(0); opacity: .95; }
  50% { transform: translateY(-12px); opacity: .6; }
}

/* ---------- stage ---------- */
.stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 318px;
  gap: clamp(20px, 3vw, 44px);
  align-items: start;
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(40px, 6vw, 82px) clamp(14px, 4vw, 40px) clamp(28px, 4vw, 48px);
}

.prose > section {
  margin: 0 0 clamp(20px, 3vw, 32px);
  padding: clamp(18px, 3vw, 34px);
  border: 1px solid var(--line);
  border-radius: 0;
  background: rgba(255, 255, 255, .012);
  scroll-margin-top: 104px;
}

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

.prose h2 {
  margin: 0 0 .55em;
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.5rem, 3.1vw, 2.05rem);
  line-height: 1.26;
  color: #f2f8fd;
}

.prose h2:first-child { margin-top: 0; }

.prose h3 {
  margin: 1.5em 0 .45em;
  font-size: 1.14rem;
  line-height: 1.45;
  color: var(--pink);
  letter-spacing: .01em;
}

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

.prose ul, .prose ol { margin: 0 0 1.05em; padding-left: 1.25em; }
.prose li { margin: .4em 0; }

.prose a {
  color: var(--blue);
  text-decoration-color: rgba(200, 224, 244, .45);
  text-underline-offset: 3px;
}

.prose a:hover { color: #fff; }

.prose figure { margin: 1.3em 0; }

.prose img {
  display: block;
  width: 100%;
  border-radius: var(--r);
}

.prose blockquote {
  margin: 1.3em 0;
  padding: .55em 0 .55em 1em;
  border-left: 3px solid var(--pink);
  color: var(--dim);
}

.prose blockquote p { margin: 0; }

.prose strong { color: #fff; }

.prose time {
  display: inline-block;
  font-size: 15px;
  color: var(--dim);
  letter-spacing: .01em;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  margin: 1.2em 0;
  font-size: 16px;
}

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

.prose th { color: var(--blue); font-weight: 600; }

/* ---------- rail ---------- */
.rail {
  position: sticky;
  top: 86px;
  padding: 22px 20px;
  border-radius: 16px;
  background: linear-gradient(145deg, var(--ink-hi), var(--ink-lo));
  box-shadow: -6px -6px 16px var(--sh-l), 7px 7px 18px var(--sh-d);
}

.rail h2 {
  margin: 0 0 .35em;
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.5rem;
  line-height: 1.3;
  color: #f3f9fd;
}

.rail .subtitle {
  margin: 0 0 1.1em;
  font-size: 16px;
  line-height: 1.65;
  color: var(--dim);
}

.rail-list {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: rail;
}

.rail-list li { counter-increment: rail; }

.rail-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 7px 10px;
  border-radius: 12px;
  color: var(--txt);
  font-size: 16px;
  text-decoration: none;
  transition: background .15s ease, color .15s ease;
}

.rail-list a::before {
  content: counter(rail, decimal-leading-zero);
  flex: none;
  font-family: var(--serif);
  font-size: 14px;
  letter-spacing: .04em;
  color: var(--blue);
  opacity: .75;
}

.rail-list a:hover {
  color: #fff;
  background: rgba(200, 224, 244, .07);
}

/* ---------- footer ---------- */
.site-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: clamp(18px, 3vw, 40px);
  max-width: 1180px;
  margin: 0 auto;
  padding: clamp(30px, 5vw, 54px) clamp(14px, 4vw, 40px) 26px;
  border-top: 1px solid var(--line-soft);
}

.foot-brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1 1 190px;
  min-width: 0;
}

.foot-brand strong {
  font-family: var(--serif);
  font-size: 1.22rem;
  font-weight: 700;
  letter-spacing: .02em;
  color: #f0f7fc;
}

.foot-logo {
  flex: none;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  color: var(--blue);
  background: linear-gradient(145deg, var(--ink-hi), var(--ink-lo));
  box-shadow: -4px -4px 10px var(--sh-l), 4px 4px 12px var(--sh-d);
}

.foot-logo svg { width: 22px; height: 22px; }
.foot-logo img { width: 26px; height: 26px; object-fit: contain; }

.foot-nav { flex: 2 1 320px; min-width: 0; }

.foot-nav dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(112px, 1fr));
  gap: 8px 14px;
  margin: 0;
}

.foot-pair { min-width: 0; }

.foot-nav dt {
  font-size: 13px;
  letter-spacing: .06em;
  color: var(--dim);
}

.foot-nav dd { margin: 0; }

.foot-nav dd a {
  display: flex;
  align-items: center;
  min-height: 42px;
  font-size: 16px;
  color: var(--txt);
  text-decoration: none;
  border-bottom: 1px solid var(--line-soft);
}

.foot-nav dd a:hover { color: var(--pink); border-bottom-color: var(--pink); }

.foot-form {
  display: flex;
  gap: 8px;
  flex: 1 1 230px;
  min-width: 0;
}

.foot-form input {
  flex: 1 1 auto;
  min-width: 0;
  min-height: 46px;
  padding: 0 14px;
  border: 0;
  border-radius: 12px;
  color: var(--txt);
  font-family: inherit;
  font-size: 16px;
  background: var(--ink-sink);
  box-shadow: inset 3px 3px 8px rgba(0, 0, 0, .6), inset -3px -3px 8px rgba(200, 224, 244, .06);
}

.foot-form input::placeholder { color: #7d8f9c; }

.foot-form button {
  flex: none;
  min-height: 46px;
  padding: 0 16px;
  border: 0;
  border-radius: 12px;
  color: var(--blue);
  font-family: inherit;
  font-size: 16px;
  cursor: pointer;
  background: linear-gradient(145deg, #21303a, var(--ink-lo));
  box-shadow: -3px -3px 9px var(--sh-l), 3px 3px 9px var(--sh-d);
  transition: transform .15s ease, box-shadow .15s ease;
}

.foot-form button:active {
  transform: scale(.97);
  box-shadow: inset 2px 2px 6px var(--sh-d);
}

.foot-legal {
  flex: 1 1 100%;
  padding-top: 18px;
  border-top: 1px solid var(--line-soft);
  text-align: center;
  font-size: 15px;
  letter-spacing: .04em;
  color: var(--dim);
}

/* ---------- to top ---------- */
.totop {
  position: fixed;
  right: 15px;
  bottom: 15px;
  z-index: 35;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 50%;
  color: var(--blue);
  background: linear-gradient(145deg, var(--ink-hi), var(--ink-lo));
  box-shadow: -4px -4px 12px var(--sh-l), 5px 5px 14px var(--sh-d);
  transition: transform .15s ease;
}

.totop svg { width: 19px; height: 19px; }
.totop:active { transform: scale(.94); }

/* ---------- anim ---------- */
.anim .prose > section {
  opacity: 0;
  transform: translateY(16px);
  transition: opacity .55s ease, transform .55s ease;
}

.anim .prose > section.in {
  opacity: 1;
  transform: none;
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .stage { grid-template-columns: minmax(0, 1fr); }
  .rail { position: static; }
}

@media (max-width: 820px) {
  .topbar { flex-wrap: wrap; gap: 10px; padding-bottom: 8px; }
  .topnav { order: 3; flex-basis: 100%; padding-bottom: 2px; }
  .cta { margin-left: auto; }
  .hero { padding-top: calc(120px + env(safe-area-inset-top)); }
  .hero h1 { max-width: 100%; }
  .hero-lead { max-width: 100%; }
}

@media (max-width: 560px) {
  body { font-size: 16px; }
  .topnav a { font-size: 15px; padding: 0 12px; }
  .cta { padding: 0 14px; font-size: 15px; }
  .prose > section { padding: 18px 16px; }
  .rail { padding: 18px 16px; }
  .foot-form { flex-basis: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .hero-band i { animation: none; }
  .anim .prose > section { opacity: 1; transform: none; transition: none; }
  .brand-link, .cta, .topnav a, .foot-form button, .totop { transition: none; }
}

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