:root {
  color-scheme: light;
  --bg: #f3f1ec;
  --bg-accent: #f7e4c8;
  --bg-panel: #fff8ef;
  --ink: #1b1a18;
  --muted: #5b5347;
  --brand: #f06f3b;
  --brand-dark: #2d1d1f;
  --card: #ffffff;
  --line: rgba(31, 26, 20, 0.12);
  --shadow: 0 24px 50px rgba(20, 10, 5, 0.12);
  font-family: "Noto Serif SC", serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #fff2e1 0%, #f2ece3 40%, #efe7dc 100%);
  color: var(--ink);
}

.bg-orbit {
  position: fixed;
  inset: -10% 0 auto;
  height: 420px;
  background: conic-gradient(from 180deg, #f9c399, #f7f0e4, #f8ac7e, #f9c399);
  filter: blur(30px);
  opacity: 0.5;
  z-index: -1;
}

.site-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 28px clamp(20px, 5vw, 64px);
}

.brand {
  display: flex;
  align-items: center;
  gap: 14px;
}

.brand-mark {
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  background: var(--brand);
  color: #fff;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 20px;
  box-shadow: var(--shadow);
}

.brand-title {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 20px;
}

.brand-subtitle {
  color: var(--muted);
  font-size: 13px;
}

.site-nav {
  display: flex;
  gap: 20px;
  font-family: "Space Grotesk", sans-serif;
  font-size: 14px;
}

.site-nav a {
  text-decoration: none;
  color: var(--ink);
  position: relative;
  padding-bottom: 4px;
}

.site-nav a::after {
  content: "";
  position: absolute;
  left: 0;
  bottom: 0;
  width: 0;
  height: 2px;
  background: var(--brand);
  transition: width 0.3s ease;
}

.site-nav a:hover::after {
  width: 100%;
}

.site-main {
  padding: 0 clamp(20px, 5vw, 80px) 60px;
}

.hero {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(260px, 1fr));
  gap: 26px;
  align-items: stretch;
}

.hero-copy h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(32px, 3.8vw, 52px);
  margin: 0 0 16px;
}

.hero-copy p {
  margin: 0 0 18px;
  color: var(--muted);
  font-size: 16px;
  line-height: 1.7;
}

.hero-meta {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 14px;
  color: var(--muted);
  background: #fffdf9;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
}

.hero-meta .dot {
  color: var(--brand);
}

.hero-panel {
  background: var(--bg-panel);
  border-radius: 24px;
  padding: 24px;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  display: flex;
  flex-direction: column;
  gap: 16px;
}

.hero-panel-title {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 18px;
}

.hero-panel-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-stats {
  display: flex;
  gap: 24px;
  margin: 12px 0 16px;
}

.hero-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.hero-stat-num {
  font-family: "Space Grotesk", sans-serif;
  font-size: 28px;
  font-weight: 700;
  color: var(--brand);
  line-height: 1.1;
}

.hero-stat-label {
  font-size: 12px;
  color: var(--muted);
  margin-top: 2px;
}

.hero-panel-subtitle {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
}

.hero-panel-tags span {
  background: #fff;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  border: 1px solid var(--line);
}

.paper-section {
  margin-top: 42px;
}

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  margin-bottom: 18px;
}

.search-icon {
  position: absolute;
  left: 16px;
  color: var(--muted);
  pointer-events: none;
}

#search-input {
  width: 100%;
  padding: 12px 16px 12px 44px;
  font-size: 15px;
  font-family: "Noto Serif SC", serif;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  color: var(--ink);
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}

#search-input::placeholder {
  color: var(--muted);
  opacity: 0.6;
}

#search-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(240, 111, 59, 0.15);
}

.search-count {
  position: absolute;
  right: 16px;
  font-size: 13px;
  color: var(--muted);
  pointer-events: none;
  white-space: nowrap;
}

.date-filter {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 18px;
  flex-wrap: wrap;
}

.date-quick-btns {
  display: flex;
  gap: 6px;
}

.date-quick-btn {
  padding: 6px 14px;
  font-size: 13px;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 500;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s ease;
  white-space: nowrap;
}

.date-quick-btn:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.date-quick-btn.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: 0 2px 8px rgba(240, 111, 59, 0.25);
}

.date-range-inputs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  transition: border-color 0.25s;
}

.date-range-inputs:focus-within {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(240, 111, 59, 0.1);
}

.date-range-inputs svg {
  color: var(--muted);
  flex-shrink: 0;
}

.date-filter input[type="date"] {
  padding: 6px 4px;
  font-size: 13px;
  font-family: "Space Grotesk", sans-serif;
  border: none;
  background: transparent;
  color: var(--ink);
  outline: none;
  min-width: 120px;
}

.date-filter-sep {
  font-size: 14px;
  color: var(--muted);
  user-select: none;
}

.date-filter-clear {
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  padding: 0;
  font-size: 14px;
  line-height: 1;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: var(--muted);
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}

.date-filter-clear:hover {
  background: rgba(240, 111, 59, 0.12);
  color: var(--brand);
}

.arxiv-ingest {
  margin-top: 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--card);
  display: grid;
  gap: 10px;
  max-width: min(560px, 100%);
}

.arxiv-ingest-title {
  font-size: 13px;
  color: var(--muted);
}

.arxiv-ingest-row {
  display: flex;
  align-items: center;
  gap: 8px;
}

#arxiv-input {
  flex: 1;
  width: auto;
  min-width: 0;
  padding: 10px 12px;
  font-size: 14px;
  font-family: "Noto Serif SC", serif;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  color: var(--ink);
  outline: none;
  transition: border-color 0.25s, box-shadow 0.25s;
}

#arxiv-input:focus {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(240, 111, 59, 0.12);
}

.arxiv-btn {
  padding: 9px 12px;
  border: 1px solid var(--brand);
  border-radius: 10px;
  background: var(--brand);
  color: #fff;
  font-size: 13px;
  font-family: "Space Grotesk", sans-serif;
  cursor: pointer;
  transition: all 0.2s ease;
}

.arxiv-btn:hover:not(:disabled) {
  filter: brightness(0.95);
}

.arxiv-btn:disabled {
  cursor: not-allowed;
  opacity: 0.5;
}

.arxiv-btn-outline {
  background: transparent;
  color: var(--brand);
}

.arxiv-status {
  font-size: 13px;
  min-height: 18px;
}

.arxiv-status.info {
  color: var(--muted);
}

.arxiv-status.success {
  color: var(--brand-dark);
}

.arxiv-status.warning {
  color: var(--brand);
}

.arxiv-status.error {
  color: var(--brand);
}

.section-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-bottom: 18px;
}

.section-header h2 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 26px;
  margin: 0;
}

.section-hint {
  color: var(--muted);
  font-size: 13px;
}

.paper-list {
  display: grid;
  gap: 18px;
}

.paper-card {
  background: var(--card);
  border-radius: 20px;
  padding: 22px 24px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(26, 20, 15, 0.08);
  display: grid;
  gap: 14px;
  animation: rise 0.6s ease both;
}

.paper-card h3 {
  margin: 0;
  font-family: "Space Grotesk", sans-serif;
  font-size: 20px;
}

.paper-card h3 a {
  text-decoration: none;
  color: var(--brand-dark);
}

.paper-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  font-size: 12px;
  color: var(--muted);
}

.paper-summary {
  margin: 0;
  color: #3a2f28;
  line-height: 1.7;
}

.paper-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.paper-tags span {
  font-size: 12px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
}

.site-footer {
  padding: 30px clamp(20px, 5vw, 80px);
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  color: var(--muted);
  font-size: 12px;
  border-top: 1px solid var(--line);
}

@keyframes rise {
  from {
    transform: translateY(12px);
    opacity: 0;
  }
  to {
    transform: translateY(0);
    opacity: 1;
  }
}

@media (max-width: 720px) {
  .site-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 16px;
  }

  .site-nav {
    flex-wrap: wrap;
    gap: 12px;
  }

  .hero-meta {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .section-header {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .site-footer {
    flex-direction: column;
    gap: 8px;
  }

  .arxiv-ingest-row {
    flex-wrap: wrap;
  }

  .arxiv-btn {
    width: 100%;
    justify-content: center;
  }
}

/* ── skeleton loading animation ──────────────────────── */

@keyframes shimmer {
  0% { background-position: -400px 0; }
  100% { background-position: 400px 0; }
}

.skeleton-card {
  pointer-events: none;
}

.sk-line {
  height: 16px;
  border-radius: 6px;
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
  background-size: 800px 100%;
  animation: shimmer 1.5s infinite ease-in-out;
}

.sk-title {
  width: 65%;
  height: 22px;
  margin-bottom: 12px;
}

.sk-meta {
  width: 45%;
  height: 13px;
  margin-bottom: 14px;
}

.sk-body {
  width: 90%;
  margin-bottom: 8px;
}

.sk-body.short {
  width: 60%;
}

/* ── scroll sentinel ─────────────────────────────────── */

.scroll-sentinel {
  text-align: center;
  padding: 24px;
  color: var(--muted);
  font-size: 14px;
}
