/* Grundlagen: Reset, Steinboden, Typografie, Browser-Oberflächen */

*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; scroll-padding-top: calc(var(--nav-h) + var(--s-3)); }
html.i18n-pending body { visibility: hidden; }

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--bg);
  background-image:
    linear-gradient(var(--bg-grout) 1px, transparent 1px),
    linear-gradient(90deg, var(--bg-grout) 1px, transparent 1px);
  background-size: var(--t) var(--t);
  color: var(--text);
  font-family: var(--font-text);
  font-size: var(--fs-base);
  line-height: var(--lh-text);
  font-feature-settings: "kern", "liga";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  position: relative;
  overflow-x: hidden;
}
/* Tesserae: leicht unterschiedlich getönte Steine im Boden */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background: var(--tile-tint);
  opacity: var(--tile-strength);
  -webkit-mask: url(../img/tesserae.svg) repeat;
  mask: url(../img/tesserae.svg) repeat;
  -webkit-mask-size: calc(var(--t) * 6) calc(var(--t) * 6);
  mask-size: calc(var(--t) * 6) calc(var(--t) * 6);
}

img, svg, video { display: block; max-width: 100%; }
img { height: auto; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; }
[hidden] { display: none !important; }

h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-head);
  letter-spacing: -0.01em;
  margin: 0;
  text-wrap: balance;
}
h1 { font-size: var(--fs-3xl); line-height: var(--lh-tight); letter-spacing: -0.02em; }
h2 { font-size: clamp(1.75rem, 1.3rem + 1.4vw, 2.375rem); }
h3 { font-size: var(--fs-xl); }
p { margin: 0; text-wrap: pretty; }
p + p { margin-top: var(--s-2); }

a { color: inherit; text-decoration-thickness: 1px; text-underline-offset: 0.22em; text-decoration-color: var(--accent); }
a:hover { text-decoration-thickness: 2px; }

::selection { background: var(--selection); color: inherit; }
:focus { outline: none; }
:focus-visible { outline: 3px solid var(--focus); outline-offset: 3px; }
.on-dark :focus-visible, .on-dark:focus-visible { outline-color: var(--focus-on-dark); }

html { scrollbar-color: var(--stone-300) var(--bg); }
:root[data-theme="dark"] { scrollbar-color: var(--basalt-600) var(--bg); }
::-webkit-scrollbar { width: 12px; height: 12px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: var(--stone-300); border: 3px solid var(--bg); }
:root[data-theme="dark"] ::-webkit-scrollbar-thumb { background: var(--basalt-600); }
input, textarea { caret-color: var(--action); }

.tabular { font-variant-numeric: tabular-nums lining-nums; }
.greek { font-family: var(--font-display); font-style: italic; font-weight: 500; letter-spacing: 0; }

.wrap { width: min(100% - 2 * var(--s-2), var(--page-max)); margin-inline: auto; }
@media (min-width: 720px) { .wrap { width: min(100% - 2 * var(--s-5), var(--page-max)); } }

.skip {
  position: absolute; left: var(--s-2); top: -100px; z-index: 100;
  background: var(--action); color: var(--on-action); padding: var(--s-1) var(--s-2); font-weight: 600;
}
.skip:focus { top: var(--s-2); }

.visually-hidden {
  position: absolute !important; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

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