/* ---------------------------------------------------------------
   TubeRadar — editorial dark theme
   --------------------------------------------------------------- */

:root {
  --bg:         #0c0b09;
  --bg-raised: #131210;
  --bg-inset:  #1a1816;
  --fg:        #ebe5d6;
  --fg-soft:   #b0a899;
  --fg-mute:   #6b6557;
  --rule:      #2a2724;
  --accent:    #ff5722;     /* ember */
  --accent-2:  #f5c451;     /* amber */
  --max:       1280px;

  --f-display: "Fraunces", "Times New Roman", serif;
  --f-body:    "IBM Plex Sans", system-ui, sans-serif;
  --f-mono:    "IBM Plex Mono", ui-monospace, monospace;
}

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

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--f-body);
  font-weight: 300;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  min-height: 100vh;
  overflow-x: hidden;
}

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

/* Subtle grain — gives the page a printed-paper feel */
.grain {
  position: fixed; inset: 0;
  pointer-events: none; z-index: 1;
  opacity: 0.035;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='200' height='200'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
}

/* ---------------------------------------------------------------
   Masthead
   --------------------------------------------------------------- */

.masthead {
  position: sticky; top: 0; z-index: 10;
  background: rgba(12, 11, 9, 0.85);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--rule);
}

.masthead__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 18px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 32px;
}

.logo {
  display: inline-flex; align-items: baseline; gap: 8px;
}
.logo__mark {
  color: var(--accent);
  font-size: 18px;
  transform: translateY(2px);
}
.logo__word {
  font-family: var(--f-display);
  font-weight: 600;
  font-size: 22px;
  letter-spacing: 0.01em;
}

.masthead__nav {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.08em;
  color: var(--fg-mute);
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.meta-label { color: var(--fg-mute); }
.meta-value { color: var(--fg); }
.meta-divider { color: var(--rule); }

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

.hero {
  max-width: var(--max);
  margin: 0 auto;
  padding: 88px 32px 56px;
  text-align: left;
  position: relative;
  z-index: 2;
}

.hero__rule {
  height: 1px;
  background: var(--rule);
  margin: 0 0 32px 0;
}
.hero__rule + .hero__rule { display: none; }
.hero .hero__rule:last-child {
  display: block;
  margin: 56px 0 0;
}

.hero__eyebrow {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 24px;
}

.hero__title {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(44px, 8vw, 112px);
  line-height: 0.95;
  letter-spacing: -0.025em;
  font-variation-settings: "opsz" 144;
  margin-bottom: 32px;
}
.hero__title em {
  font-style: italic;
  font-weight: 400;
  color: var(--accent-2);
  font-variation-settings: "opsz" 144, "SOFT" 100;
}

.hero__lede {
  font-family: var(--f-display);
  font-weight: 300;
  font-size: clamp(18px, 1.6vw, 22px);
  line-height: 1.5;
  color: var(--fg-soft);
  max-width: 64ch;
  font-variation-settings: "opsz" 24;
}

/* ---------------------------------------------------------------
   Two-column layout
   --------------------------------------------------------------- */

.layout {
  max-width: var(--max);
  margin: 0 auto;
  padding: 64px 32px;
  display: grid;
  grid-template-columns: 1.55fr 1fr;
  gap: 56px;
  position: relative;
  z-index: 2;
}

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; gap: 64px; }
}

.column__head {
  margin-bottom: 28px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--rule);
}
.column__title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 28px;
  letter-spacing: -0.01em;
  margin-bottom: 6px;
}
.column__sub {
  font-size: 13px;
  color: var(--fg-mute);
  max-width: 50ch;
}

/* ---------------------------------------------------------------
   Emerging themes
   --------------------------------------------------------------- */

.themes-section {
  margin-bottom: 64px;
  position: relative;
}
.themes-section::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 0;
  bottom: 0;
  width: 1px;
  background: linear-gradient(180deg, var(--accent) 0%, transparent 100%);
  opacity: 0.6;
}

.themes-pulse {
  display: inline-block;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--accent);
  margin-right: 12px;
  vertical-align: middle;
  position: relative;
  top: -2px;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes pulse {
  0%, 100% {
    box-shadow: 0 0 0 0 rgba(255, 87, 34, 0.6);
    transform: scale(1);
  }
  50% {
    box-shadow: 0 0 0 8px rgba(255, 87, 34, 0);
    transform: scale(1.1);
  }
}

.themes {
  list-style: none;
  display: flex;
  flex-direction: column;
}

/* "X new themes since your last visit" banner */
.themes-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 18px;
  background: rgba(255, 87, 34, 0.08);
  border: 1px solid rgba(255, 87, 34, 0.25);
  border-radius: 4px;
  margin-bottom: 24px;
  font-size: 13px;
  color: var(--fg);
  animation: bannerIn 0.5s ease-out;
}
.themes-banner strong {
  color: var(--accent);
  font-weight: 500;
}
.themes-banner__dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
}
@keyframes bannerIn {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}

.theme {
  display: grid;
  grid-template-columns: 36px 1fr;
  gap: 24px;
  padding: 24px 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  transition: padding 0.2s ease;
}
.theme:hover {
  padding-left: 8px;
}
.theme:hover .theme__phrase {
  color: var(--accent);
}

.theme__rank {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.05em;
  padding-top: 8px;
}

.theme__main { min-width: 0; }

.theme__phrase {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(20px, 2.2vw, 28px);
  letter-spacing: -0.01em;
  line-height: 1.15;
  margin-bottom: 14px;
  font-variation-settings: "opsz" 60;
  transition: color 0.2s ease;
  word-break: break-word;
}
.theme__new-badge {
  display: inline-block;
  font-family: var(--f-mono);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.15em;
  color: var(--bg);
  background: var(--accent);
  padding: 3px 7px 2px;
  border-radius: 2px;
  vertical-align: middle;
  margin-left: 12px;
  transform: translateY(-2px);
}
.theme--new {
  position: relative;
}
.theme--new::before {
  content: "";
  position: absolute;
  left: -16px;
  top: 24px;
  bottom: 24px;
  width: 2px;
  background: var(--accent);
}

.theme__detected {
  display: block;
  margin-top: 12px;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.05em;
  color: var(--fg-mute);
}

.theme__stats {
  display: flex;
  gap: 28px;
  margin-bottom: 4px;
  flex-wrap: wrap;
}
.theme__stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.theme__stat strong {
  font-family: var(--f-display);
  font-size: 24px;
  font-weight: 400;
  color: var(--accent);
  font-variation-settings: "opsz" 36;
  letter-spacing: -0.01em;
  line-height: 1;
}
.theme__stat-label {
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-mute);
}

.theme__examples {
  display: none;
  flex-direction: column;
  gap: 10px;
  margin-top: 18px;
}
.theme.is-open .theme__examples { display: flex; }
.theme.is-open { padding-bottom: 28px; }

@media (max-width: 600px) {
  .theme { grid-template-columns: 28px 1fr; gap: 16px; }
  .theme__stats { gap: 20px; }
  .theme__stat strong { font-size: 20px; }
}

/* Section divider between themes and topics */
.topics-section .column__head {
  position: relative;
}

/* ---------------------------------------------------------------
   Topics list
   --------------------------------------------------------------- */

.topics {
  list-style: none;
  display: flex;
  flex-direction: column;
}

.topic {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  align-items: start;
  gap: 24px;
  padding: 26px 0;
  border-bottom: 1px solid var(--rule);
  cursor: pointer;
  transition: padding 0.2s ease;
  position: relative;
}
.topic:hover {
  padding-left: 8px;
}
.topic:hover .topic__phrase { color: var(--accent); }

.topic__rank {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.05em;
  padding-top: 8px;
}

.topic__main { min-width: 0; }
.topic__phrase {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: clamp(22px, 2.4vw, 32px);
  letter-spacing: -0.01em;
  line-height: 1.1;
  margin-bottom: 4px;
  font-variation-settings: "opsz" 72;
  transition: color 0.2s ease;
  word-break: break-word;
}
.topic__meta {
  font-family: var(--f-mono);
  font-size: 11px;
  color: var(--fg-mute);
  letter-spacing: 0.04em;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 6px;
}
.topic__meta span:not(:last-child)::after {
  content: "·";
  margin-left: 14px;
  color: var(--rule);
}

.topic__examples {
  margin-top: 18px;
  display: none;
  flex-direction: column;
  gap: 10px;
}
.topic.is-open .topic__examples { display: flex; }
.topic.is-open { padding-bottom: 32px; }

.example {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 14px;
  padding: 10px;
  background: var(--bg-raised);
  border: 1px solid var(--rule);
  transition: border-color 0.2s ease;
}
.example:hover { border-color: var(--accent); }
.example__thumb {
  width: 96px; height: 54px;
  background: var(--bg-inset);
  background-size: cover;
  background-position: center;
}
.example__body { min-width: 0; }
.example__title {
  font-size: 13px;
  line-height: 1.35;
  color: var(--fg);
  margin-bottom: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.example__meta {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--fg-mute);
  letter-spacing: 0.04em;
}

.topic__score {
  text-align: right;
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.04em;
  color: var(--fg-mute);
  padding-top: 8px;
  white-space: nowrap;
}
.topic__score strong {
  display: block;
  font-family: var(--f-display);
  font-size: 28px;
  font-weight: 400;
  color: var(--accent);
  font-variation-settings: "opsz" 36;
  letter-spacing: -0.02em;
}
.topic__score-label {
  display: block;
  margin-top: 2px;
  text-transform: uppercase;
}

/* ---------------------------------------------------------------
   Breakout videos
   --------------------------------------------------------------- */

.videos {
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.video {
  display: grid;
  grid-template-columns: 120px 1fr;
  gap: 14px;
  border-bottom: 1px solid var(--rule);
  padding-bottom: 20px;
  cursor: pointer;
  transition: opacity 0.2s ease;
}
.video:hover { opacity: 0.75; }
.video:last-child { border-bottom: 0; }

.video__thumb {
  width: 120px; height: 68px;
  background: var(--bg-inset);
  background-size: cover;
  background-position: center;
  flex-shrink: 0;
  position: relative;
  overflow: hidden;
}
.video__thumb::after {
  content: "";
  position: absolute; inset: 0;
  border: 1px solid var(--rule);
  pointer-events: none;
}
.video__rank {
  position: absolute;
  top: 4px; left: 4px;
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--fg);
  background: rgba(0,0,0,0.7);
  padding: 2px 5px;
  letter-spacing: 0.05em;
  z-index: 1;
}

.video__body { min-width: 0; }
.video__title {
  font-size: 14px;
  line-height: 1.35;
  color: var(--fg);
  margin-bottom: 6px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.video__channel {
  font-size: 12px;
  color: var(--fg-soft);
  margin-bottom: 6px;
}
.video__meta {
  font-family: var(--f-mono);
  font-size: 10px;
  color: var(--fg-mute);
  letter-spacing: 0.04em;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}
.video__meta .vph {
  color: var(--accent);
}

/* ---------------------------------------------------------------
   How to read
   --------------------------------------------------------------- */

.how {
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  background: var(--bg-raised);
  margin-top: 32px;
  position: relative;
  z-index: 2;
}
.how__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 64px 32px;
}
.how__title {
  font-family: var(--f-display);
  font-weight: 400;
  font-size: 32px;
  letter-spacing: -0.01em;
  margin-bottom: 40px;
}
.how__grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 40px;
}
@media (max-width: 800px) { .how__grid { grid-template-columns: 1fr; gap: 32px; } }

.how__item h4 {
  font-family: var(--f-display);
  font-weight: 500;
  font-size: 20px;
  margin-bottom: 8px;
}
.how__item p {
  font-size: 14px;
  color: var(--fg-soft);
  line-height: 1.55;
  max-width: 38ch;
}
.how__num {
  font-family: var(--f-mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  color: var(--accent);
  display: block;
  margin-bottom: 16px;
}

/* ---------------------------------------------------------------
   Footer
   --------------------------------------------------------------- */

.footer {
  position: relative; z-index: 2;
}
.footer__inner {
  max-width: var(--max);
  margin: 0 auto;
  padding: 48px 32px 64px;
  display: flex;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
}
.footer__line {
  font-size: 12px;
  color: var(--fg-mute);
  max-width: 50ch;
}
.footer__line--mono {
  font-family: var(--f-mono);
  letter-spacing: 0.05em;
}
.footer__line a {
  color: var(--fg-soft);
  border-bottom: 1px solid var(--rule);
  padding-bottom: 1px;
  transition: color 0.2s ease, border-color 0.2s ease;
}
.footer__line a:hover {
  color: var(--accent);
  border-color: var(--accent);
}

/* ---------------------------------------------------------------
   AdSense slots
   --------------------------------------------------------------- */

.ad-slot {
  position: relative;
  z-index: 2;
  border-top: 1px solid var(--rule);
  border-bottom: 1px solid var(--rule);
  padding: 24px 32px;
  background: var(--bg-raised);
  min-height: 120px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
}
.ad-slot--banner {
  max-width: var(--max);
  margin: 0 auto;
}
.ad-slot--inline {
  margin-top: 32px;
  padding: 20px;
  background: transparent;
  border-color: var(--rule);
  min-height: 240px;
}
.ad-slot__label {
  display: block;
  font-family: var(--f-mono);
  font-size: 10px;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-mute);
  margin-bottom: 12px;
  align-self: flex-start;
}
.ad-slot ins.adsbygoogle {
  width: 100%;
  min-height: 90px;
}
@media (max-width: 600px) {
  .ad-slot { padding: 20px; }
}

/* ---------------------------------------------------------------
   States
   --------------------------------------------------------------- */

.placeholder {
  font-family: var(--f-mono);
  font-size: 12px;
  color: var(--fg-mute);
  padding: 32px 0;
  letter-spacing: 0.05em;
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(8px); }
  to   { opacity: 1; transform: translateY(0); }
}
.topic, .video {
  animation: fadeUp 0.5s ease-out backwards;
}
.topic:nth-child(1)  { animation-delay: 0.05s; }
.topic:nth-child(2)  { animation-delay: 0.10s; }
.topic:nth-child(3)  { animation-delay: 0.15s; }
.topic:nth-child(4)  { animation-delay: 0.20s; }
.topic:nth-child(5)  { animation-delay: 0.25s; }
.topic:nth-child(6)  { animation-delay: 0.30s; }
.topic:nth-child(7)  { animation-delay: 0.35s; }
.topic:nth-child(8+) { animation-delay: 0.40s; }

/* Tighter mobile padding */
@media (max-width: 600px) {
  .masthead__inner { padding: 14px 20px; }
  .hero { padding: 56px 20px 40px; }
  .layout { padding: 48px 20px; }
  .how__inner { padding: 48px 20px; }
  .footer__inner { padding: 32px 20px 48px; }
  .topic { grid-template-columns: 28px 1fr; }
  .topic__score { grid-column: 2; text-align: left; padding-top: 12px; }
}
