/* ==========================================================
   Learning with Covariance Matrices — LoG 2026 Tutorial
   Plain CSS, no build step. Edit the variables below to
   re-theme the whole site.
   ========================================================== */

:root {
  --ink: #0e1630;          /* hero / header background */
  --ink-2: #18234a;
  --text: #1d2433;
  --muted: #5d6679;
  --bg: #ffffff;
  --bg-alt: #f4f6fa;
  --line: #e2e6ee;
  --coral: #e2574c;        /* positive covariance / accent */
  --blue: #2f6db5;         /* negative covariance / links */
  --blue-soft: #e8f0fb;

  --font-body: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-head: "Source Serif 4", Georgia, "Times New Roman", serif;

  --header-h: 64px;
  --radius: 12px;
  --maxw: 1120px;
}

*, *::before, *::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: var(--header-h);
}
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 17px;
  line-height: 1.65;
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

img { max-width: 100%; display: block; }

a { color: var(--blue); text-decoration-thickness: 1px; text-underline-offset: 3px; }
a:hover { color: var(--coral); }

h1, h2, h3 {
  font-family: var(--font-head);
  line-height: 1.2;
  color: var(--ink);
  margin: 0 0 .5em;
}
h2 { font-size: clamp(1.9rem, 3.2vw, 2.5rem); font-weight: 600; }
h3 { font-size: 1.25rem; font-weight: 600; }

.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px;
}

/* Placeholder text: easy to spot and grep for (class="placeholder").
   Remove the class once real content is in place. */
.placeholder { color: var(--muted); font-style: italic; }

/* ---------------- Header / nav ---------------- */
.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 50;
  height: var(--header-h);
  background: rgba(14, 22, 48, .92);
  backdrop-filter: saturate(140%) blur(10px);
  -webkit-backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.nav {
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  text-decoration: none;
  font-family: var(--font-head);
  font-weight: 600;
  font-size: 1.05rem;
  white-space: nowrap;
}
.brand:hover { color: #fff; }

.nav-links {
  display: flex;
  gap: 4px;
  list-style: none;
  margin: 0;
  padding: 0;
}
.nav-links a {
  position: relative;
  display: block;
  padding: 8px 14px;
  color: rgba(255, 255, 255, .78);
  text-decoration: none;
  font-size: .95rem;
  font-weight: 500;
  border-radius: 8px;
  transition: color .15s, background-color .15s;
}
.nav-links a:hover { color: #fff; background: rgba(255, 255, 255, .07); }
.nav-links a.active { color: #fff; }
.nav-links a.active::after {
  content: "";
  position: absolute;
  left: 14px; right: 14px; bottom: 2px;
  height: 2px;
  border-radius: 2px;
  background: var(--coral);
}

.nav-toggle {
  display: none;
  width: 40px; height: 40px;
  padding: 10px 9px;
  background: transparent;
  border: 0;
  cursor: pointer;
  flex-direction: column;
  justify-content: space-between;
}
.nav-toggle span {
  display: block;
  height: 2px;
  background: #fff;
  border-radius: 2px;
  transition: transform .2s, opacity .2s;
}
.nav-toggle[aria-expanded="true"] span:nth-child(1) { transform: translateY(8px) rotate(45deg); }
.nav-toggle[aria-expanded="true"] span:nth-child(2) { opacity: 0; }
.nav-toggle[aria-expanded="true"] span:nth-child(3) { transform: translateY(-8px) rotate(-45deg); }

/* ---------------- Hero (Home) ---------------- */
.hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(1200px 500px at 85% 20%, rgba(47, 109, 181, .28), transparent 60%),
    radial-gradient(800px 400px at 10% 110%, rgba(226, 87, 76, .18), transparent 60%),
    var(--ink);
  color: #fff;
  padding: calc(var(--header-h) + 96px) 0 104px;
}

.hero-matrix {
  position: absolute;
  right: -40px;
  top: 50%;
  width: min(560px, 48vw);
  transform: translateY(-46%) rotate(-8deg);
  opacity: .9;
  -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 45%);
          mask-image: linear-gradient(to right, transparent 0%, #000 45%);
  pointer-events: none;
}

.hero-inner { position: relative; max-width: var(--maxw); }
.hero-inner > * { max-width: 660px; }

.eyebrow {
  display: inline-block;
  margin: 0 0 20px;
  padding: 6px 12px;
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: #ffd9d4;
  background: rgba(226, 87, 76, .16);
  border: 1px solid rgba(226, 87, 76, .35);
  border-radius: 999px;
}

.hero h1 {
  color: #fff;
  font-size: clamp(2.5rem, 6vw, 4.1rem);
  font-weight: 700;
  letter-spacing: -.01em;
  margin-bottom: 16px;
}

.subtitle {
  font-family: var(--font-head);
  font-size: clamp(1.15rem, 2.2vw, 1.45rem);
  line-height: 1.4;
  color: rgba(255, 255, 255, .82);
  margin: 0 0 32px;
}

.hero-meta {
  list-style: none;
  padding: 0;
  margin: 0 0 36px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px 28px;
}
.hero-meta li { display: flex; align-items: center; gap: 8px; }
.hero-meta svg {
  width: 20px; height: 20px;
  fill: none; stroke: #8fb6ff; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
  flex-shrink: 0;
}
.hero .placeholder { color: rgba(255, 255, 255, .7); }

.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; }

.btn {
  display: inline-block;
  padding: 12px 22px;
  font-weight: 600;
  font-size: .97rem;
  text-decoration: none;
  border-radius: 10px;
  transition: transform .15s, background-color .15s, color .15s, border-color .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--coral); color: #fff; }
.btn-primary:hover { background: #cc4337; color: #fff; }
.btn-ghost { color: #fff; border: 1px solid rgba(255, 255, 255, .35); }
.btn-ghost:hover { color: #fff; border-color: #fff; background: rgba(255, 255, 255, .06); }

/* ---------------- Generic sections ---------------- */
.section { padding: 88px 0; }
.section-alt { background: var(--bg-alt); }

.section-label {
  margin: 0 0 8px;
  font-size: .8rem;
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--coral);
}

.lead { font-size: 1.05rem; color: var(--muted); margin: 0 0 36px; }

.subhead { margin-top: 56px; margin-bottom: 18px; }

/* ---------------- About ---------------- */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 56px;
  align-items: start;
}
.about h3 { margin-top: 36px; }

.topics {
  margin: 0;
  padding: 0;
  list-style: none;
  counter-reset: topic;
}
.topics li {
  counter-increment: topic;
  position: relative;
  padding: 12px 0 12px 48px;
  border-bottom: 1px solid var(--line);
}
.topics li:last-child { border-bottom: 0; }
.topics li::before {
  content: counter(topic, decimal-leading-zero);
  position: absolute;
  left: 0; top: 12px;
  font-family: var(--font-head);
  font-weight: 600;
  color: var(--blue);
}
.topics strong { display: block; font-weight: 600; color: var(--ink); }
.topics span { display: block; font-size: .93rem; color: var(--muted); }

/* Key takeaways: numbered panels with square "matrix-cell" sub-bullets */
.takeaways {
  list-style: none;
  margin: 0;
  padding: 0;
  counter-reset: takeaway;
  display: grid;
  gap: 16px;
}
.takeaways > li {
  counter-increment: takeaway;
  position: relative;
  padding: 20px 22px 16px 66px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.takeaways > li::before {
  content: counter(takeaway);
  position: absolute;
  left: 20px; top: 19px;
  width: 30px; height: 30px;
  display: grid;
  place-items: center;
  font-family: var(--font-head);
  font-size: .95rem;
  font-weight: 600;
  color: #fff;
  background: var(--coral);
  border-radius: 50%;
}
.takeaways p { margin: 0 0 8px; }
.takeaways p strong { color: var(--ink); }
.takeaways ul { list-style: none; margin: 0; padding: 0; }
.takeaways ul li {
  position: relative;
  padding: 3px 0 3px 22px;
  font-size: .95rem;
}
.takeaways ul li::before {
  content: "";
  position: absolute;
  left: 3px; top: .8em;
  width: 8px; height: 8px;
  background: var(--blue);
  border-radius: 2px;
}

.info-card {
  position: sticky;
  top: calc(var(--header-h) + 24px);
  padding: 28px;
  background: var(--bg-alt);
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.info-card h3 { margin: 0 0 12px; }
.info-card dl { margin: 0; }
.info-card dt {
  margin-top: 16px;
  font-size: .78rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
.info-card dd { margin: 2px 0 0; }

/* ---------------- Speakers ---------------- */
.people {
  display: grid;
  gap: 24px;
  margin-top: 32px;
}
.people-main  { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.people-other { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.people-heading {
  margin-top: 64px;
  font-size: clamp(1.5rem, 2.4vw, 1.9rem);
}

.speaker {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  padding: 32px 24px 26px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: box-shadow .2s, transform .2s;
}
.speaker:hover { box-shadow: 0 10px 30px rgba(14, 22, 48, .08); transform: translateY(-2px); }

/* Main speakers: larger horizontal cards with a coral accent */
.speaker-main {
  flex-direction: row;
  align-items: flex-start;
  text-align: left;
  gap: 26px;
  padding: 30px;
  border-top: 3px solid var(--coral);
}
.speaker-main .avatar { width: 150px; height: 150px; margin: 0; }
.speaker-main h3 { font-size: 1.35rem; }
.speaker-text { display: flex; flex-direction: column; min-width: 0; }

.avatar {
  width: 120px; height: 120px;
  margin-bottom: 18px;
  flex-shrink: 0;
  border-radius: 50%;
  object-fit: cover;
  object-position: 50% 30%;
  background: var(--bg-alt);
  box-shadow: 0 0 0 4px var(--bg), 0 0 0 5px var(--line);
}

.speaker h3 { margin: 0 0 4px; font-size: 1.15rem; }
.affiliation { margin: 0 0 12px; font-size: .92rem; color: var(--muted); font-weight: 500; }
.bio { margin: 0 0 16px; font-size: .9rem; line-height: 1.55; flex-grow: 1; }
.speaker-link { font-size: .9rem; font-weight: 600; text-decoration: none; }
.speaker-links { display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 20px; }
@media (max-width: 560px) { .speaker-links { justify-content: center; } }

/* ---------------- Schedule ---------------- */
.schedule {
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  counter-reset: session;
  border-top: 1px solid var(--line);
}
.schedule li {
  counter-increment: session;
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  align-items: baseline;
  padding: 20px 0;
  font-family: var(--font-head);
  font-size: 1.2rem;
  font-weight: 600;
  color: var(--ink);
  border-bottom: 1px solid var(--line);
}
.schedule li::before {
  content: counter(session, decimal-leading-zero);
  font-size: 1rem;
  color: var(--coral);
}

/* ---------------- Materials ---------------- */
.materials-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 20px;
  margin-top: 36px;
}

.material {
  display: block;
  padding: 26px 24px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  color: var(--text);
  text-decoration: none;
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.material:hover {
  color: var(--text);
  border-color: var(--blue);
  box-shadow: 0 10px 30px rgba(14, 22, 48, .08);
  transform: translateY(-2px);
}
.material svg {
  width: 34px; height: 34px;
  margin-bottom: 14px;
  fill: none; stroke: var(--blue); stroke-width: 1.6;
  stroke-linecap: round; stroke-linejoin: round;
}
.material h3 { margin: 0 0 4px; font-size: 1.15rem; }
.material p { margin: 0; font-size: .92rem; }

/* Slides card (narrow) + Code/Colab card (wide) */
.materials-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 2fr); align-items: start; }

/* The Code card is a container, not a link: no hover lift */
.material-code:hover { border-color: var(--line); box-shadow: none; transform: none; }

.steps {
  list-style: none;
  counter-reset: step;
  margin: 14px 0 20px;
  padding: 0;
}
.steps li {
  counter-increment: step;
  position: relative;
  padding: 4px 0 4px 36px;
  font-size: .92rem;
}
.steps li::before {
  content: counter(step);
  position: absolute;
  left: 0; top: 4px;
  width: 24px; height: 24px;
  display: grid;
  place-items: center;
  font-size: .78rem;
  font-weight: 600;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 50%;
}

.material-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; }

.refs { list-style: none; margin: 0; padding: 0; }
.refs li {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 18px 20px;
  margin-bottom: 12px;
  background: var(--bg);
  border: 1px solid var(--line);
  border-left: 3px solid var(--coral);
  border-radius: 8px;
}
.ref-badge {
  align-self: flex-start;
  margin-bottom: 4px;
  padding: 2px 10px;
  font-size: .72rem;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--coral);
  background: rgba(226, 87, 76, .1);
  border-radius: 999px;
}
.ref-title { font-family: var(--font-head); font-size: 1.1rem; font-weight: 600; line-height: 1.35; color: var(--ink); }
.ref-authors { font-size: .95rem; }
.ref-meta { font-size: .92rem; color: var(--muted); }
.ref-links { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }

/* Small pill links used for arXiv / DOI / Code */
.ref-links a, .tags a {
  display: inline-block;
  padding: 2px 10px;
  font-size: .8rem;
  font-weight: 600;
  text-decoration: none;
  color: var(--blue);
  background: var(--blue-soft);
  border-radius: 6px;
  transition: background-color .15s, color .15s;
}
.ref-links a:hover, .tags a:hover { color: #fff; background: var(--blue); }
.tags a.placeholder { font-style: italic; color: var(--muted); background: var(--bg-alt); }

/* ---------------- Additional material ---------------- */
.biblio-group {
  margin: 32px 0 12px;
  font-family: var(--font-body);
  font-size: .82rem;
  font-weight: 600;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--muted);
}
#papers { margin-bottom: 0; }

.biblio {
  margin: 0;
  padding: 0;
  list-style: none;
}
.biblio li {
  padding: 14px 0;
  font-size: .95rem;
  line-height: 1.6;
  border-bottom: 1px solid var(--line);
}
.biblio li:last-child { border-bottom: 0; }
.biblio em { color: var(--ink); }
.tags { display: inline-flex; flex-wrap: wrap; gap: 6px; margin-left: 6px; vertical-align: 1px; }

.repos {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 14px;
}
.repos li { display: flex; }
.repo {
  flex: 1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  color: var(--text);
  text-decoration: none;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  transition: border-color .2s, box-shadow .2s, transform .2s;
}
.repo:hover {
  color: var(--text);
  border-color: var(--blue);
  box-shadow: 0 10px 30px rgba(14, 22, 48, .08);
  transform: translateY(-2px);
}
.repo-name {
  font-family: ui-monospace, "SFMono-Regular", Consolas, monospace;
  font-size: .9rem;
  color: var(--muted);
  overflow-wrap: anywhere;
}
.repo-name strong { color: var(--blue); }
.repo-desc { font-size: .92rem; }

/* ---------------- Footer ---------------- */
.site-footer {
  padding: 36px 0;
  background: var(--ink);
  color: rgba(255, 255, 255, .7);
  font-size: .92rem;
}
.footer-inner {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 8px 24px;
}
.site-footer p { margin: 0; }
.site-footer a { color: #fff; }
.site-footer .placeholder { color: rgba(255, 255, 255, .7); }

/* ---------------- Responsive ---------------- */
/* Collapse the 5-link nav into a menu button before it gets crowded */
@media (max-width: 980px) {
  .nav-toggle { display: flex; }
  .nav-links {
    position: absolute;
    top: var(--header-h);
    left: 0; right: 0;
    flex-direction: column;
    gap: 0;
    padding: 8px 24px 16px;
    background: var(--ink);
    border-bottom: 1px solid rgba(255, 255, 255, .08);
    display: none;
  }
  .nav-links.open { display: flex; }
  .nav-links a { padding: 12px 8px; }
  .nav-links a.active::after { left: 8px; right: auto; width: 24px; bottom: 6px; }
}

@media (max-width: 900px) {
  .about-grid { grid-template-columns: 1fr; gap: 40px; }
  .info-card { position: static; }
  .hero-matrix { width: 70vw; right: -20vw; opacity: .35; }
  .people-main { grid-template-columns: 1fr; }
}

@media (max-width: 760px) {
  body { font-size: 16px; }
  .container { padding: 0 16px; }
  .nav-links { padding: 8px 16px 16px; }

  .brand span { font-size: .88rem; }
  .people-other { grid-template-columns: 1fr; }
  .materials-grid { grid-template-columns: 1fr; }
  .tags { display: flex; margin: 8px 0 0; }

  .hero { padding: calc(var(--header-h) + 56px) 0 72px; }
  .hero-matrix { width: 110vw; right: -50vw; top: 30%; opacity: .22; }

  .section { padding: 64px 0; }

  .schedule li { grid-template-columns: 44px minmax(0, 1fr); font-size: 1.1rem; }
}

@media (max-width: 560px) {
  .speaker-main { flex-direction: column; align-items: center; text-align: center; }
  .speaker-main .speaker-text { align-items: center; }
  .repos { grid-template-columns: 1fr; }
}

@media (max-width: 350px) {
  .brand span { display: none; }
}
