/* ==========================================================================
   Reboot — sensible, modern element defaults
   ========================================================================== */

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
  interpolate-size: allow-keywords;
  /* Taps are taps: no double-tap-to-zoom (and no tap delay) — pinch-zoom still works, as it should */
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
/* Mobile first: nothing may push the page wider than the screen */
body { overflow-wrap: break-word; }
img, svg, video, canvas, iframe { max-width: 100%; }
/* Smooth scrolling only for in-page links (moey.js turns it on for that one jump), so scripts that
   move the page (scrollTo, scrollIntoView, "jump to post") land at once, exactly where they aimed */
html.mo-smooth-scroll { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--mo-font-sans);
  font-size: var(--mo-font-size);
  line-height: var(--mo-line-height);
  font-weight: var(--mo-font-weight-normal);
  font-optical-sizing: auto;
  font-feature-settings: "cv11", "ss01";  /* Inter: cleaner a and digits */
  color: var(--mo-fg-body);
  background-color: var(--mo-bg-body);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* A nested [data-mo-theme] section re-paints itself in its own mode */
[data-mo-theme]:not(:root) { color: var(--mo-fg-body); background-color: var(--mo-bg-surface); }

hr {
  margin: var(--mo-spacer-4) 0;
  border: 0;
  border-top: var(--mo-border-width) solid var(--mo-border-color);
}

/* App-scale headings: compact and tight, not marketing-sized. */
h1, h2, h3, h4, h5, h6, .h1, .h2, .h3, .h4, .h5, .h6 {
  margin-top: 0;
  margin-bottom: .5rem;
  font-weight: var(--mo-heading-weight);
  line-height: var(--mo-line-height-tight);
  letter-spacing: -.011em;
  text-wrap: balance;
}
h1, .h1 { font-size: clamp(1.5rem, 1.3rem + .8vw, 1.875rem); letter-spacing: -.022em; }  /* 24 → 30px */
h2, .h2 { font-size: 1.5rem; letter-spacing: -.019em; }   /* 24px */
h3, .h3 { font-size: 1.25rem; letter-spacing: -.017em; }  /* 20px */
h4, .h4 { font-size: 1.125rem; }                          /* 18px */
h5, .h5 { font-size: 1rem; }                              /* 16px */
h6, .h6 { font-size: .9375rem; }                          /* 15px */

p { margin-top: 0; margin-bottom: 1rem; text-wrap: pretty; }

ul, ol { padding-inline-start: 1.75rem; margin-top: 0; margin-bottom: 1rem; }
ul ul, ul ol, ol ol, ol ul { margin-bottom: 0; }
dl { margin-top: 0; margin-bottom: 1rem; }
dt { font-weight: 600; }
dd { margin-inline-start: 0; margin-bottom: .5rem; }

blockquote { margin: 0 0 1rem; }
b, strong { font-weight: bolder; }
small { font-size: .875em; }
mark { padding: .1em .25em; color: inherit; background-color: var(--mo-amber-bg-muted); border-radius: var(--mo-radius-1); }
sub, sup { position: relative; font-size: .75em; line-height: 0; vertical-align: baseline; }
sub { bottom: -.25em; }
sup { top: -.5em; }

a {
  color: var(--mo-link-color);
  text-decoration: underline;
  text-decoration-color: color-mix(in oklch, currentcolor 35%, transparent);
  text-underline-offset: .2em;
}
a:hover { color: var(--mo-link-hover-color); text-decoration-color: currentcolor; }

pre, code, kbd, samp { font-family: var(--mo-font-mono); font-size: .875em; font-variant-ligatures: none; }   /* show => and != as typed */
pre { display: block; margin-top: 0; margin-bottom: 1rem; overflow: auto; }
/* Code reads left to right in every language: in a right-to-left page it stays the right way round */
pre, code, kbd, samp { direction: ltr; unicode-bidi: isolate; }
pre { text-align: left; }
pre code { color: inherit; word-break: normal; }
code { color: var(--mo-code-color); overflow-wrap: break-word; }
/* A soft key cap (see kbd.css for .kbd-solid, sizes and combos) */
kbd {
  display: inline-block;
  min-width: 1.6em;
  padding: .12em .4em;
  font-family: var(--mo-font-sans);       /* keys read as interface text, not code */
  font-size: .78em;
  font-weight: var(--mo-font-weight-medium);
  line-height: 1.4;
  color: var(--mo-fg-body);
  text-align: center;
  white-space: nowrap;
  background-color: color-mix(in oklab, var(--mo-fg-body) 9%, transparent);
  border-radius: var(--mo-radius-1);
}
kbd kbd { padding: 0; min-width: 0; font-size: 1em; background: none; }

img, svg, video, canvas, audio, iframe { vertical-align: middle; }
img, video { max-width: 100%; height: auto; }

table { caption-side: bottom; border-collapse: collapse; font-variant-numeric: tabular-nums; }
caption { padding-block: .5rem; color: var(--mo-fg-3); text-align: start; }
th { font-weight: 600; text-align: inherit; }

label { display: inline-block; }
button { border-radius: 0; }
input, button, select, optgroup, textarea { margin: 0; font: inherit; color: inherit; letter-spacing: inherit; }
button, select { text-transform: none; }
[role="button"] { cursor: pointer; }
button:not(:disabled), [type="button"]:not(:disabled), [type="reset"]:not(:disabled), [type="submit"]:not(:disabled) { cursor: pointer; }
textarea { resize: vertical; }
fieldset { min-width: 0; padding: 0; margin: 0; border: 0; }
legend { float: left; width: 100%; padding: 0; margin-bottom: .5rem; font-size: 1.25rem; font-weight: 600; line-height: inherit; }
legend + * { clear: left; }
summary { display: list-item; cursor: pointer; }
output { display: inline-block; }
iframe { border: 0; }
progress { vertical-align: baseline; }

[hidden] { display: none !important; }

:focus-visible {
  outline: var(--mo-focus-ring-width) solid var(--mo-default-focus-ring);
  outline-offset: var(--mo-focus-ring-offset);
}

::selection { background-color: var(--mo-default-bg-muted); }
