/* System Tutorials — a "workshop manual" look: ink navy, paper ground, one green "go" colour. */
:root {
  --paper: #f7f5ef;
  --surface: #ffffff;
  --ink: #14213d;
  --ink-2: #3d4a66;
  --muted: #5f6a80;
  --rule: #e3dfd3;
  --go: #12895a;
  --go-ink: #ffffff;
  --go-soft: #e3f4ec;
  --mark: #fff2c2;
  --link: #1d4ed8;
  --shadow: 0 1px 2px rgba(20, 33, 61, .06), 0 4px 16px rgba(20, 33, 61, .06);
  --head: "Bricolage Grotesque", ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --body: ui-sans-serif, system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
  --mono: ui-monospace, "Cascadia Code", Consolas, monospace;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root {
    --paper: #0f1626;
    --surface: #162036;
    --ink: #eef1f7;
    --ink-2: #c4cbdb;
    --muted: #97a1b6;
    --rule: #26324c;
    --go: #2fc489;
    --go-ink: #07261a;
    --go-soft: #133628;
    --mark: #3a3214;
    --link: #8fb0ff;
    --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 4px 16px rgba(0, 0, 0, .25);
    color-scheme: dark;
  }
}

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-padding-top: 5rem; }
body { margin: 0; background: var(--paper); color: var(--ink); font: 17px/1.65 var(--body); }
img { max-width: 100%; height: auto; }
a { color: var(--link); text-underline-offset: .18em; }
h1, h2, h3 { font-family: var(--head); line-height: 1.15; text-wrap: balance; color: var(--ink); }
h1 { font-size: clamp(2rem, 4.5vw, 3rem); font-weight: 800; letter-spacing: -.02em; margin: 0 0 .75rem; }
h2 { font-size: 1.55rem; font-weight: 800; letter-spacing: -.01em; margin: 2.4rem 0 .75rem; }
h3 { font-size: 1.15rem; font-weight: 600; margin: 1.6rem 0 .4rem; }
[hidden] { display: none !important; }

.wrap { max-width: 72rem; margin: 0 auto; padding-inline: 1rem; }
.wrap.article { max-width: 82rem; }
@media (min-width: 40rem) { .wrap { padding-inline: 1.5rem; } }

.skip { position: absolute; left: -999px; top: 0; background: var(--ink); color: var(--paper); padding: .5rem 1rem; z-index: 10; }
.skip:focus { left: 1rem; }

/* Header */
.masthead { position: sticky; top: 0; z-index: 5; background: color-mix(in srgb, var(--paper) 92%, transparent); backdrop-filter: blur(8px); border-bottom: 1px solid var(--rule); }
.masthead-row { display: flex; align-items: center; justify-content: space-between; gap: 1rem; min-height: 3.75rem; }
.brand { display: flex; align-items: center; gap: .5rem; color: var(--ink); text-decoration: none; font-family: var(--head); font-size: 1.2rem; font-weight: 600; }
.brand b { font-weight: 800; }
.brand-mark { width: 1.6rem; height: 1.6rem; fill: var(--ink); }
.brand-mark rect:last-child { fill: var(--go); }
.masthead-nav { display: flex; align-items: center; gap: .75rem; }
.lang { position: relative; }
.lang summary { list-style: none; cursor: pointer; font-size: .85rem; font-weight: 600; letter-spacing: .04em; text-transform: uppercase; padding: .35rem .6rem; border: 1px solid var(--rule); border-radius: .4rem; }
.lang summary::-webkit-details-marker { display: none; }
.lang summary { display: flex; align-items: center; gap: .35rem; }
.globe { width: 1.05rem; height: 1.05rem; fill: none; stroke: currentColor; stroke-width: 1.6; }
.coming-soon { margin: 2rem 0 1rem; font-size: 1.1rem; color: var(--ink-2); }
.lang ul { position: absolute; right: 0; top: calc(100% + .4rem); margin: 0; padding: .4rem; list-style: none; background: var(--surface); border: 1px solid var(--rule); border-radius: .5rem; box-shadow: var(--shadow); min-width: 11rem; }
.lang a { display: block; padding: .35rem .6rem; border-radius: .3rem; color: var(--ink); text-decoration: none; font-size: .95rem; }
.lang a:hover, .lang a[aria-current] { background: var(--go-soft); }

/* Buttons */
.btn { display: inline-block; font-weight: 700; text-decoration: none; border-radius: .5rem; padding: .75rem 1.2rem; line-height: 1.2; }
.btn-go { background: var(--go); color: var(--go-ink); }
.btn-go:hover { filter: brightness(1.08); }
.btn-sm { padding: .45rem .8rem; font-size: .9rem; }
@media (max-width: 30rem) { .masthead .btn-sm { display: none; } }

/* Home */
.hero { border-bottom: 1px solid var(--rule); background:
  linear-gradient(var(--rule) 1px, transparent 1px) 0 0 / 100% 2rem, var(--paper); }
.hero-grid { display: grid; gap: 2rem; padding-block: 3rem; align-items: center; }
@media (min-width: 56rem) { .hero-grid { grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr); padding-block: 4.5rem; } }
.lede { font-size: 1.15rem; color: var(--ink-2); max-width: 38rem; margin: 0 0 1.5rem; }
.search label { display: block; font-size: .8rem; font-weight: 700; letter-spacing: .06em; text-transform: uppercase; color: var(--muted); margin-bottom: .35rem; }
.search input { width: 100%; max-width: 30rem; font: inherit; padding: .8rem 1rem; border: 2px solid var(--ink); border-radius: .5rem; background: var(--surface); color: var(--ink); }
.search input:focus { outline: 3px solid var(--go); outline-offset: 2px; }
.hero-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: .6rem; }
.hero-steps li { display: flex; align-items: center; gap: .75rem; background: var(--surface); border: 1px solid var(--rule); border-radius: .6rem; padding: .7rem .9rem; font-weight: 600; box-shadow: var(--shadow); }
.hero-steps b, .step-num { display: inline-grid; place-items: center; width: 1.9rem; height: 1.9rem; flex: none; border-radius: 50%; background: var(--ink); color: var(--paper); font-family: var(--head); font-size: .95rem; }
.hero-steps li:last-child b { background: var(--go); color: var(--go-ink); }

.home-sections { padding-block: 1rem 4rem; }
.group h2 { display: flex; align-items: center; gap: .75rem; }
.no-results { color: var(--muted); padding: 2rem 0; }

/* Cards */
.cards { list-style: none; margin: 0; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fill, minmax(min(100%, 19rem), 1fr)); }
.card a { display: flex; flex-direction: column; gap: .35rem; height: 100%; padding: 1.1rem 1.2rem; background: var(--surface); border: 1px solid var(--rule); border-radius: .7rem; color: var(--ink); text-decoration: none; transition: border-color .15s, transform .15s; }
.card a:hover { border-color: var(--ink); transform: translateY(-2px); }
.card-img { display: block; width: calc(100% + 2.4rem); max-width: none; height: auto; aspect-ratio: 1200 / 630; object-fit: cover; margin: -1.1rem -1.2rem .5rem; border-radius: .7rem .7rem 0 0; }
.card-kicker { font-size: .75rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--go); }
.card-title { font-family: var(--head); font-weight: 600; font-size: 1.1rem; line-height: 1.3; }
.card-desc { font-size: .93rem; color: var(--ink-2); }
.card-meta { margin-top: auto; padding-top: .4rem; font-size: .8rem; color: var(--muted); }

/* Article */
.article { padding-block: 1.5rem 4rem; }
.crumbs { font-size: .85rem; color: var(--muted); }
.crumbs a { color: var(--muted); }
.article-head { max-width: 48rem; margin: 1.5rem 0; }
.kicker { margin: 0 0 .5rem; font-size: .8rem; font-weight: 700; letter-spacing: .08em; text-transform: uppercase; color: var(--go); }
.byline { margin: 0; color: var(--muted); font-size: .95rem; }
.byline a { color: var(--ink); font-weight: 600; }
.stamp { display: inline-flex; align-items: center; gap: .4rem; margin: .9rem 0 0; padding: .3rem .7rem; border: 1.5px dashed var(--go); border-radius: 2rem; color: var(--go); font-size: .82rem; font-weight: 700; letter-spacing: .03em; text-transform: uppercase; }
.stamp svg { width: 1rem; height: 1rem; fill: currentColor; }

.answer { max-width: 48rem; background: var(--surface); border: 2px solid var(--ink); border-radius: .8rem; padding: 1.2rem 1.4rem; box-shadow: 6px 6px 0 var(--go); }
.answer h2, .facts h2 { margin: 0 0 .4rem; font-size: .8rem; letter-spacing: .1em; text-transform: uppercase; font-family: var(--body); font-weight: 800; color: var(--muted); }
.answer p { margin: 0; font-size: 1.1rem; }

.facts { max-width: 48rem; margin-top: 1.5rem; }
.facts dl { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 11rem), 1fr)); gap: 1px; margin: 0; background: var(--rule); border: 1px solid var(--rule); border-radius: .7rem; overflow: hidden; }
.facts dl > div { background: var(--surface); padding: .75rem .9rem; }
.facts dt { font-size: .78rem; color: var(--muted); text-transform: uppercase; letter-spacing: .05em; font-weight: 700; }
.facts dd { margin: .15rem 0 0; font-family: var(--head); font-weight: 600; font-size: 1.1rem; font-variant-numeric: tabular-nums; }

.article-grid { display: grid; gap: 2.2rem; margin-top: 2rem; position: relative; }
.sidebar-col { position: relative; align-self: stretch; height: 100%; min-width: 0; }
.sidebar-sticky { position: sticky; top: 5.5rem; z-index: 4; }

/* Desktop 3-column layout (wide screens >= 64rem / 1024px) */
@media (min-width: 64rem) {
  .article-grid { grid-template-columns: 13rem minmax(0, 1fr) 19.5rem; }
  .toc-col { position: relative; height: 100%; }
  .toc { position: sticky; top: 5.5rem; }
}

/* Medium screens (48rem to 63.99rem / 768px to 1023px) - Keep widget sticky on right, collapse TOC */
@media (min-width: 48rem) and (max-width: 63.99rem) {
  .article-grid { grid-template-columns: minmax(0, 1fr) 19rem; }
  .toc-col { display: none; }
}

/* Mobile & narrow viewports (< 48rem / 768px) */
@media (max-width: 47.99rem) {
  .article-grid { grid-template-columns: 1fr; }
  .toc-col { position: static; }
  .sidebar-col { grid-column: 1 / -1; margin-top: 3.5rem; margin-bottom: 2.5rem; padding-top: 2rem; border-top: 1px solid var(--rule); }
  .sidebar-sticky { position: static; }
}
.toc { border-left: 3px solid var(--ink); padding-left: 1rem; font-size: .93rem; }
.toc summary { cursor: pointer; font-weight: 800; font-size: .8rem; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); }
.toc ol { margin: .6rem 0 0; padding-left: 1.2rem; display: grid; gap: .35rem; }
.toc a { color: var(--ink-2); text-decoration: none; }
.toc a:hover { color: var(--ink); text-decoration: underline; }

.prose { min-width: 0; }
.prose > h2:first-of-type { margin-top: 1rem; }
.prose h2 { padding-top: .2rem; border-top: 1px solid var(--rule); padding-top: 1.6rem; }
.prose ol { counter-reset: step; list-style: none; padding-left: 0; }
.prose ol > li { counter-increment: step; position: relative; padding-left: 2.6rem; margin: .7rem 0; }
.prose ol > li::before { content: counter(step); position: absolute; left: 0; top: .05rem; width: 1.8rem; height: 1.8rem; display: grid; place-items: center; border-radius: 50%; background: var(--ink); color: var(--paper); font: 700 .9rem/1 var(--head); }
.prose ul { padding-left: 1.2rem; }
.prose li { margin: .35rem 0; }
.prose strong { background: linear-gradient(transparent 60%, var(--mark) 60%); }
.prose code { font-family: var(--mono); font-size: .9em; background: var(--surface); border: 1px solid var(--rule); border-radius: .3rem; padding: .05rem .3rem; }
.disclosure { font-size: .85rem; color: var(--muted); border-left: 3px solid var(--rule); padding-left: .8rem; }

.table-wrap { overflow-x: auto; margin: 1.2rem 0; border: 1px solid var(--rule); border-radius: .6rem; background: var(--surface); }
.table-wrap table { width: 100%; border-collapse: collapse; font-size: .95rem; font-variant-numeric: tabular-nums; }
.table-wrap th, .table-wrap td { padding: .6rem .9rem; text-align: left; border-bottom: 1px solid var(--rule); }
.table-wrap th { background: var(--ink); color: var(--paper); font-weight: 700; }
.table-wrap tr:last-child td { border-bottom: 0; }

.cta { margin: 2.5rem 0; padding: 1.4rem 1.5rem; background: var(--go-soft); border: 1px solid var(--go); border-radius: .8rem; }
.cta-title { margin: 0; font-family: var(--head); font-size: 1.3rem; font-weight: 800; }
.cta p { margin: .3rem 0 1rem; }

/* PLR sidebar offer: fixed gold slab, same in both themes so it stands out on light and dark pages */
.plr { --p-gold: #ffc53d; --p-ink: #1c1a52; --p-ink-2: #3a3570; --p-ink-3: #4b4580; --p-tint: rgba(28, 26, 82, .1);
  margin: 2.2rem 0 0; padding: 0 1.15rem 1.1rem; border-radius: 1.1rem; background: var(--p-gold); color: var(--p-ink);
  box-shadow: 0 18px 40px -22px rgba(28, 26, 82, .55); }
.plr svg { flex: none; width: 1em; height: 1em; }
.plr-media { position: relative; margin: -2.2rem -.4rem .9rem; }
.plr-media img { display: block; width: 100%; height: auto; transform: rotate(-3deg); filter: drop-shadow(0 12px 14px rgba(28, 26, 82, .35)); }
.plr-tag { position: absolute; left: 50%; bottom: -.55rem; transform: translateX(-50%) rotate(-3deg); display: inline-flex; align-items: center; gap: .35rem; white-space: nowrap;
  padding: .32rem .7rem; border-radius: .5rem; background: var(--p-ink); color: var(--p-gold); font-family: var(--head); font-size: .82rem; font-weight: 800; }
.plr-tag svg { font-size: 1.05rem; }
.plr .plr-title { margin: 1.1rem 0 .7rem; font-family: var(--head); font-size: 1.2rem; font-weight: 800; line-height: 1.2; text-wrap: balance; color: var(--p-ink); }
.plr ul { list-style: none; margin: 0; padding: 0; }
.plr-gains { display: grid; gap: .5rem; }
.plr-gains li { display: flex; align-items: center; gap: .6rem; margin: 0; font-size: .88rem; line-height: 1.3; color: var(--p-ink-2); }
.plr-gains strong { color: var(--p-ink); background: none; font-weight: 700; }
.plr-ic { flex: none; display: grid; place-items: center; width: 1.85rem; height: 1.85rem; border-radius: .5rem; background: var(--p-tint); color: var(--p-ink); font-size: 1.05rem; }
.plr-inside { display: flex; flex-wrap: wrap; gap: .35rem; margin: .8rem 0 .85rem !important; }
.plr-inside li { display: inline-flex; align-items: center; gap: .3rem; margin: 0; padding: .2rem .5rem; border-radius: .4rem; background: rgba(28, 26, 82, .07); color: var(--p-ink-2); font-size: .76rem; line-height: 1.3; }
.plr .plr-price { display: flex; flex-wrap: wrap; align-items: baseline; gap: 0 .45rem; margin: 0; color: var(--p-ink-2); font-size: .8rem; }
.plr-price svg { align-self: center; font-size: 1.15rem; color: var(--p-ink); }
.plr-price s { color: var(--p-ink-3); font-family: var(--head); font-size: 1rem; font-weight: 700; text-decoration-thickness: 2px; }
.plr-price strong { color: var(--p-ink); background: none; font-family: var(--head); font-size: 1.45rem; font-weight: 800; line-height: 1.1; }
.plr-sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.plr-btn { display: flex; align-items: center; justify-content: center; gap: .5rem; min-height: 2.9rem; margin-top: .7rem; padding: .7rem 1rem; border-radius: .7rem;
  background: var(--p-ink); color: var(--p-gold) !important; font-family: var(--head); font-size: 1rem; font-weight: 800; text-decoration: none; cursor: pointer; transition: transform .15s ease, box-shadow .15s ease; }
.plr-btn svg { font-size: 1.2rem; transition: transform .15s ease; }
.plr-btn:hover { transform: translateY(-2px); box-shadow: 0 10px 20px -10px rgba(28, 26, 82, .8); }
.plr-btn:hover svg { transform: translateX(4px); }
.plr-btn:focus-visible { outline: 3px solid var(--p-ink); outline-offset: 3px; }
.plr .plr-foot { margin: .55rem 0 0; font-size: .74rem; line-height: 1.4; text-align: center; color: var(--p-ink-3); }
@media (prefers-reduced-motion: reduce) { .plr-btn, .plr-btn svg { transition: none; } .plr-btn:hover, .plr-btn:hover svg { transform: none; } }
/* end offer */

.faq-item { border-bottom: 1px solid var(--rule); padding-bottom: .4rem; }
.faq-item h3 { margin-top: 1.2rem; }
.faq-item p { margin: .2rem 0 .6rem; }

.sources ol { font-size: .93rem; }
.sources span { color: var(--muted); }

.related { margin-top: 3rem; padding-top: 1rem; border-top: 2px solid var(--ink); }

/* Video: thumbnail first, player on click */
.video { margin: 2rem 0; }
.video-play, .video iframe { position: relative; display: block; width: 100%; aspect-ratio: 16 / 9; border: 0; border-radius: .7rem; overflow: hidden; background: #000; box-shadow: var(--shadow); }
.video-play img { width: 100%; height: 100%; object-fit: cover; opacity: .92; transition: transform .3s, opacity .3s; }
.video-play:hover img { transform: scale(1.03); opacity: 1; }
.video-btn { position: absolute; left: 50%; top: 50%; width: 4.2rem; height: 3rem; margin: -1.5rem 0 0 -2.1rem; border-radius: .9rem; background: var(--go); box-shadow: 0 4px 14px rgba(0, 0, 0, .35); }
.video-btn::after { content: ""; position: absolute; left: 50%; top: 50%; margin: -.6rem 0 0 -.35rem; border-style: solid; border-width: .6rem 0 .6rem 1rem; border-color: transparent transparent transparent var(--go-ink); }
.video figcaption { display: grid; gap: .2rem; margin-top: .7rem; font-size: .93rem; }
.video-label { font-size: .75rem; font-weight: 700; letter-spacing: .07em; text-transform: uppercase; color: var(--go); }
.video-note { margin-top: .4rem; padding: .6rem .8rem; background: var(--surface); border: 1px dashed var(--rule); border-radius: .5rem; color: var(--ink-2); font-size: .88rem; }

/* Footer */
.footer { border-top: 1px solid var(--rule); background: var(--surface); font-size: .9rem; color: var(--ink-2); }
.footer-grid { display: grid; gap: 1rem; padding-block: 2rem; }
@media (min-width: 48rem) { .footer-grid { grid-template-columns: 1fr 1.6fr; } .footer-links { grid-column: 1 / -1; } }
.footer p { margin: 0; }
.footer a { color: var(--ink-2); }

.cover { max-width: 48rem; margin: 0 0 1.5rem; }
.cover img { display: block; width: 100%; height: auto; border-radius: .8rem; border: 2px solid var(--ink); }
