/* ============================================================
   Sameday Logistics Health — style.css
   Live Web Studios | livewebstudios.com
   ============================================================ */

/* ----- 1. Design tokens ------------------------------------- */
:root {
  /* Surfaces */
  --color-bg:              #faf9f8;
  --color-surface:         #ffffff;
  --color-surface-low:     #f4f3f2;
  --color-surface-mid:     #eeeeed;
  --color-surface-high:    #e3e2e1;

  /* Text */
  --color-text:            #1a1c1c;
  --color-text-muted:      #5c403c;
  --color-text-inverse:    #ffffff;

  /* Brand */
  --color-red:             #cc1f1f;
  --color-red-dark:        #a5000d;
  --color-teal:            #00677d;
  --color-teal-light:      #50d9fe;
  --color-teal-hover:      #005c70;

  /* Borders */
  --color-border:          #e5bdb8;
  --color-border-neutral:  #e3e2e1;

  /* Inverse */
  --color-inverse-bg:      #2f3130;
  --color-inverse-text:    #f1f0f0;

  /* Type */
  --font-heading: 'Barlow Condensed', sans-serif;
  --font-body:    'Inter', sans-serif;

  /* Spacing */
  --space-unit:       8px;
  --container-max:    1280px;
  --gutter:           24px;
  --margin-mobile:    16px;
  --section-padding:  80px;

  /* Shadows */
  --shadow-soft: 0 20px 40px rgba(0, 0, 0, 0.06);
  --shadow-card: 0 1px 2px rgba(0, 0, 0, 0.04);

  /* Radius */
  --radius-sm: 4px;
  --radius-md: 6px;
  --radius-lg: 8px;
  --radius-pill: 9999px;

  /* Motion */
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --dur-fast: 180ms;
  --dur-base: 280ms;
  --dur-slow: 500ms;
}

/* ----- 2. Reset & base -------------------------------------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: 1rem;
  line-height: 1.6;
  color: var(--color-text);
  background-color: var(--color-bg);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

a {
  color: var(--color-teal);
  text-decoration: none;
  transition: color var(--dur-fast) var(--ease-out);
}

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

a:focus-visible,
button:focus-visible,
input:focus-visible,
select:focus-visible,
textarea:focus-visible {
  outline: 2px solid var(--color-teal);
  outline-offset: 3px;
}

button { font-family: inherit; cursor: pointer; }

ul, ol { padding-left: 1.25rem; }

/* ----- 3. Typography ---------------------------------------- */
h1, h2, h3, h4, h5, h6 {
  font-family: var(--font-heading);
  font-weight: 700;
  line-height: 1.15;
  margin: 0 0 0.5em;
  color: var(--color-text);
  letter-spacing: -0.01em;
}

h1 {
  font-size: clamp(2.2rem, 5vw, 3rem);
  font-weight: 700;
  line-height: 1.1;
  letter-spacing: -0.02em;
}

h2 {
  font-size: clamp(1.6rem, 3.5vw, 2.25rem);
  font-weight: 600;
  line-height: 1.2;
}

h3 {
  font-size: 1.5rem;
  font-weight: 600;
}

h4 { font-size: 1.25rem; font-weight: 600; }

p { margin: 0 0 1em; }

.lead {
  font-size: 1.125rem;
  line-height: 1.6;
  color: var(--color-text);
}

.label-caps {
  display: inline-block;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--color-red);
  margin-bottom: 0.75rem;
}

.label-caps--teal { color: var(--color-teal); }

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

@media (min-width: 768px) {
  .container { padding-inline: var(--gutter); }
}

.section {
  padding-block: 48px;
}

@media (min-width: 768px) {
  .section { padding-block: var(--section-padding); }
}

.section--low { background: var(--color-surface-low); }
.section--surface { background: var(--color-surface); }

/* Subtle dot-grid background — light bg sections (Phase 2) */
.section--textured {
  background-color: var(--color-bg);
  background-image: radial-gradient(circle, rgba(0, 103, 125, 0.07) 1px, transparent 1px);
  background-size: 24px 24px;
}

/* Clean white variant — very subtle warm tone (Phase 2) */
.section--white {
  background-color: #ffffff;
  background-image: radial-gradient(circle, rgba(204, 31, 31, 0.04) 1px, transparent 1px);
  background-size: 20px 20px;
}

.section--inverse {
  background: var(--color-inverse-bg);
  color: var(--color-inverse-text);
}
.section--inverse h1,
.section--inverse h2,
.section--inverse h3 { color: var(--color-inverse-text); }

.section__head {
  text-align: center;
  margin-bottom: 48px;
  max-width: 720px;
  margin-inline: auto;
}

.section__head--left {
  text-align: left;
  margin-inline: 0;
}

.section__head p {
  color: var(--color-text-muted);
  font-size: 1.0625rem;
}

/* ----- 5. Grids --------------------------------------------- */
.grid {
  display: grid;
  gap: var(--gutter);
}

.grid--2 { grid-template-columns: 1fr; }
.grid--3 { grid-template-columns: 1fr; }
.grid--4 { grid-template-columns: 1fr; }

@media (min-width: 768px) {
  .grid--2 { grid-template-columns: repeat(2, 1fr); }
  .grid--3 { grid-template-columns: repeat(2, 1fr); }
  .grid--4 { grid-template-columns: repeat(2, 1fr); }
}

@media (min-width: 1024px) {
  .grid--3 { grid-template-columns: repeat(3, 1fr); }
  .grid--4 { grid-template-columns: repeat(4, 1fr); }
}

/* ----- 6. Hero ---------------------------------------------- */
.hero {
  position: relative;
  min-height: 78vh;
  display: flex;
  align-items: center;
  overflow: hidden;
  isolation: isolate;
  color: var(--color-text-inverse);
  background-color: #1a1c1c;
  background-image: url("../images/misc/hero-fallback.jpg");
  background-size: cover;
  background-position: center;
}

.hero__video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  z-index: -2;
  opacity: 1;
  transition: opacity 1.2s var(--ease-out);
}

.hero__video.is-faded { opacity: 0; }

.hero__overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    rgba(26, 28, 28, 0.5) 0%,
    rgba(26, 28, 28, 0.65) 100%
  );
  z-index: -1;
}

.hero__content {
  position: relative;
  padding-block: 96px;
  max-width: 760px;
}

.hero h1 {
  color: var(--color-text-inverse);
  margin-bottom: 1rem;
}

.hero p {
  font-size: 1.125rem;
  color: var(--color-inverse-text);
  margin-bottom: 2rem;
  max-width: 600px;
}

.hero__ctas {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

/* Inner page hero (no video) */
.page-hero {
  background: var(--color-surface-low);
  background-image:
    radial-gradient(circle at 85% 50%, rgba(0, 103, 125, 0.08), transparent 55%),
    radial-gradient(circle at 5% 100%, rgba(204, 31, 31, 0.05), transparent 50%),
    radial-gradient(circle, rgba(0, 103, 125, 0.04) 1px, transparent 1px);
  background-size: auto, auto, 24px 24px;
  padding-block: 96px 80px;
  border-bottom: 1px solid var(--color-border-neutral);
  position: relative;
  overflow: hidden;
}

@media (min-width: 768px) {
  .page-hero { padding-block: 120px 96px; }
}

/* Decorative angled red bar — adds rhythm without clutter */
.page-hero::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: 4px;
  height: 100%;
  background: linear-gradient(
    180deg,
    var(--color-red) 0%,
    var(--color-red) 30%,
    var(--color-teal) 30%,
    var(--color-teal) 60%,
    transparent 60%
  );
  opacity: 0.7;
}

.page-hero::after {
  content: "";
  position: absolute;
  right: -180px;
  top: 50%;
  transform: translateY(-50%);
  width: 480px;
  height: 480px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(0, 103, 125, 0.10), transparent 70%);
  pointer-events: none;
}

.page-hero h1 { margin-bottom: 0.75rem; }
.page-hero p {
  font-size: 1.125rem;
  color: var(--color-text-muted);
  max-width: 720px;
  margin-bottom: 0;
}

.page-hero__badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-family: var(--font-body);
  font-size: 0.75rem;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: 0.08em;
  color: var(--color-teal);
  background: rgba(0, 103, 125, 0.1);
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  margin-top: 1rem;
}

/* ----- 7. CTA banner --------------------------------------- */
.cta-banner {
  background: var(--color-red);
  color: var(--color-text-inverse);
  text-align: center;
  padding-block: 64px;
}

.cta-banner h2 {
  color: var(--color-text-inverse);
  font-size: clamp(1.75rem, 4vw, 2.25rem);
  margin-bottom: 0.5rem;
}

.cta-banner p {
  color: rgba(255, 255, 255, 0.9);
  font-size: 1.0625rem;
  max-width: 620px;
  margin-inline: auto;
  margin-bottom: 1.5rem;
}

.cta-banner .btn--primary {
  background: var(--color-text-inverse);
  color: var(--color-red);
}

.cta-banner .btn--primary:hover {
  background: var(--color-bg);
  color: var(--color-red-dark);
}

/* ----- 8. Animations --------------------------------------- */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition:
    opacity var(--dur-slow) var(--ease-out),
    transform var(--dur-slow) var(--ease-out);
}

.reveal.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.reveal--delay-1 { transition-delay: 80ms; }
.reveal--delay-2 { transition-delay: 160ms; }
.reveal--delay-3 { transition-delay: 240ms; }
.reveal--delay-4 { transition-delay: 320ms; }

/* Hero content stagger — children animate in sequence after parent fades */
.hero__content.reveal > * {
  opacity: 0;
  transform: translateY(12px);
  transition:
    opacity 0.7s var(--ease-out),
    transform 0.7s var(--ease-out);
}

.hero__content.reveal.is-visible > *:nth-child(1) { transition-delay: 100ms; }
.hero__content.reveal.is-visible > *:nth-child(2) { transition-delay: 200ms; }
.hero__content.reveal.is-visible > *:nth-child(3) { transition-delay: 300ms; }
.hero__content.reveal.is-visible > *:nth-child(4) { transition-delay: 420ms; }

.hero__content.reveal.is-visible > * {
  opacity: 1;
  transform: translateY(0);
}

/* Override the parent's own reveal so its own translate doesn't compound */
.hero__content.reveal {
  opacity: 1 !important;
  transform: none !important;
}

@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;
  }
  .reveal { opacity: 1; transform: none; }
  .hero__content.reveal > * { opacity: 1; transform: none; }
}

/* ----- 9. Utility ------------------------------------------ */
.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;
}

.text-center { text-align: center; }
.muted { color: var(--color-text-muted); }
.no-margin { margin: 0; }
