:root {
  --bg:     #0a0e13;
  --panel:  #10161d;
  --fg:     #f2f2f0;
  --sub:    #8b8b95;
  --accent: #38bdf8;
  --border: rgba(255,255,255,0.09);
}

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

html { font-size: 1.125rem; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  line-height: 1.75rem;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

a { color: var(--accent); text-decoration: none; transition: color 0.25s ease; }
a:hover { text-decoration: underline; }
em { color: var(--fg); font-style: italic; }

#tickers { border-top: 1px solid var(--border); }
marquee {
  display: block;
  color: var(--sub);
  font-size: 0.98rem;
  letter-spacing: 0.03em;
  padding: 0.6rem 0;
  border-bottom: 1px solid var(--border);
}
marquee a { color: var(--accent); }
.blog-link { font-style: italic; }

.wrap { max-width: 64rem; width: 100%; margin: 0 auto; }

nav {
  display: flex;
  align-items: center;
  gap: 1.4rem;
  flex-wrap: wrap;
  padding: 1rem 1rem;
}
.nav-home {
  display: flex;
  align-items: center;
  gap: 0.4rem;
  font-weight: 600;
  font-size: 1.1rem;
  color: var(--fg);
  flex-grow: 1;
}
.nav-home:hover { text-decoration: none; color: var(--accent); }
nav a:not(.nav-home) {
  color: var(--sub);
  font-size: 0.95rem;
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
}
nav a:not(.nav-home):hover { color: var(--accent); text-decoration: none; }
.ext { width: 0.7em; height: 0.7em; opacity: 0.7; }
svg { display: block; }

main { flex: 1; padding: 2.2rem 1rem 1rem; }

/* the two blurbs on my homepage */
section { max-width: 64rem; margin: 0 auto 2.6rem; }
section h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.01em;
}
section .kicker {
  color: var(--sub);
  font-size: 1.08rem;
  margin-top: 0.2rem;
  margin-bottom: 0.9rem;
}
section p { color: #cfcfd6; font-size: 1.08rem; max-width: 46rem; }
section p + p { margin-top: 0.6rem; }

.easter {
  max-width: 64rem;
  margin: 0 auto 2rem;
  color: var(--sub);
  font-size: 0.88rem;
  font-style: italic;
}

/* the blogs list */
.head { max-width: 64rem; margin: 0 auto 2.4rem; }
.head h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.01em;
}
.head p {
  color: var(--sub);
  font-size: 1.08rem;
  margin-top: 0.2rem;
}

.posts { max-width: 64rem; margin: 0 auto; }
.post {
  display: block;
  color: inherit;
  text-decoration: none;
  padding: 1.3rem 0.9rem;
  margin: 0 -0.9rem 0.2rem;
  border-radius: 4px;
  transition: background 0.25s ease;
}
.post:last-child { margin-bottom: 0; }
.post:hover { background: rgba(56,189,248,0.06); text-decoration: none; }
.post-date {
  color: var(--sub);
  font-size: 0.8rem;
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.post-title {
  font-size: 1.2rem;
  font-weight: 700;
  margin-top: 0.3rem;
  color: var(--fg);
  transition: color 0.25s ease;
}
.post:hover .post-title { color: var(--accent); }
.post-excerpt {
  color: #cfcfd6;
  font-size: 0.98rem;
  margin-top: 0.4rem;
  max-width: 46rem;
}

.empty {
  max-width: 64rem;
  margin: 0 auto;
  color: var(--sub);
  font-size: 0.95rem;
  font-style: italic;
}

footer {
  padding: 1.6rem 1rem 2.2rem;
  display: flex;
  justify-content: center;
  gap: 1.1rem;
}
footer a {
  color: var(--sub);
  width: 1.3rem;
  height: 1.3rem;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: color 0.25s ease;
}
footer a:hover { color: var(--accent); }
footer svg { width: 100%; height: 100%; }

/* an actual blog post page */
.post-article {
  max-width: 64rem;
  margin: 0 auto;
  background: var(--panel);
  border-radius: 10px;
  padding: 2rem;
}
.post-article .post-meta {
  color: var(--sub);
  font-size: 0.95rem;
  margin-top: 0.5rem;
}
.post-article h1 {
  font-size: clamp(1.9rem, 4.5vw, 2.4rem);
  font-weight: 700;
  letter-spacing: 0.01em;
}
.post-body { margin-top: 1.6rem; }
.post-body h2 {
  font-size: 1.3rem;
  font-weight: 700;
  margin-top: 2.4rem;
  margin-bottom: 0.7rem;
  padding-top: 1.4rem;
  border-top: 1px solid var(--border);
}
.post-body h2:first-child { margin-top: 0; padding-top: 0; border-top: none; }
.post-body h3 {
  font-size: 1.1rem;
  font-weight: 700;
  margin-top: 1.8rem;
  margin-bottom: 0.5rem;
}
.post-body p { color: #cfcfd6; font-size: 1.05rem; margin-top: 1rem; max-width: 40rem; }
.post-body p:first-child { margin-top: 0; }
.post-body h4 {
  font-size: 1rem;
  font-weight: 700;
  margin-top: 1.2rem;
  margin-bottom: 0.4rem;
}
.post-body blockquote {
  border-left: 3px solid var(--accent);
  padding-left: 1.1rem;
  margin: 1.4rem 0;
  font-style: italic;
  font-size: 1.12rem;
  color: var(--fg);
  max-width: 40rem;
}
.post-body ul {
  margin: 1rem 0 1rem 1.3rem;
  max-width: 40rem;
}
.post-body li {
  color: #cfcfd6;
  font-size: 1.05rem;
  margin: 0.4rem 0;
}
.post-body figure { margin: 1.6rem 0; }
.post-body img,
.post-body video {
  width: 100%;
  border-radius: 10px;
  display: block;
}
.post-body figcaption {
  margin-top: 0.6rem;
  font-size: 0.85rem;
  color: var(--sub);
  text-align: center;
}
.post-body .post-audio {
  margin: 1.4rem 0;
  padding: 1rem 1.2rem;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--panel);
}
.post-body .post-audio-title {
  display: block;
  font-size: 0.82rem;
  color: var(--sub);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  margin-bottom: 0.6rem;
}
.post-body audio { width: 100%; }
.post-body .body-link {
  display: inline-flex;
  align-items: center;
  gap: 0.5rem;
  margin: 1rem 0;
  padding: 0.7rem 1.1rem;
  border: 1.5px solid var(--accent);
  border-radius: 8px;
  color: var(--accent);
  font-weight: 600;
  text-decoration: none;
}
.post-body .body-link:hover { background: rgba(56,189,248,0.08); text-decoration: none; }

/* that toc tab i made + the panel it opens */
.toc-tab {
  position: fixed;
  top: 50%;
  right: 0;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  gap: 0.7rem;
  background: var(--bg);
  border: 2px solid var(--accent);
  border-right: none;
  border-radius: 10px 0 0 10px;
  padding: 1rem 1.15rem;
  color: var(--accent);
  cursor: pointer;
  overflow: hidden;
  white-space: nowrap;
  max-width: 3.2rem;
  transition: max-width 0.45s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 40;
}
.toc-tab:hover, .toc-tab.open { max-width: 17rem; }
.toc-tab svg { flex-shrink: 0; width: 22px; height: 22px; transition: transform 0.45s cubic-bezier(0.4, 0, 0.2, 1); }
.toc-tab.open svg { transform: rotate(180deg); }
.toc-tab-label {
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.toc-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.5);
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
  z-index: 39;
}
.toc-backdrop.open { opacity: 1; pointer-events: all; }

.toc-panel {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.96);
  width: min(560px, 90vw);
  max-height: 75vh;
  overflow-y: auto;
  background: var(--bg);
  border: 2px solid var(--accent);
  border-radius: 14px;
  padding: 2rem 2.2rem;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 41;
}
.toc-panel.open { opacity: 1; pointer-events: all; transform: translate(-50%, -50%) scale(1); }
.toc-panel h2 {
  font-size: 1rem;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--sub);
  margin-bottom: 1.2rem;
}
.toc-panel ul { list-style: none; }
.toc-panel li { margin: 0.6rem 0; }
.toc-panel ul ul { margin-left: 1.2rem; margin-top: 0.45rem; }
.toc-panel a { display: block; color: var(--fg); font-size: 1.15rem; text-decoration: none; transition: color 0.25s ease; }
.toc-panel a:hover { color: var(--accent); }

@media (max-width: 720px) {
  .toc-tab, .toc-panel, .toc-backdrop { display: none; }
}