:root {
  --bg-canvas: #06070a;
  --bg-surface: #0b0d12;
  --bg-elevated: #111520;
  --bg-subtle: #0e121b;
  --bg-glass: rgba(11, 13, 18, 0.78);

  /* Compatibility tokens for subpages & dynamic scripts */
  --paper: var(--bg-canvas);
  --surface: var(--bg-surface);
  --ink: #f4f6fb;
  --muted: #98a2b3;
  --text-primary: var(--ink);
  --text-secondary: var(--muted);
  --text-muted: #8691a6;

  --hairline: rgba(255, 255, 255, 0.09);
  --hairline-strong: rgba(255, 255, 255, 0.18);
  --top-rim: rgba(255, 255, 255, 0.22);

  --accent-indigo: #6366f1;
  --accent-cyan: #38bdf8;
  /* Emerald is strictly reserved for live-dot breathing indicator */
  --accent-emerald: #34d399;
  --klein: #818cf8;
  --vermilion: #e5432d;

  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --font-serif: var(--font-sans);
  --font-mono: ui-monospace, "SF Mono", "JetBrains Mono", SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --radius-lg: 16px;
  --radius-md: 12px;
  --radius-sm: 8px;
}

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

html {
  scroll-behavior: smooth;
  background: var(--bg-canvas);
  color: var(--ink);
  overflow-x: hidden;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: var(--bg-canvas);
  background-image:
    radial-gradient(ellipse 68% 42% at 50% -8%, rgba(99, 102, 241, 0.14), transparent 65%),
    radial-gradient(ellipse 42% 32% at 86% 12%, rgba(56, 189, 248, 0.08), transparent 70%);
  color: var(--ink);
  font-family: var(--font-sans);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  line-height: 1.65;
  overflow-x: hidden;
  position: relative;
}

a {
  color: inherit;
  text-decoration: none;
}

img, video, svg {
  max-width: 100%;
}

/* Atmospheric layers */
.ambient-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(ellipse 65% 42% at 22% -4%, rgba(99, 102, 241, 0.16), transparent 65%),
    radial-gradient(ellipse 50% 38% at 82% 16%, rgba(56, 189, 248, 0.10), transparent 70%);
}

.grid-bg {
  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background-image:
    linear-gradient(to right, rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 64px 64px;
  mask-image: radial-gradient(ellipse 88% 70% at 50% 15%, #000 15%, transparent 82%);
  -webkit-mask-image: radial-gradient(ellipse 88% 70% at 50% 15%, #000 15%, transparent 82%);
}

.wrap,
.container {
  position: relative;
  z-index: 1;
  width: 100%;
  max-width: 1120px;
  margin: 0 auto;
  padding: 0 28px;
}

/* Header */
.studio-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(6, 7, 10, 0.82);
  backdrop-filter: blur(18px) saturate(140%);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  border-bottom: 1px solid var(--hairline);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 28px;
}

.studio-wordmark {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: -0.02em;
  color: var(--ink);
  white-space: nowrap;
}

.studio-submark {
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 500;
  color: var(--text-muted);
  padding: 2px 7px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.03);
}

.studio-nav {
  position: relative;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 13.5px;
  color: var(--muted);
}

.studio-nav a {
  position: relative;
  z-index: 1;
  padding: 5px 11px;
  border-radius: 999px;
  white-space: nowrap;
  transition: color 0.16s ease, background-color 0.16s ease;
}

.studio-nav a:hover,
.studio-nav a.active {
  color: var(--ink);
}

.studio-nav a:hover {
  background: rgba(255, 255, 255, 0.05);
}

.studio-nav a.active:not(.has-indicator) {
  background: rgba(99, 102, 241, 0.16);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
}

.nav-indicator {
  position: absolute;
  top: 0;
  left: 0;
  height: 100%;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  pointer-events: none;
  opacity: 0;
  transition: transform 0.25s cubic-bezier(0.16, 1, 0.3, 1), width 0.25s cubic-bezier(0.16, 1, 0.3, 1), opacity 0.18s ease;
  z-index: 0;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.header-cta {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  border-radius: 999px;
  background: linear-gradient(180deg, #ffffff 0%, #dce3ef 100%);
  color: #06070a;
  font-size: 13px;
  font-weight: 650;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 6px 20px rgba(99, 102, 241, 0.18);
  white-space: nowrap;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.header-cta:hover {
  transform: translateY(-1px);
  box-shadow: 0 8px 24px rgba(56, 189, 248, 0.22);
}

.lang-toggle-btn,
.cmdk-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 11px;
  border-radius: 8px;
  border: 1px solid var(--hairline-strong);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.08) 0%, rgba(255, 255, 255, 0.03) 100%);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.14);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
  white-space: nowrap;
}

.lang-toggle-btn:hover,
.cmdk-btn:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.1);
}

[data-lang-toggle]:not(.is-visible) {
  display: none;
}

/* Live Pulse Dot (Emerald strictly here) */
@keyframes livePulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(52, 211, 153, 0.7), 0 0 10px rgba(52, 211, 153, 0.85);
  }
  50% {
    box-shadow: 0 0 0 5px rgba(52, 211, 153, 0), 0 0 14px rgba(52, 211, 153, 0.95);
  }
}

.live-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent-emerald);
  box-shadow: 0 0 10px rgba(52, 211, 153, 0.85);
  display: inline-block;
  flex-shrink: 0;
  animation: livePulse 2.4s ease-in-out infinite;
}

.eyebrow-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.13);
  background: rgba(255, 255, 255, 0.035);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.09);
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--muted);
  max-width: 100%;
}

/* Hero identity text */
.hero-id-text {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  min-width: 0;
}

.hero-name {
  font-size: 19px;
  font-weight: 750;
  color: var(--ink);
  letter-spacing: -0.01em;
}

.hero-name span {
  font-weight: 500;
  color: var(--muted);
}

/* Home Hero */
.home-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(0, 0.95fr);
  gap: 44px;
  align-items: center;
  padding: 52px 0 36px;
}

.home-hero > *,
.telemetry-bar > *,
.product-bento > *,
.collab-grid > *,
.archived-grid > * {
  min-width: 0;
}

.hero-identity {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hero-avatar {
  width: 80px;
  height: 80px;
  border-radius: 18px;
  border: 1px solid var(--hairline-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 10px 28px rgba(0, 0, 0, 0.65),
    0 0 24px rgba(99, 102, 241, 0.16);
  object-fit: cover;
  flex-shrink: 0;
}

.home-hero-title {
  margin: 22px 0 0;
  font-size: clamp(2rem, 4vw, 3.15rem);
  font-weight: 700;
  line-height: 1.15;
  letter-spacing: -0.03em;
  background: linear-gradient(180deg, #ffffff 22%, #b5c0d4 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.home-hero-lead {
  margin: 18px 0 0;
  font-size: 15.5px;
  color: var(--muted);
  max-width: 540px;
  line-height: 1.72;
}

/* 3D Compact Screenshot Stage */
.stage-showcase {
  position: relative;
  min-height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  perspective: 1300px;
  min-width: 0;
}

.stage-glow {
  position: absolute;
  inset: 8% 6% 4%;
  background:
    radial-gradient(ellipse at 52% 45%, rgba(56, 189, 248, 0.18), transparent 64%),
    radial-gradient(ellipse at 32% 60%, rgba(99, 102, 241, 0.18), transparent 62%);
  filter: blur(36px);
  pointer-events: none;
  z-index: 0;
}

.stage-main {
  position: relative;
  z-index: 2;
  width: 92%;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: var(--bg-surface);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 28px 70px rgba(0, 0, 0, 0.8);
  overflow: hidden;
  transform: rotateY(-7deg) rotateX(3deg);
  transition: transform 0.35s ease;
}

.stage-showcase:hover .stage-main {
  transform: rotateY(-2deg) rotateX(1deg) translateY(-3px);
}

.window-chrome {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.03);
  border-bottom: 1px solid rgba(255, 255, 255, 0.07);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-muted);
}

.chrome-dots {
  display: flex;
  gap: 5px;
}

.chrome-dots span {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.18);
}

.stage-main img {
  display: block;
  width: 100%;
  height: auto;
}

.stage-sub-manga {
  position: absolute;
  left: 0;
  bottom: 12px;
  z-index: 3;
  width: 44%;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: var(--bg-elevated);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.22),
    0 20px 44px rgba(0, 0, 0, 0.85);
  overflow: hidden;
  transform: rotateY(8deg) rotateZ(-1.5deg);
  transition: transform 0.3s ease;
}

.stage-sub-manga:hover {
  transform: rotateY(2deg) rotateZ(0deg) translateY(-3px);
}

.stage-sub-manga img {
  display: block;
  width: 100%;
  height: auto;
}

.stage-sub-agy {
  position: absolute;
  right: 4px;
  bottom: 18px;
  z-index: 4;
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 8px 12px;
  border-radius: 11px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(11, 13, 18, 0.9);
  backdrop-filter: blur(12px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 16px 36px rgba(0, 0, 0, 0.78);
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--ink);
}

.stage-sub-agy img {
  width: 34px;
  height: 18px;
  object-fit: cover;
  border-radius: 4px;
  border: 1px solid var(--hairline);
}

/* Signature Element: Live Telemetry Strip */
.telemetry-bar {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  margin-top: 8px;
  padding: 16px 22px;
  border-radius: var(--radius-md);
  background: linear-gradient(180deg, rgba(20, 25, 38, 0.86) 0%, rgba(11, 13, 18, 0.96) 100%);
  border: 1px solid rgba(255, 255, 255, 0.13);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.18),
    0 18px 42px rgba(0, 0, 0, 0.55);
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.telemetry-bar::before {
  content: "";
  position: absolute;
  top: 0;
  left: 8%;
  right: 8%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(56, 189, 248, 0.55), transparent);
  pointer-events: none;
}

.telemetry-bar:hover {
  border-color: rgba(56, 189, 248, 0.42);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.24),
    0 22px 50px rgba(0, 0, 0, 0.65),
    0 0 28px rgba(56, 189, 248, 0.08);
}

.telemetry-status {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--ink);
  white-space: nowrap;
}

.telemetry-kpis {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px;
}

.telemetry-kpi {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-left: 16px;
  border-left: 1px solid var(--hairline);
  min-width: 0;
}

.telemetry-kpi-val {
  font-family: var(--font-mono);
  font-size: 20px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: var(--ink);
  line-height: 1.2;
}

.telemetry-kpi-label {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.telemetry-cta {
  font-family: var(--font-mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--accent-cyan);
  white-space: nowrap;
}

/* Home Sections */
.home-section {
  padding: 52px 0 8px;
}

.home-section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 22px;
}

.home-section-sub {
  margin: 6px 0 0;
  font-size: 14.5px;
  color: var(--muted);
}

/* Bento 4-Card Products Grid */
.product-bento {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
}

.bento-featured {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 24px;
  padding: 26px;
  align-items: center;
}

.bento-featured-info {
  display: flex;
  flex-direction: column;
  gap: 14px;
  min-width: 0;
}

.bento-title-row {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}

.bento-title {
  margin: 0;
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.bento-title-sm {
  font-size: 18px;
}

.metric-chip {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  align-self: flex-start;
  padding: 6px 11px;
  border-radius: 8px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.24);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink);
}

.metric-chip-label {
  color: var(--text-muted);
  font-size: 11.5px;
}

.metric-chip-val {
  color: var(--accent-cyan);
  font-weight: 700;
}

.bento-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-top: 4px;
}

.bento-media-panel {
  border-radius: 12px;
  border: 1px solid var(--hairline);
  background: var(--bg-canvas);
  overflow: hidden;
  min-width: 0;
}

.bento-media-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.025);
}

.bento-media-tabs {
  display: flex;
  gap: 6px;
}

.compare-pair {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding: 12px;
}

.compare-shot {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  background: var(--bg-surface);
  aspect-ratio: 4 / 3;
}

.compare-shot img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 22%;
}

.compare-label {
  position: absolute;
  left: 8px;
  top: 8px;
  padding: 2px 8px;
  border-radius: 5px;
  background: rgba(6, 7, 10, 0.84);
  border: 1px solid rgba(255, 255, 255, 0.16);
  font-family: var(--font-mono);
  font-size: 10.5px;
  font-weight: 600;
  color: var(--ink);
}

.compare-label.after {
  border-color: rgba(56, 189, 248, 0.45);
  color: var(--accent-cyan);
}

.banner-pane {
  padding: 12px;
}

.banner-pane img {
  display: block;
  width: 100%;
  border-radius: 8px;
  border: 1px solid var(--hairline);
}

.bento-tool-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 16px;
  padding: 22px;
  min-width: 0;
  transition: border-color 0.18s ease, transform 0.18s ease, box-shadow 0.18s ease;
}

.bento-tool-card:hover {
  border-color: rgba(129, 140, 248, 0.45);
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.2),
    0 24px 54px rgba(0, 0, 0, 0.72);
}

.tool-thumb-box {
  border-radius: 10px;
  border: 1px solid var(--hairline);
  background: var(--bg-canvas);
  overflow: hidden;
  aspect-ratio: 16 / 9;
  display: flex;
  align-items: center;
  justify-content: center;
}

.tool-thumb-box img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.tool-thumb-box.is-contain {
  padding: 16px;
  background: radial-gradient(circle at center, rgba(99, 102, 241, 0.12), rgba(6, 7, 10, 0.9));
}

.tool-thumb-box.is-contain img {
  object-fit: contain;
}

.tool-thumb-terminal {
  width: 100%;
  height: 100%;
  padding: 14px 16px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--muted);
  background:
    linear-gradient(180deg, rgba(99, 102, 241, 0.06), transparent),
    var(--bg-canvas);
}

.tool-thumb-terminal .term-line {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.03);
  border: 1px solid var(--hairline);
  color: var(--ink);
}

.tool-thumb-terminal .term-tag {
  font-size: 10.5px;
  color: var(--accent-cyan);
}

.bento-card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
  font-size: 13px;
  font-weight: 600;
  color: var(--muted);
}

.bento-tool-card:hover .bento-card-foot {
  color: var(--accent-cyan);
}

/* Timeline (#journal) */
.timeline-panel {
  padding: 8px 22px;
}

.timeline-list {
  display: flex;
  flex-direction: column;
}

.timeline-row {
  display: grid;
  grid-template-columns: 108px 92px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 14px 0;
  border-top: 1px solid var(--hairline);
}

.timeline-row:first-child {
  border-top: none;
}

.timeline-date {
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  color: var(--accent-cyan);
}

.timeline-title {
  font-size: 14.5px;
  color: var(--ink);
  min-width: 0;
}

.section-foot-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 16px;
}

/* Collaboration (#work-with-me) */
.collab-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 16px;
}

.collab-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 14px;
  padding: 22px;
  min-width: 0;
}

.collab-num {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  color: var(--accent-indigo);
}

.collab-title {
  margin: 6px 0 0;
  font-size: 17px;
  font-weight: 700;
  color: var(--ink);
}

.collab-list {
  margin: 12px 0 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 7px;
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--muted);
}

.collab-list li {
  position: relative;
  padding-left: 14px;
}

.collab-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.62em;
  width: 5px;
  height: 5px;
  border-radius: 1px;
  background: var(--accent-cyan);
  opacity: 0.75;
}

button.btn-secondary {
  font-family: inherit;
  cursor: pointer;
}

.collab-evidence {
  padding-top: 12px;
  border-top: 1px solid var(--hairline);
  font-size: 13px;
  color: var(--muted);
  line-height: 1.7;
}

.collab-evidence a {
  color: var(--accent-cyan);
  text-decoration: underline;
  text-decoration-color: rgba(56, 189, 248, 0.35);
  text-underline-offset: 3px;
}

.collab-evidence a:hover {
  color: var(--ink);
}

.contact-panel {
  margin-top: 18px;
  padding: 20px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
}

.contact-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

/* Footprint (#about) */
.footprint-panel {
  padding: 24px;
}

.footprint-narrative {
  margin: 0;
  font-size: 16px;
  font-weight: 500;
  color: var(--ink);
}

.archived-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin-top: 18px;
}

.archived-item {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px 16px;
  border-radius: 10px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.02);
  transition: border-color 0.16s ease, background-color 0.16s ease;
  min-width: 0;
}

.archived-item:hover {
  border-color: rgba(56, 189, 248, 0.38);
  background: rgba(255, 255, 255, 0.04);
}

.archived-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.archived-name {
  font-family: var(--font-mono);
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ink);
}

.archived-meta {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--accent-cyan);
  white-space: nowrap;
}

.archived-desc {
  margin: 0;
  font-size: 13px;
  color: var(--muted);
}

.stack-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}

.stack-pill {
  padding: 4px 11px;
  border-radius: 999px;
  border: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.03);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--muted);
}

/* Subpages Shared Editorial / Instrument Components */
.hero-section {
  padding: 52px 0 28px;
}

.subhero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1.08fr);
  gap: 36px;
  align-items: center;
  padding: 48px 0 36px;
}

.subhero-grid > *,
.stats-grid-hero > *,
.stats-two-col > *,
.bento-subrow > * {
  min-width: 0;
}

.subhero-title,
.hero-title {
  margin: 16px 0 0;
  font-family: var(--font-sans);
  font-size: clamp(1.95rem, 3.8vw, 2.85rem);
  font-weight: 700;
  line-height: 1.18;
  letter-spacing: -0.025em;
  background: linear-gradient(180deg, #ffffff 20%, #b4bfd2 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-subtitle {
  margin: 14px 0 0;
  font-size: 15.5px;
  color: var(--muted);
  max-width: 620px;
}

.section-block {
  padding: 44px 0;
  border-top: 1px solid var(--hairline);
}

.section-header {
  margin-bottom: 22px;
}

.section-kicker {
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent-cyan);
}

.section-title {
  margin: 8px 0 0;
  font-family: var(--font-sans);
  font-size: clamp(1.45rem, 2.8vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}

.trust-strip {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
  font-size: 12.5px;
}

.trust-chip {
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(56, 189, 248, 0.08);
  border: 1px solid rgba(56, 189, 248, 0.25);
  color: #bae6fd;
  font-weight: 600;
}

.cta-row {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 20px;
  border-radius: 10px;
  background: linear-gradient(180deg, #ffffff 0%, #dce3ef 100%);
  color: #06070a;
  border: 1px solid rgba(255, 255, 255, 0.9);
  box-shadow:
    0 10px 28px rgba(255, 255, 255, 0.08),
    inset 0 1px 0 #ffffff;
  font-size: 14px;
  font-weight: 650;
  cursor: pointer;
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 32px rgba(255, 255, 255, 0.14);
}

.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 11px 18px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.04);
  color: var(--ink);
  border: 1px solid var(--hairline-strong);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: border-color 0.15s ease, background-color 0.15s ease;
}

.btn-secondary:hover {
  border-color: rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.08);
}

.btn-mono {
  font-family: var(--font-mono);
  font-size: 12.5px;
}

.craft-panel {
  position: relative;
  background: linear-gradient(180deg, rgba(18, 22, 32, 0.88) 0%, rgba(10, 12, 18, 0.96) 100%);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.12),
    0 20px 50px rgba(0, 0, 0, 0.55);
  overflow: hidden;
}

.craft-panel::before {
  content: "";
  position: absolute;
  top: 0;
  left: 10%;
  right: 10%;
  height: 1px;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.25), transparent);
  pointer-events: none;
}

.bento-subrow {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
}

.bento-card {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: border-color 0.15s ease, transform 0.15s ease;
}

.bento-card:hover {
  border-color: rgba(129, 140, 248, 0.45);
  transform: translateY(-2px);
}

.card-top {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  gap: 12px;
}

.card-title {
  font-family: var(--font-sans);
  font-size: 18px;
  font-weight: 700;
  color: var(--ink);
}

.card-desc {
  margin: 8px 0 0;
  font-size: 14px;
  color: var(--muted);
  line-height: 1.65;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 6px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 600;
  border: 1px solid var(--hairline-strong);
  background: rgba(255, 255, 255, 0.04);
  color: var(--muted);
  white-space: nowrap;
}

.badge-pro {
  border-color: rgba(99, 102, 241, 0.45);
  background: rgba(99, 102, 241, 0.14);
  color: #c7d2fe;
}

.card-media {
  margin-top: 16px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--hairline);
  background: var(--bg-canvas);
}

.card-media img {
  display: block;
  width: 100%;
  height: auto;
}

.compare-box {
  background: var(--bg-surface);
  border: 1px solid var(--hairline);
  border-radius: var(--radius-md);
  overflow: hidden;
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.5);
}

.compare-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--hairline);
  background: rgba(255, 255, 255, 0.025);
}

.compare-tab,
.os-tab {
  padding: 5px 11px;
  border-radius: 7px;
  font-size: 12px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--muted);
  background: transparent;
  border: 1px solid transparent;
  cursor: pointer;
  transition: color 0.15s ease, background-color 0.15s ease, border-color 0.15s ease;
}

.compare-tab:hover,
.os-tab:hover {
  color: var(--ink);
  background: rgba(255, 255, 255, 0.05);
}

.compare-tab.active,
.os-tab.active {
  color: #06070a;
  background: #f4f6fb;
  border-color: #f4f6fb;
}

.os-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.os-tab:not(.active) {
  border-color: var(--hairline);
  background: rgba(255, 255, 255, 0.03);
}

.code-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 9px;
  background: var(--bg-elevated);
  border: 1px solid var(--hairline-strong);
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--ink);
  overflow-x: auto;
  max-width: 100%;
}

.code-box span {
  min-width: 0;
  overflow-wrap: anywhere;
}

.copy-btn {
  padding: 5px 11px;
  border-radius: 6px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid var(--hairline-strong);
  color: var(--ink);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
  flex-shrink: 0;
}

.copy-btn:hover {
  border-color: rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
}

.feature-grid-4 {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 16px;
}

.feature-card {
  padding: 20px;
}

.feature-card h3 {
  font-family: var(--font-sans);
  font-size: 16.5px;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 8px;
}

.feature-card p {
  margin: 0;
  font-size: 13.5px;
  color: var(--muted);
  line-height: 1.65;
}

.relay-table-wrap {
  overflow-x: auto;
  margin-top: 20px;
}

.relay-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 13.5px;
  text-align: left;
}

.relay-table th,
.relay-table td {
  padding: 12px 14px;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink);
}

.relay-table th {
  color: var(--muted);
  font-family: var(--font-mono);
  font-weight: 700;
  font-size: 12px;
}

/* Legal pages */
.legal-article {
  max-width: 780px;
  margin: 44px auto 64px;
  padding: 34px;
}

.legal-article h1 {
  font-family: var(--font-sans);
  font-size: 1.85rem;
  font-weight: 700;
  color: var(--ink);
  margin: 14px 0 10px;
}

.legal-article h2 {
  font-family: var(--font-sans);
  font-size: 1.15rem;
  font-weight: 700;
  margin: 26px 0 10px;
  color: var(--ink);
}

.legal-article p,
.legal-article li {
  color: var(--muted);
  font-size: 14.5px;
  margin: 0 0 10px;
}

.legal-article strong {
  color: var(--ink);
}

.legal-article ul {
  padding-left: 20px;
}

.legal-article code {
  background: rgba(255, 255, 255, 0.06);
  border: 1px solid var(--hairline-strong);
  padding: 1px 6px;
  border-radius: 4px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  color: var(--accent-cyan);
}

.legal-article code canvas {
  display: none;
}

.legal-article code:has(canvas)::after {
  content: "<canvas>";
}

/* Stats Dashboard Dark Instrument Theme */
.stats-hero {
  padding: 44px 0 28px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
}

.stats-identity {
  display: flex;
  align-items: center;
  gap: 16px;
}

.stats-avatar {
  width: 58px;
  height: 58px;
  border-radius: 12px;
  border: 1px solid var(--hairline-strong);
}

.stats-grid-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 18px;
}

.stats-kpi-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(175px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.stats-kpi { padding: 20px; }
.stats-kpi-label { font-size: 12.5px; color: var(--muted); }
.stats-kpi-val {
  margin-top: 6px;
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--ink);
}
.stats-kpi-sub { margin-top: 4px; font-size: 12px; color: var(--text-muted); }

.score-display {
  display: flex;
  align-items: baseline;
  gap: 10px;
  margin: 12px 0 6px;
}

.score-big {
  font-family: var(--font-mono);
  font-size: clamp(2.8rem, 5.5vw, 4rem);
  font-weight: 700;
  letter-spacing: -0.04em;
  line-height: 1;
  color: var(--ink);
}

.dim-stack { display: grid; gap: 12px; margin-top: 18px; }
.dim-bar-track {
  height: 7px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  overflow: hidden;
  margin: 6px 0 4px;
}
.dim-bar-fill {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent-indigo), var(--accent-cyan));
}

.radar-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  min-height: 290px;
}

/* Override hardcoded light SVG strokes/fills generated by stats.js */
#radarCardBody svg polygon[fill="none"] {
  stroke: rgba(255, 255, 255, 0.14) !important;
}
#radarCardBody svg line {
  stroke: rgba(255, 255, 255, 0.12) !important;
}
#radarCardBody svg polygon[fill^="url"] {
  fill: rgba(99, 102, 241, 0.28) !important;
  stroke: #38bdf8 !important;
}
#radarCardBody svg circle {
  fill: #38bdf8 !important;
  stroke: #0b0d12 !important;
}
#radarCardBody svg text {
  fill: #cbd5e1 !important;
}

.stats-two-col {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.stats-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.stats-table th, .stats-table td {
  padding: 11px 8px;
  border-bottom: 1px solid var(--hairline);
  text-align: left;
  vertical-align: top;
  color: var(--ink);
}
.stats-table th {
  color: var(--muted);
  font-family: var(--font-mono);
  font-size: 11.5px;
  font-weight: 700;
}
.stats-table td.num, .stats-table th.num {
  text-align: right;
  font-family: var(--font-mono);
}
.repo-link { color: var(--ink); font-weight: 700; }
.repo-link:hover { color: var(--accent-cyan); text-decoration: underline; }

.tools-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.milestone-item {
  padding: 12px 14px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.025);
  border: 1px solid var(--hairline);
}

/* Command Palette Modal (Dark) */
.cmdk-backdrop {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: none;
  align-items: flex-start;
  justify-content: center;
  padding-top: 14vh;
  background: rgba(4, 6, 10, 0.68);
  backdrop-filter: blur(8px);
}
.cmdk-backdrop.open { display: flex; }
.cmdk-modal {
  width: min(560px, 92vw);
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--hairline-strong);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.78);
  overflow: hidden;
}
.cmdk-input {
  width: 100%;
  padding: 14px 18px;
  background: var(--bg-elevated);
  border: none;
  border-bottom: 1px solid var(--hairline);
  color: var(--ink);
  font-size: 14.5px;
  outline: none;
}
.cmdk-input::placeholder {
  color: var(--text-muted);
}
.cmdk-list { max-height: 340px; overflow-y: auto; padding: 8px; }
.cmdk-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 12px;
  border-radius: 7px;
  color: var(--muted);
  font-size: 13.5px;
  cursor: pointer;
}
.cmdk-item:hover {
  background: rgba(255, 255, 255, 0.06);
  color: var(--ink);
}

/* Page transition animations used by app.js */
@keyframes pageFadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

main.container.is-entering {
  animation: pageFadeUp 0.22s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

main.container.is-leaving {
  opacity: 0;
  transform: translateY(-4px);
  transition: opacity 0.11s ease, transform 0.11s ease;
}

/* Footer */
.studio-footer,
.site-footer {
  position: relative;
  z-index: 1;
  margin-top: 56px;
  border-top: 1px solid var(--hairline);
  padding: 28px 0 46px;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 16px;
  font-size: 13px;
  color: var(--muted);
}

.seal-signoff {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 600;
}

.footer-links {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
}
.footer-links a:hover { color: var(--ink); text-decoration: underline; }

/* Responsive */
@media (max-width: 960px) {
  .home-hero {
    grid-template-columns: minmax(0, 1fr);
    gap: 32px;
    padding: 36px 0 24px;
  }
  .stage-showcase {
    min-height: 290px;
  }
  .telemetry-bar {
    grid-template-columns: minmax(0, 1fr);
    gap: 14px;
  }
  .telemetry-kpis {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .telemetry-kpi {
    padding-left: 0;
    border-left: none;
    padding-top: 10px;
    border-top: 1px solid var(--hairline);
  }
  .product-bento {
    grid-template-columns: minmax(0, 1fr);
  }
  .bento-featured {
    grid-template-columns: minmax(0, 1fr);
  }
  .collab-grid,
  .archived-grid,
  .subhero-grid,
  .bento-subrow,
  .stats-grid-hero,
  .stats-two-col {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 640px) {
  .wrap,
  .container {
    padding: 0 16px;
  }
  .header-inner {
    padding: 12px 16px;
    gap: 10px;
  }
  .studio-submark,
  .studio-nav .hide-sm {
    display: none;
  }
  .studio-nav {
    gap: 2px;
    font-size: 13px;
  }
  .studio-nav a {
    padding: 5px 8px;
  }
  .header-cta {
    padding: 6px 12px;
    font-size: 12.5px;
  }
  .header-actions .cmdk-btn {
    display: none;
  }
  .header-actions .lang-toggle-btn {
    padding: 5px 8px;
  }
  .header-inner:has(.nav-links) {
    flex-wrap: wrap;
    row-gap: 8px;
  }
  .studio-nav.nav-links {
    order: 3;
    width: 100%;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .studio-nav.nav-links::-webkit-scrollbar {
    display: none;
  }
  .studio-nav.nav-links .hide-sm {
    display: inline-flex;
  }
  .studio-nav.nav-links a {
    white-space: nowrap;
    flex-shrink: 0;
  }
  .hero-identity {
    flex-wrap: nowrap;
    gap: 10px;
  }
  .hero-avatar {
    width: 60px;
    height: 60px;
    border-radius: 14px;
  }
  .hero-name {
    font-size: 16px;
  }
  .eyebrow-pill {
    font-size: 10px;
    letter-spacing: 0.04em;
    padding: 4px 10px;
    white-space: normal;
    line-height: 1.35;
    min-width: 0;
  }
  .home-hero-title {
    font-size: 1.78rem;
  }
  .stage-showcase {
    min-height: auto;
    padding-bottom: 24px;
  }
  .stage-main {
    width: 100%;
    transform: none;
  }
  .stage-sub-manga {
    width: 48%;
    left: 6px;
    bottom: 0;
    transform: none;
  }
  .stage-sub-agy {
    right: 6px;
    bottom: 4px;
    padding: 6px 9px;
    font-size: 10px;
  }
  .telemetry-bar {
    padding: 14px 16px;
  }
  .bento-featured {
    padding: 18px;
  }
  .bento-media-bar {
    flex-wrap: wrap;
  }
  .bento-links .btn-primary,
  .bento-links .btn-secondary {
    padding: 9px 14px;
    font-size: 13px;
  }
  .compare-pair {
    grid-template-columns: 1fr;
  }
  .timeline-row {
    grid-template-columns: 96px 1fr;
    gap: 8px;
  }
  .timeline-title {
    grid-column: 1 / -1;
  }
  .legal-article {
    padding: 22px 18px;
    margin: 24px auto 40px;
  }
}

/* bento 卡标题过长时让徽章保持完整 */
.card-top .badge { flex-shrink: 0; white-space: nowrap; }
.card-top .card-title { min-width: 0; }
#publicToolsRow .card-top { flex-direction: column; align-items: flex-start; gap: 8px; }

/* mac-utils 实机截图 */
.mac-shots { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; margin: 8px 0 24px; }
.mac-shots figure { margin: 0; }
.mac-shots img { display: block; width: 100%; height: auto; filter: drop-shadow(0 18px 40px rgba(0, 0, 0, 0.55)); }
.mac-shots figcaption { margin-top: 12px; font-size: 13px; color: var(--text-muted); }
@media (max-width: 760px) { .mac-shots { grid-template-columns: minmax(0, 1fr); } }
