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

:root {
  --paper: #ffffff;
  --mist: #f5f5f5;
  --ink: #1f1f1f;
  --ink-soft: #565656;
  --ink-faint: #8b8b8b;
  --line: #e2e2e2;
  --line-soft: #eeeeee;
  --el-xs: 0 1px 2px rgba(31, 31, 31, 0.06);
  --el-sm: 0 2px 6px rgba(31, 31, 31, 0.07), 0 1px 2px rgba(31, 31, 31, 0.05);
  --el-md: 0 10px 24px rgba(31, 31, 31, 0.08), 0 3px 8px rgba(31, 31, 31, 0.05);
  --el-lg: 0 22px 48px rgba(31, 31, 31, 0.11), 0 8px 18px rgba(31, 31, 31, 0.06);
  --el-xl: 0 40px 80px rgba(31, 31, 31, 0.16), 0 12px 28px rgba(31, 31, 31, 0.08);
  --pad: clamp(16px, 4vw, 52px);
  --sans: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
}

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

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

body {
  margin: 0;
  background: var(--mist);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.72;
  letter-spacing: -0.004em;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; }

img { max-width: 100%; }

.frame {
  position: relative;
  overflow-x: clip;
}

/* ---------- head ---------- */

.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.78);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border-bottom: 1px solid var(--line-soft);
  box-shadow: var(--el-xs);
}

.brand-row {
  display: flex;
  align-items: center;
  gap: 10px;
  max-width: 1360px;
  margin: 0 auto;
  padding: 12px var(--pad) 6px;
}

.mark {
  display: block;
  width: 11px;
  height: 11px;
  background: var(--ink);
  box-shadow: 3px -3px 0 0 rgba(31, 31, 31, 0.28);
  transform: translateZ(0);
}

.brand {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 19px;
  font-weight: 700;
  letter-spacing: -0.03em;
  text-decoration: none;
}

.menu-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  max-width: 1360px;
  margin: 0 auto;
  padding: 0 var(--pad) 12px;
}

.pillnav {
  flex: 1 1 320px;
  min-width: 0;
}

.pillnav ol {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--paper);
  box-shadow: var(--el-sm);
  color: var(--ink);
  font-size: 16px;
  font-weight: 500;
  text-decoration: none;
  transform: translateZ(0);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.pill:hover,
.pill:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--el-md);
  background: #fbfbfb;
}

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

.cta {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
  box-shadow: var(--el-md);
  flex: 0 0 auto;
}

.cta:hover,
.cta:focus-visible {
  background: #000;
  color: #fff;
}

/* ---------- hero ---------- */

.hero {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.06fr 0.94fr;
  gap: clamp(16px, 3vw, 44px);
  align-items: stretch;
  min-height: 100vh;
  max-width: 1360px;
  margin: 0 auto;
  padding: clamp(16px, 3vw, 36px) var(--pad) clamp(26px, 4vw, 56px);
}

.hero-media {
  position: relative;
  min-height: 320px;
}

.hero-stack {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: linear-gradient(155deg, #ffffff 0%, #e8e8e8 100%);
  box-shadow: var(--el-xl);
  z-index: 1;
}

.hero-stack > *,
.hero-stack picture {
  position: absolute;
  inset: 0;
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-stack picture img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.hero-stack.is-empty::after {
  content: '';
  position: absolute;
  inset: 14px;
  border: 1px solid rgba(31, 31, 31, 0.12);
}

.hero-stack.multi > * {
  opacity: 0;
  animation: herofade 24s ease-in-out infinite;
}

.hero-stack.multi > *:nth-child(1) { animation-delay: 0s; }
.hero-stack.multi > *:nth-child(2) { animation-delay: 8s; }
.hero-stack.multi > *:nth-child(3) { animation-delay: 16s; }

@keyframes herofade {
  0% { opacity: 0; }
  5% { opacity: 1; }
  30% { opacity: 1; }
  35% { opacity: 0; }
  100% { opacity: 0; }
}

.hero-copy {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 20px;
  padding: clamp(8px, 2vw, 24px) 0;
  text-align: center;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(30px, 4.6vw, 58px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.035em;
  text-wrap: balance;
}

.hero-lead {
  margin: 0;
  max-width: 34ch;
  color: var(--ink-soft);
  font-size: 16px;
  line-height: 1.7;
}

/* ---------- stage ---------- */

.stage {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 250px minmax(0, 1fr);
  gap: clamp(16px, 2.4vw, 34px);
  align-items: start;
  max-width: 1360px;
  margin: 0 auto;
  padding: clamp(22px, 4vw, 52px) var(--pad) clamp(44px, 6vw, 88px);
}

.rail {
  position: sticky;
  top: 168px;
  z-index: 3;
  padding: 18px 16px 20px;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  box-shadow: var(--el-lg);
  transform: translateZ(0);
}

.rail small {
  display: block;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.16em;
  color: var(--ink-faint);
}

.rail-title {
  margin: 4px 0 12px;
  font-size: 20px;
  font-weight: 600;
  letter-spacing: -0.025em;
}

.rail-nav ol {
  display: flex;
  flex-direction: column;
  gap: 2px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rail-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 10px;
  border-left: 2px solid transparent;
  font-size: 16px;
  text-decoration: none;
  color: var(--ink-soft);
  transition: background 0.16s ease, border-color 0.16s ease, color 0.16s ease;
}

.rail-nav a:hover,
.rail-nav a:focus-visible {
  background: var(--mist);
  border-left-color: var(--ink);
  color: var(--ink);
}

/* ---------- prose ---------- */

.prose {
  position: relative;
  z-index: 1;
  min-width: 0;
}

.prose > section {
  position: relative;
  background: var(--paper);
  border: 1px solid var(--line-soft);
  box-shadow: var(--el-md);
  padding: clamp(22px, 3.2vw, 44px);
  scroll-margin-top: 176px;
}

.prose > section + section { margin-top: -8px; }

.prose > section:nth-child(1) { z-index: 1; }
.prose > section:nth-child(2) { z-index: 2; }
.prose > section:nth-child(3) { z-index: 3; }
.prose > section:nth-child(4) { z-index: 4; }
.prose > section:nth-child(n + 5) { z-index: 5; }

.prose small {
  display: block;
  margin-bottom: 8px;
  font-size: 16px;
  font-weight: 500;
  letter-spacing: 0.14em;
  color: var(--ink-faint);
}

.prose h2 {
  margin: 0 0 16px;
  font-size: clamp(22px, 2.4vw, 30px);
  font-weight: 600;
  line-height: 1.26;
  letter-spacing: -0.028em;
}

.prose h3 {
  margin: 26px 0 10px;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: -0.02em;
}

.prose p {
  margin: 0 0 16px;
  max-width: 68ch;
}

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

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

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

.prose strong { font-weight: 600; }

.prose a { text-decoration: underline; text-underline-offset: 3px; }

.prose blockquote {
  margin: 0 0 16px;
  padding: 12px 18px;
  background: var(--mist);
  box-shadow: inset 2px 0 0 var(--ink);
  color: var(--ink-soft);
}

.prose figure { margin: 0 0 16px; }

.prose img {
  display: block;
  width: 100%;
  height: auto;
  box-shadow: var(--el-sm);
}

/* ---------- foot ---------- */

.site-foot {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: clamp(12px, 3vw, 36px);
  padding: clamp(20px, 3vw, 34px) var(--pad);
  background: var(--paper);
  border-top: 1px solid var(--line);
}

.foot-brand {
  font-size: clamp(26px, 5vw, 56px);
  font-weight: 700;
  line-height: 1.02;
  letter-spacing: -0.045em;
}

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

.foot-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 40px;
  font-size: 16px;
  color: var(--ink-soft);
  text-decoration: none;
}

.foot-nav a:hover,
.foot-nav a:focus-visible {
  color: var(--ink);
  box-shadow: inset 0 -1px 0 var(--ink);
}

.foot-copy {
  font-size: 16px;
  color: var(--ink-faint);
}

/* ---------- misc ---------- */

.to-top {
  position: fixed;
  right: clamp(12px, 2.6vw, 26px);
  bottom: clamp(12px, 2.6vw, 26px);
  z-index: 50;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 18px;
  border-radius: 999px;
  background: var(--ink);
  color: #fff;
  font-size: 16px;
  text-decoration: none;
  box-shadow: var(--el-lg);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.to-top:hover,
.to-top:focus-visible {
  transform: translateY(-2px);
  box-shadow: var(--el-xl);
}

.will-reveal {
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.62s cubic-bezier(0.16, 0.84, 0.44, 1);
}

.will-reveal.is-in {
  opacity: 1;
  transform: none;
}

/* ---------- breakpoints ---------- */

@media (max-width: 980px) {
  .hero {
    grid-template-columns: 1fr;
    min-height: 0;
    padding-top: 14px;
  }

  .hero-media {
    min-height: 0;
    height: 44vh;
    order: -1;
  }

  .hero-copy { padding: 6px 0 0; }

  .stage {
    grid-template-columns: 1fr;
  }

  .rail {
    position: static;
    top: auto;
    box-shadow: var(--el-sm);
  }

  .rail-nav ol {
    flex-direction: row;
    flex-wrap: wrap;
    gap: 4px;
  }

  .rail-nav a {
    border-left: 0;
    border-bottom: 2px solid transparent;
    padding: 0 12px;
  }

  .rail-nav a:hover,
  .rail-nav a:focus-visible { border-bottom-color: var(--ink); }

  .prose > section { scroll-margin-top: 150px; }
}

@media (max-width: 620px) {
  body { font-size: 16.5px; }

  .pill { padding: 0 14px; }

  .foot-brand { width: 100%; }

  .site-foot {
    flex-direction: column;
    align-items: flex-start;
  }

  .prose > section + section { margin-top: 0; }
}

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

  .hero-stack.multi > * {
    animation: none;
    opacity: 1;
  }

  * {
    transition-duration: 0.001ms !important;
  }
}

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