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

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

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

a {
  color: inherit;
  text-decoration: none;
}

ul,
ol {
  list-style: none;
}

/* ============================================================
   Document
   ============================================================ */
html,
body {
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  font-weight: 400;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

html {
  min-height: 100%;
}

body {
  min-height: 100vh;
  position: relative;
  /* Radial gradient atmosphere — fixed for every page. */
  background-image:
    radial-gradient(circle at 20% 10%, rgba(184, 115, 42, 0.05) 0%, transparent 40%),
    radial-gradient(circle at 80% 90%, rgba(44, 58, 46, 0.04) 0%, transparent 40%);
  background-attachment: fixed;
}

/* Page wrapper — every page rendered via buildBodyOpen() uses this.
   Matches /public/brand-reference.html structure. */
.page {
  position: relative;
  max-width: 920px;
  margin: 0 auto;
  padding: 60px 24px 80px;
}

/* Paper grain — fixed overlay, mix-blend-mode multiply.
   Emitted as <div class="paper-grain" aria-hidden="true"> by headTemplate. */
.paper-grain {
  position: fixed;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3CfeColorMatrix values='0 0 0 0 0.1 0 0 0 0 0.08 0 0 0 0 0.06 0 0 0 0 0.06 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  opacity: 0.25;
  pointer-events: none;
  z-index: 1;
  mix-blend-mode: multiply;
}

/* Content sits above the grain overlay. */
.content {
  position: relative;
  z-index: 2;
}

/* ============================================================
   Headings — Fraunces, italic <em> drops to 300 + accent
   ============================================================ */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: 400;
  letter-spacing: -0.02em;
  line-height: 1.1;
  color: var(--ink);
}

h1 {
  font-size: clamp(40px, 6.5vw, 68px);
  line-height: 1.05;
}

h2 {
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.1;
}

h3 {
  font-size: 24px;
  font-weight: 500;
  line-height: 1.2;
  letter-spacing: -0.01em;
}

h4 {
  font-size: 20px;
  font-weight: 500;
  line-height: 1.2;
}

h5 {
  font-size: 17px;
  font-weight: 500;
}

h6 {
  font-size: 15px;
  font-weight: 500;
}

/* The signature: italic spans inside headings.
   Drop to weight 300, take the brand accent. */
h1 em,
h2 em,
h3 em,
h4 em,
h5 em,
h6 em {
  font-style: italic;
  font-weight: 300;
  color: var(--accent-3);
}

/* ============================================================
   Body text
   ============================================================ */
p {
  font-family: var(--font-body);
  font-size: 15px;
  line-height: 1.55;
  color: var(--ink);
}

strong { font-weight: 600; }
em     { font-style: italic; }

/* Default link styling — accent-3 underlined. */
a {
  color: var(--accent-3);
  border-bottom: 1px solid currentColor;
  transition: color 0.2s var(--ease-brand);
}

a:hover { color: var(--accent-4); }

/* ============================================================
   Selection
   ============================================================ */
::selection {
  background: var(--accent-3);
  color: var(--bg);
}
