/* Editorial Luxury design system: warm paper, espresso ink, sage accents. */

:root {
  --cream: #fdfbf7;
  --paper: #f7f2e9;
  --paper-2: #efe8da;
  --linen: #e7dfcf;
  --ink: #221b14;
  --ink-soft: #4a4036;
  --muted: #7a6f62;
  --espresso: #2a2019;
  --espresso-2: #382b22;
  --espresso-3: #4a3a2e;
  --sage: #8c9b84;
  --sage-deep: #5d6c57;
  --sage-tint: #e4e9dd;
  --clay: #b8724c;
  --wechat: #07c160;
  --hair: rgba(42, 32, 25, 0.08);
  --hair-strong: rgba(42, 32, 25, 0.14);
  --hair-light: rgba(253, 251, 247, 0.12);

  --font-display: "Clash Display", "Noto Serif SC", "Songti SC", "STSong", serif;
  --font-body: "Clash Display", "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --font-mono: "SF Mono", "JetBrains Mono", "Cascadia Code", Consolas, "Liberation Mono", monospace;

  --ease: cubic-bezier(0.32, 0.72, 0, 1);
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);
  --shadow-soft: 0 40px 80px -40px rgba(42, 32, 25, 0.18), 0 12px 32px -18px rgba(42, 32, 25, 0.10);
  --shadow-float: 0 50px 100px -40px rgba(42, 32, 25, 0.28), 0 18px 40px -20px rgba(42, 32, 25, 0.16);

  --r-shell: 2rem;
  --r-core: calc(2rem - 0.375rem);
  --gutter: clamp(1rem, 4vw, 3.5rem);
  --max: 1360px;

  /* Systemic layers only */
  --z-nav: 30;
  --z-menu: 40;
  --z-modal: 45;
  --z-grain: 50;
}

*,
*::before,
*::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--cream);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
}

/* Film grain: fixed, non-interactive, never on a scrolling container */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
}

img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
input, textarea { font: inherit; color: inherit; }
::selection { background: var(--sage-tint); color: var(--ink); }

:focus-visible { outline: 2px solid var(--sage-deep); outline-offset: 3px; border-radius: 0.5rem; }

.page { overflow-x: hidden; width: 100%; max-width: 100%; }

.wrap { width: 100%; max-width: var(--max); margin: 0 auto; padding: 0 var(--gutter); }

.section { padding: clamp(6rem, 12vw, 12rem) 0; position: relative; }

/* Heading phrase: lines may break between phrases, never inside one */
.ph { white-space: nowrap; }

.serif { font-family: var(--font-display); }
.mono { font-family: var(--font-mono); }

/* Eyebrow pill above an H2 (never in the hero) */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  padding: 0.3rem 0.85rem;
  border-radius: 999px;
  background: rgba(140, 155, 132, 0.14);
  box-shadow: inset 0 0 0 1px rgba(93, 108, 87, 0.18);
  color: var(--sage-deep);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.2em;
  text-transform: uppercase;
}
.eyebrow::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: 0.7; }
.on-dark .eyebrow { background: rgba(253, 251, 247, 0.06); box-shadow: inset 0 0 0 1px var(--hair-light); color: var(--sage-tint); }

.h2 {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.1rem, 4.2vw, 4rem);
  line-height: 1.12;
  letter-spacing: -0.01em;
  margin: 1.25rem 0 0;
  max-width: 22ch;
}
.lede { color: var(--ink-soft); font-size: clamp(1rem, 1.2vw, 1.15rem); max-width: 38rem; margin: 1.5rem 0 0; }
.on-dark .lede { color: rgba(253, 251, 247, 0.66); }

/* Double-bezel: aluminium tray + glass plate */
.bezel {
  background: rgba(42, 32, 25, 0.035);
  box-shadow: inset 0 0 0 1px var(--hair);
  padding: 0.375rem;
  border-radius: var(--r-shell);
}
.bezel > .core {
  background: var(--paper);
  border-radius: var(--r-core);
  box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.75), 0 1px 0 rgba(42, 32, 25, 0.03);
  height: 100%;
  position: relative;
  overflow: hidden;
}
.bezel.dark { background: rgba(253, 251, 247, 0.05); box-shadow: inset 0 0 0 1px var(--hair-light); }
.bezel.dark > .core { background: var(--espresso-2); box-shadow: inset 0 1px 1px rgba(255, 255, 255, 0.08); color: var(--cream); }

/* Island buttons with nested trailing icon */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 0.85rem;
  border-radius: 999px;
  padding: 0.5rem 0.5rem 0.5rem 1.5rem;
  min-height: 3.25rem;
  font-weight: 500;
  font-size: 0.98rem;
  letter-spacing: 0.01em;
  transition: transform 600ms var(--ease), background-color 600ms var(--ease), box-shadow 600ms var(--ease), color 600ms var(--ease);
  white-space: nowrap;
}
.btn:active { transform: scale(0.98); }
.btn .btn-icon {
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.05rem;
  transition: transform 600ms var(--ease), background-color 600ms var(--ease);
}
.btn:hover .btn-icon { transform: translate(3px, -1px) scale(1.05); }
.btn-dark { background: var(--espresso); color: var(--cream); box-shadow: 0 18px 40px -22px rgba(42, 32, 25, 0.7); }
.btn-dark .btn-icon { background: rgba(253, 251, 247, 0.12); }
.btn-dark:hover { background: var(--espresso-3); }
.btn-light { background: rgba(42, 32, 25, 0.045); color: var(--ink); box-shadow: inset 0 0 0 1px var(--hair-strong); }
.btn-light .btn-icon { background: rgba(42, 32, 25, 0.06); }
.btn-light:hover { background: rgba(42, 32, 25, 0.08); }
.btn-cream { background: var(--cream); color: var(--espresso); }
.btn-cream .btn-icon { background: rgba(42, 32, 25, 0.08); }
.btn-cream:hover { background: #fff; }
.btn-plain { padding: 0.5rem 1.4rem; }
.btn-sm { min-height: 2.6rem; font-size: 0.88rem; padding: 0.35rem 0.35rem 0.35rem 1.1rem; gap: 0.6rem; }
.btn-sm .btn-icon { width: 1.9rem; height: 1.9rem; font-size: 0.95rem; }
.btn-sm.btn-plain { padding: 0.35rem 1.1rem; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }

/* Entry reveal: heavy fade-up */
.js [data-reveal] {
  opacity: 0;
  transform: translate3d(0, 3.5rem, 0);
  filter: blur(8px);
  transition: opacity 1000ms var(--ease-out), transform 1100ms var(--ease-out), filter 900ms var(--ease-out);
  transition-delay: var(--d, 0ms);
}
.js [data-reveal].is-in { opacity: 1; transform: none; filter: blur(0); }

/* Navigation island */
.nav {
  position: fixed;
  top: 1.5rem;
  left: 0;
  right: 0;
  z-index: var(--z-nav);
  display: flex;
  justify-content: center;
  pointer-events: none;
  padding: 0 1rem;
}
.nav-pill {
  pointer-events: auto;
  width: max-content;
  max-width: 100%;
  display: flex;
  align-items: center;
  gap: 0.35rem;
  padding: 0.4rem 0.4rem 0.4rem 1.15rem;
  border-radius: 999px;
  background: rgba(253, 251, 247, 0.72);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  backdrop-filter: blur(18px) saturate(1.4);
  box-shadow: inset 0 0 0 1px var(--hair), 0 20px 50px -30px rgba(42, 32, 25, 0.35);
  transition: background-color 700ms var(--ease), box-shadow 700ms var(--ease), transform 700ms var(--ease);
}
.nav.is-scrolled .nav-pill { background: rgba(253, 251, 247, 0.88); box-shadow: inset 0 0 0 1px var(--hair-strong), 0 24px 60px -28px rgba(42, 32, 25, 0.4); }
.brand { display: inline-flex; align-items: center; gap: 0.6rem; font-weight: 600; font-size: 0.98rem; margin-right: 0.9rem; white-space: nowrap; }
.brand-mark {
  width: 1.65rem;
  height: 1.65rem;
  border-radius: 0.55rem;
  background: var(--espresso);
  color: var(--cream);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.95rem;
}
.nav-links { display: flex; align-items: center; gap: 0.1rem; }
.nav-link {
  padding: 0.5rem 0.9rem;
  border-radius: 999px;
  font-size: 0.9rem;
  color: var(--ink-soft);
  transition: background-color 500ms var(--ease), color 500ms var(--ease);
}
.nav-link:hover { background: rgba(42, 32, 25, 0.05); color: var(--ink); }
.nav-cta { margin-left: 0.4rem; }

.burger {
  display: none;
  position: relative;
  width: 2.6rem;
  height: 2.6rem;
  border-radius: 50%;
  background: rgba(42, 32, 25, 0.06);
  margin-left: 0.25rem;
}
.burger span {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 1rem;
  height: 1.5px;
  border-radius: 2px;
  background: var(--ink);
  transition: transform 600ms var(--ease);
}
.burger span:nth-child(1) { transform: translate(-50%, -4px); }
.burger span:nth-child(2) { transform: translate(-50%, 3px); }
.menu-open .burger span:nth-child(1) { transform: translate(-50%, 0) rotate(45deg); }
.menu-open .burger span:nth-child(2) { transform: translate(-50%, 0) rotate(-45deg); }

.menu {
  position: fixed;
  inset: 0;
  z-index: var(--z-menu);
  background: rgba(253, 251, 247, 0.84);
  -webkit-backdrop-filter: blur(40px);
  backdrop-filter: blur(40px);
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 6rem 1.5rem 3rem;
  opacity: 0;
  visibility: hidden;
  transition: opacity 600ms var(--ease), visibility 0s 600ms;
}
.menu-open .menu { opacity: 1; visibility: visible; transition: opacity 600ms var(--ease), visibility 0s; }
.menu a {
  display: block;
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.2rem, 9vw, 3.4rem);
  line-height: 1.25;
  padding: 0.3rem 0;
  overflow: hidden;
}
.menu a span {
  display: inline-block;
  transform: translate3d(0, 3rem, 0);
  opacity: 0;
  transition: transform 800ms var(--ease), opacity 700ms var(--ease);
}
.menu-open .menu a span { transform: none; opacity: 1; }
.menu a:nth-child(1) span { transition-delay: 100ms; }
.menu a:nth-child(2) span { transition-delay: 150ms; }
.menu a:nth-child(3) span { transition-delay: 200ms; }
.menu a:nth-child(4) span { transition-delay: 250ms; }
.menu-note { margin-top: 2.5rem; color: var(--muted); font-size: 0.9rem; }

/* Hero: editorial split */
.hero {
  min-height: 100dvh;
  padding: clamp(8rem, 14vw, 11rem) 0 clamp(5rem, 8vw, 7rem);
  display: flex;
  align-items: center;
  position: relative;
}
.hero::before {
  content: "";
  position: absolute;
  inset: -10% -10% auto auto;
  width: 60vw;
  height: 60vw;
  max-width: 900px;
  max-height: 900px;
  background: radial-gradient(closest-side, rgba(140, 155, 132, 0.22), rgba(140, 155, 132, 0) 70%);
  pointer-events: none;
}
.hero::after {
  content: "";
  position: absolute;
  left: -15%;
  bottom: -20%;
  width: 55vw;
  height: 55vw;
  max-width: 820px;
  max-height: 820px;
  background: radial-gradient(closest-side, rgba(184, 114, 76, 0.10), rgba(184, 114, 76, 0) 70%);
  pointer-events: none;
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 7fr) minmax(0, 5fr);
  gap: clamp(2rem, 6vw, 7rem);
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-title {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(2.6rem, 5.4vw, 5.5rem);
  line-height: 1.08;
  letter-spacing: -0.015em;
  margin: 0;
  width: 100%;
}
.hero-title .line { display: block; white-space: nowrap; }
.hero-title em { font-style: normal; color: var(--sage-deep); }
.hero-sub { color: var(--ink-soft); font-size: clamp(1.02rem, 1.25vw, 1.2rem); max-width: 34rem; margin: 2rem 0 0; }
.hero-actions { display: flex; flex-wrap: wrap; gap: 0.85rem; margin-top: 2.75rem; }

.hero-visual { position: relative; padding-bottom: 3rem; }
.hero-photo .core { aspect-ratio: 4 / 5; }
.hero-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: grayscale(0.55) sepia(0.28) contrast(1.08) brightness(1.02);
  transition: transform 1400ms var(--ease);
}
.hero-photo:hover img { transform: scale(1.05); }
.hero-photo .core::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(42, 32, 25, 0) 45%, rgba(42, 32, 25, 0.35) 100%);
}

/* WeChat template-message mock */
.notify {
  position: absolute;
  left: -14%;
  bottom: 0;
  width: min(23rem, 92%);
  box-shadow: var(--shadow-float);
}
.notify .core { background: #fff; padding: 1.15rem 1.25rem 1rem; }
.notify-head { display: flex; align-items: center; gap: 0.6rem; font-size: 0.82rem; color: var(--muted); }
.notify-avatar {
  width: 1.75rem;
  height: 1.75rem;
  border-radius: 0.5rem;
  background: var(--espresso);
  color: var(--cream);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.85rem;
}
.notify-time { margin-left: auto; font-size: 0.75rem; }
.notify-title { font-weight: 600; font-size: 1.02rem; margin: 0.85rem 0 0.6rem; color: var(--ink); }
.notify-row { display: grid; grid-template-columns: 3.2rem 1fr; gap: 0.5rem; font-size: 0.86rem; line-height: 1.6; }
.notify-row dt { color: var(--muted); }
.notify-row dd { margin: 0; color: var(--ink); }
.notify-foot {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: 0.85rem;
  padding-top: 0.75rem;
  border-top: 1px solid rgba(42, 32, 25, 0.06);
  font-size: 0.82rem;
  color: var(--ink-soft);
}
.notify-foot i { color: var(--muted); }

/* Bento */
.bento-head { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 0.85fr); gap: 2rem; align-items: end; margin-bottom: clamp(3rem, 6vw, 5rem); }
.bento-head .lede { margin: 0; justify-self: end; }
.pill-img {
  display: inline-block;
  width: 2.6em;
  height: 1.05em;
  border-radius: 999px;
  vertical-align: -0.08em;
  margin: 0 0.18em;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(42, 32, 25, 0.1);
  filter: grayscale(0.4) sepia(0.25) contrast(1.05);
}
.bento {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-rows: minmax(15rem, auto);
  grid-auto-flow: dense;
  gap: 1.25rem;
}
.cell-a { grid-column: span 7; grid-row: span 2; }
.cell-b { grid-column: span 5; }
.cell-c { grid-column: span 5; }
.cell-d { grid-column: span 4; }
.cell-e { grid-column: span 8; }
.cell .core { padding: clamp(1.5rem, 2.4vw, 2.25rem); display: flex; flex-direction: column; }
.cell h3 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.35rem, 1.8vw, 1.7rem); line-height: 1.25; margin: 0; }
.cell p { color: var(--ink-soft); margin: 0.75rem 0 0; font-size: 0.96rem; }
.cell.dark p { color: rgba(253, 251, 247, 0.62); }
.cell-icon {
  width: 2.75rem;
  height: 2.75rem;
  border-radius: 0.9rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.35rem;
  background: rgba(42, 32, 25, 0.05);
  box-shadow: inset 0 0 0 1px var(--hair);
  margin-bottom: auto;
}
.cell.dark .cell-icon { background: rgba(253, 251, 247, 0.06); box-shadow: inset 0 0 0 1px var(--hair-light); }
.cell-icon + h3 { margin-top: 2rem; }

.code-tabs { display: flex; gap: 0.25rem; padding: 0.3rem; border-radius: 999px; background: rgba(253, 251, 247, 0.06); width: max-content; margin-top: 1.75rem; box-shadow: inset 0 0 0 1px var(--hair-light); }
.code-tab { padding: 0.4rem 1rem; border-radius: 999px; font-size: 0.82rem; color: rgba(253, 251, 247, 0.6); transition: background-color 500ms var(--ease), color 500ms var(--ease); }
.code-tab[aria-selected="true"] { background: rgba(253, 251, 247, 0.12); color: var(--cream); }
.code-panes { margin-top: 1.25rem; flex: 1; position: relative; min-height: 13rem; }
.code-pane {
  position: absolute;
  inset: 0;
  margin: 0;
  padding: 1.25rem 1.35rem;
  border-radius: 1.1rem;
  background: rgba(0, 0, 0, 0.22);
  box-shadow: inset 0 0 0 1px var(--hair-light);
  font-family: var(--font-mono);
  font-size: 0.82rem;
  line-height: 1.75;
  color: #efe6d6;
  overflow: auto;
  white-space: pre;
  opacity: 0;
  transform: translate3d(0, 0.75rem, 0);
  transition: opacity 600ms var(--ease), transform 700ms var(--ease);
  pointer-events: none;
}
.code-pane.is-active { opacity: 1; transform: none; pointer-events: auto; }
.code-pane .c { color: rgba(239, 230, 214, 0.42); }
.code-pane .s { color: #c9d7b8; }
.code-pane .k { color: #e7b48f; }
.code-result { display: flex; align-items: center; gap: 0.6rem; margin-top: 1.25rem; font-size: 0.85rem; color: rgba(253, 251, 247, 0.7); }
.code-result .dot { width: 0.5rem; height: 0.5rem; border-radius: 50%; background: var(--wechat); box-shadow: 0 0 0 4px rgba(7, 193, 96, 0.15); }

.md-preview { margin-top: 1.5rem; padding: 1.1rem 1.25rem; border-radius: 1rem; background: var(--cream); box-shadow: inset 0 0 0 1px var(--hair); font-size: 0.86rem; line-height: 1.7; }
.md-preview strong { font-family: var(--font-display); font-size: 1rem; }
.md-preview code { font-family: var(--font-mono); font-size: 0.78rem; background: var(--paper-2); padding: 0.1rem 0.4rem; border-radius: 0.35rem; }
.md-preview ul { margin: 0.4rem 0 0; padding-left: 1.1rem; color: var(--ink-soft); }

.compat-url { margin-top: 1.5rem; display: grid; gap: 0.5rem; font-family: var(--font-mono); font-size: 0.78rem; }
.compat-url span { display: block; padding: 0.6rem 0.85rem; border-radius: 0.8rem; background: var(--cream); box-shadow: inset 0 0 0 1px var(--hair); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.compat-url span:first-child { color: var(--muted); text-decoration: line-through; text-decoration-color: rgba(122, 111, 98, 0.5); }
.compat-url span:last-child { color: var(--ink); background: var(--sage-tint); }

.cell-e .core { flex-direction: row; gap: 2rem; padding: 0; }
.cell-e .e-text { padding: clamp(1.5rem, 2.4vw, 2.25rem); display: flex; flex-direction: column; flex: 1 1 52%; }
.cell-e .e-img { flex: 1 1 48%; overflow: hidden; position: relative; }
.cell-e .e-img img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.5) sepia(0.3) contrast(1.1); transition: transform 1200ms var(--ease); }
.cell-e:hover .e-img img { transform: scale(1.05); }
.limit-row { display: flex; gap: 0.5rem; flex-wrap: wrap; margin-top: 1.25rem; }
.limit-chip { font-size: 0.78rem; padding: 0.35rem 0.75rem; border-radius: 999px; background: var(--cream); box-shadow: inset 0 0 0 1px var(--hair); color: var(--ink-soft); }

/* Scrubbing manifesto */
.manifesto { text-align: center; }
.manifesto-text {
  font-family: var(--font-display);
  font-weight: 600;
  font-size: clamp(1.8rem, 3.6vw, 3.4rem);
  line-height: 1.45;
  max-width: 26ch;
  margin: 2rem auto 0;
}
.js .manifesto-text .w { opacity: 0.12; }
.manifesto-text .w { transition: none; }

/* Card stacking */
.stack-section { background: var(--espresso); color: var(--cream); border-radius: clamp(2rem, 4vw, 3.5rem); width: calc(min(100%, var(--max)) - 2 * var(--gutter)); margin-inline: auto; overflow: hidden; position: relative; }
.stack-section::before {
  content: "";
  position: absolute;
  inset: auto -20% -40% auto;
  width: 70vw;
  height: 70vw;
  background: radial-gradient(closest-side, rgba(140, 155, 132, 0.18), rgba(140, 155, 132, 0) 70%);
  pointer-events: none;
}
.stack-section .wrap, .cta .wrap { padding: 0 clamp(1.5rem, 4vw, 4.5rem); }
.stack-pin { min-height: 100dvh; display: flex; align-items: center; padding: clamp(6rem, 10vw, 8rem) 0; }
.stack-grid { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2rem, 6vw, 6rem); align-items: center; width: 100%; }
.stack-cards { position: relative; height: clamp(24rem, 52vh, 30rem); }
.stack-card { position: absolute; inset: 0; will-change: transform; }
.stack-card .core { padding: clamp(1.75rem, 3vw, 2.75rem); display: flex; flex-direction: column; }
.stack-card h3 { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.6rem, 2.6vw, 2.4rem); line-height: 1.2; margin: 0; }
.stack-card p { color: rgba(253, 251, 247, 0.66); margin: 1rem 0 0; max-width: 32rem; }
.stack-card .stack-visual { margin-top: auto; padding-top: 1.5rem; }
.stack-card:nth-child(2) .core { background: #3f3127; }
.stack-card:nth-child(3) .core { background: #47382d; }
.stack-card:nth-child(4) .core { background: #504034; }
.stack-kicker { font-size: 0.8rem; letter-spacing: 0.14em; color: var(--sage); text-transform: uppercase; margin-bottom: 1.25rem; display: flex; align-items: center; gap: 0.6rem; }
.stack-kicker i { font-size: 1.15rem; }
.kv { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; font-family: var(--font-mono); font-size: 0.85rem; }
.kv span { padding: 0.55rem 0.9rem; border-radius: 0.8rem; background: rgba(0, 0, 0, 0.2); box-shadow: inset 0 0 0 1px var(--hair-light); color: #efe6d6; }
.qr-mock { width: 5.5rem; height: 5.5rem; border-radius: 1rem; background:
  conic-gradient(from 90deg at 30% 30%, var(--cream) 0 25%, transparent 0) 0 0 / 1.1rem 1.1rem,
  rgba(253, 251, 247, 0.12); box-shadow: inset 0 0 0 1px var(--hair-light); opacity: 0.85; }

/* Scenario carousel */
.scenes { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(2.5rem, 7vw, 7rem); align-items: center; }
.scene-stack { position: relative; height: clamp(22rem, 40vw, 34rem); }
.scene-photo {
  position: absolute;
  width: 68%;
  aspect-ratio: 7 / 9;
  transition: transform 1100ms var(--ease), opacity 900ms var(--ease);
  will-change: transform;
}
.scene-photo .core img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.55) sepia(0.3) contrast(1.08); transition: transform 1400ms var(--ease); }
.scene-photo:hover .core img { transform: scale(1.05); }
.scene-photo[data-pos="0"] { transform: translate3d(0, 0, 0) rotate(-3deg); z-index: 3; }
.scene-photo[data-pos="1"] { transform: translate3d(28%, 6%, 0) rotate(2deg) scale(0.92); z-index: 2; opacity: 0.9; }
.scene-photo[data-pos="2"] { transform: translate3d(48%, 12%, 0) rotate(5deg) scale(0.84); z-index: 1; opacity: 0.6; }
.scene-quotes { position: relative; min-height: 18rem; }
.scene-quote { position: absolute; inset: 0; opacity: 0; transform: translate3d(0, 1.5rem, 0); transition: opacity 800ms var(--ease), transform 900ms var(--ease); pointer-events: none; }
.scene-quote.is-active { opacity: 1; transform: none; pointer-events: auto; position: relative; }
.scene-quote blockquote { margin: 0; font-family: var(--font-display); font-weight: 600; font-size: clamp(1.6rem, 2.8vw, 2.6rem); line-height: 1.35; }
.scene-quote figcaption { margin-top: 1.75rem; color: var(--muted); font-size: 0.95rem; display: flex; align-items: center; gap: 0.75rem; }
.scene-quote figcaption::before { content: ""; width: 2rem; height: 1px; background: var(--hair-strong); }
.scene-nav { display: flex; align-items: center; gap: 0.6rem; margin-top: 2.5rem; }
.round-btn {
  width: 3rem;
  height: 3rem;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 1.1rem;
  background: rgba(42, 32, 25, 0.04);
  box-shadow: inset 0 0 0 1px var(--hair-strong);
  transition: background-color 500ms var(--ease), transform 500ms var(--ease);
}
.round-btn:hover { background: rgba(42, 32, 25, 0.08); }
.round-btn:active { transform: scale(0.95); }
.scene-count { margin-left: 0.75rem; font-size: 0.85rem; color: var(--muted); font-variant-numeric: tabular-nums; }

/* API docs */
.docs-grid { display: grid; grid-template-columns: minmax(0, 4fr) minmax(0, 8fr); gap: clamp(2rem, 5vw, 5rem); align-items: start; }
.docs-card .core { padding: clamp(1.5rem, 3vw, 2.5rem); }
.endpoint { display: flex; align-items: center; gap: 0.75rem; flex-wrap: wrap; font-family: var(--font-mono); font-size: 0.9rem; padding: 1rem 1.15rem; border-radius: 1rem; background: var(--cream); box-shadow: inset 0 0 0 1px var(--hair); word-break: break-all; }
.method { font-size: 0.72rem; font-weight: 600; letter-spacing: 0.08em; padding: 0.2rem 0.55rem; border-radius: 0.45rem; background: var(--sage-tint); color: var(--sage-deep); }
.docs-card h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.2rem; margin: 2.25rem 0 1rem; }
.param-table { width: 100%; border-collapse: collapse; font-size: 0.92rem; }
.param-table th { text-align: left; font-weight: 500; color: var(--muted); font-size: 0.8rem; letter-spacing: 0.06em; padding: 0 0.75rem 0.75rem 0; }
.param-table td { padding: 0.85rem 0.75rem 0.85rem 0; border-top: 1px solid rgba(42, 32, 25, 0.07); vertical-align: top; color: var(--ink-soft); }
.param-table td:first-child { font-family: var(--font-mono); color: var(--ink); white-space: nowrap; }
.tag-req { font-size: 0.72rem; padding: 0.1rem 0.45rem; border-radius: 0.4rem; background: rgba(184, 114, 76, 0.12); color: var(--clay); margin-left: 0.35rem; font-family: var(--font-body); }
.code-block { margin: 0; padding: 1.15rem 1.25rem; border-radius: 1rem; background: var(--espresso); color: #efe6d6; font-family: var(--font-mono); font-size: 0.82rem; line-height: 1.75; overflow-x: auto; white-space: pre; }
.err-list { display: grid; grid-template-columns: max-content 1fr; gap: 0.5rem 1.25rem; font-size: 0.9rem; color: var(--ink-soft); margin: 0; }
.err-list dt { font-family: var(--font-mono); color: var(--ink); }
.err-list dd { margin: 0; }

/* Final CTA */
.cta { position: relative; border-radius: clamp(2rem, 4vw, 3.5rem); width: calc(min(100%, var(--max)) - 2 * var(--gutter)); margin-inline: auto; overflow: hidden; background: var(--espresso); color: var(--cream); }
.cta-bg { position: absolute; inset: 0; }
.cta-bg img { width: 100%; height: 100%; object-fit: cover; filter: grayscale(0.7) sepia(0.35) contrast(1.15) brightness(0.55); opacity: 0.6; }
.cta-bg::after { content: ""; position: absolute; inset: 0; background: radial-gradient(ellipse at center, rgba(42, 32, 25, 0.35), rgba(42, 32, 25, 0.92) 75%); }
.cta-inner { position: relative; text-align: center; padding: clamp(7rem, 14vw, 12rem) 0; }
.cta-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.4rem, 5.6vw, 5.4rem); line-height: 1.12; margin: 0 auto; max-width: 16ch; }
.cta-actions { display: flex; justify-content: center; flex-wrap: wrap; gap: 0.85rem; margin-top: 3rem; }

/* Footer */
.footer { padding: clamp(5rem, 8vw, 7rem) 0 2.5rem; }
.footer-grid { display: grid; grid-template-columns: minmax(0, 1.4fr) repeat(2, minmax(0, 0.6fr)); gap: 3rem; }
.footer-brand p { color: var(--muted); margin: 1rem 0 0; max-width: 24rem; font-size: 0.92rem; }
.footer h4 { font-size: 0.8rem; font-weight: 500; letter-spacing: 0.12em; color: var(--muted); margin: 0 0 1rem; }
.footer ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.6rem; }
.footer ul a { color: var(--ink-soft); font-size: 0.95rem; transition: color 400ms var(--ease); }
.footer ul a:hover { color: var(--ink); }
.footer-base { display: flex; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-top: 4.5rem; padding-top: 1.75rem; border-top: 1px solid rgba(42, 32, 25, 0.08); color: var(--muted); font-size: 0.85rem; }
.footer-base a:hover { color: var(--ink); }

/* Login modal */
.modal {
  position: fixed;
  inset: 0;
  z-index: var(--z-modal);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  background: rgba(42, 32, 25, 0.38);
  -webkit-backdrop-filter: blur(24px);
  backdrop-filter: blur(24px);
  opacity: 0;
  visibility: hidden;
  transition: opacity 600ms var(--ease), visibility 0s 600ms;
}
.modal.is-open { opacity: 1; visibility: visible; transition: opacity 600ms var(--ease), visibility 0s; }
.modal-card { width: min(26rem, 100%); transform: translate3d(0, 2rem, 0) scale(0.97); transition: transform 800ms var(--ease); box-shadow: var(--shadow-float); }
.modal.is-open .modal-card { transform: none; }
.modal-card .core { padding: 2rem; text-align: center; background: var(--cream); }
.modal-close { position: absolute; top: 1rem; right: 1rem; }
.modal-close.round-btn { width: 2.4rem; height: 2.4rem; }
.modal h3 { font-family: var(--font-display); font-weight: 600; font-size: 1.6rem; margin: 0.5rem 0 0; }
.modal p { color: var(--ink-soft); font-size: 0.92rem; margin: 0.6rem 0 0; }
.qr-frame { width: 13.5rem; height: 13.5rem; margin: 1.75rem auto 0; padding: 0.375rem; border-radius: 1.5rem; background: rgba(42, 32, 25, 0.04); box-shadow: inset 0 0 0 1px var(--hair); }
.qr-inner { width: 100%; height: 100%; border-radius: calc(1.5rem - 0.375rem); background: #fff; display: flex; align-items: center; justify-content: center; overflow: hidden; position: relative; }
.qr-inner img { width: 92%; height: 92%; object-fit: contain; }
.qr-inner .qr-mask { position: absolute; inset: 0; background: rgba(253, 251, 247, 0.92); display: none; flex-direction: column; align-items: center; justify-content: center; gap: 0.75rem; font-size: 0.9rem; color: var(--ink-soft); padding: 1rem; }
.qr-inner.is-masked .qr-mask { display: flex; }
.spinner { width: 1.6rem; height: 1.6rem; border-radius: 50%; border: 1.5px solid var(--hair-strong); border-top-color: var(--ink); animation: spin 900ms cubic-bezier(0.5, 0.1, 0.5, 0.9) infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.modal-status { margin-top: 1.25rem; font-size: 0.88rem; color: var(--muted); min-height: 1.5rem; }
.modal-status.ok { color: var(--sage-deep); }
.modal-status.err { color: var(--clay); }

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 2rem;
  z-index: var(--z-modal);
  transform: translate3d(-50%, 1.5rem, 0);
  opacity: 0;
  padding: 0.75rem 1.25rem;
  border-radius: 999px;
  background: var(--espresso);
  color: var(--cream);
  font-size: 0.9rem;
  box-shadow: var(--shadow-float);
  transition: opacity 500ms var(--ease), transform 600ms var(--ease);
  pointer-events: none;
}
.toast.is-on { opacity: 1; transform: translate3d(-50%, 0, 0); }

/* Dashboard */
.dash { padding: clamp(8rem, 12vw, 10rem) 0 clamp(6rem, 10vw, 8rem); }
.dash-head { display: flex; justify-content: space-between; align-items: end; gap: 2rem; flex-wrap: wrap; }
.dash-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(2.2rem, 4.4vw, 3.8rem); line-height: 1.1; margin: 1rem 0 0; }
.dash-grid { display: grid; grid-template-columns: repeat(12, minmax(0, 1fr)); grid-auto-flow: dense; gap: 1.25rem; margin-top: clamp(2.5rem, 5vw, 4rem); }
.dash-key { grid-column: span 7; }
.dash-test { grid-column: span 5; grid-row: span 2; }
.dash-tips { grid-column: span 7; }
.dash-history { grid-column: span 12; }
.dash-card .core { padding: clamp(1.5rem, 2.6vw, 2.25rem); }
.dash-card h2 { font-family: var(--font-display); font-weight: 600; font-size: 1.35rem; margin: 0; display: flex; align-items: center; gap: 0.6rem; }
.dash-card h2 i { font-size: 1.25rem; color: var(--sage-deep); }
.dash-card .hint { color: var(--muted); font-size: 0.88rem; margin: 0.4rem 0 0; }
.key-box { display: flex; align-items: center; gap: 0.5rem; margin-top: 1.5rem; padding: 0.4rem 0.4rem 0.4rem 1.15rem; border-radius: 1.1rem; background: var(--cream); box-shadow: inset 0 0 0 1px var(--hair-strong); }
.key-box code { flex: 1; min-width: 0; font-family: var(--font-mono); font-size: 0.95rem; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: 0.02em; }
.icon-btn { width: 2.5rem; height: 2.5rem; border-radius: 0.8rem; display: inline-flex; align-items: center; justify-content: center; font-size: 1.1rem; color: var(--ink-soft); transition: background-color 500ms var(--ease), color 500ms var(--ease), transform 500ms var(--ease); flex-shrink: 0; }
.icon-btn:hover { background: rgba(42, 32, 25, 0.06); color: var(--ink); }
.icon-btn:active { transform: scale(0.94); }
.url-box { margin-top: 0.75rem; }
.url-box code { font-size: 0.82rem; color: var(--ink-soft); }
.key-actions { display: flex; gap: 0.6rem; flex-wrap: wrap; margin-top: 1.5rem; }
.btn-danger.is-armed { background: var(--clay); color: var(--cream); box-shadow: none; }

.field { display: block; margin-top: 1.1rem; }
.field span { display: block; font-size: 0.82rem; color: var(--muted); margin-bottom: 0.45rem; }
.field input,
.field textarea {
  width: 100%;
  padding: 0.85rem 1rem;
  border-radius: 1rem;
  border: 0;
  background: var(--cream);
  box-shadow: inset 0 0 0 1px var(--hair-strong);
  outline: none;
  transition: box-shadow 500ms var(--ease), background-color 500ms var(--ease);
  font-size: 0.95rem;
}
.field textarea { min-height: 10rem; resize: vertical; font-family: var(--font-mono); font-size: 0.86rem; line-height: 1.65; }
.field input:focus,
.field textarea:focus { box-shadow: inset 0 0 0 1.5px var(--sage-deep); background: #fff; }
.form-foot { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-top: 1.25rem; flex-wrap: wrap; }
.form-msg { font-size: 0.86rem; color: var(--muted); }
.form-msg.ok { color: var(--sage-deep); }
.form-msg.err { color: var(--clay); }

.tips-list { list-style: none; margin: 1.25rem 0 0; padding: 0; display: grid; gap: 0.85rem; }
.tips-list li { display: flex; gap: 0.75rem; font-size: 0.92rem; color: var(--ink-soft); }
.tips-list i { color: var(--sage-deep); font-size: 1.15rem; margin-top: 0.2rem; flex-shrink: 0; }
.tips-list code { font-family: var(--font-mono); font-size: 0.82rem; background: var(--paper-2); padding: 0.05rem 0.4rem; border-radius: 0.35rem; }

.history { list-style: none; margin: 1.5rem 0 0; padding: 0; }
.history li { border-top: 1px solid rgba(42, 32, 25, 0.07); }
.history a { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 1.25rem; padding: 1rem 0.25rem; transition: background-color 500ms var(--ease), padding 0s; border-radius: 0.75rem; }
.history a:hover { background: rgba(42, 32, 25, 0.03); }
.history .h-title { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 500; }
.history .h-time { color: var(--muted); font-size: 0.85rem; font-variant-numeric: tabular-nums; }
.status { font-size: 0.75rem; padding: 0.2rem 0.6rem; border-radius: 999px; white-space: nowrap; }
.status-sent { background: var(--sage-tint); color: var(--sage-deep); }
.status-failed { background: rgba(184, 114, 76, 0.12); color: var(--clay); }
.status-pending { background: var(--paper-2); color: var(--muted); }
.history-empty { margin-top: 1.5rem; padding: 2.5rem 1rem; text-align: center; color: var(--muted); border-radius: 1.25rem; background: var(--cream); box-shadow: inset 0 0 0 1px var(--hair); }
.notice-bar { margin-top: 2rem; padding: 1rem 1.25rem; border-radius: 1.1rem; background: rgba(184, 114, 76, 0.1); color: var(--clay); font-size: 0.9rem; display: flex; gap: 0.6rem; align-items: flex-start; }

/* Message detail (opened inside WeChat) */
.msg-page { min-height: 100dvh; padding: clamp(2.5rem, 7vw, 5rem) 0 4rem; }
.msg-wrap { max-width: 46rem; margin: 0 auto; padding: 0 1.25rem; }
.msg-meta { display: flex; align-items: center; gap: 0.6rem; color: var(--muted); font-size: 0.86rem; }
.msg-meta .brand-mark { width: 1.5rem; height: 1.5rem; font-size: 0.85rem; border-radius: 0.5rem; }
.msg-title { font-family: var(--font-display); font-weight: 600; font-size: clamp(1.75rem, 5vw, 2.6rem); line-height: 1.25; margin: 1.25rem 0 0; word-break: break-word; }
.msg-card { margin-top: 2rem; }
.msg-card .core { padding: clamp(1.25rem, 4vw, 2.25rem); background: #fffdf9; }
.prose { font-size: 1.02rem; line-height: 1.85; color: var(--ink); word-break: break-word; overflow-wrap: anywhere; }
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }
.prose h1, .prose h2, .prose h3, .prose h4 { font-family: var(--font-display); font-weight: 600; line-height: 1.35; margin: 1.8em 0 0.6em; }
.prose h1 { font-size: 1.6rem; }
.prose h2 { font-size: 1.35rem; }
.prose h3 { font-size: 1.15rem; }
.prose p { margin: 0.9em 0; }
.prose a { color: var(--sage-deep); text-decoration: underline; text-underline-offset: 3px; text-decoration-color: rgba(93, 108, 87, 0.4); }
.prose code { font-family: var(--font-mono); font-size: 0.86em; background: var(--paper-2); padding: 0.12em 0.4em; border-radius: 0.35rem; }
.prose pre { background: var(--espresso); color: #efe6d6; padding: 1rem 1.15rem; border-radius: 1rem; overflow-x: auto; font-size: 0.85rem; line-height: 1.7; }
.prose pre code { background: none; padding: 0; color: inherit; font-size: inherit; }
.prose blockquote { margin: 1.2em 0; padding: 0.2em 0 0.2em 1.1em; border-left: 2px solid var(--sage); color: var(--ink-soft); }
.prose ul, .prose ol { padding-left: 1.4em; }
.prose li + li { margin-top: 0.3em; }
.prose img { border-radius: 1rem; margin: 1em 0; }
.prose hr { border: 0; height: 1px; background: rgba(42, 32, 25, 0.1); margin: 2em 0; }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.92rem; display: block; overflow-x: auto; }
.prose th, .prose td { padding: 0.55rem 0.75rem; border-bottom: 1px solid rgba(42, 32, 25, 0.08); text-align: left; }
.prose th { font-weight: 600; background: var(--paper); }
.msg-empty { color: var(--muted); }
.msg-foot { margin-top: 2.5rem; text-align: center; color: var(--muted); font-size: 0.82rem; }
.msg-foot a { color: var(--ink-soft); }

/* Responsive collapse */
@media (max-width: 1080px) {
  .notify { left: -6%; }
  .cell-e .core { flex-direction: column; gap: 0; }
  .cell-e .e-img { min-height: 12rem; }
}

@media (max-width: 860px) {
  .nav-links { display: none; }
  .burger { display: inline-block; }
}

@media (max-width: 767px) {
  :root { --gutter: 1rem; }
  .section { padding: 6rem 0; }
  .hero { padding-top: 7.5rem; min-height: auto; }
  .hero-grid,
  .bento-head,
  .stack-grid,
  .scenes,
  .docs-grid,
  .footer-grid { grid-template-columns: minmax(0, 1fr); }
  .bento-head .lede { justify-self: start; }
  .hero-title { font-size: clamp(2.3rem, 10.5vw, 3rem); }
  .hero-visual { padding-bottom: 0; }
  .notify { position: relative; left: auto; bottom: auto; width: 100%; margin-top: -4rem; }
  .bento, .dash-grid { grid-template-columns: minmax(0, 1fr); gap: 1.5rem; }
  .bento > *, .dash-grid > * { grid-column: span 1; grid-row: auto; }
  .stack-pin { min-height: auto; }
  .stack-cards { height: auto; display: grid; gap: 1.25rem; }
  .stack-card { position: relative; inset: auto; }
  .stack-card .core { min-height: 18rem; }
  .scene-stack { height: 24rem; }
  .scene-photo[data-pos="0"] { transform: none; }
  .scene-photo[data-pos="1"] { transform: translate3d(22%, 4%, 0) scale(0.92); }
  .scene-photo[data-pos="2"] { transform: translate3d(38%, 8%, 0) scale(0.84); }
  .history a { grid-template-columns: minmax(0, 1fr) auto; }
  .history .h-time { grid-column: 1; grid-row: 2; margin-top: -0.6rem; }
  .history .status { grid-column: 2; grid-row: 1 / span 2; }
  .param-table td:first-child { white-space: normal; word-break: break-all; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 1ms !important; animation-duration: 1ms !important; }
  .js [data-reveal] { opacity: 1; transform: none; filter: none; }
  .js .manifesto-text .w { opacity: 1; }
}
