:root {
  --fg: #1c1d21;
  --bg: #f7f7f8;
  --surface: #ffffff;
  --muted: #666a73;
  --border: #dcdde1;
  --accent: #6d28d9;
  --accent-2: #0e7490;
  --line-2: #06b6d4;
  color-scheme: light;
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  line-height: 1.55;
}

:root[data-theme="dark"] {
  --fg: #e8e8ea;
  --bg: #141518;
  --surface: #1d1f23;
  --muted: #9a9ca3;
  --border: #2e3036;
  --accent: #b794f6;
  --accent-2: #22d3ee;
  --line-2: #22d3ee;
  color-scheme: dark;
}

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --fg: #e8e8ea;
    --bg: #141518;
    --surface: #1d1f23;
    --muted: #9a9ca3;
    --border: #2e3036;
    --accent: #b794f6;
    --accent-2: #22d3ee;
    --line-2: #22d3ee;
    color-scheme: dark;
  }
}

body {
  margin: 0 auto;
  max-width: 72rem;
  padding: 1.5rem 2rem 3rem;
  color: var(--fg);
  background: var(--bg);
}

a { color: var(--accent); }
a:hover { color: var(--accent-2); }

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 1rem;
  border-bottom: 2px solid;
  border-image: linear-gradient(90deg, var(--accent), var(--line-2, var(--accent-2))) 1;
  padding-bottom: 1rem;
  margin-bottom: 2rem;
}

.site-name {
  margin: 0;
  font-size: 1.4rem;
  font-weight: 700;
  letter-spacing: -0.01em;
  line-height: 1.2;
}
.site-name a { color: var(--accent); text-decoration: none; }
.site-name a:hover { color: var(--accent-2); }

nav { display: flex; align-items: center; gap: 1.25rem; }
nav a { text-decoration: none; font-weight: 500; }
nav a:hover { text-decoration: underline; color: var(--accent-2); }

.theme-toggle {
  display: inline-grid;
  place-items: center;
  width: 2.25rem;
  height: 2.25rem;
  padding: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--surface);
  color: var(--fg);
  cursor: pointer;
}
.theme-toggle:hover { border-color: var(--accent-2); color: var(--accent-2); }
.theme-toggle svg { display: block; }

/* The icon shows the mode a click switches to. */
.theme-toggle .icon-sun { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-moon { display: none; }
:root[data-theme="dark"] .theme-toggle .icon-sun { display: block; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .theme-toggle .icon-moon { display: none; }
  :root:not([data-theme="light"]) .theme-toggle .icon-sun { display: block; }
}

h1 { font-size: 1.75rem; letter-spacing: -0.01em; margin-top: 0; }
h2 { font-size: 1.25rem; letter-spacing: -0.01em; margin: 0 0 1rem; }

.videos {
  list-style: none;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(18rem, 1fr));
  gap: 1.5rem;
}
.videos li {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: 8px;
  overflow: hidden;
}
.videos img { display: block; width: 100%; height: auto; aspect-ratio: 16 / 9; object-fit: cover; }
.videos li > div { padding: 0.75rem 1rem 1rem; }
.videos .title { font-size: 1.05rem; font-weight: 600; color: var(--fg); text-decoration: none; }
.videos .title:hover { color: var(--accent-2); }
.videos li:hover { border-color: var(--accent); }

.intro { color: var(--muted); margin: 0 0 2rem; font-size: 1.05rem; text-wrap: pretty; }
.meta { color: var(--muted); margin: 0.35rem 0 0; font-size: 0.9rem; }

.sources { max-width: 50rem; }
.sources li { margin-bottom: 0.75rem; }
.sources a { word-break: break-all; }

footer {
  margin-top: 4rem;
  padding-top: 1.25rem;
  border-top: 1px solid var(--border);
  color: var(--muted);
  font-size: 0.95rem;
}
footer p { margin: 0.75rem 0 0; }
.socials { display: flex; flex-wrap: wrap; gap: 0.5rem 1.25rem; }
.socials a { font-weight: 500; text-decoration: none; }
.socials a:hover { text-decoration: underline; }

@media (max-width: 36rem) {
  body { padding: 1rem 1rem 2rem; }
  nav { gap: 0.9rem; }
}
