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

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: var(--font);
  font-size: var(--text-base);
  font-weight: var(--weight-regular);
  line-height: var(--line-body);
  color: var(--color-text);
  background: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "kern" 1, "liga" 1;
}

img,
svg,
iframe {
  max-width: 100%;
}

img {
  display: block;
}

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

button {
  color: inherit;
}

a {
  color: var(--color-primary);
  text-decoration-thickness: 1px;
  text-underline-offset: 3px;
}

h1, h2, h3, h4, p {
  margin-top: 0;
}

h1 {
  font-size: var(--text-3xl);
  font-weight: var(--weight-bold);
  line-height: var(--line-heading);
  letter-spacing: -0.03em;
}

h2 {
  font-size: var(--text-xl);
  font-weight: var(--weight-medium);
  line-height: var(--line-heading);
  letter-spacing: -0.01em;
}

h3 {
  font-size: var(--text-lg);
  font-weight: var(--weight-medium);
  line-height: 1.3;
}

h4 {
  font-size: var(--text-md);
  font-weight: var(--weight-medium);
  letter-spacing: -0.005em;
}

small {
  color: var(--color-text-muted);
}

/* === LAYOUT CONTAINERS === */
.container {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

.container-narrow {
  width: 100%;
  max-width: var(--container-narrow);
  margin: 0 auto;
  padding: 0 var(--space-md);
}

/* === SECTIONS === */
.section {
  padding: var(--space-2xl) 0;
}

.section--lg {
  padding: var(--space-3xl) 0;
}

section[id] {
  scroll-margin-top: 76px;
}

.section--soft {
  background: var(--color-accent-light);
}

.section--surface {
  background: var(--color-surface);
  border-block: 1px solid var(--color-border);
}

.section--dark {
  background: var(--color-dark);
  color: #f7f7f4;
}

.section--dark h2,
.section--dark h3,
.section--dark p {
  color: inherit;
}

/* === SECTION HEADER === */
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: var(--space-md);
  margin-bottom: var(--space-lg);
}

.section-head p {
  max-width: 600px;
  margin: 8px 0 0;
  color: var(--color-text-muted);
}

/* Overline label above section headings */
.overline {
  display: inline-block;
  margin-bottom: var(--space-xs);
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--color-primary);
}

.overline--light {
  color: rgba(255,255,255,0.6);
}

.overline--accent {
  color: var(--color-accent);
}

/* === PAGE INTRO === */
.page-intro {
  padding: var(--space-2xl) 0 var(--space-xl);
  background: var(--color-surface);
  border-bottom: 1px solid var(--color-border);
}

.page-intro p {
  max-width: 720px;
  margin-bottom: 0;
  color: var(--color-text-muted);
  font-size: var(--text-md);
}

/* === ICONS === */
.icon {
  width: 1em;
  height: 1em;
  flex: 0 0 auto;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* === UTILITIES === */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

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

/* === DIVIDERS === */
.divider {
  border: none;
  border-top: 1px solid var(--color-border);
  margin: 0;
}

/* === LABEL TAGS === */
.label-tag {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 20px;
  font-size: var(--text-xs);
  font-weight: var(--weight-medium);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  background: var(--color-primary-light);
  color: var(--color-primary-dark);
  border: 1px solid rgba(38,128,104,0.15);
}

.label-tag--accent {
  background: var(--color-accent-light);
  color: var(--color-accent);
  border-color: rgba(103,72,0,0.12);
}

/* === RESPONSIVE BASE === */
@media (max-width: 899px) {
  .container,
  .container-narrow {
    padding: 0 var(--space-sm);
  }

  .section {
    padding: var(--space-xl) 0;
  }

  .section--lg {
    padding: var(--space-2xl) 0;
  }

  .section-head {
    display: block;
  }
}

@media (max-width: 640px) {
  h1 {
    font-size: var(--text-2xl);
    letter-spacing: -0.015em;
  }

  h2 {
    font-size: var(--text-lg);
  }
}
