/* Dark theme (default) */
:root {
  --bg: #121212;
  --fg: #F8F8F2;
  --accent: #9580FF;
  --hover: #80FFEA;
  --muted: #6272A4;
  --border: #282A36;
}

/* Light theme */
[data-theme="light"] {
  --bg: #F8F8F2;
  --fg: #282A36;
  --accent: #6272A4;
  --hover: #9580FF;
  --muted: #888;
  --border: #ddd;
}

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

html {
  background-color: var(--bg);
}

body {
  background-color: transparent;
  color: var(--fg);
  font-family: 'JetBrains Mono', 'Fira Mono', 'Cascadia Code', 'Courier New', monospace;
  font-size: 14px;
  line-height: 1.7;
  max-width: 800px;
  margin: 0 auto;
  padding: 48px 24px;
  transition: background-color 0.15s ease, color 0.15s ease;
}


a {
  color: var(--accent);
  text-decoration: none;
}

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

/* ── Header ── */

header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 72px;
}

.site-name a {
  color: var(--fg);
  font-size: 15px;
  font-weight: bold;
}

.site-name a:hover {
  color: var(--accent);
}

nav {
  display: flex;
  align-items: center;
  gap: 24px;
}

nav a {
  color: var(--muted);
  font-size: 13px;
}

nav a:hover {
  color: var(--fg);
}

#theme-toggle {
  background: none;
  border: none;
  color: var(--muted);
  cursor: pointer;
  font-size: 17px;
  padding: 0;
  line-height: 1;
  display: flex;
  align-items: center;
}

#theme-toggle:hover {
  color: var(--fg);
}

/* ── Main ── */

main {
  margin-bottom: 72px;
}

/* Homepage layout overrides */
body.home {
  max-width: 100%;
  padding-left: 0;
  padding-right: 0;
}

body.home header {
  width: min(74vw, calc((100vh - 140px) * 16 / 9 * 0.8));
  margin-left: auto;
  margin-right: auto;
  margin-bottom: 24px;
}

/* Homepage video */
.video-wrap {
  position: relative;
  /* Fill viewport width or constrain by height (minus ~140px for header), whichever is smaller */
  width: min(74vw, calc((100vh - 140px) * 16 / 9 * 0.8));
  margin: 0 auto;
  aspect-ratio: 16 / 9;
}

.video-wrap iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

/* ── List pages ── */

h1 {
  font-size: 12px;
  font-weight: normal;
  color: var(--muted);
  margin-bottom: 36px;
  text-transform: uppercase;
  letter-spacing: 0.12em;
}

.item-list {
  list-style: none;
}

.item {
  margin-bottom: 28px;
}

.item-header {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 16px;
}

.item-header a,
.item-header span {
  color: var(--fg);
  font-size: 14px;
}

.item-header a:hover {
  color: var(--accent);
}

.item-date {
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  flex-shrink: 0;
}

.item-meta {
  color: var(--muted);
  font-size: 12px;
  margin-top: 3px;
}

.item-desc {
  color: var(--muted);
  font-size: 13px;
  margin-top: 5px;
  max-width: 620px;
  line-height: 1.5;
}

/* ── Single pages ── */

article h1 {
  font-size: 16px;
  font-weight: bold;
  color: var(--fg);
  margin-bottom: 12px;
  text-transform: none;
  letter-spacing: 0;
}

.content p {
  margin-bottom: 1.2em;
}

/* ── Footer ── */

footer {
  color: var(--muted);
  font-size: 13px;
  border-top: 1px solid var(--border);
  padding-top: 20px;
}

footer a {
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

footer a:hover {
  color: var(--fg);
}
