/* ---------------------------------------------------------------
   Minimal — a quiet, light theme.
   Serif body for reading, sans headings & chrome, mono for code.
   Styles the HTML that Markdown renders into `.content`.
   One column, generous whitespace.
   --------------------------------------------------------------- */

:root {
  --bg:        #f4f8f9;  /* cool light slate      */
  --ink:       #1d2327;  /* near-black, cool      */
  --ink-soft:  #566069;  /* muted slate           */
  --ink-faint: #95a0a8;  /* labels, meta          */
  --line:      #dfe6ea;  /* hairlines             */
  --accent:    #2f7d92;  /* steel teal-blue       */
  --code-bg:   #e9eff1;

  /* Type: serif for reading, sans for headings & chrome, mono for code */
  --font-serif: "Source Serif 4", Charter, Georgia, Cambria, "Times New Roman", serif;
  --font-sans:  "Source Sans 3", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-mono:  "JetBrains Mono", ui-monospace, "SF Mono", Menlo, Consolas, "DejaVu Sans Mono", monospace;

  --measure: 60rem;
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-serif);
  font-size: 16px;
  line-height: 1.72;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* Sans-serif for navigation, labels, and UI chrome */
.site-nav,
.course-filter,
.content a.course-chip,
.content a.course-tag,
.course-name,
.note-meta,
.note-date,
.note-title,
.back,
.page-about h1 + p {
  font-family: var(--font-sans);
}

/* Layout ------------------------------------------------------- */

.page {
  max-width: var(--measure);
  margin: 0 auto;
  padding: clamp(3rem, 10vh, 6.5rem) clamp(1.4rem, 5vw, 3rem) 4rem;
}

/* Site navigation */
.site-nav {
  display: flex;
  gap: 1.6rem;
  margin-bottom: 2.6rem;
  font-size: 0.8rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}
.site-nav a {
  color: var(--ink-faint);
  text-decoration: none;
  transition: color 0.18s ease;
}
.site-nav a:hover { color: var(--accent); }
.site-nav a.active { color: var(--ink); }

/* Rendered Markdown ------------------------------------------- */

/* Name (first H1) */
.content h1 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: clamp(2.1rem, 6vw, 3rem);
  line-height: 1.1;
  letter-spacing: -0.02em;
  margin: 0 0 0.6rem;
}

/* Contact row: the icon links immediately after the name (About page only) */
.page-about .contact {
  display: flex;
  align-items: center;
  gap: 1.1rem;
  margin: 0 0 2.8rem;
}
.content a.icon-link {
  display: inline-flex;
  line-height: 0;
  color: var(--ink-soft);
  background-image: none;       /* drop the underline used by text links */
  padding-bottom: 0;
  transition: color 0.18s ease, transform 0.18s ease;
}
.content a.icon-link:hover {
  color: var(--accent);
  background-image: none;
  transform: translateY(-1px);
}
.content a.icon-link svg { display: block; }
/* The envelope glyph has built-in padding; the GitHub/Scholar marks are
   full-bleed. Nudge only the envelope so it sits flush with the text column. */
.contact a.icon-link:first-child svg { transform: translateX(-2px); }

/* Subheadings (default — used in blog posts and any normal page) */
.content h2 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.45rem;
  letter-spacing: -0.01em;
  margin: 2.6rem 0 0.8rem;
}

.content h3 {
  font-family: var(--font-sans);
  font-weight: 700;
  font-size: 1.15rem;
  margin: 2rem 0 0.6rem;
}

/* About page only: H2 is a small uppercase section label, not a heading */
.content.page-about h2 {
  font-size: 0.72rem;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 3.2rem 0 0.95rem;
}

/* Body copy */
.content p,
.content li {
  font-size: 1.05rem;
  line-height: 1.75;
}

.content p { margin: 0 0 1.1rem; }

.content em { font-style: normal; color: var(--accent); }
.content strong { font-weight: 700; }

/* Lists — hanging accent dash, no bullets */
.content ul { list-style: none; margin: 0; padding: 0; }
.content ul li {
  position: relative;
  padding-left: 1.5rem;
  margin: 0.35rem 0;
}
.content ul li::before {
  content: "—";
  position: absolute;
  left: 0;
  color: var(--accent);
}

/* Award rows: name on the left, year flush right */
.content ul li:has(.year) {
  display: flex;
  align-items: baseline;
  gap: 1rem;
}
.content .year {
  margin-left: auto;
  color: var(--ink-faint);
  white-space: nowrap;
}

/* Notes — course filter */
.course-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  margin: 0 0 2.6rem;
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.content a.course-chip {
  background-image: none;
  padding-bottom: 0;
  color: var(--ink-faint);
}
.content a.course-chip:hover { color: var(--accent); }
.content a.course-chip.active { color: var(--ink); }

/* Notes — one block per course */
.course-block { margin: 0 0 3rem; }
.course-block:last-child { margin-bottom: 0; }

.course-name {
  display: flex;
  align-items: baseline;
  gap: 0.7rem;
  font-size: 0.78rem !important;
  font-weight: 600 !important;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-faint);
  margin: 0 0 0.4rem !important;
  padding-bottom: 0.7rem;
  border-bottom: 1px solid var(--line);
}
.content .course-name a {
  background-image: none;
  padding-bottom: 0;
  color: var(--ink-faint);
}
.content .course-name a:hover { color: var(--accent); }
.course-count {
  color: var(--ink-faint);
  font-weight: 400;
  font-size: 0.72rem;
}

/* Notes — note list within a block (no bullet dash) */
.note-list { list-style: none; margin: 0; padding: 0; }
.content .note-list li {
  padding: 1rem 0;
  margin: 0;
  border-bottom: 1px solid var(--line);
}
.content .note-list li::before { content: none; }

.content a.note-row {
  display: flex;
  align-items: baseline;
  gap: 1rem;
  background-image: none;
  padding-bottom: 0;
  color: var(--ink);
}
.note-title { font-weight: 700; }
.content a.note-row:hover .note-title { color: var(--accent); }
.note-date {
  margin-left: auto;
  color: var(--ink-faint);
  font-size: 0.85rem;
  white-space: nowrap;
}
.note-summary {
  margin: 0.45rem 0 0;
  color: var(--ink-soft);
  font-size: 0.95rem;
}
.empty { color: var(--ink-soft); }

/* Note page */
.back {
  margin: 0 0 1.4rem;
  font-size: 0.8rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}
.content .back a {
  background-image: none;
  padding-bottom: 0;
  color: var(--ink-faint);
}
.content .back a:hover { color: var(--accent); }
.note-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 1rem;
  margin: -0.3rem 0 2rem;
  color: var(--ink-faint);
  font-size: 0.85rem;
}
.content a.course-tag {
  background-image: none;
  padding-bottom: 0;
  color: var(--ink-faint);
  font-size: 0.76rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}
.content a.course-tag:hover { color: var(--accent); }
.note-meta .note-date { margin-left: 0; }

/* Links — quiet underline that warms on hover */
.content a {
  color: var(--ink);
  text-decoration: none;
  background-image: linear-gradient(var(--line), var(--line));
  background-size: 100% 1px;
  background-repeat: no-repeat;
  background-position: 0 100%;
  padding-bottom: 1px;
  transition: color 0.18s ease, background-image 0.18s ease;
}
.content a:hover {
  color: var(--accent);
  background-image: linear-gradient(var(--accent), var(--accent));
}

.content hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.8rem 0;
}

.content blockquote {
  margin: 1.4rem 0;
  padding-left: 1.1rem;
  border-left: 2px solid var(--accent);
  color: var(--ink-soft);
  font-style: italic;
}

.content code {
  font-family: var(--font-mono);
  font-size: 0.92em;
  background: var(--code-bg);
  padding: 0.12em 0.38em;
  border-radius: 4px;
}
.content pre {
  font-family: var(--font-mono);
  background: var(--code-bg);
  padding: 1rem 1.1rem;
  border-radius: 8px;
  overflow-x: auto;
  font-size: 0.9rem;
}
.content pre code { background: none; padding: 0; }

/* Math (KaTeX) — keep KaTeX's own 1.21em scaling so math optically
   matches the surrounding text size (don't force it to 1em). */

/* Accessibility ------------------------------------------------ */

a:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 2px;
}

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; }
}
