/* Normalize */
*,
*::before,
*::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html,
body {
  height: 100%;
  font-family: system-ui, sans-serif;
  line-height: 1.5;
  background-color: #fff;
  color: #111;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  scrollbar-gutter: stable;
}

/* Design Tokens */
:root {
  /* Typography */
  --font-body: "Inter", sans-serif;
  --font-heading: "Merriweather", serif;

  /* Colours */
  --color-bg: #ffffff;
  --color-text: #333;
  --color-primary: #0057ff;
  --color-accent: #f33;
  --color-muted: #666;

  /* Theme Tokens */
  --color-surface: #ffffff;
  --color-surface-alt: #f7f7f7;
  --color-on-surface: #111;
  --color-border: #ddd;

  /* Styles */
  --radius: 8px;
  --shadow: 0 4px 8px rgba(0, 0, 0, 0.05);

  --space-xs: 0.5rem;
  --space-sm: 1rem;
  --space-md: 2rem;
  --space-lg: 4rem;
}

/* Utility Classes */
/* Spacing Utilities */
.mt-1 {
  margin-top: var(--space-sm);
}
.mt-2 {
  margin-top: var(--space-md);
}
.p-1 {
  padding: var(--space-sm);
}
.p-2 {
  padding: var(--space-md);
}

/* Layout Helpers */
.container {
  width: 90%;
  max-width: 1200px;
  margin-inline: auto;
}

.text-center {
  text-align: center;
}
.flex {
  display: flex;
  gap: var(--space-sm);
}
.grid {
  display: grid;
  gap: var(--space-sm);
}

/* Width Helpers */
.w-100 {
  width: 100%;
}
.max-w-screen {
  max-width: 100vw;
}

/* Visibility Helpers */
.hidden {
  display: none;
}
.visible {
  display: block;
}

/* Text Utilities */
.text-left {
  text-align: left;
}
.text-right {
  text-align: right;
}

/* Typography Defaults */
body {
  font-family: var(--font-body);
  font-size: 1rem;
  color: var(--color-text);
  background-color: var(--color-bg);
}

h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-heading);
  margin-bottom: 0.5em;
  line-height: 1.2;
}

p {
  margin-bottom: 1rem;
  max-width: 65ch;
}

/* Images, Links, and Lists */
img {
  max-width: 100%;
  height: auto;
  display: block;
}

a {
  color: var(--color-primary);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

ul,
ol {
  padding-left: 1.5rem;
  margin-bottom: 1rem;
}

li {
  margin-bottom: 0.5rem;
}

/* Buttons */
button {
  font: inherit;
  padding: 0.5rem 1rem;
  background-color: var(--color-primary);
  color: white;
  border: none;
  border-radius: var(--radius);
  cursor: pointer;
  transition: background 0.2s ease;
}

button:hover {
  background-color: #004bcc;
}

/* Forms */
input,
textarea,
select {
  font: inherit;
  padding: 0.5rem;
  border: 1px solid var(--color-border);
  border-radius: var(--radius);
  width: 100%;
}

/* Accessibility */
@media (prefers-reduced-motion: reduce) {
  * {
    animation: none !important;
    transition: none !important;
  }
}
