/*
 * The charter site's own sheet, loaded after courtside.css. Only what a
 * documentation page needs (swatches, specimens, demo frames, code): nothing
 * here belongs in a club site, so nothing here is copied with the kit.
 */

/* ---- Section navigation under the hero ---- */
.docs-nav { margin-top: 1.4rem; }

/* ---- Layout helpers ---- */
.grid-2, .grid-3 { display: grid; gap: 1rem; margin: 1rem 0; }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(17rem, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); }
.grid-2 > .card, .grid-3 > .card { margin: 0; }
.lead { font-size: 1.08rem; max-width: 44rem; }
.prose { max-width: 46rem; }

/* A card that links to a section of the charter. */
a.card-link { display: block; color: var(--ink); text-decoration: none; }
a.card-link:hover { border-color: #000; }
a.card-link:hover .card-link-title { text-decoration: underline; }
.card-link-title { font-weight: 900; text-transform: uppercase; letter-spacing: 0.03em; margin: 0 0 0.25rem; }
.card-link p { color: var(--muted); font-size: 0.92rem; margin: 0; }

/* The four principles of the home page, numbered. */
.principles { counter-reset: principle; list-style: none; padding: 0; display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(14rem, 1fr)); }
.principles li { counter-increment: principle; background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); padding: 1rem; margin: 0; box-shadow: var(--shadow); }
.principles li::before {
  content: counter(principle); display: grid; place-items: center;
  width: 2rem; height: 2rem; border-radius: 50%; background: #000; color: var(--yellow);
  font-weight: 900; margin-bottom: 0.6rem;
}
.principles strong { display: block; margin-bottom: 0.2rem; }
.principles p { color: var(--muted); font-size: 0.92rem; margin: 0; }

/* ---- Code ---- */
code, pre { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.85em; }
:not(pre) > code { background: #ebe9e2; border-radius: 4px; padding: 0.08em 0.35em; overflow-wrap: anywhere; }
pre {
  background: #000; color: var(--black-text); border-radius: var(--radius);
  padding: 0.9rem 1rem; margin: 0.6rem 0 1rem; overflow-x: auto; line-height: 1.55;
  font-size: 0.8rem; tab-size: 2;
}
pre .c { color: var(--black-muted); }
pre .k { color: var(--yellow); }

/* ---- Demo: a live component in a frame, with its caption ---- */
.demo { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); margin: 1rem 0; overflow: hidden; box-shadow: var(--shadow); }
.demo-stage { padding: 1.2rem; }
.demo-stage > :first-child { margin-top: 0; }
.demo-stage > :last-child { margin-bottom: 0; }
.demo-stage-paper { background: var(--bg); }
.demo-stage-night { background: #000; color: #fff; }
.demo-stage-yellow { background: var(--yellow); }
.demo-stage-flush { padding: 0; }
.demo-caption { border-top: 1px solid var(--rule); padding: 0.6rem 1.2rem; font-size: 0.85rem; color: var(--muted); }
.demo-caption code { color: var(--ink); }
.demo-row { display: flex; flex-wrap: wrap; align-items: center; gap: 0.8rem; }
/* A demo header or hero must not stick, nor stretch past its frame. */
.demo .header { position: static; }
.demo .hero-inner, .demo .header-inner, .demo main { max-width: none; }
.demo main { padding-bottom: 1.2rem; }
.demo-narrow > * { max-width: 26rem; }

/* ---- Do / don't ---- */
.rules { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); margin: 1rem 0; }
.rule-card { background: var(--card); border: 1px solid var(--rule); border-top: 5px solid var(--green); border-radius: var(--radius); padding: 0.9rem 1rem; }
.rule-card.dont { border-top-color: var(--red); }
.rule-card .label { color: var(--green); }
.rule-card.dont .label { color: var(--red); }
.rule-card p, .rule-card ul { margin: 0; font-size: 0.93rem; }

/* ---- Logo stages ---- */
.logo-stages { display: grid; gap: 1rem; grid-template-columns: repeat(auto-fit, minmax(13rem, 1fr)); margin: 1rem 0; }
.logo-stage { border-radius: var(--radius); border: 1px solid var(--rule); overflow: hidden; background: var(--card); }
.logo-stage-art { display: grid; place-items: center; aspect-ratio: 4 / 3; padding: 1.2rem; }
.logo-stage-art img { max-height: 100%; width: auto; object-fit: contain; }
.logo-stage-art.on-night { background: #000; }
.logo-stage-art.on-paper { background: var(--bg); }
.logo-stage-art.on-yellow { background: var(--yellow); }
.logo-stage-art.on-photo { background: repeating-linear-gradient(135deg, #7d6a55 0 14px, #a48b70 14px 28px, #5e4f40 28px 42px); }
.logo-stage-caption { padding: 0.6rem 0.9rem; font-size: 0.85rem; border-top: 1px solid var(--rule); }
.logo-stage-caption strong { display: block; }
.logo-stage-caption span { color: var(--muted); }
.crest-art { height: 11rem; }
.badge-art { width: 9rem; height: 9rem; border-radius: 22px; }
.badge-round { border-radius: 50%; }
.logo-tiny { width: 24px; height: 24px; border-radius: 50%; }
.logo-16 { width: 16px; height: 16px; border-radius: 50%; }
.logo-32 { width: 32px; height: 32px; border-radius: 50%; }
.logo-48 { width: 48px; height: 48px; border-radius: 50%; }
.sizes-row { display: flex; align-items: flex-end; gap: 1.2rem; flex-wrap: wrap; }
.sizes-row figure { margin: 0; text-align: center; font-size: 0.78rem; color: var(--muted); }
.sizes-row figcaption { margin-top: 0.3rem; }
/* The don'ts, shown by distorting the real logo. */
.logo-stage-art .crest-stretched { width: 12rem; height: 5.5rem; max-height: none; }
.crest-recolored { filter: hue-rotate(180deg) saturate(1.4); }
.crest-rotated { transform: rotate(-14deg); }
.crest-outlined { filter: drop-shadow(0 0 6px #ff00c8) drop-shadow(0 0 2px #00e1ff); }
.crest-small { height: 3.2rem; }

/* Clear space around the crest: a dashed frame, one ball wide. */
.clearspace { position: relative; display: inline-block; padding: 2.2rem; background: var(--bg); border-radius: var(--radius); }
.clearspace::before { content: ""; position: absolute; inset: 2.2rem; border: 1px dashed var(--muted); pointer-events: none; }
.clearspace::after { content: ""; position: absolute; inset: 0; border: 2px dashed var(--orange); border-radius: var(--radius); pointer-events: none; }
.clearspace img { display: block; height: 9rem; width: auto; }

/* ---- Colours ---- */
.swatches { display: grid; gap: 0.8rem; grid-template-columns: repeat(auto-fill, minmax(12.5rem, 1fr)); margin: 0.8rem 0 1.4rem; }
.swatch { background: var(--card); border: 1px solid var(--rule); border-radius: var(--radius); overflow: hidden; }
.swatch-color { height: 5.2rem; border-bottom: 1px solid var(--rule); display: flex; align-items: flex-end; padding: 0.4rem 0.6rem; font-weight: 800; font-size: 0.82rem; }
.swatch-body { padding: 0.55rem 0.7rem 0.7rem; font-size: 0.82rem; }
.swatch-name { font-weight: 800; font-size: 0.92rem; }
.swatch-token { font-family: ui-monospace, "SF Mono", Menlo, Consolas, monospace; font-size: 0.78rem; }
.swatch-use { color: var(--muted); margin-top: 0.25rem; }
.swatch-ratio { margin-top: 0.3rem; font-variant-numeric: tabular-nums; font-weight: 700; }
.sw-yellow { background: var(--yellow); color: #000; }
.sw-black { background: #000; color: var(--yellow); }
.sw-bg { background: var(--bg); }
.sw-card { background: var(--card); }
.sw-rule { background: var(--rule); }
.sw-line { background: var(--line); }
.sw-ink { background: var(--ink); color: #fff; }
.sw-muted { background: var(--muted); color: #fff; }
.sw-link { background: var(--link); color: #fff; }
.sw-black-2 { background: var(--black-2); color: #fff; }
.sw-black-rule { background: var(--black-rule); color: #fff; }
.sw-black-muted { background: var(--black-muted); color: #000; }
.sw-black-text { background: var(--black-text); color: #000; }
.sw-green { background: var(--green); color: #fff; }
.sw-red { background: var(--red); color: #fff; }
.sw-orange { background: var(--orange); color: #fff; }
.sw-notice { background: var(--notice); }
.sw-selected { background: var(--selected); }
.sw-highlight { background: var(--highlight); }
.sw-alert { background: var(--alert); color: var(--red); }
.sw-ball { background: var(--ball); color: #000; }

/* Proportions bar: what share each colour takes on a page. */
.proportions { display: flex; height: 3rem; border-radius: var(--radius); overflow: hidden; border: 1px solid var(--rule); margin: 0.8rem 0 0.4rem; font-size: 0.78rem; font-weight: 800; }
.proportions span { display: flex; align-items: center; padding: 0 0.7rem; }
.prop-paper { flex: 60; background: var(--bg); }
.prop-card { flex: 22; background: var(--card); border-left: 1px solid var(--rule); }
.prop-night { flex: 12; background: #000; color: var(--yellow); }
.prop-yellow { flex: 6; background: var(--yellow); justify-content: center; }

/* Contrast pairs. */
.pairs { display: grid; gap: 0.6rem; grid-template-columns: repeat(auto-fill, minmax(11rem, 1fr)); margin: 0.8rem 0; }
.pair { border-radius: 10px; padding: 0.8rem; border: 1px solid var(--rule); font-weight: 800; }
.pair small { display: block; font-weight: 600; font-size: 0.75rem; margin-top: 0.2rem; opacity: 0.85; }
.pair-ink-bg { background: var(--bg); color: var(--ink); }
.pair-muted-bg { background: var(--bg); color: var(--muted); }
.pair-link-card { background: var(--card); color: var(--link); }
.pair-yellow-night { background: #000; color: var(--yellow); }
.pair-ink-yellow { background: var(--yellow); color: var(--ink); }
.pair-blackmuted-night { background: #000; color: var(--black-muted); }
.pair-yellow-card { background: var(--card); color: var(--yellow); }
.pair-yellow-bg { background: var(--bg); color: var(--yellow); }

/* ---- Typography ---- */
.specimen { display: grid; gap: 1rem; grid-template-columns: minmax(0, 1fr) minmax(0, 1.4fr); align-items: center; }
.specimen-glyph { font-size: clamp(5rem, 16vw, 9rem); font-weight: 900; line-height: 0.9; letter-spacing: -0.03em; }
.specimen-glyph span { color: var(--yellow); -webkit-text-stroke: 2px #000; }
.specimen-chars { font-size: 1.15rem; overflow-wrap: anywhere; }
.weights { display: grid; gap: 0.2rem; }
.weight { display: flex; align-items: baseline; gap: 1rem; padding: 0.4rem 0; border-bottom: 1px solid var(--rule); font-size: 1.5rem; line-height: 1.2; }
.weight:last-child { border-bottom: 0; }
.weight small { flex: none; width: 4.2rem; font-size: 0.75rem; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.weight span { flex: 1; min-width: 0; overflow-wrap: anywhere; }
.w-400 { font-weight: 400; }
.w-600 { font-weight: 600; }
.w-700 { font-weight: 700; }
.w-800 { font-weight: 800; }
.w-900 { font-weight: 900; }
.italic { font-style: italic; }
.display-sample { font: 400 clamp(1.6rem, 6vw, 2.6rem)/1.05 var(--display); color: var(--yellow); margin: 0; }
.display-sample span { color: #f0efe9; }
.scale .table td:first-child { width: 11rem; }
.scale-h1 { font-size: 1.7rem; font-weight: 900; text-transform: uppercase; letter-spacing: -0.015em; line-height: 1.1; }
.scale-h2 { font-size: 1.12rem; font-weight: 900; text-transform: uppercase; letter-spacing: 0.04em; }
.scale-h3 { font-size: 0.95rem; font-weight: 700; text-transform: uppercase; color: var(--muted); }
.scale-eyebrow { font-size: 0.78rem; font-weight: 600; letter-spacing: 0.2em; text-transform: uppercase; color: var(--link); }
.scale-label { font-size: 0.68rem; font-weight: 800; letter-spacing: 0.12em; text-transform: uppercase; color: var(--muted); }
.scale-body { font-size: 1rem; }
.scale-figure { font-size: 1.55rem; font-weight: 800; font-variant-numeric: tabular-nums; }
.figures-demo { font-size: 1.4rem; font-weight: 800; }
.figures-demo > span:not(.label) { display: block; }
.figures-right > span:not(.label) { text-align: right; }

/* ---- Layout diagrams ---- */
.wireframe { border: 2px solid #000; border-radius: 14px; overflow: hidden; background: var(--bg); font-size: 0.72rem; font-weight: 800; letter-spacing: 0.06em; text-transform: uppercase; }
.wf-header { background: #000; color: var(--black-text); padding: 0.45rem 0.7rem; display: flex; align-items: center; gap: 0.4rem; }
.wf-header::before { content: ""; width: 0.9rem; height: 0.9rem; border-radius: 50%; background: var(--yellow); }
.wf-hero { background: #000; color: var(--yellow); padding: 1.1rem 0.7rem 1.2rem; border-top: 1px solid var(--black-rule); position: relative; overflow: hidden; }
.wf-hero::after { content: ""; position: absolute; right: -1.2rem; top: 0; bottom: 0; width: 4rem; background: linear-gradient(115deg, transparent 46%, var(--yellow) 46%, var(--yellow) 54%, transparent 54%); }
.wf-body { padding: 0.7rem; display: grid; gap: 0.45rem; color: var(--muted); }
.wf-block { background: var(--card); border: 1px solid var(--rule); border-radius: 6px; padding: 0.5rem; }
.wf-block.tall { min-height: 3.5rem; }
.wf-block.accent { border-left: 3px solid var(--yellow); }
.wf-bar { height: 0.45rem; width: 1.8rem; background: var(--yellow); }
.wf-pill { justify-self: stretch; background: #000; color: var(--yellow); border-radius: 999px; text-align: center; padding: 0.45rem; }
.wf-phone { max-width: 12rem; margin: 0 auto; }

/* Inventory of the sites. */
.site-status { display: inline-block; font-size: 0.68rem; font-weight: 800; letter-spacing: 0.08em; text-transform: uppercase; padding: 0.1em 0.55em; border-radius: 999px; border: 1px solid currentColor; }
.site-public { color: var(--green); }
.site-private { color: var(--red); }
.site-drift { color: var(--orange); }

/* Signature moments. */
.moment { display: grid; gap: 0.2rem; }
.moment-name { font-weight: 900; text-transform: uppercase; letter-spacing: 0.03em; }
.moment-where { font-size: 0.82rem; color: var(--muted); }

@media (max-width: 40rem) {
  .specimen { grid-template-columns: 1fr; }
  .weight { font-size: 1.25rem; }
  .scale .table td:first-child { width: auto; }
}

/* The secondary button of a night demo, as it shows in the hero. */
.demo-stage-night .button-secondary { color: #fff; border-color: #fff; }
.demo-stage-night .button-secondary:hover { background: #fff; color: #000; }

/* A repo or file name cut over three lines reads as three names. */
.table code { white-space: nowrap; }
