/* Viator — base elements and shell structure.
   Loaded after tokens.css, before an article's article.css. */

/* Reset */
*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  color-scheme: light;
}

body,
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  text-wrap: balance;
  margin-bottom: 0.5em;
}
p,
figure,
blockquote,
dl,
dd {
  margin: 0;
}

ul,
ol {
  margin: 0;
  padding-left: 1.5em;
}

img,
video {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Page */
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-text);
  font-size: 1.125rem;
  line-height: 1.6;
  text-rendering: optimizeLegibility;
}

main {
  width: min(calc(100% - 2.5rem), 65ch);
  margin-inline: auto;
  padding-block: clamp(3rem, 8vw, 6rem);
}

/* Type */
h1,
h2,
h3,
h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: 1.15;
  text-wrap: balance;
}

h1 {
  font-size: clamp(2.25rem, 6vw, 3.5rem);
}

h2 {
  font-size: 1.75rem;
  margin-top: 2.5em;
}

h3 {
  font-size: 1.35rem;
  margin-top: 2em;
}

p,
ul,
ol,
dl,
blockquote,
figure,
pre {
  margin-bottom: 1.25rem;
}

a {
  color: var(--accent);
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.15em;
}

a:hover {
  text-decoration-thickness: 0.14em;
}

small {
  font-size: 0.875em;
}

dt {
  margin-top: 1rem;
  color: var(--muted);
  font-family: var(--font-label);
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

dd {
  margin-bottom: 1rem;
}

code,
kbd,
samp,
pre {
  font-family: var(--font-mono);
}

code {
  font-size: 0.9em;
}

pre {
  overflow-x: auto;
  padding: 1rem;
  background: color-mix(in srgb, var(--fg) 5%, var(--bg));
}

pre code {
  font-size: 0.875rem;
}

blockquote {
  border-left: 0.25rem solid var(--accent);
  padding-left: 1.25rem;
  color: var(--muted);
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
}

/* Nav — structure and position only; values come from tokens.css */
nav {
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--nav-bg);
  color: var(--nav-fg);
  font-family: var(--font-nav);
}

nav ul {
  display: flex;
  flex-wrap: wrap;
  gap: 1.5rem;
  align-items: baseline;
  width: min(calc(100% - 2.5rem), 65ch);
  margin: 0 auto;
  padding: 0.85rem 0;
  list-style: none;
}

nav li {
  margin: 0;
}

nav a {
  color: inherit;
  font-size: 0.9rem;
  letter-spacing: 0.02em;
  text-decoration: none;
}

nav a:hover,
nav a[aria-current="page"] {
  text-decoration: underline;
  text-underline-offset: 0.3em;
}