html {
    -webkit-text-size-adjust: 100%;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    font-size: var(--fs-base);
    line-height: 1.6;
    color: var(--ink);
    background: var(--canvas);
    min-height: 100vh;
    -webkit-font-smoothing: antialiased;
}

img, svg, video, canvas {
    max-width: 100%;
}

img {
    height: auto;
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
    font-family: var(--font-display);
    color: var(--ink);
    font-weight: 700;
    letter-spacing: -0.015em;
    line-height: 1.2;
    text-wrap: balance;
}

h1, .h1 { font-size: var(--fs-2xl); }
h2, .h2 { font-size: var(--fs-xl); }
h3, .h3 { font-size: var(--fs-lg); }
h4, .h4 { font-size: var(--fs-md); }
h5, .h5, h6, .h6 { font-size: var(--fs-base); }

p { text-wrap: pretty; }

a {
    color: var(--green-700);
    text-underline-offset: 3px;
}

a:hover { color: var(--green-900); }

:focus-visible {
    outline: none;
    box-shadow: var(--ring);
    border-radius: 6px;
}

::selection { background: var(--green-100); }

.text-muted { color: var(--muted) !important; }
.num, .tabular { font-variant-numeric: tabular-nums; }
.eyebrow {
    font-family: var(--font-display);
    font-size: var(--fs-xs);
    font-weight: 700;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--green-600);
}

.visually-hidden-focusable:focus {
    position: fixed !important;
    top: 8px; left: 8px;
    z-index: 2000;
    background: var(--surface);
    padding: 8px 14px;
    border-radius: var(--radius-sm);
    box-shadow: var(--shadow-md);
}

/* Flex/grid children default to min-width:auto, which lets wide content
   (tables, long words) push the whole page sideways instead of shrinking. */
.row > *, .d-flex > *, .page-grid > *, .split > * { min-width: 0; }

.page {
    width: 100%;
    max-width: var(--content-max);
    margin-inline: auto;
    padding: var(--s-6) var(--s-4) var(--s-12);
}

@media (min-width: 768px) {
    .page { padding: var(--s-8) var(--s-8) var(--s-16); }
}

.page-narrow { max-width: 760px; }
.page-medium { max-width: 1040px; }

.page-header {
    display: flex;
    flex-wrap: wrap;
    align-items: flex-end;
    justify-content: space-between;
    gap: var(--s-4);
    margin-bottom: var(--s-6);
}

.page-header > div:first-child { min-width: 0; flex: 1 1 280px; }

.page-title {
    font-size: clamp(1.5rem, 1.2rem + 1.2vw, 2rem);
    margin: 0;
}

.page-subtitle {
    margin: var(--s-1) 0 0;
    color: var(--muted);
    max-width: 65ch;
}

.page-actions {
    display: flex;
    flex-wrap: wrap;
    gap: var(--s-2);
}

.breadcrumbs {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    margin: 0 0 var(--s-2);
    padding: 0;
    list-style: none;
    font-size: var(--fs-sm);
    color: var(--muted);
}

.breadcrumbs li + li::before {
    content: "/";
    margin-right: 6px;
    color: var(--subtle);
}

.breadcrumbs a { color: var(--muted); text-decoration: none; }
.breadcrumbs a:hover { color: var(--green-700); }

.stack { display: flex; flex-direction: column; gap: var(--s-6); }
.stack-sm { display: flex; flex-direction: column; gap: var(--s-3); }

.page-grid {
    display: grid;
    gap: var(--s-6);
    grid-template-columns: minmax(0, 1fr);
}

@media (min-width: 992px) {
    .page-grid.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
    .page-grid.main-aside { grid-template-columns: minmax(0, 1fr) 340px; }
    .page-grid.aside-main { grid-template-columns: 320px minmax(0, 1fr); }
}

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