/* ===========================================================================
   sldrz — base.css
   Reset, document typography, page chrome (skip link, header, main, footer
   rhythm) and a handful of utilities. Tokens only: every value here comes from
   core/tokens.css, which is what lets a site's colours and layout change the entire look.
   =========================================================================== */

*, *::before, *::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--s-header-h) + var(--s-space-4));
}

body {
  margin: 0;
  background-color: var(--s-bg);
  background-image: var(--s-bg-image);
  background-size: var(--s-bg-size);
  background-attachment: fixed;
  color: var(--s-fg);
  font-family: var(--s-font-body);
  font-size: var(--s-text-base);
  line-height: var(--s-leading-normal);
  font-weight: var(--s-weight-normal);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

/* --- headings ----------------------------------------------------------- */

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--s-font-display);
  line-height: var(--s-leading-tight);
  letter-spacing: var(--s-tracking-tight);
  text-transform: var(--s-case-display);
  font-weight: var(--s-weight-bold);
  text-wrap: balance;
}

h1, h2 { font-style: var(--s-display-style); text-shadow: var(--s-display-shadow); }
h1 { font-size: var(--s-text-4xl); }
h2 { font-size: var(--s-text-2xl); }
h3 { font-size: var(--s-text-lg); }
h4 { font-size: var(--s-text-base); }

p { margin: 0 0 var(--s-space-4); }
p:last-child { margin-bottom: 0; }

/* --- links and controls ------------------------------------------------- */

a {
  color: var(--s-accent);
  text-decoration-color: color-mix(in srgb, var(--s-accent) 45%, transparent);
  text-underline-offset: .18em;
  transition: color var(--s-dur-fast) var(--s-ease);
}
a:hover { color: color-mix(in srgb, var(--s-accent) 70%, var(--s-fg)); }

button, input, select, textarea { font: inherit; color: inherit; }

:focus-visible {
  outline: var(--s-border-w-strong) solid var(--s-focus);
  outline-offset: 2px;
  border-radius: var(--s-radius-sm);
}

/* --- media -------------------------------------------------------------- */

img, video, svg { max-width: 100%; height: auto; display: block; }
/* pictures always show exactly as uploaded: no filters, tints or blend
   modes on images (ziim, 2026-11-26; validate.py check 2 enforces it) */

hr {
  border: 0;
  border-top: var(--s-border-w) var(--s-rule-style) var(--s-border);
  margin: var(--s-space-6) 0;
}

/* --- page chrome -------------------------------------------------------- */

.s-skip {
  position: absolute;
  left: var(--s-space-3);
  top: calc(-1 * var(--s-space-9));
  z-index: 100;
  padding: var(--s-space-2) var(--s-space-4);
  background: var(--s-accent);
  color: var(--s-accent-fg);
  border-radius: var(--s-radius-sm);
  text-decoration: none;
  transition: top var(--s-dur-fast) var(--s-ease);
}
.s-skip:focus { top: var(--s-space-3); }

.s-head {
  position: sticky;
  top: 0;
  z-index: 50;
  min-height: var(--s-header-h);
  display: flex;
  align-items: center;
  gap: var(--s-space-5);
  padding: var(--s-space-2) var(--s-gutter);
  color: var(--s-head-fg);
  background: var(--s-head-bg);
  border-bottom: var(--s-border-w) var(--s-rule-style) var(--s-border);
}

.s-head__brand {
  display: inline-flex;
  align-items: center;
  gap: var(--s-space-2);
  color: var(--s-head-fg);
  text-decoration: none;
  font-family: var(--s-font-display);
  font-style: var(--s-display-style);
  font-weight: var(--s-weight-bold);
  letter-spacing: var(--s-tracking-tight);
  text-transform: var(--s-case-display);
  font-size: var(--s-text-lg);
  white-space: nowrap;
  flex: none;
}
.s-head__brand img { max-height: 2rem; width: auto; }

/* every link stays visible: the row wraps instead of scrolling sideways */
.s-head__nav {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-end;
  gap: var(--s-space-1);
  margin-inline-start: auto;
  min-width: 0;
}

.s-head__link {
  flex: none;
  padding: var(--s-space-2) var(--s-space-3);
  color: var(--s-head-fg);
  font-size: var(--s-text-sm);
  text-decoration: none;
  letter-spacing: var(--s-tracking-wide);
  text-transform: uppercase;
  border-radius: var(--s-radius-sm);
  white-space: nowrap;
}
.s-head__link:hover,
.s-head__link[aria-current="true"] {
  color: var(--s-head-fg);
  background: color-mix(in srgb, var(--s-head-fg) 14%, transparent);
}
.s-head__link[aria-current="true"] { text-decoration: underline; text-underline-offset: .35em; }

/* "Home" is for the page-per-section layouts; a scrolling page has the brand */
.s-head__link--home { display: none; }

/* the Menu: a labelled button, never a bare icon, so nobody has to guess that
   there are more pages. It replaces the row on a narrow screen. */
.s-menu { display: none; margin-inline-start: auto; }
.s-menu > summary { list-style: none; }
.s-menu > summary::-webkit-details-marker { display: none; }
.s-menu__toggle {
  --sx-btn-bg: transparent;
  --sx-btn-fg: var(--s-head-fg);
  border-color: color-mix(in srgb, var(--s-head-fg) 45%, transparent);
  text-transform: uppercase;
  letter-spacing: var(--s-tracking-wide);
}
.s-menu__shut,
.s-menu[open] .s-menu__open { display: none; }
.s-menu[open] .s-menu__shut { display: block; }

.s-menu__panel {
  position: absolute;
  inset-inline: 0;
  top: 100%;
  z-index: 70;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(9rem, 1fr));
  gap: var(--s-space-1);
  padding: var(--s-space-4) var(--s-gutter) var(--s-space-5);
  background: var(--s-head-bg);
  border-bottom: var(--s-border-w-strong) var(--s-rule-style) var(--s-border-strong);
  box-shadow: var(--s-shadow-3);
}
.s-menu__panel .s-head__link {
  padding: var(--s-space-3);
  font-size: var(--s-text-base);
  border: var(--s-border-w) var(--s-rule-style) color-mix(in srgb, var(--s-head-fg) 25%, transparent);
}

@media (max-width: 56rem) {
  .s-head > .s-head__nav { display: none; }
  .s-menu { display: block; }
}

/* --- sections ----------------------------------------------------------- */

.s-main { display: block; }

.s-main > [data-section] {
  padding: var(--s-section-y) var(--s-gutter);
  scroll-margin-top: var(--s-header-h);
}
.s-main > [data-section] > * {
  max-width: var(--s-container);
  margin-inline: auto;
}

/* Every section (1.10) arranges itself by its own width, not the window's: a
   layout that puts it in a narrow column (a profile page, tiles, newspaper
   columns, a sidebar) gets it stacked, not squeezed. Section CSS uses
   @container for its own columns. Not the top banner: the glass layout fixes
   its picture to the window, which a container would stop. */
.s-main > [data-section]:not(.s-hero) { container-type: inline-size; }

/* alternating surface so adjacent sections separate without a rule */
.s-main > [data-section]:nth-of-type(even) { background: var(--s-bg-elev); }

.s-section-head {
  display: flex;
  align-items: baseline;
  gap: var(--s-space-4);
  flex-wrap: wrap;
  margin-bottom: var(--s-space-6);
}
.s-section-head__lead {
  color: var(--s-fg-muted);
  font-size: var(--s-text-sm);
  max-width: 48ch;
}

.s-eyebrow {
  display: block;
  font-family: var(--s-font-mono);
  font-size: var(--s-text-xs);
  letter-spacing: var(--s-tracking-wide);
  text-transform: uppercase;
  color: var(--s-accent);
  margin-bottom: var(--s-space-2);
}

/* --- utilities ---------------------------------------------------------- */

.s-prose { max-width: 68ch; line-height: var(--s-leading-loose); color: var(--s-fg-muted); }
.s-prose strong { color: var(--s-fg); font-weight: var(--s-weight-medium); }

.s-grid {
  display: grid;
  gap: var(--s-grid-gap);
  grid-template-columns: repeat(auto-fill, minmax(var(--sx-min, 14rem), 1fr));
}

.s-sr-only {
  position: absolute;
  width: .0625rem; height: .0625rem;
  margin: -.0625rem; padding: 0;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
}

.s-noscript { padding: var(--s-space-6) var(--s-gutter); }

.s-empty {
  color: var(--s-fg-muted);
  font-family: var(--s-font-mono);
  font-size: var(--s-text-sm);
}

/* --- motion ------------------------------------------------------------- */

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

@media print {
  .s-head, .s-skip { display: none; }
  body { background: transparent; color: var(--s-fg); }
}

/* Blog list and post pages (1.4) always take the full width: layouts that set
   sections into columns or a grid (bento, portal, profile, metro) do not get to squeeze an article into one column. */
.s-main > [data-section]:is(.s-blog, .s-post) { grid-column: 1 / -1; column-span: all; }
.s-main > [data-section].s-grid { grid-column: 1 / -1; column-span: all; }

/* --- section styles (1.5) -------------------------------------------------
   A section's "style" in site.json arrives as data-s-* attributes (see
   sectionStyle in core/render.js). The accent and inverse colour schemes
   re-point the colour tokens for everything inside the section; they are
   declared in core/tokens.css with the other token values. These rules are
   !important on purpose: they are one person's choice for one section, so
   they win over a layout's general rules for every section. */
.s-main > [data-section][data-s-bg] { background-color: var(--s-bg) !important; color: var(--s-fg) !important; }
.s-main > [data-section][data-s-bg="plain"] { background-color: transparent !important; }
.s-main > [data-section][data-s-bg="raised"] { background-color: var(--s-bg-elev) !important; }
.s-main > [data-section][data-s-bg="sunken"] { background-color: var(--s-bg-sunken) !important; }
.s-main > [data-section][data-s-bg="image"] {
  background-size: cover !important;
  background-position: center !important;
}
.s-main > [data-section][data-s-panel] > * {
  padding: var(--s-space-6) !important;
  border-radius: var(--s-radius-lg) !important;
  background: color-mix(in srgb, var(--s-bg) 86%, transparent) !important;
}

.s-main > [data-section][data-s-pad="none"] { padding-block: 0 !important; }
.s-main > [data-section][data-s-pad="s"] { padding-block: var(--s-space-6) !important; }
.s-main > [data-section][data-s-pad="l"] { padding-block: calc(var(--s-section-y) * 1.5) !important; }
.s-main > [data-section][data-s-pad="xl"] { padding-block: calc(var(--s-section-y) * 2) !important; }

.s-main > [data-section][data-s-width="narrow"] > * { max-width: 46rem !important; }
.s-main > [data-section][data-s-width="wide"] > * { max-width: 96rem !important; }
.s-main > [data-section][data-s-width="full"] { padding-inline: 0 !important; }
.s-main > [data-section][data-s-width="full"] > * { max-width: none !important; }

.s-main > [data-section]:is([data-s-height="half"], [data-s-height="screen"]) { display: grid !important; align-content: center !important; }
.s-main > [data-section][data-s-height="half"] { min-height: 50svh !important; }
.s-main > [data-section][data-s-height="screen"] { min-height: calc(100svh - var(--s-header-h)) !important; }

.s-main > [data-section][data-s-align="center"] { text-align: center !important; }
.s-main > [data-section][data-s-align="center"] .s-section-head { justify-content: center !important; }
.s-main > [data-section][data-s-align="center"] :is(.s-prose, .s-section-head__lead) { margin-inline: auto !important; }

/* reveal on scroll: tied to scrolling, so nothing runs in the background;
   browsers without scroll timelines, and people who ask for less motion,
   simply see the section */
@keyframes s-reveal-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes s-reveal-rise { from { opacity: 0; translate: 0 var(--s-space-7); } to { opacity: 1; translate: 0 0; } }
@keyframes s-reveal-zoom { from { opacity: 0; scale: .92; } to { opacity: 1; scale: 1; } }
@supports (animation-timeline: view()) {
  @media (prefers-reduced-motion: no-preference) {
    .s-main > [data-section][data-s-anim] > * { animation: linear both; animation-timeline: view(); animation-range: entry 0% entry 80%; }
    .s-main > [data-section][data-s-anim="fade"] > * { animation-name: s-reveal-fade; }
    .s-main > [data-section][data-s-anim="rise"] > * { animation-name: s-reveal-rise; }
    .s-main > [data-section][data-s-anim="zoom"] > * { animation-name: s-reveal-zoom; }
  }
}

/* Advanced design (1.6): a button shape chosen for the whole site wins over
   the shape a layout gives its buttons (core/tune.json, knob "buttons") */
html[data-tune-buttons] .s-btn { border-radius: var(--sx-tune-btn-radius) !important; }

/* --- drop-down menus (1.8) --------------------------------------------------
   A page with pages under it: its link, a small button, and the list. In the
   header row the list opens on hover, on keyboard focus, or with the button
   (render.js adds .is-open for touch screens). In the Menu panel everything is
   listed, the pages under another one marked as such. */
.s-head__group { position: relative; display: inline-flex; align-items: center; flex: none; }
.s-head__caret {
  display: inline-grid;
  place-items: center;
  width: 1.6rem;
  height: 2rem;
  padding: 0;
  margin-inline-start: calc(var(--s-space-1) * -1);
  border: 0;
  border-radius: var(--s-radius-sm);
  background: none;
  color: var(--s-head-fg);
  cursor: pointer;
}
.s-head__caret:hover { background: color-mix(in srgb, var(--s-head-fg) 14%, transparent); }
.s-head__caret .s-icon { width: .85rem; height: .85rem; transition: transform var(--s-dur-fast) var(--s-ease); }
.s-head__sub {
  position: absolute;
  top: 100%;
  inset-inline-end: 0;          /* menus sit at the right of the header: open leftwards, onto the page */
  z-index: 80;
  display: none;
  flex-direction: column;
  align-items: stretch;
  min-width: 12rem;
  padding: var(--s-space-2);
  background: var(--s-head-bg);
  border: var(--s-border-w) var(--s-rule-style) var(--s-border-strong);
  border-radius: var(--s-radius-md);
  box-shadow: var(--s-shadow-2);
}
.s-head__nav .s-head__group:is(:hover, :focus-within, .is-open) > .s-head__sub { display: flex; }
.s-head__nav .s-head__group:is(:hover, :focus-within, .is-open) > .s-head__caret .s-icon { transform: rotate(180deg); }
.s-head__sub .s-head__link { display: block; text-align: start; }

.s-menu__panel .s-head__group { display: contents; }
.s-menu__panel .s-head__caret { display: none; }
.s-menu__panel .s-head__sub { display: contents; }
.s-menu__panel .s-head__link--sub { font-size: var(--s-text-sm); border-style: dashed; }
