/* ==========================================================================
   Salvor Logistics — Base: reset, typography, layout, motion primitives (dark)
   ========================================================================== */

*, *::before, *::after { box-sizing: border-box; }
* { margin: 0; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: calc(var(--header-h) + 20px);
}
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

body {
  font-family: var(--font-body);
  font-size: var(--fs-body);
  line-height: var(--lh-body);
  color: var(--text);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  text-rendering: optimizeLegibility;
  overflow-x: hidden;
}

img, picture, svg, video { display: block; max-width: 100%; }
img { height: auto; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }

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

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

/* --- Headings --- */
h1, h2, h3, h4 {
  font-family: var(--font-display);
  font-weight: 700;
  line-height: var(--lh-snug);
  letter-spacing: -0.02em;
  color: var(--text-strong);
}
h1 { line-height: var(--lh-tight); }
p { text-wrap: pretty; }
h1, h2, h3 { text-wrap: balance; }
strong { font-weight: 600; color: var(--text-strong); }

/* --- Layout --- */
.container {
  width: 100%;
  max-width: var(--container);
  margin-inline: auto;
  padding-inline: var(--gutter);
}
.container--narrow { max-width: var(--container-narrow); }

.section { padding-block: var(--section-y); position: relative; }
.section--tight { padding-block: clamp(52px, 6vw, 92px); }
.section--alt,
.section--paper2,
.section--surface { background: var(--bg-2); }
.section--dark { background: var(--bg); }
.section--deep { background: #0a0d10; }

/* divider hairline at section tops where needed */
.section--hr { border-top: 1px solid var(--line); }

/* --- Section headers --- */
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.7em;
  font-family: var(--font-display);
  font-size: var(--fs-eyebrow);
  font-weight: 600;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.eyebrow::before { content: ""; width: 30px; height: 1px; background: var(--accent-line); }
.section-head { max-width: 820px; margin-bottom: clamp(40px, 5vw, 68px); }
.section-head--center { margin-inline: auto; text-align: center; }
.section-head--center .eyebrow { justify-content: center; }
.section-head h2 { margin-top: 20px; font-size: var(--fs-h2); }
.section-head .lead { margin-top: 18px; }

.lead { font-size: var(--fs-lead); line-height: 1.55; color: var(--text-muted); }
.muted { color: var(--text-muted); }

/* --- Grid helpers --- */
.grid { display: grid; gap: clamp(16px, 1.8vw, 26px); }
.grid--2 { grid-template-columns: repeat(2, 1fr); }
.grid--3 { grid-template-columns: repeat(3, 1fr); }
.grid--4 { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 980px) { .grid--3, .grid--4 { grid-template-columns: repeat(2, 1fr); } }
@media (max-width: 620px) { .grid--2, .grid--3, .grid--4 { grid-template-columns: 1fr; } }

/* --- Icons --- */
.icon { width: 1.2em; height: 1.2em; flex: none; }
.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;
}

/* ==========================================================================
   Motion primitives
   ========================================================================== */

/* fade / slide reveal */
.reveal {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out);
  will-change: opacity, transform;
}
.reveal.is-in { opacity: 1; transform: none; }

/* staggered children: add .stagger to a parent, children animate in sequence */
.stagger > * {
  opacity: 0;
  transform: translateY(24px);
  transition: opacity var(--t-slow) var(--ease-out), transform var(--t-slow) var(--ease-out);
}
.stagger.is-in > * { opacity: 1; transform: none; }
.stagger.is-in > *:nth-child(1) { transition-delay: 60ms; }
.stagger.is-in > *:nth-child(2) { transition-delay: 130ms; }
.stagger.is-in > *:nth-child(3) { transition-delay: 200ms; }
.stagger.is-in > *:nth-child(4) { transition-delay: 270ms; }
.stagger.is-in > *:nth-child(5) { transition-delay: 340ms; }
.stagger.is-in > *:nth-child(6) { transition-delay: 410ms; }

/* delay utility for individual reveals */
.reveal[data-delay="1"] { transition-delay: 90ms; }
.reveal[data-delay="2"] { transition-delay: 180ms; }
.reveal[data-delay="3"] { transition-delay: 270ms; }
.reveal[data-delay="4"] { transition-delay: 360ms; }
.reveal[data-delay="5"] { transition-delay: 450ms; }

/* image clip reveal: image scales back as it enters */
.img-reveal { overflow: hidden; }
.img-reveal img {
  transform: scale(1.18);
  transition: transform 1100ms var(--ease-out);
  will-change: transform;
}
.img-reveal.is-in img { transform: scale(1); }

@media (prefers-reduced-motion: reduce) {
  .reveal, .stagger > * { opacity: 1 !important; transform: none !important; transition: none !important; }
  .img-reveal img { transform: none !important; transition: none !important; }
}
