/* Shared colour and typography tokens. */
:root {
    --ink: #202638;
    --muted: #535f72;
    --brand-navy: #1d2669;
    --brand-red: #7e0000;
    --link: #293e90;
    --line: #d9dee8;
    --pale: #eff2f8;
    --paper: #f8f9fc;
    --code-bg: #182134;
    --header-height: 4.9rem;
    --nav-gap: 1rem;
    --reading-inset: clamp(1.2rem, 2.5vw, 2.5rem);
    --heading-face: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    --display-weight: 650;
    --display-tracking: -.032em;
    --mono: Consolas, Monaco, 'Andale Mono', 'Ubuntu Mono', monospace;
    --bs-body-font-family: Roboto, "Helvetica Neue Light", "Helvetica Neue", Helvetica, Arial, "Lucida Grande", sans-serif;
    --bs-body-font-size: .9375rem;
    --bs-body-color: var(--ink);
    --bs-link-color: var(--link);
    --bs-font-monospace: var(--mono);
}
h1, h2, h3, h4, h5, h6 { font-family: var(--heading-face); font-style: normal; }
html { scroll-padding-top: calc(var(--header-height) + var(--nav-gap)); scrollbar-gutter: stable; }
html:has(.site-menu[open]) { overflow: hidden; }
body { padding-top: var(--header-height); background: var(--paper); color: var(--ink); }
a { color: var(--link); text-underline-offset: .19em; }
a:hover { color: var(--brand-navy); }
:focus-visible { outline: 3px solid var(--link); outline-offset: 3px; }
main:focus { outline: none; }
img { max-width: 100%; height: auto; }
.shell, .flex-container { width: min(100% - 3rem, 87rem); margin-inline: auto; }
.skip-link { position: fixed; left: 1rem; top: .5rem; padding: .75rem; background: white; z-index: 1031; }
.skip-link:not(:focus) { clip-path: inset(50%); width: 1px; height: 1px; overflow: hidden; }
.site-header { position: fixed; inset: 0 0 auto; z-index: 1030; height: var(--header-height); background: white; border-top: 2px solid var(--brand-navy); border-bottom: 1px solid var(--line); box-shadow: 0 2px 8px rgb(26 41 70 / 5%); }
.header-inner, .footer-inner, .site-links, .site-brand { display: flex; align-items: center; }
.header-inner { height: 100%; justify-content: space-between; gap: 1rem; }
.header-brand { display: flex; align-items: center; gap: 1rem; }
.menu-trigger, .menu-close {
    display: grid; place-items: center; flex: none; width: 44px; height: 44px;
    color: var(--brand-navy); border: 1px solid var(--line); border-radius: .45rem; background: white;
}
.menu-trigger:hover, .menu-close:hover { background: var(--pale); border-color: #a4afcb; }
.menu-icon { display: block; width: 18px; height: 14px; border-block: 2px solid currentColor; }
.menu-icon::after { content: ''; display: block; margin-top: 4px; border-top: 2px solid currentColor; }
.site-brand { display: inline-flex; flex-shrink: 0; padding-block: .25rem; }
.site-brand img { display: block; width: 150px; height: auto; }
.site-links { gap: clamp(.85rem, 3vw, 2.25rem); }
.site-links a { display: inline-flex; align-items: center; min-height: 44px; font-size: .95rem; font-weight: 600; text-decoration: none; color: var(--ink); }
.site-links a:hover, .site-footer a:hover { text-decoration: underline; }
.site-footer { background: #fff; border-top: 1px solid var(--line); margin-top: 3.5rem; }
.footer-inner { justify-content: space-between; flex-wrap: wrap; gap: 1rem; padding-block: 2rem; }
.footer-inner > div { display: flex; align-items: center; gap: 1.4rem; color: var(--muted); font-size: .83rem; }
.footer-inner > div a { color: inherit; }
.footer-inner .site-brand img { width: 120px; }

/* The native modal manages focus, keyboard dismissal and background interaction. */
.site-menu {
    position: fixed; inset: 0 auto 0 0; width: min(21rem, calc(100% - 1.5rem)); max-width: none;
    height: 100%; height: 100dvh; max-height: none; margin: 0; padding: 0; border: 0;
    background: white; color: var(--ink); box-shadow: 6px 0 32px rgb(15 24 54 / 14%);
}
.site-menu[open] { display: flex; flex-direction: column; }
.site-menu::backdrop { background: rgb(20 29 49 / 45%); }
.drawer-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; flex: none; padding: .7rem 1.15rem; min-height: var(--header-height); border-top: 2px solid var(--brand-navy); border-bottom: 1px solid var(--line); }
.drawer-heading h2 { margin: 0; font-size: 1.2rem; color: var(--brand-navy); font-weight: 700; }
.menu-close { font: 1.65rem/1 var(--bs-body-font-family); }
.drawer-body { min-height: 0; overflow-y: auto; overscroll-behavior: contain; padding: 1rem 1.15rem max(1rem, env(safe-area-inset-bottom)); }
.drawer-shortcuts { display: grid; grid-template-columns: 1fr 1fr; gap: .5rem; margin-bottom: 1.25rem; }
.drawer-shortcuts a { display: grid; place-items: center; min-height: 44px; border: 1px solid var(--line); border-radius: .4rem; color: var(--brand-navy); font-size: .88rem; font-weight: 600; text-decoration: none; }
.drawer-shortcuts a:hover, .drawer-languages a:hover { background: var(--pale); }
.drawer-languages h3, .drawer-lessons > h3 { margin: 0 0 .6rem; color: var(--brand-navy); font-size: 1rem; font-weight: 700; }
.drawer-lessons { padding-bottom: 1rem; margin-bottom: 1.1rem; border-bottom: 1px solid var(--line); }
.drawer-languages a { display: flex; align-items: center; gap: .8rem; min-height: 44px; padding: .4rem .6rem; border-radius: .35rem; color: var(--ink); font-size: .94rem; text-decoration: none; }
.drawer-languages img { width: 24px; height: 24px; object-fit: contain; }
.drawer-languages a[aria-current] { background: #eef1fa; color: var(--brand-navy); font-weight: 700; }

.hero { border-bottom: 1px solid var(--line); background: linear-gradient(100deg, #fff 20%, #f0f3fa); }
.hero-inner { display: grid; grid-template-columns: repeat(2, minmax(0,1fr)); align-items: center; gap: clamp(2rem, 5vw, 5rem); padding-block: clamp(2.5rem, 4vw, 4rem); }
.hero h1 { margin: 0; font-size: clamp(2.2rem, 3.8vw, 3.45rem); line-height: 1.08; font-weight: 700; letter-spacing: -.032em; color: var(--brand-navy); }
.hero p { max-width: 33rem; margin: 1rem 0 1.45rem; font-size: clamp(1rem, 1.3vw, 1.14rem); line-height: 1.6; color: var(--muted); }
.btn-primary, .btn-info {
    --bs-btn-color: white; --bs-btn-bg: var(--brand-navy); --bs-btn-border-color: var(--brand-navy);
    --bs-btn-hover-color: white; --bs-btn-hover-bg: var(--link); --bs-btn-hover-border-color: var(--link);
    --bs-btn-active-color: white; --bs-btn-active-bg: var(--brand-navy); --bs-btn-active-border-color: var(--brand-navy);
    border-radius: .5rem; padding: .72rem 1.1rem; font-size: .93rem; font-weight: 600;
}
.hero .btn span { display: inline-block; padding-left: 1.2rem; }
.editor { width: 100%; max-width: 33rem; justify-self: end; background: var(--code-bg); color: #edf0f6; border-radius: .5rem; border: 1px solid #ccd3e0; box-shadow: 0 5px 16px rgb(28 41 77 / 7%); margin: 0; overflow: hidden; font: .87rem/1.65 var(--mono); }
.editor figcaption { display: flex; align-items: center; justify-content: space-between; gap: .6rem; min-height: 2.85rem; padding: 0 1rem; background: #fff; color: var(--ink); font-size: .8rem; }
.editor-file { display: inline-flex; align-items: center; gap: .6rem; align-self: stretch; border-bottom: 2px solid var(--brand-red); }
.editor-file img { width: 22px; height: 22px; }
.editor figcaption a { display: inline-flex; align-items: center; gap: .4rem; min-height: 44px; font: 600 .8rem var(--bs-body-font-family); text-decoration: none; }
.editor figcaption a:hover { text-decoration: underline; }
.editor pre { counter-reset: lines; margin: 0; padding: 1.1rem 1rem; color: inherit; font: inherit; }
.editor pre span::before { counter-increment: lines; content: counter(lines); display: inline-block; width: 1.6rem; color: #a6b1c6; user-select: none; }
.editor pre b { color: #c4bcff; font-weight: 500; }
.editor pre i { color: #a6d6ff; font-style: normal; }
.editor pre strong { color: #f2cf8e; font-weight: 500; }
.editor-output { display: flex; align-items: center; gap: 1rem; padding: .85rem 1rem; border-top: 1px solid #364259; background: #222d40; }
.editor-output small { color: #c3ccdc; font-size: .62rem; text-transform: uppercase; letter-spacing: .12em; }
.editor-output i { font-style: normal; color: #a6d6ff; }
.home-sections { padding-block: 2.5rem 0; }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 1rem; margin-bottom: 1.3rem; }
.section-heading h2 { margin: 0; color: var(--brand-navy); font-size: clamp(1.5rem, 2.3vw, 2rem); font-weight: 700; letter-spacing: -.022em; }
.filter-control { display: flex; align-items: center; gap: .6rem; background: white; border: 1px solid #bbc5d5; border-radius: .5rem; padding: 0 .8rem; }
.filter-control:focus-within { outline: 2px solid var(--link); }
.filter-control input { background: transparent; border: 0; width: 10.5rem; max-width: 100%; min-width: 0; min-height: 42px; outline: 0; font-size: .88rem; }
.search-icon { width: .8rem; height: .8rem; position: relative; border: 1.5px solid var(--muted); border-radius: 50%; flex: none; }
.search-icon::after { content: ''; position: absolute; width: .35rem; height: 1.5px; background: var(--muted); right: -.25rem; bottom: -.07rem; transform: rotate(45deg); }
.filter-status { margin: 0; color: var(--muted); }
.language-card, .example-card, .showcase-main-container .item { background: white; border: 1px solid var(--line); border-radius: .5rem; }
.language-card { height: 100%; display: flex; align-items: center; gap: 1rem; color: var(--ink); text-decoration: none; padding: 1.25rem; }
.language-card:hover, .example-card:hover, .showcase-main-container .item:hover { border-color: #939fc3; background: #fafbff; color: var(--link); }
.language-logo { display: grid; place-items: center; width: 3.6rem; height: 3.6rem; flex-shrink: 0; background: #f6f7fb; border-radius: .55rem; }
.language-logo img { width: 2.15rem; mix-blend-mode: multiply; }
.language-card strong, .language-card small { display: block; }
.language-card strong { color: var(--brand-navy); font-size: 1.1rem; font-weight: 700; }
.language-card small { font-size: .84rem; color: var(--muted); }
.card-arrow { margin-left: auto; color: #687590; font-size: 1.4rem; line-height: 1; }
.example-card { display: flex; flex-direction: column; text-decoration: none; color: var(--ink); height: 100%; overflow: hidden; }
.example-card small { padding: 1.1rem 1.25rem 0; color: var(--muted); font-weight: 600; }
.example-card code { color: var(--link); font: 500 clamp(1.4rem, 3vw, 2.3rem) var(--mono); padding: .7rem 1.25rem 1.3rem; }
.example-card strong { border-top: 1px solid var(--line); padding: .9rem 1.25rem; display: flex; justify-content: space-between; }
.ad-space { background: #f6f7f9; border: 1px solid #dce0e6; border-radius: .5rem; width: 100%; min-width: 0; }
.ad-label { display: block; text-align: center; font: .65rem/1.4 var(--mono); color: #5b6576; text-transform: uppercase; letter-spacing: .12em; padding: .5rem .25rem; }
.ad-banner { min-height: 116px; margin-block: 1.75rem; }
.ad-rail { min-height: 280px; }
.home-sections > .ad-banner { margin-block: 2.5rem; }

/* Tutorial indexes, lesson navigation and reading surface */
.flex-container { --lesson-sidebar-width: clamp(13rem, 17vw, 15rem); --lesson-gap: 1.75rem; padding-block: 2rem 0; display: flex; align-items: flex-start; gap: var(--lesson-gap); }
.main { min-width: 0; flex: 1; }
.main > .body { display: grid; grid-template-columns: minmax(0, 1fr) minmax(15rem, 18rem); align-items: start; gap: 1.75rem; }
.main main, .policy-page { min-width: 0; padding: var(--reading-inset); border-radius: .5rem; background: white; border: 1px solid var(--line); border-top: 3px solid var(--brand-navy); overflow-wrap: anywhere; }
.main main h1, .policy-page h1 { margin: .8rem 0 .75rem; color: var(--brand-navy); font-size: clamp(1.8rem, 2.7vw, 2.55rem); font-weight: 700; letter-spacing: -.025em; line-height: 1.16; }
.main main h2, .policy-page h2 { font-size: clamp(1.23rem, 2vw, 1.6rem); margin: 2rem 0 .9rem; font-weight: 700; letter-spacing: -.015em; }
.main main h3 { font-size: clamp(1.16rem, 1.8vw, 1.45rem); margin: 1.6rem 0 .75rem; letter-spacing: -.01em; }
.main main h4 { font-size: 1rem; font-weight: 650; }
.main main p, .policy-page p { line-height: 1.72; }
.trail { display: flex; gap: .55rem; align-items: center; flex-wrap: wrap; color: #697589; font-size: .85rem; }
.trail a { color: #535f72; text-decoration: none; }
.trail a:hover, .topic-links a:hover { text-decoration: underline; }
.side-nav {
    flex: 0 0 var(--lesson-sidebar-width); min-width: 0; position: sticky;
    top: calc(var(--header-height) + var(--nav-gap)); background: white;
    border: 1px solid #cfd7e6; border-radius: .85rem; box-shadow: 0 8px 24px -12px rgb(26 40 82 / 22%);
}
.side-nav summary {
    display: flex; justify-content: space-between; align-items: center; min-height: 3.25rem;
    padding: .8rem .95rem; border-radius: .78rem; color: #fff; background: linear-gradient(105deg, #202952, #334379);
    font-size: 1rem; font-weight: 700; cursor: pointer; list-style: none;
}
.side-nav summary::-webkit-details-marker { display: none; }
.side-nav summary::after { content: ''; width: .48rem; height: .48rem; border-right: 2px solid; border-bottom: 2px solid; transform: rotate(45deg); }
.side-nav[open] summary { border-radius: .78rem .78rem 0 0; }
.side-nav[open] summary::after { transform: rotate(225deg); }
.side-nav nav {
    padding: .65rem .6rem; max-height: calc(100vh - var(--header-height) - 3.25rem - 2.25rem);
    max-height: min(calc(100dvh - var(--header-height) - 5.5rem), var(--article-room,100dvh));
    overflow-y: auto; overscroll-behavior: contain; scrollbar-gutter: stable; min-width: 0; border-radius: 0 0 .5rem .5rem;
    scrollbar-color: #7584a5 #f0f3f8;
}
.menu-tools {
    display: grid; gap: .7rem; padding: .85rem .85rem .65rem; flex: none; min-width: 0;
    border-bottom: 1px solid #d9dfeb; background: linear-gradient(180deg, #fff, #f6f8fc);
}
.menu-tools svg { display: block; width: 1.1rem; height: 1.1rem; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.menu-search {
    display: flex; align-items: center; gap: .6rem; padding-inline: .7rem .25rem; min-width: 0;
    background: #fff; border: 1px solid #bcc7da; border-radius: .55rem; box-shadow: 0 1px 2px rgb(25 40 80 / 5%);
}
.menu-search:focus-within { border-color: #5468a7; outline: 2px solid #a9b8e1; outline-offset: 1px; }
.menu-search input {
    flex: 1; width: 0; min-width: 0; height: 2.5rem; border: 0; padding: 0; outline: 0; box-shadow: none;
    background: transparent; font: inherit; font-size: .88rem; color: var(--ink); appearance: none;
}
.menu-search input::placeholder { color: #5b687f; opacity: 1; }
.menu-search input::-webkit-search-cancel-button { appearance: none; }
.menu-clear { display: grid; place-items: center; border: 0; background: transparent; border-radius: .35rem; color: #51617d; width: 1.9rem; height: 2rem; }
.menu-clear:hover { background: #edf0f7; color: var(--brand-navy); }
.menu-position { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: .35rem; }
.menu-count { display: grid; color: #25305a; line-height: 1.15; font-variant-numeric: tabular-nums; }
.menu-count-label { color: #586680; font-size: .66rem; font-weight: 650; letter-spacing: .07em; text-transform: uppercase; }
.menu-count strong { font-size: 1.08rem; font-weight: 700; letter-spacing: -.025em; }
.menu-count small { color: #53617b; font-size: .77rem; white-space: nowrap; }
.menu-steps {
    display: inline-flex; align-items: center; flex: none; gap: 2px; padding: 2px;
    background: #e9edf5; border: 1px solid #cbd4e4; border-radius: .65rem;
}
.menu-steps button {
    display: grid; place-items: center; padding: 0; width: 2.1rem; height: 1.95rem;
    background: #fff; color: #29396f; border: 0; border-radius: .44rem; box-shadow: 0 1px 3px rgb(39 54 94 / 15%);
}
.menu-steps button:hover:enabled, .menu-steps button:active:enabled { color: #fff; background: var(--brand-navy); }
.menu-steps button:disabled { color: #8591a8; background: transparent; box-shadow: none; }
.menu-steps button:focus-visible, .menu-clear:focus-visible { position: relative; z-index: 1; outline: 2px solid var(--link); outline-offset: 1px; }
.menu-track { height: 3px; position: relative; overflow: hidden; border-radius: 2rem; background: #dde3ef; }
.menu-track span { position: absolute; height: 100%; border-radius: inherit; background: #596daa; }
.menu-empty { margin: .2rem; padding: .75rem .5rem; color: var(--muted); font-size: .88rem; line-height: 1.5; }
.menu-clear[hidden], .menu-empty[hidden], .menu-filtered-out { display: none !important; }
.side-nav .menu-tools + nav {
    max-height: calc(100vh - var(--header-height) - 5.5rem - var(--menu-tools-height, 7.5rem));
    max-height: calc(min(100dvh - var(--header-height) - 5.5rem, var(--article-room,100dvh)) - var(--menu-tools-height,7.5rem));
}
.site-menu .menu-tools { padding-inline: 1.15rem; }
.site-menu .menu-search input { height: 2.75rem; font-size: 1rem; }
.site-menu .menu-steps button, .site-menu .menu-clear { width: 2.75rem; height: 2.75rem; }
/* Explicit scrollbar dimensions also expose the track on overlay-scrollbar systems. */
@supports selector(::-webkit-scrollbar) {
    .side-nav nav, .site-menu .drawer-body { scrollbar-color: auto; }
    :is(.side-nav nav, .drawer-body)::-webkit-scrollbar { width: .7rem; }
    :is(.side-nav nav, .drawer-body)::-webkit-scrollbar-track { background: #edf1f7; }
    :is(.side-nav nav, .drawer-body)::-webkit-scrollbar-thumb {
        border: 2px solid #edf1f7; border-radius: 1rem; background: #7786a3;
    }
    :is(.side-nav nav, .drawer-body)::-webkit-scrollbar-thumb:hover { background: #46587a; }
}
.side-nav nav:focus-visible, .drawer-body:focus-visible { outline-offset: -3px; }
.drawer-body { scrollbar-gutter: stable; scrollbar-color: #7584a5 #f0f3f8; }
.nav-overview {
    display: block; margin: 0 .18rem .65rem; padding: .55rem .55rem .7rem; border-bottom: 1px solid var(--line);
    color: var(--brand-navy); font-weight: 650; font-size: .92rem; text-decoration: none;
}
.nav-overview:hover, .nav-overview:focus-visible { text-decoration: underline; }
:is(.side-nav, .drawer-lessons) nav h3 { margin: 0; padding: .45rem .55rem .3rem; font-size: .82rem; line-height: 1.4; font-weight: 700; color: var(--muted); }
:is(.side-nav, .drawer-lessons) nav ul + h3 { border-top: 1px solid var(--line); padding-top: .85rem; margin-top: .55rem; }
:is(.side-nav, .drawer-lessons) nav ul,
:is(.side-nav, .drawer-lessons) nav li { min-width: 0; max-width: 100%; }
:is(.side-nav, .drawer-lessons) .nav-link { overflow-wrap: anywhere; white-space: normal; padding: .58rem .75rem; border-inline-start: 3px solid transparent; border-radius: .25rem; line-height: 1.4; color: var(--ink); font-size: .9rem; }
:is(.side-nav, .drawer-lessons) .nav-link:hover { color: var(--link); background: var(--pale); }
:is(.side-nav, .drawer-lessons) .nav-link.active { color: var(--brand-navy); background: #e9edf9; border-inline-start-color: var(--brand-navy); font-weight: 700; }
.drawer-lessons .nav-link { display: flex; align-items: center; min-height: 44px; }
.topic-links { background: white; border: 1px solid var(--line); padding: 1.1rem; border-radius: .5rem; margin-bottom: 1rem; }
.topic-links h2 { color: var(--brand-navy); font-size: 1.05rem; font-weight: 700; margin: 0 0 .7rem; }
.topic-links a { display: flex; justify-content: space-between; align-items: center; padding-block: .65rem; border-top: 1px solid var(--line); text-decoration: none; font-size: .9rem; }
.tutorial-rail { min-width: 0; }
.showcase-main-container { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 12rem),1fr)); gap: .8rem; }
.showcase-main-container .item { position: relative; display: flex; align-items: center; gap: .8rem; padding: 1rem; }
.showcase-main-container .logo img, .lang-logo img { width: 2.6rem; border: 0; padding: 0; }
.showcase-main-container .link a { color: var(--ink); font-weight: 600; text-decoration: none; }
.showcase-main-container .link a::after { content: ''; position: absolute; inset: 0; }
.showcase-container { margin-top: 1.5rem; background: var(--pale); padding: 1rem; border-radius: .65rem; }
.showcase-information { display: flex; align-items: center; gap: .8rem; flex-wrap: wrap; margin: 0 0 1rem; }
.showcase-information p { margin: 0; font-weight: 600; }
.showcase-information .btn { margin-left: auto; }
.highlight-text { font-weight: 600; color: var(--brand-navy); }
.error-text, .mandatory-text { color: #953a2f; }
.showcase-sourcecode { min-width: 0; }
pre[class*="language-"], code[class*="language-"] { text-shadow: none; color: #edf0f6; font: .89rem/1.65 var(--mono); white-space: pre; }
pre[class*="language-"] { background: var(--code-bg); padding: 1.1rem; border-radius: .5rem; margin: .55rem 0 1rem; overflow: auto; max-width: 100%; }
pre[class*="language-"] code { background: none; }
.token.comment, .token.prolog, .token.doctype, .token.cdata { color: #afbbce; }
.token.punctuation, .token.operator { color: #e2e7ef; background: none; }
.token.keyword, .token.atrule, .token.attr-value { color: #d0c8ff; }
.token.string, .token.char, .token.attr-name, .token.selector { color: #f2cf8e; }
.token.function, .token.class-name, .token.builtin { color: #a6d6ff; }
.token.number, .token.boolean, .token.constant, .token.symbol, .token.property, .token.tag { color: #ffbe8e; }
.code-terminal-screen { background: #f1f4fa; border-left: 3px solid #6576aa; padding: .85rem 1rem; font: .9rem/1.6 var(--mono); overflow-x: auto; }
.code-snip-line { white-space: pre-wrap; overflow-wrap: anywhere; }
.margin-top-15 { margin-top: 1rem; }
.margin-top-25 { margin-top: 1.5rem; }
.table { display: block; width: 100%; overflow-x: auto; margin-block: 1rem; --bs-table-border-color: var(--line); }
.table th, .table td { font-size: .95rem; padding: .65rem .8rem; }
.table th { background: var(--pale); }
.rel-nav, .social-container { display: flex; gap: .65rem; align-items: center; flex-wrap: wrap; margin-block: 1.25rem; }
.rel-nav { justify-content: space-between; }
.rel-nav a { display: inline-flex; align-items: center; gap: .4rem; padding: .45rem .7rem; border-radius: .35rem; background: var(--pale); text-decoration: none; }
.rel-nav img { max-width: 1rem; }
.tags-container { margin-block-start: 1.5rem; padding-block-start: 1rem; border-top: 1px solid var(--line); }
.tags-container > cite { display: block; margin-bottom: .6rem; font-size: .9rem; font-style: normal; font-weight: 600; color: var(--ink); }
.tags-container .tags { display: flex; flex-wrap: wrap; gap: .45rem; margin: 0; padding: 0; list-style: none; }
.tags-container .tags > li {
    max-width: 100%; min-width: 0; padding: .25rem .7rem;
    border: 1px solid var(--line); border-radius: 1rem; background: var(--paper);
    color: var(--muted); font-size: .875rem; line-height: 1.4; overflow-wrap: anywhere;
}
.social-container { font-size: .88rem; }
.social-container > :empty { display: none; }
.memory-container .body { display: flex; flex-wrap: wrap; gap: .75rem; padding: 1rem; background: var(--pale); }
.memory-container .variable { margin: 0 !important; width: auto !important; height: auto !important; padding: .8rem; border: 1px solid var(--line); border-radius: .4rem; background: white; font: .85rem/1.6 var(--mono); }
.memory-container .title { font-weight: 600; padding: .5rem 0; }
.policy-page { max-width: 54rem; margin-top: 2rem; }
@media (min-width: 992px) {
    /* Give the extra column to the article and keep rendered banners at their original width. */
    .side-nav[hidden] + .main .leaderboard-ads .ad-banner {
        width: calc(100% - var(--lesson-sidebar-width) - var(--lesson-gap));
        margin-inline: auto;
    }
}
@media (max-width: 1199.98px) {
    .side-nav + .main > .body { grid-template-columns: minmax(0, 1fr); }
    .side-nav + .main .ad-rail { min-height: 116px; }
}
@media (max-width: 991.98px) {
    .flex-container { display: block; }
    .main > .body { grid-template-columns: minmax(0, 1fr); }
    .side-nav { position: static; margin-bottom: 1rem; }
    .ad-rail { min-height: 116px; }
    .hero-inner { gap: 1.2rem; }
    .editor pre { font-size: .73rem; }
}
@media (max-width: 767.98px) {
    .hero-inner { grid-template-columns: minmax(0, 1fr); padding-block: 2.4rem 1.8rem; }
    .editor { max-width: 100%; justify-self: stretch; }
    .hero h1 { font-size: clamp(2rem, 6vw, 2.6rem); }
    .hero p { margin: .8rem 0 1rem; }
    .editor pre { font-size: clamp(.64rem, 2.2vw, .82rem); padding: .85rem .6rem; }
    .editor pre span::before { width: 1.3rem; }
    :root { --reading-inset: 1.15rem; }
    .flex-container { padding-top: 1.25rem; }
    .home-sections { padding-top: 1.75rem; }
    .home-sections > .ad-banner { margin-block: 1.75rem; }
    .ad-banner, .ad-rail, .side-nav + .main .ad-rail { min-height: 96px; }
    .language-card { padding: 1rem; }
}
@media (max-width: 575.98px) {
    .shell, .flex-container { width: calc(100% - 2rem); }
    :root { --header-height: 3.9rem; --nav-gap: .65rem; }
    .header-brand { gap: .55rem; }
    .header-inner { gap: .5rem; }
    .site-links a[href="./programming/#examples"] { display: none; }
    .site-brand img { width: clamp(108px, 30vw, 132px); }
    .site-links a { font-size: .8rem; }
    .section-heading { flex-wrap: wrap; gap: .75rem; margin-bottom: 1rem; }
    .filter-control { width: 100%; }
    .filter-control input { width: 100%; }
    .showcase-information .btn { margin-left: 0; }
    .main main h1 { font-size: 1.8rem; }
    .footer-inner { padding-block: 1.4rem; }
}
@media print {
    body { padding-top: 0; }
    .site-menu[open] { display: none; }
    .site-header, .side-nav, .tutorial-rail, .ad-space, .site-footer, .social-container, .rel-nav, .skip-link, .filter-control { display: none !important; }
    .flex-container, .main > .body { display: block; width: 100%; }
    .main main { border: 0; padding: 0; }
    pre[class*="language-"], code[class*="language-"] { white-space: pre-wrap; color: black; background: white; }
}

.course-index { columns: 2 15rem; column-gap: 2.5rem; padding-inline-start: 1.8rem; }
.course-index li { break-inside: avoid; padding: .25rem .3rem; }
.course-index li::marker { color: var(--muted); }
.practice-answer { margin-block: 1rem; }
.practice-answer summary { cursor: pointer; color: var(--link); }
.practice-answer p { margin-block: .55rem; }
.course-reference { margin-block-start: 1.4rem; }

.library-filter { width: min(100%, 27rem); margin-block: 1rem; }
.library-filter input { flex: 1; }
.reference-group { margin-block: 1.8rem; }
.reference-entries { list-style: none; padding: 0; }
.reference-entries li { padding-block: .65rem; border-bottom: 1px solid var(--line); overflow-wrap: anywhere; }
.reference-entries li a { font-weight: 600; }
.reference-entries li span { display: block; color: var(--muted); margin-top: .15rem; }
.reference-packages { columns: 2 16rem; margin-top: 1rem; padding-inline-start: 1.4rem; }
.reference-packages li { break-inside: avoid; padding-block: .2rem; overflow-wrap: anywhere; }
.reference-catalog > summary { cursor: pointer; padding-block: .5rem; color: var(--brand-navy); }
[data-reference-index] [hidden] { display: none !important; }


.guide-search { max-width: 37rem; margin: 1.25rem 0 1.6rem; }
.guide-search label { display: block; font-weight: 600; margin-bottom: .35rem; }
.guide-search div { display: flex; gap: .5rem; }
.guide-search input { flex: 1; min-width: 0; padding: .6rem .8rem; border: 1px solid #a8b2c4; border-radius: .4rem; }
.guide-search button { background: var(--brand-navy); border-color: var(--brand-navy); }
.guide-directory { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,15rem),1fr)); gap: .85rem; }
.guide-card { display: block; padding: 1rem; border: 1px solid var(--line); border-radius: .45rem; text-decoration: none; }
.guide-card:hover, .guide-card:focus-visible { background: var(--pale); }
.guide-directory .guide-card h2 { color: var(--brand-navy); font-size: 1.15rem; margin: 0 0 .4rem; }
.guide-directory .guide-card p { color: var(--muted); margin: 0; }
.guide-section { font-size: .9rem; }
.guide-related { margin-top: 1.65rem; }
.guide-links { display: flex; flex-wrap: wrap; list-style: none; gap: .45rem .6rem; padding: 0; }
.guide-links li { margin: 0; }
.guide-links a { display: inline-block; padding: .4rem .65rem; border: 1px solid var(--line); border-radius: .4rem; text-decoration: none; overflow-wrap: anywhere; }
.guide-links a:hover, .guide-links a:focus-visible { text-decoration: underline; }
.guide-links code { color: var(--muted); }
.practical-guide h1, .practical-guide h2 { overflow-wrap: anywhere; }

.guide-topic { scroll-margin-top: 6.5rem; }
.guide-card small { display: block; margin-top: .5rem; color: var(--muted); }

/* Reference directories use the original brand palette and site typefaces. */
.reference-directory > :last-child { margin-bottom: 0; }
.directory-head {
    margin: calc(-1 * var(--reading-inset)) calc(-1 * var(--reading-inset)) 1.5rem;
    padding: var(--reading-inset);
    background: linear-gradient(110deg, #eff3fc, #f8faff 72%, white);
    border-bottom: 1px solid #dce3ef; border-radius: .4rem .4rem 0 0;
}
.directory-head .trail { margin-bottom: 1rem; }
.directory-title { display: flex; justify-content: space-between; align-items: center; gap: 1.25rem; }
.directory-title img { flex: none; width: 3.5rem; height: 3.5rem; object-fit: contain; padding: .5rem; background: var(--paper); border: 1px solid var(--line); border-radius: .65rem; }
.main .directory-title h1 { margin: 0 0 .75rem; }
.main .directory-title p { color: #354358; max-width: 68ch; margin: 0; }
.directory-title + :is(.showcase-main-container, .reference-filter) { margin-top: 1.25rem; }
.directory-head .guide-search { max-width: 38rem; margin: 1rem 0 0; }
.directory-head .guide-search label { color: var(--ink); font-size: .88rem; }
.directory-head .guide-search input { background: white; color: var(--ink); }
.guide-search button:where(:hover, :focus-visible) { background: #303e87; }
.directory-jumps ul, .main .method-list { list-style: none; padding: 0; }
.directory-jumps ul { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,13rem),1fr)); gap: .45rem; }
.directory-jumps li { margin: 0; }
.directory-jumps a { display: flex; align-items: center; justify-content: space-between; gap: .7rem; min-height: 2.8rem; padding: .55rem .72rem; background: #f4f6fc; border: 1px solid #dce2ef; border-radius: .45rem; color: var(--brand-navy); text-decoration: none; font-size: .88rem; }
.directory-jumps a:hover { background: #e9edfa; text-decoration: underline; }
.topic-count { font: .75rem var(--mono); color: var(--muted); }
.main .method-list { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,17rem),1fr)); gap: .6rem; }
.main .method-list li { margin: 0; padding: 0; border: 0; min-width: 0; }
.method-list a, .peer-directory a {
    display: grid; align-content: start; height: 100%; min-height: 3rem; padding: .9rem 1rem;
    border: 1px solid var(--line); border-radius: .55rem; background: white; color: var(--brand-navy);
    text-decoration: none; overflow-wrap: anywhere;
}
.method-list a { position: relative; padding-inline-end: 2.15rem; }
.method-list a::after { content: ""; position: absolute; inset-inline-end: .9rem; top: 1.25rem; width: .44rem; height: .44rem; border: solid #677995; border-width: 1.5px 1.5px 0 0; transform: rotate(45deg); }
.method-list a strong { font: 600 .95rem/1.45 var(--mono); }
.method-list a span, .guide-related .guide-links small {
    display: block; margin-top: .25rem; color: var(--muted); font-size: .87rem; font-weight: 400; line-height: 1.5;
}
.method-heading { margin-top: .85rem; padding: .25rem 0 1.2rem; border-bottom: 1px solid var(--line); }
.main .method-heading h1 { margin: .45rem 0 .65rem; line-height: 1.14; }
.method-heading > p:last-child { max-width: 65ch; color: #394860; margin-bottom: 0; }
.method-heading .guide-section { margin: 0; font-size: .85rem; }
.method-heading .guide-section a { color: #485a81; }
.run-instructions, .case-index, .method-note { margin: 1.25rem 0; border-radius: .5rem; padding: .85rem 1rem; }
.run-instructions { border: 1px solid var(--line); }
.run-instructions summary { font-weight: 600; color: var(--brand-navy); }
.run-instructions[open] summary { margin-bottom: .65rem; }
.case-index, .method-note { background: #f2f5fb; border-inline-start: 3px solid #576db0; }
.main .case-index h2, .main .method-note h2 { font-size: 1.05rem; margin: 0 0 .5rem; }
.case-index ul { margin: 0; padding-left: 1.3rem; }
.case-index li + li { margin-top: .35rem; }
.method-note p:last-child { margin-bottom: 0; }
.example-study { margin-block: 1.8rem; scroll-margin-top: calc(var(--header-height) + 1rem); }
.main .example-study h2 { font-size: clamp(1.2rem, 2vw, 1.48rem); }
.code-sheet { overflow: hidden; border-radius: .5rem .5rem 0 0; margin: 0; background: var(--code-bg); }
.code-sheet pre, .code-sheet pre code { white-space: pre-wrap; overflow-wrap: anywhere; }
.code-sheet figcaption { display: flex; justify-content: space-between; align-items: center; gap: .5rem; padding: .55rem .9rem; background: #26324b; color: #e7edfc; font: .78rem/1.45 var(--mono); }
.copy-example { border: 1px solid #7887a3; color: white; background: transparent; border-radius: .3rem; padding: .25rem .55rem; }
.code-sheet pre[class*="language-"], .example-result pre { margin: 0; border: 0; border-radius: 0; }
.example-result { background: #eff5f4; border: 1px solid #d4e4e1; border-radius: 0 0 .5rem .5rem; margin-bottom: .85rem; }
.example-result figcaption { margin: 0; padding: .6rem .9rem 0; color: #30544e; font-size: .8rem; }
.example-result pre { padding: .55rem .9rem .75rem; background: transparent; color: #183d35; white-space: pre-wrap; overflow-wrap: anywhere; }
.example-result samp { color: inherit; }
.ad-banner, .ad-article { margin-block: 2.4rem; }
.ad-article { min-height: 240px; }
.main > .body > .section-index:only-child { grid-column: 1 / -1; }
.ad-space { border: 1px solid #dce1ea; background: #f7f8fa; }
.ad-space:has(ins[data-ad-status="unfilled"]) { display: none; }
@media (min-width: 1200px) {
    .tutorial-rail { display: flex; flex-direction: column; gap: 1.35rem; }
    .tutorial-rail .topic-links { margin-bottom: 0; }
    .tutorial-rail .ad-rail { order: -1; }
}
@media (max-width: 575.98px) {
    .directory-title img { width: 2.5rem; height: 2.5rem; padding: .35rem; }
    .directory-title { align-items: start; }
    .directory-title img { margin-top: .9rem; }
    .directory-jumps ul { grid-template-columns: 1fr; }
}

.main main, .policy-page { box-shadow: 0 3px 14px rgb(23 37 69 / 4%); }
.main main > .trail { margin-bottom: 1rem; }
.main main article > h1 { line-height: 1.16; margin-bottom: .8rem; }
.main main article > h1 + p { max-width: 68ch; color: #354358; }
.topic-links { padding: 1.05rem 1.2rem; border-top: 3px solid var(--brand-navy); }
.topic-links a { min-height: 2.65rem; }
@media (max-width: 991.98px) { .tutorial-rail .ad-secondary { display: none; } }
@media (max-width: 1199.98px) { .side-nav + .main .tutorial-rail .ad-secondary { display: none; } }
@media print { .copy-example, .case-index, .directory-jumps, .guide-search { display: none; } }

.guide-topic, .example-study { scroll-margin-top: .65rem; }
@media (max-width: 575.98px) {
    .header-brand { flex: none; }
}
@media (max-width: 440px) {
    .site-links a[href="./library/"] { display: none; }
    .header-brand:has(.menu-trigger:not([hidden])) + .site-links a { white-space: nowrap; }
}

/* End-of-lesson topics and navigation share the same rhythm in both page templates. */
.main main .tags-container {
    margin: 1.65rem 0 1.25rem; padding: .95rem 1.1rem;
    border: 1px solid #dfe4ec; border-radius: .7rem; background-color: #f6f8fb;
}
.main main .tags-container > h2 {
    margin: 0 0 .55rem; font-size: .94rem; line-height: 1.4; color: #273653;
}
.main main .tags-container ul.tags { display:flex; flex-wrap:wrap; gap:.4rem .55rem; margin:0; padding:0; list-style:none; }
.main main .tags-container .tags > li {
    display:inline-flex; max-width:100%; margin:0; padding:.2rem .64rem;
    border:0; border-radius:.32rem; background:#e7ecf3; color:#374762;
    font-size:.84rem; line-height:1.55; overflow-wrap:anywhere;
}
.main main .guide-related {
    margin:1.65rem 0 0; padding:1.1rem 0 0; border-top:1px solid #d8deea;
}
.main main .guide-related > h2 {
    margin:0 0 .85rem; color:var(--ink); font-size:clamp(1.08rem,1.9vw,1.35rem);
    line-height:1.32; letter-spacing:-.015em;
}
.guide-related .guide-links, .peer-directory {
    display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,max(14rem,calc(50% - .55rem))),1fr));
    gap: .55rem; margin: 0; padding: 0; list-style: none;
}
.guide-related .guide-links > li, .peer-directory > li { min-width: 0; margin: 0; }
.guide-related .guide-links a {
    display: flex; align-items: center; justify-content: space-between; gap: .8rem; min-height: 3rem; height: 100%;
    padding: .85rem 1rem; color: var(--brand-navy); background: #f8fafd; border: 1px solid #dae1ec;
    border-radius: .55rem; text-decoration: none; line-height: 1.4; overflow-wrap: anywhere;
}
.guide-related .guide-links strong { font-size: .95rem; }
.guide-related .guide-links a::after, .peer-directory a::after {
    content: ''; flex: none; width: .43rem; height: .43rem; border: solid #677995;
    border-width: 1.5px 1.5px 0 0; transform: rotate(45deg);
}
.peer-directory { grid-template-columns: repeat(auto-fit,minmax(min(100%,12rem),1fr)); }
.peer-directory a { grid-template-columns: 1.55rem minmax(0,1fr) auto; align-content: center; align-items: center; gap: .55rem; }
.peer-directory img { width: 1.5rem; height: 1.5rem; object-fit: contain; }
.peer-directory strong, .peer-directory code { display: block; }
.peer-directory strong { font-size: .88rem; }
.peer-directory code { margin-top: .2rem; color: #405271; font: .84rem/1.4 var(--mono); }
.method-list a:is(:hover,:focus-visible), .peer-directory a:is(:hover,:focus-visible),
.guide-related .guide-links a:is(:hover,:focus-visible) {
    background: #edf2fb; border-color: #8a9bbe; box-shadow: 0 2px 6px rgb(23 43 84 / 7%);
}
.method-list a:is(:hover,:focus-visible) strong, .peer-directory a:is(:hover,:focus-visible) strong,
.guide-related .guide-links a:is(:hover,:focus-visible) strong { text-decoration: underline; }
.example-study > .example-scenario, .main main .example-scenario { max-width:70ch; line-height:1.7; margin:.2rem 0 1rem; color:#344158; }
.file-signatures ul { padding-left:1.25rem; }
.file-signatures li { margin:.55rem 0; overflow-wrap:anywhere; }
.file-signatures code { color:inherit; }
@media (max-width: 575.98px) {
    .main main .tags-container { padding:.8rem; }
    .peer-directory { grid-template-columns: repeat(auto-fit,minmax(min(100%,10.5rem),1fr)); }
    .guide-related .guide-links { grid-template-columns:repeat(auto-fit,minmax(min(100%,12rem),1fr)); }
}

.home-example { width: 100%; max-width: 33rem; justify-self: end; }
.home-example > a { display: inline-block; padding-block: .35rem; }
figure.example-result { margin: 0 0 1rem; }
.example-result figcaption { font-weight: 650; letter-spacing: .01em; }
.code-sheet + .code-sheet { margin-top: .75rem; }
.code-sheet pre[class*="language-"] { padding: .95rem 1rem; }
.compare-all { display: inline-block; margin-top: .75rem; }

/* Worked diagrams. HTML labels keep units, long paths and space-sensitive values readable. */
.lesson-drawing {
    display: grid;
    grid-template-columns: minmax(7rem, .78fr) minmax(0, 1.6fr);
    align-items: stretch;
    margin: 1rem 0 1.25rem;
    border: 1px solid #cbdedb;
    border-radius: .8rem;
    overflow: hidden;
    background: #f8fbfa;
    color: #213e43;
    break-inside: avoid;
}
.lesson-drawing .drawing-stage {
    display: grid; place-items: center; padding: .65rem .4rem;
    border-right: 1px solid #d2e2dd;
    background-color: #e8f2ee;
    background-image: radial-gradient(#c2d6ce 1px, transparent 1px);
    background-size: 12px 12px;
}
.lesson-drawing .drawing-stage img { display: block; width: min(100%, 14rem); height: auto; margin: 0; border: 0; border-radius: 0; }
.lesson-drawing .drawing-values {
    align-self: center; display: grid; gap: .5rem; min-width: 0; padding: .9rem 1.05rem;
    font: inherit; color: inherit; background: transparent; text-align: start;
}
.drawing-values div > span { display: block; font: 650 .72rem/1.4 var(--sans, system-ui,sans-serif); color: #44655e; }
.drawing-values div > strong { display: block; margin-top: .12rem; font: 560 .9rem/1.45 var(--mono,monospace); overflow-wrap: anywhere; white-space: pre-wrap; }
.drawing-values .drawing-answer strong { color: #115d4e; font-weight: 700; }
.worked-application, .example-study { scroll-margin-top: 5.5rem; }
.worked-source { margin: .85rem 0; }
.worked-source > summary { padding: .55rem 0; color: #293d78; font-weight: 650; cursor: pointer; }
@media (max-width: 450px) {
    .lesson-drawing { grid-template-columns: minmax(5rem, .6fr) minmax(0,1fr); }
    .lesson-drawing .drawing-stage { padding: .2rem; }
    .lesson-drawing .drawing-values { padding: .65rem .7rem; }
    .drawing-values div > strong { font-size: .82rem; }
}
@media (max-width: 450px) {
    .lesson-drawing { grid-template-columns: minmax(0,1fr); }
    .lesson-drawing .drawing-stage { border-right: 0; border-bottom: 1px solid #d2e2dd; padding: .28rem; }
    .lesson-drawing .drawing-stage img { width: 10.5rem; }
    .lesson-drawing .drawing-values { display: flex; align-items: start; flex-wrap: wrap; gap: .5rem 1rem; }
    .drawing-values div { flex: 1 1 6.5rem; min-width: 0; }
}

/* Shared tutorial shell */
:root {
    --masthead: 4.15rem;
    --language-bar: 2.55rem;
    --header-height: calc(var(--masthead) + var(--language-bar));
    --course-ink: #162438;
    --course-muted: #506070;
    --course-line: #d8e0e3;
    --course-accent: #a6edda;
    --course-shadow: 0 9px 32px -24px rgb(17 38 52 / 40%);
    --paper: #f6f8f8;
}
body { background: var(--paper); }
.site-header { height: var(--header-height); border: 0; box-shadow: 0 2px 10px rgb(18 35 47 / 10%); }
.header-inner { height: var(--masthead); }
.site-brand img { width: 10.8rem; }
.header-brand { gap: 1rem; }
.menu-trigger { width: 42px; height: 42px; border-color: #d6dddf; border-radius: .7rem; color: #283a52; }
.site-links { gap: clamp(.8rem, 2.6vw, 2.5rem); }
.site-links a { font-size: .89rem; font-weight: 650; }
html:has(.site-header-general) { --header-height: var(--masthead); }
.site-links .subject-switch { gap: .5rem; }
.site-header-general .subject-switch { border: 1px solid #d3dcd8; padding: .35rem .85rem; border-radius: .55rem; color: #264946; }
.course-strip .programming-root { border-inline-end: 1px solid #53616f; }
.drawer-shortcuts h3 { grid-column: 1 / -1; margin: 0 0 .2rem; font-size: 1rem; color: var(--course-ink); }
.drawer-shortcuts a { align-content: center; text-align: center; padding: .45rem; line-height: 1.3; }
.drawer-shortcuts small { color: #58656a; font-weight: 500; }
.programming-trail { padding-block: .9rem; }
.course-switcher { background: #172438; color: #e9f1f3; }
.course-strip {
    display: flex; align-items: stretch; gap: clamp(.15rem, .8vw, .9rem); overflow-x: auto;
    height: var(--language-bar); scrollbar-width: none; overscroll-behavior-x: contain;
}
.course-strip::-webkit-scrollbar { display: none; }
.course-strip a {
    flex: none; display: grid; place-items: center; padding: 0 clamp(.65rem, 1.3vw, 1.3rem);
    border-bottom: 3px solid transparent; padding-top: 3px;
    text-decoration: none; color: #e0e7ee; font-size: .84rem; font-weight: 600;
}
.course-strip a[aria-current] { color: #bcf3e2; border-bottom-color: #9ee3cb; background: rgb(163 232 216 / 7%); }
.course-strip a:hover { color: white; background: rgb(255 255 255 / 10%); }
.course-strip a:focus-visible { outline-color: #b4f3e2; outline-offset: -4px; }
.site-footer { border-color: var(--course-line); }
.site-footer .site-brand img { width: 9rem; }
.trail { gap: .55rem; font-size: .81rem; }
.trail [aria-current] { font-weight: 600; color: #344757; }

/* Language landing pages */
.course-shell { padding-block: 1.15rem 0; }
.course-shell > .trail { margin: 0 0 1rem .15rem; }
.course-cover, .directory-head, .home-page .hero {
    background: radial-gradient(ellipse at 84% 44%, #254d59 0%, transparent 51%),
                linear-gradient(110deg, #152337, #14283c 58%, #142e3b);
    color: white;
}
.course-cover {
    position: relative; isolation: isolate; overflow: hidden; display: grid;
    grid-template-columns: minmax(0, 1.16fr) minmax(0, 1fr); align-items: center;
    padding: clamp(1.8rem, 3.6vw, 3.7rem) clamp(1.5rem, 3.8vw, 4rem);
    border-radius: 1.25rem 1.25rem 0 0;
}
.course-intro { position: relative; z-index: 1; }
.course-meta { display: flex; align-items: center; gap: .55rem; margin: 0 0 1rem; color: #c5e8df; font: 600 .8rem/1.5 var(--bs-body-font-family); }
.course-meta svg { width: 1.1rem; height: 1.1rem; }
.course-cover h1, .home-page .hero h1 {
    margin: 0; color: #f8fbfa; font-weight: var(--display-weight); font-size: clamp(2rem, 3.9vw, 3.65rem);
    letter-spacing: var(--display-tracking); line-height: 1.1; text-wrap: balance; overflow-wrap: break-word;
}
.course-lead { max-width: 55ch; margin: 1.1rem 0 1.5rem; font-size: clamp(.98rem, 1.16vw, 1.12rem); line-height: 1.6; color: #d3e3e6; }
.course-actions { display: flex; flex-wrap: wrap; align-items: center; gap: .65rem 1.35rem; }
.course-actions a { display: inline-flex; align-items: center; gap: .75rem; min-height: 44px; font-size: .94rem; font-weight: 650; text-decoration: none; }
.start-course, .home-page .hero .btn-primary { border: 1px solid #acedd8; border-radius: .57rem; background: #b3f0dc; color: #112e31; padding: .65rem 1rem; }
.start-course:hover, .home-page .hero .btn-primary:hover { background: #d6ffef; color: #142f32; }
.browse-course { color: #f1f6f8; }
.browse-course:hover { color: #c4f7e6; text-decoration: underline; }
.course-cover a:focus-visible, .directory-head :focus-visible, .hero a:focus-visible { outline-color: #fff; }
.course-art { display: block; width: 100%; max-width: 37rem; height: auto; justify-self: center; pointer-events: none; }
[data-course="python"] .course-art, [data-course="php"] .course-art, [data-course="r"] .course-art { filter: hue-rotate(23deg); }
[data-course="java"] .course-art, [data-course="ruby"] .course-art { filter: hue-rotate(186deg); }
[data-course="cpp"] .course-art, [data-course="scala"] .course-art, [data-course="kotlin"] .course-art { filter: hue-rotate(74deg); }
.course-resources {
    display: grid; grid-template-columns: repeat(3,minmax(0,1fr)); overflow: hidden;
    background: #fff; border: 1px solid var(--course-line); border-top: 0;
    border-radius: 0 0 1.2rem 1.2rem; box-shadow: var(--course-shadow);
}
.course-resources a {
    display: flex; align-items: center; gap: clamp(.6rem, 1.2vw, 1rem); padding: 1.13rem clamp(.85rem, 2vw, 2rem);
    color: var(--course-ink); text-decoration: none;
}
.course-resources a + a { border-inline-start: 1px solid var(--course-line); }
.course-resources a:hover { background: #edf6f3; }
.course-resources a:focus-visible { outline-offset: -4px; }
.resource-icon { flex: none; width: 2.5rem; height: 2.5rem; padding: .56rem; box-sizing: border-box; border-radius: .66rem; background: #e9f2ee; color: #2f5d56; }
.course-resources strong, .course-resources small { display: block; }
.course-resources strong { font-size: 1rem; }
.course-resources small { color: var(--course-muted); font-size: .82rem; margin-top: .15rem; }
.resource-arrow { margin-inline-start: auto; color: #516775; }
.course-reading { display: grid; grid-template-columns: minmax(0,1fr) minmax(15rem,18rem); gap: 1.5rem 2rem; align-items: start; margin-top: 2rem; }
.course-curriculum, .course-sample { min-width: 0; background: #fff; border: 1px solid var(--course-line); border-radius: 1rem; padding: clamp(1.2rem,2.45vw,2.3rem); box-shadow: var(--course-shadow); }
.course-curriculum h2, .course-sample h2, .section-heading h2 { color: var(--course-ink); font-size: clamp(1.5rem,2.4vw,2.15rem); letter-spacing: -.025em; font-weight: var(--display-weight); line-height: 1.18; }
.course-curriculum h2, .course-sample h2 { margin: 0 0 1.35rem; }
.course-chapter + .course-chapter { margin-top: 1.65rem; }
.course-chapter h3 { color: #384e5d; font-size: 1rem; font-weight: 650; margin: 0 0 .5rem; }
.course-chapter ol { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2,minmax(0,1fr)); column-gap: 1.6rem; }
.course-chapter li { min-width: 0; }
.course-chapter a {
    display: grid; grid-template-columns: 2ch minmax(0,1fr) 1rem; gap: .75rem; align-items: baseline;
    padding: .7rem .25rem; min-height: 44px; height: 100%; border-top: 1px solid #e1e7e8;
    color: #213a48; text-decoration: none; line-height: 1.45; overflow-wrap: anywhere;
}
.course-chapter a:hover { background: #f0f6f4; color: #194e4a; }
.lesson-number { font: .77rem/1.5 var(--mono); color: #536d72; }
.lesson-arrow { color: #627d80; justify-self: end; }
.course-sample { grid-column: 1; }

/* Section directories and the reading surface */
.main main, .policy-page { border: 1px solid var(--course-line); border-radius: 1rem; box-shadow: var(--course-shadow); }
.main main h1, .policy-page h1 { color: var(--course-ink); line-height: 1.16; font-weight: var(--display-weight); letter-spacing: var(--display-tracking); }
.main main h2 { color: #223343; letter-spacing: -.022em; }
.directory-head { border-radius: .97rem .97rem 0 0; border: 0; }
.directory-head .trail a, .directory-head .trail, .directory-head .trail [aria-current] { color: #ccdfe2; }
.main .directory-head h1, .directory-head .guide-search label { color: #fff; }
.main .directory-head .directory-title p { color: #d6e5e8; }
.directory-mark {
    display: grid; place-items: center; flex: none; min-width: 3.3rem; height: 3.3rem; padding-inline: .45rem;
    border: 1px solid #79b5ad; border-radius: .7rem; box-shadow: 0 3px 0 #477e7b;
    background: linear-gradient(145deg,#d2f4e8,#99d2c9); color: #23434a; font: 650 1rem/1 var(--mono);
}
.directory-head .guide-search button { border-color: #b3ebd9; background: #b3ebd9; color: #163438; }
.directory-head .guide-search button:hover { background: #defaf0; }
.main .method-heading { margin: 1.05rem 0 1.65rem; padding-bottom: 1.3rem; border-color: var(--course-line); }
.main main .method-heading > p:last-child, .main main article > h1 + p { font-size: 1.02rem; line-height: 1.68; }
.main :is(.guide-card,.method-list a,.guide-related .guide-links a,.showcase-main-container .item,.peer-directory a) { border-color: var(--course-line); border-radius: .7rem; }
.main :is(.guide-card,.method-list a,.guide-related .guide-links a,.showcase-main-container .item,.peer-directory a):hover { border-color: #91aca8; background: #f4f9f7; }
.topic-links { border: 1px solid var(--course-line); border-radius: .85rem; box-shadow: var(--course-shadow); }
.topic-links h2 { color: var(--course-ink); }
.rel-nav a { min-height: 44px; padding: .55rem .8rem; color: #234e49; background: #edf5f1; border: 1px solid #d7e4df; border-radius: .55rem; }
.rel-nav a[rel="next"] { margin-inline-start: auto; }
.rel-nav a:hover { background: #dceee6; }
.method-note, .case-index { border-color: #598b80; background: #eff6f3; }
.side-nav summary { background: linear-gradient(110deg,#1a2a3e,#284a56); }
:is(.side-nav,.drawer-lessons) .nav-link.active { color: #173f3b; background: #e3f1eb; border-inline-start-color: #378277; }
.code-sheet { background: #182638; border-radius: .7rem .7rem 0 0; }
.code-sheet figcaption { color: #e3eeed; background: #25394a; border-bottom: 1px solid #405464; }
.code-sheet pre[class*="language-"] { background: #182638; }
.copy-example { min-height: 30px; border-color: #738790; border-radius: .4rem; }
.copy-example:hover { background: #394e5a; }
.example-result { border-radius: 0 0 .7rem .7rem; background: #edf6f1; }
.example-result figcaption { font-weight: 650; }
.ad-space { border-radius: .8rem; }
.home-page .hero { border: 0; }
.home-page .hero-copy p, .home-example > a { color: #dcece9; }
.home-example > a:hover { color: #fff; }
.home-page .home-example .code-sheet { border: 1px solid #526673; border-bottom: 0; box-shadow: 0 12px 32px -16px #0009; }
.language-card, .example-card { border-radius: .85rem; border-color: var(--course-line); box-shadow: var(--course-shadow); }
.language-card:hover, .example-card:hover { border-color: #97b4ab; background: #f3f9f6; }
.language-logo { font: 650 1.05rem/1 var(--mono); background: #e7f1eb; color: #29564e; }
@media (max-width: 991.98px) {
    .course-reading { grid-template-columns: minmax(0,1fr); }
    .course-reading .tutorial-rail { width: 100%; }
    .course-resources a { padding: .9rem; gap: .55rem; }
    .course-resources small { font-size: .78rem; }
}
@media (max-width: 700px) {
    .course-cover { grid-template-columns: 1fr; padding: 1.6rem 1.5rem 0; }
    .course-art { width: min(100%, 19.5rem); height: auto; margin: -.2rem auto -.4rem; }
    .course-resources { grid-template-columns: 1fr; }
    .course-resources a { padding: .78rem 1.15rem; }
    .course-resources a + a { border-inline-start: 0; border-top: 1px solid var(--course-line); }
    .course-cover h1 { font-size: clamp(2rem,6.8vw,2.9rem); }
    .course-reading { gap: 1rem; margin-top: 1.2rem; }
    .course-chapter ol { grid-template-columns: 1fr; }
    .course-strip { width: 100%; padding-inline: 1rem; }
    .course-meta { margin-bottom: .7rem; }
}
@media (max-width: 575.98px) {
    :root { --masthead: 3.55rem; --language-bar: 2.4rem; }
    .site-brand img { width: clamp(6.7rem,29vw,8.6rem); }
    .site-links a { font-size: .8rem; }

    .course-shell { padding-top: .85rem; }
    .course-shell > .trail { margin-bottom: .7rem; }
    .course-cover { padding-inline: 1.15rem; }
    .directory-mark { min-width: 2.7rem; height: 2.7rem; font-size: .82rem; }
}
@media print {
    body { padding-top: 0; }
    .course-art, .course-actions, .course-switcher, .course-resources { display: none; }
    .course-cover, .directory-head { background: white; color: black; padding: 0; }
    .course-cover *, .main .directory-head *, .home-page .hero-copy * { color: black !important; }
    .course-reading, .course-chapter ol { display: block; }
}
.activity-cards { display: grid; grid-template-columns: repeat(auto-fit,minmax(min(100%,14rem),1fr)); gap: .85rem; }
.activity-cards a {
    display: grid; align-content: start; gap: .45rem; padding: 1.1rem; color: var(--course-ink);
    border: 1px solid var(--course-line); border-radius: .8rem; text-decoration: none; background: white;
}
.activity-cards a:hover { background: #f3f8f5; border-color: #91aca8; }
.activity-cards svg { margin-bottom: .45rem; }
.activity-cards strong { font-size: 1.1rem; }
.activity-cards span { color: var(--course-muted); font-size: .91rem; line-height: 1.5; }

/* First examples use written steps alongside a scalable visual trace. */
.first-example, .first-application {
    min-width: 0;
    margin: 1.6rem 0 2rem;
}
.main .first-example > h2, .main .first-application > h2 {
    margin: 0 0 .4rem;
}
.main .first-example .first-example-task {
    margin: 0 0 .85rem;
    color: #344757;
    font-size: 1rem;
    overflow-wrap: anywhere;
}
.first-trace {
    margin: 0 0 .8rem;
    padding: clamp(.85rem, 2vw, 1.2rem);
    border: 1px solid #cbd9d8;
    border-radius: .85rem;
    background: linear-gradient(115deg, #fafcfb, var(--edition-paper, #edf4f1));
    color: #1b3642;
    container-type: inline-size;
}
.main .first-trace-steps {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: .8rem;
    padding: 0;
    margin: 0;
    list-style: none;
}
.main .first-trace-steps li {
    margin: 0;
    padding: 0 .55rem 0 0;
    min-width: 0;
    overflow-wrap: anywhere;
    line-height: 1.42;
}
.first-step-label {
    display: flex;
    align-items: center;
    gap: .35rem;
    color: var(--edition-ink, #31585a);
    font-size: .8rem;
    font-weight: 600;
}
.first-step-label svg {
    width: 1.12rem;
    height: 1.12rem;
    flex: none;
    fill: var(--edition-paper, #edf4f1);
    stroke: currentColor;
    stroke-width: 1.65;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.first-trace-steps strong {
    display: block;
    margin: .38rem 0 0;
    font-size: 1rem;
    color: #162f3b;
}
.first-trace figcaption {
    padding-top: .78rem;
    margin-top: .9rem;
    border-top: 1px solid #cbd9d8;
    font-size: .92rem;
    line-height: 1.6;
    color: #344757;
}
.first-count-line { display: block; width: min(100%, 22rem); height: auto; margin: 0 auto .85rem; color: #799a94; }
.first-count-line circle { stroke-width: 1.5; }
.first-count-line text { font: 600 17px ui-monospace, monospace; }
.count-print circle { fill: #24495a; stroke: #24495a; }
.count-print text { fill: white; }
.count-skip circle { fill: #fff; stroke: #657884; stroke-dasharray: 3 3; }
.count-skip text { fill: #425560; }
@container (max-width: 26rem) {
    .main .first-trace-steps { grid-template-columns: 1fr; gap: .64rem; }
    .main .first-trace-steps li { display: grid; grid-template-columns: 5.35rem minmax(0, 1fr); gap: .4rem; align-items: baseline; }
    .first-trace-steps strong { margin: 0; }
}
@media (max-width: 520px) {
    .main .first-trace-steps { grid-template-columns: 1fr; }
    .first-trace-steps strong { margin-top: 0; }
}

.first-graphic { display: block; width: min(100%, 21rem); height: auto; margin: 0 auto .85rem; }

.social-container.lesson-share {
    display: flex; justify-content: space-between; align-items: flex-start; gap: 1.3rem 2rem;
    margin: 2.5rem 0 1rem; padding: clamp(1rem, 3vw, 1.5rem);
    border: 1px solid #cbdad7; border-radius: 1rem; background: #f4f8f7; text-align: left;
}
.lesson-share h2 { margin: 0 0 .5rem; font-family: inherit; font-size: 1rem; font-weight: 650; line-height: 1.35; color: #193b39; letter-spacing: 0; }
.lesson-share .share-links { display: flex; flex-wrap: wrap; align-items: center; gap: .4rem; }
.lesson-share .share-links a, .lesson-share .share-copy {
    display: inline-flex; align-items: center; justify-content: center; gap: .45rem; min-height: 44px;
    padding: .4rem .8rem; border: 1px solid #c2d5d0; border-radius: .6rem; background: white;
    font: inherit; font-weight: 600; color: #204c46; text-decoration: none; cursor: pointer;
}
.lesson-share .share-copy { color: white; background: #1c5048; border-color: #1c5048; }
.lesson-share .share-copy svg { width: 1rem; height: 1rem; }
.lesson-share .share-follow a { background: transparent; border-color: transparent; }
.lesson-share .share-links a:hover { background: #e1eeea; color: #163e36; }
.lesson-share .share-copy:hover { background: #123e37; }
.lesson-share :focus-visible { outline: 3px solid #326d93; outline-offset: 2px; }
.lesson-share [hidden] { display: none; }
.lesson-share .share-address { margin-top: .5rem; width: 100%; }
.lesson-share .share-status:not(:empty) { display: block; margin-top: .45rem; }
