/* ============================================================================
   EQUIPMENT · "Ship's Toolbox" (bespoke, Equipment page only)
   Ported from the approved Claude Design export ("Equipment - Ship's Toolbox").
   Replaces this page's former reliance on the shared .toy-* / .eq-ph vocabulary
   in styles.css — those rules are untouched and still serve Toys/Safety Aboard.

   Layout model (mirrors the export exactly):
   - Desktop (≥760px): each drawer tray is a dense 4-column grid, 128px auto
     rows; cards span data-c × data-r (hero cards are 2×2).
   - Narrow (<760px): trays become horizontal scroll-snap "shelves", the fixed
     "The chest" scrollspy nav hides, the CTA grid stacks.
   - Cards flip via .is-flipped (toggled in equipment.js) — 3D rotateY with a
     front/back opacity crossfade, instant under prefers-reduced-motion.
   ========================================================================== */

/* ---------- page wash ---------- */
.eqp-root {
  position: relative;
  min-height: 100vh;
  background: linear-gradient(180deg, #bfe0f4 0%, #dcecf5 14%, #eef1e6 34%, #f3ecd9 100%);
}
.eqp-dots {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(120, 150, 120, .08) 1.4px, transparent 1.4px);
  background-size: 24px 24px;
  pointer-events: none;
}

/* ---------- intro ---------- */
.eqp-intro {
  position: relative;
  z-index: 10;
  max-width: 1000px;
  margin: 0 auto;
  padding: clamp(24px, 3vw, 40px) clamp(18px, 4vw, 40px) 0;
}
.eqp-crumb {
  display: flex;
  align-items: center;
  gap: 9px;
  font: 700 12px/1 'Oswald', sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: #3a6b57;
  margin-bottom: clamp(14px, 2vw, 20px);
}
.eqp-crumb a { color: #3a6b57; text-decoration: none; }
.eqp-crumb a:hover { text-decoration: underline; }
.eqp-crumb-sep { color: #96b0a4; }
.eqp-crumb-here { color: #173049; }
.eqp-kicker {
  font: 700 12px/1 'Oswald', sans-serif;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: #a8432a;
  margin-bottom: 10px;
}
.eqp-title {
  font: 700 clamp(46px, 9vw, 96px)/.86 'Caveat', cursive;
  color: #173049;
  margin: 0;
  transform: rotate(-1.2deg);
}
.eqp-lede {
  font: 400 clamp(16px, 2vw, 18.5px)/1.65 'Nunito Sans', sans-serif;
  color: #2c4257;
  margin: 22px 0 0;
  max-width: 600px;
  text-wrap: pretty;
}
.eqp-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
  background: #efe3c6;
  border: 2.5px solid #223140;
  border-radius: 30px;
  padding: 9px 16px;
  box-shadow: 0 5px 0 rgba(34, 49, 64, .14);
}
.eqp-badge-stat {
  font: 800 12px/1 'Oswald', sans-serif;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: #173049;
}
.eqp-badge-dot { width: 5px; height: 5px; border-radius: 50%; background: #a8432a; }
.eqp-badge-hand { font: 600 16px/1 'Caveat', cursive; color: #8a5a34; }

/* ---------- "The chest" fixed scrollspy nav ---------- */
.eqp-toolnav {
  position: fixed;
  top: 50%;
  right: 16px;
  transform: translateY(-50%);
  z-index: 95;
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 9px 8px 10px;
  background: #efe3c6;
  border: 2.5px solid #223140;
  border-radius: 13px;
  box-shadow: 0 14px 28px -12px rgba(34, 49, 64, .5);
}
.eqp-toolnav-title {
  font: 800 7px/1 'Oswald', sans-serif;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: #8a6a3a;
  text-align: center;
  margin-bottom: 2px;
}
.eqp-navseg {
  display: flex;
  align-items: center;
  gap: 7px;
  width: 120px;
  padding: 7px 9px;
  border: 2px solid #223140;
  border-radius: 7px;
  background: #d8ccae;
  color: #223140;
  text-decoration: none;
  transition: background .25s, color .25s, transform .2s;
}
.eqp-navseg[data-navseg="cta"] { margin-top: 2px; }
.eqp-navseg-swatch {
  width: 12px;
  height: 12px;
  border-radius: 3px;
  border: 1.5px solid #223140;
  flex: none;
}
.eqp-navseg-label {
  font: 800 8.5px/1 'Oswald', sans-serif;
  letter-spacing: .05em;
  text-transform: uppercase;
}
.eqp-navseg[data-navseg="nav"] .eqp-navseg-swatch { background: #0b6e66; }
.eqp-navseg[data-navseg="power"] .eqp-navseg-swatch { background: #cf942b; }
.eqp-navseg[data-navseg="comfort"] .eqp-navseg-swatch { background: #e8836a; }
.eqp-navseg[data-navseg="safety"] .eqp-navseg-swatch { background: #e5732a; }
.eqp-navseg[data-navseg="deck"] .eqp-navseg-swatch { background: #3f9e78; }
.eqp-navseg[data-navseg="cta"] .eqp-navseg-swatch { background: #a8432a; }
.eqp-navseg.is-active { transform: translateX(-5px); }
.eqp-navseg.is-active[data-navseg="nav"] { background: #0b6e66; color: #fff; }
.eqp-navseg.is-active[data-navseg="power"] { background: #cf942b; color: #173049; }
.eqp-navseg.is-active[data-navseg="comfort"] { background: #e8836a; color: #173049; }
.eqp-navseg.is-active[data-navseg="safety"] { background: #e5732a; color: #fff; }
.eqp-navseg.is-active[data-navseg="deck"] { background: #3f9e78; color: #fff; }
.eqp-navseg.is-active[data-navseg="cta"] { background: #a8432a; color: #fff; }

/* ---------- drawer sections ---------- */
.eqp-drawer {
  position: relative;
  z-index: 10;
  max-width: 1120px;
  margin: 0 auto;
  padding: clamp(26px, 3.5vw, 44px) clamp(16px, 4vw, 40px) 0;
  scroll-margin-top: 90px; /* clear the sticky theme header on anchor jumps */
}
.eqp-drawer--cta {
  padding: clamp(22px, 3vw, 38px) clamp(16px, 4vw, 40px) clamp(40px, 6vw, 70px);
}
.eqp-drawer-box {
  position: relative;
  border: 2.5px solid #223140;
  border-radius: 16px;
  overflow: hidden;
  box-shadow: 0 22px 40px -22px rgba(34, 49, 64, .4);
}
.eqp-drawer--cta .eqp-drawer-box { box-shadow: 0 26px 46px -22px rgba(34, 49, 64, .5); }

/* drawer header — two-tone accent gradient per category */
.eqp-drawer-head {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 15px 20px;
  border-bottom: 3px solid #223140;
}
.eqp-drawer[data-seg="nav"] .eqp-drawer-head { background: linear-gradient(180deg, #17897e 0 42%, #0b6e66 42%); }
.eqp-drawer[data-seg="power"] .eqp-drawer-head { background: linear-gradient(180deg, #e3ad3e 0 42%, #cf942b 42%); }
.eqp-drawer[data-seg="comfort"] .eqp-drawer-head { background: linear-gradient(180deg, #f2997f 0 42%, #e8836a 42%); }
.eqp-drawer[data-seg="safety"] .eqp-drawer-head { background: linear-gradient(180deg, #f28a3d 0 42%, #e5732a 42%); }
.eqp-drawer[data-seg="deck"] .eqp-drawer-head { background: linear-gradient(180deg, #55b28c 0 42%, #3f9e78 42%); }
.eqp-drawer[data-seg="cta"] .eqp-drawer-head { background: linear-gradient(180deg, #bd5236 0 42%, #a8432a 42%); }
.eqp-drawer-head-left {
  display: flex;
  align-items: center;
  gap: 14px;
  min-width: 0;
}
.eqp-drawer-num {
  font: 700 26px/1 'Oswald', sans-serif;
  color: rgba(255, 255, 255, .34);
  flex: none;
}
.eqp-drawer-tape {
  transform: rotate(-1.4deg);
  background: #ecdcae;
  padding: 6px 16px 7px;
  box-shadow: 0 3px 0 rgba(34, 49, 64, .18);
  border: 1.5px solid #cbb079;
}
.eqp-drawer-tape span {
  font: 400 clamp(17px, 2.4vw, 22px)/1 'Permanent Marker', cursive;
  color: #24282d;
}
.eqp-drawer-head-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: none;
}
.eqp-drawer-count {
  font: 800 10px/1 'Oswald', sans-serif;
  letter-spacing: .1em;
  text-transform: uppercase;
  border: 2px solid #223140;
  padding: 5px 10px;
  border-radius: 20px;
}
.eqp-drawer[data-seg="nav"] .eqp-drawer-count { color: #0b6e66; background: #eafaf5; }
.eqp-drawer[data-seg="power"] .eqp-drawer-count { color: #8a5a1c; background: #fbf1d6; }
.eqp-drawer[data-seg="comfort"] .eqp-drawer-count { color: #a8432a; background: #fdeee7; }
.eqp-drawer[data-seg="safety"] .eqp-drawer-count { color: #fff; background: #c8531c; }
.eqp-drawer[data-seg="deck"] .eqp-drawer-count { color: #fff; background: #2f8663; }
.eqp-drawer-handle {
  width: 78px;
  height: 17px;
  border-radius: 9px;
  background: #dbe2e6;
  border: 2.5px solid #223140;
  flex: none;
}

/* drawer body: kraft felt + peg-dot texture */
.eqp-drawer-body {
  position: relative;
  background: #efe3c6;
  padding: 20px;
}
.eqp-drawer--cta .eqp-drawer-body { padding: clamp(20px, 3vw, 32px); }
.eqp-drawer-felt {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(180, 150, 90, .16) 1.4px, transparent 1.4px);
  background-size: 15px 15px;
  pointer-events: none;
}

/* ---------- foam-cutout tray (asymmetric grid) ---------- */
.eqp-tray {
  position: relative;
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-auto-rows: 128px;
  grid-auto-flow: dense;
  gap: 13px;
}
.eqp-item { position: relative; display: grid; }
.eqp-item[data-c="2"] { grid-column: span 2; }
.eqp-item[data-r="2"] { grid-row: span 2; }

/* ---------- flip card ---------- */
.eqp-card {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 128px;
  perspective: 1000px;
}
.eqp-flip {
  position: absolute;
  inset: 0;
  transform-style: preserve-3d;
  transition: transform .6s cubic-bezier(.4, .05, .2, 1);
  will-change: transform;
}
.eqp-item.is-flipped .eqp-flip { transform: rotateY(180deg); }
.eqp-item { cursor: pointer; }
.eqp-item:focus-visible {
  outline: 3px solid #a8432a;
  outline-offset: 3px;
  border-radius: 13px;
}

.eqp-face-front,
.eqp-face-back {
  position: absolute;
  inset: 0;
  border-radius: 13px;
  border: 2.5px solid #2a3b47;
  transition: opacity .25s ease .12s;
  backface-visibility: hidden;
}
.eqp-face-front {
  transform: rotateY(0deg);
  opacity: 1;
  background: #c6d4d6;
  box-shadow: inset 0 4px 0 rgba(42, 59, 71, .14), inset 0 -3px 0 rgba(255, 255, 255, .5);
  display: flex;
  align-items: center;
  justify-content: center;
}
.eqp-face-back {
  transform: rotateY(180deg);
  opacity: 0;
  background: #e9d7ab;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.eqp-item.is-flipped .eqp-face-front { opacity: 0; }
.eqp-item.is-flipped .eqp-face-back { opacity: 1; }

/* front face */
.eqp-icon {
  width: 42%;
  max-width: 98px;
  height: auto;
  filter: drop-shadow(0 2px 0 rgba(42, 59, 71, .1));
}
.eqp-name-row {
  position: absolute;
  left: 9px;
  right: 9px;
  bottom: 8px;
  pointer-events: none;
}
.eqp-name {
  display: inline-block;
  background: #fbf3e0;
  border: 1.5px solid #223140;
  border-radius: 5px;
  padding: 3px 8px;
  font: 700 8.5px/1.15 'Oswald', sans-serif;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #173049;
}

/* icon-only front face — the 6 items with no viable photo at all
   (AIS transceiver, HF/MF radio, EPIRB, both bilge pump items, Professional
   sea anchor) get a subtle foam-texture + soft vignette so the card doesn't
   read as a flat empty rectangle next to the photo cards. Reuses the same
   felt-dot language as .eqp-drawer-felt for visual consistency. */
.eqp-face-front:not(.eqp-face-front--photo) {
  background-image: radial-gradient(rgba(42, 59, 71, .08) 1.4px, transparent 1.4px);
  background-size: 13px 13px;
  box-shadow:
    inset 0 4px 0 rgba(42, 59, 71, .14),
    inset 0 -3px 0 rgba(255, 255, 255, .5),
    inset 0 0 30px rgba(42, 59, 71, .12);
}
.eqp-face-front:not(.eqp-face-front--photo) .eqp-icon {
  width: 48%;
  max-width: 108px;
}

/* photo-forward front face — the image replaces the icon and fills the card,
   framed by the face's own navy border. Items with a 'photo' get this; the
   "the real thing" caption is added only for verified-real (real => true). */
.eqp-face-front--photo {
  background: #eef3f5;
}
.eqp-photo {
  position: absolute;
  inset: 0;
  border-radius: 10.5px; /* face radius 13px minus its 2.5px border */
  overflow: hidden;
}
.eqp-photo img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
/* subtle handwritten authenticity note — top-right, clear of the bottom-left
   name tag; light on a soft navy scrim so it reads over any photo */
.eqp-photo-cap {
  position: absolute;
  top: 7px;
  right: 7px;
  padding: 1px 8px 2px;
  font: 600 14px/1 'Caveat', cursive;
  color: #fdf7ea;
  background: rgba(23, 34, 43, .5);
  border-radius: 9px;
  pointer-events: none;
}

/* back face — "Ship's kit" spec tag */
.eqp-back-felt {
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(120, 90, 40, .14) 1px, transparent 1px);
  background-size: 9px 9px;
  pointer-events: none;
}
.eqp-back-grommet {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #efe3c6;
  border: 2px solid #2a3b47;
}
/* scroll wrapper: centres short specs (margin:auto), scrolls long ones —
   the original captions are kept verbatim, some far outgrow a 1×1 card */
.eqp-back-scroll {
  position: relative;
  margin: auto 0;
  max-height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
  scrollbar-color: rgba(58, 46, 34, .4) transparent;
  padding-bottom: 14px; /* keep last line clear of the Checked stamp */
}
.eqp-back-kicker {
  font: 700 9px/1.05 'Oswald', sans-serif;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #9a7238;
}
.eqp-back-name {
  font: 700 14px/1.05 'Oswald', sans-serif;
  letter-spacing: .01em;
  text-transform: uppercase;
  color: #173049;
  margin-top: 3px;
}
.eqp-back-rule {
  height: 2px;
  background: rgba(58, 46, 34, .26);
  margin: 7px 0;
}
.eqp-back-head {
  font: 700 11px/1.2 'Oswald', sans-serif;
  letter-spacing: .02em;
  text-transform: uppercase;
  color: #a8432a;
}
.eqp-back-spec {
  font: 400 11px/1.35 'Nunito Sans', sans-serif;
  color: #5c4a37;
  margin-top: 3px;
  text-wrap: pretty;
}
.eqp-checked {
  position: absolute;
  right: 9px;
  bottom: 8px;
  transform: rotate(-9deg);
  border: 2px solid #0b6e66;
  color: #0b6e66;
  border-radius: 4px;
  padding: 2px 7px;
  font: 800 7.5px/1 'Oswald', sans-serif;
  letter-spacing: .12em;
  text-transform: uppercase;
  background: rgba(239, 227, 198, .85);
}

/* ---------- stamped spec plates (Power drawer footer) ---------- */
.eqp-plates-wrap { position: relative; margin-top: 14px; }
.eqp-plates-title {
  font: 800 9px/1 'Oswald', sans-serif;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #8a6a3a;
  margin-bottom: 9px;
}
.eqp-plates {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}
.eqp-plate {
  flex: 1 1 148px;
  position: relative;
  background: #e9c15a;
  border: 2.5px solid #223140;
  border-radius: 10px;
  padding: 11px 13px;
  box-shadow: 0 5px 0 rgba(34, 49, 64, .16);
}
.eqp-plate-rivet {
  position: absolute;
  top: 7px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #8a6a28;
  border: 1.5px solid #223140;
}
.eqp-plate-rivet--l { left: 7px; }
.eqp-plate-rivet--r { right: 7px; }
.eqp-plate-label {
  font: 600 8.5px/1 'Oswald', sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: #7a3018;
}
.eqp-plate-value {
  font: 700 24px/1 'Oswald', sans-serif;
  color: #173049;
  margin-top: 5px;
}
.eqp-plate-unit { font-size: 12px; color: #7a3018; }
.eqp-plate-sub {
  font: 400 10px/1.2 'Nunito Sans', sans-serif;
  color: #6a4a22;
  margin-top: 3px;
}

/* ---------- closing CTA drawer ---------- */
.eqp-cta-grid {
  position: relative;
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: clamp(20px, 3vw, 34px);
  align-items: center;
}
.eqp-cta-cutout {
  position: relative;
  border-radius: 14px;
  background: #c6d4d6;
  border: 2.5px solid #2a3b47;
  box-shadow: inset 0 4px 0 rgba(42, 59, 71, .14), inset 0 -3px 0 rgba(255, 255, 255, .5);
  padding: 24px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
}
.eqp-cta-tag {
  position: relative;
  transform: rotate(-3deg);
  background: #e9d7ab;
  border: 2.5px solid #2a3b47;
  border-radius: 8px;
  padding: 16px 20px 15px;
  box-shadow: 0 6px 0 rgba(34, 49, 64, .16);
  text-align: center;
}
.eqp-cta-tag-grommet {
  position: absolute;
  top: 9px;
  left: 11px;
  width: 11px;
  height: 11px;
  border-radius: 50%;
  background: #efe3c6;
  border: 2px solid #2a3b47;
}
.eqp-cta-tag-kicker {
  font: 700 9px/1 'Oswald', sans-serif;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: #9a7238;
  margin-bottom: 6px;
}
.eqp-cta-tag-title {
  font: 400 27px/.95 'Permanent Marker', cursive;
  color: #a8432a;
}
.eqp-cta-stamp {
  transform: rotate(4deg);
  border: 2.5px solid #0b6e66;
  color: #0b6e66;
  border-radius: 6px;
  padding: 5px 12px;
  font: 800 12px/1 'Oswald', sans-serif;
  letter-spacing: .14em;
  text-transform: uppercase;
  background: rgba(11, 110, 102, .06);
}
.eqp-cta-kicker {
  font: 700 11px/1 'Oswald', sans-serif;
  letter-spacing: .24em;
  text-transform: uppercase;
  color: #a8432a;
  margin-bottom: 10px;
}
.eqp-cta-title {
  font: 700 clamp(30px, 4.6vw, 46px)/.92 'Caveat', cursive;
  color: #173049;
  margin: 0;
}
.eqp-cta-copy {
  font: 400 15px/1.65 'Nunito Sans', sans-serif;
  color: #2c4257;
  margin: 16px 0 0;
  max-width: 460px;
  text-wrap: pretty;
}
.eqp-cta-actions {
  display: flex;
  align-items: center;
  gap: 16px;
  flex-wrap: wrap;
  margin-top: 22px;
}
.eqp-cta-btn {
  display: inline-flex;
  align-items: center;
  gap: 11px;
  font: 800 14px/1 'Nunito Sans', sans-serif;
  letter-spacing: .05em;
  text-transform: uppercase;
  color: #fff;
  background: #a8432a;
  padding: 16px 26px;
  border-radius: 4px;
  border: 2.5px solid #223140;
  box-shadow: 4px 4px 0 rgba(34, 49, 64, .3);
  text-decoration: none;
  transition: transform .15s, box-shadow .15s;
}
.eqp-cta-btn:hover {
  transform: translate(-1px, -1px);
  box-shadow: 5px 5px 0 rgba(34, 49, 64, .3);
  color: #fff;
}
.eqp-cta-alt {
  font: 700 14px/1 'Nunito Sans', sans-serif;
  color: #173049;
  border-bottom: 2px solid rgba(23, 48, 73, .35);
  padding-bottom: 2px;
  text-decoration: none;
}
.eqp-cta-alt:hover { border-bottom-color: #173049; }

/* ---------- scroll-reveal (class applied by equipment.js) ---------- */
.eqp-anim [data-reveal] {
  opacity: 0;
  transform: translateY(26px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2, .8, .25, 1);
  will-change: opacity, transform;
}
.eqp-anim [data-reveal].is-in {
  opacity: 1;
  transform: none;
}

/* ---------- narrow: shelf mode ---------- */
@media (max-width: 759px) {
  .eqp-toolnav { display: none; }
  .eqp-tray {
    display: flex;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    -webkit-overflow-scrolling: touch;
    gap: 13px;
    padding: 14px 0 8px;
  }
  .eqp-item {
    flex: 0 0 74%;
    min-height: 168px;
  }
  .eqp-plates {
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 6px;
  }
  .eqp-plate { flex: 0 0 148px; }
  .eqp-cta-grid { grid-template-columns: 1fr; }
}

/* ---------- reduced motion: no slide-in, instant flips ---------- */
@media (prefers-reduced-motion: reduce) {
  .eqp-anim [data-reveal] {
    opacity: 1;
    transform: none;
    transition: none;
  }
  .eqp-flip {
    transition: none;
  }
  .eqp-face-front,
  .eqp-face-back {
    transition: none;
  }
  .eqp-navseg { transition: none; }
  .eqp-cta-btn { transition: none; }
}
