/*
 * Typography
 *
 * Establishes the type system: families, scale, hierarchy, and rhythm.
 *
 * Developed by: Rhyll Neri
 */

html {
  font-size: 100%;
}

body {
  font-family: var(--font-sans);
  font-size: var(--fs-16);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  font-weight: var(--fw-regular);
}

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-display);
  font-weight: var(--fw-medium);
  line-height: var(--lh-tight);
  letter-spacing: var(--ls-tight);
  color: var(--color-ink);
}

h1, .h1 {
  font-size: clamp(2.25rem, 5vw + 0.5rem, var(--fs-72));
  font-weight: var(--fw-semibold);
}

h2, .h2 {
  font-size: clamp(1.875rem, 3vw + 0.5rem, var(--fs-56));
}

h3, .h3 {
  font-size: clamp(1.5rem, 2vw + 0.5rem, var(--fs-42));
  margin-bottom: 1.5rem;
}

h4, .h4 {
  font-size: clamp(1.25rem, 1vw + 0.6rem, var(--fs-28));
  letter-spacing: var(--ls-snug);
}

h5, .h5 {
  font-size: var(--fs-22);
}

h6, .h6 {
  font-size: var(--fs-18);
}

p, ul, ol, dl {
  margin: 0 0 1em;
  color: var(--color-text);
}

.lead {
  font-size: clamp(1.0625rem, 0.6vw + 1rem, var(--fs-20));
  line-height: var(--lh-relaxed);
  color: var(--color-text-muted);
}

a {
  color: var(--color-primary);
  text-decoration: none;
  transition: color var(--dur-200) var(--ease-out);
}

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

strong, b {
  font-weight: var(--fw-semibold);
}

em, i {
  font-style: italic;
}

small,
.small {
  font-size: var(--fs-14);
}

/* --- Inline text formatting --- */

/* Strikethrough: <s> (no longer accurate/relevant) and <del> (removed text). */
s,
strike {
  text-decoration: line-through;
  text-decoration-thickness: 1px;
}

del {
  text-decoration: line-through;
  text-decoration-color: var(--color-error);
  color: var(--color-text-muted);
}

/* Inserted / underlined text. */
ins {
  text-decoration: underline;
  text-decoration-color: var(--color-success);
  text-underline-offset: 2px;
  background: rgba(28, 139, 90, 0.08);
  padding: 0 0.15em;
}

u {
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Highlight. */
mark {
  background: var(--color-accent-50);
  color: var(--color-ink);
  padding: 0.05em 0.3em;
  border-radius: var(--radius-xs);
}

/* Abbreviations with an explanatory title. */
abbr[title] {
  text-decoration: underline dotted;
  text-underline-offset: 2px;
  cursor: help;
}

/* Definitions + variables. */
dfn {
  font-style: italic;
}

var {
  font-family: var(--font-mono);
  font-style: italic;
}

/* Sub / superscript that doesn't disturb line height. */
sub,
sup {
  font-size: 0.75em;
  line-height: 0;
  position: relative;
  vertical-align: baseline;
}

sup { top: -0.5em; }
sub { bottom: -0.25em; }

/* Definition lists. */
dt {
  font-weight: var(--fw-semibold);
  color: var(--color-ink);
}

dd {
  margin: 0 0 var(--space-3) var(--space-5);
  color: var(--color-text-muted);
}

/* Content lists (article / page body) get real markers + rhythm. */
.entry-content ul,
.entry-content ol {
  padding-left: 1.5em;
  margin: 0 0 1.25em;
}

.entry-content ul { list-style: disc; }
.entry-content ol { list-style: decimal; }

.entry-content li {
  margin-bottom: 0.5em;
}

.entry-content li::marker {
  color: var(--color-accent);
}

blockquote {
  font-family: var(--font-display);
  font-style: italic;
  font-size: clamp(1.25rem, 1vw + 0.75rem, var(--fs-28));
  line-height: var(--lh-snug);
  color: var(--color-ink);
  border-left: 3px solid var(--color-accent);
  padding: var(--space-4) var(--space-6);
  margin: var(--space-6) 0;
}

cite {
  display: block;
  font-style: normal;
  font-family: var(--font-sans);
  font-size: var(--fs-14);
  color: var(--color-text-muted);
  margin-top: var(--space-3);
}

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

code {
  padding: 0.15em 0.4em;
  background: var(--color-mist);
  border-radius: var(--radius-xs);
}

pre {
  padding: var(--space-5);
  background: var(--color-mist);
  border-radius: var(--radius-md);
  overflow-x: auto;
}

hr {
  border: 0;
  border-top: 1px solid var(--color-border);
  margin: var(--space-8) 0;
}

.eyebrow {
  font-family: var(--font-sans);
  font-size: var(--fs-12);
  font-weight: var(--fw-semibold);
  letter-spacing: var(--ls-eyebrow);
  text-transform: uppercase;
  color: var(--color-accent);
  margin-bottom: var(--space-3);
  display: inline-flex;
  align-items: center;
  gap: var(--space-2);
}

.eyebrow::before {
  content: '';
  display: inline-block;
  width: 24px;
  height: 1px;
  background: currentColor;
}

.eyebrow--center::before { display: none; }
.eyebrow--center { justify-content: center; }

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

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

/* Text decoration utilities. */
.text-strike,
.text-line-through { text-decoration: line-through; }
.text-underline    { text-decoration: underline; text-underline-offset: 2px; }
.text-no-underline { text-decoration: none; }
.text-highlight    { background: var(--color-accent-50); color: var(--color-ink); padding: 0.05em 0.3em; border-radius: var(--radius-xs); }

/* Text transform utilities. */
.text-uppercase  { text-transform: uppercase; }
.text-lowercase  { text-transform: lowercase; }
.text-capitalize { text-transform: capitalize; }
.text-normal-case { text-transform: none; }

/* Wrapping / overflow utilities. */
.text-nowrap  { white-space: nowrap; }
.text-balance { text-wrap: balance; }
.text-truncate {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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