* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
  background-color: var(--surface-1);
  color: var(--text-1);
  line-height: 1.6;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
}

h1, h2, h3, h4, h5, h6 {
  font-weight: 600;
  line-height: 1.2;
  margin-bottom: var(--size-3);
  color: var(--text-1);
}

h1 { font-size: var(--font-size-5); }
h2 { font-size: var(--font-size-4); }
h3 { font-size: var(--font-size-3); }

p {
  margin-bottom: var(--size-3);
}

a {
  color: var(--link-color);
  text-decoration: none;
  transition: color 0.2s ease;
}

a:hover {
  color: var(--link-hover-color);
}

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

/* Site header */
.site-header {
  position: relative;
  background-color: white;
  border-bottom: 1px solid var(--surface-3);
  padding-block: var(--size-4);
}

[data-theme="dark"] .site-header {
  background-color: var(--surface-2);
}

.site-header__inner {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: var(--size-3);
}

.site-title {
  display: flex;
  align-items: center;
  gap: var(--size-2);
  font-size: var(--font-size-4);
  color: var(--text-1);
  font-weight: 600;
  margin: 0;
}

.site-logo {
  display: inline-block;
  width: 32px;
  height: 32px;
}

.site-logo svg {
  width: 100%;
  height: 100%;
  fill: var(--text-1);
}

[data-theme="dark"] .site-logo svg {
  fill: white;
}

/* Navigation */
.menu-toggle {
  display: none;
  background: none;
  border: none;
  cursor: pointer;
  padding: var(--size-2);
  margin-left: auto;
}

.menu-toggle__icon {
  display: block;
  width: 24px;
  height: 2px;
  background-color: var(--text-1);
  position: relative;
}

.menu-toggle__icon::before,
.menu-toggle__icon::after {
  content: '';
  position: absolute;
  width: 24px;
  height: 2px;
  background-color: var(--text-1);
  left: 0;
  transition: transform 0.3s ease;
}

.menu-toggle__icon::before {
  top: -8px;
}

.menu-toggle__icon::after {
  top: 8px;
}

.site-nav__list {
  display: flex;
  list-style: none;
  gap: var(--size-5);
  flex-wrap: wrap;
}

.site-nav__link {
  color: var(--text-1);
  font-size: var(--font-size-1);
}

.site-nav__link:hover,
.site-nav__link--active {
  color: var(--link-color);
}

.site-nav__item--theme {
  display: flex;
  align-items: center;
}

.site-nav__item--theme .theme-toggle {
  flex-shrink: 0;
}

/* Mobile menu */
@media (max-width: 768px) {
  .menu-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    top: 100%;
    right: var(--size-4);
    width: max-content;
    min-width: 200px;
    background-color: var(--surface-1);
    border: 1px solid var(--surface-3);
    border-radius: var(--radius-2);
    box-shadow: var(--shadow-3);
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease;
  }

  .site-nav--open {
    max-height: 400px;
  }

  .site-nav__list {
    flex-direction: column;
    padding: var(--size-4);
    gap: 0;
  }

  .site-nav__link {
    display: block;
    padding: var(--size-3) 0;
  }

  .site-nav__item--theme {
    padding: var(--size-3) 0;
  }
}

/* Footer */
.site-footer {
  background-color: white;
  border-top: 1px solid var(--surface-3);
  padding-block: var(--size-5);
  text-align: center;
  font-size: var(--font-size-0);
}

[data-theme="dark"] .site-footer {
  background-color: var(--surface-2);
}

/* Main content */
.site-main {
  padding-block: var(--size-7);
  flex: 1;
}
