/* ==========================================================================
   stefaniehubig.com — BASE
   "The Architecture of Justice" design system: tokens, reset, typography
   ========================================================================== */

:root {
  /* Palette */
  --ivory: #F5F0E7;
  --oxblood: #6B2634;
  --deep-wine: #421C27;
  --stone: #D8D0C4;
  --sage: #899384;
  --clay: #B9A08C;
  --ink: #252322;
  --brass: #A78A58;
  --white: #FCFAF6;
  --apricot: #D69A78;

  /* Derived tones (all text tones tested ≥ 4.5:1 on ivory) */
  --ink-2: #4A4440;
  --ink-3: #635B54;
  --oxblood-ink: #5A1F2C;
  --sage-deep: #4F5A4B;
  --stone-soft: #E7E0D5;
  --rule: #CFC5B6;
  --wine-ink: #F3E7DD;

  /* Type */
  --serif: "Cormorant Garamond", "Cormorant", "Iowan Old Style", "Palatino Linotype", Palatino, Georgia, serif;
  --sans: "IBM Plex Sans", "Source Sans 3", "Helvetica Neue", Arial, system-ui, sans-serif;
  --mono: "IBM Plex Mono", ui-monospace, "SFMono-Regular", Menlo, Consolas, monospace;

  --fs-xs: 0.75rem;
  --fs-sm: 0.875rem;
  --fs-base: 1.0625rem;
  --fs-md: 1.1875rem;
  --fs-lg: clamp(1.35rem, 1.1rem + 0.9vw, 1.75rem);
  --fs-xl: clamp(1.9rem, 1.4rem + 2vw, 2.9rem);
  --fs-2xl: clamp(2.5rem, 1.6rem + 3.6vw, 4.6rem);
  --fs-3xl: clamp(3rem, 1.6rem + 5.8vw, 7rem);

  /* Space & grid */
  --gutter: clamp(1rem, 0.4rem + 2.6vw, 3rem);
  --page-max: 1440px;
  --measure: 66ch;
  --header-h: 76px;
  --radius: 2px;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

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

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 24px);
}

body {
  margin: 0;
  min-height: 100vh;
  background-color: var(--ivory);
  color: var(--ink);
  font-family: var(--sans);
  font-size: var(--fs-base);
  line-height: 1.68;
  font-weight: 400;
  overflow-x: hidden;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

/* Faint architectural drafting grid on the page itself */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -1;
  background-image:
    linear-gradient(to right, rgba(167, 138, 88, .07) 1px, transparent 1px),
    linear-gradient(to bottom, rgba(167, 138, 88, .045) 1px, transparent 1px);
  background-size: 120px 100%, 100% 120px;
}

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

a {
  color: var(--oxblood);
  text-decoration-thickness: 1px;
  text-underline-offset: .2em;
}
a:hover { color: var(--deep-wine); text-decoration-thickness: 2px; }

:focus-visible {
  outline: 2px solid var(--oxblood);
  outline-offset: 3px;
}

::selection { background: var(--oxblood); color: var(--white); }

h1, h2, h3, h4 {
  font-family: var(--serif);
  font-weight: 500;
  line-height: 1.06;
  letter-spacing: -.01em;
  color: var(--ink);
  margin: 0 0 .5em;
  text-wrap: balance;
}
h1 { font-size: var(--fs-2xl); }
h2 { font-size: var(--fs-xl); }
h3 { font-size: var(--fs-lg); line-height: 1.15; }
h4 {
  font-family: var(--sans);
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: .12em;
  text-transform: uppercase;
  line-height: 1.4;
}

p { margin: 0 0 1.1em; max-width: var(--measure); text-wrap: pretty; }
ul, ol { margin: 0 0 1.2em; padding-left: 1.2em; }
li { margin-bottom: .4em; max-width: var(--measure); }
strong { font-weight: 600; }
em { font-style: italic; }
small { font-size: var(--fs-sm); }
hr { border: 0; border-top: 1px solid var(--rule); margin: 3rem 0; }

blockquote { margin: 0; }

abbr[title] { text-decoration: underline dotted; cursor: help; }

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

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

.sr-only {
  position: absolute !important;
  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;
  left: 1rem; top: -100px;
  z-index: 1000;
  background: var(--oxblood);
  color: var(--white);
  padding: .75rem 1.1rem;
  font-size: var(--fs-sm);
  font-weight: 600;
  letter-spacing: .06em;
  text-decoration: none;
}
.skip-link:focus { top: .75rem; color: var(--white); }

/* --------------------------------------------------------------------------
   Type utilities
   -------------------------------------------------------------------------- */
.label {
  display: inline-block;
  font-family: var(--sans);
  font-size: var(--fs-xs);
  font-weight: 600;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--oxblood);
  line-height: 1.5;
}
.label--muted { color: var(--ink-3); }
.label--light { color: var(--apricot); }

.meta {
  font-family: var(--sans);
  font-size: var(--fs-xs);
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.lede {
  font-family: var(--serif);
  font-size: var(--fs-lg);
  line-height: 1.38;
  color: var(--ink-2);
  max-width: 38ch;
  font-weight: 500;
}

.display {
  font-family: var(--serif);
  font-size: var(--fs-3xl);
  line-height: .92;
  letter-spacing: -.02em;
  font-weight: 500;
}

.serif { font-family: var(--serif); }
.num {
  font-family: var(--serif);
  font-feature-settings: "lnum" 1, "tnum" 1;
  color: var(--brass);
}

.prose > * + h2 { margin-top: 2.4em; }
.prose > * + h3 { margin-top: 1.9em; }
.prose p, .prose li { color: var(--ink-2); }
.prose p:first-child { margin-top: 0; }

.dropcap::first-letter {
  float: left;
  font-family: var(--serif);
  font-size: 4.6em;
  line-height: .78;
  padding: .08em .1em 0 0;
  color: var(--oxblood);
}

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