/* ===== RESOURCE HUB =====
   Shared styles for /resources and /resources/<slug>.
   Tokens and card treatment mirror the homepage so the hub reads as part of the
   same site. Edit this file directly — build-resources.js only writes HTML. */

/* ===== TOKENS (same as the homepage) ===== */
:root {
  --bg: #000000;
  --bg-2: #0a0a0a;
  --bg-3: #111111;
  --accent: #dce925;
  --text: #ffffff;
  --muted: rgba(255, 255, 255, 0.5);
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.16);
}

/* ===== BASE ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: 'Archivo', -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-weight: 400;
  font-size: 16px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
.container { max-width: 1200px; margin: 0 auto; padding: 0 32px; }
.display {
  font-family: 'Archivo Black', sans-serif;
  font-weight: 400;
  line-height: 0.95;
  letter-spacing: -0.02em;
  text-transform: uppercase;
  margin: 0;
}
.accent-text { color: var(--accent); }
.eyebrow {
  display: block;
  font-family: 'Archivo Black', sans-serif;
  font-size: 11px;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent);
}

/* ===== NAV ===== */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 100;
  padding: 18px 0;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: saturate(180%) blur(14px);
  -webkit-backdrop-filter: saturate(180%) blur(14px);
  border-bottom: 1px solid var(--line);
}
.nav-inner { display: flex; align-items: center; justify-content: space-between; gap: 24px; }
.logo {
  font-family: 'Archivo Black', sans-serif;
  font-size: 16px;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  /* Plain inline text, not flex. A flex `gap` here would sit between the two
     words and read as a double space. */
  white-space: nowrap;
}
.logo .yellow { color: var(--accent); }
.nav-links { display: flex; align-items: center; gap: 28px; font-weight: 500; font-size: 14px; }
.nav-links a:not(.nav-cta) { color: var(--muted); transition: color 0.15s; }
.nav-links a:not(.nav-cta):hover { color: var(--text); }
.nav-cta {
  display: inline-block;
  background: var(--accent);
  color: #000;
  font-weight: 500;
  font-size: 14px;
  padding: 9px 18px;
  border-radius: 999px;
  white-space: nowrap;
  flex-shrink: 0;
  transition: transform 0.15s, box-shadow 0.15s;
}
.nav-cta:hover { color: #000; transform: translateY(-1px); box-shadow: 0 10px 25px -10px var(--accent); }

/* ===== MOBILE MENU BUTTON =====
   Hidden on desktop; the media query below turns it on and converts
   .nav-links into a dropdown panel. Behaviour lives in /assets/nav.js. */
.nav-toggle {
  display: none;
  flex-direction: column;
  justify-content: center;
  gap: 5px;
  width: 42px;
  height: 42px;
  padding: 0 10px;
  background: transparent;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  cursor: pointer;
  flex-shrink: 0;
  transition: border-color 0.15s ease;
}
.nav-toggle:hover { border-color: var(--accent); }
.nav-toggle-bar {
  display: block;
  width: 100%;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.2s ease, opacity 0.15s ease;
}
.nav[data-menu="open"] .nav-toggle-bar:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.nav[data-menu="open"] .nav-toggle-bar:nth-child(2) { opacity: 0; }
.nav[data-menu="open"] .nav-toggle-bar:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
@media (prefers-reduced-motion: reduce) {
  .nav-toggle-bar, .nav-cta { transition: none; }
}

@media (max-width: 900px) {
  .nav-toggle { display: inline-flex; }
  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 6px 22px 18px;
    /* Fully opaque: content sits directly behind this panel. */
    background: var(--bg);
    border-bottom: 1px solid var(--line);
  }
  .nav[data-menu="open"] .nav-links { display: flex; }
  .nav-links a:not(.nav-cta) {
    padding: 15px 2px;
    font-size: 15px;
    border-bottom: 1px solid var(--line);
  }
  .nav-cta { margin-top: 14px; text-align: center; padding: 12px 18px; }
}

/* ===== PAGE HEAD ===== */
.res-head {
  padding: 150px 0 60px;
  border-bottom: 1px solid var(--line);
}
/* Nested inside .container (not merged onto it) so it stays left-aligned with
   the card grid instead of inheriting the container's `margin: 0 auto`. */
.res-head-inner { max-width: 780px; }
.res-h {
  font-size: clamp(44px, 6.5vw, 84px);
  margin: 18px 0 20px;
}
.res-sub {
  color: var(--muted);
  font-size: 18px;
  max-width: 620px;
  margin: 0;
}

/* ===== INDEX GRID ===== */
.res-grid-wrap { padding: 60px 0 120px; }
.res-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.resource-card {
  position: relative;
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-top: 2px solid transparent;
  border-radius: 16px;
  padding: 28px 26px;
  display: flex;
  flex-direction: column;
  /* min-width:0 stops a long word in a title from widening the whole grid. */
  min-width: 0;
  transition: transform 0.2s ease, border-top-color 0.2s ease, background 0.2s ease;
}
.resource-card:hover {
  transform: translateY(-3px);
  border-top-color: var(--accent);
  background: #161616;
}
.resource-tag {
  display: inline-block;
  align-self: flex-start;
  background: rgba(220, 233, 37, 0.12);
  border: 1px solid rgba(220, 233, 37, 0.3);
  color: var(--accent);
  font-family: 'Archivo Black', sans-serif;
  font-size: 10px;
  letter-spacing: 0.18em;
  padding: 5px 10px;
  border-radius: 999px;
  margin-bottom: 16px;
  text-transform: uppercase;
}
.resource-name {
  font-family: 'Archivo Black', sans-serif;
  font-size: 22px;
  margin: 0 0 12px;
  letter-spacing: -0.01em;
  /* Long titles wrap instead of overflowing the card. */
  overflow-wrap: anywhere;
}
.resource-desc {
  color: var(--muted);
  font-size: 15px;
  margin: 0 0 20px;
  flex: 1;
}
.resource-arrow {
  font-family: 'Archivo Black', sans-serif;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--accent);
  text-transform: uppercase;
}

/* ===== DETAIL PAGE ===== */
.res-back {
  display: inline-block;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 28px;
  transition: color 0.15s ease;
}
.res-back:hover { color: var(--accent); }
/* Stacked, not inline: the pill and the date sit on different visual weights,
   so side by side they read as competing for the same line. */
.res-meta {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 18px;
}
.res-updated { color: var(--muted); font-size: 13px; }

.res-body {
  padding: 60px 0 120px;
  max-width: 720px;
}
.res-body h2 {
  font-family: 'Archivo Black', sans-serif;
  font-size: 28px;
  letter-spacing: -0.01em;
  margin: 48px 0 16px;
}
.res-body h3 {
  font-family: 'Archivo Black', sans-serif;
  font-size: 19px;
  margin: 36px 0 12px;
}
.res-body h2:first-child, .res-body h3:first-child { margin-top: 0; }
.res-body p { color: rgba(255, 255, 255, 0.78); margin: 0 0 18px; }
.res-body ul, .res-body ol { color: rgba(255, 255, 255, 0.78); margin: 0 0 18px; padding-left: 22px; }
.res-body li { margin-bottom: 8px; }
.res-body strong { color: var(--text); font-weight: 500; }
.res-body a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; }
.res-body code {
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-radius: 5px;
  padding: 2px 6px;
  font-size: 14px;
}
.res-body pre {
  background: var(--bg-3);
  border: 1px solid var(--line-strong);
  border-radius: 12px;
  padding: 20px;
  overflow-x: auto;
  margin: 0 0 18px;
}
.res-body pre code { background: none; border: 0; padding: 0; }
.res-body blockquote {
  border-left: 2px solid var(--accent);
  margin: 0 0 18px;
  padding: 4px 0 4px 20px;
  color: var(--muted);
  font-style: italic;
}
.res-body hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }

/* ===== FOOTER CTA ===== */
.res-cta {
  border-top: 1px solid var(--line);
  padding: 70px 0 90px;
  text-align: center;
}
.res-cta h2 { font-family: 'Archivo Black', sans-serif; font-size: clamp(28px, 4vw, 40px); margin: 0 0 12px; text-transform: uppercase; }
.res-cta p { color: var(--muted); margin: 0 0 26px; }
.btn-primary {
  display: inline-block;
  background: var(--accent);
  color: #000;
  font-weight: 500;
  padding: 14px 28px;
  border-radius: 999px;
}

/* ===== RESPONSIVE ===== */
@media (max-width: 900px) {
  .res-grid { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 640px) {
  .container { padding: 0 20px; }
  .res-head { padding: 120px 0 44px; }
  .res-grid { grid-template-columns: 1fr; }
  .res-grid-wrap { padding: 40px 0 80px; }
  .res-body { padding: 40px 0 80px; }
  .res-body h2 { font-size: 24px; }
  .res-sub { font-size: 16px; }
}
