/* Course site theme. Light background, Inter body font (Google Fonts),
   aqua-green accent. rheo 0.5.0 auto-wires this file (root style.css) into every
   page. Code stays in Berkeley Mono, which is proprietary and not committed — see
   fonts/README.md; the stack falls back to the system monospace when the TTFs
   are absent. */

@import url('https://fonts.googleapis.com/css2?family=Inter:wght@400;500;600;700&display=swap');

@font-face {
  font-family: 'Berkeley Mono';
  src: url('./fonts/BerkeleyMono-Regular.ttf') format('truetype');
  font-weight: 400;
  font-style: normal;
}

@font-face {
  font-family: 'Berkeley Mono';
  src: url('./fonts/BerkeleyMono-Bold.ttf') format('truetype');
  font-weight: 700;
  font-style: normal;
}

@font-face {
  font-family: 'Berkeley Mono';
  src: url('./fonts/BerkeleyMono-Oblique.ttf') format('truetype');
  font-weight: 400;
  font-style: oblique;
}

@font-face {
  font-family: 'Berkeley Mono';
  src: url('./fonts/BerkeleyMono-Bold-Oblique.ttf') format('truetype');
  font-weight: 700;
  font-style: oblique;
}

/* ============================================
   CSS Variables
   ============================================ */
:root {
  --background-color: #e9e9e9;
  --text-color: #1a1a1a;
  --link-color: #00c9a7;
  --border-color: #00c9a7;
  --muted-color: #767676;
}

/* ============================================
   Base Layout
   ============================================ */
body {
  background-color: var(--background-color);
  color: var(--text-color);
  font-family: 'Inter', sans-serif;
  font-size: 1em;
  line-height: 1.3;
  letter-spacing: -0.03em;
  margin: 0 auto;
  padding: 50px;
  max-width: 38em;
}

/* ============================================
   Navigation
   ============================================ */
.site-nav {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 0;
}

.site-nav + hr {
  margin-top: 0;
  height: 5px;
}

.site-nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 1em;
}

.site-nav a {
  text-decoration: none;
  color: var(--muted-color);
  font-size: 0.8em;
  text-transform: uppercase;
}

.site-nav a:hover {
  color: var(--text-color);
  text-decoration: underline;
  text-decoration-color: var(--text-color);
}

.site-title {
  font-size: 0.9em;
  color: var(--text-color);
}

.site-nav li.active a,
.site-title.active {
  color: var(--border-color);
  font-weight: 600;
}

/* ============================================
   Typography
   ============================================ */
h1, h2, h3, h4, h5, h6 {
  color: var(--border-color);
  font-weight: 500;
  text-transform: uppercase;
  text-align: left;
  margin-top: 1.25em;
  margin-bottom: 0.25em;
}

/* ============================================
   Links
   ============================================ */
a {
  color: var(--link-color);
  text-decoration: underline;
  text-decoration-color: transparent;
  text-decoration-thickness: 1px;
  transition: text-decoration-color 0.25s ease;
}

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

/* ============================================
   Lists
   ============================================ */
ul, ol {
  padding-left: 2em;
  margin: 0.5em 0;
}

/* ============================================
   Goals (index.typ `#goals`)
   ============================================ */
/* Each skill is a row; its learning goals sit in a <details> drawer toggled by
   the summary. The native disclosure triangle is replaced by a +/× marker on the
   right that rotates when the drawer is open. */
.goals {
  list-style: none;
  padding: 0;
  margin: 1em 0 1.5em;
  border-top: 1px solid rgba(0, 201, 167, 0.3);
}

.goals > li {
  border-bottom: 1px solid rgba(0, 201, 167, 0.3);
}

.goals summary {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 1em;
  padding: 0.65em 0;
  font-weight: 500;
  cursor: pointer;
  list-style: none;
  transition: color 0.2s ease;
}

.goals summary::-webkit-details-marker {
  display: none;
}

.goals summary::after {
  content: '+';
  flex-shrink: 0;
  color: var(--border-color);
  font-weight: 600;
  font-size: 1.2em;
  line-height: 1;
  transition: transform 0.25s ease;
}

.goals details[open] summary::after {
  transform: rotate(45deg);
}

.goals summary:hover {
  color: var(--border-color);
}

.goals summary:focus-visible {
  outline: 2px solid var(--border-color);
  outline-offset: 2px;
}

/* Inside a drawer: one flat list of what students will be able to do. */
.goals details > ul {
  margin: 0 0 0.9em;
  padding-left: 1.4em;
  font-size: 0.95em;
}

.goals details > ul > li {
  margin: 0.3em 0;
}

.goals details > ul > li::marker {
  content: '– ';
  color: var(--border-color);
}

/* ============================================
   Media
   ============================================ */
img, video {
  max-width: 100%;
  height: auto;
  display: block;
  margin: 1.5em 0;
}

/* ============================================
   Code
   ============================================ */
code {
  font-family: 'Berkeley Mono', monospace;
  background-color: rgba(0, 0, 0, 0.06);
  padding: 0.2em 0.4em;
  border-radius: 3px;
  font-size: 0.88em;
}

/* ============================================
   Tables
   ============================================ */
/* Break out wider than the 38em content column — analogous to the tables in
   spec/index.css. Because body is `margin: 0 auto`, its center is the viewport
   center; `margin-left: 50%` puts the table's left edge there and
   `translateX(-50%)` re-centers the wider box on the viewport, independent of
   the narrow content column. */
table {
  table-layout: fixed;
  width: 80vw;
  max-width: 1000px;
  margin-left: 50%;
  transform: translateX(-50%);
  margin-top: 1.5em;
  margin-bottom: 2em;
  border-collapse: collapse;
  font-size: 0.9em;
  letter-spacing: normal;
}

/* Grid lines are a dimmed variation of the aqua-green accent (--border-color,
   #00c9a7) rather than a neutral gray, so they read as part of the theme on the
   light background. Low alpha keeps a full-grid table from turning loud. */
th, td {
  border: 1px solid rgba(0, 201, 167, 0.3);
  padding: 0.5em 0.7em;
  text-align: left;
  vertical-align: top;
  overflow-wrap: break-word;
}

td {
  background: #ffffff;
}

/* Unequal columns: slim Week and Date, generous Content for bullet lists.
   Widths live here because Typst emits a bare <table> with no <col> widths, so
   the `table-layout: fixed` above would otherwise split all five columns
   equally. Only the header cells are targeted: with `table-layout: fixed` they
   alone fix the column widths, and a td:nth-child rule would hit the wrong
   column in rows that follow a rowspan'd Week cell. */
th:nth-child(1) { width: 11%; }
th:nth-child(2) { width: 12%; }
th:nth-child(3) { width: 22%; }
th:nth-child(4) { width: 35%; }
th:nth-child(5) { width: 20%; }

th {
  background: rgba(0, 201, 167, 0.12);
  color: var(--border-color);
  text-transform: uppercase;
  font-weight: 600;
  font-size: 0.85em;
  border-bottom: 2px solid rgba(0, 201, 167, 0.6);
}

/* ============================================
   Blockquotes
   ============================================ */
blockquote {
  margin: 1em 0;
  padding-left: 1em;
  border-left: 2px solid var(--border-color);
  color: var(--muted-color);
  font-style: italic;
}

/* ============================================
   Rules
   ============================================ */
hr {
  height: 1px;
  background-color: var(--border-color);
  border: none;
  margin: 1.25em 0;
}

/* ============================================
   Endnotes
   ============================================ */
section[role="doc-endnotes"] {
  margin-top: 2em;
  padding-top: 1em;
  border-top: 1px solid var(--border-color);
}

section[role="doc-endnotes"] ol li a[role="doc-backlink"] {
  padding-right: 0.2em;
}

/* ============================================
   Hamburger (hidden on desktop)
   ============================================ */
.nav-toggle {
  display: none;
}

.nav-hamburger {
  display: none;
}

/* ============================================
   Responsive
   ============================================ */
@media (max-width: 600px) {
  body {
    padding: 12px;
    font-size: 0.9em;
  }

  .site-nav {
    position: sticky;
    top: 0;
    background: var(--background-color);
    z-index: 100;
    flex-wrap: wrap;
    border-bottom: 5px solid var(--border-color);
  }

  .site-nav + hr {
    display: none;
  }

  .nav-hamburger {
    display: block;
    cursor: pointer;
    color: var(--muted-color);
    font-size: 0;
    user-select: none;
  }

  .nav-hamburger::before {
    content: '☰';
    font-size: 1.1rem;
    display: inline-block;
    transition: transform 0.25s ease;
  }

  .nav-toggle:checked ~ .nav-hamburger::before {
    content: '✕';
    transform: rotate(90deg);
  }

  .site-nav ul {
    display: none;
    width: 100%;
    flex-direction: column;
    gap: 0.5em;
    padding: 0.5em 0;
  }

  .nav-toggle:checked ~ ul {
    display: flex;
  }

  /* No breakout on narrow screens — full content width instead. */
  table {
    width: 100%;
    max-width: 100%;
    margin-left: 0;
    transform: none;
  }
}
