/* Code Cockpit HUD theme (see brand-kit.md) */

/* Dark is the brand default. The hero always uses the dark tokens: it sits
   on a dark photo and acts as the "cockpit window" in both themes. */
:root, .hero-banner {
  --bg: #0B0F14;
  --bg-raise: #111823;
  --line: #1E2937;
  --green: #00E68C;       /* text, strokes, brackets */
  --amber: #FFB020;
  --red: #FF4D4D;
  --text: #E8EDF2;
  --text-dim: #8A97A6;
  --green-fill: #00E68C;  /* button fills */
  --on-green: #0B0F14;    /* text on button fills */
  --header-bg: rgba(11, 15, 20, 0.92);
  --card-shadow: none;
  color-scheme: dark;
}
:root {
  --sans: "Inter Tight", system-ui, sans-serif;
  --mono: "JetBrains Mono", ui-monospace, monospace;
}

/* Light theme: the same brand hues, deepened so text and brackets stay
   readable on white (all text colours are at least 4.5:1). Applied by the
   theme script in base.html; the media query covers visitors without JS. */
:root[data-theme="light"] {
  --bg: #F5F7FA;
  --bg-raise: #FFFFFF;
  --line: #D9E0E8;
  --green: #00804F;
  --amber: #A35C00;
  --red: #C62828;
  --text: #0B0F14;
  --text-dim: #4E5B69;
  --header-bg: rgba(245, 247, 250, 0.92);
  --card-shadow: 0 1px 2px rgba(11, 15, 20, 0.06);
  color-scheme: light;
}
@media (prefers-color-scheme: light) {
  :root:not([data-theme]) {
    --bg: #F5F7FA;
    --bg-raise: #FFFFFF;
    --line: #D9E0E8;
    --green: #00804F;
    --amber: #A35C00;
    --red: #C62828;
    --text: #0B0F14;
    --text-dim: #4E5B69;
    --header-bg: rgba(245, 247, 250, 0.92);
    --card-shadow: 0 1px 2px rgba(11, 15, 20, 0.06);
    color-scheme: light;
  }
}

* { box-sizing: border-box; }

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.6;
}

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

.container { max-width: 1040px; margin: 0 auto; padding: 0 24px; }

/* ---------- header ---------- */
.site-header {
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--header-bg);
  backdrop-filter: blur(8px);
  z-index: 10;
}

.nav {
  display: flex;
  align-items: center;
  gap: 16px;
  height: 64px;
}

.brand {
  margin-right: auto;
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--mono);
  font-weight: 600;
  font-size: 18px;
  letter-spacing: 0.08em;
  color: var(--text);
}
.brand:hover { text-decoration: none; }
.brand-logo {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1.5px solid var(--green);
  object-fit: cover;
  display: block;
}
.brand-accent { color: var(--green); }

.nav-links { display: flex; gap: 28px; align-items: center; }
.nav-links a { color: var(--text-dim); font-weight: 600; font-size: 15px; }
.nav-links a:hover { color: var(--text); text-decoration: none; }

.nav-cta {
  color: var(--on-green) !important;
  background: var(--green-fill);
  padding: 8px 16px;
  border-radius: 6px;
}
.nav-cta:hover { filter: brightness(1.1); }

.nav-toggle { display: none; }

.theme-toggle {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  background: none;
  border: 1px solid var(--line);
  border-radius: 8px;
  color: var(--text-dim);
  cursor: pointer;
}
.theme-toggle:hover { color: var(--text); border-color: var(--green); }
/* Show the mode you'd switch to: moon in light, sun in dark. */
.theme-toggle .icon-moon { display: none; }
:root[data-theme="light"] .theme-toggle .icon-sun { display: none; }
:root[data-theme="light"] .theme-toggle .icon-moon { display: block; }

/* ---------- hero ---------- */
.hero-banner {
  color: var(--text);
  border-bottom: 1px solid var(--line);
  background:
    linear-gradient(90deg, var(--bg) 30%, rgba(11, 15, 20, 0.72) 55%, rgba(11, 15, 20, 0.05) 100%),
    url("../img/banner-bg.c7e6ceaf7553.png") right center / cover no-repeat;
}

.hero { padding-top: 110px; padding-bottom: 90px; }

.hero-pill {
  display: inline-block;
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--amber);
  border: 1px solid var(--amber);
  border-radius: 999px;
  padding: 4px 14px;
  margin-bottom: 24px;
}

.hero h1 {
  font-size: clamp(40px, 7vw, 68px);
  font-weight: 800;
  line-height: 1.05;
  margin: 0 0 16px;
  letter-spacing: -0.02em;
}

.hero h1 .accent { color: var(--green); }

.hero .tagline {
  font-family: var(--mono);
  color: var(--green);
  font-size: 18px;
  margin: 0 0 16px;
}

/* The typed tagline wraps on phones; reserve two lines so nothing below jumps. */
@media (max-width: 600px) {
  .hero .tagline { min-height: 3.2em; }
}

.hero .sub {
  color: var(--text-dim);
  max-width: 560px;
  margin: 0 0 32px;
}

.btn-row { display: flex; gap: 14px; flex-wrap: wrap; }

.btn {
  display: inline-block;
  font-weight: 700;
  padding: 12px 24px;
  border-radius: 8px;
  border: 1px solid var(--line);
  color: var(--text);
}
.btn:hover { text-decoration: none; border-color: var(--green); }
.btn-primary { background: var(--green-fill); color: var(--on-green); border-color: var(--green-fill); }
.btn-primary:hover { filter: brightness(1.1); }

/* ---------- sections ---------- */
.section { padding: 56px 0; }
.section + .section { border-top: 1px solid var(--line); }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 28px;
}

.section-head h2 {
  font-family: var(--mono);
  font-size: 15px;
  letter-spacing: 0.18em;
  color: var(--text-dim);
  margin: 0;
  text-transform: uppercase;
}
.section-head h2::before { content: "# "; color: var(--green); }

.section-head a { font-size: 14px; font-family: var(--mono); }

/* ---------- cards ---------- */
.grid { display: grid; gap: 20px; }
.grid-2 { grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); }
.grid-4 { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }

.card {
  position: relative;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 24px;
  box-shadow: var(--card-shadow);
}

/* HUD target-lock corner brackets */
.card::before, .card::after {
  content: "";
  position: absolute;
  width: 14px;
  height: 14px;
  pointer-events: none;
}
.card::before {
  top: -1px; left: -1px;
  border-top: 2px solid var(--green);
  border-left: 2px solid var(--green);
  border-top-left-radius: 10px;
}
.card::after {
  bottom: -1px; right: -1px;
  border-bottom: 2px solid var(--green);
  border-right: 2px solid var(--green);
  border-bottom-right-radius: 10px;
}
.card.accent-amber::before, .card.accent-amber::after { border-color: var(--amber); }
.card.accent-red::before, .card.accent-red::after { border-color: var(--red); }

.card h3 { margin: 0 0 8px; font-size: 20px; }
.card h3 a { color: var(--text); }
.kicker {
  font-family: var(--mono);
  font-size: 12px;
  letter-spacing: 0.12em;
  color: var(--green);
  text-transform: uppercase;
  margin: 0 0 10px;
}
.accent-amber .kicker { color: var(--amber); }
.accent-red .kicker { color: var(--red); }
.card p { color: var(--text-dim); font-size: 15px; margin: 0; }

.series-icon { color: var(--green); margin-bottom: 12px; }
.series-icon svg { display: block; }
.accent-amber .series-icon { color: var(--amber); }
.accent-red .series-icon { color: var(--red); }
.series-head .series-icon svg { width: 40px; height: 40px; }

.status-tag {
  font-family: var(--mono);
  font-size: 11px;
  letter-spacing: 0.1em;
  padding: 2px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: var(--text-dim);
  text-transform: uppercase;
}
.status-tag.active { color: var(--green); border-color: var(--green); }
.status-tag.upcoming { color: var(--amber); border-color: var(--amber); }

/* ---------- video cards ---------- */
.video-card { padding: 0; overflow: hidden; }

.video-frame {
  aspect-ratio: 16 / 9;
  width: 100%;
  border: 0;
  display: block;
  background: #000;
}

.video-meta { padding: 18px 22px 22px; }
.video-meta .ep {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--green);
  letter-spacing: 0.1em;
}
.video-meta h3 { font-size: 17px; margin: 6px 0; }
.video-meta time { font-family: var(--mono); font-size: 12px; color: var(--text-dim); }

/* ---------- links page ---------- */
.links-page { max-width: 640px; margin: 0 auto; padding: 64px 24px; text-align: center; }
.links-page .avatar-img {
  width: 96px; height: 96px;
  margin: 0 auto 16px;
  border-radius: 50%;
  border: 2px solid var(--green);
  display: block;
  object-fit: cover;
}
.links-page h1 { font-family: var(--mono); letter-spacing: 0.06em; font-size: 26px; margin: 0 0 6px; }
.links-page .bio { color: var(--text-dim); margin: 0 0 36px; }

.link-row {
  display: block;
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 22px;
  margin-bottom: 14px;
  color: var(--text);
  font-weight: 700;
  transition: border-color 0.15s;
  text-align: left;
}
.link-row:hover { border-color: var(--green); text-decoration: none; }
.link-row .icon { margin-right: 12px; }
.link-row small { display: block; color: var(--text-dim); font-weight: 400; margin-top: 2px; }

/* ---------- blog ---------- */
.page-head { padding: 64px 0 8px; }
.page-head h1 { font-size: clamp(32px, 5vw, 44px); margin: 0 0 8px; letter-spacing: -0.01em; }
.page-head .lede { color: var(--text-dim); max-width: 620px; margin: 0; }

.post-list { list-style: none; padding: 0; margin: 0; }
.post-list li { border-bottom: 1px solid var(--line); padding: 26px 0; }
.post-list h3 { margin: 0 0 6px; font-size: 22px; }
.post-list h3 a { color: var(--text); }
.post-list h3 a:hover { color: var(--green); text-decoration: none; }
.post-list .meta { font-family: var(--mono); font-size: 13px; color: var(--text-dim); }
.post-list p { color: var(--text-dim); margin: 8px 0 0; }

.tag {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--green);
  border: 1px solid var(--line);
  border-radius: 4px;
  padding: 1px 8px;
  margin-left: 8px;
}

.post-body { max-width: 720px; padding-bottom: 72px; }
.post-body h2, .post-body h3 { margin-top: 40px; letter-spacing: -0.01em; }
.post-body { overflow-wrap: anywhere; }
.post-body img { max-width: 100%; height: auto; }
.post-body pre {
  background: var(--bg-raise);
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 18px;
  overflow-x: auto;
  font-family: var(--mono);
  font-size: 14px;
}
.post-body code { font-family: var(--mono); font-size: 0.92em; color: var(--green); }
.post-body pre code { color: var(--text); }
.post-body blockquote {
  border-left: 3px solid var(--green);
  margin: 0;
  padding-left: 18px;
  color: var(--text-dim);
}
.post-body table { border-collapse: collapse; width: 100%; display: block; overflow-x: auto; }
.post-body th, .post-body td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }

/* ---------- empty state ---------- */
.empty {
  font-family: var(--mono);
  color: var(--text-dim);
  border: 1px dashed var(--line);
  border-radius: 10px;
  padding: 36px;
  text-align: center;
}
.empty::before { content: "⚠ "; color: var(--amber); }

/* ---------- error pages ---------- */
.error-page { text-align: center; padding: 96px 24px 120px; }
.error-icon { display: flex; justify-content: center; }
.error-icon .series-icon svg { width: 48px; height: 48px; }
.error-kicker { margin-top: 20px; }
.error-code {
  font-family: var(--mono);
  font-size: clamp(72px, 14vw, 120px);
  margin: 0;
  line-height: 1.1;
  letter-spacing: -0.02em;
}
.error-title { font-size: 22px; font-weight: 700; margin: 8px 0; }
.error-sub { color: var(--text-dim); max-width: 480px; margin: 0 auto 32px; }
.error-btns { justify-content: center; }

/* ---------- footer ---------- */
.site-footer {
  border-top: 1px solid var(--line);
  margin-top: 48px;
  padding: 40px 0;
}
.footer-sign { font-family: var(--mono); color: var(--green); font-size: 16px; margin: 0 0 6px; }
.footer-meta { color: var(--text-dim); font-size: 13px; margin: 0; }

.cursor { animation: blink 1.2s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }

@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .hero { padding-top: 56px; padding-bottom: 48px; }
  .hero h1 { font-size: 40px; }
  .hero .btn-row .btn { flex: 1 1 0; text-align: center; padding: 12px 14px; white-space: nowrap; }

  /* Text sits over the photo on phones, so darken it more evenly. */
  .hero-banner {
    background:
      linear-gradient(180deg, rgba(11, 15, 20, 0.80), rgba(11, 15, 20, 0.92)),
      url("../img/banner-bg.c7e6ceaf7553.png") 70% center / cover no-repeat;
  }

  /* Nav collapses behind a menu button. */
  .nav-toggle {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 44px;
    height: 44px;
    background: none;
    border: 1px solid var(--line);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
  }
  .theme-toggle { width: 44px; height: 44px; }
  .nav { gap: 10px; }
  .nav-toggle .icon-close { display: none; }
  .nav-toggle[aria-expanded="true"] .icon-open { display: none; }
  .nav-toggle[aria-expanded="true"] .icon-close { display: block; }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 4px 20px 20px;
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .nav-links.open { display: flex; }
  .nav-links a { font-size: 17px; padding: 14px 0; border-bottom: 1px solid var(--line); }
  .nav-links .nav-cta { margin-top: 16px; padding: 12px; text-align: center; border-bottom: 0; }

  .section { padding: 44px 0; }
  .section-head { flex-wrap: wrap; gap: 8px 16px; }
  .page-head { padding-top: 44px; }
  .empty { padding: 28px 20px; }
  .links-page { padding: 44px 20px; }
  .error-page { padding: 64px 20px 80px; }
}
