/* XHS project site — clean Apple-inspired design (not a copy). */

:root {
  --bg: #ffffff;
  --bg-gray: #f5f5f7;
  --bg-dark: #0b0b0f;
  --text: #1d1d1f;
  --text-dim: #6e6e73;
  --text-dark-bg: #f5f5f7;
  --accent: #0071e3;
  --accent2: #7d4cff;
  --radius: 18px;
  --maxw: 1080px;
  --font: -apple-system, BlinkMacSystemFont, "SF Pro Display", "PingFang SC",
          "Helvetica Neue", "Segoe UI", Roboto, sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  font-family: var(--font);
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

/* ---------- nav ---------- */
.nav {
  position: sticky; top: 0; z-index: 50;
  backdrop-filter: saturate(180%) blur(20px);
  -webkit-backdrop-filter: saturate(180%) blur(20px);
  background: rgba(255,255,255,0.72);
  border-bottom: 1px solid rgba(0,0,0,0.06);
}
.nav-inner {
  max-width: var(--maxw); margin: 0 auto; padding: 0 24px;
  height: 52px; display: flex; align-items: center; justify-content: space-between;
}
.nav-logo { font-weight: 700; letter-spacing: 0.06em; }
.nav-links a {
  color: var(--text); text-decoration: none; font-size: 14px;
  margin-left: 26px; opacity: 0.85;
}
.nav-links a:hover { opacity: 1; color: var(--accent); }

/* ---------- hero ---------- */
.hero {
  max-width: var(--maxw); margin: 0 auto;
  padding: 120px 24px 96px; text-align: center;
}
.eyebrow {
  color: var(--accent); font-weight: 600; font-size: 15px;
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 6px;
}
.byline {
  font-size: 14px; color: var(--text-dim);
  letter-spacing: 0.04em; margin-bottom: 18px;
}
h1 {
  font-size: clamp(44px, 7vw, 80px);
  line-height: 1.05; font-weight: 700; letter-spacing: -0.02em;
}
.gradient-text {
  background: linear-gradient(92deg, var(--accent) 0%, var(--accent2) 55%, #ff4d6d 100%);
  -webkit-background-clip: text; background-clip: text;
  -webkit-text-fill-color: transparent; color: transparent;
}
.hero-sub {
  margin: 26px auto 0; max-width: 640px;
  font-size: 19px; color: var(--text-dim);
}
.hero-cta { margin-top: 38px; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }
.btn {
  display: inline-block; padding: 13px 26px; border-radius: 999px;
  font-size: 16px; font-weight: 600; text-decoration: none;
  cursor: pointer; border: none; font-family: var(--font);
  transition: transform 0.15s ease, box-shadow 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--accent); color: #fff; box-shadow: 0 6px 20px rgba(0,113,227,0.25); }
.btn-primary:hover { background: #0077ed; }
.btn-ghost { background: transparent; color: var(--accent); border: 1.5px solid rgba(0,113,227,0.4); }
.btn-ghost:hover { background: rgba(0,113,227,0.06); }
.btn:disabled { opacity: 0.45; cursor: default; transform: none; }

.stat-chips {
  margin: 64px auto 0; display: flex; gap: 14px; justify-content: center; flex-wrap: wrap;
}
.chip {
  background: var(--bg-gray); border-radius: 14px; padding: 14px 22px;
  display: flex; flex-direction: column; align-items: center; min-width: 128px;
}
.chip b { font-size: 24px; letter-spacing: -0.01em; }
.chip span { font-size: 12px; color: var(--text-dim); margin-top: 2px; }

/* ---------- sections ---------- */
.section { padding: 110px 24px; max-width: var(--maxw); margin: 0 auto; }
.section-gray { background: var(--bg-gray); max-width: none; }
.section-gray > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }
.section-dark { background: var(--bg-dark); color: var(--text-dark-bg); max-width: none; }
.section-dark > * { max-width: var(--maxw); margin-left: auto; margin-right: auto; }

.kicker {
  color: var(--accent); font-weight: 600; font-size: 14px;
  letter-spacing: 0.08em; text-transform: uppercase; margin-bottom: 14px;
}
.kicker-dark { color: #7db3ff; }
.section h2 {
  font-size: clamp(30px, 4.5vw, 48px); line-height: 1.12;
  letter-spacing: -0.015em; font-weight: 700; margin-bottom: 22px;
}
.lead { font-size: 18px; color: var(--text-dim); max-width: 760px; }
.section-dark .lead, .section-dark p { color: rgba(245,245,247,0.75); }
.section-dark b { color: #fff; }

/* pipeline */
.pipeline { margin-top: 56px; display: flex; align-items: stretch; gap: 10px; flex-wrap: wrap; }
.pipe-step {
  flex: 1 1 160px; background: var(--bg-gray); border-radius: var(--radius);
  padding: 22px 18px;
}
.section-gray .pipe-step, .section-dark .pipe-step { background: rgba(255,255,255,0.05); }
.pipe-no {
  font-size: 13px; font-weight: 700; color: var(--accent);
  letter-spacing: 0.06em;
}
.pipe-step h3 { font-size: 17px; margin: 8px 0 6px; }
.pipe-step p { font-size: 13.5px; color: var(--text-dim); line-height: 1.55; }
.pipe-arrow { align-self: center; color: var(--text-dim); font-size: 18px; }
@media (max-width: 900px) { .pipe-arrow { display: none; } }

.cards { margin-top: 26px; display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
@media (max-width: 800px) { .cards { grid-template-columns: 1fr; } }
.card {
  border-radius: var(--radius); padding: 26px 24px;
  background: var(--bg-gray);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: 0 14px 34px rgba(0,0,0,0.08); }
.card h3 { font-size: 19px; margin-bottom: 8px; }
.card p { font-size: 14.5px; color: var(--text-dim); }

/* tech */
.tech-grid { display: grid; grid-template-columns: 1.25fr 1fr; gap: 48px; margin-top: 40px; }
@media (max-width: 860px) { .tech-grid { grid-template-columns: 1fr; } }
.tech-grid p { margin-bottom: 16px; font-size: 15.5px; line-height: 1.75; }
.tech-aside h4 { font-size: 15px; margin-bottom: 14px; color: #fff; }
.metric-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.metric-table th, .metric-table td {
  text-align: left; padding: 9px 12px;
  border-bottom: 1px solid rgba(255,255,255,0.12);
}
.metric-table th { color: rgba(245,245,247,0.55); font-weight: 500; }
.metric-table td b { color: #7db3ff; }
.aside-note { margin-top: 18px; font-size: 13.5px; color: rgba(245,245,247,0.55); }

/* paper link inline in the tech heading */
.paper-link {
  display: inline-block; font-size: 15px; font-weight: 600;
  color: #7db3ff; text-decoration: none; letter-spacing: 0;
  padding: 7px 15px; border-radius: 999px;
  border: 1px solid rgba(125,179,255,0.35);
  vertical-align: middle; margin-left: 16px;
  transition: background 0.15s ease;
  white-space: nowrap;
}
.paper-link:hover { background: rgba(125,179,255,0.12); }

/* demo */
.audio-list { margin-top: 44px; display: flex; flex-direction: column; gap: 14px; }
.audio-row {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  background: var(--bg-gray); border-radius: var(--radius); padding: 20px 24px;
  flex-wrap: wrap;
}
.audio-info h3 { font-size: 17px; }
.audio-info p { font-size: 13.5px; color: var(--text-dim); }
.audio-row audio { height: 40px; min-width: 260px; flex: 0 1 340px; }

/* playground */
.section-gray > .lead {
  /* stay in the centered 1080px column, but left-aligned like the heading */
  max-width: 760px;
  margin-left: calc(max(0px, (100% - var(--maxw)) / 2));
  margin-right: auto;
}
.pg-controls {
  margin-top: 40px; display: flex; gap: 18px; align-items: flex-end; flex-wrap: wrap;
  justify-content: flex-start;
}
.pg-controls label {
  font-size: 13px; color: var(--text-dim); display: flex; flex-direction: column; gap: 6px;
}
.pg-controls select {
  font-family: var(--font); font-size: 15px; padding: 9px 12px;
  border-radius: 10px; border: 1px solid rgba(0,0,0,0.14); background: #fff;
  min-width: 150px;
}
.pg-status { margin-top: 26px; font-size: 14px; color: var(--text-dim); text-align: left; }
.pg-grid-wrap { margin-top: 18px; overflow-x: auto; padding-bottom: 8px; }
.pg-grid {
  display: grid; grid-auto-flow: column; grid-template-rows: repeat(1, auto);
  gap: 3px; width: max-content; margin: 0;
}
.pg-bar {
  width: 34px; height: 46px; border-radius: 7px;
  font-size: 8.5px; line-height: 1.15; color: #fff; font-weight: 600;
  display: flex; align-items: center; justify-content: center; text-align: center;
  cursor: default; position: relative; white-space: pre-line;
  transition: transform 0.1s ease;
}
.pg-bar:hover { transform: scale(1.12); z-index: 2; }
.pg-bar.sec-start { margin-left: 10px; }
.pg-canvas { margin: 22px auto 0; display: block; width: 100%; max-width: 1080px; background: #fff;
  border-radius: 14px; box-shadow: 0 1px 4px rgba(0,0,0,0.06); }
.pg-legend { margin-top: 14px; display: flex; gap: 22px; font-size: 12.5px; color: var(--text-dim); flex-wrap: wrap; justify-content: flex-start; }
.pg-legend .sw { display: inline-block; width: 12px; height: 12px; border-radius: 4px; margin-right: 6px; vertical-align: -1px; }

/* language switcher */
.nav-lang {
  font-size: 13px; font-weight: 600; color: var(--text);
  border: 1px solid rgba(0,0,0,0.18); border-radius: 999px;
  padding: 4px 12px; text-decoration: none; margin-left: 26px;
}
.nav-lang:hover { background: rgba(0,0,0,0.05); }

/* footer */
.footer { border-top: 1px solid rgba(0,0,0,0.06); padding: 44px 24px 60px; }
.footer-inner { max-width: var(--maxw); margin: 0 auto; }
.footer-note { margin-top: 10px; font-size: 12.5px; color: var(--text-dim); max-width: 760px; }

/* ---------- code window ---------- */
.codewin {
  margin-top: 40px;
  background: #0d1117;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 18px 50px rgba(0,0,0,0.35);
  border: 1px solid rgba(255,255,255,0.08);
}
.codewin-chrome {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 16px;
  background: rgba(255,255,255,0.04);
  border-bottom: 1px solid rgba(255,255,255,0.06);
}
.codewin-dot { width: 12px; height: 12px; border-radius: 50%; }
.codewin-dot-1 { background: #ff5f57; }
.codewin-dot-2 { background: #febc2e; }
.codewin-dot-3 { background: #28c840; }
.codewin-tabs { display: flex; gap: 4px; margin-left: 14px; flex-wrap: wrap; }
.codewin-tab {
  font-family: "SF Mono", ui-monospace, Menlo, monospace;
  font-size: 12.5px; color: #8b949e; background: transparent;
  border: none; padding: 5px 12px; border-radius: 8px; cursor: pointer;
  transition: background 0.15s, color 0.15s;
}
.codewin-tab:hover { color: #e6edf3; background: rgba(255,255,255,0.06); }
.codewin-tab.active { color: #fff; background: rgba(88,166,255,0.18); }
.codewin-body { overflow-x: auto; max-height: 560px; overflow-y: auto; }
.codeblock {
  margin: 0; padding: 18px 0;
  font-family: "SF Mono", ui-monospace, Menlo, Consolas, monospace;
  font-size: 13px; line-height: 1.62; color: #e6edf3;
  counter-reset: line;
}
.cline { display: block; padding: 0 20px 0 0; white-space: pre; }
.cline:hover { background: rgba(255,255,255,0.03); }
.cno {
  display: inline-block; width: 44px; text-align: right; margin-right: 18px;
  color: #484f58; user-select: none;
}
.ck { color: #ff7b72; }            /* keywords */
.cs { color: #a5d6ff; }            /* strings/docstrings */
.cc { color: #7d8590; font-style: italic; }  /* comments */
.cn { color: #79c0ff; }            /* numbers */
.cf { color: #d2a8ff; }            /* function calls */
.codewin-caption {
  padding: 12px 18px; font-size: 13px; color: #8b949e;
  border-top: 1px solid rgba(255,255,255,0.06);
  background: rgba(255,255,255,0.02);
}
