/* threatlevelhuman.com — TUI / terminal aesthetic
   Brand palette:
     navy   #0A0E1A  (background)
     cyan   #4FC3F7  (accent / links / prompt)
     amber  #FFB74D  (alerts / threat meter)
     white  #F8F9FA  (body text)
     gray   #9E9E9E  (muted / secondary)
*/

:root {
  --navy: #0A0E1A;
  --navy-2: #0F1626;
  --navy-3: #141d31;
  --cyan: #4FC3F7;
  --amber: #FFB74D;
  --white: #F8F9FA;
  --gray: #9E9E9E;
  --line: #1e2a44;
  --mono: "JetBrains Mono", "SFMono-Regular", ui-monospace, "Cascadia Code",
    Menlo, Consolas, monospace;
  --sans: "Inter", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --cond: "Oswald", "Roboto Condensed", "Arial Narrow", var(--sans);
  --maxw: 1080px;
}

* { box-sizing: border-box; }

html { scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--navy);
  color: var(--white);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  /* faint scanline texture for the terminal feel */
  background-image: repeating-linear-gradient(
    to bottom,
    rgba(79, 195, 247, 0.012) 0px,
    rgba(79, 195, 247, 0.012) 1px,
    transparent 1px,
    transparent 3px
  );
}

a { color: var(--cyan); text-decoration: none; }
a:hover { text-decoration: underline; }

.wrap { max-width: var(--maxw); margin: 0 auto; padding: 0 24px; }

/* ---------- headings ---------- */
h1, h2, h3 {
  font-family: var(--cond);
  font-weight: 700;
  letter-spacing: 0.5px;
  line-height: 1.15;
  margin: 0 0 0.5em;
}
h1 { font-size: clamp(2rem, 6vw, 3.4rem); text-transform: uppercase; }
h2 { font-size: clamp(1.4rem, 3.4vw, 2rem); }
h3 { font-size: 1.2rem; }

.mono { font-family: var(--mono); }
.muted { color: var(--gray); }
.amber { color: var(--amber); }
.cyan { color: var(--cyan); }

/* ---------- top bar ---------- */
.topbar {
  border-bottom: 1px solid var(--line);
  background: rgba(10, 14, 26, 0.85);
  backdrop-filter: blur(6px);
  position: sticky;
  top: 0;
  z-index: 50;
}
.topbar .wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 56px;
}
.brandmark {
  font-family: var(--mono);
  font-size: 0.95rem;
  letter-spacing: 1px;
  color: var(--white);
}
.brandmark b { color: var(--cyan); }
.nav a { color: var(--gray); font-family: var(--mono); font-size: 0.85rem; margin-left: 22px; }
.nav a:hover { color: var(--cyan); text-decoration: none; }

/* ---------- prompt motif ---------- */
.prompt::before {
  content: "user@threatlevel:~$ ";
  color: var(--cyan);
  font-family: var(--mono);
}
.cursor {
  display: inline-block;
  width: 9px;
  height: 1.05em;
  background: var(--cyan);
  vertical-align: -2px;
  margin-left: 3px;
  animation: blink 1.1s steps(1) infinite;
}
@keyframes blink { 50% { opacity: 0; } }

/* ---------- hero ---------- */
.hero {
  padding: 72px 0 56px;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(1100px 380px at 50% -120px, rgba(79, 195, 247, 0.10), transparent 70%);
}
.hero .kicker {
  font-family: var(--mono);
  color: var(--gray);
  font-size: 0.9rem;
  margin-bottom: 14px;
}
.hero h1 { margin-bottom: 0.15em; }
.hero h1 .lvl { color: var(--cyan); }
.tagline {
  font-family: var(--mono);
  color: var(--amber);
  font-size: clamp(1rem, 2.4vw, 1.35rem);
  margin: 12px 0 26px;
}
.hero .lede { max-width: 660px; color: var(--white); }
.cta-row { margin-top: 28px; display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.9rem;
  padding: 11px 20px;
  border: 1px solid var(--cyan);
  color: var(--cyan);
  border-radius: 4px;
  transition: background 0.15s, color 0.15s;
}
.btn:hover { background: var(--cyan); color: var(--navy); text-decoration: none; }
.btn.solid { background: var(--cyan); color: var(--navy); }
.btn.solid:hover { background: #74d0fa; }
.btn.ghost { border-color: var(--line); color: var(--gray); }
.btn.ghost:hover { border-color: var(--cyan); color: var(--cyan); background: transparent; }

/* ---------- threat meter ---------- */
.meter {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--gray);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 6px 12px;
  margin-top: 26px;
}
.meter .bars { display: inline-flex; gap: 3px; }
.meter .bar { width: 8px; height: 14px; background: var(--line); border-radius: 1px; }
.meter .bar.on { background: var(--amber); }
.meter .lab { color: var(--amber); letter-spacing: 1px; }

/* ---------- section frame ---------- */
section { padding: 56px 0; border-bottom: 1px solid var(--line); }
.sec-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
  gap: 16px;
}
.sec-head h2 { margin: 0; }
.sec-head .tag {
  font-family: var(--mono);
  font-size: 0.8rem;
  color: var(--cyan);
}

/* ---------- feature briefing ---------- */
.feature {
  display: grid;
  grid-template-columns: 1.3fr 1fr;
  gap: 32px;
  background: var(--navy-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
}
.feature .body { padding: 30px; }
/* Pin the thumb to a true 16:9 box (align-self:start stops it stretching to the tall text column),
   so the whole video thumbnail shows instead of being cropped to fill an over-tall cell. */
.feature .thumb {
  background: var(--navy-3) center/cover no-repeat;
  aspect-ratio: 16 / 9;
  align-self: start;
  border-left: 1px solid var(--line);
  position: relative;
  display: block;
}
.feature .thumb img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
/* the real video thumbnail shows; a subtle play affordance sits on top */
.feature .thumb::after {
  content: "\25B6";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 2.6rem;
  color: #fff;
  background: rgba(10, 14, 26, 0.28);
  text-shadow: 0 2px 10px rgba(0, 0, 0, 0.6);
}
.feature .thumb:hover::after { background: rgba(10, 14, 26, 0.12); }
.badge {
  display: inline-block;
  font-family: var(--mono);
  font-size: 0.7rem;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  color: var(--navy);
  background: var(--cyan);
  padding: 3px 9px;
  border-radius: 3px;
  margin-bottom: 14px;
}
.feature h3 { font-size: 1.6rem; }

/* ---------- episode grid ---------- */
.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 18px;
}
.card {
  display: flex;
  flex-direction: column;
  background: var(--navy-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 20px;
  transition: border-color 0.15s, transform 0.15s;
}
.card:hover { border-color: var(--cyan); transform: translateY(-2px); }
.card .ep-id { font-family: var(--mono); font-size: 0.78rem; color: var(--cyan); }
.card .date { font-family: var(--mono); font-size: 0.72rem; color: var(--gray); float: right; }
.card h3 {
  font-size: 1.15rem;
  margin: 10px 0 8px;
  text-transform: none;
  letter-spacing: 0.3px;
}
.card h3 a { color: var(--white); }
.card h3 a:hover { color: var(--cyan); text-decoration: none; }
.card p { color: var(--gray); font-size: 0.92rem; margin: 0 0 16px; flex: 1; }
.card .more { font-family: var(--mono); font-size: 0.8rem; color: var(--cyan); }

/* ---------- newsletter ---------- */
.signup {
  background: var(--navy-2);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 36px;
  text-align: center;
}
.signup form { display: flex; gap: 10px; max-width: 480px; margin: 22px auto 0; flex-wrap: wrap; }
.signup input[type="email"] {
  flex: 1;
  min-width: 220px;
  background: var(--navy);
  border: 1px solid var(--line);
  color: var(--white);
  font-family: var(--mono);
  padding: 12px 14px;
  border-radius: 4px;
}
.signup input::placeholder { color: var(--gray); }
.signup input:focus { outline: none; border-color: var(--cyan); }

/* ---------- upcoming ---------- */
.upcoming li {
  font-family: var(--mono);
  font-size: 0.95rem;
  color: var(--gray);
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
  list-style: none;
}
.upcoming ul { padding: 0; margin: 0; }
.upcoming .q { color: var(--amber); margin-right: 12px; }

/* ---------- footer ---------- */
footer {
  padding: 40px 0;
  color: var(--gray);
  font-family: var(--mono);
  font-size: 0.82rem;
}
footer a { color: var(--gray); }
footer a:hover { color: var(--cyan); }
.foot-grid { display: flex; justify-content: space-between; flex-wrap: wrap; gap: 16px; }

/* ---------- episode page (article) ---------- */
.article { padding: 48px 0; }
.article .breadcrumb { font-family: var(--mono); font-size: 0.82rem; color: var(--gray); margin-bottom: 20px; }
.article h1 { text-transform: none; letter-spacing: 0.3px; margin-bottom: 0.3em; }
.article .meta { font-family: var(--mono); font-size: 0.85rem; color: var(--gray); margin-bottom: 28px; }
.article .meta .sep { color: var(--line); margin: 0 8px; }
.video-frame {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: var(--navy-2);
  margin-bottom: 32px;
}
.video-frame iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.article .content { max-width: 760px; }
.article .content h2 { margin-top: 1.6em; }
.article .content h3 { margin-top: 1.4em; color: var(--cyan); }
.article .content p { margin: 0 0 1.1em; }
.article .content ul { margin: 0 0 1.1em; padding-left: 1.2em; color: var(--white); }
.article .content li { margin: 6px 0; }
.article .content strong { color: var(--white); font-weight: 600; }
/* blog index reuses the homepage card grid inside an .article */
.article .grid { margin-top: 8px; }
.callout {
  border-left: 3px solid var(--amber);
  background: var(--navy-2);
  padding: 16px 20px;
  border-radius: 0 6px 6px 0;
  margin: 28px 0;
  font-family: var(--mono);
  font-size: 0.92rem;
  color: var(--white);
}
.tldr {
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 22px 24px;
  margin-bottom: 32px;
  background: var(--navy-2);
}
.tldr h2 { margin-top: 0; font-size: 1rem; font-family: var(--mono); color: var(--cyan); letter-spacing: 1px; }
.tldr ul { margin: 0; padding-left: 1.2em; color: var(--white); }
.tldr li { margin: 6px 0; }
.back-link { display: inline-block; margin-top: 36px; font-family: var(--mono); font-size: 0.88rem; }

@media (max-width: 760px) {
  .feature { grid-template-columns: 1fr; }
  .feature .thumb { border-left: 0; border-top: 1px solid var(--line); }
  .nav a:not(:last-child) { display: none; }
}

/* Newsletter signup CTA on each episode page — the top-of-funnel for the list. */
.newsletter-cta {
  margin: 36px 0 8px;
  padding: 22px 24px;
  border: 1px solid var(--cyan);
  border-radius: 10px;
  background: linear-gradient(180deg, var(--navy-2), var(--navy-3));
}
.newsletter-cta h2 { color: var(--cyan); margin: 0 0 8px; }
.newsletter-cta p { margin: 0 0 16px; color: var(--white); }
.cta-button {
  display: inline-block;
  padding: 11px 20px;
  border-radius: 8px;
  background: var(--cyan);
  color: var(--navy);
  font-weight: 600;
  font-family: var(--mono);
}
.cta-button:hover { background: var(--amber); color: var(--navy); text-decoration: none; }
.newsletter-cta .cta-link {
  display: inline-block;
  margin-left: 16px;
  font-family: var(--mono);
  font-size: 0.85rem;
  color: var(--cyan);
}
.newsletter-cta .cta-link:hover { color: var(--amber); }

/* ---------- signup alignment + terminal flourishes ---------- */
/* center the single button under the centered text in .signup blocks (e.g. "Get new guides") */
.signup .cta-row { justify-content: center; }

/* braille spinner: a live "working" affordance for the terminal feel */
.spin {
  display: inline-block;
  width: 1ch;
  color: var(--cyan);
  font-family: var(--mono);
}
.spin::before { content: "\280B"; animation: braille 0.9s steps(1) infinite; }
@keyframes braille {
  0%   { content: "\280B"; } 11% { content: "\2819"; } 22% { content: "\2839"; }
  33%  { content: "\2838"; } 44% { content: "\283C"; } 55% { content: "\2834"; }
  66%  { content: "\2826"; } 77% { content: "\2827"; } 88% { content: "\2807"; }
  100% { content: "\280F"; }
}

/* hero system status line */
.sysline { font-family: var(--mono); color: var(--gray); font-size: 0.85rem; margin-top: 24px; }
.sysline .amber { color: var(--amber); }
.sysline .dot { color: var(--gray); margin: 0 8px; }

/* subtle CRT scanlines over the hero (modern-meets-terminal, very low contrast) */
.hero { position: relative; overflow: hidden; }
.hero .wrap { position: relative; z-index: 1; }
.hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: repeating-linear-gradient(180deg,
    rgba(79, 195, 247, 0.035) 0, rgba(79, 195, 247, 0.035) 1px,
    transparent 1px, transparent 3px);
}
@media (prefers-reduced-motion: reduce) {
  .spin::before, .cursor { animation: none; }
}

/* watch-the-episode CTA on blog posts */
.watch-cta { margin: 4px 0 20px; }

/* ---------- shimmering links (the web echo of the TUI ShimmerText) ---------- */
/* a brand gradient (cyan -> teal -> periwinkle -> violet) swept across the glyphs, matching the
   spinner/shimmer palette in the terminal UI. Applied to the chrome + CTA links, not inline prose
   links (those stay solid cyan for readability). */
@keyframes link-shimmer { to { background-position: 200% center; } }
.brandmark,
.nav a,
.foot-grid a,
.more,
.back-link,
.cta-link {
  background-image: linear-gradient(90deg, #4FC3F7, #5BE0C9, #7AA2FF, #B388FF, #4FC3F7);
  background-size: 200% auto;
  background-clip: text;
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  color: transparent;
  animation: link-shimmer 7s linear infinite;
}
.nav a:hover,
.foot-grid a:hover,
.more:hover,
.back-link:hover { animation-duration: 2.2s; }   /* livelier sweep on hover */
@media (prefers-reduced-motion: reduce) {
  .brandmark, .nav a, .foot-grid a, .more, .back-link, .cta-link {
    animation: none; -webkit-text-fill-color: initial; color: var(--cyan);
  }
}
