* {
  box-sizing: border-box;
}

html {
  color-scheme: dark;
  background: var(--color-bg-deep);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--color-text);
  background-color: var(--color-bg-deep);
  background-image:
    linear-gradient(rgba(34, 211, 238, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(34, 211, 238, 0.025) 1px, transparent 1px);
  background-size: 36px 36px;
  font-family: Inter, "Noto Sans SC", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 16px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}

body.dialog-open {
  overflow: hidden;
}

[hidden] {
  display: none !important;
}

button,
input,
select,
textarea {
  font: inherit;
}

button,
select {
  cursor: pointer;
}

button {
  color: inherit;
}

a {
  color: var(--color-primary);
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1,
h2,
h3 {
  letter-spacing: 0;
  line-height: 1.25;
}

h1 {
  font-size: clamp(2rem, 6vw, 4.25rem);
}

h2 {
  font-size: clamp(1.5rem, 3.5vw, 2.4rem);
}

h3 {
  font-size: 1rem;
}

p {
  color: var(--color-muted);
}

small {
  font-size: 0.78rem;
}

svg {
  flex: 0 0 auto;
}

:focus-visible {
  outline: 2px solid var(--color-primary);
  outline-offset: 3px;
}

.app-shell {
  width: min(100%, var(--content-width));
  min-height: 100vh;
  margin-inline: auto;
  background: rgba(11, 17, 32, 0.88);
  border-inline: 1px solid var(--color-border);
  box-shadow: 0 0 80px rgba(0, 0, 0, 0.28);
}

.app-main {
  min-height: calc(100vh - var(--header-height));
}

.page-view {
  animation: page-in 220ms ease-out;
}

@keyframes page-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: translateY(0); }
}

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