/* -------------------------------------------------------------------------- */
/* typography */
:root {
    --font-serif: "Bitstream Charter", Georgia, "Times New Roman", Times, serif;
    --font-sans: "Lato Latin", "Lato", ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";
    --font-mono: ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, "Liberation Mono", "Courier New", monospace;
    --font-symbol: ui-sans-serif, system-ui, -apple-system, Segoe UI, Roboto, Helvetica, Arial, "Apple Color Emoji", "Segoe UI Emoji";

    --font-weight-hairline: 100;
    --font-weight-thin:     200;
    --font-weight-light:    300;
    --font-weight-regular:  400;
    --font-weight-medium:   500;
    --font-weight-heavy:    600;
    --font-weight-bold:     700;
    --font-weight-black:    900;

    --all-caps-space: .08em;
    --all-caps-word-space: 0.12em;

    --line-height-serif: 1.45;
    --line-height-sans: 1.35;

    --font-size-hugge:   36pt;
    --font-size-huge:    24pt;
    --font-size-bigger:  21pt;
    --font-size-big:     18pt;
    --font-size-larger:  16pt;
    --font-size-large:   14pt;
    --font-size-normal:  12pt;
    --font-size-small:   10pt;
    --font-size-smaller: 9pt;
    --font-size-tiny:    8pt;

    --border-radius: 10px;
    --border-radius-large: 14px;

    --hover-transition: 0.2s ease-in-out;
}

.weight-thin    { font-weight: var(--font-weight-thin);    }
.weight-light   { font-weight: var(--font-weight-light);   }
.weight-regular { font-weight: var(--font-weight-regular); }
.weight-medium  { font-weight: var(--font-weight-medium);  }
.weight-bold    { font-weight: var(--font-weight-bold);    }
.weight-black   { font-weight: var(--font-weight-black);   }

.size-hugge   { font-size: var(--font-size-hugge);   }
.size-huge    { font-size: var(--font-size-huge);    }
.size-bigger  { font-size: var(--font-size-bigger);  }
.size-big     { font-size: var(--font-size-big);     }
.size-larger  { font-size: var(--font-size-larger);  }
.size-large   { font-size: var(--font-size-large);   }
.size-normal  { font-size: var(--font-size-normal);  }
.size-small   { font-size: var(--font-size-small);   }
.size-smaller { font-size: var(--font-size-smaller); }
.size-tiny    { font-size: var(--font-size-tiny);    }

.mono   { font-family: var(--font-mono); }
.sans   { font-family: var(--font-sans); }
.serif  { font-family: var(--font-serif); }
.symbol { font-family: var(--font-symbol); }

/* TODO: font size scale */

/* -------------------------------------------------------------------------- */
/* spacing scale */
:root {
    /* spacing scale */
    --space-0: 0;
    --space-1: 0.25rem;
    --space-2: 0.5rem;
    --space-3: 0.75rem;
    --space-4: 1rem;
    --space-5: 1.5rem;
    --space-6: 2rem;
    --space-7: 3rem;
    --space-8: 4rem;

    /* layout */
    --maxw: 72rem;     /* overall container max width */
    --readw: 62ch;     /* ideal text line length */
    --truncw: 31ch;
}

/* spacing utilities */
.mt-0 { margin-top: 0 !important; }
.mt-1 { margin-top: var(--space-1) !important; }
.mt-2 { margin-top: var(--space-2) !important; }
.mt-3 { margin-top: var(--space-3) !important; }
.mt-4 { margin-top: var(--space-4) !important; }
.mt-5 { margin-top: var(--space-5) !important; }
.mt-6 { margin-top: var(--space-6) !important; }
.mt-7 { margin-top: var(--space-7) !important; }
.mt-8 { margin-top: var(--space-8) !important; }

.mb-0 { margin-bottom: 0 !important; }
.mb-1 { margin-bottom: var(--space-1) !important; }
.mb-2 { margin-bottom: var(--space-2) !important; }
.mb-3 { margin-bottom: var(--space-3) !important; }
.mb-4 { margin-bottom: var(--space-4) !important; }
.mb-5 { margin-bottom: var(--space-5) !important; }
.mb-6 { margin-bottom: var(--space-6) !important; }
.mb-7 { margin-bottom: var(--space-7) !important; }
.mb-8 { margin-bottom: var(--space-8) !important; }

.ml-0 { margin-left: 0 !important; }
.ml-1 { margin-left: var(--space-1) !important; }
.ml-2 { margin-left: var(--space-2) !important; }
.ml-3 { margin-left: var(--space-3) !important; }
.ml-4 { margin-left: var(--space-4) !important; }
.ml-5 { margin-left: var(--space-5) !important; }
.ml-6 { margin-left: var(--space-6) !important; }
.ml-7 { margin-left: var(--space-7) !important; }
.ml-8 { margin-left: var(--space-8) !important; }

.mr-0 { margin-right: 0 !important; }
.mr-1 { margin-right: var(--space-1) !important; }
.mr-2 { margin-right: var(--space-2) !important; }
.mr-3 { margin-right: var(--space-3) !important; }
.mr-4 { margin-right: var(--space-4) !important; }
.mr-5 { margin-right: var(--space-5) !important; }
.mr-6 { margin-right: var(--space-6) !important; }
.mr-7 { margin-right: var(--space-7) !important; }
.mr-8 { margin-right: var(--space-8) !important; }

.pad-1 { padding: var(--space-1) !important; }
.pad-2 { padding: var(--space-2) !important; }
.pad-3 { padding: var(--space-3) !important; }
.pad-4 { padding: var(--space-4) !important; }
.pad-5 { padding: var(--space-5) !important; }
.pad-6 { padding: var(--space-6) !important; }
.pad-7 { padding: var(--space-7) !important; }
.pad-8 { padding: var(--space-8) !important; }

/* -------------------------------------------------------------------------- */
/* hide-only-visually helper */

/* Visually hide while keeping content accessible to assistive tech.
   Use for: skip links, helper text for screen readers, form controls that
   are "re-skinned" (e.g., radio inputs behind custom tabs), and any content
   that should be announced but not seen.
   Why: avoids display:none/visibility:hidden (which remove from the
   accessibility tree) while keeping elements focusable and operable. */
.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  white-space: nowrap;
  border: 0;

  /* `clip` is deprecated but still broad; `clip-path` is the modern form. */
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

/* Same as above, but only hidden when *not* focused/active.
   Use for: "Skip to content" links that should appear when tabbed to. */
.visually-hidden-focusable:not(:focus):not(:active) {
  position: absolute !important;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  white-space: nowrap;
  border: 0;
  clip: rect(0 0 0 0);
  clip-path: inset(50%);
}

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

body {
    margin: 0;
    background: var(--bg);
    color: var(--text);
    font-family: var(--font-serif);
    font-size: var(--font-size-normal);
    line-height: var(--line-height-serif);
    text-rendering: optimizeLegibility;
    -webkit-font-smoothing: subpixel-antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img, svg, video, canvas { max-width: 100%; height: auto; }
img { display: block; }

:focus-visible {
    outline: none;
    /* outline: 2px solid var(--focus); */
    /* outline-offset: 3px; */
    box-shadow: 0 0 4px 2px color-mix(in srgb, var(--focus) 75%, transparent);
}

a {
    color: var(--link);
    text-decoration: none;
}
a:hover { text-decoration: underline; }

code, pre, kbd, samp {
    font-family: var(--font-mono);
    font-size: var(--font-size-small);
}
pre {
    /* background: var(--surface); */
    background: var(--bg);
    padding: var(--space-4);
    border-radius: var(--border-radius);
    overflow: auto;
    border: 1px solid var(--border);
}

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

/* -------------------------------------------------------------------------- */
/* Print styles */
@media print {
    :root {
        --bg: #ffffff;
        --text: #000000;
        --border: #d1d5db;
    }
    body {
        background: #fff;
        color: #000;
    }
    a {
        color: inherit;
        text-decoration: none;
    }
    .btn, .badge {
        box-shadow: none;
    }
    /* .footer { */
    /*     border-top: 0; */
    /* } */
}
