/* ==========================================================================
   Global Styles - Skeleton Crew
   Base typography, links, buttons, layout utilities, and skeleton loaders.
   ========================================================================== */

/* --- Body --- */
body {
  background-color: var(--color-bg);
  color: var(--color-text);
  font-family: var(--font-body);
  font-size: var(--font-size-base);
  line-height: 1.6;
  overflow-x: hidden;
}

/* --- Noise texture overlay ---
   Barely perceptible grain that adds tactile depth to the dark background. */
body::after {
  content: '';
  position: fixed;
  inset: 0;
  z-index: 998;
  pointer-events: none;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg viewBox='0 0 200 200' xmlns='http://www.w3.org/2000/svg'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.65' numOctaves='3' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  background-repeat: repeat;
  background-size: 200px 200px;
}

/* --- Headings --- */
h1 {
  font-family: var(--font-display);
  font-size: var(--font-size-hero);
  color: var(--color-text);
  text-transform: uppercase;
  text-wrap: balance;
}

h2 {
  font-family: var(--font-heading);
  font-size: var(--font-size-2xl);
  text-transform: uppercase;
  letter-spacing: 0.15em;
}

h3 {
  font-family: var(--font-heading);
  font-size: var(--font-size-xl);
  text-transform: uppercase;
}

@media (min-width: 600px) {
  h2 {
    font-size: var(--font-size-3xl);
  }

  h3 {
    font-size: var(--font-size-2xl);
  }
}

h4 {
  font-family: var(--font-heading);
  font-size: var(--font-size-xl);
  text-transform: uppercase;
}

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

a:hover { text-decoration: underline; }

a:focus-visible {
  outline: 2px solid var(--color-accent);
  outline-offset: 3px;
}

/* --- Buttons --- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0.75rem 1.5rem;
  font-family: var(--font-heading);
  font-size: var(--font-size-lg);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  border: none;
  border-radius: var(--border-radius);
  cursor: pointer;
  text-decoration: none;
  min-height: 44px;
  transition: background-color var(--transition-fast),
    color var(--transition-fast), border-color var(--transition-fast);
}

.btn--primary {
  background-color: var(--color-accent);
  color: var(--color-bg);
}

.btn--primary:hover { background-color: var(--color-accent-hover); }

.btn--ghost {
  background-color: transparent;
  border: 1px solid var(--color-accent);
  color: var(--color-accent);
}

.btn--ghost:hover {
  background-color: var(--color-accent);
  color: var(--color-bg);
}

.btn:hover {
  text-decoration: none;
}

/* --- Layout utilities --- */
.section { padding: var(--space-section) 0; }

.container {
  max-width: var(--max-width);
  margin: 0 auto;
  padding-inline: var(--space-md);
}

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

/* --- Skip-to-content link --- */
.skip-link {
  position: absolute;
  top: -100%;
  left: var(--space-md);
  z-index: 9999;
  padding: 0.5rem 1rem;
  background-color: var(--color-accent);
  color: var(--color-bg);
  font-family: var(--font-heading);
  text-decoration: none;
  border-radius: var(--border-radius);
}

.skip-link:focus { top: var(--space-sm); }

/* --- Skeleton loaders --- */
.skeleton__image {
  display: block;
  background-color: var(--color-surface);
  height: 200px;
  border-radius: var(--border-radius);
}

.skeleton__line {
  display: block;
  background-color: var(--color-surface);
  border-radius: var(--border-radius);
}

.skeleton__line--title { height: 1.5rem; width: 60%; margin-top: 1rem; }
.skeleton__line--text { height: 1rem; width: 90%; margin-top: 0.5rem; }

@keyframes skeleton-pulse {
  0%, 100% { opacity: 0.4; }
  50% { opacity: 0.8; }
}

.skeleton .skeleton__image,
.skeleton .skeleton__line {
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

@media (prefers-reduced-motion: reduce) {
  .skeleton .skeleton__image,
  .skeleton .skeleton__line {
    animation: none;
    opacity: 0.6;
  }
}

/* --- Angled section dividers ---
   Diagonal transitions between sections instead of flat edges.
   Gives the layout a physical, cut-and-paste energy. */
.section--angled {
  position: relative;
  padding-bottom: calc(var(--space-section) + 2rem);
}

.section--angled::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 60px;
  background-color: var(--color-bg);
  clip-path: polygon(0 40%, 100% 0, 100% 100%, 0 100%);
  z-index: 1;
}

/* --- Section heading with accent line ---
   Short horizontal bar before section headings. */
.section__heading {
  display: flex;
  align-items: center;
  gap: var(--space-md);
}

.section__heading::before {
  content: '';
  display: block;
  width: 24px;
  height: 3px;
  background-color: var(--color-accent);
  flex-shrink: 0;
}

