/* Base */
html {
  scroll-behavior: smooth;
  color-scheme: dark;
  scrollbar-gutter: stable;
}

body {
  background: var(--background);
  color: var(--foreground);
  font-family: var(--font-geist-mono), monospace;
  font-feature-settings: "liga" 0, "calt" 0;
  -webkit-font-smoothing: antialiased;
  transition: none;
}

::selection {
  background: var(--accent-subtle);
  color: var(--accent);
}

/* Scrollbar */
::-webkit-scrollbar       { width: 5px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: color-mix(in srgb, var(--foreground) 50%, transparent); border-radius: 3px; }
::-webkit-scrollbar-thumb:hover  { background: var(--muted-fg); }
::-webkit-scrollbar-thumb:active { background: var(--foreground); }

@supports not selector(::-webkit-scrollbar) {
  html {
    scrollbar-width: thin;
    scrollbar-color: color-mix(in srgb, var(--foreground) 50%, transparent) transparent;
  }
}

/* Accessibility */
:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 3px;
  border-radius: 4px;
}

.skip-link {
  position: fixed;
  top: 0.75rem;
  left: 1rem;
  z-index: 10002;
  padding: 0.5rem 0.75rem;
  border: 1px solid var(--accent);
  border-radius: 0.5rem;
  background-color: var(--surface);
  color: var(--foreground);
  font-size: 0.875rem;
  line-height: 1.25rem;
  transform: translateY(-200%);
}

.skip-link:focus {
  transform: none;
}

@keyframes popover-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.95); }
  to   { opacity: 1; transform: translateY(0) scale(1); }
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

.terminal-cursor {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--accent);
  animation: blink 1.2s step-end infinite;
}

.wavy-underline {
  text-decoration: underline wavy;
  text-decoration-color: var(--accent);
  text-underline-offset: 4px;
}

.wavy-underline-hover {
  text-underline-offset: 4px;
}
.wavy-underline-hover:hover {
  text-decoration: underline wavy;
  text-decoration-color: var(--accent);
}

.grain-overlay {
  pointer-events: none;
  position: fixed;
  inset: 0;
  z-index: 0;
  opacity: 0.05;
  mix-blend-mode: overlay;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-size: 180px 180px;
}

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

.page:focus {
  outline: none;
}

.page {
  position: relative;
  z-index: 10;
  display: flex;
  flex-direction: column;
}