/* ==========================================================================
   KARADIGM - base.css
   Reset, fonts, baseline typography + rich-text element styling.

   TABLE OF CONTENTS
     BASELINE   fonts · reset · headings · text · links · divider ·
                focus · scrollbar
     RICH TEXT  inline emphasis · lists · blockquote · code · table ·
                progress & meter · figures & images
   ========================================================================== */

/* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
   fonts
   Loaded via Google Fonts (link in each page's <head>):
   Inter (UI/headings), IBM Plex Sans (reading), JetBrains Mono (code).
   The font stacks live in tokens.css; system fonts are the fallback.
   ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ */

/* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
   reset
   ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ */
*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  font-size: 17px;            /* generous base; rem type scales from here */
  scroll-behavior: smooth;
  scroll-padding-top: 6rem;   /* anchors clear the sticky header */
}

body {
  background-color: var(--bg0);
  color: var(--fg0);
  font-family: var(--font-text);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  -webkit-font-smoothing: antialiased;
}

img, svg { display: block; max-width: 100%; }

/* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
   headings
   ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-ui);
  font-weight: 900;
  line-height: var(--lh-heading);
}

h1 {
  font-size: var(--fs-h1);
  text-align: center;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  text-wrap: balance;          /* tidy, even heading line breaks */
}
h2 { font-size: var(--fs-h2); text-wrap: balance; }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }
h5 { font-size: var(--fs-h5); }
h6 { font-size: var(--fs-h6); }

/* page title polish (scoped to .site-main) */
.site-main h1 {
  font-size: clamp(2.4rem, 5vw, 3.4rem);
  letter-spacing: 0.08em;
  line-height: 1.1;
}
.site-main h1::after {           /* centered tri-accent rule */
  content: "";
  display: block;
  width: 64px;
  height: 3px;
  margin: var(--sp-6) auto 0;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--acc-blue), var(--acc-green), var(--acc-red));
}

/* content-heading polish (scoped to .site-main) - a decent touch of accent */
.site-main h2 {
  padding-bottom: var(--sp-3);
  background-image: linear-gradient(90deg, var(--acc-blue), var(--acc-green), var(--acc-red));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 64px 3px;
}
.site-main h3:not(.card__title)::before {   /* small accent tick before H3 */
  content: "";
  display: inline-block;
  width: 0.5em;
  height: 0.5em;
  margin-right: 0.55em;
  border-radius: 2px;
  background-color: var(--acc);
  vertical-align: 0.08em;
}

/* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
   text
   ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ */
p { margin: 0; text-wrap: pretty; }   /* avoids orphan words on the last line */

/* prose paragraphs: justified, with the first line of every paragraph indented.
   Flush exceptions: labels, the drop-cap paragraph, and small contained blocks. */
.site-main p { text-indent: 1.75em; text-align: justify; hyphens: auto; }
.site-main .section-label,
.site-main .sub-label,
.site-main .gallery-caption,
.site-main .dropcap,
.site-main blockquote p,
.site-main .callout p,
.site-main .card p,
.site-main .card__text { text-indent: 0; }
/* narrow contained blocks read better flush-left than justified */
.site-main blockquote p,
.site-main .callout p,
.site-main .card p,
.site-main .card__text { text-align: left; hyphens: manual; }

/* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
   links (underlined → invert on hover)
   ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ */
a {
  color: inherit;
  text-decoration: underline;
  text-underline-offset: 2px;
  padding: 0 2px;
  border-radius: 3px;
  transition: background-color var(--transition), color var(--transition);
}
a:hover {
  background-color: var(--fg0);
  color: var(--bg0);
  text-decoration: none;
}

/* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
   divider
   ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ */
hr {
  border: none;
  border-top: 1px solid currentColor;
  opacity: 0.2;
  margin: var(--sp-16) 0;
}

/* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
   focus (accessibility)
   ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ */
:focus-visible {
  outline: 2px solid var(--acc);
  outline-offset: 2px;
}

/* skip-to-content link - visible only when focused (keyboard users) */
.skip-link {
  position: absolute;
  left: var(--sp-3);
  top: var(--sp-3);
  z-index: 200;
  padding: var(--sp-2) var(--sp-4);
  font-family: var(--font-ui);
  font-weight: 700;
  background-color: var(--acc);
  color: #fff;
  border-radius: var(--radius);
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--transition);
}
.skip-link:focus { transform: translateY(0); }

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

/* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
   scrollbar (matches the theme)
   ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ */
html {
  scrollbar-width: thin;                       /* Firefox */
  scrollbar-color: var(--line) transparent;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
  background-color: var(--line);
  border: 2px solid var(--bg0);                /* inset look */
  border-radius: 10px;
  background-clip: padding-box;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--fg1); }
::-webkit-scrollbar-corner { background: transparent; }

/* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
   RICH TEXT - elements inside running content
   ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ */

/* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
   inline emphasis
   ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ */
strong, b { font-weight: 700; color: var(--fg0); }
em, i { font-style: italic; }
small { font-size: var(--fs-small); color: var(--fg1); }
del { text-decoration: line-through; opacity: 0.6; }

/* highlight - uses a restrained accent tint */
mark {
  background-color: color-mix(in srgb, var(--acc) 30%, transparent);
  color: inherit;
  padding: 0 0.2em;
  border-radius: var(--radius-sm);
}

/* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
   lists
   ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ */
ul, ol { padding-left: 1.4em; }
li + li { margin-top: var(--sp-2); }
li > ul, li > ol { margin-top: var(--sp-2); }
ol li::marker { color: var(--fg1); }

/* prettier content lists (scoped so it never touches .contact-list etc.) */
.site-main ul { list-style: none; padding-left: 1.5em; }
.site-main ul > li { position: relative; }
.site-main ul > li::before {           /* accent square bullet */
  content: "";
  position: absolute;
  left: -1.25em;
  top: 0.62em;
  width: 6px;
  height: 6px;
  border-radius: 2px;
  background-color: var(--acc);
}
.site-main ul ul > li::before {        /* nested: hollow */
  background-color: transparent;
  box-shadow: inset 0 0 0 1.5px var(--acc);
}
.site-main ol { padding-left: 1.7em; }
.site-main ol > li::marker {           /* numbers in mono + accent */
  color: var(--acc);
  font-family: var(--font-mono);
  font-weight: 700;
}

/* ---- definition list (term → definition, ledger style) ---- */
.site-main dl {
  display: grid;
  grid-template-columns: minmax(7em, 12em) 1fr;
  gap: var(--sp-3) var(--sp-6);
  align-items: baseline;
}
.site-main dt { font-family: var(--font-ui); font-weight: 700; color: var(--fg0); }
.site-main dd { color: var(--fg1); text-indent: 0; }
.site-main dl > dt,
.site-main dl > dd {
  padding-top: var(--sp-3);
  border-top: 1px solid color-mix(in srgb, var(--line) 30%, transparent);
}
.site-main dl > dt:first-of-type,
.site-main dl > dd:first-of-type { padding-top: 0; border-top: none; }
@media (max-width: 480px) {
  .site-main dl { grid-template-columns: 1fr; gap: var(--sp-1); }
  .site-main dl > dd { border-top: none; padding-top: 0; margin-bottom: var(--sp-3); }
}

/* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
   blockquote
   ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ */
blockquote {
  border-left: 4px solid var(--acc);
  background-color: color-mix(in srgb, var(--acc) 6%, transparent);
  padding: var(--sp-3) var(--sp-6);
  color: var(--fg1);
}
blockquote p + p { margin-top: var(--sp-3); }
blockquote cite {
  display: block;
  margin-top: var(--sp-3);
  font-style: normal;
  font-size: var(--fs-small);
  color: var(--fg1);
  opacity: 0.8;
}

/* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
   code
   ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ */
code, kbd, samp {
  font-family: var(--font-mono);
  font-size: 0.9em;
}
:not(pre) > code {
  background-color: color-mix(in srgb, var(--fg0) 8%, transparent);
  padding: 0.15em 0.4em;
  border-radius: var(--radius-sm);
}
pre {
  background-color: var(--bg1);
  border: 1px solid color-mix(in srgb, var(--line) 50%, transparent);
  border-radius: var(--radius);
  padding: var(--sp-4);
  overflow-x: auto;
  line-height: 1.5;
}
pre code { background: none; padding: 0; }

/* keyboard keys - small physical "keycap" */
kbd {
  font-family: var(--font-mono);
  font-size: 0.78em;
  padding: 0.15em 0.5em;
  color: var(--fg0);
  background-color: color-mix(in srgb, var(--fg0) 10%, transparent);
  border: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
  border-radius: var(--radius-sm);
  box-shadow: 0 1px 0 color-mix(in srgb, var(--line) 70%, transparent);
}
/* abbreviation - dotted underline, help cursor reveals the title */
abbr[title] { text-decoration: underline dotted; text-underline-offset: 2px; cursor: help; }
/* sub / superscript - don't disturb the line box */
sub, sup { font-size: 0.75em; line-height: 0; }

/* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
   table (mirrors the Obsidian theme)
   ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ */
table {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid color-mix(in srgb, var(--line) 45%, transparent);
  border-radius: var(--radius-sm);
  overflow: hidden;
  font-size: 0.95em;
}
th, td {
  padding: var(--sp-2) var(--sp-4);
  text-align: left;
  vertical-align: middle;
}
thead th {
  font-family: var(--font-ui);
  font-weight: 500;
  opacity: 0.6;
  border-bottom: 1px solid color-mix(in srgb, var(--line) 60%, transparent);
}
tbody td { border-top: 1px solid color-mix(in srgb, var(--line) 25%, transparent); }
tbody tr:nth-child(even) { background-color: color-mix(in srgb, var(--fg0) 3%, transparent); }
tbody tr:hover { background-color: color-mix(in srgb, var(--fg0) 6%, transparent); }

/* minimal / borderless variant - just a header rule and airy rows,
   no outer frame, no zebra. Add class="table-plain" to the <table>. */
.table-plain {
  border: none;
  border-radius: 0;
}
.table-plain thead th { border-bottom: 1px solid color-mix(in srgb, var(--line) 55%, transparent); }
.table-plain tbody td { border-top: 1px solid color-mix(in srgb, var(--line) 18%, transparent); }
.table-plain tbody tr:nth-child(even),
.table-plain tbody tr:hover { background: none; }
.table-plain th,
.table-plain td { padding-left: 0; }

/* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
   progress & meter (native data bars)
   ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ */
progress, meter {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 10px;
  border: none;
  border-radius: 999px;
  overflow: hidden;
  background-color: color-mix(in srgb, var(--fg0) 8%, transparent);
}
/* progress: track + value (WebKit + Firefox) */
progress::-webkit-progress-bar { background: transparent; }
progress::-webkit-progress-value { background-color: var(--acc); border-radius: 999px; }
progress::-moz-progress-bar { background-color: var(--acc); }
/* meter: semantic thresholds colour the fill (good / ok / poor) */
meter::-webkit-meter-bar { background: transparent; border: none; }
meter::-webkit-meter-optimum-value      { background-color: var(--acc-green); }
meter::-webkit-meter-suboptimum-value   { background-color: var(--acc-blue); }
meter::-webkit-meter-even-less-good-value { background-color: var(--acc-red); }
meter:-moz-meter-optimum::-moz-meter-bar    { background-color: var(--acc-green); }
meter:-moz-meter-sub-optimum::-moz-meter-bar { background-color: var(--acc-blue); }
meter:-moz-meter-sub-sub-optimum::-moz-meter-bar { background-color: var(--acc-red); }

/* ▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀▀
   figures & images
   ▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄▄ */
figure { margin: 0; }
figure img {
  width: 100%;
  border-radius: var(--radius);
  border: 1px solid color-mix(in srgb, var(--line) 40%, transparent);
}
figcaption {
  margin-top: var(--sp-3);
  font-size: var(--fs-small);
  color: var(--fg1);
  opacity: 0.55;        /* quieter than body text */
}

/* ──────────────────────────────────────────────────────────────────────────
   Karadigm - design system & templates crafted by Luko Karavan
   https://lukokaravan.com
   ────────────────────────────────────────────────────────────────────────── */
