:root {
  color-scheme: light;

  --background: #f7faff;
  --surface: #ffffff;
  --surface-muted: #eef5fc;

  --text: #152235;
  --text-muted: #66758a;

  --border: #dce7f2;

  --blue: #1769aa;
  --blue-dark: #0e4f83;
  --blue-soft: #e2f0fc;

  --drawing: #1769aa;
  --drawing-light: #9fc5e4;

  --shadow: 0 18px 45px rgba(29, 77, 115, 0.1);

  --container-width: 1120px;
  --radius: 16px;
  --font-sans: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont,
    "Segoe UI", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, monospace;
}

:root[data-theme="dark"] {
  color-scheme: dark;

  --background: #0d141c;
  --surface: #141e29;
  --surface-muted: #1a2a39;

  --text: #f1f6fb;
  --text-muted: #9eafc0;

  --border: #293b4c;

  --blue: #5aabeb;
  --blue-dark: #86c5f3;
  --blue-soft: #183950;

  --drawing: #62b5f0;
  --drawing-light: #426b89;

  --shadow: 0 18px 45px rgba(0, 0, 0, 0.25);
}

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

html {
  scroll-behavior: smooth;
}

body {
  min-width: 320px;
  background: var(--background);
  color: var(--text);
  font-family: var(--font-sans);
  line-height: 1.6;
  transition:
    background-color 0.25s ease,
    color 0.25s ease;
}

a {
  color: inherit;
  text-decoration: none;
}

button,
a {
  -webkit-tap-highlight-color: transparent;
}

button:focus-visible,
a:focus-visible {
  outline: 3px solid var(--blue);
  outline-offset: 4px;
}

.container {
  width: min(calc(100% - 40px), var(--container-width));
  margin-inline: auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 10;
  border-bottom: 1px solid var(--border);
  background: rgba(247, 250, 255, 0.88);
  backdrop-filter: blur(12px);
}

:root[data-theme="dark"] .site-header {
  background: rgba(13, 20, 28, 0.88);
}

.navbar {
  min-height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.logo {
  color: var(--text);
  font-size: 1.4rem;
  font-weight: 800;
  letter-spacing: -0.07em;
}

.logo span {
  color: var(--blue);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
}

.nav-links > a {
  color: var(--text-muted);
  font-size: 0.9rem;
  transition: color 0.2s ease;
}

.nav-links > a:hover {
  color: var(--blue);
}

.theme-toggle {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: 50%;
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  font-size: 1rem;
  transition:
    border-color 0.2s ease,
    background-color 0.2s ease,
    transform 0.2s ease;
}

.theme-toggle:hover {
  border-color: var(--blue);
  background: var(--surface-muted);
  transform: rotate(12deg);
}

.button {
  min-height: 46px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0 20px;
  border: 1px solid transparent;
  border-radius: 8px;
  font-size: 0.9rem;
  font-weight: 700;
  transition:
    background-color 0.2s ease,
    border-color 0.2s ease,
    color 0.2s ease,
    transform 0.2s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button-primary {
  background: var(--blue);
  color: #ffffff;
}

.button-primary:hover {
  background: var(--blue-dark);
}

.button-secondary {
  border-color: var(--border);
  background: var(--surface);
  color: var(--text);
}

.button-secondary:hover {
  border-color: var(--blue);
  background: var(--surface-muted);
}

@media (max-width: 560px) {
  .container {
    width: min(calc(100% - 28px), var(--container-width));
  }

  .navbar {
    min-height: 64px;
  }

  .nav-links {
    gap: 12px;
  }

  .nav-links > a {
    display: none;
  }

  .button {
    width: 100%;
  }
}

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    scroll-behavior: auto !important;
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
  }
}
