:root {
  color-scheme: light;
  --paper: #f5f0e8;
  --paper-soft: #eee6dc;
  --paper-card: #faf7f2;
  --ink: #171716;
  --ink-soft: #625f5a;
  --graphite: #141414;
  --graphite-2: #201f1d;
  --wine: #9f1738;
  --wine-dark: #781127;
  --gold: #b68b4f;
  --gold-soft: #d6bd91;
  --line: rgba(30, 26, 22, 0.14);
  --line-dark: rgba(255, 255, 255, 0.15);
  --shadow-soft: 0 18px 60px rgba(42, 31, 22, 0.1);
  --radius-sm: 12px;
  --radius-md: 22px;
  --radius-lg: 30px;
  --container: min(1640px, calc(100% - 64px));
  --section-space: clamp(88px, 7vw, 112px);
  --section-space-compact: clamp(72px, 6vw, 96px);
  --section-heading-gap: clamp(38px, 4vw, 60px);
  --layout-gap: clamp(28px, 3.5vw, 56px);
  --font-ui: Onest, "Segoe UI Variable Text", "Segoe UI", Arial, sans-serif;
  --font-display: "Cormorant Garamond", "Iowan Old Style", Baskerville, Georgia, serif;
}

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

html {
  scroll-behavior: smooth;
  text-size-adjust: 100%;
}

body {
  min-width: 320px;
  margin: 0;
  overflow-x: clip;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-ui);
  font-size: 17px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

main,
section,
header,
nav,
footer {
  min-width: 0;
}

img,
svg {
  display: block;
}

img {
  max-width: 100%;
}

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

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

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button {
  cursor: pointer;
}

:focus-visible {
  outline: 3px solid var(--focus-color, var(--wine));
  outline-offset: 4px;
}

.container {
  width: var(--container);
  margin-inline: auto;
}

section[id],
[id="contact"] {
  scroll-margin-top: 24px;
}

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

.skip-link {
  position: fixed;
  z-index: 100;
  top: 12px;
  left: 12px;
  padding: 12px 16px;
  transform: translateY(-160%);
  border-radius: 8px;
  background: var(--graphite);
  color: var(--paper-card);
  font-weight: 650;
}

.skip-link:focus {
  transform: translateY(0);
}

.section-kicker {
  display: flex;
  gap: 12px;
  align-items: center;
  margin: 0 0 20px;
  color: var(--wine);
  font-size: 0.76rem;
  font-weight: 700;
  letter-spacing: 0.15em;
  text-transform: uppercase;
}

.section-kicker::before {
  width: 28px;
  height: 1px;
  content: "";
  background: currentColor;
}

.section-title {
  margin: 0;
  font-family: var(--font-display);
  font-size: clamp(3rem, 4.8vw, 5.35rem);
  font-weight: 400;
  letter-spacing: -0.035em;
  line-height: 0.94;
  text-wrap: balance;
}

/*
 * 6-6B.6 visual mash (AUDIT_CODEX29):
 * Parent titles set letter-spacing in em; the used value is inherited as absolute px
 * based on the large root font. A fragment span with font-size:10px still inherits
 * ~-3px tracking and collapses glyphs into an unreadable column.
 * Re-bind tracking to the fragment's own font when it overrides font-size.
 * Inline letter-spacing from the editor still wins over these rules.
 */
span[data-edit-span][style*="font-size"] {
  letter-spacing: normal;
}
.section-title span[data-edit-span][style*="font-size"] {
  letter-spacing: -0.035em;
}

/* Decorative brand accent only — editor italic uses neutral <i>, not this color. */
.section-title em.text-accent,
.section-title .text-accent {
  color: var(--wine-dark);
  font-weight: 400;
}

.section-title i {
  font-style: italic;
  color: inherit;
  font-weight: inherit;
}

.section-lead {
  margin: 0;
  color: var(--ink-soft);
  font-size: clamp(1rem, 1.15vw, 1.12rem);
  line-height: 1.65;
  text-wrap: pretty;
}

@media (max-width: 980px) {
  :root {
    --section-space: clamp(64px, 8vw, 82px);
    --section-space-compact: clamp(60px, 7vw, 76px);
    --section-heading-gap: clamp(34px, 5vw, 48px);
  }
}

@media (max-width: 640px) {
  :root {
    --container: calc(100% - 32px);
    --section-space: clamp(48px, 14vw, 60px);
    --section-space-compact: clamp(44px, 12vw, 54px);
    --section-heading-gap: 30px;
    --layout-gap: 28px;
  }

  body {
    font-size: 16px;
  }

  .section-kicker {
    margin-bottom: 16px;
    font-size: 0.71rem;
  }

  .section-title {
    font-size: clamp(2.55rem, 12.5vw, 3.3rem);
    line-height: 0.96;
  }

  .section-lead {
    font-size: 1rem;
    line-height: 1.58;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }

  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    transition-delay: 0s !important;
  }
}
