/* ==========================================================================
   The article page (Theme\ArticleOs), cryptogames.gg only — owner 2026-09-27.
   Layout B "Feature" of artifact KpRGQTKTfa8dJvU7CpXdZB: the image as the
   header with the title on it, contents | text | sidebar below.
   Palette: home-os.css's, as the page's own --ar-* tokens (same as the Magazine).
   Widths: ≥1240 three columns · 1024–1239 text + sidebar, contents folded
   above the text · <1024 one column · ≤760 the image sits above the title.
   ========================================================================== */

body.cg-article-os {
  --ar-bg: #191919;
  --ar-s1: #212121;
  --ar-s2: #2a2a2a;
  --ar-s3: #333333;
  --ar-line: rgba(255, 255, 255, .08);
  --ar-text: #ffffff;
  --ar-body: #d6d6d6;
  --ar-muted: #b5b5b5;
  --ar-faint: #8c8c8c;
  --ar-accent: #9d8cff;
  --ar-grad: linear-gradient(135deg, #06707f 0%, #4a28c4 62%, #7b2fc0 100%);
  --ar-title: linear-gradient(120deg, #4fd1e0 0%, #9d8cff 55%, #c792ff 100%);
  --ar-glow: rgba(123, 47, 192, .45);
  --ar-glow-2: rgba(74, 40, 196, .22);
  --ar-live: #35b477;
  --ar-top: calc(var(--cg-hd, 64px) + 16px);
}
body:not([data-theme="dark"]).cg-article-os {
  --ar-bg: #ffffff;
  --ar-s1: #f4f4f6;
  --ar-s2: #e9e9ee;
  --ar-s3: #dedee6;
  --ar-line: rgba(0, 0, 0, .08);
  --ar-text: #191919;
  --ar-body: #2b2b2b;
  --ar-muted: #6b6b6b;
  --ar-faint: #8a8a8a;
  --ar-accent: #4a28c4;
  --ar-title: linear-gradient(120deg, #06707f 0%, #4a28c4 60%, #7b2fc0 100%);
  --ar-glow: rgba(123, 47, 192, .18);
  --ar-glow-2: rgba(74, 40, 196, .08);
  --ar-live: #2f9e68;
}

/* ---------------------------------------------------------- page ground */
body.cg-article-os,
body.cg-article-os main.cg-main,
body.cg-article-os .cg-content-area { background: var(--ar-bg); }
@media (min-width: 1024px) {
  body.cg-article-os .cg-rail ~ main.cg-main,
  body.cg-article-os .cg-rail ~ .footer-wrap,
  body.cg-article-os .cg-rail ~ .cg-site-footer,
  body.cg-article-os .cg-rail ~ * .footer-wrap { margin-left: var(--cg-rail, 64px); }
}
body.cg-article-os .cg-content-area { max-width: none; padding: 20px 24px 64px; }

.cg-article-os .ar { max-width: 1340px; margin: 0 auto; color: var(--ar-body); font: 15px/1.55 Inter, system-ui, sans-serif; }
.cg-article-os .ar a { text-decoration: none; }
.cg-article-os .ar h1,
.cg-article-os .ar h2,
.cg-article-os .ar h3 { font-family: Inter, system-ui, sans-serif; text-wrap: balance; }
.cg-article-os .ar a:focus-visible,
.cg-article-os .ar button:focus-visible,
.cg-article-os .ar summary:focus-visible { outline: 2px solid var(--ar-accent); outline-offset: 3px; border-radius: 8px; }

/* reading progress, driven by article-os.js */
.cg-article-os .ar-progress { position: fixed; left: 0; right: 0; top: 0; z-index: 9999; height: 3px; pointer-events: none; }
.cg-article-os .ar-progress i { display: block; height: 100%; width: 100%; background: var(--ar-grad); transform: scaleX(var(--ar-read, 0)); transform-origin: 0 50%; }

/* ------------------------------------------------------------------ hero */
.cg-article-os .ar-hero { position: relative; display: flex; align-items: flex-end; min-height: 500px; margin-bottom: 28px; border-radius: 20px; overflow: hidden; background: var(--ar-s1); isolation: isolate; }
.cg-article-os .ar-hero-media { position: absolute; inset: 0; z-index: -1; }
.cg-article-os .ar-hero-media .ar-hero-img { display: block; width: 100%; height: 100%; max-width: none; object-fit: cover; }
.cg-article-os .ar-hero-media::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, rgba(0, 0, 0, .1) 15%, rgba(10, 6, 24, .55) 50%, rgba(10, 6, 24, .94) 100%); }
.cg-article-os .ar-hero-media .cg-image-source { position: absolute; top: 12px; right: 12px; z-index: 1; padding: 4px 10px; border-radius: 999px; background: rgba(0, 0, 0, .55); color: rgba(255, 255, 255, .85); font-size: 11.5px; line-height: 1.4; }
.cg-article-os .ar-hero-tx { display: flex; flex-direction: column; gap: 14px; max-width: 920px; padding: 36px 40px; color: #ffffff; }
.cg-article-os .ar-title { margin: 0; color: #ffffff; font-size: clamp(30px, 3.6vw, 50px); line-height: 1.08; font-weight: 800; letter-spacing: -.025em; }
.cg-article-os .ar-dek { margin: 0; max-width: 62ch; color: rgba(255, 255, 255, .84); font-size: 18px; line-height: 1.5; }
.cg-article-os .ar-crumb { font-size: 12px; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; color: rgba(255, 255, 255, .72); }
.cg-article-os .ar-crumb a,
.cg-article-os .ar-crumb span { color: inherit; }
.cg-article-os .ar-crumb a:hover { color: #ffffff; }
.cg-article-os .ar-cats { display: flex; flex-wrap: wrap; gap: 6px; }
.cg-article-os .ar-chip { display: inline-flex; align-items: center; height: 28px; padding: 0 12px; border-radius: 999px; background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .2); color: #ffffff; font-size: 12.5px; font-weight: 600; }
.cg-article-os .ar-chip:first-child { background: var(--ar-grad); border-color: transparent; }
.cg-article-os .ar-chip:hover { border-color: #ffffff; }
.cg-article-os .ar-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 12px; font-size: 13.5px; color: rgba(255, 255, 255, .75); }
.cg-article-os .ar-who { display: inline-flex; align-items: center; gap: 8px; color: #ffffff; font-weight: 700; }
.cg-article-os .ar-who:hover { text-decoration: underline; }
.cg-article-os .ar-meta .ar-av { width: 30px; height: 30px; border-radius: 50%; }
.cg-article-os .ar-dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: .7; }

/* no featured image: the same header as a glow card, in the page's colours */
.cg-article-os .ar-hero--plain { min-height: 0; background: radial-gradient(120% 140% at 100% 0%, var(--ar-glow) 0%, var(--ar-glow-2) 35%, transparent 70%), var(--ar-s1); }
.cg-article-os .ar-hero--plain .ar-hero-tx,
.cg-article-os .ar-hero--plain .ar-title,
.cg-article-os .ar-hero--plain .ar-who { color: var(--ar-text); }
.cg-article-os .ar-hero--plain .ar-dek,
.cg-article-os .ar-hero--plain .ar-crumb,
.cg-article-os .ar-hero--plain .ar-meta { color: var(--ar-muted); }
.cg-article-os .ar-hero--plain .ar-chip { background: var(--ar-s2); border-color: var(--ar-line); color: var(--ar-text); }
.cg-article-os .ar-hero--plain .ar-chip:first-child { background: var(--ar-grad); color: #ffffff; }

/* ------------------------------------------------------------------ grid */
.cg-article-os .ar-grid { display: grid; grid-template-columns: 220px minmax(0, 720px) 320px; gap: 32px; justify-content: center; align-items: start; }
.cg-article-os .ar-grid--notoc { grid-template-columns: minmax(0, 760px) 320px; }
.cg-article-os .ar-col { display: flex; flex-direction: column; gap: 24px; min-width: 0; }

/* contents, left, follows the reader */
.cg-article-os .ar-toc { position: sticky; top: var(--ar-top); display: flex; flex-direction: column; gap: 2px; max-height: calc(100vh - var(--ar-top) - 16px); overflow: auto; font-size: 13.5px; }
.cg-article-os .ar-toc > b { margin-bottom: 8px; font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ar-faint); }
.cg-article-os .ar-toc > a { padding: 7px 10px; border-left: 2px solid var(--ar-line); color: var(--ar-muted); line-height: 1.35; }
.cg-article-os .ar-toc > a:hover { color: var(--ar-text); }
.cg-article-os .ar-toc > a.is-on { border-color: var(--ar-accent); color: var(--ar-text); font-weight: 700; background: linear-gradient(90deg, var(--ar-glow-2), transparent); }
.cg-article-os .ar-share--toc { margin-top: 16px; }
.cg-article-os .ar-toc-m { display: none; border-radius: 14px; background: var(--ar-s1); }
.cg-article-os .ar-toc-m summary { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; cursor: pointer; list-style: none; color: var(--ar-text); font-weight: 800; }
.cg-article-os .ar-toc-m summary::-webkit-details-marker { display: none; }
.cg-article-os .ar-toc-m summary small { margin-left: auto; color: var(--ar-faint); font-weight: 600; }
.cg-article-os .ar-toc-m summary::after { content: ""; width: 8px; height: 8px; border-right: 2px solid var(--ar-faint); border-bottom: 2px solid var(--ar-faint); transform: rotate(45deg); transition: transform .15s; }
.cg-article-os .ar-toc-m[open] summary::after { transform: rotate(-135deg); }
.cg-article-os .ar-toc-m nav { display: flex; flex-direction: column; padding: 0 18px 14px; }
.cg-article-os .ar-toc-m nav a { padding: 8px 0; border-top: 1px solid var(--ar-line); color: var(--ar-body); font-size: 14.5px; }

/* share */
.cg-article-os .ar-share { display: flex; flex-wrap: wrap; gap: 6px; }
.cg-article-os .ar-sh { display: grid; place-items: center; width: 36px; height: 36px; padding: 0; border-radius: 10px; border: 1px solid var(--ar-line); background: var(--ar-s1); color: var(--ar-text); cursor: pointer; }
.cg-article-os .ar-sh:hover { border-color: var(--ar-accent); color: var(--ar-accent); }
.cg-article-os .ar-copy.is-done { background: var(--ar-grad); color: #ffffff; border-color: transparent; }
.cg-article-os .ar-share-row { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 16px; border-radius: 14px; background: var(--ar-s1); }
.cg-article-os .ar-share-row > span { color: var(--ar-text); font-weight: 700; }
.cg-article-os .ar-share-row .ar-sh { background: var(--ar-s2); }

.cg-article-os .ar-disc { padding: 12px 16px; border-radius: 12px; border: 1px solid var(--ar-line); color: var(--ar-faint); font-size: 12.5px; line-height: 1.55; }
.cg-article-os .ar-disc .reader-disclosure { margin: 0; padding: 0; border: 0; background: none; color: inherit; font: inherit; letter-spacing: 0; text-transform: none; }

/* ------------------------------------------------------------------ text */
.cg-article-os .ar-body { max-width: 68ch; color: var(--ar-body); font-size: 17.5px; line-height: 1.75; overflow-wrap: break-word; }
.cg-article-os .ar-body > * { max-width: 100%; }
.cg-article-os .ar-body p { margin: 0 0 1.15em; }
.cg-article-os .ar-body h2 { margin: 1.7em 0 .6em; color: var(--ar-text); font-size: 27px; line-height: 1.25; font-weight: 800; letter-spacing: -.015em; scroll-margin-top: var(--ar-top); }
.cg-article-os .ar-body h3 { margin: 1.5em 0 .5em; color: var(--ar-text); font-size: 21px; line-height: 1.3; font-weight: 800; scroll-margin-top: var(--ar-top); }
.cg-article-os .ar-body h4 { margin: 1.3em 0 .4em; color: var(--ar-text); font-size: 18px; font-weight: 700; }
.cg-article-os .ar-body a:not([class]) { color: var(--ar-accent); text-decoration: underline; text-decoration-thickness: 1px; text-underline-offset: 3px; }
.cg-article-os .ar-body a:not([class]):hover { text-decoration-thickness: 2px; }
.cg-article-os .ar-body strong { color: var(--ar-text); }
.cg-article-os .ar-body ul,
.cg-article-os .ar-body ol { margin: 0 0 1.2em; padding-left: 1.3em; }
.cg-article-os .ar-body li { margin-bottom: .45em; }
.cg-article-os .ar-body li::marker { color: var(--ar-accent); }
.cg-article-os .ar-body blockquote { margin: 1.4em 0; padding: 4px 0 4px 20px; border-left: 3px solid var(--ar-accent); color: var(--ar-text); font-size: 1.08em; font-style: normal; }
.cg-article-os .ar-body img,
.cg-article-os .ar-body video { max-width: 100%; height: auto; border-radius: 14px; }
.cg-article-os .ar-body figure { margin: 1.6em 0; }
.cg-article-os .ar-body figcaption { margin-top: 8px; color: var(--ar-faint); font-size: 13px; line-height: 1.5; text-align: left; }
.cg-article-os .ar-body iframe { display: block; max-width: 100%; border-radius: 14px; }
.cg-article-os .ar-body iframe[src*="youtube"],
.cg-article-os .ar-body iframe[src*="youtu.be"] { width: 100%; height: auto; aspect-ratio: 16 / 9; }
.cg-article-os .ar-body .wp-block-embed__wrapper { max-width: 100%; }
.cg-article-os .ar-body .wp-block-table,
.cg-article-os .ar-body .table-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.cg-article-os .ar-body table { width: 100%; border-collapse: collapse; font-size: 15px; line-height: 1.5; }
.cg-article-os .ar-body th,
.cg-article-os .ar-body td { padding: 10px 12px; border-bottom: 1px solid var(--ar-line); text-align: left; vertical-align: top; }
.cg-article-os .ar-body th { color: var(--ar-text); background: var(--ar-s1); }
.cg-article-os .ar-body pre { max-width: 100%; overflow-x: auto; padding: 14px 16px; border-radius: 12px; background: var(--ar-s1); font-size: 14px; }
.cg-article-os .ar-body hr { border: 0; border-top: 1px solid var(--ar-line); margin: 2em 0; }
/* the theme's in-text contents box: the page's own list replaces it */
.cg-article-os .ar-body .ruby-table-contents { display: none; }
.cg-article-os .ar-body .inline-single-ad { margin: 1.6em 0; }
.cg-article-os .ar-pages { display: flex; gap: 6px; flex-wrap: wrap; font-weight: 600; }

/* tags, author, related */
.cg-article-os .ar-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.cg-article-os .ar-tags a { padding: 5px 11px; border-radius: 999px; background: var(--ar-s1); border: 1px solid var(--ar-line); color: var(--ar-muted); font-size: 13px; font-weight: 600; }
.cg-article-os .ar-tags a:hover { color: var(--ar-text); border-color: var(--ar-accent); }
.cg-article-os .ar-author { display: grid; grid-template-columns: 64px minmax(0, 1fr); gap: 16px; padding: 20px; border-radius: 16px; background: radial-gradient(120% 140% at 100% 0%, var(--ar-glow-2), transparent 60%), var(--ar-s1); }
.cg-article-os .ar-author .ar-av { width: 64px; height: 64px; border-radius: 50%; }
.cg-article-os .ar-author-n { color: var(--ar-text); font-size: 17px; font-weight: 800; }
.cg-article-os .ar-author-n:hover { color: var(--ar-accent); }
.cg-article-os .ar-author p { margin: 4px 0 0; color: var(--ar-muted); font-size: 14.5px; line-height: 1.55; }
.cg-article-os .ar-sec-h { display: flex; align-items: center; gap: 10px; margin: 0 0 14px; color: var(--ar-text); font-size: 21px; font-weight: 800; letter-spacing: -.01em; }
.cg-article-os .ar-sec-h i { width: 6px; height: 20px; border-radius: 3px; background: var(--ar-grad); }
.cg-article-os .ar-rel-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.cg-article-os .ar-card { display: flex; flex-direction: column; border-radius: 14px; overflow: hidden; background: var(--ar-s1); transition: transform .15s ease; }
.cg-article-os .ar-card:hover { transform: translateY(-2px); }
.cg-article-os .ar-ph { display: block; aspect-ratio: 16 / 9; max-width: 100%; background: var(--ar-s2); }
.cg-article-os .ar-ph img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cg-article-os .ar-card-tx { display: flex; flex-direction: column; gap: 5px; padding: 11px 13px 13px; }
.cg-article-os .ar-kick { font-size: 11px; font-weight: 800; letter-spacing: .08em; text-transform: uppercase; color: var(--ar-accent); }
.cg-article-os .ar-card-h { color: var(--ar-text); font-size: 15px; line-height: 1.35; font-weight: 700; }
.cg-article-os .ar-card time { color: var(--ar-faint); font-size: 12px; }
.cg-article-os .ar-comments { padding: 20px; border-radius: 16px; background: var(--ar-s1); }

/* --------------------------------------------------------------- sidebar */
.cg-article-os .ar-side { position: sticky; top: var(--ar-top); display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.cg-article-os .ar-box { padding: 16px; border-radius: 16px; background: var(--ar-s1); color: var(--ar-body); font-size: 14px; }
.cg-article-os .ar-box-h { display: flex; align-items: center; gap: 8px; margin: 0 0 10px; color: var(--ar-text); font-size: 15.5px; font-weight: 800; }
.cg-article-os .ar-box-h b { width: 8px; height: 8px; border-radius: 50%; background: var(--ar-live); box-shadow: 0 0 0 4px color-mix(in srgb, var(--ar-live) 22%, transparent); }
.cg-article-os .ar-widget a { color: var(--ar-text); }
.cg-article-os .ar-widget a:hover { color: var(--ar-accent); }
.cg-article-os .ar-widget ul { margin: 0; padding: 0; list-style: none; }
.cg-article-os .ar-widget li { padding: 8px 0; border-top: 1px solid var(--ar-line); }
.cg-article-os .ar-widget li:first-child { border-top: 0; padding-top: 0; }
.cg-article-os .ar-widget img { max-width: 100%; height: auto; border-radius: 10px; }
.cg-article-os .ar-widget p:last-child { margin-bottom: 0; }
.cg-article-os .ar-tl { display: grid; grid-template-columns: 50px minmax(0, 1fr); gap: 10px; padding: 9px 0; border-top: 1px solid var(--ar-line); }
.cg-article-os .ar-tl:first-of-type { border-top: 0; }
.cg-article-os .ar-tl time { padding-top: 1px; color: var(--ar-accent); font-size: 12px; font-weight: 700; font-variant-numeric: tabular-nums; }
.cg-article-os .ar-tl span { color: var(--ar-text); font-size: 13.5px; line-height: 1.35; font-weight: 600; }
.cg-article-os .ar-tl:hover span { color: var(--ar-accent); }

/* ------------------------------------------------------------ narrower */
@media (max-width: 1239px) {
  .cg-article-os .ar-grid,
  .cg-article-os .ar-grid--notoc { grid-template-columns: minmax(0, 1fr) 300px; gap: 28px; }
  .cg-article-os .ar-toc { display: none; }
  .cg-article-os .ar-toc-m { display: block; }
  .cg-article-os .ar-body { max-width: none; }
}
@media (max-width: 1023px) {
  .cg-article-os .ar-grid,
  .cg-article-os .ar-grid--notoc { grid-template-columns: minmax(0, 1fr); }
  .cg-article-os .ar-side { position: static; }
  .cg-article-os .ar-hero { min-height: 420px; }
  .cg-article-os .ar-hero-tx { padding: 28px; }
}
@media (max-width: 760px) {
  body.cg-article-os .cg-content-area { padding: 12px 16px 40px; }
  /* phones: the image above the title, never text over a busy picture */
  .cg-article-os .ar-hero { display: block; min-height: 0; margin: 0 -16px 20px; border-radius: 0; background: none; }
  .cg-article-os .ar-hero-media { position: relative; z-index: 0; aspect-ratio: 16 / 9; max-width: 100%; }
  .cg-article-os .ar-hero-media::after { display: none; }
  .cg-article-os .ar-hero-tx { gap: 12px; padding: 18px 16px 0; color: var(--ar-text); }
  .cg-article-os .ar-title,
  .cg-article-os .ar-who { color: var(--ar-text); }
  .cg-article-os .ar-title { font-size: 28px; }
  .cg-article-os .ar-dek { color: var(--ar-muted); font-size: 16.5px; }
  .cg-article-os .ar-crumb,
  .cg-article-os .ar-meta { color: var(--ar-muted); }
  .cg-article-os .ar-chip { background: var(--ar-s2); border-color: var(--ar-line); color: var(--ar-text); }
  .cg-article-os .ar-chip:first-child { color: #ffffff; }
  .cg-article-os .ar-hero--plain { margin: 0 0 20px; border-radius: 16px; }
  .cg-article-os .ar-hero--plain .ar-hero-tx { padding: 18px; }
  .cg-article-os .ar-body { font-size: 16.5px; line-height: 1.7; }
  .cg-article-os .ar-body h2 { font-size: 23px; }
  .cg-article-os .ar-body h3 { font-size: 19px; }
  .cg-article-os .ar-rel-grid { grid-template-columns: minmax(0, 1fr); }
  .cg-article-os .ar-author { grid-template-columns: 48px minmax(0, 1fr); padding: 16px; }
  .cg-article-os .ar-author .ar-av { width: 48px; height: 48px; }
  .cg-article-os .ar-comments { padding: 16px; }
}
@media (prefers-reduced-motion: reduce) {
  .cg-article-os .ar-card,
  .cg-article-os .ar-toc-m summary::after { transition: none; }
  .cg-article-os .ar-progress { display: none; }
}
