:root {
  --bg: #000000;
  --bg-elev: #0a0a0a;
  --text: #ffffff;
  --muted: #adadad;
  --accent: #ffab40;
  --link: #4dd0e1;
  --rule: rgba(255, 255, 255, 0.08);
  --rule-strong: rgba(255, 255, 255, 0.16);
  --maxw: 760px;
  --maxw-wide: 920px;
}

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
}

html,
body {
  height: 100%;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: "Lexend", system-ui, -apple-system, "Segoe UI", Roboto, Helvetica,
    Arial, "Apple Color Emoji", "Segoe UI Emoji";
  font-weight: 400;
  font-size: 17px;
  line-height: 1.7;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

.container {
  width: min(var(--maxw), calc(100% - 2rem));
  margin-inline: auto;
}

.container-wide {
  width: min(var(--maxw-wide), calc(100% - 2rem));
  margin-inline: auto;
}

/* ---------- Header / nav ---------- */

.site-header {
  border-bottom: 1px solid var(--rule);
  padding: 1.1rem 0;
  position: sticky;
  top: 0;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: saturate(140%) blur(8px);
  -webkit-backdrop-filter: saturate(140%) blur(8px);
  z-index: 10;
}

.site-header .container-wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1.5rem;
}

.site-title {
  font-weight: 600;
  font-size: 0.98rem;
  letter-spacing: 0.2px;
  color: var(--text);
  white-space: nowrap;
}

.site-title:hover {
  text-decoration: none;
  color: var(--accent);
}

.site-nav {
  display: flex;
  gap: 1.25rem;
  flex-wrap: wrap;
  font-size: 0.95rem;
  color: var(--muted);
}

.site-nav a {
  color: var(--muted);
}

.site-nav a:hover,
.site-nav a[aria-current="page"] {
  color: var(--text);
  text-decoration: none;
}

/* ---------- Main / footer ---------- */

main {
  padding: 3rem 0 5rem;
}

.site-footer {
  border-top: 1px solid var(--rule);
  padding: 1.5rem 0 2rem;
  color: var(--muted);
  font-size: 0.92rem;
}

.site-footer .container-wide {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
}

.site-footer a {
  color: var(--muted);
}

.site-footer a:hover {
  color: var(--link);
}

/* ---------- Typography ---------- */

h1,
h2,
h3,
h4,
h5,
h6 {
  color: var(--accent);
  font-weight: 600;
  line-height: 1.2;
  letter-spacing: -0.01em;
  margin: 2.4rem 0 0.85rem;
}

h1 {
  font-size: clamp(1.9rem, 1.4rem + 1.6vw, 2.6rem);
  font-weight: 650;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.35rem, 1.1rem + 0.8vw, 1.65rem);
}

h3 {
  font-size: 1.15rem;
}

p {
  margin: 0 0 1.1rem;
}

p:last-child {
  margin-bottom: 0;
}

.muted {
  color: var(--muted);
}

.lead {
  font-size: 1.08rem;
  color: var(--text);
}

strong,
b {
  color: var(--accent);
  font-weight: 600;
}

em,
i {
  color: inherit;
}

a {
  color: var(--link);
  text-decoration: none;
  transition: color 120ms ease;
}

a:hover,
a:focus-visible {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
}

hr {
  border: 0;
  border-top: 1px solid var(--rule);
  margin: 2.5rem 0;
}

ul,
ol {
  padding-left: 1.25rem;
}

ul li::marker {
  color: var(--muted);
}

blockquote {
  margin: 1.5rem 0;
  padding: 0.4rem 1.1rem;
  border-left: 2px solid var(--accent);
  color: var(--muted);
}

code,
pre {
  font-family: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas,
    "Liberation Mono", "Courier New", monospace;
  font-size: 0.92em;
}

pre {
  padding: 1rem;
  overflow: auto;
  background: var(--bg-elev);
  border: 1px solid var(--rule);
  border-radius: 10px;
}

::selection {
  background: rgba(255, 171, 64, 0.28);
}

/* ---------- Hero ---------- */

.hero {
  padding: 1rem 0 0.5rem;
}

.hero .eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.6rem;
}

.hero h1 {
  margin: 0 0 0.35rem;
  color: var(--text);
}

.hero .subtitle {
  color: var(--accent);
  font-weight: 500;
  margin: 0 0 1.6rem;
}

.hero .lead {
  color: var(--text);
  max-width: 60ch;
}

/* ---------- Thread cards (home) ---------- */

.threads {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1rem;
  margin: 1.25rem 0 0;
}

.thread-card {
  display: block;
  padding: 1.25rem 1.25rem 1.1rem;
  border: 1px solid var(--rule);
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(255, 255, 255, 0.015), transparent);
  color: var(--text);
  transition: border-color 150ms ease, transform 150ms ease,
    background-color 150ms ease;
}

.thread-card:hover {
  border-color: var(--rule-strong);
  text-decoration: none;
  transform: translateY(-1px);
}

.thread-card .thread-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 1rem;
  color: var(--accent);
  font-weight: 600;
  font-size: 1.1rem;
  margin: 0 0 0.35rem;
}

.thread-card .thread-title .arrow {
  color: var(--link);
  transition: transform 150ms ease;
}

.thread-card:hover .thread-title .arrow {
  transform: translateX(3px);
}

.thread-card .thread-tagline {
  color: var(--muted);
  font-size: 0.96rem;
  margin: 0 0 0.6rem;
}

.thread-card .thread-meta {
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

/* ---------- Thread page ---------- */

.thread-header {
  margin-bottom: 1.25rem;
}

.thread-header .eyebrow {
  display: inline-block;
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  margin: 0 0 0.5rem;
}

.thread-header h1 {
  color: var(--accent);
  margin: 0 0 0.5rem;
}

.thread-intro {
  color: var(--text);
  max-width: 60ch;
}

.section-label {
  margin-top: 2.5rem;
  color: var(--muted);
  font-size: 0.82rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 500;
  border-top: 1px solid var(--rule);
  padding-top: 1.4rem;
}

/* ---------- Video card ---------- */

.video-list {
  display: grid;
  grid-template-columns: 1fr;
  gap: 1.75rem;
  margin: 1.25rem 0 0;
  padding: 0;
  list-style: none;
  counter-reset: video-counter;
}

.video-card {
  counter-increment: video-counter;
  display: grid;
  grid-template-columns: 1fr;
  gap: 0.85rem;
}

.video-thumb {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  border: 1px solid var(--rule);
  background: #111;
  transition: border-color 150ms ease, transform 150ms ease;
}

.video-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  transition: transform 250ms ease, opacity 200ms ease;
}

.video-thumb::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    60% 60% at 50% 50%,
    rgba(0, 0, 0, 0.0) 40%,
    rgba(0, 0, 0, 0.35) 100%
  );
  opacity: 0;
  transition: opacity 200ms ease;
  pointer-events: none;
}

.video-thumb .play {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 60px;
  height: 60px;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  display: grid;
  place-items: center;
  transition: background-color 150ms ease, transform 150ms ease;
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.video-thumb .play svg {
  width: 22px;
  height: 22px;
  fill: var(--text);
  transform: translateX(2px); /* optical center */
}

.video-thumb:hover {
  border-color: var(--rule-strong);
  text-decoration: none;
}

.video-thumb:hover img {
  transform: scale(1.02);
}

.video-thumb:hover::before {
  opacity: 1;
}

.video-thumb:hover .play {
  background: var(--accent);
  transform: translate(-50%, -50%) scale(1.04);
  border-color: transparent;
}

.video-thumb:hover .play svg {
  fill: #000;
}

.video-duration {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 2px 7px;
  font-size: 0.78rem;
  font-weight: 500;
  color: #fff;
  background: rgba(0, 0, 0, 0.78);
  border-radius: 4px;
  line-height: 1.4;
  letter-spacing: 0.02em;
}

.video-meta .video-index {
  font-size: 0.78rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--muted);
  display: inline-block;
  margin-bottom: 0.25rem;
}

.video-meta .video-index::before {
  content: counter(video-counter, decimal-leading-zero) " · ";
  color: var(--accent);
  font-weight: 600;
}

.video-meta h3 {
  color: var(--text);
  font-weight: 600;
  font-size: 1.08rem;
  margin: 0 0 0.35rem;
}

.video-meta h3 a {
  color: var(--text);
}

.video-meta h3 a:hover {
  color: var(--accent);
  text-decoration: none;
}

.video-meta .blurb {
  color: var(--muted);
  margin: 0;
}

.video-also-in {
  margin: 0.75rem 0 0;
  font-size: 0.82rem;
  color: var(--muted);
  letter-spacing: 0.02em;
}

.video-also-in a {
  color: var(--muted);
  border-bottom: 1px dotted var(--rule-strong);
  padding-bottom: 1px;
  transition: color 120ms ease, border-color 120ms ease;
}

.video-also-in a:hover,
.video-also-in a:focus-visible {
  color: var(--link);
  border-color: var(--link);
  text-decoration: none;
}

/* ---------- Skip link ---------- */

.skip {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
}

.skip:focus {
  position: fixed;
  left: 1rem;
  top: 1rem;
  width: auto;
  height: auto;
  padding: 0.5rem 0.75rem;
  background: var(--accent);
  color: #000;
  border-radius: 6px;
  z-index: 100;
}

/* ---------- Responsive tweaks ---------- */

@media (min-width: 720px) {
  .threads {
    gap: 1.1rem;
  }
}
