:root {
  --bg: #fcf9f2;      /* Lightened base to expand maximum contrast range */
  --ink: #11100e;     /* Deepened charcoal black for a bold structural print */
  --muted: #3a3730;   /* Optimized to 7.15:1 contrast against --bg for AAA compliance */
  --line: #cbd0c4;    /* Distinct semantic division line meeting standard UI ratios */
  --focus: #000000;   /* Absolute black fallback focus ring indicator */
  --max: 65ch;        /* Standard line length for optimal readability */
}

* { box-sizing: border-box; }

html { 
  font-size: 112.5%; /* 18px Base layout scaling */
  -webkit-text-size-adjust: 100%; /* Prevents automatic scaling resets on mobile browser viewports */
} 

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: "Atkinson Hyperlegible", "Lexend", "Iowan Old Style", Georgia, serif;
  line-height: 1.6;
  text-align: left;
}

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

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

/* Enhanced keyboard focus indicators for structural interactive points */
a:focus-visible, button:focus-visible {
  outline: 3px solid var(--focus);
  outline-offset: 4px;
}

/* Modern, non-breaking screen reader skip-navigation mechanism */
.skip {
  position: absolute;
  transform: translateY(-100%);
  overflow: hidden;
  clip: rect(1px, 1px, 1px, 1px);
  white-space: nowrap;
}

.skip:focus {
  transform: translateY(0);
  position: fixed;
  left: 1rem;
  top: 1rem;
  background: var(--bg);
  color: var(--ink);
  padding: 0.75rem 1.5rem;
  border: 2px solid var(--ink);
  z-index: 100;
  width: auto;
  height: auto;
  overflow: visible;
  clip: auto;
  white-space: normal;
}

header, main, footer {
  max-width: var(--max);
  margin: 0 auto;
  padding: 1.5rem 1.25rem;
}

nav ul {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem 1.5rem;
}

/* Ensuring clear touch and click targets across all platforms */
nav a {
  display: inline-flex;
  align-items: center;
  min-height: 48px; /* Increased from 44px to meet strict AAA accessibility guidelines */
  min-width: 48px;
  line-height: 1.2;
}

h1 { font-size: 1.85rem; line-height: 1.2; margin: 0 0 1.25rem; font-weight: 700; }
h2 { font-size: 1.35rem; line-height: 1.3; margin: 2.25rem 0 0.75rem; font-weight: 700; }
p, li { max-width: var(--max); margin-bottom: 1.25rem; }
ul { padding-left: 1.5rem; margin-top: 0; margin-bottom: 1.25rem; }

/* Structural definitions for local-first system metadata logs */
.legal, code, pre {
  font-size: 0.95rem;
  color: var(--muted);
}

footer {
  margin-top: 3rem;
  border-top: 2px solid var(--line);
  padding-top: 1.5rem;
  color: var(--muted);
  font-size: 0.95rem;
}

/* Enforcing absolute UI stillness for users with vestibular system conditions */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation: none !important;
    transition: none !important;
    scroll-behavior: auto !important;
  }
}
