/* ==========================================================================
   Typography System
   Primary:   Open Sans (body, UI)
   Secondary: Fraunces (display, headings)
   ========================================================================== */

@import url("https://fonts.googleapis.com/css2?family=Open+Sans:ital,wght@0,300..800;1,300..800&family=Fraunces:ital,opsz,wght@0,9..144,300..900;1,9..144,300..900&display=swap");

:root {
  --font-sans:
    "Open Sans", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --font-display: "Fraunces", Georgia, "Times New Roman", serif;
  --font-mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;

  /* Fluid type scale — ratio 1.25, base 16→18px */
  --text-xs: clamp(0.75rem, 0.71rem + 0.2vw, 0.875rem);
  --text-sm: clamp(0.875rem, 0.83rem + 0.22vw, 1rem);
  --text-base: clamp(1rem, 0.95rem + 0.25vw, 1.125rem);
  --text-lg: clamp(1.125rem, 1.06rem + 0.32vw, 1.25rem);
  --text-xl: clamp(1.25rem, 1.16rem + 0.45vw, 1.5rem);
  --text-2xl: clamp(1.5rem, 1.36rem + 0.7vw, 1.875rem);
  --text-3xl: clamp(1.875rem, 1.66rem + 1.05vw, 2.5rem);
  --text-4xl: clamp(2.25rem, 1.9rem + 1.75vw, 3.25rem);
  --text-5xl: clamp(2.75rem, 2.2rem + 2.75vw, 4.25rem);
  --text-6xl: clamp(3.25rem, 2.45rem + 4vw, 5.5rem);

  --fw-light: 300;
  --fw-regular: 400;
  --fw-medium: 500;
  --fw-semibold: 600;
  --fw-bold: 700;

  --lh-tight: 1.1;
  --lh-snug: 1.25;
  --lh-normal: 1.5;
  --lh-relaxed: 1.65;
  --lh-loose: 1.8;

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

  --measure: 65ch;

  --color-text: #2a1810;
  --color-text-muted: #6b5444;
  --color-text-subtle: #8a7565;
  --color-link: #8b3a1f;
  --color-link-hover: #5c2410;

  --color-accent-coral: #a8421f;
  --color-accent-sage: #3d5e4a;
  --color-accent-plum: #5a3a6b;
  --color-accent-mustard: #8a6420;
}

html {
  font-size: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-base);
  font-weight: var(--fw-regular);
  line-height: var(--lh-relaxed);
  color: var(--color-text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  font-feature-settings: "kern", "liga", "calt";
}

/* ==========================================================================
   Headings — Fraunces
   ========================================================================== */

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-semibold);
  line-height: var(--lh-tight);
  letter-spacing: var(--tracking-tight);
  color: var(--color-text);
  margin: 0 0 0.5em;
  text-wrap: balance;
  font-variation-settings:
    "opsz" 144,
    "SOFT" 50;
}

h1 {
  font-size: var(--text-5xl);
  font-weight: var(--fw-bold);
  letter-spacing: var(--tracking-tighter);
}

h2 {
  font-size: var(--text-4xl);
}
h3 {
  font-size: var(--text-3xl);
}

h4 {
  font-size: var(--text-2xl);
  font-weight: var(--fw-medium);
}

h5 {
  font-size: var(--text-xl);
  font-weight: var(--fw-medium);
  font-variation-settings: "opsz" 14;
}

h6 {
  font-size: var(--text-lg);
  font-weight: var(--fw-medium);
  font-variation-settings: "opsz" 14;
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
}

.display {
  font-family: var(--font-display);
  font-size: var(--text-6xl);
  font-weight: var(--fw-bold);
  line-height: 0.95;
  letter-spacing: var(--tracking-tighter);
  font-variation-settings:
    "opsz" 144,
    "SOFT" 30;
}

.display em,
h1 em,
h2 em,
h3 em {
  font-style: italic;
  font-variation-settings:
    "opsz" 144,
    "SOFT" 100;
}

/* ==========================================================================
   Body text
   ========================================================================== */

p {
  margin: 0 0 1.25em;
  max-width: var(--measure);
  text-wrap: pretty;
}

.lead {
  font-size: var(--text-lg);
  line-height: var(--lh-relaxed);
  color: var(--color-text-muted);
  font-weight: var(--fw-light);
  max-width: 55ch;
}

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

.text-muted {
  color: var(--color-text-muted);
}
.text-subtle {
  color: var(--color-text-subtle);
}
.text-coral {
  color: var(--color-accent-coral);
}
.text-sage {
  color: var(--color-accent-sage);
}
.text-plum {
  color: var(--color-accent-plum);
}
.text-mustard {
  color: var(--color-accent-mustard);
}

.eyebrow {
  display: inline-block;
  font-size: var(--text-xs);
  font-weight: var(--fw-semibold);
  text-transform: uppercase;
  letter-spacing: var(--tracking-wider);
  color: var(--color-accent-coral);
  margin: 0 0 0.75em;
  max-width: none;
}

/* ==========================================================================
   Inline elements
   ========================================================================== */

strong,
b {
  font-weight: var(--fw-semibold);
}
em,
i {
  font-style: italic;
}

a {
  color: var(--color-link);
  text-decoration: underline;
  text-decoration-thickness: 0.08em;
  text-underline-offset: 0.18em;
  transition:
    color 0.15s ease,
    text-decoration-color 0.15s ease;
}

a:hover,
a:focus-visible {
  color: var(--color-link-hover);
  text-decoration-thickness: 0.12em;
}

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

code {
  background: rgba(0, 0, 0, 0.05);
  padding: 0.15em 0.4em;
  border-radius: 3px;
}

pre {
  background: rgba(0, 0, 0, 0.05);
  padding: 1em 1.25em;
  border-radius: 6px;
  overflow-x: auto;
  line-height: var(--lh-snug);
}

pre code {
  background: transparent;
  padding: 0;
}

blockquote {
  font-family: var(--font-display);
  font-size: var(--text-xl);
  font-style: italic;
  line-height: var(--lh-snug);
  color: var(--color-text);
  border-left: 3px solid currentColor;
  padding-left: 1.25em;
  margin: 2em 0;
  max-width: 55ch;
  font-variation-settings:
    "opsz" 144,
    "SOFT" 100;
}

blockquote cite {
  display: block;
  margin-top: 0.75em;
  font-family: var(--font-sans);
  font-size: var(--text-sm);
  font-style: normal;
  color: var(--color-text-muted);
}

blockquote cite::before {
  content: "— ";
}

/* ==========================================================================
   Lists
   ========================================================================== */

ul,
ol {
  margin: 0 0 1.25em;
  padding-left: 1.5em;
  max-width: var(--measure);
}

li {
  margin-bottom: 0.4em;
  line-height: var(--lh-relaxed);
}

li > ul,
li > ol {
  margin-top: 0.4em;
}

dl {
  margin: 0 0 1.25em;
}
dt {
  font-weight: var(--fw-semibold);
  margin-top: 0.75em;
}
dd {
  margin: 0 0 0.5em;
  color: var(--color-text-muted);
}

/* ==========================================================================
   Heading rhythm
   ========================================================================== */

* + h1 {
  margin-top: 1.5em;
}
* + h2 {
  margin-top: 1.75em;
}
* + h3 {
  margin-top: 1.5em;
}
* + h4 {
  margin-top: 1.25em;
}
* + h5,
* + h6 {
  margin-top: 1em;
}

h1 + *,
h2 + *,
h3 + * {
  margin-top: 0.5em;
}

/* ==========================================================================
   Utilities
   ========================================================================== */

.font-sans {
  font-family: var(--font-sans);
}
.font-display {
  font-family: var(--font-display);
}
.font-mono {
  font-family: var(--font-mono);
}

.fw-light {
  font-weight: var(--fw-light);
}
.fw-regular {
  font-weight: var(--fw-regular);
}
.fw-medium {
  font-weight: var(--fw-medium);
}
.fw-semibold {
  font-weight: var(--fw-semibold);
}
.fw-bold {
  font-weight: var(--fw-bold);
}

.text-left {
  text-align: left;
}
.text-center {
  text-align: center;
}
.text-right {
  text-align: right;
}

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

.truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

@media (prefers-reduced-motion: reduce) {
  a {
    transition: none;
  }
}
