:root {
  --bg: #0f1117;
  --surface: #1a1d27;
  --surface-2: #242833;
  --border: #2e3340;
  --text: #e8eaed;
  --text-muted: #9aa0a6;
  --accent: #f0b429;
  --accent-hover: #f5c84c;
  --accent-dim: rgba(240, 180, 41, 0.12);
  --danger: #ff6b6b;
  --link: #7dd3fc;
  --success: #4ade80;
  --radius: 14px;
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.35);
  --nav-h: 64px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { scroll-behavior: smooth; }

body {
  font-family: "Inter", system-ui, -apple-system, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  background:
    radial-gradient(ellipse 80% 50% at 50% -20%, rgba(240, 180, 41, 0.07), transparent),
    radial-gradient(ellipse 50% 40% at 100% 100%, rgba(125, 211, 252, 0.04), transparent);
  pointer-events: none;
  z-index: 0;
}

a { color: var(--link); text-decoration: none; }
a:hover { text-decoration: underline; }

.container {
  width: min(1080px, 92%);
  margin: 0 auto;
  position: relative;
  z-index: 1;
}

/* ========== NAV ========== */
.nav {
  position: sticky;
  top: 0;
  z-index: 100;
  height: var(--nav-h);
  background: rgba(15, 17, 23, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1080px, 92%);
  margin: 0 auto;
  gap: 1rem;
}

.nav-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-family: "Space Grotesk", sans-serif;
  font-weight: 700;
  font-size: 1.05rem;
  color: var(--text);
  text-decoration: none;
  flex-shrink: 0;
}
.nav-brand:hover { text-decoration: none; color: var(--accent); }
.nav-brand img {
  width: 36px;
  height: 36px;
  border-radius: 50%;
  border: 1.5px solid var(--border);
  object-fit: cover;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 0.15rem;
  list-style: none;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-links a {
  color: var(--text-muted);
  font-size: 0.9rem;
  font-weight: 500;
  padding: 0.4rem 0.7rem;
  border-radius: 8px;
  text-decoration: none;
  transition: color 0.15s, background 0.15s;
}
.nav-links a:hover,
.nav-links a.active {
  color: var(--text);
  background: var(--surface-2);
  text-decoration: none;
}
.nav-links a.active {
  color: var(--accent);
}

.nav-toggle {
  display: none;
  background: none;
  border: 1px solid var(--border);
  color: var(--text);
  padding: 0.4rem 0.6rem;
  border-radius: 8px;
  cursor: pointer;
  font-size: 1.1rem;
}

/* ========== HERO ========== */
.hero {
  padding: 3rem 0 2rem;
  text-align: center;
  border-bottom: 1px solid var(--border);
}

.hero h1 {
  font-family: "Space Grotesk", sans-serif;
  font-size: clamp(1.8rem, 5vw, 2.6rem);
  font-weight: 700;
  letter-spacing: -0.03em;
  margin-bottom: 0.5rem;
}

.hero .subtitle {
  color: var(--text-muted);
  font-size: 1.05rem;
  max-width: 560px;
  margin: 0 auto;
}

.hero .badge {
  display: inline-block;
  background: var(--accent-dim);
  color: var(--accent);
  font-size: 0.8rem;
  font-weight: 600;
  padding: 0.25rem 0.7rem;
  border-radius: 999px;
  margin-bottom: 0.75rem;
}

/* ========== MAIN ========== */
main {
  flex: 1;
  padding: 2.5rem 0 3.5rem;
  position: relative;
  z-index: 1;
}

/* ========== CARDS GRID ========== */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 1.25rem;
}

.card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.15s, border-color 0.15s, box-shadow 0.15s;
  display: flex;
  flex-direction: column;
}
.card:hover {
  transform: translateY(-3px);
  border-color: #3d4455;
  box-shadow: var(--shadow);
}

.card-img {
  aspect-ratio: 16/10;
  background: var(--surface-2);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 2.5rem;
  overflow: hidden;
}
.card-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.card-body {
  padding: 1.1rem 1.2rem 1.25rem;
  flex: 1;
  display: flex;
  flex-direction: column;
}
.card-body h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
  font-weight: 600;
  margin-bottom: 0.3rem;
}
.card-body p {
  color: var(--text-muted);
  font-size: 0.88rem;
  flex: 1;
  margin-bottom: 0.9rem;
}
.card-body .btn {
  margin-top: auto;
}

/* ========== BUTTONS ========== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 0.9rem;
  padding: 0.55rem 1.1rem;
  border-radius: 999px;
  border: none;
  cursor: pointer;
  text-decoration: none;
  transition: transform 0.12s, box-shadow 0.12s, background 0.12s;
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }

.btn-primary {
  background: linear-gradient(135deg, var(--accent), #e6a817);
  color: #1a1200;
  box-shadow: 0 4px 16px rgba(240, 180, 41, 0.3);
}
.btn-primary:hover {
  box-shadow: 0 6px 22px rgba(240, 180, 41, 0.4);
  color: #1a1200;
}

.btn-secondary {
  background: var(--surface-2);
  color: var(--text);
  border: 1px solid var(--border);
}
.btn-secondary:hover {
  background: #2c3140;
  color: var(--text);
}

.btn-sm {
  font-size: 0.82rem;
  padding: 0.4rem 0.85rem;
}

/* ========== PAPER LIST ========== */
.paper-list {
  display: flex;
  flex-direction: column;
  gap: 0.6rem;
}

.paper-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 0.9rem 1.15rem;
  transition: border-color 0.15s;
}
.paper-item:hover { border-color: #3d4455; }

.paper-info h4 {
  font-size: 0.95rem;
  font-weight: 600;
  margin-bottom: 0.15rem;
}
.paper-info span {
  font-size: 0.8rem;
  color: var(--text-muted);
}

.paper-actions {
  display: flex;
  gap: 0.5rem;
  flex-shrink: 0;
}

/* ========== SECTION ========== */
.section {
  margin-bottom: 2.5rem;
}
.section-title {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.25rem;
  font-weight: 600;
  margin-bottom: 1rem;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}
.section-title::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
  margin-left: 0.5rem;
}

.prose {
  color: var(--text-muted);
  font-size: 0.95rem;
  max-width: 65ch;
}
.prose p { margin-bottom: 0.75rem; }
.prose strong { color: var(--text); }

/* ========== NOTICE / ALERT ========== */
.notice {
  background: var(--accent-dim);
  border: 1px solid rgba(240, 180, 41, 0.25);
  border-radius: 12px;
  padding: 1rem 1.2rem;
  font-size: 0.9rem;
  color: #f0d78c;
  margin-bottom: 1.5rem;
}
.notice strong { color: var(--accent); }

/* ========== SOFTWARE CARDS ========== */
.soft-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 1.25rem;
}

.soft-card {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.4rem;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  transition: border-color 0.15s, transform 0.15s;
}
.soft-card:hover {
  border-color: #3d4455;
  transform: translateY(-2px);
}
.soft-icon {
  width: 52px;
  height: 52px;
  border-radius: 12px;
  background: var(--surface-2);
  display: grid;
  place-items: center;
  font-size: 1.6rem;
  margin-bottom: 0.9rem;
  overflow: hidden;
}
.soft-icon img {
  width: 100%;
  height: 100%;
  object-fit: contain;
}
.soft-card h3 {
  font-family: "Space Grotesk", sans-serif;
  font-size: 1.05rem;
  margin-bottom: 0.3rem;
}
.soft-card p {
  color: var(--text-muted);
  font-size: 0.85rem;
  flex: 1;
  margin-bottom: 1rem;
}
.soft-card .btn { margin-top: auto; }

/* ========== CHANGELOG ========== */
.changelog {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}
.changelog-entry {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 1.25rem 1.4rem;
}
.changelog-date {
  font-family: "Space Grotesk", sans-serif;
  font-weight: 600;
  color: var(--accent);
  font-size: 0.95rem;
  margin-bottom: 0.5rem;
}
.changelog-entry ul {
  padding-left: 1.2rem;
  color: var(--text-muted);
  font-size: 0.9rem;
}
.changelog-entry li { margin-bottom: 0.3rem; }
.changelog-by {
  font-size: 0.8rem;
  color: var(--text-muted);
  margin-top: 0.6rem;
  opacity: 0.8;
}

/* ========== FOOTER ========== */
footer {
  border-top: 1px solid var(--border);
  background: var(--surface);
  padding: 2rem 0 2.25rem;
  position: relative;
  z-index: 1;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem 2.5rem;
  justify-content: space-between;
  align-items: flex-start;
}
.footer-brand {
  display: flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 600;
  font-size: 0.95rem;
}
.footer-brand img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.footer-links {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  font-size: 0.88rem;
}
.footer-links a { color: var(--text-muted); }
.footer-links a:hover { color: var(--accent); }
.footer-contact {
  font-size: 0.85rem;
  color: var(--text-muted);
  max-width: 280px;
}
.footer-contact a { color: var(--link); }

/* ========== UTILS ========== */
.text-center { text-align: center; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }

/* ========== MOBILE ========== */
@media (max-width: 720px) {
  .nav-toggle { display: block; }
  .nav-links {
    display: none;
    position: absolute;
    top: var(--nav-h);
    left: 0;
    right: 0;
    background: var(--surface);
    border-bottom: 1px solid var(--border);
    flex-direction: column;
    align-items: stretch;
    padding: 0.75rem;
    gap: 0.25rem;
  }
  .nav-links.open { display: flex; }
  .nav-links a {
    padding: 0.7rem 1rem;
  }

  .paper-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .paper-actions { width: 100%; }
  .paper-actions .btn { flex: 1; }

  .footer-inner {
    flex-direction: column;
    gap: 1.25rem;
  }
}

@media (max-width: 480px) {
  .hero { padding: 2rem 0 1.5rem; }
  main { padding: 1.75rem 0 2.5rem; }
}
