/* Guides, article, about, legal and error pages after the RDR2 reference. Loaded last.
   Everything sits on imagery: red-graded game art in the heads, a faint art backdrop under framed translucent panels,
   thin icon strips with vertical dividers. Red, black, white and silver only. */

/* Article head: the shared RDR2 scene (site.css) behind a giant title, then a thin icon strip */
.ah { position: relative; isolation: isolate; display: flex; flex-direction: column; justify-content: flex-end; min-height: clamp(480px, 44vw, 640px); overflow: hidden; padding-top: 96px; border-bottom: 1px solid var(--line-2); }
.ah-inner { padding-bottom: 52px; }
.ah-copy { display: grid; gap: 18px; justify-items: start; max-width: 900px; min-width: 0; }
.ah-copy > * { animation: rise-in .7s var(--ease) both; }
.ah-copy > :nth-child(2) { animation-delay: .06s; }
.ah-copy > :nth-child(3) { animation-delay: .12s; }
.ah-copy > :nth-child(4) { animation-delay: .18s; }
.ah-copy > :nth-child(n+5) { animation-delay: .24s; }
.ah .kicker { letter-spacing: .14em; }
.ah .kicker::before, .ah .kicker::after { content: none; }
.ah-copy h1:not(.banner):not(.slab) { font: 800 clamp(36px, 4.6vw, 72px)/.98 var(--display); letter-spacing: 0; text-transform: uppercase; text-shadow: 0 6px 40px rgba(0, 0, 0, .7); }
.ah-title.slab { max-width: 22ch; font-size: clamp(34px, 4.2vw, 68px); line-height: 1; overflow-wrap: anywhere; }
.ah-copy .star-rule { margin-top: 4px; }
.ah-title.slab .inline-wordmark { height: 1em; margin: 0 -.12em; vertical-align: -.16em; }
.ah-copy h1 .inline-wordmark { height: 1.05em; }
.ah-copy .banner-article { height: clamp(90px, 11vw, 170px); }
.ah-copy .banner-article img { height: 100%; width: auto; max-width: 100%; object-fit: contain; object-position: left; }
.ah-lead { max-width: 680px; color: #d6d6dc; font-size: 18.5px; }
.ah-strip { position: relative; border-top: 1px solid var(--line-2); background: #09090a; }
.ah-meta { display: grid; grid-auto-columns: minmax(0, 1fr); grid-auto-flow: column; margin-block: 0; }
.ah-meta > div { display: grid; grid-template-columns: auto minmax(0, 1fr); align-content: center; gap: 6px 14px; min-width: 0; padding: 22px 24px; border-left: 1px solid var(--line-2); }
.ah-meta > div:first-child { padding-left: 0; border-left: 0; }
.ah-ico { grid-row: span 2; align-self: center; width: 34px; height: 34px; color: var(--red-hot); fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.ah-meta dt, .ah-meta dd { grid-column: -2; }
.ah-meta dt { color: var(--muted); font: 700 11px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; }
.ah-meta dd { min-width: 0; margin: 0; overflow: hidden; font: 700 15.5px/1.15 var(--display); letter-spacing: .02em; text-overflow: ellipsis; text-transform: uppercase; white-space: nowrap; }

/* Information pages: RDR2 icon strip with vertical dividers */
.doc-tabs { border-bottom: 1px solid var(--line-2); background: #0a0a0c; }
.doc-tabs-inner { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); }
.doc-tabs a { position: relative; display: flex; align-items: center; gap: 14px; min-width: 0; padding: 22px 24px; border-left: 1px solid var(--line-2); color: var(--muted); transition: background-color .2s; }
.doc-tabs a:first-child { padding-left: 0; border-left: 0; }
.doc-tabs a::after { content: ""; position: absolute; left: 0; right: 0; bottom: -1px; height: 3px; background: #fff; transform: scaleX(0); transform-origin: left; transition: transform .3s var(--ease); }
.doc-tabs a:hover { background: rgba(255, 255, 255, .03); }
.doc-tabs a:hover::after, .doc-tabs a[aria-current]::after { transform: scaleX(1); }
.doc-tabs a[aria-current]::after { background: #c8111b; }
.dt-ico { flex: none; width: 34px; height: 34px; color: var(--red-hot); fill: none; stroke: currentColor; stroke-width: 1.5; stroke-linecap: round; stroke-linejoin: round; }
.doc-tabs a > span { display: grid; gap: 6px; min-width: 0; }
.doc-tabs strong { color: #fff; font: 700 15px/1 var(--display); letter-spacing: .06em; text-transform: uppercase; }
.doc-tabs small { overflow: hidden; color: var(--muted); font-size: 14px; white-space: nowrap; text-overflow: ellipsis; }
.doc-tabs a[aria-current] strong { color: var(--red-hot); }

/* Stage: a faint scene plate behind a page body so framed panels sit on imagery */
.stage { position: relative; isolation: isolate; }
.stage-fx { position: absolute; inset: 0 0 auto; z-index: -1; height: min(56.25vw, 100%); overflow: hidden; opacity: .42; pointer-events: none; -webkit-mask: radial-gradient(75% 75% at 72% 20%, #000 15%, transparent 74%); mask: radial-gradient(75% 75% at 72% 20%, #000 15%, transparent 74%); }
.stage-fx img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; animation: sl-push 30s ease-in-out infinite alternate; }


/* Image wordmarks in running text: larger so the detailed art reads at a glance */
.article-body .inline-wordmark, .ah-lead .inline-wordmark, .gx-card p .inline-wordmark, .err-lead .inline-wordmark { height: 2.1em; vertical-align: -.7em; }
.gx-card h2 .inline-wordmark, .gx-card h3 .inline-wordmark { height: 2em; vertical-align: -.6em; }

/* Article body: one framed translucent panel, outlined section numbers, 1px dividers */
.article-layout { margin-top: 0; }
.article-body { position: relative; gap: 0; max-width: none; padding: 40px 44px; border: 1px solid rgba(255, 255, 255, .16); background: rgba(9, 9, 11, .82); }
.article-body::before { content: ""; position: absolute; top: -1px; left: -1px; width: 110px; height: 3px; background: #c8111b; box-shadow: 0 0 14px var(--red-glow); }
.article-body .as { padding: 38px 0; border-top: 1px solid var(--line); scroll-margin-top: calc(var(--top) + 20px); }
.article-body .as:first-child { padding-top: 0; border-top: 0; }
.article-body .as:last-child { padding-bottom: 0; }
.as-head { display: flex; align-items: center; gap: 18px; margin-bottom: 16px; }
.as-num { flex: none; color: transparent; -webkit-text-stroke: 1.4px var(--red-hot); font: 800 36px/1 var(--display); }
.article-body .as-head h2 { margin: 0; padding: 0; border: 0; font: 800 clamp(20px, 2vw, 26px)/1.15 var(--display); text-transform: uppercase; }
.as-code.code-box { margin-top: 18px; clip-path: none; border-radius: 2px; background: #09090b; box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .22), inset 3px 0 0 #c8111b; }

/* Aside: framed translucent panels with a red top bar */
.article-aside .toc, .article-aside .support-card { position: relative; clip-path: none; border-radius: 0; background: rgba(9, 9, 11, .82); box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18); }
.article-aside .toc::before, .article-aside .support-card::before { content: ""; position: absolute; top: 0; left: 0; width: 84px; height: 3px; background: #c8111b; box-shadow: 0 0 14px var(--red-glow); }
.article-aside .toc { gap: 0; padding: 22px 0 10px; }
.article-aside .toc span { margin: 0 22px 12px; }
.article-aside .toc a { display: flex; gap: 14px; padding: 13px 22px; border-top: 1px solid var(--line); color: var(--muted); font-size: 17px; transition: color .2s, background-color .2s; }
.article-aside .toc a b { flex: none; color: var(--red-hot); font: 700 14px/1.6 var(--display); letter-spacing: .08em; }
.article-aside .toc a:hover { background: rgba(255, 255, 255, .04); color: #fff; box-shadow: inset 3px 0 0 #fff; }
.article-aside .support-card { padding: 26px 24px 24px; }
.article-aside .toc::after, .article-aside .support-card::after { content: ""; position: absolute; top: -12px; left: -14px; width: 112px; height: 26px; background: radial-gradient(closest-side, rgba(225, 20, 30, .75), transparent); animation: bd-glow 2.6s ease-in-out infinite; pointer-events: none; }
.article-aside .btn-discord img { height: 42px; }
.article-aside .btn-discord { height: auto; min-height: 48px; padding-block: 8px; flex-wrap: wrap; white-space: normal; }
.article-aside .btn-discord span { display: inline; }

/* Guides: RDR2 feature row. Dark scene plate, red line icon, centered caps title, short copy, red link. */
.gx-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 1px; }
.gx-card { position: relative; isolation: isolate; display: flex; flex-direction: column; align-items: center; gap: 12px; min-width: 0; min-height: 340px; overflow: hidden; padding: 46px 30px 34px; color: #fff; text-align: center; box-shadow: 0 0 0 1px var(--line-2); }
.gx-bg { position: absolute; inset: 0; z-index: -1; background: #120304; }
.gx-bg img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: scale .6s var(--ease); }
.gx-bg::after { content: ""; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(7, 7, 8, .95) 34%, rgba(7, 7, 8, .55)); transition: opacity .3s; }
.gx-card:hover .gx-bg img { scale: 1.03; }
.gx-card:hover .gx-bg::after { opacity: .82; }
.gx-ico svg { width: 54px; height: 54px; color: var(--red-hot); fill: none; stroke: currentColor; stroke-width: 1.4; stroke-linecap: round; stroke-linejoin: round; filter: drop-shadow(0 0 12px var(--red-glow)); }
.gx-card small { color: var(--muted); font: 700 11px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; }
.gx-card h2, .gx-card h3 { font: 800 clamp(18px, 1.6vw, 21px)/1.15 var(--display); letter-spacing: .01em; text-transform: uppercase; }
.gx-card p { max-width: 36ch; color: #c9c9cf; font-size: 15.5px; line-height: 1.6; }
.gx-read { display: inline-flex; align-items: center; gap: 8px; margin-top: auto; padding-top: 8px; color: var(--red-hot); font: 700 12px/1 var(--display); font-style: normal; letter-spacing: .12em; text-transform: uppercase; }
.gx-read svg { width: 14px; height: 14px; stroke-width: 2.8; transition: transform .2s; }
.gx-card:hover .gx-read svg { transform: translateX(3px); }

/* 404: Apex-style hero with a giant outlined code */
.err { position: relative; isolation: isolate; display: flex; align-items: center; min-height: min(640px, 78vh); overflow: hidden; padding: 80px 0; border-bottom: 1px solid var(--line-2); }
.err-fx { position: absolute; inset: 0; z-index: -1; pointer-events: none; }
.err-bg { position: absolute; top: 0; right: 0; width: 55%; height: 100%; object-fit: cover; opacity: .5; animation: sl-push 30s ease-in-out infinite alternate; -webkit-mask: linear-gradient(90deg, transparent, #000 50%); mask: linear-gradient(90deg, transparent, #000 50%); }
.err-slab { position: absolute; top: 0; right: -4vw; width: 46%; height: 100%; clip-path: polygon(32% 0, 100% 0, 100% 100%, 0 100%); background: repeating-linear-gradient(115deg, rgba(0, 0, 0, .2) 0 2px, transparent 2px 16px), linear-gradient(160deg, #ff3030, #a20c15 45%, #3a0408); opacity: .55; }
.err-fx::after { content: ""; position: absolute; inset: 0; background: linear-gradient(90deg, var(--bg) 22%, rgba(7, 7, 8, .4) 70%, rgba(7, 7, 8, .1)); }
/* Poster plate, same as the page-head counters: err-ring = bracketed frame, err-dots = grained inner plate with star rule
   and ribbon, err-word = worn cream numeral. Static, inside the 1360 column; centered above the copy on mobile. */
.err-fx { --pw: clamp(300px, 30vw, 440px); --ph: calc(var(--pw) * .72); --pr: max(32px, calc((100% - var(--wrap)) / 2 + 32px)); }
.err-ring, .err-dots { position: absolute; z-index: 1; top: 50%; translate: 0 -50%; pointer-events: none; }
.err-ring { right: var(--pr); width: var(--pw); height: var(--ph);
  background:
    linear-gradient(var(--cream), var(--cream)) left top / 26px 2px no-repeat, linear-gradient(var(--cream), var(--cream)) left top / 2px 26px no-repeat,
    linear-gradient(var(--cream), var(--cream)) right top / 26px 2px no-repeat, linear-gradient(var(--cream), var(--cream)) right top / 2px 26px no-repeat,
    linear-gradient(var(--cream), var(--cream)) left bottom / 26px 2px no-repeat, linear-gradient(var(--cream), var(--cream)) left bottom / 2px 26px no-repeat,
    linear-gradient(var(--cream), var(--cream)) right bottom / 26px 2px no-repeat, linear-gradient(var(--cream), var(--cream)) right bottom / 2px 26px no-repeat,
    rgba(8, 3, 4, .6);
  box-shadow: inset 0 0 0 1px rgba(239, 232, 220, .16); }
.err-dots { right: calc(var(--pr) + 14px); width: calc(var(--pw) - 28px); height: calc(var(--ph) - 28px); background: url("fx/grain.webp") 0 0 / 256px, linear-gradient(180deg, #171113, #0b0708 70%); box-shadow: inset 0 0 0 1px rgba(239, 232, 220, .42); }
.err-dots::before { content: "\2605"; position: absolute; top: 22px; left: 26px; right: 26px; display: flex; justify-content: center; color: var(--rdr-red); font-size: 15px; line-height: 1; background: linear-gradient(90deg, transparent, #b3121a) left center / calc(50% - 18px) 1px no-repeat, linear-gradient(90deg, #b3121a, transparent) right center / calc(50% - 18px) 1px no-repeat; }
.err-dots::after { content: "Not found"; position: absolute; left: -16px; right: -16px; bottom: 20px; padding: 12px 30px 11px; background: var(--rdr-red); color: #fff; font: normal 700 15px/1 var(--display); letter-spacing: .14em; text-align: center; text-transform: uppercase; clip-path: polygon(0 0, 100% 0, calc(100% - 14px) 50%, 100% 100%, 0 100%, 14px 50%); }
.err-word { position: absolute; z-index: 2; top: calc(50% - 8px); right: var(--pr); width: var(--pw); color: var(--cream); font: 800 calc(var(--pw) * .34)/.84 var(--slab); letter-spacing: -.02em; text-align: center; transform: translateY(-50%); -webkit-mask: url("fx/grunge.webp") 0 0 / 220px repeat; mask: url("fx/grunge.webp?v=2") 0 0 / 220px repeat; animation: slide-in .9s var(--ease) .1s both; }
.err-inner { position: relative; z-index: 2; display: grid; gap: 20px; justify-items: start; }
.err-inner > * { max-width: 640px; animation: rise-in .7s var(--ease) both; }
.err-inner > :nth-child(2) { animation-delay: .06s; }
.err-inner > :nth-child(3) { animation-delay: .12s; }
.err-inner > :nth-child(n+4) { animation-delay: .18s; }
.err h1 { font: 800 clamp(34px, 4.6vw, 68px)/1 var(--display); text-transform: uppercase; text-shadow: 0 4px 30px rgba(0, 0, 0, .6); }
.err-lead { color: #c9c9cf; font-size: 18.5px; }
.err .action-row { justify-content: flex-start; margin-top: 8px; }
.err-links { display: flex; flex-wrap: wrap; gap: 8px 28px; margin-top: 10px; }
.err-links a { padding-bottom: 5px; border-bottom: 1px solid rgba(255, 255, 255, .35); color: var(--silver); font: 600 18px/1 var(--display); letter-spacing: .12em; text-transform: uppercase; transition: color .2s, border-color .2s; }
.err-links a:hover { border-color: #fff; color: #fff; }

/* Glows keep running under reduced motion (user request); entrances fall back to a fade. */
@keyframes bd-glow { 0%, 100% { opacity: .35; } 50% { opacity: 1; } }
@keyframes bd-fade { from { opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .ah-copy > *, .err-inner > *, .err-word { animation-name: bd-fade; animation-duration: .5s; }
}

@media (max-width: 960px) {
  .article-aside { grid-template-columns: repeat(auto-fit, minmax(280px, 1fr)); align-items: start; }
  .article-aside .support-card > .sheen img { max-width: 300px; }
  .ah-meta { grid-auto-flow: row; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ah-meta > div { padding: 18px 18px 18px 20px; border-left: 0; }
  .ah-meta > div:nth-child(odd) { padding-left: 0; }
  .ah-meta > div:nth-child(odd):not(:last-child) { border-right: 1px solid var(--line-2); }
  .ah-meta > div:nth-child(n+3) { border-top: 1px solid var(--line-2); }
  .ah-meta > div:last-child:nth-child(odd) { grid-column: 1 / -1; }
  .doc-tabs-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .doc-tabs a { padding-left: 20px; border-left: 0; }
  .doc-tabs a:nth-child(odd) { padding-left: 0; border-right: 1px solid var(--line-2); }
  .doc-tabs a:nth-child(n+3) { border-top: 1px solid var(--line-2); }
}

@media (max-width: 640px) {
  .ah { min-height: 0; padding-top: 56px; }
  .ah-inner { padding-bottom: 36px; }
  .ah-title.slab { font-size: clamp(26px, 7.6vw, 38px); }
  .ah .scene-moon { --moon: 170px; top: auto; bottom: 26%; right: -56px; opacity: .55; }
  .ah-lead, .err-lead { font-size: 16.5px; }
  .ah-meta > div { gap: 6px 10px; padding: 14px 12px 14px 14px; }
  .ah-ico { width: 26px; height: 26px; }
  .ah-meta dd { font-size: 14px; white-space: normal; overflow-wrap: anywhere; }
  .doc-tabs a { gap: 10px; padding: 16px 12px 16px 14px; }
  .dt-ico { width: 26px; height: 26px; }
  .doc-tabs strong { font-size: 14px; }
  .doc-tabs small { font-size: 13px; }
  .article.stage { padding-top: 36px; }
  .article-body { padding: 26px 18px; }
  .article-body .as { padding: 30px 0; }
  .as-head { gap: 14px; }
  .as-num { font-size: 28px; }
  .gx-grid { grid-template-columns: minmax(0, 1fr); }
  .gx-card { min-height: 0; padding: 36px 22px 28px; }
  .err { min-height: 0; padding: 268px 0 56px; }
  .err-fx { --pw: 240px; --ph: 188px; }
  .err-ring { top: 40px; left: calc(50% - var(--pw) / 2); right: auto; translate: none; }
  .err-dots { top: 54px; left: calc(50% - var(--pw) / 2 + 14px); right: auto; translate: none; }
  .err-dots::before { top: 16px; }
  .err-dots::after { bottom: 14px; padding: 10px 24px 9px; font-size: 14px; }
  .err-word { top: 126px; left: calc(50% - var(--pw) / 2); right: auto; font-size: 76px; }
  .err .btn-lg { flex: 1 1 100%; justify-content: center; }
}

@media (max-width: 420px) {
  .ah-meta { grid-template-columns: minmax(0, 1fr); }
  .ah-meta > div { padding-left: 0; border-right: 0 !important; }
  .ah-meta > div + div { border-top: 1px solid var(--line-2); }
}
