/* Shared by the all-courses page, every course page and About us (site/build.py copies it to the root).
   Palette, type and geometry follow ref/academic.css, the lecture-deck theme: monochrome,
   square corners, hard offset shadows. The dark header is the deck's cover slide. */

:root {
  --black: #0D0D0D;
  --gray-900: #1A1A1A;
  --gray-800: #2B2B2B;
  --gray-700: #404040;
  --gray-600: #5A5A5A;
  --gray-500: #737373;
  --gray-400: #9A9A9A;
  --gray-300: #C2C2C2;
  --gray-200: #E0E0DE;
  --gray-50: #F8F8F6;
  --white: #FFFFFF;

  --bg: var(--white);
  --fg: var(--black);
  --fg-2: var(--gray-700);
  --fg-3: var(--gray-500);
  --rule: var(--gray-200);
  --ink: var(--black);          /* borders and shadows of controls */
  --logo-filter: none;
  --live: #15803D;              /* one of the two colours on the site: "ongoing" */
  --warn: #B91C1C;              /* the other: "(not interactive)" */
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #111111;
    --fg: var(--gray-50);
    --fg-2: var(--gray-300);
    --fg-3: var(--gray-400);
    --rule: var(--gray-800);
    --ink: var(--gray-50);
    --logo-filter: invert(1);
    --live: #4ADE80;
    --warn: #F87171;
  }
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font: 400 17px/1.55 'DM Sans', system-ui, sans-serif;
}
a { color: inherit; }
.wrap { max-width: 920px; margin: 0 auto; padding-inline: 24px; }

/* ── Header: the deck's cover slide ─────────────────────────────── */
header {
  background: var(--black);
  color: var(--white);
  padding: 48px 0 64px;
}
.top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.wordmark {
  display: block;
  width: 220px;
  height: auto;
  filter: invert(1);           /* white on the black header */
}
header.home { padding: 56px 0; }
.wordmark.big { width: 380px; }
.eyebrow {
  margin: 88px 0 14px;
  font: 400 13px/1.4 'Space Mono', monospace;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--gray-400);
}
h1 {
  margin: 0;
  padding-bottom: 14px;
  border-bottom: 2px solid var(--white);
  font: 700 clamp(34px, 6.4vw, 60px)/1.02 'Rajdhani', sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.tagline {
  margin: 14px 0 0;
  font: 500 15px/1.5 'Rajdhani', sans-serif;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--gray-400);
}

/* ── Buttons: --shadow is the hard offset shadow of each variant ── */
.actions { display: flex; flex-wrap: wrap; gap: 16px; margin-top: 44px; }
.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px;
  border: 2px solid var(--white);
  box-shadow: 4px 4px 0 var(--shadow);
  font: 700 16px/1 'Rajdhani', sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform .08s, box-shadow .08s;
}
.btn:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--shadow); }
.btn.primary { --shadow: var(--gray-600); background: var(--white); color: var(--black); }
.btn.ghost { --shadow: var(--gray-800); color: var(--white); }
.btn.small { padding: 10px 16px; font-size: 14px; box-shadow: 3px 3px 0 var(--shadow); }
/* On the light page body (course cards) */
.btn.solid { --shadow: var(--gray-400); background: var(--ink); color: var(--bg); border-color: var(--ink); }
.btn:focus-visible, .link:focus-visible, .text-link:focus-visible, .card h3 a:focus-visible { outline: 2px solid var(--gray-400); outline-offset: 3px; }

main { padding-block: 56px 8px; }

/* ── All-courses page ───────────────────────────────────────────── */
main section + section { margin-top: 56px; }
.group {
  display: flex;
  align-items: center;
  gap: 14px;
  padding-bottom: 10px;
  margin-bottom: 32px;
  border-bottom: 2px solid var(--ink);
}
.dot { width: 12px; height: 12px; background: var(--fg-3); flex: none; }
.dot.live { background: var(--live); border-radius: 50%; animation: live 2s ease-out infinite; }
@keyframes live {
  0%   { box-shadow: 0 0 0 0 color-mix(in srgb, var(--live) 55%, transparent); }
  100% { box-shadow: 0 0 0 10px transparent; }
}
@media (prefers-reduced-motion: reduce) { .dot.live { animation: none; } }
.courses {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(360px, 100%), 1fr));
  gap: 32px;
}
.card {
  display: flex;
  flex-direction: column;
  gap: 14px;
  padding: 26px 26px 30px;
  border: 2px solid var(--ink);
  box-shadow: 6px 6px 0 var(--ink);
}
.meta {                        /* a card's eyebrow; "Lecturer" on a course page */
  margin: 0;
  font: 400 12px/1.4 'Space Mono', monospace;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--fg-3);
}
.card h3 {
  margin: 0;
  font: 700 30px/1.05 'Rajdhani', sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.card h3 a { text-decoration: none; }
.card h3 a:hover { text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 4px; }
.card .tagline { margin: 0; font-size: 13px; letter-spacing: 0.14em; color: var(--fg-3); }
.card .actions { margin-top: auto; padding-top: 10px; align-items: center; gap: 24px; }   /* buttons at the card's foot */
.text-link {
  font: 700 15px/1 'Rajdhani', sans-serif;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-decoration: underline;
  text-decoration-thickness: 2px;
  text-underline-offset: 5px;
}
.text-link:hover { text-decoration-color: var(--fg-3); }

/* ── Course page: the lecture list ──────────────────────────────── */
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
  border-bottom: 2px solid var(--ink);
  padding-bottom: 10px;
}
h2 {
  margin: 0;
  font: 700 28px/1.1 'Rajdhani', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.section-head a {
  font: 400 13px/1.4 'Space Mono', monospace;
  color: var(--fg-3);
  text-decoration: none;
  border-bottom: 1px solid var(--rule);
}
.section-head a:hover { color: var(--fg); border-color: var(--fg); }

ol { list-style: none; margin: 0; padding: 0; }
.lecture, .entry {             /* an entry on About us is laid out as a lecture */
  display: grid;
  grid-template-columns: 64px 1fr auto;
  gap: 4px 20px;
  align-items: start;
  padding: 22px 0;
  border-bottom: 1px solid var(--rule);
}
.num {
  font: 700 36px/1 'Rajdhani', sans-serif;
  color: var(--fg-3);
  letter-spacing: 0.02em;
}
.lecture h3, .entry h3 {
  margin: 2px 0 4px;
  font: 700 21px/1.2 'Rajdhani', sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.sub { margin: 0 0 6px; color: var(--fg-2); }
.topics { margin: 0; font-size: 14px; color: var(--fg-3); }
.links {                       /* the lecture's links: separate buttons of one size, in a row */
  align-self: center;
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 12px;
}
.links:has(.stills) { margin-bottom: 18px; }   /* room for the note under the PDF */
.link {
  position: relative;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: baseline;
  padding: 9px 14px;
  border: 2px solid var(--ink);
  box-shadow: 3px 3px 0 var(--ink);
  font: 700 13px/1 'Space Mono', monospace;
  text-transform: uppercase;
  text-decoration: none;
  white-space: nowrap;
  transition: transform .08s, box-shadow .08s;
}
.link span { font-weight: 400; color: var(--fg-3); }
.link:hover { transform: translate(2px, 2px); box-shadow: 1px 1px 0 var(--ink); }
.stills {                      /* under the PDF of slides with GIFs or interactive slides, below its shadow */
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  font: 400 10px/1 'Space Mono', monospace;
  text-transform: none;
  text-align: center;
  color: var(--warn);
}

/* ── About us ───────────────────────────────────────────────────── */
.icon { width: 18px; height: 18px; flex: none; fill: currentColor; }   /* Simple Icons, one ink */
.num .icon { width: 34px; height: 34px; }
.channel { grid-template-columns: 64px 1fr auto; }   /* Discord over the photos: one column, */
.channel .num { display: flex; justify-self: center; align-self: center; }   /* its icon centred in it */
.link:has(.icon) { justify-content: flex-start; align-items: center; gap: 8px; }
.link:has(.icon) span { margin-left: auto; padding-left: 4px; }
.link .icon { width: 16px; height: 16px; }
.link img.icon { width: auto; height: 14px; filter: var(--logo-filter); }   /* the IM mark */
.entry .links { min-width: 160px; }   /* one button per entry: the same width in every entry */

.prose { max-width: 720px; }
.prose p { margin: 24px 0 0; }
.lead { font-size: 20px; line-height: 1.5; }
.chip {                        /* "community": inverted, square, in the type of the buttons */
  padding: 2px 8px 1px;
  background: var(--ink);
  color: var(--bg);
  font: 700 1em/1 'Rajdhani', sans-serif;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.prose a, .sub a { text-underline-offset: 3px; text-decoration-color: var(--fg-3); }
.prose a:hover, .sub a:hover { text-decoration-color: currentColor; }

.course-list { margin: 14px 0 0; padding: 0; list-style: none; }
.course-list li {              /* the dot, when there is one, in a column of its own */
  display: grid;
  grid-template-columns: 12px 1fr;
  gap: 2px 14px;
  align-items: center;
}
.course-list li + li { margin-top: 12px; }
.course-list .dot { grid-area: 1 / 1; align-self: start; margin-top: 5px; }   /* on the name's first line */
.course-list a, .course-list small { grid-column: 2; }
.course-list small { font-size: 15px; color: var(--fg-3); }
.course-list a {
  font: 700 18px/1.2 'Rajdhani', sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--fg);
  text-decoration-thickness: 2px;
  text-underline-offset: 4px;
}
.course-list a:hover { text-decoration-color: var(--fg-3); }
.tag {                         /* "TBA" before a title: boxed, in the page's grey — not a third colour */
  display: inline-block;
  margin-right: 4px;
  padding: 2px 5px 1px;
  border: 2px solid currentColor;   /* the 2 px of every frame on the site */
  font: 400 11px/1 'Space Mono', monospace;
  letter-spacing: 0.1em;
  vertical-align: 3px;
  color: var(--fg-3);
}

.partners {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(340px, 100%), 1fr));
  gap: 24px;
  margin-top: 26px;
}
.partner {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  border: 2px solid var(--ink);
  box-shadow: 4px 4px 0 var(--ink);
  font: 700 17px/1.2 'Rajdhani', sans-serif;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  text-decoration: none;
  transition: transform .08s, box-shadow .08s;
}
.partner:hover { transform: translate(2px, 2px); box-shadow: 2px 2px 0 var(--ink); }
.partner .mark { flex: none; width: 104px; display: flex; justify-content: center; }
.partner img { display: block; height: 56px; width: auto; filter: var(--logo-filter); }   /* black ink; white in dark mode */
.partner img.im { height: 32px; }   /* the IM plate reads heavier than the KAU mark at one height */
.partner .arrow { margin-left: auto; font: 400 13px/1 'Space Mono', monospace; color: var(--fg-3); }
.partner:focus-visible { outline: 2px solid var(--gray-400); outline-offset: 3px; }

/* A person is an entry: the photo where the Discord icon is; Email, LinkedIn, IM in a row */
.photo {                       /* in colour, as on the posters: content, not a third UI colour */
  width: 64px;
  height: 64px;
  border-radius: 50%;          /* a circle, as on the posters — bare: a hard shadow on it reads as a stray crescent */
}
@media (max-width: 860px) {    /* three labelled buttons no longer fit beside the name: under it */
  .person .links { grid-column: 1 / -1; margin-top: 14px; }
}

/* ── Course page, under the lectures: more to come, and who teaches it ── */
.more .body { grid-column: 2; }   /* no number: in line with the lecture titles */
.more .dot { display: inline-block; margin-right: 10px; }   /* the green dot before "Ongoing", on the baseline: as high as its capitals */
.lecturer { margin-top: 48px; }
.lecturer .person { padding-top: 14px; }   /* the About us entry, smaller */
.lecturer .photo { width: 48px; height: 48px; }
.lecturer h3 { font-size: 17px; }
.lecturer .sub { margin: 0; font-size: 14px; }

footer {
  display: flex;
  align-items: center;
  gap: 10px;
  padding-block: 40px 48px;
  font: 400 12px/1.4 'Space Mono', monospace;
  color: var(--fg-3);
}
footer a { text-decoration-color: var(--gray-300); text-underline-offset: 3px; }
footer a, footer span span { white-space: nowrap; }   /* a narrow screen wraps between names, not inside one */
footer a:hover { color: var(--fg); text-decoration-color: currentColor; }
footer img {
  width: 22px;
  height: auto;
  opacity: 0.6;
  filter: var(--logo-filter);
}

@media (max-width: 600px) {
  .wrap { padding-inline: 16px; }
  header { padding: 32px 0 48px; }
  .wordmark { width: 170px; }
  header.home { padding: 36px 0; }
  .wordmark.big { width: 240px; }
  .eyebrow { margin-top: 56px; }
  .tagline { letter-spacing: 0.12em; }
  .actions .btn { flex: 1 1 100%; justify-content: center; }
  .card { padding: 22px 20px 24px; }
  .card h3 { font-size: 26px; }
  .lecture, .entry { grid-template-columns: 44px 1fr; }
  .num { font-size: 28px; }
  .num .icon { width: 28px; height: 28px; }
  .channel { grid-template-columns: 64px 1fr; }
  .links { grid-column: 1 / -1; gap: 8px; margin-top: 14px; }   /* the whole row: three fit */
  .link { gap: 8px; padding-inline: 10px; }
  .lead { font-size: 18px; }
  .partner { padding: 14px 16px; gap: 14px; font-size: 16px; }
  .partner .mark { width: 84px; }
  .partner img { height: 48px; }
  .partner img.im { height: 26px; }
  .person .link { gap: 0; justify-content: center; font-size: 0; }   /* three fit as icons only; */
  .person .link span { display: none; }                             /* the words stay for screen readers */
  .lecturer .person { grid-template-columns: 44px 1fr; }   /* the name in line with the lecture titles */
  .lecturer .photo { width: 44px; height: 44px; }
}
