:root {
  color-scheme: light;
  --ink: #182230;
  --muted: #697789;
  --soft: #98a4b2;
  --line: #e3e8ee;
  --paper: #f5f7f9;
  --surface: #fff;
  --blue: #4058d6;
  --blue-soft: #eef1ff;
  --green: #3f876a;
  --shadow: 0 20px 55px rgba(24, 34, 48, 0.08);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", sans-serif;
  font-synthesis: none;
  text-rendering: optimizeLegibility;
}

* { box-sizing: border-box; }

body {
  min-width: 320px;
  min-height: 100vh;
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(ellipse at 8% 0%, rgba(197, 210, 255, 0.36), transparent 38rem),
    radial-gradient(ellipse at 100% 12%, rgba(200, 230, 218, 0.28), transparent 33rem),
    var(--paper);
}

a { color: inherit; }
button, input, select { font: inherit; }

.page-shell { width: min(1120px, calc(100% - 40px)); margin: 0 auto; }
.hero { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; align-items: end; padding: 38px 0 32px; }
.hero-copy { padding: 18px 0 12px; }
.back-link { color: var(--muted); font-size: 13px; font-weight: 650; text-decoration: none; }
.back-link:hover { color: var(--blue); }
.eyebrow { margin: 0 0 12px; color: #768394; font-size: 10px; font-weight: 800; letter-spacing: 0.17em; }
.hero .eyebrow { margin-top: 36px; }
h1, h2, h3, p { margin-top: 0; }
h1 { max-width: 760px; margin-bottom: 17px; font-size: clamp(36px, 6.3vw, 64px); font-weight: 850; letter-spacing: -0.055em; line-height: 1.06; }
h1 span { display: inline-block; margin-left: 12px; color: var(--blue); }
.hero-description { max-width: 610px; margin-bottom: 18px; color: var(--muted); font-size: 15px; line-height: 1.85; }
.source-link { display: inline-flex; align-items: center; gap: 8px; color: var(--blue); font-size: 13px; font-weight: 750; text-decoration: none; }
.source-link:hover, .empty-state a:hover { text-decoration: underline; }
.hero-note { position: relative; overflow: hidden; padding: 22px; border: 1px solid rgba(255, 255, 255, 0.88); border-radius: 20px; background: rgba(255, 255, 255, 0.73); box-shadow: var(--shadow); }
.hero-note::after { position: absolute; top: -28px; right: -22px; width: 124px; height: 124px; border-radius: 50%; background: rgba(221, 228, 255, 0.54); content: ""; }
.note-icon { position: relative; z-index: 1; display: grid; width: 40px; height: 40px; place-items: center; margin-bottom: 22px; border-radius: 13px; color: #fff; background: #24292f; font-size: 12px; font-weight: 850; letter-spacing: -0.04em; }
.hero-note strong { display: block; margin-bottom: 8px; font-size: 15px; }
.hero-note p { margin-bottom: 20px; color: var(--muted); font-size: 12px; line-height: 1.75; }
.note-foot { color: var(--soft); font-size: 9px; font-weight: 800; letter-spacing: 0.12em; }

.overview { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.overview-card { min-height: 116px; padding: 18px 20px; border: 1px solid var(--line); border-radius: 17px; background: rgba(255, 255, 255, 0.84); }
.metric-label, .metric-caption { display: block; color: var(--muted); font-size: 11px; }
.metric-label { margin-bottom: 9px; font-weight: 700; }
.overview-card strong { display: block; overflow: hidden; margin-bottom: 4px; font-size: 23px; font-weight: 820; letter-spacing: -0.035em; text-overflow: ellipsis; white-space: nowrap; }
.overview-card:nth-child(2) strong { font-size: 17px; letter-spacing: -0.02em; }

.report-section { margin-top: 24px; padding: 28px; border: 1px solid var(--line); border-radius: 22px; background: rgba(255, 255, 255, 0.88); box-shadow: var(--shadow); }
.section-heading { display: flex; align-items: end; justify-content: space-between; gap: 16px; margin-bottom: 22px; }
.section-heading .eyebrow { margin-bottom: 7px; }
h2 { margin-bottom: 0; font-size: 25px; font-weight: 830; letter-spacing: -0.04em; }
.history-control { display: grid; gap: 7px; color: var(--muted); font-size: 11px; font-weight: 700; }
.history-control select { min-width: 180px; padding: 10px 34px 10px 12px; border: 1px solid var(--line); border-radius: 11px; color: var(--ink); background: #fff; font-size: 12px; }
.history-control select:disabled { color: #8b96a3; background: #f5f6f8; }
.report-note { margin-bottom: 17px; padding: 12px 14px; border: 1px solid #e5e9f5; border-radius: 12px; color: #56627b; background: #f7f8fc; font-size: 12px; line-height: 1.65; }
.source-attribution { margin: -7px 0 17px; color: var(--muted); font-size: 11px; line-height: 1.7; }
.source-attribution a { color: var(--blue); text-underline-offset: 2px; }
.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.search-box { display: flex; width: min(440px, 100%); min-height: 43px; align-items: center; gap: 10px; padding: 0 13px; border: 1px solid var(--line); border-radius: 12px; color: #8a96a4; background: #fff; }
.search-box span { font-size: 21px; line-height: 1; transform: rotate(-18deg); }
.search-box input { width: 100%; border: 0; outline: 0; color: var(--ink); background: transparent; font-size: 12px; }
.search-box input::placeholder { color: #9aa4b0; }
.search-box:focus-within { border-color: #a8b4ff; box-shadow: 0 0 0 3px rgba(64, 88, 214, 0.08); }
.result-count { margin: 0; color: var(--soft); font-size: 11px; }
.project-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 14px; }
.project-card { min-width: 0; padding: 18px; border: 1px solid var(--line); border-radius: 16px; background: #fff; transition: transform 160ms ease, box-shadow 160ms ease, border-color 160ms ease; }
.project-card:hover { transform: translateY(-2px); border-color: #d4dcf5; box-shadow: 0 13px 28px rgba(24, 34, 48, 0.07); }
.project-topline { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
.rank-pill { display: inline-flex; min-width: 37px; min-height: 25px; align-items: center; justify-content: center; padding: 0 8px; border-radius: 8px; color: #4759ba; background: #eef1ff; font-size: 10px; font-weight: 850; }
.category-tag { overflow: hidden; color: #788495; font-size: 10px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.project-name { display: inline-block; max-width: 100%; margin-bottom: 4px; overflow-wrap: anywhere; color: var(--ink); font-size: 16px; font-weight: 820; letter-spacing: -0.025em; text-decoration: none; }
.project-name:hover { color: var(--blue); }
.project-owner { margin-bottom: 11px; color: var(--soft); font-size: 10px; }
.project-summary { min-height: 42px; margin-bottom: 13px; color: #596779; font-size: 12px; line-height: 1.75; }
.trend-reason { margin: 0 0 15px; padding-left: 10px; border-left: 2px solid #dce2ff; color: #77849a; font-size: 11px; line-height: 1.65; }
.project-meta { display: flex; flex-wrap: wrap; gap: 7px; padding-top: 12px; border-top: 1px solid #edf0f3; }
.meta-chip { display: inline-flex; align-items: center; gap: 5px; min-height: 25px; padding: 0 8px; border-radius: 7px; color: #576477; background: #f4f6f8; font-size: 10px; }
.meta-chip.week-growth { color: #2f795d; background: #edf7f1; font-weight: 750; }
.empty-state { display: grid; justify-items: center; padding: 48px 20px 42px; text-align: center; }
.empty-mark { display: grid; width: 48px; height: 48px; place-items: center; margin-bottom: 17px; border-radius: 16px; color: var(--blue); background: var(--blue-soft); font-size: 24px; }
.empty-state h3 { margin-bottom: 9px; font-size: 17px; letter-spacing: -0.025em; }
.empty-state p { max-width: 510px; margin-bottom: 17px; color: var(--muted); font-size: 12px; line-height: 1.8; }
.empty-state a { color: var(--blue); font-size: 12px; font-weight: 750; text-decoration: none; }
.load-error { margin: 14px 0 0; padding: 12px 14px; border-radius: 10px; color: #9e3e47; background: #fff0f0; font-size: 12px; }
.page-footer { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 22px 2px 30px; color: var(--soft); font-size: 10px; }
.page-footer p { margin: 0; line-height: 1.6; }
.page-footer span { flex: 0 0 auto; font-size: 9px; font-weight: 800; letter-spacing: 0.12em; }
.page-footer i { padding: 0 4px; color: #c0c8d1; font-style: normal; }

@media (max-width: 760px) {
  .page-shell { width: min(100% - 28px, 620px); }
  .hero { grid-template-columns: 1fr; gap: 16px; padding-top: 24px; }
  .hero-copy { padding-top: 8px; }
  .hero .eyebrow { margin-top: 28px; }
  .hero-note { display: grid; grid-template-columns: 44px 1fr; column-gap: 13px; align-items: center; padding: 15px; }
  .note-icon { grid-row: span 3; margin: 0; }
  .hero-note strong { margin: 0 0 3px; }
  .hero-note p { margin: 0 0 4px; }
  .note-foot { font-size: 8px; }
  .report-section { padding: 20px 16px; }
  .project-grid { grid-template-columns: 1fr; }
}

@media (max-width: 480px) {
  .page-shell { width: calc(100% - 22px); }
  .hero { padding-top: 18px; }
  h1 { font-size: 39px; }
  h1 span { margin-left: 7px; }
  .hero-description { font-size: 13px; }
  .overview { gap: 7px; }
  .overview-card { min-height: 99px; padding: 12px 10px; border-radius: 13px; }
  .metric-label, .metric-caption { font-size: 9px; }
  .overview-card strong { font-size: 18px; }
  .overview-card:nth-child(2) strong { font-size: 12px; }
  .report-section { margin-top: 16px; padding: 18px 12px; border-radius: 18px; }
  .section-heading { align-items: start; flex-direction: column; }
  .history-control { width: 100%; }
  .history-control select { width: 100%; }
  .toolbar { align-items: start; flex-direction: column; }
  .search-box { width: 100%; }
  .page-footer { align-items: start; flex-direction: column; padding-bottom: 22px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { scroll-behavior: auto !important; transition-duration: 0.01ms !important; }
}
