/* ==========================================================================
   SCHWAB Cargo Logistik — Base Styles
   ========================================================================== */

/* === Document Defaults === */
html {
  scroll-behavior: smooth;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-normal);
  color: var(--color-text);
  background-color: var(--color-bg);
  min-block-size: 100vh;
  min-block-size: 100dvh;
  overflow-x: hidden;
}

/* === Grain Overlay (Mandatory — Industrial Texture) === */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  z-index: var(--z-grain);
  pointer-events: none;
  opacity: 0.035;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 256 256' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='noise'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23noise)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 256px 256px;
}

/* === Skip Link (Accessibility) === */
.skip-link {
  position: absolute;
  inset-block-start: -100%;
  inset-inline-start: var(--space-md);
  padding: var(--space-sm) var(--space-md);
  background: var(--color-accent);
  color: #fff;
  font-weight: 700;
  font-size: var(--fs-sm);
  border-radius: var(--radius);
  z-index: var(--z-toast);
  transition: inset-block-start var(--transition-fast);
}

.skip-link:focus {
  inset-block-start: var(--space-sm);
}

/* === Focus Styles (WCAG 2.1 AA) === */
:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

:focus:not(:focus-visible) {
  outline: none;
}

/* === Selection === */
::selection {
  background: var(--color-accent);
  color: #fff;
}

/* === Scrollbar (Dark Theme) === */
::-webkit-scrollbar {
  inline-size: 8px;
}

::-webkit-scrollbar-track {
  background: var(--color-scrollbar-track);
}

::-webkit-scrollbar-thumb {
  background: var(--color-accent-dark);
  border-radius: var(--radius-full);
}

::-webkit-scrollbar-thumb:hover {
  background: var(--color-accent);
}

/* Firefox scrollbar */
* {
  scrollbar-width: thin;
  scrollbar-color: var(--color-accent-dark) var(--color-scrollbar-track);
}

/* === Headings === */
h1,
h2,
h3,
h4,
h5,
h6 {
  font-family: var(--font-display);
  line-height: var(--lh-tight);
  font-weight: 700;
  color: var(--color-text);
  text-wrap: balance;
}

h1 { font-size: var(--fs-h1); }
h2 { font-size: var(--fs-h2); }
h3 { font-size: var(--fs-h3); }
h4 { font-size: var(--fs-h4); }

/* === Paragraph === */
p {
  max-inline-size: 70ch;
  text-wrap: pretty;
}

/* === Links === */
a {
  color: var(--color-accent-light);
  text-decoration: none;
  transition: color var(--transition-fast);
}

a:hover {
  color: var(--color-accent);
}

/* === Strong / Bold === */
strong,
b {
  font-weight: 700;
}

/* === Code === */
code,
pre {
  font-family: var(--font-mono);
  font-size: var(--fs-sm);
}

/* === Screen Reader Only === */
.sr-only {
  position: absolute;
  inline-size: 1px;
  block-size: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

/* === 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;
  }
}
