/* ============================================================================
   Karvan Group — base
   Reset, typefaces, typography, focus, link and table defaults.
   ========================================================================== */

@font-face {
  font-family: "IBM Plex Sans";
  src: url("../assets/fonts/plex-sans-var.woff2") format("woff2-variations");
  font-weight: 100 700;
  font-style: normal;
  font-display: swap;
}

@font-face {
  font-family: "IBM Plex Mono";
  src: url("../assets/fonts/plex-mono.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}

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

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  background: var(--ground);
  color: var(--ink);
  font-family: var(--font-sans);
  font-size: var(--t-body);
  line-height: var(--lead-normal);
  font-variant-numeric: tabular-nums;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

/* Motion is opt-in: users who have expressed no preference get the
   transitions, everyone else gets the static default. */
@media (prefers-reduced-motion: no-preference) {
  a,
  .ledger-row,
  .channel {
    transition: color var(--dur) var(--ease),
      background-color var(--dur) var(--ease),
      border-color var(--dur) var(--ease);
  }

  html {
    scroll-behavior: smooth;
  }
}

/* --- headings ------------------------------------------------------------ */

h1,
h2,
h3 {
  font-weight: 600;
  line-height: var(--lead-snug);
  text-wrap: balance;
}

h1 {
  font-size: var(--t-h1);
  letter-spacing: -0.025em;
}

h2 {
  font-size: var(--t-h2);
  letter-spacing: -0.015em;
}

h3 {
  font-size: var(--t-h3);
  letter-spacing: -0.005em;
}

/* --- text ---------------------------------------------------------------- */

p,
li {
  max-width: var(--measure);
  text-wrap: pretty;
}

p + p {
  margin-top: var(--s4);
}

strong {
  font-weight: 600;
}

abbr[title] {
  text-decoration: underline dotted;
  text-underline-offset: 0.2em;
}

code,
kbd,
samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

:lang(sv) {
  font-style: italic;
}

/* --- links --------------------------------------------------------------- */

a {
  color: var(--accent);
  text-decoration-thickness: 1px;
  text-underline-offset: 0.18em;
}

a:hover {
  text-decoration-thickness: 2px;
}

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 1px;
}

/* --- lists --------------------------------------------------------------- */

ul,
ol {
  padding-left: 1.15em;
}

li + li {
  margin-top: var(--s2);
}

ul.plain {
  list-style: none;
  padding-left: 0;
}

/* --- tables -------------------------------------------------------------- */

.table-scroll {
  overflow-x: auto;
  margin-top: var(--s5);
  border-top: 1px solid var(--rule-strong);
}

table {
  border-collapse: collapse;
  width: 100%;
  min-width: 34rem;
  font-size: var(--t-sm);
}

caption {
  text-align: left;
  font-family: var(--font-mono);
  font-size: var(--t-label);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ink-muted);
  padding-bottom: var(--s3);
}

th,
td {
  text-align: left;
  vertical-align: top;
  padding: var(--s3) var(--s4) var(--s3) 0;
  border-bottom: 1px solid var(--rule);
}

thead th {
  font-family: var(--font-mono);
  font-weight: 400;
  font-size: var(--t-label);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ink-muted);
  border-bottom: 1px solid var(--rule-strong);
}

tbody th {
  font-weight: 600;
}

/* --- figures ------------------------------------------------------------- */

figure {
  margin: var(--s6) 0 0;
}

figcaption {
  margin-top: var(--s3);
  font-size: var(--t-sm);
  color: var(--ink-muted);
  max-width: var(--measure);
}

svg {
  display: block;
  max-width: 100%;
  height: auto;
}

/* --- skip link ----------------------------------------------------------- */

.skip {
  position: absolute;
  left: var(--s4);
  top: var(--s4);
  z-index: 10;
  transform: translateY(-200%);
  background: var(--accent);
  color: var(--accent-ink);
  padding: var(--s3) var(--s4);
  font-family: var(--font-mono);
  font-size: var(--t-label);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  text-decoration: none;
}

.skip:focus {
  transform: translateY(0);
}

/* --- shared utilities ---------------------------------------------------- */

.shell {
  width: var(--shell);
  margin-inline: auto;
}

.label {
  font-family: var(--font-mono);
  font-size: var(--t-label);
  letter-spacing: var(--track-label);
  text-transform: uppercase;
  color: var(--ink-muted);
}

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