/* ==========================================================================
   RESOURCES — free articles + free bots (strip on home, /resources, articles, gate)
   ========================================================================== */
:root { --res-h: 3.4rem; }

/* ---------- home strip: first thing under the header ---------- */
.res-strip {
  position: relative; z-index: 6; margin-top: 4.5rem;
  background: linear-gradient(90deg, rgba(252,80,0,.20), rgba(252,80,0,.07) 45%, rgba(252,80,0,.03));
  border-bottom: 1px solid rgba(252,80,0,.28);
}
.res-strip-in {
  max-width: var(--w); margin: 0 auto; padding: 0 1.5rem; min-height: var(--res-h);
  display: flex; align-items: center; gap: 1.4rem;
}
.res-strip-kicker {
  display: inline-flex; align-items: center; gap: .55rem; flex: none;
  font-family: var(--mono); font-size: .7rem; font-weight: 600; letter-spacing: .18em; text-transform: uppercase;
  color: var(--brand-soft);
}
.res-dot { width: .5rem; height: .5rem; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 0 rgba(252,80,0,.6); animation: resPulse 2.2s infinite; }
@keyframes resPulse { 0% { box-shadow: 0 0 0 0 rgba(252,80,0,.55); } 70% { box-shadow: 0 0 0 .55rem rgba(252,80,0,0); } 100% { box-shadow: 0 0 0 0 rgba(252,80,0,0); } }
@media (prefers-reduced-motion: reduce) { .res-dot { animation: none; } }
.res-strip-list { display: flex; gap: .55rem; list-style: none; min-width: 0; flex: 1; overflow-x: auto; scrollbar-width: none; padding: .45rem 0; }
.res-strip-list::-webkit-scrollbar { display: none; }
.res-strip-list a {
  display: inline-flex; align-items: center; gap: .5rem; white-space: nowrap;
  font-size: .86rem; font-weight: 600; color: var(--bone); letter-spacing: -.01em;
  padding: .42rem .8rem; border-radius: 999px; border: 1px solid var(--line-strong); background: rgba(10,10,12,.35);
  transition: border-color .18s ease, background .18s ease;
}
html[data-theme="light"] .res-strip-list a { background: rgba(255,255,255,.7); }
.res-strip-list a:hover { border-color: var(--brand); background: rgba(252,80,0,.12); }
.res-n { font-family: var(--mono); font-size: .66rem; color: var(--brand-soft); letter-spacing: .08em; }
.res-strip-cta {
  flex: none; display: inline-flex; align-items: center; gap: .4rem;
  background: var(--brand); color: #fff; font-weight: 600; font-size: .86rem; padding: .5rem 1rem; border-radius: var(--r-sm);
}
.res-strip-cta:hover { background: var(--brand-solid); }
.res-strip + .hero-wall { padding-top: .25rem; height: calc(100vh - 4.5rem - var(--res-h)); }
@media (max-width: 960px) {
  .res-strip + .hero-wall { padding-top: 1.4rem; height: auto; }
  .res-strip-list { -webkit-mask-image: linear-gradient(90deg, #000 85%, transparent); mask-image: linear-gradient(90deg, #000 85%, transparent); }
}
@media (max-width: 720px) {
  :root { --res-h: auto; }
  .res-strip-in { flex-wrap: wrap; gap: .1rem .8rem; padding: .55rem 1rem .1rem; }
  .res-strip-kicker { font-size: .64rem; }
  .res-strip-cta { margin-left: auto; padding: .38rem .8rem; font-size: .8rem; }
  .res-strip-list { order: 3; flex-basis: 100%; padding: .3rem 0 .5rem; }
  .res-strip-list a { font-size: .8rem; padding: .36rem .7rem; }
}

/* nav: Resources item gets a small "free" pip */
.nav-links a.nav-res, .nav-mobile a.nav-res { display: inline-flex; align-items: center; gap: .35rem; }
.nav-links a.nav-res::before, .nav-mobile a.nav-res::before {
  content: ""; width: .38rem; height: .38rem; border-radius: 50%; background: var(--brand); flex: none;
}
.nav-links a.nav-res.active { flex-wrap: wrap; }

/* ---------- shared page shell ---------- */
.res-page { padding: 8rem 0 5rem; }
.res-wrap { max-width: var(--w); margin: 0 auto; padding: 0 1.5rem; }
.res-hero { padding-bottom: 3rem; border-bottom: 1px solid var(--line); margin-bottom: 3.5rem; }
.res-hero .h-display { max-width: 18ch; }
.res-hero .lede { max-width: 60ch; }
.res-sec { margin-bottom: 4.5rem; }
.res-sec-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 1rem; flex-wrap: wrap; margin-bottom: 1.8rem; }
.res-sec-head h2 { font-family: var(--display); font-weight: 600; font-size: clamp(1.7rem, 3vw, 2.4rem); letter-spacing: -.03em; line-height: 1.1; }
.res-sec-head p { color: var(--bone-55); max-width: 46ch; font-size: .98rem; }

.res-grid { display: grid; grid-template-columns: repeat(3, minmax(0,1fr)); gap: 1.4rem; }
.res-grid.two { grid-template-columns: repeat(2, minmax(0,1fr)); }
@media (max-width: 1000px) { .res-grid { grid-template-columns: 1fr 1fr; } }
@media (max-width: 680px) { .res-grid, .res-grid.two { grid-template-columns: 1fr; } }

.res-card {
  display: flex; flex-direction: column; background: var(--ink-2); border: 1px solid var(--line);
  border-radius: var(--r); overflow: hidden; transition: border-color .25s ease, transform .25s ease;
}
.res-card:hover { border-color: var(--line-strong); transform: translateY(-2px); }
.res-cover { display: block; aspect-ratio: 16/9; background: var(--ink-3); overflow: hidden; }
.res-cover img { width: 100%; height: 100%; object-fit: cover; display: block; }
.res-card-body { padding: 1.5rem 1.5rem 1.6rem; display: flex; flex-direction: column; gap: .75rem; flex: 1; }
.res-card h3 { font-family: var(--display); font-weight: 600; font-size: 1.32rem; line-height: 1.2; letter-spacing: -.02em; }
.res-card h3 a:hover { color: var(--brand-soft); }
.res-card p { color: var(--bone-70); font-size: .96rem; line-height: 1.6; }
.res-meta { font-family: var(--mono); font-size: .66rem; letter-spacing: .14em; text-transform: uppercase; color: var(--bone-35); }
.res-meta b { color: var(--brand-soft); font-weight: 600; }
.res-actions { display: flex; gap: .6rem; flex-wrap: wrap; margin-top: auto; padding-top: .6rem; }
.res-actions .btn, .res-actions .btn-ghost { padding: .7rem 1.15rem; font-size: .9rem; }
.res-dl[data-unlocked="1"]::after { content: "✓"; font-size: .8rem; opacity: .8; }

/* bot cards */
.res-bot { padding: 1.7rem; gap: .8rem; }
.res-bot-ic { width: 2.8rem; height: 2.8rem; border-radius: .8rem; display: grid; place-items: center; background: rgba(252,80,0,.14); color: var(--brand-soft); }
.res-bot.is-placeholder { border-style: dashed; border-color: rgba(252,80,0,.45); }
.res-flag { align-self: flex-start; font-family: var(--mono); font-size: .62rem; letter-spacing: .14em; text-transform: uppercase; color: #111; background: #ffd27a; padding: .25rem .5rem; border-radius: .3rem; }

/* ---------- article page ---------- */
.art-head { max-width: 48rem; margin: 0 auto; padding: 0 1.5rem; }
.art-head .eyebrow { margin-bottom: 1.1rem; }
.art-title { font-family: var(--display); font-weight: 600; font-size: clamp(2.2rem, 4.6vw, 3.6rem); line-height: 1.07; letter-spacing: -.035em; }
.art-sub { margin-top: .9rem; font-size: 1.25rem; color: var(--bone-70); letter-spacing: -.01em; }
.art-byline { margin-top: 1.4rem; display: flex; gap: .9rem 1.4rem; flex-wrap: wrap; align-items: center; }
.art-byline .btn { padding: .7rem 1.2rem; font-size: .9rem; }
.art-cover { max-width: 64rem; margin: 2.6rem auto 0; padding: 0 1.5rem; }
.art-cover img { width: 100%; aspect-ratio: 16/9; object-fit: cover; border-radius: var(--r); display: block; background: var(--ink-3); border: 1px solid var(--line); }
.art-body { max-width: 42rem; margin: 3rem auto 0; padding: 0 1.5rem; font-size: 1.1rem; line-height: 1.75; color: var(--bone-70); }
.art-body > * + * { margin-top: 1.1rem; }
.art-body h2 { font-family: var(--display); font-weight: 600; color: var(--bone); font-size: 1.75rem; line-height: 1.2; letter-spacing: -.025em; margin-top: 2.6rem; }
.art-body h3 { font-family: var(--display); font-weight: 600; color: var(--bone); font-size: 1.3rem; margin-top: 2rem; }
.art-body strong { color: var(--bone); }
.art-body a { color: var(--bone); border-bottom: 1px solid var(--brand); word-break: break-word; }
.art-body a:hover { color: var(--brand-soft); }
.art-body ul, .art-body ol { padding-left: 1.3rem; }
.art-body li + li { margin-top: .45rem; }
.art-body li::marker { color: var(--brand); }
.art-body .art-series { font-size: .98rem; color: var(--bone-55); }
.art-body hr { border: 0; border-top: 1px solid var(--line-strong); margin: 3rem 0; }
.art-biblio { font-size: .92rem; line-height: 1.6; }
.art-biblio h2 { font-size: 1.3rem; }
.art-end {
  max-width: 42rem; margin: 3.5rem auto 0; padding: 1.8rem; border-radius: var(--r);
  border: 1px solid rgba(252,80,0,.35); background: linear-gradient(135deg, rgba(252,80,0,.12), rgba(252,80,0,.02));
  display: flex; gap: 1.2rem; align-items: center; justify-content: space-between; flex-wrap: wrap;
}
.art-end h3 { font-family: var(--display); font-weight: 600; font-size: 1.3rem; letter-spacing: -.02em; }
.art-end p { color: var(--bone-55); font-size: .95rem; }
.art-more { max-width: var(--w); margin: 5rem auto 0; padding: 0 1.5rem; }

/* ---------- gate dialog ---------- */
.res-gate[hidden], .res-gate [hidden] { display: none !important; }
.res-gate { position: fixed; inset: 0; z-index: 200; display: grid; place-items: center; padding: 1rem; background: rgba(5,5,7,.72); backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); }
.res-gate-box {
  position: relative; width: 100%; max-width: 27rem; background: var(--ink-2); border: 1px solid var(--line-strong);
  border-radius: var(--r); padding: 2rem 1.8rem 1.6rem; box-shadow: 0 30px 80px -20px rgba(0,0,0,.6);
  max-height: calc(100vh - 2rem); overflow: auto;
}
.res-gate-x { position: absolute; top: .7rem; right: .7rem; width: 2.2rem; height: 2.2rem; border-radius: 50%; border: 1px solid var(--line); background: transparent; color: var(--bone-70); cursor: pointer; font-size: 1.2rem; line-height: 1; }
.res-gate h2 { font-family: var(--display); font-weight: 600; font-size: 1.45rem; letter-spacing: -.02em; line-height: 1.2; padding-right: 2rem; }
.res-gate-what { margin-top: .5rem; color: var(--bone-55); font-size: .92rem; }
.res-gate form { margin-top: 1.3rem; display: grid; gap: .95rem; }
.res-field label { display: block; font-size: .82rem; font-weight: 600; color: var(--bone-70); margin-bottom: .35rem; }
.res-field input {
  width: 100%; font: inherit; font-size: 1rem; color: var(--bone); background: var(--ink); border: 1px solid var(--line-strong);
  border-radius: var(--r-sm); padding: .8rem .9rem; outline: none; transition: border-color .15s ease;
}
.res-field input:focus { border-color: var(--brand); }
.res-field.has-err input { border-color: #ff5a5a; }
.res-err { min-height: 1.1em; margin-top: .3rem; font-size: .8rem; color: #ff7a7a; }
.res-hp { position: absolute !important; left: -9999px !important; width: 1px; height: 1px; overflow: hidden; }
.res-gate .btn { justify-content: center; width: 100%; }
.res-gate .btn[disabled] { opacity: .6; cursor: progress; }
.res-note { font-size: .76rem; color: var(--bone-35); line-height: 1.5; }
.res-msg { font-size: .9rem; color: var(--bone-70); }
.res-msg.err { color: #ff7a7a; }
.res-done { margin-top: 1.2rem; display: grid; gap: .9rem; }
.res-done p { color: var(--bone-70); font-size: .95rem; }
