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

:root {
  --ink: #1f1f1f;
  --ink-2: #3a3a3a;
  --ink-3: #6d6d6d;
  --paper: #ffffff;
  --stone: #f5f5f5;
  --line: rgba(31, 31, 31, .12);
  --line-soft: rgba(31, 31, 31, .07);
  --r: 4px;
  --wrap: 1180px;
  --e1: 0 1px 2px rgba(17, 17, 17, .06), 0 2px 6px rgba(17, 17, 17, .04);
  --e2: 0 2px 6px rgba(17, 17, 17, .07), 0 10px 22px -10px rgba(17, 17, 17, .12);
  --e3: 0 6px 16px rgba(17, 17, 17, .08), 0 26px 48px -22px rgba(17, 17, 17, .20);
  --e4: 0 14px 30px rgba(17, 17, 17, .12), 0 46px 84px -34px rgba(17, 17, 17, .32);
}

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

body {
  margin: 0;
  background: var(--stone);
  color: var(--ink);
  font-family: "Plus Jakarta Sans", system-ui, -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 17px;
  line-height: 1.75;
  letter-spacing: .008em;
  -webkit-font-smoothing: antialiased;
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
ul { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4 { margin: 0; line-height: 1.25; font-weight: 700; letter-spacing: -.02em; }
hr { border: 0; border-top: 1px solid var(--line); margin: 12px 0 14px; }
p { margin: 0 0 16px; }

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

/* ---------- top chrome ---------- */
.chrome {
  position: sticky;
  top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px clamp(14px, 4vw, 40px);
  background: rgba(255, 255, 255, .84);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
  backdrop-filter: blur(16px) saturate(1.3);
  border-bottom: 1px solid var(--line);
  box-shadow: var(--e1);
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  font-weight: 700;
  letter-spacing: -.01em;
  font-size: 17px;
}

.mark {
  display: grid;
  place-items: center;
  width: 28px;
  height: 28px;
  border-radius: var(--r);
  background: var(--ink);
  color: #fff;
  font-size: 13px;
  line-height: 1;
  box-shadow: var(--e2);
  transform: translateZ(0);
}

.brand-txt { white-space: nowrap; }

.dropper { position: relative; }

.drop-btn {
  min-height: 44px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--r);
  background: var(--paper);
  color: var(--ink);
  font: inherit;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--e1);
  transition: box-shadow .2s ease, transform .2s ease;
}

.drop-btn:hover { box-shadow: var(--e2); transform: translateY(-1px); }
.drop-btn[aria-expanded="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }

.panel {
  position: absolute;
  top: calc(100% + 12px);
  left: 0;
  z-index: 6;
  display: none;
  grid-template-columns: 1fr 1fr;
  gap: 10px 26px;
  min-width: min(80vw, 460px);
  padding: 16px;
  background: var(--paper);
  border: 1px solid var(--line);
  border-radius: var(--r);
  border-bottom: 3px solid var(--ink);
  box-shadow: var(--e4);
}

.dropper.open .panel,
.dropper:hover .panel,
.dropper:focus-within .panel { display: grid; }

.panel a {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  padding: 0 10px;
  border-radius: var(--r);
  font-size: 16px;
  font-weight: 500;
  transition: background .18s ease, transform .18s ease;
}

.panel a:hover { background: var(--stone); transform: translateX(3px); }

.num {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .1em;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}

.cta {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: var(--r);
  background: var(--ink);
  color: #fff;
  font-weight: 600;
  font-size: 16px;
  box-shadow: var(--e3);
  transition: transform .2s ease, box-shadow .2s ease;
}

.cta:hover { transform: translateY(-2px); box-shadow: var(--e4); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  isolation: isolate;
  overflow: hidden;
  display: flex;
  align-items: flex-end;
  justify-content: flex-end;
  min-height: min(70vh, 660px);
  background: #161616;
  color: #fff;
}

.hero-media { position: absolute; inset: -8% 0; z-index: 0; will-change: transform; }

.hero-img,
.hero-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: .62;
  filter: grayscale(.15) contrast(1.02);
}

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(200deg, rgba(22, 22, 22, .18) 0%, rgba(22, 22, 22, .62) 55%, rgba(22, 22, 22, .92) 100%);
}

.hero-ghost {
  position: absolute;
  left: clamp(10px, 2.4vw, 34px);
  bottom: -.06em;
  z-index: 1;
  font-size: clamp(40px, 12vw, 190px);
  font-weight: 700;
  letter-spacing: -.055em;
  line-height: .8;
  color: rgba(255, 255, 255, .15);
  white-space: nowrap;
  pointer-events: none;
  text-shadow: 0 18px 40px rgba(0, 0, 0, .28);
}

.hero-copy {
  position: relative;
  z-index: 2;
  max-width: 760px;
  padding: 0 clamp(18px, 5vw, 64px) clamp(30px, 6vw, 72px);
  text-align: right;
}

.hero-copy h1 {
  font-size: clamp(30px, 5vw, 58px);
  letter-spacing: -.035em;
  text-shadow: 0 2px 26px rgba(0, 0, 0, .4);
}

.hero-desc {
  margin: 16px 0 0 auto;
  max-width: 52ch;
  font-size: clamp(16px, 1.6vw, 18px);
  color: rgba(255, 255, 255, .85);
}

/* ---------- stage ---------- */
.stage {
  position: relative;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: clamp(22px, 4vw, 46px) clamp(14px, 3vw, 28px) 64px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: clamp(18px, 3vw, 32px);
  align-items: start;
}

.sheet {
  position: relative;
  z-index: 1;
  padding: clamp(18px, 3vw, 42px);
  background: var(--paper);
  border-radius: var(--r);
  border-bottom: 3px solid var(--ink);
  box-shadow: var(--e3);
}

.prose { min-width: 0; }
.prose div { scroll-margin-top: 96px; }
.prose div + div {
  margin-top: 44px;
  padding-top: 34px;
  border-top: 1px dashed var(--line);
}

.prose h2 {
  margin: 6px 0 4px;
  font-size: clamp(22px, 2.6vw, 30px);
  letter-spacing: -.03em;
}

.prose h3 {
  margin: 28px 0 4px;
  font-size: clamp(18px, 2vw, 21px);
}

.prose p { color: var(--ink-2); }
.prose strong { color: var(--ink); }

.prose a {
  color: var(--ink);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
  text-decoration-color: rgba(31, 31, 31, .35);
}

.prose a:hover { text-decoration-color: var(--ink); }

.prose ul,
.prose ol { margin: 0 0 18px; padding-left: 22px; color: var(--ink-2); }
.prose ul { list-style: none; padding-left: 0; }

.prose ul > li {
  position: relative;
  padding-left: 20px;
  margin-bottom: 8px;
}

.prose ul > li::before {
  content: "";
  position: absolute;
  left: 2px;
  top: .72em;
  width: 7px;
  height: 7px;
  border-radius: 2px;
  background: var(--ink);
}

.prose ol { list-style: decimal; }
.prose ol > li { margin-bottom: 8px; }

.prose blockquote {
  margin: 20px 0;
  padding: 14px 18px;
  background: var(--stone);
  border-left: 3px solid var(--ink);
  border-radius: 0 var(--r) var(--r) 0;
  color: var(--ink-2);
}

.prose figure { margin: 22px 0; }
.prose figure img { border-radius: var(--r); box-shadow: var(--e2); }
.prose figcaption { margin-top: 8px; font-size: 15px; color: var(--ink-3); }

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

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

.prose th { background: var(--stone); font-weight: 600; }

/* ---------- rail ---------- */
.rail {
  position: sticky;
  top: 78px;
  z-index: 2;
  display: grid;
  gap: 14px;
}

.card {
  position: relative;
  padding: 16px;
  background: var(--paper);
  border-radius: var(--r);
  border-bottom: 3px solid var(--ink);
  box-shadow: var(--e2);
}

.nav-card h2 { font-size: 16px; letter-spacing: .04em; }

.rail-list { display: grid; gap: 2px; }

.rail-list a {
  display: flex;
  align-items: baseline;
  gap: 10px;
  min-height: 44px;
  padding: 9px 10px;
  border-radius: var(--r);
  font-size: 16px;
  line-height: 1.5;
  color: var(--ink-2);
  transition: background .18s ease, transform .18s ease, color .18s ease;
}

.rail-list a:hover,
.rail-list a.on {
  background: var(--stone);
  color: var(--ink);
  transform: translateX(3px);
}

.rail-list a.on { box-shadow: inset 3px 0 0 var(--ink); }

.card.dark {
  background: var(--ink);
  border-bottom-color: #000;
  color: #fff;
  box-shadow: var(--e4);
}

.dark-link {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 12px;
  border-radius: var(--r);
  background: #fff;
  color: var(--ink);
  font-weight: 600;
  font-size: 16px;
  box-shadow: var(--e2);
  transition: transform .2s ease, box-shadow .2s ease;
}

.dark-link:hover { transform: translateY(-2px); box-shadow: var(--e3); }

.totop {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-size: 16px;
  color: var(--ink-3);
  border-radius: var(--r);
  border: 1px dashed var(--line);
}

.totop:hover { color: var(--ink); border-color: var(--ink); }

/* ---------- footer ---------- */
.base {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 22px 30px;
  align-items: start;
  padding: clamp(30px, 5vw, 60px) clamp(16px, 4vw, 40px) 20px;
  background: var(--ink);
  color: #fff;
}

.f-logo {
  display: block;
  min-height: 44px;
  font-size: clamp(30px, 7.5vw, 72px);
  font-weight: 700;
  letter-spacing: -.05em;
  line-height: .98;
}

.f-nav ul {
  display: grid;
  gap: 2px;
  justify-items: end;
}

.f-nav a {
  display: flex;
  align-items: center;
  min-height: 44px;
  padding: 0 8px;
  font-size: 16px;
  color: rgba(255, 255, 255, .74);
  border-radius: var(--r);
  transition: color .18s ease, background .18s ease;
}

.f-nav a:hover { color: #fff; background: rgba(255, 255, 255, .08); }

.f-bar {
  grid-column: 1 / -1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-top: 8px;
  padding-top: 14px;
  border-top: 1px solid rgba(255, 255, 255, .16);
  font-size: 15px;
  color: rgba(255, 255, 255, .6);
}

.f-top { display: inline-flex; align-items: center; min-height: 44px; color: rgba(255, 255, 255, .82); }
.f-top:hover { color: #fff; }

/* ---------- responsive ---------- */
@media (max-width: 940px) {
  .stage { grid-template-columns: minmax(0, 1fr); padding-bottom: 48px; }
  .rail { position: static; }
  .rail-list { grid-template-columns: 1fr 1fr; }
  .hero-copy { text-align: left; }
  .hero-desc { margin-left: 0; }
  .hero-ghost { font-size: clamp(38px, 13vw, 120px); }
}

@media (max-width: 640px) {
  body { font-size: 16px; }
  .hero { min-height: min(66vh, 480px); }
  .brand-txt { font-size: 16px; }
  .cta { padding: 0 14px; font-size: 15px; }
  .panel { grid-template-columns: 1fr; min-width: min(86vw, 320px); }
  .base { grid-template-columns: minmax(0, 1fr); }
  .f-nav ul { justify-items: start; grid-template-columns: 1fr 1fr; }
  .f-bar { flex-direction: column; align-items: flex-start; gap: 4px; }
  .rail-list { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *,
  *::before,
  *::after { transition-duration: .001ms !important; animation-duration: .001ms !important; }
}

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