/* ===== NSU Study Stash — styles ===== */
:root {
  --bg: #f6f7fb;
  --bg-elev: #ffffff;
  --text: #1a1c23;
  --text-soft: #5b6072;
  --muted: #8a90a2;
  --border: #e6e8f0;
  --brand: #4f46e5;
  --brand-2: #7c3aed;
  --brand-soft: #eef0fe;
  --accent: #0ea5e9;
  --shadow: 0 1px 2px rgba(16,24,40,.04), 0 8px 24px rgba(16,24,40,.06);
  --shadow-lg: 0 12px 40px rgba(16,24,40,.12);
  --radius: 16px;
  --cse: #4f46e5; --ged: #0ea5e9; --mat: #f59e0b;
}
:root[data-theme="dark"] {
  --bg: #0c0e16;
  --bg-elev: #151823;
  --text: #eceef5;
  --text-soft: #aeb4c6;
  --muted: #767d92;
  --border: #242838;
  --brand-soft: #1c1f3a;
  --shadow: 0 1px 2px rgba(0,0,0,.3), 0 8px 24px rgba(0,0,0,.35);
  --shadow-lg: 0 16px 48px rgba(0,0,0,.55);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: "Inter", system-ui, -apple-system, Segoe UI, Roboto, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}
a { color: var(--brand); text-decoration: none; }
a:hover { text-decoration: underline; }
.muted { color: var(--muted); font-size: .9rem; }

.skip-link {
  position: absolute; left: -999px; top: 0; background: var(--brand); color: #fff;
  padding: .6rem 1rem; border-radius: 0 0 8px 0; z-index: 100;
}
.skip-link:focus { left: 0; }

/* ---------- Hero ---------- */
.hero {
  background:
    radial-gradient(1200px 400px at 15% -10%, rgba(124,58,237,.22), transparent 60%),
    radial-gradient(900px 360px at 95% 0%, rgba(14,165,233,.18), transparent 55%),
    linear-gradient(180deg, var(--brand-soft), transparent);
  padding-bottom: 2.5rem;
  border-bottom: 1px solid var(--border);
}
.hero__bar {
  max-width: 1140px; margin: 0 auto; padding: 1rem 1.25rem;
  display: flex; align-items: center; justify-content: space-between; gap: 1rem;
}
.brand { display: flex; align-items: center; gap: .55rem; font-weight: 800; font-size: 1.15rem; }
.brand__mark {
  display: grid; place-items: center; width: 34px; height: 34px; border-radius: 10px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; font-size: 1.1rem;
}
.hero__nav { display: flex; align-items: center; gap: 1.1rem; font-weight: 600; font-size: .95rem; }
.hero__nav a { color: var(--text-soft); }
.hero__nav a:hover { color: var(--brand); text-decoration: none; }
.theme-toggle {
  border: 1px solid var(--border); background: var(--bg-elev); border-radius: 10px;
  width: 38px; height: 38px; cursor: pointer; font-size: 1.05rem; line-height: 1;
}
.hero__content { max-width: 820px; margin: 1.5rem auto 0; padding: 0 1.25rem; text-align: center; }
.hero h1 {
  font-size: clamp(1.9rem, 5vw, 3.1rem); line-height: 1.1; margin: .4rem 0 .6rem; letter-spacing: -.02em;
  background: linear-gradient(120deg, var(--text), var(--brand)); -webkit-background-clip: text; background-clip: text; color: transparent;
}
.hero__sub { color: var(--text-soft); font-size: clamp(1rem, 2.2vw, 1.15rem); margin: 0 auto; max-width: 680px; }
.stats { display: flex; flex-wrap: wrap; justify-content: center; gap: .6rem; margin-top: 1.4rem; }
.stat {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 999px;
  padding: .45rem 1rem; font-size: .9rem; font-weight: 600; box-shadow: var(--shadow);
}
.stat b { color: var(--brand); }

/* ---------- Controls ---------- */
main { max-width: 1140px; margin: 0 auto; padding: 1.75rem 1.25rem 2rem; }
.controls {
  position: sticky; top: 0; z-index: 20; background: var(--bg);
  padding: 1rem 0 .85rem; margin-bottom: .5rem;
  display: flex; flex-wrap: wrap; gap: .8rem; align-items: center; justify-content: space-between;
}
.search {
  flex: 1 1 280px; display: flex; align-items: center; gap: .55rem;
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: 12px; padding: .15rem .8rem;
  box-shadow: var(--shadow);
}
.search svg { width: 18px; height: 18px; color: var(--muted); flex: none; }
.search input {
  flex: 1; border: none; outline: none; background: transparent; color: var(--text);
  font-size: 1rem; padding: .65rem 0; font-family: inherit;
}
.filters { display: flex; flex-wrap: wrap; gap: .4rem; }
.filters button {
  border: 1px solid var(--border); background: var(--bg-elev); color: var(--text-soft);
  padding: .55rem .95rem; border-radius: 999px; font-weight: 600; font-size: .9rem; cursor: pointer;
  font-family: inherit; transition: all .15s ease;
}
.filters button:hover { color: var(--text); }
.filters button[aria-selected="true"] {
  background: var(--brand); border-color: var(--brand); color: #fff;
}

/* ---------- Grid ---------- */
.grid {
  display: grid; gap: 1rem;
  grid-template-columns: repeat(auto-fill, minmax(290px, 1fr));
}
.card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.15rem 1.15rem 1rem; display: flex; flex-direction: column; gap: .7rem;
  box-shadow: var(--shadow); transition: transform .16s ease, box-shadow .16s ease, border-color .16s ease;
}
.card:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: var(--brand); }
.card__top { display: flex; align-items: center; justify-content: space-between; gap: .5rem; }
.code { font-family: "JetBrains Mono", ui-monospace, monospace; font-weight: 600; font-size: 1.05rem; }
.badge {
  font-size: .7rem; font-weight: 700; letter-spacing: .04em; text-transform: uppercase;
  padding: .25rem .55rem; border-radius: 6px; color: #fff;
}
.badge--cse { background: var(--cse); } .badge--ged { background: var(--ged); } .badge--mat { background: var(--mat); }
.card__name { font-weight: 700; font-size: 1.08rem; margin: 0; line-height: 1.3; }
.meta { display: flex; flex-direction: column; gap: .3rem; font-size: .88rem; color: var(--text-soft); }
.meta div { display: flex; gap: .5rem; }
.meta .k { color: var(--muted); min-width: 78px; flex: none; }
.meta .v { color: var(--text); }
.card__actions { display: flex; gap: .55rem; margin-top: auto; padding-top: .35rem; }
.btn {
  flex: 1; text-align: center; padding: .6rem .8rem; border-radius: 10px; font-weight: 700;
  font-size: .9rem; border: 1px solid var(--border); cursor: pointer; transition: all .15s ease;
}
.btn--dl { background: linear-gradient(135deg, var(--brand), var(--brand-2)); color: #fff; border: none; }
.btn--dl:hover { filter: brightness(1.07); text-decoration: none; }
.btn--repo { background: var(--bg-elev); color: var(--text); }
.btn--repo:hover { border-color: var(--brand); color: var(--brand); text-decoration: none; }
.empty { text-align: center; color: var(--muted); padding: 3rem 0; font-size: 1.05rem; }

/* ---------- Info / footer ---------- */
.info {
  max-width: 1140px; margin: 1rem auto 0; padding: 0 1.25rem;
  display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
}
.info__card {
  background: var(--bg-elev); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 1.4rem 1.5rem; box-shadow: var(--shadow);
}
.info__card--alt { border-left: 4px solid var(--mat); }
.info__card h2 { margin: 0 0 .6rem; font-size: 1.2rem; }
.info__card ol { padding-left: 1.2rem; margin: .5rem 0; }
.info__card li { margin: .4rem 0; }
code {
  font-family: "JetBrains Mono", ui-monospace, monospace; font-size: .85em;
  background: var(--brand-soft); padding: .12rem .4rem; border-radius: 5px; color: var(--brand);
}
.footer { max-width: 1140px; margin: 2.5rem auto 1.5rem; padding: 1.5rem 1.25rem 0; border-top: 1px solid var(--border); text-align: center; color: var(--text-soft); font-size: .9rem; }
.footer p { margin: .35rem 0; }

@media (max-width: 560px) {
  .hero__nav a:not(:last-child) { display: none; }
  .controls { position: static; }
  .card__name { font-size: 1.02rem; }
}
@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; scroll-behavior: auto !important; }
}
