/* ============================================================
   zhengxiangsheng.com — the Record
   Extends the existing editorial system; cobalt replaces rust.
   ============================================================ */

:root {
  --accent: #1f3a93;
  --accent-soft: rgba(31, 58, 147, 0.12);
}

[data-theme="dark"] {
  --accent: #8fa6ff;
  --accent-soft: rgba(143, 166, 255, 0.14);
}

body.menu-open {
  overflow: hidden;
}

/* ---------- header tools / mobile menu ---------- */
.header-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-left: 10px;
}

.menu-toggle {
  display: none;
  align-items: center;
  gap: 8px;
  min-height: 36px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  cursor: pointer;
}
.menu-toggle__close {
  display: none;
}
body.menu-open .menu-toggle__open {
  display: none;
}
body.menu-open .menu-toggle__close {
  display: inline;
}

.mobile-nav {
  position: fixed;
  inset: 60px 0 0;
  z-index: 18;
  display: none;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px max(20px, 5vw) 32px;
  background: var(--bg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-6px);
  transition: opacity 0.3s ease, transform 0.3s ease, visibility 0.3s;
}
.mobile-nav.is-open {
  opacity: 1;
  visibility: visible;
  transform: none;
}
.mobile-nav nav {
  display: flex;
  flex-direction: column;
  border-top: 1px solid var(--line);
}
.mobile-nav nav a {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 18px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(2rem, 8vw, 2.7rem);
  line-height: 1;
  letter-spacing: -0.02em;
}
.mobile-nav nav a em {
  font-family: "Inter", system-ui, sans-serif;
  font-style: normal;
  font-size: 0.65rem;
  letter-spacing: 0.16em;
  color: var(--muted);
}
.mobile-nav__foot {
  display: flex;
  flex-wrap: wrap;
  gap: 14px 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.78rem;
  color: var(--muted);
}
.mobile-nav__foot a {
  border-bottom: 1px solid var(--line);
  padding-bottom: 2px;
}

/* ---------- hero ---------- */
.hero {
  padding-block: clamp(58px, 8vw, 96px) clamp(48px, 6vw, 76px);
}
.hero-name {
  margin-top: 20px !important;
  max-width: none !important;
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(3rem, 7.4vw, 6.3rem) !important;
  line-height: 0.94 !important;
  letter-spacing: -0.035em;
  font-weight: 300;
}
.hero-cn {
  display: block;
  margin-top: 16px;
  font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: clamp(1rem, 1.5vw, 1.25rem);
  font-weight: 400;
  letter-spacing: 0.22em;
  color: var(--muted);
  line-height: 1;
}
.hero-role {
  margin-top: 24px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-statement {
  max-width: 16ch;
  margin-top: 30px;
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(1.7rem, 3vw, 2.55rem);
  font-weight: 300;
  line-height: 1.06;
  letter-spacing: -0.025em;
}
.hero-statement em {
  color: var(--accent);
  font-style: italic;
}
.hero-facts {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 18px;
  margin: 40px 0 0;
  padding-top: 20px;
  border-top: 1px solid var(--line);
}
.hero-facts dt {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.64rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
}
.hero-facts dd {
  margin: 6px 0 0;
  font-size: 0.88rem;
  line-height: 1.4;
  color: var(--ink);
}

/* ---------- record ---------- */
.record-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: clamp(26px, 4vw, 54px);
}
.record-grid--lower {
  margin-top: 36px;
  padding-top: 30px;
  border-top: 1px solid var(--line);
}
.record-block {
  min-width: 0;
}
.record-block h3 {
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.68rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--accent);
}
.record-row {
  display: grid;
  grid-template-columns: 78px minmax(0, 1fr);
  gap: 16px;
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.record-date {
  padding-top: 2px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.66rem;
  letter-spacing: 0.08em;
  color: var(--muted);
  white-space: nowrap;
}
.record-row strong {
  display: block;
  font-family: "Newsreader", Georgia, serif;
  font-size: 1.08rem;
  font-weight: 500;
  line-height: 1.25;
  letter-spacing: -0.01em;
}
.record-row span {
  display: block;
  margin-top: 4px;
  font-size: 0.82rem;
  line-height: 1.45;
  color: var(--muted);
}
.record-row em {
  display: block;
  margin-top: 6px;
  font-style: normal;
  font-size: 0.8rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.record-row em a,
.record-note a {
  color: var(--accent);
  border-bottom: 1px solid var(--accent-soft);
  transition: border-color 0.2s ease, color 0.2s ease;
}
.record-row em a:hover,
.record-note a:hover {
  color: var(--accent);
  border-color: var(--accent);
}
.record-note {
  margin-top: 14px;
  font-size: 0.78rem;
  line-height: 1.55;
  color: var(--muted);
}
.record-skills {
  margin: 0;
}
.record-skills > div {
  display: grid;
  grid-template-columns: 90px minmax(0, 1fr);
  gap: 14px;
  padding: 10px 0;
  border-bottom: 1px solid var(--line);
}
.record-skills dt {
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.64rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 3px;
}
.record-skills dd {
  margin: 0;
  font-size: 0.85rem;
  line-height: 1.5;
  color: var(--ink-soft);
}
.record-skills a {
  border-bottom: 1px solid var(--line);
}

/* ---------- record-style 404 ---------- */
.error-page main {
  width: min(1120px, 100% - 2 * clamp(20px, 5vw, 48px));
  min-height: 100svh;
  margin-inline: auto;
  padding: clamp(70px, 12vh, 130px) 0 48px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}
.error-page .error-code {
  margin-top: 18px;
  font-family: "Newsreader", Georgia, serif;
  font-size: clamp(5rem, 15vw, 11rem);
  font-weight: 300;
  line-height: 0.76;
  letter-spacing: -0.055em;
  color: transparent;
  -webkit-text-stroke: 1px var(--accent);
  opacity: 0.55;
}
.error-page h1 {
  max-width: 14ch;
  margin-top: 30px;
  font-family: "Newsreader", Georgia, serif;
  font-weight: 300;
  font-size: clamp(2.2rem, 4.7vw, 4rem);
  line-height: 1.02;
  letter-spacing: -0.03em;
}
.error-page .error-copy {
  max-width: 42ch;
  margin-top: 18px;
  font-size: 0.98rem;
  line-height: 1.6;
  color: var(--muted);
}
.error-page .actions {
  margin-top: 28px;
}
.error-page .site-footer {
  padding-block: 0 26px;
}
.error-page .mx-strip {
  margin-bottom: 0;
}

/* ---------- footer ---------- */
.site-footer {
  padding-block: 28px 40px;
}
.site-footer .mx-strip {
  margin-bottom: 18px;
}
.footer-easter {
  margin-top: 7px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.62rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
}

/* ---------- fireworks ---------- */
.fireworks-canvas {
  position: fixed;
  inset: 0;
  z-index: 400;
  width: 100%;
  height: 100%;
  pointer-events: none;
}

@media print {
  .fireworks-canvas {
    display: none !important;
  }
}

/* ---------- 蹦蹦 / bengbeng ---------- */
.bengbeng {
  overflow: clip;
}

.bengbeng__body {
  min-width: 0;
}

.bengbeng__stage {
  position: relative;
  isolation: isolate;
  height: clamp(380px, 48vw, 520px);
  overflow: hidden;
  background:
    radial-gradient(circle at 50% 118%, rgba(31, 58, 147, 0.32), transparent 58%),
    linear-gradient(rgba(246, 244, 239, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(246, 244, 239, 0.035) 1px, transparent 1px),
    #07080b;
  background-size: auto, 44px 44px, 44px 44px, auto;
  border: 1px solid rgba(246, 244, 239, 0.18);
  box-shadow: 0 26px 60px -38px rgba(8, 9, 11, 0.8);
}

.bengbeng__stage::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 2;
  pointer-events: none;
  background: radial-gradient(circle at 50% 45%, transparent 36%, rgba(7, 8, 11, 0.42) 100%);
}

/* 桃花: old paper behind the canvas, a pale moon, a little mist */
.bengbeng__stage::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.7s ease;
  background:
    radial-gradient(circle 33px at 78% 19%, rgba(255, 253, 244, 0.95) 0 93%, rgba(255, 253, 244, 0) 100%),
    radial-gradient(circle 74px at 78% 19%, rgba(255, 250, 232, 0.5), rgba(255, 250, 232, 0) 100%),
    radial-gradient(ellipse at 34% 112%, rgba(112, 126, 122, 0.24), transparent 56%),
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='240' height='240'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.75' numOctaves='3' seed='4'/%3E%3CfeColorMatrix values='0 0 0 0 0.36 0 0 0 0 0.28 0 0 0 0 0.16 0 0 0 0.1 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"),
    radial-gradient(ellipse at 50% 42%, #f4ebd7 0%, #ebe0c7 62%, #dccdab 100%);
}

.bengbeng__stage[data-toy="peach"]::before {
  opacity: 1;
}

.bengbeng__stage[data-toy="peach"]::after {
  background: radial-gradient(circle at 50% 45%, transparent 48%, rgba(110, 86, 52, 0.2) 100%);
}

.bengbeng__stage[data-toy="peach"] .bengbeng__badge,
.bengbeng__stage[data-toy="peach"] .bengbeng__hint {
  color: rgba(52, 40, 30, 0.6);
}

.bengbeng__canvas {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: block;
  width: 100%;
  height: 100%;
  cursor: crosshair;
  touch-action: pan-y;      /* sideways drags lay strings and throw bombs; vertical swipes still scroll the page */
}

.bengbeng__motion {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 5;
  transform: translate(-50%, -50%);
  min-height: 44px;
  padding: 8px 16px;
  border: 1px solid #ffd60a;
  background: rgba(7, 8, 11, 0.88);
  color: #f6f4ef;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.74rem;
  cursor: pointer;
}

.bengbeng__motion[hidden] {
  display: none;
}

.bengbeng__app {
  color: var(--accent);
  text-underline-offset: 0.2em;
}

.bengbeng__clear[aria-pressed="true"] {
  border-color: var(--accent);
  color: var(--accent);
}

.bengbeng__clear b {
  font-weight: 600;
}

.bengbeng__clear i {
  font-style: normal;
}

.bengbeng__badge,
.bengbeng__hint {
  position: absolute;
  z-index: 4;
  pointer-events: none;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.58rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: rgba(246, 244, 239, 0.52);
}

.bengbeng__badge {
  top: 14px;
  right: 16px;
}

.bengbeng__hint {
  bottom: 13px;
  left: 16px;
}

.bengbeng__stage:focus-within {
  border-color: rgba(246, 244, 239, 0.36);
}

.bengbeng__stage.is-shaking {
  animation: bengbeng-shake 0.38s cubic-bezier(0.36, 0.07, 0.19, 0.97);
}

@keyframes bengbeng-shake {
  0%, 100% { transform: translate3d(0, 0, 0); }
  18% { transform: translate3d(-4px, 2px, 0); }
  36% { transform: translate3d(3px, -2px, 0); }
  54% { transform: translate3d(-2px, 1px, 0); }
  72% { transform: translate3d(2px, 0, 0); }
}

.bengbeng__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 14px;
}

.bengbeng__modes,
.bengbeng__actions {
  display: flex;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 7px;
}

.bengbeng__mode {
  display: inline-flex;
  align-items: baseline;
  gap: 7px;
  min-height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.03em;
  white-space: nowrap;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.bengbeng__mode-cn {
  font-size: 0.82rem;
}

.bengbeng__mode-en {
  color: var(--muted);
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.bengbeng__mode:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.bengbeng__mode.is-active {
  border-color: var(--accent);
  background: var(--accent);
  color: #f6f4ef;
}

.bengbeng__mode.is-active .bengbeng__mode-en {
  color: rgba(246, 244, 239, 0.82);
}

[data-theme="dark"] .bengbeng__mode[data-mode="fireworks"].is-active {
  color: #0d1020;
}

[data-theme="dark"] .bengbeng__mode[data-mode="fireworks"].is-active .bengbeng__mode-en {
  color: rgba(13, 16, 32, 0.78);
}

.bengbeng__mode[data-mode="firecracker"].is-active {
  border-color: #b3261e;
  background: #b3261e;
}

.bengbeng__mode[data-mode="bomb"].is-active {
  border-color: #1b1b1b;
  background: #1b1b1b;
}

.bengbeng__mode[data-mode="snow"].is-active {
  border-color: #2f5f8a;
  background: #2f5f8a;
}

.bengbeng__mode[data-mode="peach"].is-active {
  border-color: #963555;
  background: #963555;
}

.bengbeng__ignite,
.bengbeng__clear {
  min-height: 40px;
  padding: 0 15px;
  border: 1px solid var(--ink);
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.7rem;
  letter-spacing: 0.04em;
  cursor: pointer;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.bengbeng__ignite {
  background: var(--ink);
  color: var(--bg);
}

.bengbeng__ignite span,
.bengbeng__clear span {
  margin-left: 4px;
  font-size: 0.58rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  opacity: 0.65;
}

.bengbeng__clear {
  background: transparent;
  color: var(--ink);
}

.bengbeng__ignite:hover {
  background: var(--accent);
  border-color: var(--accent);
}

.bengbeng__clear:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.bengbeng__mode:focus-visible,
.bengbeng__ignite:focus-visible,
.bengbeng__clear:focus-visible,
.bengbeng__canvas:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

.bengbeng__status {
  margin-top: 10px;
  font-family: "Inter", system-ui, sans-serif;
  font-size: 0.64rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
}

@media (max-width: 620px) {
  .bengbeng__stage {
    height: 340px;
  }

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

  .bengbeng__modes,
  .bengbeng__actions {
    width: 100%;
  }

  .bengbeng__mode {
    flex: 1 1 0;
    align-items: center;
    justify-content: center;
    padding-inline: 9px;
    font-size: 0.8rem;
  }

  .bengbeng__clear i {
    display: none;          /* "声音 off" fits on one line */
  }

  .bengbeng__mode-en {
    display: none;
  }

  .bengbeng__ignite,
  .bengbeng__clear {
    flex: 1 1 0;
  }
}

@media (prefers-reduced-motion: reduce) {
  .bengbeng__stage::before {
    transition: none;
  }

  .bengbeng__stage.is-shaking {
    animation: none;
  }
}

@media print {
  .bengbeng {
    display: none !important;
  }
}

[data-theme="dark"] .mx-strip--light {
  --mx-fg: #eae8e3;
  --mx-muted: #99a0a8;
  --mx-hair: rgba(234, 232, 227, 0.16);
  --mx-hair-strong: rgba(234, 232, 227, 0.3);
}
[data-theme="dark"] .mx-strip--light a {
  color: #c9c6bf;
}
[data-theme="dark"] .mx-strip--light a:hover,
[data-theme="dark"] .mx-strip--light a.is-current {
  color: #eae8e3;
}
[data-theme="dark"] .mx-strip--light i {
  background: #ff6a3d;
}
[data-theme="dark"] .mx-strip--light a[data-site="lab"] i {
  background: #7fdcf2;
}
[data-theme="dark"] .mx-strip--light a[data-site="record"] i {
  background: #8fa6ff;
}

/* ---------- print ---------- */
@media print {
  @page {
    size: A4;
    margin: 18mm;
  }
  .site-header,
  .mobile-nav,
  .site-footer,
  .mx-dock,
  .theme-toggle,
  .menu-toggle {
    display: none !important;
  }
  body {
    background: #fff !important;
    color: #000 !important;
    font-size: 10.5pt;
  }
  .hero {
    padding-top: 0;
  }
  .hero-name {
    font-size: 26pt !important;
  }
  .section {
    grid-template-columns: 120px minmax(0, 1fr);
    break-inside: avoid;
  }
  .reveal {
    opacity: 1 !important;
    transform: none !important;
  }
  .paper,
  .card {
    background: #fff;
  }
}

/* ---------- responsive ---------- */
@media (max-width: 900px) {
  .site-nav {
    display: none;
  }
  .menu-toggle {
    display: inline-flex;
  }
  .header-tools {
    margin-left: auto;
  }
  .mobile-nav {
    display: flex;
  }
  .hero-facts {
    grid-template-columns: 1fr 1fr;
  }
  .record-grid,
  .record-grid--lower {
    grid-template-columns: 1fr;
  }
  .record-grid--lower {
    margin-top: 26px;
  }
}

@media (min-width: 761px) and (max-width: 900px) {
  .mobile-nav {
    top: 68px;
  }
}

@media (max-width: 760px) {
  .site-nav {
    display: none;
  }
  .menu-toggle {
    display: inline-flex;
  }
  .header-tools {
    margin-left: auto;
  }
  .mobile-nav {
    display: flex;
  }
  .hero-name {
    font-size: clamp(2.7rem, 13vw, 4.4rem) !important;
  }
  .hero-cn {
    margin-top: 12px;
    font-size: 1rem;
  }
  .hero-facts {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .hero-statement {
    margin-top: 24px;
  }
  .record-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
  .record-date {
    padding-top: 0;
  }
  .record-skills > div {
    grid-template-columns: 1fr;
    gap: 4px;
  }
}

@media (max-width: 420px) {
  .wordmark {
    font-size: 1rem;
  }
  .wordmark .zh {
    display: none;
  }
}
