/* Base Styles & Typography */

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  /* stops iOS bumping type up a size when the phone is turned sideways */
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  padding: 0;
  background-color: var(--gray-200);
  color: var(--gray-900);
  font-family: var(--font-ui);
  font-size: 1rem;
  line-height: var(--leading-normal);
  font-feature-settings: 'kern' 1;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

/* A long unbroken string (URL, API key, ₦ amount) must wrap rather than push
   the page wider than the viewport. */
body {
  overflow-wrap: break-word;
}

/* Typography */

h1, h2, h3, h4, h5, h6 {
  margin: 0;
  font-family: var(--font-display);
  font-weight: 800;
  line-height: var(--leading-tight);
  letter-spacing: -0.02em;
}

h1 {
  font-size: var(--text-6xl);
  line-height: 0.94;
  letter-spacing: -0.03em;
}

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

h3 {
  font-size: var(--text-xl);
  font-weight: 600;
}

h4 {
  font-size: var(--text-lg);
  font-weight: 600;
}

p {
  margin: 0;
  line-height: var(--leading-relaxed);
}

a {
  color: var(--pink-500);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--pink-600);
}

/* Links in content */
main a {
  border-bottom: 1px solid currentColor;
}

main a:hover {
  border-bottom-color: currentColor;
}

/* Images */
img {
  display: block;
  max-width: 100%;
  height: auto;
}

/* Lists */
ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* Code blocks */
code {
  font-family: var(--font-mono);
  font-size: 0.9em;
  background-color: var(--gray-100);
  padding: 2px 6px;
  border-radius: var(--radius-sm);
}

pre {
  background-color: var(--gray-900);
  color: var(--white);
  padding: var(--space-4);
  border-radius: var(--radius-lg);
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: var(--text-sm);
  line-height: var(--leading-normal);
}

pre code {
  background: none;
  color: inherit;
  padding: 0;
}

/* Forms */
input, textarea, select {
  font-family: inherit;
  font-size: inherit;
}

input[type="text"],
input[type="email"],
input[type="tel"],
input[type="url"],
textarea,
select {
  width: 100%;
  padding: var(--space-3) var(--space-4);
  border: 1px solid var(--gray-300);
  border-radius: var(--radius-md);
  background-color: var(--white);
  color: var(--gray-900);
  transition: all var(--transition-base);
}

input[type="text"]:focus,
input[type="email"]:focus,
input[type="tel"]:focus,
input[type="url"]:focus,
textarea:focus,
select:focus {
  outline: none;
  border-color: var(--pink-500);
  box-shadow: 0 0 0 3px rgba(235, 33, 136, 0.1);
}

/* Typography utility classes */
.text-accent {
  color: var(--pink-500);
}

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

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

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

.text-wrap-balance {
  text-wrap: balance;
}

.text-wrap-pretty {
  text-wrap: pretty;
}

/* Scrollbar styling */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background-color: var(--gray-400);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background-color: var(--gray-600);
}

/* Selection styling */
::selection {
  background-color: var(--pink-500);
  color: var(--white);
}

/* Focus visible outline for accessibility */
:focus-visible {
  outline: 2px solid var(--pink-500);
  outline-offset: 2px;
}

/* Label text that only screen readers need, e.g. a control the visible
   layout already names */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Reduce motion for users who prefer it */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
