/* Base CSS - Reset, Typography, Layout */

/* Reset */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html, body {
  height: 100%;
}

/* Typography */
body {
  font-family: 'Montserrat', ui-sans-serif, system-ui, sans-serif;
  font-size: 16px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

@supports (-moz-appearance: none) {
  body {
    -moz-osx-font-smoothing: grayscale;
  }
}

/* Tech monospace for status text */
.mono {
  font-family: 'JetBrains Mono', 'Fira Code', 'SF Mono', Consolas, monospace;
}

/* Main layout */
body {
  background: var(--bg-primary);
  color: var(--text-primary);
  display: grid;
  place-items: center;
  position: relative;
  overflow-x: hidden;
}

/* Grid background pattern */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  background-image:
    linear-gradient(var(--grid-line) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid-line) 1px, transparent 1px);
  background-size: 50px 50px;
  background-position: center center;
  opacity: 0.5;
  pointer-events: none;
  z-index: -2;
  animation: grid-shift 30s linear infinite;
}

@keyframes grid-shift {
  0% { background-position: 0 0; }
  100% { background-position: 50px 50px; }
}

/* Main stage container */
.stage {
  width: min(580px, 94vw);
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 28px;
  gap: 32px;
  position: relative;
}

/* Divider */
.divider {
  display: flex;
  align-items: center;
  gap: 16px;
  width: 100%;
  color: var(--text-muted);
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 2px;
  font-weight: 500;
}

.divider::before,
.divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-subtle), transparent);
}

/* Utility classes */
.hidden {
  display: none !important;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* Focus visible for accessibility */
:focus-visible {
  outline: 2px solid var(--accent-primary);
  outline-offset: 2px;
}

/* Selection */
::selection {
  background: var(--accent-subtle);
  color: var(--text-primary);
}

/* Hidden file input */
.hidden-input {
  display: none;
}

/* Restart progress bar */
.restart-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--accent-primary), var(--accent-secondary));
  width: 0;
  z-index: 9999;
  transition: width 100ms linear;
  box-shadow: 0 0 10px var(--accent-glow);
}

.restart-progress.active {
  animation: progress-fill 25s linear forwards;
}

@keyframes progress-fill {
  0% { width: 0; }
  90% { width: 85%; }
  100% { width: 95%; }
}

.restart-progress.done {
  width: 100%;
  transition: width 200ms ease-out, opacity 300ms ease-out 200ms;
  opacity: 0;
}
