/* Zariya Hub shell v0.1 (task H3). Works on top of https://brand.thezariya.com/v1/tokens.css with <html data-brand="hub">.
   Every colour reads a --brand-* token. The hex values below are fallbacks only, used if the brand site is unreachable.
   Change colours in the brand project, never here. */

:root {
  --h-bg: var(--brand-bg, #001B33);
  --h-alt: var(--brand-bg-alt, #012745);
  --h-surface: var(--brand-surface, #0B3A5E);
  --h-surface-hover: var(--brand-surface-hover, #164264);
  --h-text: var(--brand-text, #E7E4DC);
  --h-muted: var(--brand-text-muted, #9FB7C8);
  --h-line: var(--brand-line, #1E4D73);
  --h-primary: var(--brand-primary, #DA8F0E);
  --h-primary-hover: var(--brand-primary-hover, #DF9F30);
  --h-primary-active: var(--brand-primary-active, #E4AC4D);
  --h-on-primary: var(--brand-primary-contrast, #1B1A18);
  --h-accent: var(--brand-accent, #5FB3A5);
  --h-link: var(--brand-link, #5FB3A5);
  --h-link-hover: var(--brand-link-hover, #E7E4DC);
  --h-focus: var(--brand-focus, #DA8F0E);
  --h-warn-bg: var(--brand-warning-bg, #DA8F0E);
  --h-warn-text: var(--brand-warning-text, #1B1A18);
  --h-head: var(--brand-font-heading, 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', sans-serif);
  --h-body: var(--brand-font-body, 'Bricolage Grotesque', system-ui, -apple-system, 'Segoe UI', sans-serif);
  --h-label: var(--brand-font-label, 'IBM Plex Mono', ui-monospace, Menlo, Consolas, monospace);
  --h-serif: var(--font-cormorant-garamond, 'Cormorant Garamond', Georgia, 'Times New Roman', serif);
  --h-dur: var(--brand-dur, 240ms);
  --h-ease: var(--brand-ease, cubic-bezier(.34, 1.56, .64, 1));
  --s1: var(--space-1, .25rem); --s2: var(--space-2, .5rem); --s3: var(--space-3, .75rem); --s4: var(--space-4, 1rem);
  --s5: var(--space-5, 1.5rem); --s6: var(--space-6, 2rem); --s7: var(--space-7, 3rem); --s8: var(--space-8, 4rem); --s9: var(--space-9, 6rem);
  --max: var(--content-max, 1120px);
  --gut: var(--gutter, clamp(1rem, 4vw, 2rem));
  --t-xs: var(--text-xs, .75rem); --t-sm: var(--text-sm, .875rem); --t-md: var(--text-md, 1.125rem); --t-lg: var(--text-lg, 1.25rem);
  --t-2xl: var(--text-2xl, 2rem);
  --t-3xl: var(--text-3xl, clamp(2.25rem, 1.6rem + 2.5vw, 3rem));
  --t-4xl: var(--text-4xl, clamp(2.75rem, 1.8rem + 4vw, 4.5rem));
  --bw: var(--border-w, 1px);
}
@media (prefers-reduced-motion: reduce) { :root { --h-dur: 0ms; } }

*, *::before, *::after { box-sizing: border-box; }
html { color-scheme: dark; -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--h-bg); color: var(--h-text); font: var(--t-base, 1rem)/1.55 var(--h-body); }
img { max-width: 100%; height: auto; }
a { color: var(--h-link); transition: color var(--h-dur) var(--h-ease); }
a:hover { color: var(--h-link-hover); }
:focus-visible { outline: 2px solid var(--h-focus); outline-offset: 2px; }
h1, h2, h3 { font-family: var(--h-head); font-weight: 500; line-height: 1.1; margin: 0; }
p { margin: 0 0 var(--s4); }

.wrap { max-width: var(--max); margin: 0 auto; padding: 0 var(--gut); }
.label { font: 500 var(--t-xs)/1 var(--h-label); letter-spacing: .08em; text-transform: uppercase; color: var(--h-muted); margin: 0 0 var(--s3); }
.muted { color: var(--h-muted); }
.skip { position: absolute; left: var(--s4); top: -4rem; background: var(--h-primary); color: var(--h-on-primary); padding: var(--s3) var(--s4); z-index: 10; }
.skip:focus { top: var(--s3); }

/* header: fades in over the first 80px of scroll (hub.js sets --scroll) */
.site-header { position: sticky; top: 0; z-index: 5; padding: var(--s3) 0;
  background: rgb(var(--brand-bg-rgb, 0 27 51) / calc(var(--scroll, 0) * var(--scroll-scrim-alpha, .92)));
  border-bottom: var(--bw) solid transparent; transition: background var(--h-dur) var(--h-ease); }
.site-header .wrap { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: var(--s3) var(--s5); }
.site-header img { display: block; height: 48px; width: auto; }
.nav { display: flex; gap: var(--s5); margin: 0; padding: 0; list-style: none; }
.nav a { color: var(--h-text); text-decoration: none; font: 500 var(--t-sm)/1 var(--h-label); letter-spacing: .08em; text-transform: uppercase; padding: var(--s2) 0; border-bottom: 2px solid transparent; }
.nav a:hover { color: var(--h-link); }
.nav a[aria-current="page"] { border-bottom-color: var(--h-primary); }

/* buttons */
.btn { display: inline-block; background: var(--h-primary); color: var(--h-on-primary); border: 0; border-radius: 0; padding: var(--s3) var(--s5); font: 500 var(--t-base, 1rem)/1.2 var(--h-body); text-decoration: none; cursor: pointer; transition: background var(--h-dur) var(--h-ease); }
.btn:hover { background: var(--h-primary-hover); color: var(--h-on-primary); }
.btn:active { background: var(--h-primary-active); }

/* hero */
.hero { padding: var(--s8) 0 var(--s7); }
.hero h1 { font-size: var(--t-4xl); max-width: 16ch; margin-bottom: var(--s5); }
.hero .lede { font-size: var(--t-md); max-width: 52ch; color: var(--h-text); }
.hero .actions { display: flex; flex-wrap: wrap; align-items: center; gap: var(--s4) var(--s5); margin-top: var(--s5); }
.hero .note { color: var(--h-muted); font-size: var(--t-sm); margin-top: var(--s4); }

/* sections */
.section { padding: var(--s7) 0; border-top: var(--bw) solid var(--h-line); }
.section > .wrap > h2 { font-size: var(--t-3xl); margin-bottom: var(--s5); max-width: 20ch; }
.section .intro { max-width: 56ch; color: var(--h-muted); margin-bottom: var(--s6); }

/* the loop */
.loop { display: grid; grid-template-columns: repeat(auto-fit, minmax(9rem, 1fr)); gap: 0; margin: 0; padding: 0; list-style: none; border: var(--bw) solid var(--h-line); counter-reset: step; }
.loop li { padding: var(--s4); border-right: var(--bw) solid var(--h-line); border-bottom: var(--bw) solid var(--h-line); margin: -1px 0 0 -1px; counter-increment: step; }
.loop li::before { content: "0" counter(step); display: block; font: 500 var(--t-xs)/1 var(--h-label); color: var(--h-muted); margin-bottom: var(--s3); }
.loop strong { display: block; font: 500 var(--t-lg)/1.2 var(--h-head); }
.loop span { display: block; font-size: var(--t-sm); color: var(--h-muted); margin-top: var(--s2); }
.loop li.is-hub strong { color: var(--h-accent); }

/* rooms */
.rooms { display: grid; gap: var(--s4); grid-template-columns: repeat(auto-fill, minmax(17rem, 1fr)); margin: 0; padding: 0; list-style: none; }
.room { display: flex; flex-direction: column; gap: var(--s3); background: var(--h-surface); border: var(--bw) solid var(--h-line); padding: var(--s5); transition: background var(--h-dur) var(--h-ease); }
a.room { color: inherit; text-decoration: none; }
a.room:hover { background: var(--h-surface-hover); }
.room .top { display: flex; align-items: baseline; justify-content: space-between; gap: var(--s3); }
.room .num { font: 500 var(--t-xs)/1 var(--h-label); color: var(--h-muted); }
.room h3 { font-size: var(--t-2xl); }
.room p { margin: 0; color: var(--h-text); font-size: var(--t-sm); }
.chip { font: 500 var(--t-xs)/1 var(--h-label); letter-spacing: .08em; text-transform: uppercase; padding: var(--s1) var(--s2); border: var(--bw) solid var(--h-muted); color: var(--h-muted); white-space: nowrap; }
.chip.is-live { border-color: var(--h-accent); color: var(--h-accent); }
.room .go { margin-top: auto; padding-top: var(--s2); font: 500 var(--t-sm)/1 var(--h-label); color: var(--h-link); }
a.room:hover .go { color: var(--h-link-hover); }

/* promises */
.promises { display: grid; gap: var(--s5); grid-template-columns: repeat(auto-fit, minmax(15rem, 1fr)); }
.promises h3 { font-size: var(--t-lg); margin-bottom: var(--s2); }
.promises p { color: var(--h-muted); margin: 0; }

/* inner pages */
.page-head { padding: var(--s8) 0 var(--s6); }
.page-head h1 { font-size: var(--t-3xl); max-width: 22ch; margin-bottom: var(--s4); }
.page-head .lede { font-size: var(--t-md); max-width: 56ch; margin: 0; }
.prose { max-width: 62ch; }
.prose h2 { font-size: var(--t-2xl); margin: var(--s7) 0 var(--s4); }
.prose h2:first-child { margin-top: 0; }
/* Library entry page (H2): the generic ".section > .wrap > h2" rule is more specific than ".prose h2", so entry headings came out at page-title size. These win. */
.section > .wrap.prose > h2 { font-size: var(--t-2xl); max-width: none; margin: var(--s7) 0 var(--s4); }
.section > .wrap.prose > h2:first-child { margin-top: 0; }
.prose h3 { font-size: var(--t-lg); margin: var(--s5) 0 var(--s3); }
.stale { margin: 0 0 var(--s5); }
.prose ul, .prose ol { padding-left: 1.25rem; margin: 0 0 var(--s4); }
.prose li { margin-bottom: var(--s2); }
.notice { background: var(--h-warn-bg); color: var(--h-warn-text); padding: var(--s4) var(--s5); margin: 0 0 var(--s6); max-width: 62ch; font-size: var(--t-sm); }
.notice strong { font-weight: 600; }
.notice a { color: inherit; }
.rules { list-style: none; padding: 0; margin: 0 0 var(--s6); max-width: 62ch; counter-reset: rule; border-top: var(--bw) solid var(--h-line); }
.rules li { counter-increment: rule; padding: var(--s4) 0 var(--s4) var(--s7); border-bottom: var(--bw) solid var(--h-line); position: relative; margin: 0; }
.rules li::before { content: counter(rule, decimal-leading-zero); position: absolute; left: 0; top: var(--s4); font: 500 var(--t-xs)/1.9 var(--h-label); color: var(--h-muted); }
.rules strong { font: 500 var(--t-md)/1.3 var(--h-head); display: block; }
.rules span { color: var(--h-muted); }
.pair { display: grid; gap: var(--s5); grid-template-columns: repeat(auto-fit, minmax(16rem, 1fr)); margin-bottom: var(--s6); }
.pair .room h3 { font-size: var(--t-xl, 1.5rem); }
.steps { list-style: none; padding: 0; margin: 0 0 var(--s6); max-width: 62ch; counter-reset: st; }
.steps li { counter-increment: st; padding: var(--s3) 0 var(--s3) var(--s7); border-top: var(--bw) solid var(--h-line); position: relative; margin: 0; }
.steps li:last-child { border-bottom: var(--bw) solid var(--h-line); }
.steps li::before { content: counter(st, decimal-leading-zero); position: absolute; left: 0; top: var(--s3); font: 500 var(--t-xs)/1.9 var(--h-label); color: var(--h-muted); }
.empty { border: var(--bw) dashed var(--h-line); padding: var(--s5); max-width: 62ch; color: var(--h-muted); margin: 0 0 var(--s6); }
.empty strong { color: var(--h-text); display: block; margin-bottom: var(--s2); }

/* staleness banner: reserved for the Library entry template (H2) */
.stale { background: var(--h-warn-bg); color: var(--h-warn-text); padding: var(--s3) var(--s4); font-weight: 500; }

/* footer */
.site-footer { border-top: var(--bw) solid var(--h-line); padding: var(--s6) 0; margin-top: var(--s7); color: var(--h-muted); font: var(--t-sm)/1.6 var(--h-label); }
.site-footer .wrap { display: flex; flex-wrap: wrap; justify-content: space-between; gap: var(--s4) var(--s6); }
.site-footer ul { list-style: none; margin: 0; padding: 0; display: flex; flex-wrap: wrap; gap: var(--s2) var(--s5); }

@media (max-width: 30rem) {
  .hero { padding-top: var(--s7); }
  .nav { gap: var(--s4); }
}
