/* Home Mate · 小瑞 Official Website — Editorial Design System */
:root {
  --bg: #f6f7f3;
  --surface: #ffffff;
  --surface-subtle: #eff2ec;
  --border: #dfe5dc;
  --border-strong: #c5d1c4;
  --text: #18201e;
  --text-muted: #52615c;
  --accent: #0f766e;
  --accent-hover: #0d5e58;
  --accent-soft: #e2f5f2;
  --code-bg: #151c1b;
  --code-text: #eaf3f0;
  --radius-sm: 10px;
  --radius-md: 16px;
  --radius-lg: 24px;
  --shadow-sm: 0 2px 10px rgba(20, 32, 28, 0.04);
  --shadow-md: 0 12px 32px rgba(20, 32, 28, 0.08);
  --max-w: 1140px;
  --font-sans: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Noto Sans SC", "Segoe UI", sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
}

:root[data-theme="dark"] {
  --bg: #0c1110;
  --surface: #131b19;
  --surface-subtle: #192421;
  --border: #24332f;
  --border-strong: #324842;
  --text: #eef4f2;
  --text-muted: #98aba4;
  --accent: #2dd4bf;
  --accent-hover: #5eead4;
  --accent-soft: rgba(45, 212, 191, 0.12);
  --code-bg: #090d0c;
  --code-text: #e6f2ee;
  --shadow-sm: 0 2px 10px rgba(0, 0, 0, 0.28);
  --shadow-md: 0 16px 40px rgba(0, 0, 0, 0.45);
}

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

img { max-width: 100%; height: auto; display: block; }
a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; }
code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-subtle);
  padding: 0.14em 0.4em;
  border-radius: 6px;
}

.wrap { max-width: var(--max-w); margin: 0 auto; padding: 0 24px; }
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap;
}

/* Header */
.site-header {
  position: sticky; top: 0; z-index: 40;
  backdrop-filter: blur(14px);
  background: color-mix(in srgb, var(--bg) 86%, transparent);
  border-bottom: 1px solid var(--border);
}
.header-inner {
  max-width: var(--max-w); margin: 0 auto; padding: 14px 24px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
}
.brand {
  display: flex; align-items: center; gap: 10px;
  font-weight: 700; font-size: 1.05rem; color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand img { width: 28px; height: 28px; }
.nav-links { display: flex; align-items: center; gap: 22px; font-size: 0.94rem; }
.nav-links a { color: var(--text-muted); font-weight: 500; }
.nav-links a:hover { color: var(--text); text-decoration: none; }
.header-controls { display: flex; align-items: center; gap: 10px; }
.pill-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 12px; border-radius: 999px;
  border: 1px solid var(--border); background: var(--surface);
  color: var(--text); font-size: 0.85rem; font-weight: 500; cursor: pointer;
}
.pill-btn:hover { border-color: var(--accent); text-decoration: none; }

/* Hero */
.hero { padding: 64px 0 48px; }
.hero-grid {
  display: grid; grid-template-columns: 1.05fr 1fr; gap: 40px; align-items: center;
}
.eyebrow {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 5px 12px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent);
  font-size: 0.82rem; font-weight: 600; margin-bottom: 18px;
}
.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(2rem, 4vw, 3.05rem);
  line-height: 1.15; letter-spacing: -0.025em;
}
.hero-lead {
  margin: 0 0 28px; color: var(--text-muted); font-size: 1.06rem; max-width: 54ch;
}
.hero-cta { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 24px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  padding: 12px 22px; border-radius: 12px; font-weight: 600; font-size: 0.96rem;
  border: 1px solid var(--border); background: var(--surface); color: var(--text);
  transition: transform 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.btn:hover { text-decoration: none; border-color: var(--accent); transform: translateY(-1px); }
.btn-primary { background: var(--accent); border-color: var(--accent); color: #ffffff; }
:root[data-theme="dark"] .btn-primary { color: #071917; }
.btn-primary:hover { background: var(--accent-hover); border-color: var(--accent-hover); }
.hero-metrics {
  display: flex; flex-wrap: wrap; gap: 20px; font-size: 0.86rem; color: var(--text-muted);
}
.hero-visual {
  border-radius: var(--radius-lg); overflow: hidden;
  border: 1px solid var(--border); background: var(--surface); box-shadow: var(--shadow-md);
}
.hero-visual img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

/* Sections */
.section { padding: 64px 0; border-top: 1px solid var(--border); }
.section-head { max-width: 68ch; margin-bottom: 32px; }
.section-head h2 {
  margin: 0 0 10px; font-size: clamp(1.5rem, 2.8vw, 2.15rem); letter-spacing: -0.02em;
}
.section-head p { margin: 0; color: var(--text-muted); font-size: 1rem; }

/* Interactive Matcher */
.matcher-shell {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); padding: 28px; box-shadow: var(--shadow-sm);
}
.matcher-controls {
  display: grid; grid-template-columns: 1.6fr 1fr; gap: 24px; margin-bottom: 24px;
  padding-bottom: 24px; border-bottom: 1px solid var(--border);
}
.matcher-label {
  font-size: 0.84rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: 0.04em; color: var(--text-muted); margin-bottom: 10px; display: block;
}
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px; border-radius: 10px;
  border: 1px solid var(--border); background: var(--surface-subtle);
  color: var(--text); font-size: 0.9rem; font-weight: 500; cursor: pointer;
  transition: all 0.14s ease;
}
.chip:hover { border-color: var(--accent); }
.chip[aria-selected="true"] {
  background: var(--accent); border-color: var(--accent); color: #ffffff;
}
:root[data-theme="dark"] .chip[aria-selected="true"] { color: #071917; }

.track-panel[hidden] { display: none; }
.track-top {
  display: flex; flex-wrap: wrap; align-items: baseline; justify-content: space-between;
  gap: 12px; margin-bottom: 12px;
}
.track-top h3 { margin: 0; font-size: 1.32rem; }
.tag {
  display: inline-block; padding: 4px 10px; border-radius: 999px;
  background: var(--accent-soft); color: var(--accent); font-size: 0.8rem; font-weight: 600;
}
.track-sub { margin: 0 0 16px; color: var(--text-muted); }
.prereq-list { margin: 0 0 20px; padding-left: 20px; color: var(--text-muted); font-size: 0.94rem; }
.prereq-list li { margin-bottom: 6px; }

.code-card {
  border-radius: var(--radius-md); overflow: hidden;
  border: 1px solid var(--border); background: var(--code-bg); color: var(--code-text);
  margin-bottom: 14px;
}
.code-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: 10px 16px; background: rgba(255, 255, 255, 0.05);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  font-size: 0.82rem; color: #a7bdb6;
}
.copy-btn {
  padding: 5px 12px; border-radius: 8px; border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.08); color: #ffffff;
  font-size: 0.82rem; font-weight: 600; cursor: pointer;
}
.copy-btn:hover { background: var(--accent); border-color: var(--accent); color: #ffffff; }
.code-pre {
  margin: 0; padding: 16px; overflow-x: auto;
  font-family: var(--font-mono); font-size: 0.86rem; line-height: 1.6; white-space: pre-wrap;
}
.manual-details {
  border: 1px solid var(--border); border-radius: var(--radius-sm);
  padding: 10px 14px; background: var(--surface-subtle);
}
.manual-details summary {
  cursor: pointer; font-weight: 600; font-size: 0.9rem; color: var(--text);
}
.manual-details .code-card { margin: 12px 0 0; }

/* Bento Capabilities */
.bento-grid {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 20px;
}
.bento-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 24px; box-shadow: var(--shadow-sm);
  display: flex; flex-direction: column; gap: 12px;
}
.bento-card h3 { margin: 0; font-size: 1.15rem; }
.bento-card p { margin: 0; color: var(--text-muted); font-size: 0.95rem; }
.bento-media {
  margin-top: 6px; border-radius: var(--radius-sm); overflow: hidden;
  border: 1px solid var(--border); background: var(--surface-subtle);
}
.bento-media img { width: 100%; aspect-ratio: 16 / 9; object-fit: cover; }

/* Curated Gallery */
.gallery-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 18px; }
.gallery-stage {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-sm);
}
.gallery-caption {
  padding: 14px 20px; border-bottom: 1px solid var(--border);
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 8px;
  font-size: 0.9rem; color: var(--text-muted);
}
.gallery-caption strong { color: var(--text); }
.gallery-stage img { width: 100%; max-height: 580px; object-fit: contain; background: var(--surface-subtle); }

/* Repo Matrix & Footer */
.repo-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 16px; }
.repo-card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--radius-md); padding: 20px;
  display: flex; flex-direction: column; gap: 8px;
}
.repo-head { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.repo-name { font-family: var(--font-mono); font-weight: 700; font-size: 0.96rem; }
.repo-card p { margin: 0; color: var(--text-muted); font-size: 0.92rem; }
.repo-meta { font-size: 0.82rem; color: var(--text-muted); margin-top: auto; padding-top: 6px; }

.disclaimer {
  margin-top: 28px; padding: 18px 20px; border-radius: var(--radius-md);
  background: var(--surface-subtle); border: 1px solid var(--border);
  font-size: 0.9rem; color: var(--text-muted);
}
.site-footer {
  padding: 36px 0 48px; border-top: 1px solid var(--border);
  color: var(--text-muted); font-size: 0.88rem;
}
.footer-row { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 14px; }

@media (max-width: 880px) {
  .hero-grid, .matcher-controls, .bento-grid, .repo-grid { grid-template-columns: 1fr; }
  .nav-links { display: none; }
  .hero { padding: 40px 0 32px; }
  .matcher-shell { padding: 20px; }
}
