/* Guides hub and articles (tools/guides.py, templates/guide.j2 + guides_hub.j2). v2 tokens only (v2.css :root); the shared
   page kit (.ph, .sx, .xprose, .xsvc, .qa, .xcta) comes from v2-pages.css and v2-r6.css. Pixel language: chamfered cards with
   the three-square pixel corner, square bullets, square TOC markers. */

/* ---------- hero: short answer box and byline ---------- */
.gd-hero h1 { font-size: clamp(34px, 4.4vw, 62px); max-width: 20ch; }
.gd-hero.no-vis .ph-in { grid-template-columns: minmax(0, 900px); }
.gd-answer { --c: 14px; position: relative; max-width: 68ch; margin-top: 28px; padding: 22px 24px 22px 26px; font-size: clamp(16.5px, 1.25vw, 18.5px); line-height: 1.62;
  background: color-mix(in srgb, var(--surface) 86%, transparent); box-shadow: inset 0 0 0 1px var(--line-2), inset 3px 0 0 var(--accent);
  clip-path: polygon(0 0, calc(100% - var(--c)) 0, 100% var(--c), 100% 100%, 0 100%); -webkit-backdrop-filter: blur(6px); backdrop-filter: blur(6px); }
.gd-answer-k { display: inline-flex; align-items: center; gap: 8px; margin-bottom: 8px; font: 700 11.5px/1 var(--f-head); letter-spacing: .18em; text-transform: uppercase; color: var(--accent-ink); }
.gd-answer-k::before { content: ""; width: 7px; height: 7px; background: var(--accent); }
.gd-answer p { margin: 0; }
.gd-byline { display: flex; align-items: center; gap: 14px; margin-top: 26px; }
.gd-av { flex: none; width: 48px; height: 48px; overflow: hidden; clip-path: polygon(8px 0, 100% 0, 100% calc(100% - 8px), calc(100% - 8px) 100%, 0 100%, 0 8px); background: var(--bg-2); }
.gd-av img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.gd-byline p { display: flex; flex-wrap: wrap; gap: 4px 18px; font: 600 14px/1.4 var(--f-head); color: var(--muted); }
.gd-byline p span + span { position: relative; padding-left: 18px; }
.gd-byline p span + span::before { content: ""; position: absolute; left: 0; top: .55em; width: 5px; height: 5px; background: var(--line-2); }
.gd-byline a { color: var(--ink); text-decoration: none; box-shadow: inset 0 -1.5px 0 var(--accent); }
.gd-byline a:hover { color: var(--accent-ink); }
.js .ph .gd-byline[data-rise] { animation-delay: 420ms; }

/* ---------- reading band: sticky contents beside a ~68ch column ---------- */
.gd-read { position: relative; padding: var(--sec-y) 0; background: var(--surface); }
.gd-grid { display: grid; grid-template-columns: minmax(200px, 260px) minmax(0, 68ch); gap: clamp(32px, 5vw, 88px); justify-content: center; align-items: start; }
.gd-toc { position: sticky; top: 112px; }
.gd-toc-box summary { list-style: none; cursor: default; display: flex; align-items: center; gap: 10px; margin-bottom: 16px; font: 700 12px/1.2 var(--f-head); letter-spacing: .2em; text-transform: uppercase; color: var(--muted); }
.gd-toc-box summary::-webkit-details-marker { display: none; }
.gd-toc-box summary::before { content: ""; width: 7px; height: 7px; background: var(--accent); flex: none; }
.gd-toc ol { display: grid; gap: 2px; border-left: 1px solid var(--line-2); }
.gd-toc a { position: relative; display: block; padding: 7px 0 7px 18px; font: 600 14px/1.4 var(--f-head); color: var(--muted); text-decoration: none; transition: color 120ms var(--ease); }
.gd-toc a::before { content: ""; position: absolute; left: -4px; top: 13px; width: 7px; height: 7px; background: var(--surface); box-shadow: inset 0 0 0 1.5px var(--line-2); transition: background-color 160ms var(--ease), box-shadow 160ms var(--ease); }
.gd-toc a:hover { color: var(--ink); }
.gd-toc a[aria-current] { color: var(--ink); }
.gd-toc a[aria-current]::before { background: var(--accent); box-shadow: none; }

/* the article prose: larger rhythm than .xprose's default, headings with a pixel tick */
.gd-prose > * + * { margin-top: 18px; }
.gd-prose p, .gd-prose li { font-size: 18px; line-height: 1.75; }
.gd-prose h2 { position: relative; margin-top: 64px; padding-top: 22px; font-size: clamp(26px, 2.5vw, 34px); line-height: 1.12; letter-spacing: -.025em; scroll-margin-top: 110px; }
.gd-prose h2::before { content: ""; position: absolute; left: 0; top: 0; width: 7px; height: 7px; background: var(--accent); box-shadow: 12px 0 0 color-mix(in srgb, var(--accent) 55%, transparent), 24px 0 0 color-mix(in srgb, var(--accent) 25%, transparent); }
.gd-prose > h2:first-child { margin-top: 0; }
.gd-prose h3 { margin-top: 36px; font-size: 22px; scroll-margin-top: 110px; }
.gd-prose h2 + *, .gd-prose h3 + * { margin-top: 14px; }
.gd-prose a { font-weight: 600; }
.gd-prose blockquote { --c: 12px; margin: 26px 0; padding: 18px 22px; background: var(--bg-2); box-shadow: inset 3px 0 0 var(--accent); font-style: normal;
  clip-path: polygon(0 0, calc(100% - var(--c)) 0, 100% var(--c), 100% 100%, 0 100%); }
.gd-prose blockquote p { font: 600 16.5px/1.6 var(--f-body); color: var(--ink); }
.gd-tw { --c: 14px; margin: 26px 0; overflow-x: auto; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line);
  clip-path: polygon(0 0, calc(100% - var(--c)) 0, 100% var(--c), 100% 100%, var(--c) 100%, 0 calc(100% - var(--c))); }
.gd-tw table { min-width: 460px; font-size: 15.5px; }
.gd-tw th { font: 700 12px/1.3 var(--f-head); letter-spacing: .12em; text-transform: uppercase; color: var(--muted); background: var(--bg-2); }
.gd-tw th, .gd-tw td { padding: 13px 16px; }
.gd-tw tr:last-child td { border-bottom: 0; }
.gd-tw td:last-child { font-weight: 700; color: var(--ink); white-space: nowrap; }

.gd-sources { margin-top: 48px; padding-top: 24px; border-top: 1px dashed var(--line-2); }
.gd-sources ol { display: grid; gap: 6px; counter-reset: s; }
.gd-sources li { counter-increment: s; font-size: 14.5px; line-height: 1.5; color: var(--muted); }
.gd-sources li::before { content: counter(s) ". "; font-weight: 700; color: var(--accent-ink); }
.gd-sources a { color: var(--ink-2); text-underline-offset: 3px; }

/* author box: pixel-resolved portrait, chamfered card with the pixel corner */
.gd-author { --c: 26px; position: relative; isolation: isolate; display: grid; grid-template-columns: 140px minmax(0, 1fr); gap: 28px; align-items: start; margin-top: 56px; padding: 28px;
  background: var(--bg); box-shadow: inset 0 0 0 1px var(--line);
  clip-path: polygon(0 0, calc(100% - var(--c)) 0, 100% var(--c), 100% 100%, var(--c) 100%, 0 calc(100% - var(--c))); }
.gd-author::before { content: ""; position: absolute; z-index: 2; top: 9px; right: calc(var(--c) - 4px); width: 6px; height: 6px; background: var(--accent); pointer-events: none;
  box-shadow: calc((var(--c) - 13px) * .5) calc((var(--c) - 13px) * .5) 0 -1px color-mix(in srgb, var(--accent) 55%, transparent), calc(var(--c) - 13px) calc(var(--c) - 13px) 0 0 var(--accent); }
.gd-author-ph { display: block; width: 140px; aspect-ratio: 1; overflow: hidden; clip-path: polygon(14px 0, 100% 0, 100% calc(100% - 14px), calc(100% - 14px) 100%, 0 100%, 0 14px); background: var(--bg-2); }
.gd-author-ph img { width: 100%; height: 100%; object-fit: cover; object-position: 50% 18%; }
.gd-author .kicker { margin-bottom: 8px; }
.gd-author-n { font-size: 24px; letter-spacing: -.02em; }
.gd-author-r { margin-top: 4px; font: 600 14px/1.4 var(--f-head); color: var(--accent-ink); }
.gd-author-b { margin-top: 12px; font-size: 15.5px; line-height: 1.65; color: var(--ink-2); }
.gd-author .tlink { margin-top: 14px; }

/* related services: two columns when there are two */
.gd-svc.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }

/* ---------- cards (hub grid and "more guides") ---------- */
.gd-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--grid-gap); }
.gd-cards.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.gd-card { --c: 26px; position: relative; isolation: isolate; display: flex; flex-direction: column; gap: 12px; min-height: 100%; padding: 30px 28px 26px; text-decoration: none; color: var(--ink);
  background: var(--surface); box-shadow: inset 0 0 0 1px var(--line);
  clip-path: polygon(0 0, calc(100% - var(--c)) 0, 100% var(--c), 100% 100%, var(--c) 100%, 0 calc(100% - var(--c))); transition: transform 240ms var(--ease); }
.gd-card[hidden] { display: none; }
.gd-card::before { content: ""; position: absolute; z-index: 2; top: 9px; right: calc(var(--c) - 4px); width: 6px; height: 6px; background: var(--accent); pointer-events: none;
  box-shadow: calc((var(--c) - 13px) * .5) calc((var(--c) - 13px) * .5) 0 -1px color-mix(in srgb, var(--accent) 55%, transparent), calc(var(--c) - 13px) calc(var(--c) - 13px) 0 0 var(--accent); }
.gd-card::after { content: ""; position: absolute; inset: 0; z-index: -1; pointer-events: none; opacity: 0; transition: opacity 100ms var(--ease); background: radial-gradient(340px circle at var(--mx, 50%) var(--my, 30%), rgba(0, 187, 255, .14), transparent 62%); }
.gd-card:hover { transform: translateY(-4px); }
.gd-card:hover::after { opacity: 1; }
.gd-card:hover::before { animation: pxblip 520ms steps(2, end) 1; }
.gd-card h3 { font-size: 22px; line-height: 1.2; letter-spacing: -.02em; }
.gd-card p { font-size: 15.5px; line-height: 1.6; color: var(--ink-2); }
.gd-chip { align-self: flex-start; padding: 6px 11px; font: 700 11.5px/1 var(--f-head); letter-spacing: .14em; text-transform: uppercase; color: var(--accent-ink); background: color-mix(in srgb, var(--accent) 12%, transparent);
  clip-path: polygon(5px 0, 100% 0, 100% calc(100% - 5px), calc(100% - 5px) 100%, 0 100%, 0 5px); }
.gd-card-f { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: center; gap: 10px; margin-top: auto; padding-top: 16px; border-top: 1px dashed var(--line-2); font: 600 13.5px/1.3 var(--f-head); color: var(--muted); }
.gd-go { display: inline-flex; align-items: center; gap: 8px; color: var(--accent-ink); font-weight: 700; }
.gd-go .arr { width: 16px; height: 16px; transition: transform 240ms var(--ease); }
.gd-card:hover .gd-go .arr, .gd-feat:hover .gd-go .arr { transform: translateX(5px); }

/* ---------- hub: featured guide ---------- */
.gd-feat-band { padding-top: var(--sec-y-tight); }
.gd-feat { --c: 40px; position: relative; isolation: isolate; display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr); text-decoration: none; color: var(--ink);
  background: var(--bg); box-shadow: inset 0 0 0 1px var(--line);
  clip-path: polygon(0 0, calc(100% - var(--c)) 0, 100% var(--c), 100% 100%, var(--c) 100%, 0 calc(100% - var(--c))); transition: transform 240ms var(--ease); }
.gd-feat:hover { transform: translateY(-4px); }
.gd-feat::before { content: ""; position: absolute; z-index: 2; top: 12px; right: calc(var(--c) - 6px); width: 8px; height: 8px; background: var(--accent); pointer-events: none;
  box-shadow: 12px 12px 0 -1px color-mix(in srgb, var(--accent) 55%, transparent), 24px 24px 0 0 var(--accent); }
.gd-feat-img { display: grid; place-items: center; overflow: hidden; background: #0A1428; }
.gd-feat-img img { width: 100%; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; transition: transform 700ms var(--ease); }
.gd-feat:hover .gd-feat-img img { transform: scale(1.03); }
.gd-feat-tx { display: flex; flex-direction: column; gap: 16px; padding: clamp(28px, 3.4vw, 52px); }
.gd-feat-h { font-size: clamp(26px, 2.6vw, 38px); line-height: 1.1; letter-spacing: -.03em; }
.gd-feat-p { font-size: 17px; line-height: 1.6; color: var(--ink-2); }
.gd-feat .gd-card-f { margin-top: auto; }

/* topic chips (filter) */
.gd-filter { display: flex; flex-wrap: wrap; gap: 8px; margin: calc(var(--head-gap) * -.4) 0 var(--sp-6); }
.gd-filter[hidden] { display: none; }
.gd-filter button { padding: 10px 16px; font: 700 13.5px/1 var(--f-head); letter-spacing: .02em; color: var(--ink-2); background: var(--surface); border: 0; cursor: pointer; box-shadow: inset 0 0 0 1px var(--line-2);
  clip-path: polygon(7px 0, 100% 0, 100% calc(100% - 7px), calc(100% - 7px) 100%, 0 100%, 0 7px); transition: background-color 100ms var(--ease), color 100ms var(--ease); }
.gd-filter button:hover { color: var(--ink); background: color-mix(in srgb, var(--accent) 8%, var(--surface)); }
.gd-filter button[aria-pressed="true"] { color: #fff; background: var(--ink); box-shadow: none; }
[data-theme="dark"] .gd-filter button[aria-pressed="true"] { color: var(--bg); background: var(--accent); }

/* navy band rotation: cards keep their own surface */
.sx-navy .gd-card { background: var(--win); }

/* ---------- responsive ---------- */
@media (max-width: 1100px) {
  .gd-cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 980px) {
  .gd-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .gd-toc { position: static; }
  .gd-toc-box { --c: 12px; padding: 16px 18px; background: var(--bg); box-shadow: inset 0 0 0 1px var(--line); clip-path: polygon(0 0, calc(100% - var(--c)) 0, 100% var(--c), 100% 100%, 0 100%); }
  .gd-toc-box summary { margin-bottom: 0; cursor: pointer; }
  .gd-toc-box summary::after { content: "+"; margin-left: auto; font-size: 18px; letter-spacing: 0; color: var(--accent-ink); }
  .gd-toc-box[open] summary { margin-bottom: 10px; }
  .gd-toc-box[open] summary::after { content: "\2212"; }
  .gd-feat { grid-template-columns: minmax(0, 1fr); }
  .gd-feat-img { aspect-ratio: 1200 / 630; }
}
@media (max-width: 680px) {
  .gd-cards, .gd-cards.two, .gd-svc.two { grid-template-columns: minmax(0, 1fr); }
  .gd-prose p, .gd-prose li { font-size: 17px; }
  .gd-prose h2 { margin-top: 52px; }
  .gd-answer { padding: 18px 18px 18px 20px; }
  .gd-author { grid-template-columns: minmax(0, 1fr); gap: 18px; padding: 24px 20px; }
  .gd-author-ph { width: 96px; }
  .gd-feat-img { display: none; }   /* the cover repeats the title on a phone: the text card alone reads better */
  .gd-card { padding: 26px 22px 22px; }
}
@media (prefers-reduced-motion: reduce) {
  .gd-card, .gd-feat, .gd-feat-img img { transition: none; }
  .gd-card:hover, .gd-feat:hover { transform: none; }
}
