body {
  font-family: var(--font-sans);
  background: var(--bg);
  color: var(--text);
  overflow-x: hidden;
  padding-bottom: calc(var(--bottom-nav-h) + var(--safe-bottom) + 1rem);
}

@media (min-width: 768px) {
  body {
    padding-bottom: 0;
  }
}

::selection {
  background: rgba(34, 211, 238, 0.3);
  color: #a5f3fc;
}

[data-theme="light"] ::selection {
  color: #164e63;
}

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

.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: 1rem;
}

@media (min-width: 768px) {
  .container {
    padding-inline: 1.5rem;
  }
}

.section {
  padding-block: 3.5rem;
}

@media (min-width: 768px) {
  .section {
    padding-block: 5.5rem;
  }
}

.section-header {
  text-align: center;
  margin-bottom: 2.5rem;
  padding-inline: 0.5rem;
}

.section-header h2 {
  font-size: clamp(2rem, 5vw, 3rem);
  color: var(--text-strong);
  letter-spacing: -0.02em;
  margin-bottom: 0.75rem;
}

.section-header h2 em,
.section-header h2 .accent-italic {
  font-family: var(--font-display);
  font-style: italic;
  color: var(--accent);
  font-weight: 500;
}

.section-header p {
  font-size: 0.75rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--muted);
  font-weight: 300;
}

.page-main {
  min-height: 60vh;
  padding-top: calc(var(--header-h) + 1.5rem);
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  border: 0;
}

.text-center { text-align: center; }
.text-muted { color: var(--muted); }
.text-strong { color: var(--text-strong); }
.text-accent { color: var(--accent); }

.grid-2 {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .grid-2 { grid-template-columns: repeat(2, 1fr); gap: 1.25rem; }
}

.grid-3 {
  display: grid;
  gap: 1rem;
}

@media (min-width: 768px) {
  .grid-3 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .grid-3 { grid-template-columns: repeat(3, 1fr); }
}

.grid-4 {
  display: grid;
  gap: 1.25rem;
}

@media (min-width: 768px) {
  .grid-4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1200px) {
  .grid-4 { grid-template-columns: repeat(4, 1fr); }
}

.hidden { display: none !important; }

@media (min-width: 768px) {
  .md-hidden { display: none !important; }
  .md-show { display: flex !important; }
}

@media (max-width: 767px) {
  .sm-only { display: flex; }
  .md-only { display: none !important; }
}
