:root {
  --bg: #f6f7fb; --card: #ffffff; --ink: #1b1f2a; --muted: #5d6475; --line: #e2e5ee;
  --accent: #2f5bd3; --accent-ink: #ffffff; --error-bg: #fdecec; --error: #a32020;
  --shadow: 0 1px 2px rgba(20, 30, 60, .06), 0 8px 24px rgba(20, 30, 60, .08);
  color-scheme: light dark;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #12151c; --card: #1b1f29; --ink: #e8eaf0; --muted: #a0a7b8; --line: #2b3140;
    --accent: #7c9cff; --accent-ink: #0d1020; --error-bg: #3a1c1f; --error: #ffb4b4;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 8px 24px rgba(0, 0, 0, .35);
  }
}
* { box-sizing: border-box; }
html, body { margin: 0; }
body {
  font: 16px/1.5 system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink); min-height: 100vh;
}
h1, h2 { line-height: 1.25; }
.muted { color: var(--muted); }
.small { font-size: .875rem; }
.mark {
  display: inline-grid; place-items: center; width: 3rem; height: 3rem; border-radius: .8rem;
  background: var(--accent); color: var(--accent-ink); font: 700 1.2rem ui-monospace, Menlo, monospace;
}
.mark.small { width: 1.9rem; height: 1.9rem; border-radius: .5rem; font-size: .8rem; }

/* sign-in */
.login { min-height: 100vh; display: grid; place-items: center; padding: 1.5rem; }
.card {
  width: min(24rem, 100%); background: var(--card); border: 1px solid var(--line);
  border-radius: 1rem; padding: 2rem; box-shadow: var(--shadow); display: grid; gap: .4rem;
}
.card h1 { margin: .75rem 0 0; font-size: 1.5rem; }
.card p { margin: 0 0 .75rem; }
.card label { font-weight: 600; font-size: .9rem; margin-top: .4rem; }
.card input {
  font: inherit; padding: .65rem .75rem; border-radius: .55rem; border: 1px solid var(--line);
  background: var(--bg); color: var(--ink);
}
.card input:focus-visible, button:focus-visible, .course:focus-visible {
  outline: 3px solid var(--accent); outline-offset: 2px;
}
.card button {
  margin-top: 1rem; font: 600 1rem system-ui, sans-serif; padding: .7rem; border: 0;
  border-radius: .55rem; background: var(--accent); color: var(--accent-ink); cursor: pointer;
}
.card button:hover { filter: brightness(1.08); }
.card .small { margin: .75rem 0 0; text-align: center; }
.error { background: var(--error-bg); color: var(--error); padding: .6rem .75rem; border-radius: .5rem; }

/* landing */
.top {
  display: flex; justify-content: space-between; align-items: center; gap: 1rem; flex-wrap: wrap;
  padding: .9rem clamp(1rem, 4vw, 3rem); border-bottom: 1px solid var(--line); background: var(--card);
}
.brand { display: inline-flex; align-items: center; gap: .6rem; font-weight: 700; }
.who { display: flex; align-items: center; gap: .9rem; margin: 0; color: var(--muted); font-size: .95rem; }
.who strong { color: var(--ink); }
button.link {
  font: inherit; background: none; border: 1px solid var(--line); color: var(--ink);
  padding: .35rem .8rem; border-radius: .5rem; cursor: pointer;
}
button.link:hover { border-color: var(--accent); }
.home { max-width: 68rem; margin: 0 auto; padding: 2.5rem clamp(1rem, 4vw, 3rem); }
.home h1 { margin: 0 0 .25rem; font-size: 1.9rem; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(19rem, 1fr)); gap: 1.25rem; margin-top: 1.75rem; }
.course {
  display: flex; flex-direction: column; gap: .5rem; padding: 1.5rem; border-radius: 1rem;
  background: var(--card); border: 1px solid var(--line); box-shadow: var(--shadow);
  color: inherit; text-decoration: none; transition: transform .12s ease, border-color .12s ease;
}
.course:hover { transform: translateY(-2px); border-color: var(--accent); }
.course h2 { margin: 0; font-size: 1.2rem; }
.course p { margin: 0; color: var(--muted); }
.course .by { font-size: .85rem; }
.tags { display: flex; flex-wrap: wrap; gap: .4rem; margin-top: .25rem; }
.tag { font-size: .78rem; padding: .15rem .55rem; border-radius: 999px; border: 1px solid var(--line); color: var(--muted); }
.go { margin-top: auto; padding-top: .75rem; color: var(--accent); font-weight: 600; }
@media (prefers-reduced-motion: reduce) { .course { transition: none; } .course:hover { transform: none; } }
