/*
 * OpenShip design system — shared across every site page.
 * Ocean/nautical theme: it's Open*ship*, so the whole thing sails.
 * Page-specific layout stays inline per-page; anything reused
 * (tokens, nav, logo, footer, buttons, badges, waves, motion, cards) lives here.
 */

:root {
  /* surface + ink */
  --bg: #eef5fb; --card: #fff; --card-2: #e7f1fb; --line: #d3e2f0;
  --text: #0a2540; --dim: #57708c; --dimmer: #89a2bd;
  /* deep sea (dark bands / hero) */
  --deep: #071a33; --deep-2: #0e3a6b; --on-deep: #eaf4ff; --on-deep-dim: #9fc2e6;
  /* ocean blue (primary) */
  --accent: #1d6fd4; --accent-2: #0e4ea8; --accent-light: #4bb8f0;
  --accent-soft: #e2f0ff; --on-accent: #fff;
  /* seafoam (secondary) + buoy (warm) + coral (danger) */
  --teal: #10b0a0; --teal-soft: #d4f5f0;
  --buoy: #f5b544; --buoy-soft: #fdf1d9;
  --danger: #ef5a5a; --danger-soft: #fde4e2;

  --shadow-sm: 0 1px 2px rgba(7,26,51,.06);
  --shadow-md: 0 8px 24px rgba(7,26,51,.09);
  --shadow-lg: 0 22px 50px rgba(7,26,51,.16);
  --shadow-accent: 0 10px 28px rgba(29,111,212,.30);

  --radius-sm: 8px; --radius: 14px; --radius-lg: 20px;

  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --ease-spring: cubic-bezier(.34, 1.56, .64, 1);
  --dur-fast: 150ms; --dur: 260ms; --dur-slow: 480ms;
}

* { box-sizing: border-box; }
body {
  margin: 0; background: var(--bg); color: var(--text);
  font: 15px/1.6 system-ui, -apple-system, "Segoe UI", sans-serif;
}
.wrap { max-width: 880px; margin: 0 auto; padding: 0 20px; }
a { color: inherit; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .001ms !important; animation-iteration-count: 1 !important; transition-duration: .001ms !important; }
}

/* ---- nav + logo mark --------------------------------------------------- */
nav { display: flex; align-items: center; gap: 10px; padding: 18px 0; }
.mark {
  width: 34px; height: 34px; border-radius: 10px; display: grid; place-items: center;
  flex: none; background: linear-gradient(160deg, var(--accent-light), var(--accent-2));
  box-shadow: var(--shadow-accent); position: relative; overflow: hidden;
  transition: transform var(--dur) var(--ease-spring), box-shadow var(--dur) var(--ease-out);
}
/* a little foam crest sweeping under the swap-arrows */
.mark::after {
  content: ''; position: absolute; left: -20%; right: -20%; bottom: -2px; height: 42%;
  background: radial-gradient(120% 100% at 50% 100%, rgba(255,255,255,.55), transparent 70%);
}
nav:hover .mark, a:hover > .mark { transform: rotate(-6deg) scale(1.06); }
.mark svg { width: 18px; height: 18px; position: relative; z-index: 1; }
nav b { font-size: 17px; letter-spacing: -.2px; }
nav .links { margin-left: auto; display: flex; gap: 18px; font-size: 13.5px; }
nav a { color: var(--dim); text-decoration: none; position: relative; }
nav a:not(.mark-link)::after {
  content: ''; position: absolute; left: 0; right: 100%; bottom: -3px; height: 1.5px;
  background: var(--teal); transition: right var(--dur) var(--ease-out);
}
nav a:hover { color: var(--accent); }
nav a:hover::after { right: 0; }

/* ---- badges, buttons ---------------------------------------------------- */
.badge {
  font-size: 11px; text-transform: uppercase; letter-spacing: .6px; font-weight: 600;
  color: var(--accent); background: var(--accent-soft); border: 1px solid #c3ddf7;
  padding: 3px 11px; border-radius: 999px; transition: transform var(--dur-fast) var(--ease-out);
}
.badge:hover { transform: translateY(-1px); }

.btn {
  display: inline-block; padding: 12px 24px; border-radius: var(--radius-sm);
  font-size: 14px; font-weight: 600; text-decoration: none; border: 0; cursor: pointer;
  transition: transform var(--dur-fast) var(--ease-out), box-shadow var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}
.btn.primary { background: linear-gradient(160deg, var(--accent), var(--accent-2)); color: var(--on-accent); box-shadow: var(--shadow-accent); }
.btn.primary:hover { transform: translateY(-2px); box-shadow: var(--shadow-lg); }
.btn.disabled { background: var(--card); color: var(--dimmer); border: 1px dashed var(--line); cursor: not-allowed; }

/* ---- cards --------------------------------------------------------------- */
.card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  transition: transform var(--dur) var(--ease-out), box-shadow var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.card.hoverable:hover { transform: translateY(-3px); box-shadow: var(--shadow-lg); border-color: #b9d4ef; }

/* nautical round icon badge (anchor/compass/etc. sit in these on feature cards) */
.ic-badge {
  width: 44px; height: 44px; border-radius: 13px; display: grid; place-items: center;
  background: var(--teal-soft); color: var(--teal);
}
.ic-badge svg { width: 22px; height: 22px; }

/* ---- animated waves ------------------------------------------------------ */
/* Canonical layered-wave separator. Put <div class="wave-sep"> ... </div>
   between a deep band and a light one; set --wave-fill to the colour the
   waves resolve INTO (usually the next section's background). */
.wave-sep { position: relative; width: 100%; height: 64px; line-height: 0; margin: 0; --wave-fill: var(--bg); }
.wave-sep svg { position: absolute; inset: 0; width: 100%; height: 100%; }
.wave-parallax > use { animation: wave-move 22s cubic-bezier(.55,.5,.45,.5) infinite; }
.wave-parallax > use:nth-child(1) { animation-delay: -2s;  animation-duration: 8s;  }
.wave-parallax > use:nth-child(2) { animation-delay: -3s;  animation-duration: 11s; }
.wave-parallax > use:nth-child(3) { animation-delay: -4s;  animation-duration: 14s; }
.wave-parallax > use:nth-child(4) { animation-delay: -5s;  animation-duration: 22s; }
@keyframes wave-move { 0% { transform: translate3d(-90px,0,0); } 100% { transform: translate3d(85px,0,0); } }

/* deep-sea band (hero / feature strips) */
.deep { position: relative; background: linear-gradient(180deg, var(--deep) 0%, var(--deep-2) 100%); color: var(--on-deep); overflow: hidden; }
/* faint drifting light rays / bubbles layer */
.deep::before {
  content: ''; position: absolute; inset: 0; pointer-events: none; opacity: .5;
  background:
    radial-gradient(2px 2px at 15% 40%, rgba(255,255,255,.5), transparent 60%),
    radial-gradient(2px 2px at 70% 25%, rgba(255,255,255,.35), transparent 60%),
    radial-gradient(1.5px 1.5px at 45% 65%, rgba(255,255,255,.4), transparent 60%),
    radial-gradient(1.5px 1.5px at 85% 60%, rgba(255,255,255,.3), transparent 60%),
    radial-gradient(2px 2px at 30% 80%, rgba(255,255,255,.3), transparent 60%);
  animation: bubble-rise 14s linear infinite;
}
@keyframes bubble-rise { from { transform: translateY(0); } to { transform: translateY(-24px); } }

/* ---- porthole (frames the demo GIF like a ship window) ------------------- */
.porthole {
  position: relative; display: inline-block; border-radius: 22px; padding: 10px;
  background: linear-gradient(160deg, #1a4b7e, #0b2748);
  box-shadow: var(--shadow-lg), inset 0 0 0 2px rgba(255,255,255,.08);
}
.porthole::before {
  /* brass rivets around the frame */
  content: ''; position: absolute; inset: 4px; border-radius: 18px;
  box-shadow: inset 0 0 0 2px rgba(245,181,68,.35);
  pointer-events: none;
}
.porthole img { display: block; max-width: 100%; border-radius: 13px; }

/* ---- scroll-reveal + entrance ------------------------------------------- */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
.enter { animation: fadeInUp var(--dur-slow) var(--ease-out) both; }
.reveal {
  opacity: 0; transform: translateY(18px);
  transition: opacity var(--dur-slow) var(--ease-out), transform var(--dur) var(--ease-out),
              box-shadow var(--dur) var(--ease-out), border-color var(--dur) var(--ease-out);
}
.reveal.in { opacity: 1; transform: none; }

/* ---- footer -------------------------------------------------------------- */
footer {
  border-top: 1px solid var(--line); padding: 22px 0 34px; color: var(--dimmer);
  font-size: 12.5px; text-align: center;
}
footer a { color: var(--dim); }
footer a:hover { color: var(--accent); }
footer .ver { color: var(--dim); font-variant-numeric: tabular-nums; }

/* ---- share loop -----------------------------------------------------------
   Shared across haul.html / items.html / stores.html: the visitor agent
   picker, per-row/per-haul share buttons, the "you followed a shared link"
   highlight state, and the install CTA banner every shared surface ends in.
   Kept generic + token-driven on purpose so all three pages can reuse it. */
.share-btn {
  flex: none; display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 12px; font-size: 12.5px; font-weight: 600; color: var(--dim);
  background: var(--card-2); border: 1px solid var(--line); border-radius: 999px;
  cursor: pointer; transition: color var(--dur-fast) var(--ease-out), border-color var(--dur-fast) var(--ease-out),
              background var(--dur-fast) var(--ease-out);
}
.share-btn:hover { color: var(--accent); border-color: #c3ddf7; background: var(--accent-soft); }
.share-btn.copied { color: #0b7d72; border-color: #a9e4dc; background: #dbf5f1; }

/* visitor agent picker — small enough to sit inline in a nav-adjacent bar */
.agent-picker { display: flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--dimmer); }
.agent-picker select {
  padding: 6px 10px; font-size: 12.5px; font-weight: 600; color: var(--text);
  background: var(--card); border: 1px solid var(--line); border-radius: 8px;
}
.agent-picker select:focus { outline: none; border-color: var(--accent); }

/* a row/card that arrived via ?item=/?store= gets a brief highlight so the
   visitor can find the thing they were sent without hunting the whole list */
@keyframes highlight-pulse {
  0%, 100% { box-shadow: var(--shadow-md); border-color: var(--line); }
  35% { box-shadow: 0 0 0 3px var(--accent-soft), var(--shadow-lg); border-color: var(--accent); }
}
.highlighted { animation: highlight-pulse 1.8s var(--ease-out) 1; border-color: var(--accent); }

/* standalone "not on the board yet" card built purely from URL params */
.standalone-card { margin-bottom: 14px; border-style: dashed; border-color: #c3ddf7; background: var(--accent-soft); }
.standalone-card .tag {
  display: inline-block; font-size: 10.5px; text-transform: uppercase; font-weight: 700;
  letter-spacing: .5px; color: var(--accent); margin-bottom: 6px;
}

/* install CTA banner — closes the loop on a shared page: whoever opens this
   link either converts it for themselves right now, or gets nudged to
   install so the NEXT one converts automatically. */
.cta-banner {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 16px 18px; margin-bottom: 14px; border-radius: var(--radius-lg);
  background: linear-gradient(160deg, var(--deep-2), var(--deep)); color: var(--on-deep);
  box-shadow: var(--shadow-md);
}
.cta-banner .ic-badge { background: rgba(255,255,255,.12); color: #7fe9d6; }
.cta-banner p { flex: 1; min-width: 200px; margin: 0; font-size: 13.5px; color: var(--on-deep-dim); }
.cta-banner p b { color: #fff; }
.cta-banner a.btn.primary { flex: none; }

/* shared-haul read-only item cards (rendered from a decoded #h= fragment,
   before the visitor has committed to editing anything) */
.shared-item { display: flex; align-items: center; gap: 12px; padding: 12px 14px; margin-bottom: 8px; }
.shared-item .info { flex: 1; min-width: 0; }
.shared-item .info b { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shared-item .info .sub { font-size: 12px; color: var(--dimmer); margin-top: 2px; }
