/* UPP 461 Course Hub — accessible, no-build static site */
/* WCAG 2.1 considerations: strong focus, contrast, reduced motion, keyboard nav */

:root {
  /* Light theme */
  --bg: #f7f7fb;
  --surface: #ffffff;
  --surface-2: #f0f1f6;
  --text: #14151a;
  --muted: #4a4f63;
  --border: #d6d9e6;

  --accent: #2b59ff;         /* strong, not neon */
  --accent-2: #1040e7;
  --focus: #ffb703;          /* high visibility */

  --shadow: 0 10px 30px rgba(0,0,0,0.08);
  --radius: 14px;

  --font: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";

  /* Spacing rhythm */
  --s-1: 6px;
  --s-2: 10px;
  --s-3: 14px;
  --s-4: 18px;
  --s-5: 24px;
  --s-6: 32px;
  --s-7: 44px;
}

html {
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }
}

[data-theme="dark"] {
  --bg: #0b0c10;
  --surface: #121420;
  --surface-2: #0f1220;
  --text: #f2f4ff;
  --muted: #b4bbd6;
  --border: #2a2f46;

  --accent: #7aa2ff;
  --accent-2: #a8c0ff;
  --focus: #ffd166;

  --shadow: 0 14px 40px rgba(0,0,0,0.35);
}

* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--text);
  background:
    radial-gradient(1200px 600px at 10% 0%, rgba(43,89,255,0.10), transparent 55%),
    radial-gradient(900px 500px at 90% 10%, rgba(255,183,3,0.08), transparent 60%),
    var(--bg);
  line-height: 1.5;
}

.container {
  width: min(1100px, calc(100% - 2 * var(--s-5)));
  margin-inline: auto;
}

.skip-link {
  position: absolute;
  left: 0;
  top: 0;
  transform: translateY(-130%);
  padding: var(--s-2) var(--s-4);
  background: var(--surface);
  border: 2px solid var(--focus);
  border-radius: 10px;
  color: var(--text);
  z-index: 999;
}
.skip-link:focus {
  transform: translateY(var(--s-2));
  outline: none;
}

.site-header {
  border-bottom: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface) 86%, transparent);
  backdrop-filter: blur(8px);
}

.header-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: var(--s-5);
  padding-block: var(--s-5);
}

.title {
  margin: 0;
  font-size: clamp(1.2rem, 1.1rem + 1vw, 1.9rem);
  letter-spacing: 0.2px;
}
.term {
  margin: var(--s-1) 0 0 0;
  color: var(--muted);
  font-size: 0.95rem;
}

.toggle {
  display: inline-flex;
  align-items: center;
  gap: var(--s-2);
  padding: 10px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: 0 1px 0 rgba(0,0,0,0.04);
}
.toggle:hover {
  border-color: color-mix(in oklab, var(--border) 55%, var(--accent) 45%);
}
.toggle:active {
  transform: translateY(1px);
}

.site-main {
  padding-block: var(--s-6);
}

.intro {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-6);
  box-shadow: var(--shadow);
}

.section-header {
  margin-top: var(--s-7);
  display: grid;
  gap: var(--s-1);
}
.section-header h2 {
  margin: 0;
}

h2 {
  margin: 0 0 var(--s-2) 0;
  font-size: 1.25rem;
}
p { margin: 0; }
.muted { color: var(--muted); }

.weeks-grid {
  list-style: none;
  padding: 0;
  margin: var(--s-5) 0 0 0;
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: var(--s-5);
}

.card {
  grid-column: span 12;
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: var(--surface);
  box-shadow: var(--shadow);
  padding: var(--s-5);
  display: grid;
  gap: var(--s-3);
}

@media (min-width: 720px) {
  .card { grid-column: span 6; }
}
@media (min-width: 980px) {
  .card { grid-column: span 4; }
}

.card-top {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: var(--s-3);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 10px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface-2) 75%, transparent);
  color: var(--muted);
  font-size: 0.9rem;
  white-space: nowrap;
}

.card h3 {
  margin: 0;
  font-size: 1.05rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: fit-content;
  text-decoration: none;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in oklab, var(--accent) 55%, var(--border) 45%);
  background: color-mix(in oklab, var(--accent) 12%, var(--surface) 88%);
  color: var(--text);
  font-weight: 600;
}
.btn:hover {
  background: color-mix(in oklab, var(--accent) 18%, var(--surface) 82%);
  border-color: var(--accent);
}
.btn:active { transform: translateY(1px); }

.notice {
  margin-top: var(--s-5);
  background: color-mix(in oklab, var(--surface-2) 70%, transparent);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: var(--s-4);
}

.help {
  margin-top: var(--s-7);
  padding: var(--s-5);
  border-radius: var(--radius);
  border: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface) 88%, transparent);
}

.site-footer {
  border-top: 1px solid var(--border);
  background: color-mix(in oklab, var(--surface) 86%, transparent);
  margin-top: var(--s-7);
}

.footer-row {
  padding-block: var(--s-5);
  display: grid;
  gap: var(--s-3);
}

.disclaimer {
  margin: 0;
  color: var(--muted);
  max-width: 85ch;
}

.link {
  color: var(--text);
  text-decoration: underline;
  width: fit-content;
  text-underline-offset: 3px;
}
.link:hover {
  color: var(--accent);
}

/* Focus visibility: do not remove outlines */
:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 3px;
  border-radius: 10px;
}
