/* ==========================================================================
   River Trails Transport — v2 (full redesign)
   - Single modern variable typeface (Geist)
   - Editorial layout, larger type, fewer cards, more rhythm
   - CSS scroll-driven motion (image zoom, fade-up, drawn-in heading rule)
   - No JavaScript dependencies for visual effects
   ========================================================================== */

/* ===== TOKENS ===== */
:root {
  /* Surfaces */
  --bg-deep:   #0A1628;   /* deepest navy — hero, footer */
  --bg-mid:    #122340;   /* alternate dark sections */
  --bg-rule:   #1F3050;   /* dark section dividers */
  --paper:     #FFFFFF;
  --cream:     #F4F0E7;   /* warm light alt sections */

  /* Ink */
  --ink:       #0A1628;
  --ink-soft:  #4F5D75;
  --ink-muted: #889AB6;

  /* On-dark text */
  --on-dark:        #F4F0E7;
  --on-dark-soft:   #B6C2D6;
  --on-dark-muted:  #6B7A95;

  /* Accents — staying blue */
  --accent:        #2C6BB0;
  --accent-strong: #1E548A;
  --accent-soft:   #4A8DD8;

  /* Lines */
  --line:        #E5E0D5;
  --line-strong: #C8C2B5;
  --line-dark:   rgba(255,255,255,.10);

  /* Layout */
  --maxw: 1280px;
  --gutter: clamp(20px, 4vw, 32px);
  --section-pad: clamp(72px, 10vw, 144px);
  --radius: 6px;
  --radius-lg: 14px;

  /* Shadows */
  --shadow-sm: 0 1px 2px rgba(10,22,40,.08);
  --shadow-md: 0 12px 40px rgba(10,22,40,.18);
  --shadow-lg: 0 28px 70px rgba(10,22,40,.30);
}

/* ===== RESET ===== */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: "Geist", "Inter Tight", -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
  font-size: 17px;
  line-height: 1.55;
  color: var(--ink);
  background: var(--paper);
  font-feature-settings: "ss01", "cv11";
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}
img, svg { max-width: 100%; height: auto; display: block; }
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }

/* ===== TYPE ===== */
h1, h2, h3, h4 {
  font-family: inherit;
  margin: 0 0 0.5em;
  letter-spacing: -0.02em;
  color: var(--ink);
  font-weight: 700;
  text-wrap: balance;
}
h1 { font-size: clamp(2.4rem, 5.5vw, 4.6rem); line-height: 1.05; letter-spacing: -0.035em; font-weight: 800; }
h2 { font-size: clamp(2rem, 4vw, 3.2rem);   line-height: 1.1;  letter-spacing: -0.03em; }
h3 { font-size: clamp(1.25rem, 2vw, 1.5rem); line-height: 1.25; letter-spacing: -0.02em; }
p  { margin: 0 0 1em; }
.lede { font-size: clamp(1.05rem, 1.6vw, 1.3rem); line-height: 1.55; color: var(--ink-soft); max-width: 60ch; }

.eyebrow {
  display: inline-block;
  font-size: 12px;
  font-weight: 600;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.dark .eyebrow, .hero .eyebrow { color: var(--accent-soft); }

/* ===== LAYOUT ===== */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--gutter);
}
.section { padding-block: var(--section-pad); }
.section.alt  { background: var(--cream); }
.section.dark { background: var(--bg-deep); color: var(--on-dark); }
.section.dark h1, .section.dark h2, .section.dark h3 { color: var(--on-dark); }

/* ===== BUTTONS ===== */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 14px 24px;
  border-radius: 999px;
  border: 1.5px solid transparent;
  font-weight: 600;
  font-size: 15px;
  letter-spacing: -0.005em;
  transition: transform .2s ease, background .2s ease, border-color .2s ease, color .2s ease;
  cursor: pointer;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary  { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-primary:hover  { background: var(--accent-strong); border-color: var(--accent-strong); }
.btn-light    { background: var(--paper); color: var(--ink); border-color: var(--paper); }
.btn-light:hover    { background: transparent; color: var(--paper); }
.btn-ghost    { background: transparent; color: var(--ink); border-color: var(--ink); }
.btn-ghost:hover    { background: var(--ink); color: var(--paper); }
.dark .btn-ghost,
.hero .btn-ghost    { color: var(--on-dark); border-color: var(--on-dark); }
.dark .btn-ghost:hover,
.hero .btn-ghost:hover { background: var(--on-dark); color: var(--ink); }

.arrow-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--accent);
  font-weight: 600;
  border-bottom: 1.5px solid currentColor;
  padding-bottom: 2px;
  transition: gap .2s ease;
}
.arrow-link:hover { gap: 12px; }

/* ===== TOPBAR ===== */
.topbar {
  background: var(--bg-deep);
  color: var(--on-dark-soft);
  font-size: 14px;
  padding: 8px 0;
}
.topbar .container {
  display: flex;
  justify-content: flex-end;
  gap: 22px;
  flex-wrap: wrap;
}
.topbar a { color: var(--on-dark); transition: color .15s ease; }
.topbar a:hover { color: var(--accent-soft); }
.topbar .sep { color: var(--on-dark-muted); }

/* ===== HEADER ===== */
.site-header {
  background: var(--bg-deep);
  color: var(--on-dark);
  position: sticky;
  top: 0;
  z-index: 9999; /* defensive — must sit above any transform-induced stacking contexts in body */
  border-bottom: 1px solid var(--line-dark);
  transition: padding .25s ease, box-shadow .25s ease, background .25s ease;
  isolation: isolate; /* gives the header its own stacking context for its descendants */
}
.nav-wrap {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px 0;
  gap: 24px;
  transition: padding .25s ease;
}
.brand { display: flex; align-items: center; gap: 14px; color: var(--on-dark); }
.brand img { height: 52px; width: auto; transition: height .25s ease; }
.brand-text { display: flex; flex-direction: column; line-height: 1.05; }
.brand-text .name {
  font-weight: 800;
  font-size: 1.2rem;
  letter-spacing: -0.02em;
  color: var(--on-dark);
}
.brand-text .tag {
  font-size: 11px;
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--accent-soft);
  margin-top: 2px;
}

.nav { display: flex; align-items: center; gap: 4px; }
.nav a {
  color: var(--on-dark-soft);
  font-weight: 500;
  font-size: 15px;
  padding: 10px 14px;
  border-radius: 8px;
  position: relative;
  transition: color .2s ease;
}
.nav a::after {
  content: '';
  position: absolute;
  left: 14px; right: 14px; bottom: 4px;
  height: 2px;
  background: var(--accent-soft);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .25s cubic-bezier(.2,.7,.2,1);
}
.nav a:hover { color: var(--on-dark); }
.nav a:hover::after { transform: scaleX(1); }
.nav a.active { color: var(--on-dark); }
.nav a.active::after { transform: scaleX(1); }
.nav a.cta {
  background: var(--accent);
  color: var(--paper);
  margin-left: 8px;
  padding: 10px 18px;
  border-radius: 999px;
  font-weight: 600;
}
.nav a.cta::after { display: none; }
.nav a.cta:hover { background: var(--accent-strong); color: var(--paper); }

.nav-toggle {
  display: none;
  background: transparent;
  border: 1px solid var(--on-dark-muted);
  color: var(--on-dark);
  padding: 8px 12px;
  border-radius: var(--radius);
  font-size: 18px;
  cursor: pointer;
  position: relative;       /* keep — defensive for stacking */
  z-index: 101;             /* keep — defensive for stacking */
  /* Restored Android default tap feedback (removed earlier override).
     Plus explicit :active and :hover states for clear visual press. */
}
.nav-toggle:hover,
.nav-toggle:active,
.nav-toggle:focus {
  background: rgba(255, 255, 255, 0.12);
  outline: none;
}

@media (max-width: 920px) {
  .nav-toggle { display: inline-block; }
  .nav {
    display: none;
    position: absolute;
    top: 100%; left: 0; right: 0;
    flex-direction: column;
    background: var(--bg-mid);
    padding: 14px 24px 22px;
    border-top: 1px solid var(--line-dark);
  }
  .nav.open { display: flex; z-index: 99; }
  .nav a { padding: 14px 8px; border-bottom: 1px solid var(--line-dark); width: 100%; }
  .nav a::after { display: none; }
  .nav a.cta { margin: 10px 0 0; text-align: center; }
}

/* Compact-on-scroll */
body.scrolled .site-header { box-shadow: 0 4px 24px rgba(10,22,40,.45); }
body.scrolled .nav-wrap { padding: 10px 0; }
body.scrolled .brand img { height: 40px; }

/* ===== HERO ===== */
.hero {
  position: relative;
  min-height: 88vh;
  background:
    linear-gradient(180deg, rgba(10,22,40,.35) 0%, rgba(10,22,40,.25) 40%, rgba(10,22,40,.85) 100%),
    url("../images/hero-rgn-combine-night.jpg") center/cover no-repeat;
  color: var(--on-dark);
  display: flex;
  align-items: flex-end;
  padding-block: clamp(60px, 14vw, 140px);
  border-bottom: 1px solid var(--line-dark);
}
.hero h1 { color: var(--on-dark); max-width: 18ch; }
.hero .lede { color: var(--on-dark-soft); margin-top: 12px; max-width: 55ch; }
.hero .eyebrow { color: var(--accent-soft); }
.hero .actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 28px; }
.hero .scroll-indicator {
  position: absolute;
  bottom: 24px; left: 50%; transform: translateX(-50%);
  font-size: 11px;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: var(--on-dark-muted);
}
.hero .scroll-indicator::after {
  content: '↓';
  display: block;
  margin-top: 6px;
  font-size: 18px;
  animation: bounce 2.4s ease-in-out infinite;
}
@keyframes bounce {
  0%, 100% { transform: translateY(0); opacity: 0.5; }
  50%      { transform: translateY(6px); opacity: 1; }
}
.hero.hero-sm { min-height: 56vh; align-items: flex-end; }
.hero.hero-sm h1 { font-size: clamp(2rem, 4vw, 3.2rem); }

/* ===== TAGLINE STRIP (echoes the print ad) ===== */
.tagline-strip {
  background: var(--bg-mid);
  color: var(--on-dark);
  padding: 22px 0;
  border-block: 1px solid var(--line-dark);
}
.tagline-strip .row {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: clamp(20px, 4vw, 56px);
  font-size: clamp(13px, 1.4vw, 15px);
  font-weight: 500;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}
.tagline-strip span { display: inline-flex; align-items: center; gap: 14px; color: var(--on-dark-soft); }
.tagline-strip span:not(:last-child)::after {
  content: '';
  width: 5px; height: 5px;
  background: var(--accent-soft);
  border-radius: 50%;
  display: inline-block;
}

/* ===== EDITORIAL TWO-COLUMN ===== */
.editorial {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(32px, 5vw, 80px);
  align-items: center;
}
.editorial.reverse > :first-child { order: 2; }
@media (max-width: 800px) { .editorial { grid-template-columns: 1fr; } .editorial.reverse > :first-child { order: 0; } }

.editorial .photo {
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  aspect-ratio: 4 / 3;
}
.editorial .photo img { width: 100%; height: 100%; object-fit: cover; }

/* ===== NUMBERED EQUIPMENT ROWS ===== */
.equipment-row {
  display: grid;
  grid-template-columns: 1fr 1.2fr;
  gap: clamp(40px, 6vw, 96px);
  align-items: center;
  padding-block: clamp(56px, 8vw, 100px);
  border-top: 1px solid var(--line);
}
.section.dark .equipment-row { border-top-color: var(--line-dark); }
.equipment-row.reverse { grid-template-columns: 1.2fr 1fr; }
.equipment-row.reverse > :first-child { order: 2; }
@media (max-width: 860px) {
  .equipment-row, .equipment-row.reverse { grid-template-columns: 1fr; }
  .equipment-row.reverse > :first-child { order: 0; }
}

.equipment-row .num {
  font-size: clamp(2.8rem, 6vw, 4.5rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
  display: block;
  margin-bottom: 16px;
}
.section.dark .equipment-row .num { color: var(--accent-soft); }
.equipment-row h2 { margin-top: 0; }
.equipment-row .photo {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  box-shadow: var(--shadow-md);
  background: var(--bg-deep);
}
.equipment-row .photo img { width: 100%; height: 100%; object-fit: cover; }
.equipment-row .meta {
  margin-top: 20px;
  font-size: 14px;
  color: var(--ink-soft);
}
.section.dark .equipment-row .meta { color: var(--on-dark-soft); }

/* ===== GALLERY (less boxy) ===== */
.gallery {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 14px;
}
.gallery .item {
  position: relative;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}
.gallery .item img { width: 100%; height: 100%; object-fit: cover; }
.gallery .caption {
  position: absolute;
  inset: auto 0 0 0;
  padding: 14px 18px 16px;
  background: linear-gradient(transparent, rgba(10,22,40,.85));
  color: var(--on-dark);
  font-size: 13px;
  font-weight: 500;
  letter-spacing: 0.04em;
}

/* ===== CTA BANNER ===== */
.cta-banner {
  position: relative;
  overflow: hidden;
  isolation: isolate;
  padding-block: clamp(72px, 10vw, 120px);
  background: radial-gradient(circle at 50% 50%, #1f3866 0%, #15264a 50%, #0d1b34 100%);
  color: var(--on-dark);
  text-align: center;
}
/* Live background — dispatch network: faint dot grid + pulsing nodes */
.cta-banner .grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-image: radial-gradient(circle, rgba(74,141,216,0.22) 1.2px, transparent 1.5px);
  background-size: 36px 36px;
  -webkit-mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
          mask-image: radial-gradient(ellipse at center, black 30%, transparent 80%);
}
.cta-banner .nodes {
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
}
.cta-banner .node {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--accent-soft);
  box-shadow: 0 0 8px rgba(74,141,216,0.8);
}
.cta-banner .node::before,
.cta-banner .node::after {
  content: '';
  position: absolute;
  inset: -3px;
  border-radius: 50%;
  border: 1.5px solid var(--accent-soft);
  animation: rtt-pulse 4s ease-out infinite;
}
.cta-banner .node::after { animation-delay: 2s; }
.cta-banner .node:nth-child(1) { top: 18%; left: 22%; }
.cta-banner .node:nth-child(2) { top: 32%; left: 78%; }
.cta-banner .node:nth-child(3) { top: 65%; left: 12%; }
.cta-banner .node:nth-child(4) { top: 75%; left: 65%; }
.cta-banner .node:nth-child(5) { top: 25%; left: 50%; }
.cta-banner .node:nth-child(6) { top: 58%; left: 88%; }
.cta-banner .node:nth-child(7) { top: 82%; left: 38%; }
.cta-banner .node:nth-child(2)::before { animation-delay: 1.2s; }
.cta-banner .node:nth-child(3)::before { animation-delay: 0.6s; }
.cta-banner .node:nth-child(4)::before { animation-delay: 2.1s; }
.cta-banner .node:nth-child(5)::before { animation-delay: 3.0s; }
.cta-banner .node:nth-child(6)::before { animation-delay: 1.8s; }
.cta-banner .node:nth-child(7)::before { animation-delay: 0.3s; }
@keyframes rtt-pulse {
  0%   { transform: scale(1); opacity: 0.9; }
  100% { transform: scale(7); opacity: 0;   }
}
.cta-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, transparent 30%, rgba(10,22,40,0.5) 80%);
  z-index: 2;
  pointer-events: none;
}
.cta-banner > .container { position: relative; z-index: 3; }

@media (prefers-reduced-motion: reduce) {
  .cta-banner .node::before,
  .cta-banner .node::after { animation: none; }
}

.cta-banner h2 { color: var(--on-dark); margin-bottom: 8px; max-width: 22ch; margin-inline: auto; }
.cta-banner p { color: var(--on-dark-soft); max-width: 50ch; margin: 0 auto 24px; }
.cta-banner .actions { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; }
.cta-banner .phone {
  display: block;
  margin-top: 18px;
  font-size: clamp(1.5rem, 3vw, 2rem);
  font-weight: 700;
  letter-spacing: -0.02em;
  color: var(--on-dark);
}

/* ===== CONTACT INFO BLOCK ===== */
.info-block {
  background: var(--cream);
  border-radius: var(--radius-lg);
  padding: 32px 30px;
}
.info-block h3 { margin-top: 0; margin-bottom: 20px; }
.info-block dl { margin: 0; }
.info-block dt {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--ink-soft);
  margin-top: 16px;
}
.info-block dd { margin: 4px 0 0; color: var(--ink); }
.info-block a { color: var(--accent); border-bottom: 1.5px solid transparent; transition: border-color .2s ease; }
.info-block a:hover { border-bottom-color: currentColor; }

/* ===== FORM ===== */
.contact-grid { display: grid; grid-template-columns: 1fr 1.4fr; gap: clamp(28px, 4vw, 56px); }
@media (max-width: 800px) { .contact-grid { grid-template-columns: 1fr; } }

.form { background: var(--paper); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 32px; }
.form h3 { margin-top: 0; }
.form .row { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }
@media (max-width: 600px) { .form .row { grid-template-columns: 1fr; } }
.form label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--ink-soft);
  margin: 16px 0 6px;
}
.form input, .form select, .form textarea {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  font: inherit;
  background: var(--paper);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form input:focus, .form select:focus, .form textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px rgba(44,107,176,.18);
}
.form textarea { min-height: 140px; resize: vertical; }
.form .actions { margin-top: 22px; }
.form-note { font-size: 13px; color: var(--ink-muted); margin-top: 12px; }
.hp { position: absolute; left: -9999px; top: -9999px; }

/* ===== MAP ===== */
.map-wrap {
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-sm);
}
.map-wrap iframe { display: block; width: 100%; height: 420px; border: 0; }

/* ===== FOOTER ===== */
.site-footer {
  background: var(--bg-deep);
  color: var(--on-dark-soft);
  padding: 64px 0 24px;
  font-size: 14px;
}
.site-footer .grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 48px;
  margin-bottom: 36px;
}
@media (max-width: 700px) { .site-footer .grid { grid-template-columns: 1fr; } }
.site-footer h4 {
  color: var(--on-dark);
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  margin: 0 0 14px;
}
.site-footer a { color: var(--on-dark-soft); transition: color .15s ease; }
.site-footer a:hover { color: var(--on-dark); }
.site-footer ul { list-style: none; padding: 0; margin: 0; }
.site-footer li { margin-bottom: 6px; }
.site-footer .legal {
  border-top: 1px solid var(--line-dark);
  padding-top: 22px;
  display: flex;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 10px;
  color: var(--on-dark-muted);
  font-size: 13px;
}

/* ===== SECTION HEAD ===== */
.section-head {
  max-width: 720px;
  margin-bottom: clamp(40px, 6vw, 72px);
}
.section-head.center { margin-inline: auto; text-align: center; }
.section-head h2 { margin-bottom: 16px; }
.section-head p { color: var(--ink-soft); font-size: 1.1rem; max-width: 60ch; }
.section.dark .section-head p { color: var(--on-dark-soft); }

/* ===== ANIMATED HEADING UNDERLINE ===== */
.section-head h2::after,
.equipment-row h2::after {
  content: '';
  display: block;
  width: 64px;
  height: 3px;
  background: var(--accent);
  margin-top: 18px;
  border-radius: 2px;
  transform-origin: left;
  transform: scaleX(0);
  transition: transform .9s cubic-bezier(.2,.7,.2,1);
}
.section-head.center h2::after { margin-inline: auto; transform-origin: center; }
.section.dark .section-head h2::after,
.section.dark .equipment-row h2::after { background: var(--accent-soft); }

@supports (animation-timeline: view()) {
  .section-head h2::after,
  .equipment-row h2::after {
    animation: rtt-line-grow linear both;
    animation-timeline: view();
    animation-range: entry 5% cover 30%;
    transition: none;
  }
  @keyframes rtt-line-grow {
    from { transform: scaleX(0); }
    to   { transform: scaleX(1); }
  }
}

/* ===== SECTION FADE-UP ON SCROLL ===== */
@supports (animation-timeline: view()) {
  .section,
  .cta-banner,
  .tagline-strip,
  .equipment-row {
    animation: rtt-fade-up linear both;
    animation-timeline: view();
    animation-range: entry 0% cover 22%;
  }
  @keyframes rtt-fade-up {
    from { opacity: 0; transform: translateY(40px); }
    to   { opacity: 1; transform: translateY(0); }
  }
}

/* ===== IMAGE ZOOM-ON-SCROLL (SuperForm-style) ===== */
.editorial .photo,
.equipment-row .photo,
.gallery .item {
  overflow: hidden;
}
.editorial .photo img,
.equipment-row .photo img,
.gallery .item img {
  transition: transform .9s cubic-bezier(.2,.7,.2,1);
}
@supports (animation-timeline: view()) {
  .editorial .photo img,
  .equipment-row .photo img,
  .gallery .item img {
    animation: rtt-img-zoom linear both;
    animation-timeline: view();
    animation-range: entry 0% exit 100%;
    transition: none;
    will-change: transform;
  }
  @keyframes rtt-img-zoom {
    from { transform: scale(1); }
    to   { transform: scale(1.12); }
  }
}
@media (hover: hover) {
  .gallery .item:hover img,
  .editorial .photo:hover img { transform: scale(1.05); }
}

/* ===== UTIL ===== */
.center { text-align: center; }
.muted { color: var(--ink-muted); }
.section.dark .muted { color: var(--on-dark-muted); }

/* ===== 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;
  }
  .section-head h2::after,
  .equipment-row h2::after { transform: scaleX(1) !important; }
}


/* ==========================================================================
   JS-DRIVEN MOTION (works in every browser)
   ========================================================================== */

/* Photos: fast smooth easing while scroll handler updates transform */
.editorial .photo img,
.equipment-row .photo img,
.gallery .item img,
.photo img {
  transition: transform 80ms linear;
  will-change: transform;
}

/* Section reveal — sections start hidden, JS adds .reveal-in to show */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity .8s cubic-bezier(.2,.7,.2,1),
              transform .8s cubic-bezier(.2,.7,.2,1);
}
.reveal.reveal-in {
  opacity: 1;
  transform: translateY(0);
}

/* Heading rule — JS adds .rule-in to draw it */
.section-head h2.rule::after,
.equipment-row h2.rule::after {
  transform: scaleX(0);
}
.section-head h2.rule-in::after,
.equipment-row h2.rule-in::after {
  transform: scaleX(1);
}

/* Hero — needs background-position transition for parallax */
.hero {
  transition: background-position 30ms linear;
}

/* Reduced motion — JS already opts out, but keep CSS belt-and-suspenders */
@media (prefers-reduced-motion: reduce) {
  .reveal,
  .reveal.reveal-in {
    opacity: 1 !important;
    transform: none !important;
    transition: none !important;
  }
  .editorial .photo img,
  .equipment-row .photo img,
  .gallery .item img,
  .photo img {
    transform: none !important;
  }
  .section-head h2.rule::after,
  .equipment-row h2.rule::after { transform: scaleX(1) !important; }
}

/* ==========================================================================
   HERO PHOTO ROTATOR — crossfade through multiple photos
   ========================================================================== */
.hero.hero-rotator {
  position: relative;
  background: var(--bg-deep);
  overflow: hidden;
}
.hero.hero-rotator .hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
}
.hero.hero-rotator .hero-img {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  opacity: 0;
  transition: opacity 1.5s ease-in-out;
  will-change: opacity;
}
.hero.hero-rotator .hero-img.active { opacity: 1; }
.hero.hero-rotator .hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg,
    rgba(10,22,40,.40) 0%,
    rgba(10,22,40,.28) 40%,
    rgba(10,22,40,.85) 100%);
  z-index: 1;
}
.hero.hero-rotator .container { position: relative; z-index: 2; }
.hero.hero-rotator .scroll-indicator { z-index: 2; }

/* Override the static .hero background so only the rotator shows */
.hero.hero-rotator { background-image: none !important; }

/* Mobile: shorten hero so wide landscape photos don't crop heavily.
   At 88vh + portrait phone aspect ratio, cover crops ~70% off the sides.
   Reducing height lets more of the photo show naturally. */
@media (max-width: 768px) {
  .hero { min-height: 42vh; }
  .hero.hero-sm { min-height: 30vh; }
  .hero.hero-rotator { min-height: 42vh; }
}
@media (max-width: 480px) {
  .hero { min-height: 32vh; }
  .hero.hero-sm { min-height: 24vh; }
  .hero.hero-rotator { min-height: 32vh; }
}

/* ==========================================================================
   STICKY-SCROLL STORIES — full-width landscape photo pinned, text scrolls under
   ========================================================================== */
.scroll-stories {
  background: var(--cream);
  padding-block: clamp(64px, 8vw, 120px);
}
.scroll-stories .section-head { margin-bottom: clamp(48px, 8vw, 80px); }

.scroll-stories .story {
  position: relative;
  min-height: 170vh;     /* gives the sticky photo room to pin while card slides */
  margin-bottom: clamp(40px, 6vw, 80px);
}
.scroll-stories .story:last-child { margin-bottom: 0; }
/* "reverse" no longer needed but kept harmless */
.scroll-stories .story.reverse { /* same layout */ }

/* Full-width landscape photo, sticky at top of viewport */
.scroll-stories .story-photo {
  position: sticky;
  top: 100px;            /* clears the sticky header */
  width: 100%;
  height: clamp(420px, 75vh, 780px);
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-md);
  z-index: 1;
}
.scroll-stories .story-photo img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

/* Translucent text card — slides UP IN FRONT of the pinned photo */
.scroll-stories .story-text {
  position: relative;
  z-index: 2;
  width: min(820px, calc(100% - 32px));
  /* Card starts ~25vh below the bottom of the pinned photo, then scrolls
     up across it. The photo stays pinned because .story is 170vh tall. */
  margin: 25vh auto 0;
  background: rgba(245, 240, 232, 0.72);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  padding: clamp(32px, 4vw, 48px) clamp(24px, 4vw, 56px);
  border-radius: var(--radius-lg);
  border: 1px solid rgba(255, 255, 255, 0.45);
  box-shadow: 0 24px 60px -20px rgba(10, 22, 40, 0.35);
}
.scroll-stories .story-text .num {
  display: block;
  font-size: clamp(2.5rem, 5vw, 4rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  color: var(--accent);
  line-height: 1;
  margin-bottom: 14px;
}
.scroll-stories .story-text h3 {
  font-size: clamp(1.75rem, 3.5vw, 2.5rem);
  letter-spacing: -0.025em;
  margin-bottom: 18px;
}
.scroll-stories .story-text .lede {
  font-size: clamp(1.05rem, 1.5vw, 1.2rem);
  margin-bottom: 18px;
}
.scroll-stories .story-text p { color: var(--ink-soft); }

@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .scroll-stories .story-text {
    background: rgba(245, 240, 232, 0.96);
  }
}

@media (max-width: 860px) {
  /* Mobile sticky-scroll: photo pins at top of viewport while text card slides up over it.
     Scaled down vs desktop so it works on shorter mobile screens.
     -webkit-sticky included for older iOS Safari. */
  .scroll-stories .story {
    position: relative;
    min-height: 130vh;
    margin-bottom: clamp(40px, 6vw, 60px);
  }
  .scroll-stories .story-photo {
    position: -webkit-sticky;
    position: sticky;
    top: 70px;        /* clears the sticky site header */
    width: 100%;
    height: 55vh;     /* dominant but leaves room for the card to slide up */
    aspect-ratio: auto;
    z-index: 1;
  }
  .scroll-stories .story-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
  }
  .scroll-stories .story-text {
    position: relative;
    z-index: 2;
    width: calc(100% - 24px);
    margin: 18vh auto 0;
    backdrop-filter: blur(14px) saturate(140%);
    -webkit-backdrop-filter: blur(14px) saturate(140%);
    padding: clamp(24px, 5vw, 36px);
  }
}

/* ==========================================================================
   FOOTER CTA — visible Contact link on every page (mobile fallback for nav)
   ========================================================================== */
.footer-cta {
  text-align: center;
  margin: 28px 0 8px;
}
.site-footer .footer-cta .btn {
  letter-spacing: .02em;
}

/* ==========================================================================
   TOAST — confirmation message after form submit
   ========================================================================== */
.toast {
  position: fixed;
  top: 24px;
  left: 50%;
  transform: translate(-50%, -180%);
  display: flex;
  align-items: flex-start;
  gap: 14px;
  background: var(--paper);
  color: var(--ink);
  padding: 18px 24px;
  border-radius: 14px;
  box-shadow: 0 18px 50px rgba(10,22,40,.30);
  border: 1px solid var(--line);
  z-index: 10000;
  max-width: calc(100% - 32px);
  width: 420px;
  transition: transform .45s cubic-bezier(.2,.7,.2,1), opacity .3s;
  font-family: 'Geist', sans-serif;
}
.toast.show {
  transform: translate(-50%, 0);
}
.toast-icon {
  flex: 0 0 auto;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: #1f7a34;
  color: #fff;
  font-size: 18px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-top: 2px;
}
.toast-body { flex: 1; }
.toast-body strong {
  display: block;
  font-size: 17px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin-bottom: 4px;
  color: var(--ink);
}
.toast-body p {
  margin: 0;
  font-size: 14px;
  line-height: 1.4;
  color: var(--ink-soft);
}
@media (max-width: 480px) {
  .toast {
    top: 12px;
    padding: 14px 18px;
    border-radius: 12px;
    gap: 10px;
  }
  .toast-icon { width: 28px; height: 28px; font-size: 16px; }
  .toast-body strong { font-size: 15px; }
  .toast-body p { font-size: 13px; }
}

/* ==========================================================================
   GALLERY LIGHTBOX — click any gallery image for a full-size view
   ========================================================================== */
.gallery .item { cursor: zoom-in; }

.lightbox {
  position: fixed;
  inset: 0;
  background: rgba(10, 22, 40, 0.94);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 9999;
  padding: 40px;
  opacity: 0;
  transition: opacity .25s ease;
}
.lightbox.open {
  display: flex;
  opacity: 1;
}
.lightbox-frame {
  margin: 0;
  max-width: 100%;
  max-height: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.lightbox-frame img {
  max-width: 100%;
  max-height: calc(100vh - 120px);
  height: auto;
  width: auto;
  border-radius: 8px;
  box-shadow: 0 20px 60px rgba(0,0,0,.6);
  display: block;
}
.lightbox-frame figcaption {
  color: var(--on-dark);
  font-family: 'Geist', sans-serif;
  font-size: 15px;
  letter-spacing: .04em;
  margin-top: 16px;
  text-align: center;
  opacity: .85;
}
.lightbox-close {
  position: fixed;
  top: 20px;
  right: 24px;
  background: transparent;
  border: 0;
  color: var(--on-dark);
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
  padding: 8px 14px;
  border-radius: 50%;
  transition: background .2s ease;
}
.lightbox-close:hover,
.lightbox-close:focus {
  background: rgba(255,255,255,.12);
  outline: none;
}

.lightbox-prev,
.lightbox-next {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,.08);
  border: 0;
  color: var(--on-dark);
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  transition: background .2s ease;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 0;
  font-family: inherit;
}
.lightbox-prev { left: 24px; }
.lightbox-next { right: 24px; }
.lightbox-prev:hover, .lightbox-next:hover,
.lightbox-prev:focus, .lightbox-next:focus {
  background: rgba(255,255,255,.18);
  outline: none;
}
.lightbox-counter {
  color: var(--on-dark-soft);
  font-family: 'Geist', sans-serif;
  font-size: 12px;
  letter-spacing: .12em;
  text-transform: uppercase;
  margin-top: 8px;
  text-align: center;
  opacity: .7;
}

@media (max-width: 600px) {
  .lightbox { padding: 20px; }
  .lightbox-frame img { max-height: calc(100vh - 100px); }
  .lightbox-close { top: 10px; right: 12px; font-size: 32px; }
  .lightbox-prev, .lightbox-next {
    width: 44px; height: 44px; font-size: 28px;
  }
  .lightbox-prev { left: 8px; }
  .lightbox-next { right: 8px; }
}

/* ==========================================================================
   FOOTER CREDENTIALS — DOT/MC/Insurance line under company description
   ========================================================================== */
.site-footer .creds {
  margin-top: 14px;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--accent-soft);
  font-weight: 600;
}