/* Reset + base typography + page scaffold */
*,
*::before,
*::after {
  box-sizing: border-box;
}

* {
  margin: 0;
  padding: 0;
}

html {
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-color: var(--c-bg) var(--c-bg-sunken);
}

body {
  min-height: 100vh;
  min-height: 100dvh;
  background: var(--c-bg-darker);
  color: var(--c-text);
  font: var(--fs)/1.45 var(--font);
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
}

img,
video,
svg {
  display: block;
  max-width: 100%;
}

img {
  filter: sepia(0.18) grayscale(0.08);
}

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

a {
  color: var(--c-accent);
  text-decoration: none;
}

a:hover {
  text-decoration: underline;
}

:focus-visible {
  outline: 1px dotted var(--c-text);
  outline-offset: 1px;
}

h1,
h2,
h3 {
  font-weight: 400;
  line-height: 1.25;
}

code,
pre,
kbd {
  font-family: var(--font-mono);
  font-size: var(--fs-s);
}

pre {
  white-space: pre-wrap;
  word-break: break-word;
}

::selection {
  background: var(--c-select);
  color: var(--c-select-text);
}

/* VGUI-style scrollbars (WebKit/Blink) */
::-webkit-scrollbar {
  width: 14px;
  height: 14px;
  background: var(--c-bg-sunken);
}

::-webkit-scrollbar-thumb {
  background: var(--c-bg);
  border: 1px solid;
  border-color: var(--bevel-raised);
}

::-webkit-scrollbar-thumb:hover {
  background: #56634c;
}

::-webkit-scrollbar-corner {
  background: var(--c-bg-sunken);
}

.visually-hidden {
  position: absolute !important;
  width: 1px;
  height: 1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
}

/* ---- page ------------------------------------------------------------------------------------ */
.page {
  display: flex;
  flex-direction: column;
}

.page--center {
  display: flex;
  min-height: 60vh;
  align-items: center;
  justify-content: center;
  padding: var(--gutter);
}

.page__app {
  display: flex;
  flex: 1;
  flex-direction: column;
  min-height: 100vh;
  min-height: 100dvh;
}

.page__main {
  flex: 1;
  width: 100%;
  max-width: var(--page-max);
  margin: 0 auto;
  padding: var(--sp-5) var(--gutter) var(--sp-7);
}

.page__main--wide {
  max-width: none;
  padding: 0;
}

.page__footer {
  padding: var(--sp-5) var(--gutter);
  border-top: 1px solid var(--c-dark);
  box-shadow: inset 0 1px 0 var(--c-light);
  background: var(--c-bg);
  color: var(--c-text-faint);
  font-size: var(--fs-s);
  text-align: center;
}

.page__footer a {
  color: var(--c-text-dim);
}

/* Top loading bar shown during route changes */
.route-progress {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  background: var(--c-accent);
  transition: width 0.3s ease, opacity 0.3s ease 0.2s;
  opacity: 0;
}

.route-progress--active {
  width: 70%;
  opacity: 1;
  transition: width 2s cubic-bezier(0.1, 0.6, 0.3, 1);
}

.route-progress--done {
  width: 100%;
  opacity: 0;
}

/* ---- boot splash ----------------------------------------------------------------------------- */
.splash {
  display: flex;
  flex: 1;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sp-6);
}

.splash__logo {
  width: 96px;
  height: 96px;
  filter: sepia(0.64) grayscale(0.32);
}

.splash__bar {
  width: 180px;
  height: 14px;
  padding: 2px;
  border: 1px solid;
  border-color: var(--bevel-sunken);
  background: var(--c-bg-sunken);
}

.splash__fill {
  height: 100%;
  width: 40%;
  background: repeating-linear-gradient(90deg, var(--c-select) 0 8px, transparent 8px 10px);
  animation: splash-slide 1.2s linear infinite;
}

@keyframes splash-slide {
  from { transform: translateX(-100%); }
  to { transform: translateX(250%); }
}

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