@import url('https://fonts.googleapis.com/css2?family=JetBrains+Mono:wght@500&family=Playfair+Display:ital,wght@0,600;0,700;1,600&family=Spectral:ital,wght@0,400;0,500;0,600;1,400&display=swap');

@property --mesh-x1 {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 18%;
}

@property --mesh-y1 {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 24%;
}

@property --mesh-x2 {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 82%;
}

@property --mesh-y2 {
  syntax: '<percentage>';
  inherits: false;
  initial-value: 76%;
}

@property --mesh-angle {
  syntax: '<angle>';
  inherits: false;
  initial-value: 125deg;
}

:root {
  --ground: #E4EAE3;
  --surface: #D9E2D8;
  --surface-alt: #CED8CC;
  --surface-dark: #121F17;
  --ink: #18281E;
  --ink-light: #F4F7F3;
  --muted: #223326;
  --muted-soft: #384A3D;
  --border: rgba(24, 40, 30, 0.16);
  --border-strong: rgba(24, 40, 30, 0.32);
  --border-subtle: rgba(24, 40, 30, 0.08);
  --border-inverse: rgba(244, 247, 243, 0.18);
  --accent: #935606;
  --accent-hover: #734200;
  --accent-soft: rgba(147, 86, 6, 0.12);
  --white: #F4F7F3;
  --error: #8F2218;
  --error-bg: rgba(143, 34, 24, 0.08);
  --success: #1D5428;

  --font-display: 'Playfair Display', Georgia, 'Times New Roman', serif;
  --font-body: 'Spectral', Charter, Garamond, serif;
  --font-mono: 'JetBrains Mono', 'Courier New', Courier, monospace;

  --text-xs: clamp(0.72rem, 0.7rem + 0.1vw, 0.78rem);
  --text-sm: clamp(0.82rem, 0.8rem + 0.15vw, 0.9rem);
  --text-base: clamp(0.98rem, 0.94rem + 0.22vw, 1.08rem);
  --text-md: clamp(1.12rem, 1.06rem + 0.35vw, 1.25rem);
  --text-lg: clamp(1.28rem, 1.18rem + 0.5vw, 1.48rem);
  --text-xl: clamp(1.5rem, 1.35rem + 0.8vw, 1.85rem);
  --text-2xl: clamp(1.8rem, 1.55rem + 1.2vw, 2.3rem);
  --text-3xl: clamp(2.15rem, 1.75rem + 1.8vw, 2.9rem);
  --text-4xl: clamp(2.5rem, 2rem + 2.5vw, 3.6rem);

  --leading-tight: 1.16;
  --leading-snug: 1.28;
  --leading-normal: 1.58;
  --leading-relaxed: 1.72;

  --tracking-tight: -0.02em;
  --tracking-normal: 0;
  --tracking-wide: 0.04em;
  --tracking-wider: 0.08em;

  --container-max: 1240px;
  --container-prose: 72ch;
  --gutter: clamp(1rem, 4vw, 2.25rem);
  --section-pad-y: clamp(3rem, 7vw, 6rem);
  --radius: 2px;

  --ease-standard: cubic-bezier(0.2, 0.0, 0.2, 1.0);
  --ease-out: cubic-bezier(0.0, 0.0, 0.2, 1.0);
  --dur-instant: 120ms;
  --dur-fast: 180ms;
  --dur-base: 240ms;
  --dur-slow: 400ms;
}

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

html {
  font-size: 16px;
  background-color: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-text-size-adjust: 100%;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background-color: var(--ground);
  color: var(--ink);
  font-family: var(--font-body);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
}

main {
  flex: 1 0 auto;
  display: block;
  width: 100%;
}

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

input,
button,
textarea,
select {
  font: inherit;
  color: inherit;
}

button {
  background: none;
  border: none;
  cursor: pointer;
}

a {
  color: inherit;
  text-decoration-skip-ink: auto;
}

table {
  border-collapse: collapse;
  width: 100%;
}

ul,
ol {
  list-style-position: outside;
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 600;
  line-height: var(--leading-tight);
  color: var(--ink);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
}

h1 {
  font-size: var(--text-4xl);
}

h2 {
  font-size: var(--text-2xl);
  line-height: var(--leading-snug);
}

h3 {
  font-size: var(--text-xl);
  line-height: var(--leading-snug);
}

h4 {
  font-size: var(--text-lg);
}

p {
  margin-bottom: 1.15em;
  text-wrap: pretty;
}

p:last-child {
  margin-bottom: 0;
}

small {
  font-size: var(--text-sm);
  color: var(--muted);
}

strong,
b {
  font-weight: 600;
  color: var(--ink);
}

em,
i {
  font-style: italic;
}

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

address {
  font-style: normal;
}

.skip-link {
  position: absolute;
  top: -999px;
  left: 1rem;
  z-index: 10000;
  padding: 0.75rem 1.25rem;
  background-color: var(--ink);
  color: var(--white);
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  letter-spacing: var(--tracking-wide);
  text-decoration: none;
  border: 1px solid var(--accent);
}

.skip-link:focus {
  top: 1rem;
}

.icon {
  width: 1.125rem;
  height: 1.125rem;
  display: inline-block;
  vertical-align: middle;
  fill: currentColor;
  flex-shrink: 0;
}

.icon-lg {
  width: 1.5rem;
  height: 1.5rem;
}

.icon-sm {
  width: 0.95rem;
  height: 0.95rem;
}

.container {
  width: 100%;
  max-width: var(--container-max);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.container-prose {
  width: 100%;
  max-width: var(--container-prose);
  margin-left: auto;
  margin-right: auto;
  padding-left: var(--gutter);
  padding-right: var(--gutter);
}

.section-pad {
  padding-top: var(--section-pad-y);
  padding-bottom: var(--section-pad-y);
}

.section-pad-top {
  padding-top: var(--section-pad-y);
}

.section-pad-bottom {
  padding-bottom: var(--section-pad-y);
}

.rule-top {
  border-top: 1px solid var(--border);
}

.rule-bottom {
  border-bottom: 1px solid var(--border);
}

.mesh-backdrop {
  background-color: var(--ground);
  background-image:
    radial-gradient(circle at var(--mesh-x1) var(--mesh-y1), rgba(195, 211, 193, 0.85) 0%, rgba(228, 234, 227, 0) 58%),
    radial-gradient(circle at var(--mesh-x2) var(--mesh-y2), rgba(210, 221, 208, 0.9) 0%, rgba(228, 234, 227, 0) 54%),
    conic-gradient(from var(--mesh-angle) at 50% 50%, rgba(228, 234, 227, 0.4) 0deg, rgba(206, 216, 204, 0.6) 120deg, rgba(228, 234, 227, 0.4) 240deg, rgba(206, 216, 204, 0.6) 360deg);
  animation: meshDrift 28s ease-in-out infinite alternate;
}

@keyframes meshDrift {
  0% {
    --mesh-x1: 16%;
    --mesh-y1: 22%;
    --mesh-x2: 84%;
    --mesh-y2: 78%;
    --mesh-angle: 120deg;
  }
  50% {
    --mesh-x1: 32%;
    --mesh-y1: 38%;
    --mesh-x2: 68%;
    --mesh-y2: 62%;
    --mesh-angle: 195deg;
  }
  100% {
    --mesh-x1: 22%;
    --mesh-y1: 18%;
    --mesh-x2: 78%;
    --mesh-y2: 82%;
    --mesh-angle: 300deg;
  }
}

.visually-hidden {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}

.mono-meta {
  font-family: var(--font-mono);
  font-size: var(--text-xs);
  color: #121F17;
  letter-spacing: var(--tracking-wider);
  text-transform: uppercase;
}

.site-footer .mono-meta,
.util-bar .mono-meta,
.stat-strip .mono-meta {
  color: rgba(244, 247, 243, 0.85);
}

.lead-p {
  font-size: var(--text-md);
  line-height: var(--leading-relaxed);
  color: var(--muted);
}

.table-wrap {
  width: 100%;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  margin: 1.5rem 0;
  border: 1px solid var(--border);
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
  .mesh-backdrop {
    animation: none !important;
    background-image:
      radial-gradient(circle at 25% 25%, rgba(195, 211, 193, 0.75) 0%, rgba(228, 234, 227, 0) 60%),
      radial-gradient(circle at 75% 75%, rgba(210, 221, 208, 0.75) 0%, rgba(228, 234, 227, 0) 60%);
  }
}
