/* ============================================================
   Shippr — POLISH LAYER (additive, namespaced)
   Linked AFTER styles.css. Detail-only micro-interactions,
   nav behavior, scroll progress, selection + scrollbar.
   No layout / spacing / rhythm changes.
   ============================================================ */

/* ---------- 1. Scroll progress bar ---------- */
#sp-progress {
  position: fixed;
  top: 0; left: 0;
  height: 2px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  z-index: 60;                 /* above .nav (z 50) */
  background: var(--text);
  pointer-events: none;
  will-change: transform;
}

/* ---------- 1b. Nav condense on scroll ---------- */
.nav {
  transition: background .3s var(--ease), border-color .3s var(--ease), box-shadow .3s var(--ease);
}
.nav { transition: border-color .3s var(--ease); }
.nav__inner { transition: height .3s var(--ease); }
.nav.is-scrolled .nav__inner { height: 58px; }
/* The bar condenses but the CTAs never did: a 53px button (.btn padding 15px
   + 13px mono) inside a 58px bar leaves ~2px of air and reads as clipped.
   Condense the buttons with it, and give them room at rest too. */
.nav__cta .btn { padding: 12px 20px; transition: padding .3s var(--ease), font-size .3s var(--ease), background .18s, color .18s, border-color .18s; }
.nav.is-scrolled .nav__cta .btn { padding: 9px 16px; font-size: 12px; }

/* ---------- 2. Button micro-interactions ---------- */
/* The primary button's hover is a background swap, owned by styles.css.
   The old opacity:.82 here fought that transition and faded the button
   toward the canvas; the ::after rules targeted a pseudo that never
   existed. Both removed. */

/* Ghost button — refined border glow on hover */
.btn--ghost {
  transition: transform .18s var(--ease), background .18s, border-color .18s, box-shadow .25s;
}
.btn--ghost:hover {
  box-shadow: var(--shadow);
}

/* ---------- 3. Eyebrow leading accent tick ---------- */
/* The eyebrow text already starts with "/". Add a small gradient tick
   before it so section labels feel crafted. No vertical-rhythm impact. */
.eyebrow::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 14px;
  margin-right: 9px;
  vertical-align: -2px;
  border-radius: 2px;
  background: var(--text);
  box-shadow: 0 0 8px -1px rgba(137, 87, 229, .55);
}

/* ---------- 4. Animated underline-on-hover for text links ---------- */
.feature__link,
.nav__links a {
  position: relative;
}
.feature__link::after,
.nav__links a::after {
  content: "";
  position: absolute;
  left: 0; bottom: -3px;
  height: 1.5px;
  width: 100%;
  transform: scaleX(0);
  transform-origin: 0 50%;
  background: var(--text);
  transition: transform .28s var(--ease);
  pointer-events: none;
}
.feature__link:hover::after,
.nav__links a:hover::after { transform: scaleX(1); }

/* keep the arrow motion feeling consistent */
.feature__link .arrow { transition: transform .2s var(--ease); }
.feature__link:hover .arrow { transform: translateX(3px); }

/* ---------- 5. Card / surface hover consistency ---------- */
/* NOTE: .card, .tier, .agent, .terminal are 3D-tilt-managed by motion.js —
   applying a translateY hover here would override their tilt transform.
   So limit the lift to non-tilt surfaces (.metric, .b2b). */
.metric, .b2b {
  transition: transform .25s var(--ease), border-color .25s var(--ease), box-shadow .3s var(--ease);
}
.metric:hover, .b2b:hover {
  transform: translateY(-2px);
  border-color: var(--accent-line);
  box-shadow: var(--shadow);
}

/* Footer social — subtle lift to match */
.footer__social a { transition: border-color .15s, color .15s, transform .2s var(--ease); }
.footer__social a:hover { transform: translateY(-2px); }

/* ---------- 6. Selection + custom scrollbar ---------- */
::selection {
  background: color-mix(in srgb, var(--text) 16%, transparent);
  color: var(--text);
}
::-moz-selection {
  background: color-mix(in srgb, var(--text) 16%, transparent);
  color: var(--text);
}

html {
  scrollbar-width: thin;
  scrollbar-color: #c9c4bb transparent;
}
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-track { background: var(--ink-2); }
::-webkit-scrollbar-thumb {
  background: #cdc8bf;
  border-radius: var(--pill);
  border: 2px solid var(--ink-2);
}
::-webkit-scrollbar-thumb:hover { background: #bab5ab; }

/* ---------- 7. Reduced-motion: keep progress bar, drop the flourishes ---------- */
@media (prefers-reduced-motion: reduce) {
  #sp-progress { box-shadow: none; }          /* bar stays (functional, not motion) */
  .feature__link::after,
  .nav__links a::after,
  .card, .tier, .metric,
  .nav, .nav__inner, .footer__social a {
    transition: none;
  }
  .card:hover,
  .tier:not(.tier--win):hover,
  .metric:hover,
  .footer__social a:hover { transform: none; }
  .feature__link:hover::after,
  .nav__links a:hover::after { transform: scaleX(1); }
}

/* ============================================================
   4. Mobile nav drawer
   styles.css:214 has styled `.nav__toggle { display: none }` since
   launch with no element behind it. Here is the element, and the
   drawer it opens. Drawer, never a modal.
   ============================================================ */
.nav__toggle {
  display: none;
  background: none; border: 1px solid var(--border); cursor: pointer;
  padding: 10px 11px; margin-left: 10px;
}
.nav__toggle-bars { display: block; width: 18px; }
.nav__toggle-bars i {
  display: block; height: 1.5px; background: var(--text); border-radius: 1px;
}
.nav__toggle-bars i + i { margin-top: 4px; }
.nav__toggle[aria-expanded="true"] { border-color: var(--accent); }

.navdrawer { position: fixed; inset: 0; z-index: 90; }
.navdrawer__scrim {
  position: absolute; inset: 0; background: rgba(5,5,6,.72);
  opacity: 0; transition: opacity .24s var(--ease);
}
.navdrawer__panel {
  position: absolute; top: 0; right: 0; bottom: 0;
  width: min(86vw, 360px); overflow-y: auto;
  background: var(--ink-2); border-left: 1px solid var(--border);
  padding: 18px 20px 28px;
  transform: translateX(100%); transition: transform .24s var(--ease);
  display: flex; flex-direction: column; gap: 2px;
}
.navdrawer.is-open .navdrawer__scrim { opacity: 1; }
.navdrawer.is-open .navdrawer__panel { transform: none; }

.navdrawer__head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.navdrawer__title {
  font-family: var(--mono); font-size: 11px; letter-spacing: .1em;
  text-transform: uppercase; color: var(--muted);
}
.navdrawer__close {
  background: none; border: 0; color: var(--text-2); cursor: pointer;
  font-size: 26px; line-height: 1; padding: 4px 8px;
}
.navdrawer__close:hover { color: var(--text); }

.navdrawer__link {
  display: grid; grid-template-columns: auto 1fr; column-gap: 10px;
  align-items: baseline; padding: 13px 4px;
  font-family: var(--display); font-size: 19px; font-weight: 600; color: var(--text);
  border-bottom: 1px solid var(--border-2);
}
.navdrawer__link em {
  grid-column: 2; font-family: var(--sans); font-style: normal;
  font-size: 12.5px; font-weight: 400; color: var(--muted); margin-top: 2px;
}
.navdrawer__n { font-family: var(--mono); font-size: 11px; color: var(--accent); }
.navdrawer__link--plain {
  grid-template-columns: 1fr; font-size: 15px; font-weight: 500; color: var(--text-2);
  padding: 11px 4px;
}
.navdrawer__link:hover, .navdrawer__link:hover .navdrawer__n { color: var(--accent); }
.navdrawer__rule { height: 14px; }
.navdrawer__cta { margin-top: 16px; justify-content: center; }

@media (max-width: 900px) {
  .nav__toggle { display: inline-flex; }
  /* the two nav CTAs are too much next to a hamburger — Docs lives in
     the drawer at this width, the score CTA stays */
  .nav__cta .btn--ghost { display: none; }
}
@media (min-width: 901px) { .navdrawer { display: none; } }
@media (prefers-reduced-motion: reduce) {
  .navdrawer__scrim, .navdrawer__panel { transition: none; }
}

/* ============================================================
   5. "You are here"
   Enhancement only: with no [data-stage] on <body> every stage
   renders at full strength. Picking one quiets the others — it
   never hides them, so the whole page stays readable.
   ============================================================ */
.stage-pick__opt.is-picked {
  border-color: var(--accent);
  background: var(--accent-tint);
}
.stage-pick__opt.is-picked b { color: var(--accent); }

body[data-stage] [data-stage-section] { transition: opacity .3s var(--ease); }
body[data-stage="1"] [data-stage-section]:not([data-stage-section="1"]),
body[data-stage="2"] [data-stage-section]:not([data-stage-section="2"]),
body[data-stage="3"] [data-stage-section]:not([data-stage-section="3"]),
body[data-stage="4"] [data-stage-section]:not([data-stage-section="4"]) {
  opacity: .58;
}
/* ...and restore it the moment they actually read one */
body[data-stage] [data-stage-section]:hover,
body[data-stage] [data-stage-section]:focus-within { opacity: 1 !important; }

/* the "you are here" marker on the reader's own stage */
body[data-stage="1"] [data-stage-section="1"] .eyebrow::after,
body[data-stage="2"] [data-stage-section="2"] .eyebrow::after,
body[data-stage="3"] [data-stage-section="3"] .eyebrow::after,
body[data-stage="4"] [data-stage-section="4"] .eyebrow::after {
  content: " · you are here";
  color: var(--accent);
}
/* and on the path diagram itself */
body[data-stage="1"] .path__stage:nth-child(1),
body[data-stage="2"] .path__stage:nth-child(2),
body[data-stage="3"] .path__stage:nth-child(3),
body[data-stage="4"] .path__stage:nth-child(4) {
  outline: 2px solid var(--accent); outline-offset: -1px;
}

@media (prefers-reduced-motion: reduce) {
  body[data-stage] [data-stage-section] { transition: none; }
}
