/* DSH Usage Stats — showcase theme following the official harness page language:
   #4d6bfe brand blue, Host Grotesk display, DM Sans body, Fragment Mono data,
   glass navigation, hairline borders, 10/16/24px radius ladder. */

:root {
  --blue: #4d6bfe;
  --blue-soft: #73a3d2;
  --bg: #0b1020;
  --bg-deep: #0a0a0a;
  --surface-1: #121c31;
  --surface-2: #1e232c;
  --line: rgba(255, 255, 255, 0.09);
  --line-strong: rgba(255, 255, 255, 0.16);
  --text: #eef1f8;
  --muted: #8691a1;
  --muted-2: #9ca3af;
  --light: #f9f8f8;
  --radius-card: 24px;
  --radius-panel: 16px;
  --radius-media: 10px;
  --radius-pill: 100px;
  --blur: 12px;
  --font-display: "Host Grotesk", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-body: "DM Sans", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  --font-mono: "Fragment Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
  --shell: 1200px;
  --pointer-x: 50%;
  --pointer-y: 20%;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg-deep);
  color: var(--text);
  font: 16px/1.6 var(--font-body);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; height: auto; }
code { font-family: var(--font-mono); }
::selection { background: rgba(77, 107, 254, 0.4); }

.shell { width: min(var(--shell), calc(100% - 48px)); margin-inline: auto; }

/* ---------- header ---------- */
.site-head {
  position: sticky;
  top: 0;
  z-index: 10;
  backdrop-filter: blur(var(--blur));
  -webkit-backdrop-filter: blur(var(--blur));
  background: rgba(10, 10, 10, 0.55);
  border-bottom: 1px solid var(--line);
}
.head-shell { display: flex; align-items: center; justify-content: space-between; height: 64px; }
.brand { display: inline-flex; align-items: center; gap: 10px; font: 600 1.02rem var(--font-display); letter-spacing: -0.02em; }
.brand img {
  width: 26px;
  height: 26px;
  border-radius: 7px;
  box-shadow: 0 0 0 1px var(--line-strong);
}
nav { display: flex; align-items: center; gap: 26px; font-size: 0.92rem; color: var(--muted); }
nav a { transition: color 0.18s ease; }
nav a:hover { color: var(--text); }
.repo {
  padding: 7px 16px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  color: var(--text);
  transition: border-color 0.18s ease, background 0.18s ease;
}
.repo:hover { border-color: var(--blue); background: rgba(77, 107, 254, 0.12); }

/* ---------- hero ---------- */
.hero {
  position: relative;
  padding: 96px 0 72px;
  background:
    radial-gradient(900px 460px at 78% -8%, rgba(77, 107, 254, 0.28), transparent 62%),
    radial-gradient(700px 420px at 8% 12%, rgba(115, 163, 210, 0.14), transparent 60%),
    linear-gradient(180deg, var(--surface-1) 0%, var(--bg) 78%);
  border-bottom: 1px solid var(--line);
  overflow: hidden;
}
.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.05) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.05) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: radial-gradient(820px 520px at var(--pointer-x) var(--pointer-y), #000 0 42%, transparent 80%);
  -webkit-mask-image: radial-gradient(820px 520px at var(--pointer-x) var(--pointer-y), #000 0 42%, transparent 80%);
}
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(560px circle at var(--pointer-x) var(--pointer-y), rgba(77, 107, 254, 0.32), transparent 62%),
    radial-gradient(320px circle at calc(var(--pointer-x) - 12%) calc(var(--pointer-y) + 14%), rgba(115, 163, 210, 0.18), transparent 66%);
  transition: background 0.12s ease-out;
}
.hero > .shell { position: relative; }
.hero-copy { max-width: 660px; }
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 22px;
  padding: 7px 14px;
  border: 1px solid rgba(77, 107, 254, 0.45);
  border-radius: var(--radius-pill);
  background: rgba(77, 107, 254, 0.12);
  color: #b9c8ff;
  font: 500 0.8rem/1.4 var(--font-mono);
  letter-spacing: 0.08em;
}
.hero h1 {
  margin: 0 0 22px;
  font: 500 clamp(2.6rem, 6.4vw, 4.6rem)/1.12 var(--font-display);
  letter-spacing: -0.03em;
}
.hero h1 em { font-style: normal; color: var(--blue); text-shadow: 0 0 42px rgba(77, 107, 254, 0.45); }
.intro { margin: 0 0 30px; max-width: 540px; color: var(--muted); font-size: 1.06rem; }
.actions { display: flex; flex-wrap: wrap; gap: 14px; margin-bottom: 26px; }
.button {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: var(--radius-pill);
  font: 500 0.96rem var(--font-body);
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}
.button.primary { background: var(--blue); color: #fff; box-shadow: 0 8px 30px rgba(77, 107, 254, 0.35); }
.button.primary:hover { transform: translateY(-1px); box-shadow: 0 12px 38px rgba(77, 107, 254, 0.5); }
.button.ghost { border: 1px solid var(--line-strong); color: var(--text); }
.button.ghost:hover { border-color: var(--blue); background: rgba(77, 107, 254, 0.1); }
.hint { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; margin: 0; color: var(--muted); font: 0.82rem var(--font-mono); }
.hint b { color: var(--blue-soft); }
.hint i { width: 3px; height: 3px; border-radius: 50%; background: var(--muted-2); }
.hint code { padding: 2px 8px; border: 1px solid var(--line); border-radius: 7px; background: rgba(0, 0, 0, 0.25); font-size: 0.78rem; }

.hero-shot { position: relative; margin-top: 58px; }
.shot-glow {
  position: absolute;
  inset: -40px 8% auto;
  height: 220px;
  background: radial-gradient(60% 100% at 50% 0%, rgba(77, 107, 254, 0.4), transparent 70%);
  filter: blur(34px);
}
.shot-frame {
  position: relative;
  margin: 0;
  padding: 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-media);
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0.015));
  box-shadow: 0 40px 90px rgba(0, 0, 0, 0.55);
}
.shot-frame img { border-radius: 6px; }

/* ---------- statement + stats ---------- */
.statement { padding: 96px 0 84px; border-bottom: 1px solid var(--line); background: var(--bg-deep); }
.section-title p {
  margin: 0 0 14px;
  color: var(--blue-soft);
  font: 500 0.74rem var(--font-mono);
  letter-spacing: 0.22em;
  text-transform: uppercase;
}
.section-title h2 {
  margin: 0;
  font: 500 clamp(1.7rem, 3.6vw, 2.6rem)/1.22 var(--font-display);
  letter-spacing: -0.02em;
}
.stat-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; margin-top: 46px; }
.stat {
  padding: 26px 26px 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: linear-gradient(180deg, var(--surface-1), rgba(18, 28, 49, 0.4));
}
.stat b { display: block; margin-bottom: 6px; font: 400 clamp(1.5rem, 2.6vw, 2.1rem)/1.1 var(--font-mono); color: var(--text); font-variant-numeric: tabular-nums; }
.stat span { color: var(--muted); font-size: 0.9rem; }

/* ---------- features ---------- */
.features { padding: 96px 0; border-bottom: 1px solid var(--line); }
.feature-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 14px; margin-top: 46px; }
.feature {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 30px 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: linear-gradient(180deg, var(--surface-2), rgba(30, 35, 44, 0.35));
  transition: transform 0.2s ease, border-color 0.2s ease;
}
.feature:hover { transform: translateY(-3px); border-color: rgba(77, 107, 254, 0.55); }
.feature b { color: var(--blue); font: 400 0.8rem var(--font-mono); letter-spacing: 0.14em; }
.feature h3 { margin: 0; font: 500 1.28rem var(--font-display); letter-spacing: -0.01em; }
.feature p { margin: 0; color: var(--muted); font-size: 0.95rem; }
.feature.lead {
  grid-row: span 2;
  background:
    radial-gradient(420px 240px at 20% 0%, rgba(77, 107, 254, 0.22), transparent 68%),
    linear-gradient(180deg, var(--surface-1), rgba(18, 28, 49, 0.4));
}
.feature.lead p { font-size: 1rem; }
.bars { display: flex; align-items: flex-end; gap: 7px; height: 96px; margin-top: auto; padding-top: 18px; }
.bars i {
  flex: 1;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, var(--blue), rgba(77, 107, 254, 0.16));
  animation: bar 2.6s ease-in-out infinite;
  transform-origin: bottom;
}
.bars i:nth-child(1) { height: 42%; animation-delay: -0.2s; }
.bars i:nth-child(2) { height: 66%; animation-delay: -0.6s; }
.bars i:nth-child(3) { height: 38%; animation-delay: -1s; }
.bars i:nth-child(4) { height: 82%; animation-delay: -1.4s; }
.bars i:nth-child(5) { height: 58%; animation-delay: -1.8s; }
.bars i:nth-child(6) { height: 94%; animation-delay: -2.2s; }
.bars i:nth-child(7) { height: 72%; animation-delay: -2.6s; }
@keyframes bar {
  0%, 100% { transform: scaleY(0.82); opacity: 0.75; }
  50% { transform: scaleY(1); opacity: 1; }
}

/* ---------- screenshots ---------- */
.screenshots { padding: 96px 0; border-bottom: 1px solid var(--line); background: linear-gradient(180deg, var(--bg-deep), #0d1226 60%, var(--bg-deep)); }
.gallery { display: flex; gap: 14px; height: clamp(360px, 48vw, 640px); margin-top: 46px; }
.gallery figure {
  position: relative;
  margin: 0;
  min-width: 0;
  overflow: hidden;
  cursor: pointer;
  border: 1px solid var(--line);
  border-radius: var(--radius-media);
  background: var(--surface-2);
  flex: 1 1 0%;
  transition: flex-grow 0.55s cubic-bezier(0.22, 0.61, 0.36, 1), border-color 0.2s ease;
}
.gallery .wide { flex-grow: 3.4; }
.gallery:hover figure { flex-grow: 1; }
.gallery figure:hover {
  flex-grow: 6;
  border-color: rgba(115, 163, 210, 0.65);
}
.gallery img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center top;
}
.gallery figcaption {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 34px 16px 12px;
  background: linear-gradient(180deg, transparent, rgba(6, 8, 14, 0.85));
  color: var(--text);
  font: 0.82rem var(--font-mono);
  opacity: 0.72;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: opacity 0.25s ease;
}
.gallery figure:hover figcaption { opacity: 1; }

/* ---------- install ---------- */
.install { padding: 96px 0; background: var(--bg-deep); }
.install-shell { display: grid; grid-template-columns: 5fr 7fr; gap: 48px; align-items: start; }
.install-note { color: var(--muted); font-size: 0.98rem; }
.install-note code { padding: 2px 8px; border: 1px solid var(--line); border-radius: 7px; background: rgba(0, 0, 0, 0.25); font-size: 0.82rem; }
.install-panel {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  background: linear-gradient(180deg, var(--surface-1), rgba(18, 28, 49, 0.35));
}
.cmd-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px 16px;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-media);
  background: rgba(0, 0, 0, 0.3);
}
.cmd-row div { display: flex; align-items: baseline; gap: 10px; grid-column: 1 / -1; }
.cmd-row b { color: var(--blue); font: 400 0.76rem var(--font-mono); }
.cmd-row span { color: var(--muted); font-size: 0.88rem; }
.cmd-row code {
  align-self: center;
  max-width: 100%;
  overflow-x: auto;
  color: var(--blue-soft);
  font-size: 0.86rem;
  white-space: nowrap;
}
.copy {
  padding: 6px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text);
  font: 500 0.8rem var(--font-body);
  cursor: pointer;
  transition: border-color 0.18s ease, background 0.18s ease;
}
.copy:hover { border-color: var(--blue); background: rgba(77, 107, 254, 0.12); }
.copy.done { border-color: #37e0c8; color: #37e0c8; }

/* ---------- footer ---------- */
footer { border-top: 1px solid var(--line); background: var(--bg-deep); }
.foot-shell { display: flex; flex-wrap: wrap; align-items: center; gap: 18px; padding: 30px 0; color: var(--muted); }
.foot-shell p { flex: 1; margin: 0; font-size: 0.9rem; }
.foot-shell a:last-child { color: var(--text); }
.foot-shell a:last-child:hover { color: var(--blue-soft); }

/* ---------- reveal + motion ---------- */
.reveal { opacity: 0; transform: translateY(18px); transition: opacity 0.6s ease, transform 0.6s ease; }
.reveal.in { opacity: 1; transform: none; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  .reveal { opacity: 1; transform: none; transition: none; }
  .bars i { animation: none; }
  .button, .feature, .gallery figure { transition: none; }
  .gallery figure:hover { flex-grow: 3.4; }
}

/* ---------- responsive ---------- */
@media (max-width: 960px) {
  .stat-grid { grid-template-columns: repeat(2, 1fr); }
  .feature-grid { grid-template-columns: 1fr; }
  .feature.lead { grid-row: auto; }
  .gallery { flex-direction: column; height: auto; }
  .gallery figure { flex: none; }
  .gallery img { position: static; height: auto; }
  .gallery figcaption { position: static; background: none; padding: 10px 14px; border-top: 1px solid var(--line); }
  .install-shell { grid-template-columns: 1fr; gap: 30px; }
}
@media (max-width: 640px) {
  .shell { width: calc(100% - 36px); }
  .head-shell { height: 56px; }
  nav { gap: 16px; font-size: 0.86rem; }
  .repo { padding: 6px 12px; }
  .hero { padding: 64px 0 56px; }
  .stat-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .cmd-row { grid-template-columns: 1fr; }
  .cmd-row code { white-space: normal; word-break: break-all; }
}
