:root {
  --ink: #071c23;
  --muted: #5e7074;
  --paper: #f4f1e9;
  --paper-2: #ebe7dc;
  --line: rgba(7, 28, 35, .16);
  --mint: #53d6b0;
  --mint-dark: #0d715c;
  --white: #fffdf7;
  --shadow: 0 24px 80px rgba(7, 28, 35, .10);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    radial-gradient(circle at 78% 14%, rgba(83,214,176,.10), transparent 28rem),
    var(--paper);
  font-family: Inter, "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  line-height: 1.65;
}
a { color: inherit; }
button, input { font: inherit; }

.skip-link { position: fixed; left: 1rem; top: -4rem; z-index: 99; padding: .65rem 1rem; background: var(--ink); color: white; }
.skip-link:focus { top: 1rem; }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); white-space: nowrap; border: 0; }

.site-header {
  max-width: 1360px;
  margin: 0 auto;
  padding: 1.6rem 3rem;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
}
.brand { display: inline-flex; align-items: center; gap: .8rem; text-decoration: none; font-size: .76rem; letter-spacing: .19em; font-weight: 800; }
.brand-mark { display: inline-flex; align-items: end; gap: 3px; width: 25px; height: 22px; }
.brand-mark i { display: block; width: 5px; background: var(--ink); border-radius: 8px 8px 2px 2px; }
.brand-mark i:nth-child(1) { height: 8px; }
.brand-mark i:nth-child(2) { height: 15px; }
.brand-mark i:nth-child(3) { height: 22px; background: var(--mint-dark); }
nav { display: flex; align-items: center; gap: 2rem; font-size: .88rem; }
nav a { text-decoration: none; }
nav a:hover { color: var(--mint-dark); }
.repo-link { padding: .55rem .9rem; border: 1px solid var(--line); border-radius: 999px; }

main { overflow: hidden; }
.hero { max-width: 1360px; min-height: 680px; margin: 0 auto; padding: 6.5rem 3rem 5rem; display: grid; grid-template-columns: 1.02fr .98fr; gap: 6rem; align-items: center; }
.eyebrow { margin: 0 0 1.25rem; display: flex; align-items: center; gap: .7rem; color: var(--mint-dark); font-size: .76rem; font-weight: 800; letter-spacing: .19em; }
.eyebrow span { width: 28px; height: 1px; background: currentColor; }
h1, h2 { margin: 0; font-family: Georgia, "Noto Serif SC", "Songti SC", serif; font-weight: 500; letter-spacing: -.035em; }
h1 { font-size: clamp(3.2rem, 6.2vw, 6.3rem); line-height: 1.02; }
h1 em { color: var(--mint-dark); font-style: normal; }
.hero-intro { max-width: 36rem; margin: 2rem 0 0; color: var(--muted); font-size: 1.08rem; }
.hero-actions { display: flex; gap: .8rem; margin-top: 2.4rem; flex-wrap: wrap; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 48px; padding: .75rem 1.25rem; border: 1px solid var(--ink); border-radius: 2px; text-decoration: none; font-size: .9rem; font-weight: 700; transition: .18s ease; }
.button-primary { background: var(--ink); color: white; }
.button-primary:hover { background: var(--mint-dark); border-color: var(--mint-dark); transform: translateY(-2px); }
.button-ghost:hover { background: rgba(255,255,255,.45); transform: translateY(-2px); }

.signal-panel { position: relative; padding: 1.2rem 1.2rem .9rem; background: var(--ink); color: white; box-shadow: var(--shadow); transform: rotate(1deg); }
.signal-panel:before { content: ""; position: absolute; inset: 10px; border: 1px solid rgba(255,255,255,.08); pointer-events: none; }
.signal-meta, .signal-labels { display: flex; justify-content: space-between; color: rgba(255,255,255,.55); font: 700 .64rem/1.2 ui-monospace, monospace; letter-spacing: .12em; }
.signal-panel svg { width: 100%; height: auto; margin: 1.25rem 0 .5rem; overflow: visible; }
.grid path { fill: none; stroke: rgba(255,255,255,.09); stroke-width: 1; }
.area { fill: url(#signalFill); }
.trace { fill: none; stroke: var(--mint); stroke-width: 3; stroke-linecap: round; }
.pulse { fill: var(--mint); filter: drop-shadow(0 0 9px var(--mint)); animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { r: 9; opacity: .45; } }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .pulse { animation: none; } }

.stats { max-width: 1360px; margin: 0 auto 7rem; padding: 0 3rem; display: grid; grid-template-columns: repeat(4,1fr); }
.stats div { padding: 1.45rem 1.6rem; border: 1px solid var(--line); border-right: 0; background: rgba(255,255,255,.28); }
.stats div:last-child { border-right: 1px solid var(--line); }
.stats strong { display: block; font-family: Georgia, serif; font-size: 2rem; font-weight: 500; }
.stats span { color: var(--muted); font-size: .78rem; }

.datasets-section { padding: 7rem max(3rem, calc((100vw - 1360px)/2 + 3rem)); background: var(--white); }
.section-heading { display: flex; justify-content: space-between; align-items: end; gap: 3rem; margin-bottom: 2.7rem; }
h2 { font-size: clamp(2.6rem, 4.5vw, 4.6rem); line-height: 1.08; }
.section-heading > div > p:last-child { margin: 1rem 0 0; color: var(--muted); }
.search-box { width: min(330px,100%); display: flex; align-items: center; gap: .65rem; border-bottom: 1px solid var(--ink); padding: .55rem .1rem; }
.search-box svg { width: 18px; fill: none; stroke: currentColor; stroke-width: 1.6; }
.search-box input { width: 100%; border: 0; outline: 0; background: transparent; color: var(--ink); }

.file-table-wrap { border-top: 2px solid var(--ink); }
.file-table-header, .file-row { display: grid; grid-template-columns: minmax(250px,2.2fr) .75fr .9fr 1fr; align-items: center; gap: 1rem; }
.file-table-header { padding: .8rem 1rem; color: var(--muted); border-bottom: 1px solid var(--line); font-size: .72rem; letter-spacing: .12em; text-transform: uppercase; }
.file-row { min-height: 92px; padding: 1.1rem 1rem; border-bottom: 1px solid var(--line); transition: background .15s ease; }
.file-row:hover { background: rgba(83,214,176,.07); }
.file-name { display: flex; align-items: center; min-width: 0; gap: 1rem; font-weight: 750; }
.file-icon { flex: 0 0 auto; width: 38px; height: 44px; display: grid; place-items: center; color: var(--mint-dark); border: 1px solid currentColor; font: 800 .62rem/1 ui-monospace, monospace; }
.file-name-text { overflow-wrap: anywhere; }
.file-meta { color: var(--muted); font-size: .9rem; }
.file-actions { display: flex; justify-content: flex-end; gap: .5rem; }
.download-button, .copy-button { border: 1px solid var(--ink); background: transparent; min-height: 42px; padding: .55rem .9rem; cursor: pointer; text-decoration: none; font-size: .82rem; font-weight: 750; }
.download-button { color: white; background: var(--ink); }
.download-button:hover { background: var(--mint-dark); border-color: var(--mint-dark); }
.copy-button:hover { background: var(--paper-2); }
.loading-row, .empty-row { display: flex; justify-content: center; align-items: center; min-height: 160px; color: var(--muted); }
.loader { width: 18px; height: 18px; margin-right: .7rem; border: 2px solid var(--line); border-top-color: var(--mint-dark); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.data-status { min-height: 1.5em; margin: 1rem 0 0; color: var(--muted); font-size: .8rem; }

.about-section { max-width: 1360px; margin: 0 auto; padding: 8rem 3rem; display: grid; grid-template-columns: .8fr 1.2fr; gap: 7rem; }
.about-copy > p:last-child { color: var(--muted); max-width: 38rem; }
.notes-grid { display: grid; grid-template-columns: repeat(3,1fr); border-top: 1px solid var(--line); }
.notes-grid article { padding: 1.5rem 1.4rem; border-right: 1px solid var(--line); }
.notes-grid article:first-child { border-left: 1px solid var(--line); }
.notes-grid span { color: var(--mint-dark); font: 800 .75rem ui-monospace, monospace; }
.notes-grid h3 { margin: 3.6rem 0 .7rem; font-size: 1.15rem; }
.notes-grid p { margin: 0; color: var(--muted); font-size: .9rem; }

footer { padding: 2rem max(3rem, calc((100vw - 1360px)/2 + 3rem)); background: var(--ink); color: rgba(255,255,255,.72); display: flex; align-items: center; gap: 2rem; font-size: .82rem; }
footer .brand-mark i { background: white; }
footer .brand-mark i:last-child { background: var(--mint); }
.footer-brand { color: white; margin-right: auto; }
footer a { color: var(--mint); text-decoration: none; }
.toast { position: fixed; right: 1.2rem; bottom: 1.2rem; z-index: 20; padding: .75rem 1rem; color: white; background: var(--ink); box-shadow: var(--shadow); transform: translateY(140%); transition: .2s ease; font-size: .86rem; }
.toast.show { transform: translateY(0); }

@media (max-width: 920px) {
  .site-header { padding: 1.25rem 1.4rem; }
  nav a:not(.repo-link) { display: none; }
  .hero { grid-template-columns: 1fr; min-height: auto; padding: 5rem 1.4rem 3rem; gap: 3.5rem; }
  .signal-panel { transform: none; }
  .stats { padding: 0 1.4rem; grid-template-columns: repeat(2,1fr); margin-bottom: 4rem; }
  .stats div:nth-child(2) { border-right: 1px solid var(--line); }
  .stats div:nth-child(n+3) { border-top: 0; }
  .datasets-section { padding: 5rem 1.4rem; }
  .section-heading { align-items: start; flex-direction: column; }
  .about-section { grid-template-columns: 1fr; padding: 5rem 1.4rem; gap: 3rem; }
  footer { padding: 2rem 1.4rem; flex-wrap: wrap; }
}

@media (max-width: 680px) {
  h1 { font-size: clamp(2.8rem, 15vw, 4.2rem); }
  .stats { grid-template-columns: 1fr 1fr; }
  .file-table-header { display: none; }
  .file-row { grid-template-columns: 1fr auto; gap: .6rem 1rem; padding: 1.2rem .25rem; }
  .file-name { grid-column: 1 / -1; }
  .file-row > .file-meta:nth-of-type(2) { display: none; }
  .file-actions { grid-column: 2; grid-row: 2; }
  .copy-button { display: none; }
  .notes-grid { grid-template-columns: 1fr; }
  .notes-grid article { border-left: 1px solid var(--line); border-bottom: 1px solid var(--line); }
  .notes-grid h3 { margin-top: 1.4rem; }
  footer p { width: 100%; order: 3; }
}
