/* stylesheet.org — a small, standards-compliant CSS framework.
 *
 * Semantic HTML + a handful of utility classes. No custom tags, no IDs, no
 * JavaScript. Write a normal page (header / main / footer, one h1 in main,
 * sections by depth) and it looks right; reach for a class only where HTML has
 * no element for the job (layout and a few presentational components).
 *
 * The file is in five sections. A theme only ever changes section 2.
 *   1. RESET          — constant
 *   2. THEME TOKENS   — :root variables (colour, type, space, shape)
 *   3. LAYOUT         — constant: row, column, grid, flow, stretch
 *   4. ELEMENTS       — constant: semantic tags styled directly
 *   5. COMPONENTS     — constant: panel, card, chip, buttons, status, paging, menu
 *
 * Layout model: children of .row / .column take their natural size and stack
 * from the start — a fixed item is just a width/height, no class. .stretch is
 * the one flexing element (empty = a spacer; with content = a flexible region;
 * .stretch-2 / .stretch-3 weight the shares).
 */

/* ============================================================
   1. RESET
   ============================================================ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body { min-height: 100vh; overflow-x: hidden; display: flex; flex-direction: column; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
img, svg, video { max-width: 100%; height: auto; display: block; }

/* ============================================================
   2. THEME TOKENS  — the only section a theme changes  (sunshine yellow)
   ============================================================ */
:root {
  /* colour */
  --bg: #fffdf3;               /* warm cream page base */
  --surface: #ffffff;          /* panels, cards, the intro area */
  --surface-soft: #fff6cf;     /* nested panels / soft fills */
  --section-bg: #fff2bb;       /* pale sunny yellow */
  --band: #ffe79a;             /* slightly darker — the full-width section band */
  --pad: 28px;                 /* content side padding */
  --header-bg: #ffd21a;        /* bright sunshine yellow — the menu */
  --header-bg-2: #ffe066;      /* paler band for a stacked sub-nav */
  --fg: #3a2f12;               /* warm dark-brown text */
  --heading: #2a2008;
  --muted: #897946;
  --border: #f0e3a4;           /* warm gold border */
  --border-strong: #e3cf78;
  --accent: #c25e0d;           /* warm orange — buttons, links, active */
  --accent-hover: #a44d09;
  --accent-fg: #ffffff;
  --accent-tint: #ffeeb0;      /* warm light — hovers, focus, quotes */
  --accent-2: #0d9488;         /* teal — for "active" chips/badges */
  --accent-2-tint: #d5f3ef;
  --code-bg: #2a2410;          /* warm dark code block */
  --code-fg: #f0e6c4;
  /* syntax highlighting — bright tokens on the warm-dark code block */
  --hl-tag:     #7cc4ff;       /* html tags · css at-rules */
  --hl-attr:    #f0c66b;       /* html attributes · css properties */
  --hl-value:   #8fe0a0;       /* html attribute values · css values · js strings */
  --hl-comment: #9b9b9b;       /* comments, any language — grey */
  --hl-kw:      #cbb6f5;       /* js keywords */
  --hl-fn:      #7fd6e0;       /* js function and method names */
  --hl-num:     #f0a98a;       /* js numbers */
  --ok-fg: #04603e; --ok-bg: #e9fbf2; --ok-bd: #a6e9c8;
  --err-fg: #ad1b14; --err-bg: #fdf0ef; --err-bd: #f6c9c6;
  --info-fg: #2f4ad6; --info-bg: #eef1ff; --info-bd: #c5cefb;
  --warn-fg: #9a5a05; --warn-bg: #fff4d6; --warn-bd: #f3df9a;
  /* type */
  --font: system-ui, -apple-system, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
  --font-hand: 'Snell Roundhand', 'Bradley Hand', 'Segoe Script', cursive;   /* the handwritten wordmark / hero title */
  --mono: ui-monospace, 'SF Mono', Menlo, Consolas, monospace;
  /* space + shape */
  --gap: 16px;                 /* the one spacing rhythm — content flow, rows, columns, grids */
  --sep-1: 28px;               /* section separation, by nesting depth — first level… */
  --sep-2: 20px;               /*   …one level in… */
  --sep-3: 14px;               /*   …two levels in */
  --radius: 14px;
  --radius-sm: 9px;
  --radius-pill: 999px;
  --maxw: 1040px;
  --shadow-sm: 0 1px 2px rgba(120, 90, 10, 0.05), 0 1px 3px rgba(120, 90, 10, 0.07);
  --shadow-md: 0 6px 14px -4px rgba(120, 90, 10, 0.13), 0 2px 6px -2px rgba(120, 90, 10, 0.07);
  --shadow-lg: 0 20px 30px -12px rgba(120, 90, 10, 0.20);
}

/* ============================================================
   3. LAYOUT  — structure only; references --gap, never colour
   ============================================================ */
.row, .column { display: flex; gap: var(--gap); }
.row { flex-direction: row; }
.column { flex-direction: column; }
.row > *, .column > * { flex: 0 0 auto; min-width: 0; min-height: 0; }   /* natural size, from the start */
.stretch { flex: 1 1 0; min-width: 0; min-height: 0; }                    /* eats / shares the remainder */
.stretch-2 { flex-grow: 2; }
.stretch-3 { flex-grow: 3; }
.grid { display: grid; gap: var(--gap); grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.grid.cols-2 { grid-template-columns: repeat(2, 1fr); }
.grid.cols-3 { grid-template-columns: repeat(3, 1fr); }
.grid.cols-4 { grid-template-columns: repeat(4, 1fr); }
.flow { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
/* explicit grids collapse gracefully on narrow screens */
@media (max-width: 860px) { .grid.cols-3, .grid.cols-4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 680px) { .grid.cols-2, .grid.cols-3, .grid.cols-4 { grid-template-columns: 1fr; } }

/* ============================================================
   4. ELEMENTS  — semantic tags styled directly
   ============================================================ */
body {
  background: radial-gradient(130% 760px at 50% 120px, #fff5d3, #ffffff);   /* light main-area glow: warm light centre just under the top of main, easing out to white over a distance wider than the screen */
  color: var(--fg);
  font-family: var(--font);
  font-size: 16px;
  line-height: 1.65;
}

/* typography */
h1, h2, h3, h4, h5, h6 { color: var(--heading); font-weight: 700; line-height: 1.2; letter-spacing: -0.015em; }
h1 { font-size: 2rem; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; letter-spacing: -0.01em; }
h4 { font-size: 1.02rem; letter-spacing: 0; }
h5, h6 { font-size: 0.9rem; letter-spacing: 0; }
/* Headings carry no spacing of their own. Within a part everything is one gap; the only
   margin in the flow is a section's own top margin (see the sections rules below), and a
   heading is always its section's first child, so it sits flush with nothing to reset. */
a { color: var(--accent); text-decoration: none; transition: color 0.15s ease; }
a:hover { color: var(--accent-hover); text-decoration: underline; }
strong { font-weight: 650; color: var(--heading); }
small { color: var(--muted); font-size: 0.875em; }
ul, ol { padding-left: 1.4em; }
li { margin: 5px 0; }
li::marker { color: var(--accent); }
/* description list — term → description pairs, laid out as two columns */
dl { display: grid; grid-template-columns: max-content 1fr; gap: 8px 18px; }
dt { font-weight: 600; color: var(--heading); }
dd { color: var(--fg); }
hr { border: none; border-top: 1px solid var(--border); }
code { font-family: var(--mono); font-size: 0.88em; background: var(--surface-soft); border: 1px solid var(--border); padding: 0.1em 0.4em; border-radius: 6px; }
pre { background: var(--code-bg); color: var(--code-fg); border-radius: var(--radius-sm); padding: 16px 18px; overflow-x: auto; box-shadow: var(--shadow-sm); font-size: 0.85rem; line-height: 1.6; width: 100%; max-width: 54rem; margin-inline: auto; }   /* one consistent width (fills to the cap, not to its content), centred, a touch narrower than the content — and it fills once the screen itself is narrower */
/* a captioned code block: the figure is the centred, capped unit; the code fills it and the short caption sits beneath, aligned to the code's left edge */
figure:has(> pre) { width: 100%; max-width: 54rem; margin-inline: auto; }
figure:has(> pre) > pre { max-width: 100%; }
pre code { background: none; border: none; padding: 0; color: inherit; font-size: inherit; }
/* syntax highlighting: a language tab pinned to the top-right, and per-token colours.
   Spans are baked into the markup — <code class="html|css|js"> with .tag/.attr/.value/.comment inside. */
pre { position: relative; }                             /* positioning context for the language tab */
pre > code[class] { display: block; padding-top: 14px; }  /* reserve room so the tab clears the first line */
pre > code[class]::before {
  position: absolute; top: 0; right: 0; padding: 3px 11px;
  font-family: var(--font); font-size: 0.66rem; font-weight: 700;
  letter-spacing: 0.09em; text-transform: uppercase;
  color: var(--code-fg); background: rgba(255, 255, 255, 0.06);
  border-left: 1px solid rgba(255, 255, 255, 0.14);
  border-bottom: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 0 var(--radius-sm) 0 var(--radius-sm);
}
pre > code.html::before { content: "html"; }
pre > code.css::before  { content: "css"; }
pre > code.js::before   { content: "javascript"; }
code.html         { color: #f5f5f5; }   /* html: plain element text reads white, not the warm cream */
pre code .tag     { color: var(--hl-tag); }
pre code .attr    { color: var(--hl-attr); }
pre code .value   { color: var(--hl-value); }
pre code .comment { color: var(--hl-comment); }
pre code .kw      { color: var(--hl-kw); }
pre code .fn      { color: var(--hl-fn); }
pre code .num     { color: var(--hl-num); }
blockquote { padding: 10px 18px; border-left: 3px solid var(--accent); background: var(--accent-tint); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; color: var(--fg); }
/* figure: a block (image, code) tied to its caption — the caption is part of the
   component, sitting tight at a fixed distance, outside the flow rhythm */
figure { display: flex; flex-direction: column; gap: 6px; }
figcaption { color: var(--muted); font-size: 0.9em; text-align: center; }   /* caption centred beneath the block */

/* header: the site chrome — a bright sunshine-yellow menu, sticky, stacked bars */
header {
  position: sticky; top: 0; z-index: 10;
  background: var(--header-bg);
  border-bottom: 2px solid rgba(0, 0, 0, 0.08);
  box-shadow: 0 2px 10px rgba(180, 130, 10, 0.20);
}
nav { display: flex; flex-wrap: wrap; align-items: center; gap: 14px; }
nav > a, nav > span { font-weight: 700; color: var(--heading); letter-spacing: -0.01em; }   /* a bar's title */
nav > a:hover { text-decoration: none; }
nav > ul { display: flex; flex-wrap: wrap; align-items: center; gap: 2px; margin: 0; padding: 0; list-style: none; }
nav > ul > li { margin: 0; }
nav ul a { display: block; padding: 7px 13px; border-radius: 8px; white-space: nowrap; color: var(--fg); font-size: 0.95rem; font-weight: 500; text-decoration: none; transition: background 0.15s, color 0.15s; }
nav ul a:hover { background: rgba(0, 0, 0, 0.07); color: var(--heading); text-decoration: none; }
nav a[aria-current] { background: var(--accent); color: #fff; }
nav a[aria-current]:hover { background: var(--accent); color: #fff; }
header > nav { padding: 12px 28px; }
header > nav:first-of-type > a { display: inline-flex; align-items: center; gap: 9px; font-family: var(--font-hand); font-weight: 700; font-size: 1.7rem; letter-spacing: 0; line-height: 1; }   /* brand: sun icon + bold handwritten wordmark */
header > nav:first-of-type > a img { width: 32px; height: 32px; display: block; }
header > nav:first-of-type > ul { margin-left: auto; }                        /* brand left, links right */
header > nav ~ nav { border-top: 1px solid rgba(0, 0, 0, 0.08); background: var(--header-bg-2); padding-top: 9px; padding-bottom: 9px; }
header > nav ~ nav > span { font-size: 0.85rem; color: var(--accent-hover); text-transform: uppercase; letter-spacing: 0.05em; }
header > nav ~ nav ul a { font-size: 0.9rem; }

/* nav dropdowns (no JS): a nested <ul> in <details> (click) or bare (hover/focus) */
nav li { position: relative; }
nav li > ul, nav details > ul {
  position: absolute; top: calc(100% + 6px); left: 0; z-index: 20;
  display: flex; flex-direction: column; gap: 2px;
  min-width: 210px; margin: 0; padding: 6px; list-style: none;
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius-sm); box-shadow: var(--shadow-md);
}
nav li > ul li, nav details > ul li { margin: 0; }
nav summary { display: block; padding: 7px 13px; border-radius: 8px; cursor: pointer; color: var(--fg); font-size: 0.95rem; font-weight: 500; list-style: none; }
nav summary:hover { background: rgba(0, 0, 0, 0.07); color: var(--heading); }
nav summary::-webkit-details-marker { display: none; }
nav summary::after { content: "  ▾" / ""; color: var(--muted); }
nav details[open] > summary { background: rgba(0, 0, 0, 0.07); color: var(--heading); }
nav details[open] > summary::after { content: "  ▴" / ""; }
nav li:has(> ul) > a::after { content: "  ▾" / ""; color: var(--muted); }
nav li > ul { visibility: hidden; opacity: 0; transform: translateY(-4px); transition: opacity 0.12s ease, transform 0.12s ease, visibility 0.12s; }
nav li:hover > ul, nav li:focus-within > ul { visibility: visible; opacity: 1; transform: none; }

/* main: a white intro with a warm radial glow; sections sit on pale yellow */
main {
  flex: 1 0 auto;                /* grow to fill: footer sticks to the bottom */
  width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 44px var(--pad) 0;
  display: flex; flex-direction: column; gap: 0;
  /* no background here — the intro shows the body glow through, full-width with no edge */
}
/* darker band filler — keeps short pages banded all the way down to the footer */
main::after { content: ""; flex: 1 0 auto; margin-inline: calc(var(--pad) * -1); background: var(--band); box-shadow: 0 0 0 100vw var(--band); clip-path: inset(0 -100vw); }
main > h1 { font-size: clamp(1.9rem, 4vw, 2.5rem); letter-spacing: -0.025em; line-height: 1.12; }
main > h1 + p { max-width: 72ch; font-size: 1.15rem; color: var(--muted); }
/* a top-level feature list (e.g. the homepage goals): roomy, a lead line each */
main > ul { padding-left: 1.3em; max-width: 70ch; }
main > ul > li { margin: 0 0 18px; }
main > ul > li:last-child { margin-bottom: 0; }
main > ul > li > strong { font-size: 1.05rem; }
main > ul > li > p { margin-top: 4px; color: var(--muted); }

/* A section is the always-on structural unit — one around each heading and its content,
   nested to mirror the outline. Flow spacing is two rules and nothing else:
     • content rides one --gap, imposed by the container on its direct children (any element);
     • a subsection carries the between-part margin --sep, which tightens with nesting depth.
   Only sections set a margin; a first child is always flush. */
section { display: flex; flex-direction: column; }

main > *, main section > *                       { margin-top: var(--gap); }   /* content rhythm */
main > :first-child, main section > :first-child { margin-top: 0; }            /* first child flush */

main > *                  { --sep: var(--sep-1); }   /* separation tightens with depth */
main section > *          { --sep: var(--sep-2); }
main section section > *  { --sep: var(--sep-3); }

main section > section    { margin-top: var(--sep); }   /* a subsection sits --sep apart */

/* Backgrounds are a styling layer applied by position (or the user's own selector) — no
   class. The default theme paints the first-level sections as full-width bands: content
   stays centred while the background bleeds edge-to-edge via a clipped spread shadow. The
   first band keeps its --sep above it; the rest run flush. Nested sections stay transparent. */
main > section               { margin-top: 0; margin-inline: calc(var(--pad) * -1); padding: var(--sep) var(--pad); background: var(--band); box-shadow: 0 0 0 100vw var(--band); clip-path: inset(0 -100vw); }
main > section:first-of-type { margin-top: var(--sep); }
main > section > h2          { padding-bottom: 8px; border-bottom: 2px solid var(--border-strong); }

/* tables */
table { width: 100%; border-collapse: collapse; }
caption { text-align: left; padding: 8px 0; font-weight: 600; color: var(--muted); }
th, td { padding: 11px 12px; text-align: left; border-bottom: 1px solid var(--border); }
thead th { font-size: 0.78rem; font-weight: 600; text-transform: uppercase; letter-spacing: 0.04em; color: var(--muted); background: var(--surface-soft); border-bottom: 1px solid var(--border-strong); }
tbody tr { transition: background 0.12s; }
tbody tr:hover { background: var(--accent-tint); }
tbody tr:last-child td { border-bottom: none; }

/* forms */
form { display: grid; gap: 15px; }
fieldset { padding: 16px; display: grid; gap: 10px; border: 1px solid var(--border); border-radius: var(--radius-sm); }
legend { font-weight: 600; padding: 0 6px; color: var(--heading); }
label > p { font-weight: 550; font-size: 0.9rem; margin-bottom: 6px; color: var(--heading); }
input, select, textarea { width: 100%; padding: 9px 12px; font: inherit; color: var(--fg); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); transition: border-color 0.15s, box-shadow 0.15s; }
input:focus, select:focus, textarea:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-tint); }
textarea { min-height: 96px; resize: vertical; }
input[type="checkbox"], input[type="radio"] { width: auto; margin-right: 7px; accent-color: var(--accent); }
/* The 100% width above is for a stacked form (form / fieldset are grids). In a row
   a field is a flex item: let it shrink so it shares the free space and fits the
   flow instead of forcing 100% and pushing the row wider. .row > * already sets
   min-width: 0, so it can shrink cleanly; checkboxes and radios are width: auto,
   so they have nothing to shrink and stay their natural size. */
.row > :is(input, select, textarea) { flex-shrink: 1; }

/* buttons (the element) + link buttons */
button, input[type="submit"], input[type="reset"], input[type="button"], a.button {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  width: auto; padding: 9px 18px; font: inherit; font-weight: 550; line-height: 1.4;
  cursor: pointer; text-align: center; text-decoration: none;
  background: var(--accent); color: var(--accent-fg);
  border: 1px solid var(--accent); border-radius: var(--radius-sm);
  box-shadow: var(--shadow-sm); transition: background 0.15s, box-shadow 0.15s, transform 0.1s;
}
button:hover, input[type="submit"]:hover, input[type="button"]:hover, a.button:hover {
  background: var(--accent-hover); border-color: var(--accent-hover); color: var(--accent-fg);
  box-shadow: var(--shadow-md); text-decoration: none; transform: translateY(-1px);
}
/* button variants */
.button.secondary, input[type="reset"], button.secondary { background: var(--surface); color: var(--fg); border-color: var(--border-strong); box-shadow: none; }
.button.secondary:hover, input[type="reset"]:hover, button.secondary:hover { background: var(--surface-soft); color: var(--fg); border-color: var(--border-strong); box-shadow: var(--shadow-sm); }
.button.ghost, button.ghost { background: transparent; color: var(--accent); border-color: transparent; box-shadow: none; }
.button.ghost:hover, button.ghost:hover { background: var(--accent-tint); color: var(--accent-hover); }
.button.small, button.small { padding: 5px 12px; font-size: 0.9rem; }
.button.large, button.large { padding: 12px 24px; font-size: 1.05rem; }

/* menu: a sidebar nav */
menu { display: block; margin: 0; padding: 8px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow-sm); }
menu ol, menu ul { list-style: none; margin: 0; padding: 0; }
menu li { margin: 2px 0; }
menu p { margin: 12px 8px 4px; font-size: 0.72rem; font-weight: 700; text-transform: uppercase; letter-spacing: 0.06em; color: var(--muted); }
menu a { display: block; padding: 7px 12px; color: var(--fg); border-radius: 8px; transition: background 0.15s; }
menu a:hover { background: var(--surface-soft); text-decoration: none; }
menu a[aria-current] { background: var(--accent-tint); color: var(--accent-hover); font-weight: 600; box-shadow: inset 2px 0 0 var(--accent); }

/* ============================================================
   5. COMPONENTS
   ============================================================ */
/* panel — a soft surface (a neutral skin that composes with layout classes).
   card — a styling class, not an element: a bordered, padded surface you add to
   whatever already carries the meaning (article, section, p, div, a). It only
   paints — children flow at the system --gap, so adding or removing .card never
   reflows them. <article> is not boxed on its own; add .card when you want the
   surface. */
.panel { display: block; background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); }
.panel .panel { background: var(--surface-soft); box-shadow: none; }
.card { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); padding: 20px; box-shadow: var(--shadow-sm); display: flex; flex-direction: column; gap: var(--gap); transition: box-shadow 0.18s ease, border-color 0.18s ease, transform 0.12s ease; }
.card .card { background: var(--surface-soft); box-shadow: none; }   /* a nested card is an inset surface — same gap, just softer */
/* a card title takes no special colour: a plain heading stays the heading colour; a
   heading that is a link gets the link colour from the <a>, so accent follows the link. */
/* card links — two ways to make a whole card clickable.
   boxed link (a.card): the whole card is one <a>. Simplest, but it can hold no other links.
   stretched title link (.stretch-link): a card whose heading is a link; the link is stretched
   over the whole surface, so the card opens from anywhere while inner links/buttons still work
   and the card keeps its hover. Trade-off: card text isn't selectable (the overlay is the link). */
a.card { color: inherit; }
a.card:hover, .grid > a.card:hover { text-decoration: none; box-shadow: var(--shadow-md); border-color: var(--accent); transform: translateY(-2px); }
.stretch-link { position: relative; }
.stretch-link :is(h1, h2, h3, h4, h5, h6) a::after { content: ""; position: absolute; inset: 0; }
.stretch-link a:not(:is(h1, h2, h3, h4, h5, h6) a), .stretch-link button { position: relative; z-index: 1; }
.stretch-link:hover { text-decoration: none; box-shadow: var(--shadow-md); border-color: var(--accent); transform: translateY(-2px); }
.stretch-link:hover :is(h1, h2, h3, h4, h5, h6) a { color: var(--accent-hover); text-decoration: underline; }   /* the title link fills the card, so its lit state follows the CARD's hover — steady wherever the pointer is, even over a sub-link */

/* thumb — a small line-diagram of a component page, sitting atop an overview card.
   A wireframe in the site's three tones only: the darker yellow (#ffd21a) draws every
   outline, the lighter yellow (#fff6cf) is the one fill, everything else stays white.
   No frame and no vertical padding — each SVG's viewBox is cropped to its content, so it
   sits tight top-and-bottom; the side padding keeps it narrower than the card. */
.thumb { display: block; width: 100%; height: auto; padding: 0 12px; }
.thumb .box { fill: #fff; stroke: var(--header-bg); stroke-width: 2; }               /* a plain surface — outline only */
.thumb .bar { fill: var(--surface-soft); stroke: var(--header-bg); stroke-width: 2; } /* a filled bar / nav */
.thumb .at  { fill: var(--surface-soft); stroke: var(--header-bg); stroke-width: 2; } /* a highlighted / active surface */
.thumb .a   { fill: var(--surface-soft); stroke: var(--header-bg); stroke-width: 2; } /* headings, buttons, the brand mark — a filled accent */
.thumb .m   { fill: none; stroke: var(--header-bg); stroke-width: 1.5; }              /* text lines — outlined */
.thumb .ln  { stroke: var(--header-bg); stroke-width: 1.5; }                          /* table rules */

/* chip — an inline pill label; a button/a chip is interactive */
.chip { display: inline-flex; align-items: center; gap: 6px; padding: 4px 12px; font-size: 0.85rem; font-weight: 550; line-height: 1.5; color: var(--fg); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-pill); }
button.chip, a.chip { cursor: pointer; text-decoration: none; transition: background 0.15s, border-color 0.15s, color 0.15s; }
button.chip:hover, a.chip:hover { background: var(--accent-tint); border-color: var(--accent); color: var(--accent-hover); text-decoration: none; }
.chip.accent { background: var(--accent-tint); border-color: transparent; color: var(--accent-hover); }
.chip.teal { background: var(--accent-2-tint); border-color: transparent; color: var(--accent-2); }

/* buttons — a group of actions */
.buttons { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }

/* tabset — an in-page tab set, no JavaScript and no IDs. Inside .tabset a <label> holding a
   radio is a tab, and the element immediately after it is that tab's content. The radios
   share a name, so exactly one is ever chosen; :has() hides every unchosen tab's content
   and leaves the chosen one showing. Anything else you drop in (a lead line, a note) is
   neither a tab nor hidden, so it rides along above the strip. The radios hold the state,
   so a script can read the choice from a radio's value via its change event. */
/* the unit is a soft strip; the tabs ride along its top, the chosen tab's content joins
   flush beneath as one bordered card */
.tabset { display: flex; flex-wrap: wrap; align-items: flex-start; gap: 8px; padding: 8px; background: var(--surface-soft); border: 1px solid var(--border-strong); border-radius: var(--radius); }
/* a tab — a label styled like a button; its radio is taken out of sight but stays focusable */
.tabset > label { order: 1; position: relative; display: inline-flex; align-items: center; gap: 7px; padding: 9px 18px; cursor: pointer; font-weight: 550; line-height: 1.4; color: var(--fg); background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius-sm); box-shadow: var(--shadow-sm); transition: background 0.15s, color 0.15s, border-color 0.15s, box-shadow 0.15s; }
.tabset > label:hover { border-color: var(--accent); color: var(--accent-hover); }
.tabset > label:has(input:checked) { background: var(--accent); color: var(--accent-fg); border-color: var(--accent); box-shadow: var(--shadow-md); }
.tabset > label:has(input:checked):hover { color: var(--accent-fg); }
.tabset > label:has(input:focus-visible) { outline: 2px solid var(--accent); outline-offset: 2px; }
.tabset > label > input { position: absolute; width: 1px; height: 1px; margin: -1px; padding: 0; border: 0; clip: rect(0 0 0 0); overflow: hidden; }
/* the content — the element straight after a tab. It breaks out to the strip's edges and
   joins flush at the bottom; only the chosen tab's content is left showing. */
.tabset > label:has(input) + * { order: 2; flex: 0 0 auto; width: calc(100% + 16px); margin: 0 -8px -8px; padding: 20px; background: var(--surface); border-top: 1px solid var(--border-strong); border-radius: 0 0 var(--radius) var(--radius); }
.tabset > label:has(input) + * > * + * { margin-top: var(--gap); }        /* content inside the panel rides the one gap */
.tabset > label:has(input:not(:checked)) + * { display: none; }           /* hide every unchosen tab's content */
/* vertical — the tabs stack in a column and the chosen content fills the space beside them */
.tabset.vertical { display: grid; grid-template-columns: max-content minmax(0, 1fr); row-gap: 0; column-gap: 8px; align-content: start; }
.tabset.vertical > label { grid-column: 1; width: 100%; margin-bottom: 6px; justify-content: flex-start; }
.tabset.vertical > label:has(input) + * { grid-column: 2; grid-row: 1 / span 50; width: auto; margin: 0; border: 1px solid var(--border-strong); border-radius: var(--radius-sm); }

/* accordion — a stack of disclosure panels built on the native <details> element. Each
   row is a <details>; its <summary> is the always-visible header and the rest of the
   content shows when the row is open. No JS — the browser owns open/closed. Give every
   <details> the same name to make a single-open set (opening one closes the siblings);
   leave the name off and any number of rows can stand open at once. Wrapping the rows in
   .accordion fuses them into one bordered unit with shared dividers. */
.accordion { background: var(--surface); border: 1px solid var(--border-strong); border-radius: var(--radius); box-shadow: var(--shadow-sm); overflow: hidden; }
.accordion > details + details { border-top: 1px solid var(--border-strong); }   /* a divider between rows */
.accordion > details > summary { display: flex; align-items: center; gap: 10px; padding: 14px 18px; font-weight: 600; color: var(--heading); background: var(--surface); cursor: pointer; list-style: none; transition: background 0.15s; }
.accordion > details > summary:hover { background: var(--surface-soft); }
.accordion > details > summary::-webkit-details-marker { display: none; }         /* drop the native triangle; the chevron below replaces it */
.accordion > details > summary::after { content: "▾"; margin-left: auto; color: var(--muted); transition: transform 0.2s ease; }
.accordion > details[open] > summary { background: var(--surface-soft); border-bottom: 1px solid var(--border-strong); }
.accordion > details[open] > summary::after { transform: rotate(180deg); }
.accordion > details > :not(summary) { padding-inline: 18px; }                    /* body content keeps the header's side inset */
.accordion > details > summary + :not(summary) { padding-top: 14px; }             /* first body block clears the header */
.accordion > details > :last-child:not(summary) { padding-bottom: 16px; }         /* last body block leaves a base */
.accordion > details > :not(summary) + :not(summary) { margin-top: var(--gap); }  /* the content rhythm between body blocks */

/* status — a banner / live region */
.status { display: block; padding: 11px 15px; border-radius: var(--radius-sm); border: 1px solid var(--border); font-weight: 500; }
.status.success { background: var(--ok-bg); border-color: var(--ok-bd); color: var(--ok-fg); }
.status.error   { background: var(--err-bg); border-color: var(--err-bd); color: var(--err-fg); }
.status.info    { background: var(--info-bg); border-color: var(--info-bd); color: var(--info-fg); }
.status.warning { background: var(--warn-bg); border-color: var(--warn-bd); color: var(--warn-fg); }

/* paging — a Pagination nav */
.paging { display: flex; flex-wrap: wrap; gap: 4px; justify-content: center; }
.paging a, .paging span { display: inline-block; padding: 7px 13px; border-radius: 8px; color: var(--fg); text-decoration: none; }
.paging a:hover { background: var(--surface); box-shadow: var(--shadow-sm); text-decoration: none; }
.paging a[aria-current] { background: var(--accent); color: var(--accent-fg); }
.paging span { color: var(--muted); }

/* footer — full-width bar; content constrained and centred, copyright left / credit right */
footer { flex-shrink: 0; background: var(--bg); border-top: 1px solid var(--border-strong); color: var(--muted); }
footer > .row { width: 100%; padding: 22px var(--pad); align-items: center; flex-wrap: wrap; }   /* full window width, not the content column */
footer a { color: var(--muted); text-decoration: underline; }



/* ============================================================
   LEWPEN.COM  — a theme layer over stylesheet.org.
   Per the framework's rule, a theme changes TOKENS only; the two
   blocks below add just what the core file omits (.crumbs, .band)
   and a couple of thin helpers for media/cards.
   ============================================================ */

/* 1. THEME TOKENS — cool paper + slate chrome, faithful to old lewpen.com.
      Subtle per-section accents: clients gold (#fc6), games red (#faa). */
:root{
  --bg:#eef2f7;
  --surface:#ffffff;
  --surface-soft:#eef2f7;
  --section-bg:#e6ecf3;
  --band:#e6ecf3;
  --header-bg:#334155;
  --header-bg-2:#3f4d63;
  --fg:#1f2733;
  --heading:#0f172a;
  --muted:#5b6675;
  --border:#dbe2ea;
  --border-strong:#c4cdd8;
  --accent:#3f5266;
  --accent-hover:#2c3b4c;
  --accent-fg:#ffffff;
  --accent-tint:#e5ebf2;
  --accent-2:#3f7d5a;
  --accent-2-tint:#dcefe4;
  --font: 'Segoe UI', system-ui, -apple-system, Roboto, Helvetica, Arial, sans-serif;
  --font-hand: var(--font);      /* no cursive wordmark — keep the brand plain */
  --maxw:1180px;
}
/* the sunshine-yellow radial glow on <body> in the core → a cool one */
body{ background:radial-gradient(130% 760px at 50% 120px, #ffffff, var(--bg)); }

/* faithful subtle section accents (token-only overrides) */
body.section-clients { --accent:#b8860b; --accent-hover:#976f09; --accent-tint:#f6ecd2; }
body.section-games   { --accent:#c0504d; --accent-hover:#a23f3c; --accent-tint:#f7e2e1; }
body.section-projects{ --accent:#3f7d5a; --accent-hover:#336749; --accent-tint:#dcefe4; }
body.section-services{ --accent:#3f6690; --accent-hover:#315376; --accent-tint:#dde7f3; }
body.section-articles{ --accent:#3f5aa6; --accent-hover:#324a89; --accent-tint:#dfe4f5; }
body.section-contact { --accent:#5b6675; --accent-hover:#454e5b; --accent-tint:#e6e9ee; }
body.section-blog    { --accent:#6a5aa6; --accent-hover:#554888; --accent-tint:#e6e2f3; }

/* 2. HELPERS the core file omits (present in sprites.org's build) --------- */

/* breadcrumb row — separators drawn in CSS */
.crumbs { display:flex; flex-wrap:wrap; align-items:center; margin:0 0 var(--gap); font-size:0.9rem; color:var(--muted); }
.crumbs a { color:var(--muted); text-decoration:underline; text-underline-offset:2px; transition:color 0.15s; }
.crumbs a:hover { color:var(--accent-hover); }
.crumbs > * + *::before { content:"\203A"; display:inline-block; margin:0 10px; color:var(--muted); opacity:0.6; text-decoration:none; }
/* the current (last) crumb is plain text, no active-nav background */
.crumbs a[aria-current], .crumbs a[aria-current]:hover { background:none; color:var(--heading); font-weight:600; }

/* links carry an underline everywhere EXCEPT the top menu; buttons and boxed
   cards are components, not text links, so they stay undecorated */
a { text-decoration:underline; text-underline-offset:2px; }
header nav a, header nav a:hover { text-decoration:none; }
a.button, a.button:hover, a.card, a.card:hover { text-decoration:none; }

/* a .band stands in for a first-level section on layout (menu + content) pages */
main > section, main > .band               { margin-top:0; margin-inline:calc(var(--pad) * -1); padding:var(--sep) var(--pad); background:var(--band); box-shadow:0 0 0 100vw var(--band); clip-path:inset(0 -100vw); }
main > section:first-of-type, main > .band:first-of-type { margin-top:var(--sep); }
main > .band .row > .column > section > h2 { padding-bottom:8px; border-bottom:2px solid var(--border-strong); }
main > .band > .row { gap:calc(var(--gap) * 1.5); align-items:start; }
main > :last-child { padding-bottom:calc(var(--sep-1) * 4); }

/* the sidebar menu keeps its natural width in the row and sticks while scrolling */
main .row > menu { flex:0 0 220px; align-self:start; }
main > .band > .row > menu { position:sticky; top:74px; }
@media (max-width:780px){ main .row:has(> menu){ flex-direction:column; } main .row > menu{ position:static; flex-basis:auto; width:100%; } }
menu a[aria-current] { background:var(--accent); color:#fff; box-shadow:none; }
menu a[aria-current]:hover { background:var(--accent); color:#fff; }
menu ul ul { margin:2px 0 6px 10px; border-left:2px solid var(--border); padding-left:6px; }

/* 3. THIN COMPONENT HELPERS (image inside a card, the media player frame) -- */
.card-img { display:block; width:calc(100% + 40px); max-width:none; margin:-20px -20px 0 -20px; border-radius:var(--radius) var(--radius) 0 0; aspect-ratio:16/9; object-fit:cover; object-position:center; background:var(--surface-soft); }
.card small { color:var(--muted); margin-top:auto; }
/* browsable source file list */
.source-list { list-style:none; padding:0; margin:0; }
.source-list li { margin:4px 0; }
.source-list a { font-family:var(--mono); font-size:0.92rem; }
.source-list small { color:var(--muted); margin-left:6px; }
.player { align-items:center; }
.player > object, .player > iframe, .player > cheerpj-applet { max-width:100%; border-radius:var(--radius-sm); background:#111; }
.player > cheerpj-applet { display:block; }
.shot { display:block; border:1px solid var(--border-strong); border-radius:var(--radius-sm); overflow:hidden; background:var(--surface); }
.shot img { width:100%; height:100%; aspect-ratio:1/1; object-fit:cover; display:block; }

/* header brand + footer, kept minimal */
header > nav:first-of-type > a { font-family:var(--font); font-weight:700; font-size:1.25rem; color:#fff; }
header nav a { color:#dbe3ee; }
header nav a:hover { color:#fff; }
header nav > span { color:#c3ccd8; }
footer { width:100%; max-width:var(--maxw); margin:0 auto; padding:28px var(--pad); color:var(--muted); font-size:0.85rem; }
