/* DocketRadar — Base Styles
   Reset, typography, and foundational rules
   Google Fonts: Inter weights 300-800 required */

/* ========== Skip Navigation ========== */
.skip-nav {
  position: absolute;
  left: -9999px;
  top: auto;
  width: 1px;
  height: 1px;
  overflow: hidden;
  z-index: 10000;
}
.skip-nav:focus {
  position: fixed;
  top: 12px;
  left: 12px;
  width: auto;
  height: auto;
  padding: 12px 20px;
  background: var(--color-teal-700, #0f766e);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  border-radius: 8px;
  text-decoration: none;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

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

html {
  font-size: 16px;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  scroll-padding-top: var(--nav-height);
}

[id] {
  scroll-margin-top: 64px;
}

body {
  font-family: var(--font-sans);
  font-size: var(--text-body);
  font-weight: 400;
  line-height: 1.7;
  color: var(--color-slate-700);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--color-teal);
  text-decoration: none;
  transition: color var(--transition-base);
}

a:hover {
  color: var(--color-teal-dark);
}

a:focus-visible {
  outline: 2px solid var(--color-teal);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

ul,
ol {
  list-style: none;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
}

button:focus-visible {
  outline: 2px solid var(--color-teal);
  outline-offset: 2px;
  border-radius: var(--radius-sm);
}

/* ========== Typography ========== */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-sans);
  color: var(--color-slate-800);
  line-height: 1.25;
}

h1 {
  font-size: var(--text-h1);
  font-weight: 700;
  letter-spacing: -0.02em;
  line-height: 1.25;
}

h2 {
  font-size: var(--text-h2);
  font-weight: 600;
  letter-spacing: -0.015em;
  line-height: 1.3;
}

h3 {
  font-size: var(--text-h3);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.35;
}

h4 {
  font-size: var(--text-h4);
  font-weight: 600;
  line-height: 1.4;
}

.display {
  font-size: var(--text-display);
  font-weight: 700;
  letter-spacing: -0.025em;
  line-height: 1.2;
  color: var(--color-slate-900);
}

p {
  margin-bottom: 0.75em;
}

p:last-child {
  margin-bottom: 0;
}

.text-sm {
  font-size: var(--text-body-sm);
  line-height: 1.5;
}

.text-caption {
  font-size: var(--text-caption);
  line-height: 1.4;
  letter-spacing: 0.01em;
  color: var(--color-slate-500);
}

.text-overline {
  font-size: var(--text-overline);
  font-weight: 600;
  line-height: 1.4;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-teal);
}

.text-center {
  text-align: center;
}

.text-navy {
  color: var(--color-navy);
}

.text-teal {
  color: var(--color-teal);
}

.text-white {
  color: #ffffff;
}

.text-slate {
  color: var(--color-slate-600);
}

/* ========== Selection ========== */
::selection {
  background: rgba(184, 134, 11, 0.15);
  color: var(--color-slate-900);
}

/* ========== Focus for accessibility ========== */
:focus:not(:focus-visible) {
  outline: none;
}

/* ========== Monospace ========== */
code,
.mono {
  font-family: var(--font-mono);
  font-size: 0.9em;
}

/* ========== Noise / Grain Texture Overlay ========== */
.noise-overlay {
  position: relative;
}

.noise-overlay::after {
  content: "";
  position: absolute;
  inset: 0;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  pointer-events: none;
  z-index: 1;
  opacity: 0.5;
}

/* ========== Fade-Up Animation ========== */
@keyframes fade-up {
  from {
    opacity: 0;
    transform: translateY(16px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.fade-up {
  animation: fade-up 0.8s ease-out forwards;
}

.fade-up-delay-1 {
  animation: fade-up 0.8s ease-out 0.3s forwards;
  opacity: 0;
}

.fade-up-delay-2 {
  animation: fade-up 0.8s ease-out 0.5s forwards;
  opacity: 0;
}

.fade-up-delay-3 {
  animation: fade-up 0.8s ease-out 0.7s forwards;
  opacity: 0;
}

/* ========== Scroll Reveal ========== */
.scroll-reveal {
  opacity: 0;
  transform: translateY(16px);
  transition:
    opacity 0.6s ease,
    transform 0.6s ease;
}

.scroll-reveal.revealed {
  opacity: 1;
  transform: translateY(0);
}

/* ========== Screen Reader Only ========== */
.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;
}

/* ========== Softer scroll-reveal on mobile ========== */
@media (max-width: 768px) {
  @keyframes fade-up {
    from {
      opacity: 0;
      transform: translateY(10px);
    }
    to {
      opacity: 1;
      transform: translateY(0);
    }
  }
  .scroll-reveal {
    transform: translateY(10px);
  }
}

/* ========== Reduced Motion ========== */
@media (prefers-reduced-motion: reduce) {
  .scroll-reveal {
    opacity: 1;
    transform: none;
    transition: none;
  }
  *,
  *::before,
  *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}
