/* ===============================================
   DEATHLAB BASE STYLES
   Global resets, typography, and core styles
   =============================================== */

/* Import Tokens First */
@import "dl-tokens.css";

/* ======================
   GLOBAL RESETS
   ====================== */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  scroll-behavior: smooth;
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ======================
   BASE ELEMENTS
   ====================== */

html,
body {
  background: var(--dl-black) !important;
  color: var(--dl-white) !important;
  font-family: var(--font-primary) !important;
  font-size: 16px;
  line-height: 1.6;
  margin: 0;
  padding: 0;
  min-height: 100vh;
}

/* Force dark background on all containers */
.site-wrapper,
.site-main,
main,
.content,
.viewport {
  background: var(--dl-black) !important;
  background-image: none !important;
}

/* ======================
   TYPOGRAPHY
   ====================== */

h1, h2, h3, h4, h5, h6,
.h1, .h2, .h3, .h4, .h5, .h6 {
  font-family: var(--font-accent) !important;
  color: var(--dl-white) !important;
  font-weight: 700 !important;
  letter-spacing: -0.01em;
  line-height: 1.25;
  margin-top: 0;
}

h1, .h1 {
  font-size: 3.5rem;
  line-height: 1.1;
}

h2, .h2 {
  font-size: 2.5rem;
  line-height: 1.2;
}

h3, .h3 {
  font-size: 1.875rem;
}

h4, .h4 {
  font-size: 1.5rem;
}

h5, .h5 {
  font-size: 1.25rem;
}

h6, .h6 {
  font-size: 1.125rem;
}

p,
.text-content {
  color: var(--dl-white);
  font-size: 1rem;
  line-height: 1.6;
  margin-bottom: 1rem;
}

/* Responsive Typography */
@media (max-width: 768px) {
  h1, .h1 {
    font-size: 2.5rem;
  }

  h2, .h2 {
    font-size: 2rem;
  }

  h3, .h3 {
    font-size: 1.5rem;
  }

  h4, .h4 {
    font-size: 1.25rem;
  }
}

/* ======================
   LINKS
   ====================== */

a {
  color: var(--dl-cyan) !important;
  text-decoration: none !important;
  transition: color var(--transition-base), opacity var(--transition-base);
}

a:hover {
  color: var(--dl-cyan-200) !important;
  text-decoration: underline !important;
  text-underline-offset: 3px;
}

a:focus-visible {
  outline: 2px solid var(--dl-outline);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(111, 228, 255, 0.15);
  border-radius: 4px;
}

/* ======================
   SELECTION
   ====================== */

::selection {
  background: rgba(111, 228, 255, 0.3);
  color: var(--dl-white);
}

::-moz-selection {
  background: rgba(111, 228, 255, 0.3);
  color: var(--dl-white);
}

/* ======================
   SCROLLBAR
   ====================== */

::-webkit-scrollbar {
  width: 12px;
  height: 12px;
}

::-webkit-scrollbar-track {
  background: var(--dl-black);
}

::-webkit-scrollbar-thumb {
  background: var(--dl-gunmetal);
  border-radius: 6px;
  border: 2px solid var(--dl-black);
}

::-webkit-scrollbar-thumb:hover {
  background: rgba(111, 228, 255, 0.3);
}

/* ======================
   HORIZONTAL RULE
   ====================== */

hr {
  border: 0;
  border-top: var(--dl-border);
  margin: 2rem 0;
}

/* ======================
   CONTAINERS
   ====================== */

.container,
.site-container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 2rem;
}

@media (max-width: 768px) {
  .container,
  .site-container {
    padding: 0 1.25rem;
  }
}

/* ======================
   SECTIONS
   ====================== */

section {
  padding: 4rem 0;
}

@media (max-width: 768px) {
  section {
    padding: 2.5rem 0;
  }
}

/* ======================
   UTILITIES
   ====================== */

/* Visibility */
.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

/* Skip Link */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: var(--dl-cyan);
  color: var(--dl-black);
  padding: 0.75rem 1.5rem;
  text-decoration: none;
  border-radius: 0 0 var(--radius-md) 0;
  z-index: 1000;
}

.skip-link:focus {
  top: 0;
}

/* Text Utilities */
.text-cyan {
  color: var(--dl-cyan) !important;
}

.text-white {
  color: var(--dl-white) !important;
}

.text-steel {
  color: var(--dl-steel) !important;
}

.text-center {
  text-align: center;
}

.text-left {
  text-align: left;
}

.text-right {
  text-align: right;
}

/* Background Utilities */
.bg-black {
  background: var(--dl-black);
}

.bg-gunmetal {
  background: var(--dl-gunmetal);
}

.bg-glow {
  background: var(--dl-glow);
}

/* Spacing Utilities */
.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 0.5rem; }
.mt-2 { margin-top: 1rem; }
.mt-3 { margin-top: 1.5rem; }
.mt-4 { margin-top: 2rem; }
.mt-5 { margin-top: 3rem; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 0.5rem; }
.mb-2 { margin-bottom: 1rem; }
.mb-3 { margin-bottom: 1.5rem; }
.mb-4 { margin-bottom: 2rem; }
.mb-5 { margin-bottom: 3rem; }

.pt-0 { padding-top: 0; }
.pt-1 { padding-top: 0.5rem; }
.pt-2 { padding-top: 1rem; }
.pt-3 { padding-top: 1.5rem; }
.pt-4 { padding-top: 2rem; }
.pt-5 { padding-top: 3rem; }

.pb-0 { padding-bottom: 0; }
.pb-1 { padding-bottom: 0.5rem; }
.pb-2 { padding-bottom: 1rem; }
.pb-3 { padding-bottom: 1.5rem; }
.pb-4 { padding-bottom: 2rem; }
.pb-5 { padding-bottom: 3rem; }

/* ======================
   FOCUS MANAGEMENT
   ====================== */

button:focus-visible,
input:focus-visible,
textarea:focus-visible,
select:focus-visible,
a:focus-visible,
[tabindex]:focus-visible {
  outline: 2px solid var(--dl-outline);
  outline-offset: 2px;
  box-shadow: 0 0 0 6px rgba(111, 228, 255, 0.15);
}

/* Remove default focus for mouse users */
button:focus:not(:focus-visible),
a:focus:not(:focus-visible) {
  outline: none;
  box-shadow: none;
}

/* ======================
   REDUCED MOTION
   ====================== */

@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}

/* ======================
   PRINT STYLES
   ====================== */

@media print {
  body {
    background: white !important;
    color: black !important;
  }

  a {
    text-decoration: underline !important;
  }

  nav,
  .site-header,
  .site-footer,
  button {
    display: none !important;
  }
}
