/* learn.agilesystemsoftware.com — Agile System Software brand (warm paper, ink, terracotta), no framework.
   Palette and type follow the agilesystemsoftware.com store: surface #faf9f5, ink #1d1b18, line #e5e1d6,
   brand #a84a26 (100 #f0dbcf, 900 #3f1b0d), Source Sans 3 with the system stack as fallback. */
:root {
  --surface: #faf9f5; --paper: #fffdf9; --ink: #1d1b18; --muted: #5d574d; --muted-2: #857d70; --line: #e5e1d6;
  --brand: #a84a26; --brand-100: #f0dbcf; --brand-50: #f8ece5; --brand-700: #8a3a1c; --brand-900: #3f1b0d;
  --ok: #2f6b3a; --ok-bg: #e4f1e6; --info: #2b4f7a; --info-bg: #e3ebf5; --warn-bg: #fbf1d8; --warn: #7a5a0f;
  --radius: .5rem; --radius-lg: .75rem;
  --shadow-card: 0 1px 2px rgba(60,50,30,.06), 0 4px 16px rgba(60,50,30,.06);
  --font: "Source Sans 3", -apple-system, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }
body { margin: 0; background: var(--surface); color: var(--ink); font: 17px/1.55 var(--font); min-width: 320px; overflow-wrap: anywhere; }
img, svg { max-width: 100%; height: auto; }
a { color: var(--brand); text-decoration-thickness: 1px; text-underline-offset: 2px; }
a:hover { color: var(--brand-700); }
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
h1, h2, h3, h4 { line-height: 1.2; letter-spacing: -.01em; margin: 0 0 .5em; font-weight: 600; }
h1 { font-size: clamp(1.9rem, 1.2rem + 3vw, 2.9rem); }
h2 { font-size: clamp(1.4rem, 1.1rem + 1.4vw, 1.9rem); }
h3 { font-size: 1.2rem; }
p { margin: 0 0 1em; }
code, .mono { font-family: var(--mono); font-size: .92em; }
code { background: var(--brand-50); padding: .05em .3em; border-radius: .25rem; }
pre { overflow-x: auto; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px; }
.wrap { max-width: 1120px; margin: 0 auto; padding: 0 16px; }
.small { font-size: .9rem; }
.muted { color: var(--muted); }
.eyebrow { text-transform: uppercase; letter-spacing: .08em; font-size: .78rem; font-weight: 600; color: var(--brand); margin: 0 0 .5em; }
.visually-hidden { position: absolute !important; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0; }
.skip { position: absolute; left: 8px; top: -48px; background: var(--ink); color: #fff; padding: 8px 12px; border-radius: var(--radius); z-index: 100; }
.skip:focus { top: 8px; }

/* header */
header.site { background: var(--paper); border-bottom: 1px solid var(--line); position: sticky; top: 0; z-index: 20; }
.bar { display: flex; align-items: center; gap: 14px 22px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
.brand { display: inline-flex; align-items: center; gap: 10px; color: var(--ink); text-decoration: none; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-name { font-weight: 600; font-size: 1rem; }
.brand-sub { font-size: .78rem; text-transform: uppercase; letter-spacing: .12em; color: var(--brand); font-weight: 600; }
nav.main { display: flex; gap: 4px 16px; flex-wrap: wrap; }
nav.main a { color: var(--muted); text-decoration: none; font-weight: 500; padding: 6px 0; border-bottom: 2px solid transparent; }
nav.main a:hover, nav.main a[aria-current="page"] { color: var(--ink); border-bottom-color: var(--brand); }
.sitesearch { position: relative; margin-left: auto; flex: 1 1 200px; max-width: 320px; }
.sitesearch input { width: 100%; font: inherit; font-size: .95rem; padding: 8px 12px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); color: var(--ink); }
.sitesearch input:focus { border-color: var(--brand); }
#site-q-results { position: absolute; top: calc(100% + 6px); left: 0; right: 0; margin: 0; padding: 6px; list-style: none; background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); box-shadow: var(--shadow-card); max-height: 60vh; overflow: auto; }
#site-q-results li a { display: block; padding: 8px 10px; border-radius: .35rem; color: var(--ink); text-decoration: none; }
#site-q-results li a:hover, #site-q-results li[aria-selected="true"] a { background: var(--brand-50); }
#site-q-results .k { display: block; font-size: .8rem; color: var(--muted-2); }
@media (max-width: 560px) { .sitesearch { max-width: none; flex-basis: 100%; margin-left: 0; } nav.main { gap: 2px 12px; font-size: .95rem; } }

/* sections */
main > section { padding: 40px 0; }
main > section.hero { padding: 48px 0 32px; }
main > section.alt { background: var(--paper); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.lede { font-size: 1.15rem; color: var(--muted); max-width: 70ch; }
.grid { display: grid; gap: 16px; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); }
.grid.two { grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); }
.card { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); box-shadow: var(--shadow-card); padding: 18px 20px; }
.card h3 { margin-top: 0; }
.card.lift { transition: border-color .15s, transform .15s; }
.card.lift:hover { border-color: #d9b6a4; transform: translateY(-1px); }
.card a.cover { color: inherit; text-decoration: none; }
.card a.cover:hover h3 { color: var(--brand-700); }
.tag { display: inline-block; font-size: .78rem; font-weight: 600; padding: 2px 9px; border-radius: 999px; background: var(--brand-100); color: var(--brand-900); margin: 0 6px 6px 0; }
.tag.lvl-kids { background: #e6f0e8; color: #27532f; }
.tag.lvl-beginner { background: #e3ebf5; color: #243f63; }
.tag.lvl-intermediate { background: #f3e7cf; color: #624a10; }
.tag.lvl-advanced { background: #ead9e6; color: #58244e; }
.tag.tier { background: var(--ok-bg); color: var(--ok); }
.tag.tier.t0 { background: #eee9df; color: var(--muted); }
.tag.tier.t4 { background: var(--info-bg); color: var(--info); }
.btn { display: inline-block; font: inherit; font-weight: 600; padding: 10px 18px; border-radius: 999px; border: 1px solid var(--brand); background: var(--brand); color: #fff; text-decoration: none; cursor: pointer; }
.btn:hover { background: var(--brand-700); color: #fff; }
.btn.ghost { background: transparent; color: var(--brand); }
.btn.ghost:hover { background: var(--brand-50); }
.btn[aria-disabled="true"] { background: #cfc8bb; border-color: #cfc8bb; color: #fff; cursor: not-allowed; }
.btnrow { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; }
.cta-note { font-size: .9rem; color: var(--muted); margin: 8px 0 0; }
.meta { display: grid; gap: 10px 20px; grid-template-columns: repeat(auto-fit, minmax(min(220px, 100%), 1fr)); margin: 18px 0 0; padding: 0; list-style: none; }
.meta li { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); padding: 10px 14px; }
.meta b { display: block; font-size: .78rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); margin-bottom: 2px; }
.scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
table { border-collapse: collapse; width: 100%; font-size: .95rem; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid var(--line); vertical-align: top; }
th { font-size: .8rem; text-transform: uppercase; letter-spacing: .06em; color: var(--muted-2); }
.matrix td a { font-weight: 600; text-decoration: none; }
.matrix td .small { display: block; color: var(--muted); font-weight: 400; }

/* catalogue filters */
.filters { display: flex; gap: 8px; flex-wrap: wrap; margin: 0 0 18px; }
.filters button { font: inherit; font-size: .9rem; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line); background: var(--paper); color: var(--muted); cursor: pointer; }
.filters button[aria-pressed="true"] { background: var(--ink); color: #fff; border-color: var(--ink); }
.cards[data-filtered] .card[hidden] { display: none; }
.card .code { font-family: var(--mono); font-size: .85rem; color: var(--muted-2); }
.card .facts { font-size: .9rem; color: var(--muted); margin: 8px 0 0; }

/* course page */
.hero .code { font-family: var(--mono); color: var(--muted-2); }
.syllabus .sess { padding: 22px 0; border-top: 1px solid var(--line); }
.syllabus .sess:first-of-type { border-top: 0; }
.syllabus h3 { margin-bottom: .3em; }
.syllabus .lab { background: var(--brand-50); border-left: 3px solid var(--brand); padding: 10px 14px; border-radius: 0 var(--radius) var(--radius) 0; }
.syllabus .lab b { color: var(--brand-900); }
details.steps { margin-top: 12px; }
details.steps > summary { cursor: pointer; font-weight: 600; color: var(--brand); padding: 6px 0; list-style: none; }
details.steps > summary::-webkit-details-marker { display: none; }
details.steps > summary::before { content: "▸ "; }
details.steps[open] > summary::before { content: "▾ "; }
details.steps > summary:focus-visible { outline-offset: 4px; }
ol.steplist { list-style: none; margin: 8px 0 0; padding: 0; display: grid; gap: 8px; }
ol.steplist > li { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius); scroll-margin-top: 120px; }
ol.steplist > li:target { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-100); }
details.step > summary { display: flex; gap: 8px 12px; align-items: baseline; flex-wrap: wrap; padding: 10px 14px; cursor: pointer; list-style: none; }
details.step > summary::-webkit-details-marker { display: none; }
details.step > summary .id { font-family: var(--mono); color: var(--muted-2); min-width: 2.6em; }
details.step > summary .t { font-weight: 600; flex: 1 1 200px; }
details.step > summary .min { color: var(--muted-2); font-size: .9rem; }
details.step .body { padding: 0 14px 14px; border-top: 1px dashed var(--line); }
details.step .body h4 { font-size: .78rem; text-transform: uppercase; letter-spacing: .08em; color: var(--muted-2); margin: 14px 0 4px; }
details.step .body p { margin: 0 0 .4em; }
details.step .check { font-size: .92rem; color: var(--muted); }
details.step .anchor { font-size: .8rem; color: var(--muted-2); text-decoration: none; }
details.step .anchor:hover { color: var(--brand); }
ul.skills { padding-left: 1.2em; }
ul.skills li { margin: 0 0 .4em; }
ul.gates { list-style: none; padding: 0; display: flex; gap: 8px; flex-wrap: wrap; }
ul.gates li { background: var(--paper); border: 1px solid var(--line); border-radius: 999px; padding: 4px 12px; font-size: .9rem; }
.toc { display: flex; gap: 6px 14px; flex-wrap: wrap; padding: 0; margin: 0 0 8px; list-style: none; font-size: .95rem; }
.toc a { text-decoration: none; }
.notice { background: var(--warn-bg); color: var(--warn); border-radius: var(--radius); padding: 10px 14px; font-size: .95rem; }

/* home */
.hero-home { display: grid; gap: 28px; grid-template-columns: repeat(auto-fit, minmax(min(320px, 100%), 1fr)); align-items: center; }
.steps3 { counter-reset: s; }
ol.steps3 { list-style: none; padding: 0; margin: 0; }
.steps3 .card::before { counter-increment: s; content: counter(s); display: inline-flex; width: 32px; height: 32px; align-items: center; justify-content: center; border-radius: .4rem; background: var(--brand); color: #fff; font-weight: 600; margin-bottom: 10px; }
.langs { display: flex; gap: 8px; flex-wrap: wrap; }
.langs a { display: inline-block; padding: 8px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); text-decoration: none; color: var(--ink); font-weight: 600; }
.langs a:hover { border-color: var(--brand); color: var(--brand-700); }

/* search page */
.search-input { flex: 1 1 240px; max-width: 480px; font: inherit; padding: 10px 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--paper); color: var(--ink); }
.results li { padding: 12px 0; border-bottom: 1px solid var(--line); }
.results .k { font-size: .85rem; color: var(--muted-2); }

/* footer */
footer.site { border-top: 1px solid var(--line); background: var(--paper); margin-top: 40px; }
.foot { display: grid; gap: 20px; grid-template-columns: repeat(auto-fit, minmax(min(260px, 100%), 1fr)); padding-top: 28px; padding-bottom: 28px; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.foot a { color: var(--muted); }
.brand-foot { margin: 0 0 6px; }
.copy { grid-column: 1 / -1; margin: 0; }
@media print { header.site, footer.site, .sitesearch, .btn { display: none; } details { open: true; } }
