
:root {
  --ground: #BFA384;
  --ground-deep: #AE9071;
  --ground-elevated: #CBAD8E;
  --ink: #1A1612;
  --ink-muted: #261F1A;
  --ink-faint: rgba(26, 22, 18, 0.7);
  --accent: #78170D;
  --accent-hover: #5E1008;
  --accent-soft: rgba(120, 23, 13, 0.12);
  --hairline: rgba(26, 22, 18, 0.22);
  --hairline-strong: rgba(26, 22, 18, 0.45);
  --border-frame: 2px solid var(--ink);

  --tiha-d7c: "Playfair Display", Georgia, 'Times New Roman', serif;
  --tiha-623: 'Rubik', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  --tiha-099: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Monaco, Consolas, monospace;

  --text-xs: clamp(0.72rem, 0.68rem + 0.2vw, 0.8rem);
  --text-sm: clamp(0.82rem, 0.78rem + 0.22vw, 0.92rem);
  --text-base: clamp(0.95rem, 0.9rem + 0.25vw, 1.05rem);
  --text-md: clamp(1.1rem, 1.02rem + 0.4vw, 1.25rem);
  --text-lg: clamp(1.3rem, 1.18rem + 0.6vw, 1.55rem);
  --text-xl: clamp(1.6rem, 1.35rem + 1.1vw, 2.05rem);
  --text-2xl: clamp(2rem, 1.65rem + 1.8vw, 2.75rem);
  --text-display: clamp(2.4rem, 1.95rem + 2.5vw, 3.85rem);
  --text-metric: clamp(3.2rem, 2.5rem + 3.8vw, 5.5rem);

  --leading-none: 1;
  --leading-tight: 1.15;
  --leading-snug: 1.3;
  --leading-normal: 1.55;
  --leading-relaxed: 1.7;

  --tracking-tight: -0.025em;
  --tracking-normal: 0em;
  --tracking-wide: 0.05em;
  --tracking-wider: 0.09em;
  --tracking-mono: -0.01em;

  --space-1: 0.25rem;
  --space-2: 0.5rem;
  --space-3: 0.75rem;
  --space-4: 1rem;
  --space-5: 1.25rem;
  --space-6: 1.5rem;
  --space-8: 2rem;
  --space-10: 2.5rem;
  --space-12: 3rem;

  --space-16: 4rem;
  --space-20: 5rem;
  --space-section: clamp(2.5rem, 5vw, 5rem);

  --frame-padding: clamp(0.75rem, 2vw, 1.75rem);
  --max-width-boxed: 1360px;
  --max-width-prose: 68ch;
  --max-width-ledger: 1040px;

  --radius-none: 0px;
  --radius-tag: 2px;

  --duration-fast: 140ms;
  --duration-base: 200ms;
  --duration-slow: 320ms;
  --ease-standard: cubic-bezier(0.2, 0, 0, 1);
  --ease-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);

  --shadow-press: inset 0 2px 4px rgba(26, 22, 18, 0.2);
  --shadow-elevated: 0 4px 16px rgba(26, 22, 18, 0.12);
}

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

html {
  font-size: 16px;
  text-size-adjust: 100%;
  -webkit-text-size-adjust: 100%;
  background-color: var(--ground);
  color: var(--ink);
  scroll-behavior: smooth;
  scroll-padding-top: 4.5rem;
}

body {
  font-family: var(--tiha-623);
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--ink);
  background-color: var(--ground);
  background-image: 
    radial-gradient(circle at 10% 20%, rgba(26, 22, 18, 0.035) 0%, transparent 8%),
    radial-gradient(circle at 90% 80%, rgba(26, 22, 18, 0.03) 0%, transparent 10%);
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  overflow-x: hidden;
  position: relative;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

img, picture, svg, video {
  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;
}

ul, ol { list-style: none; }

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

h1, h2, h3, h4, h5, h6 {
  font-family: var(--tiha-d7c);
  font-weight: 700;
  line-height: var(--leading-tight);
  color: var(--ink);
  letter-spacing: var(--tracking-tight);
  text-wrap: balance;
  overflow-wrap: break-word;
  word-break: break-word;
}

h1 {
  font-size: var(--text-display);
  font-weight: 700;
  line-height: 1.08;
}

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

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

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

h5 {
  font-size: var(--text-md);
  line-height: 1.35;
}

h6 {
  font-size: var(--text-base);
  line-height: 1.4;
}

p {

  max-width: var(--max-width-prose);
  margin-block-end: var(--space-4);
  text-wrap: pretty;
  font-size: var(--text-base);
  line-height: var(--leading-normal);
  color: var(--ink);
}

p:last-child { margin-block-end: 0; }

p.lead {
  font-size: var(--text-md);
  line-height: var(--leading-snug);
  color: var(--ink);
  font-weight: 400;
}

small, .text-sm {
  font-size: var(--text-sm);

  line-height: var(--leading-snug);
}

.text-xs {
  font-size: var(--text-xs);
  line-height: var(--leading-snug);
}

.text-mono {
  font-family: var(--tiha-099);
  letter-spacing: var(--tracking-mono);
}

.text-muted { color: var(--ink-muted); }

.text-accent { color: var(--accent); }

.text-ink { color: var(--ink); }

.text-uppercase {
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

.font-display { font-family: var(--tiha-d7c); }

.font-body { font-family: var(--tiha-623); }

.font-mono { font-family: var(--tiha-099); }

.site-frame-root {
  width: 100%;
  max-width: var(--max-width-boxed);
  margin-inline: auto;
  border-left: var(--border-frame);
  border-right: var(--border-frame);
  display: flex;
  flex-direction: column;
  min-height: 100vh;
  background-color: var(--ground);
  position: relative;
}

.page-wrapper {
  width: 100%;
  display: flex;
  flex-direction: column;
  flex: 1 0 auto;
}

.container {
  width: 100%;
  max-width: var(--max-width-boxed);
  margin-inline: auto;
  padding-inline: var(--frame-padding);
}

.prose-measure { max-width: var(--max-width-prose); }

.ledger-measure { max-width: var(--max-width-ledger); }

.rule-hairline {
  border: 0;
  height: 1px;
  background-color: var(--hairline);
  margin-block: var(--space-8);
  width: 100%;
}

.rule-strong {
  border: 0;
  height: 2px;
  background-color: var(--ink);
  margin-block: var(--space-8);
  width: 100%;
}

.grid {
  display: grid;
  gap: var(--space-6);
}

.grid-cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }

.grid-cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }

.grid-cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

@media (max-width: 900px) {
  .grid-cols-4,
  .grid-cols-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 640px) {
  .grid-cols-4,
  .grid-cols-3,
  .grid-cols-2 { grid-template-columns: minmax(0, 1fr); }
  .site-frame-root {
    border-left: none;
    border-right: none;
  }
}

.flex { display: flex; }

.flex-col { flex-direction: column; }

.items-center { align-items: center; }

.items-start { align-items: flex-start; }

.justify-between { justify-content: space-between; }

.justify-center { justify-content: center; }

.flex-wrap { flex-wrap: wrap; }

.gap-1 { gap: var(--space-1); }
.gap-2 { gap: var(--space-2); }
.gap-3 { gap: var(--space-3); }
.gap-4 { gap: var(--space-4); }
.gap-6 { gap: var(--space-6); }
.gap-8 { gap: var(--space-8); }

.min-w-0 { min-width: 0; }

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

.skip-link {
  position: absolute;
  top: var(--space-2);
  left: var(--space-2);
  z-index: 9999;
  padding: var(--space-3) var(--space-5);
  background-color: var(--ink);
  color: var(--ground);
  font-family: var(--tiha-099);
  font-size: var(--text-sm);
  font-weight: 500;
  text-decoration: none;
  transform: translateY(-200%);
  transition: transform var(--duration-fast) var(--ease-standard);
  border: 1px solid var(--accent);
}

.skip-link:focus {
  transform: translateY(0);
  outline: 2px solid var(--accent);
}

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

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

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

@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;
  }
}
