/* --------------------------------------------------------------------------
   Experience (index.html #experience): a tape measure with the roles' lanyard
   badges clipped to it. Two of the drafts in .claude/experience-drafts/
   combined (the tape to scale, the badges), static, no script.

   The tape runs newest first, one tick a month from Sep 2026 back to
   Jan 2025, so reading order and drawing order agree. Under it, each role's
   span in its colour, and each badge hangs from its own span on one straight
   string (the badge's ::after). The badges sit in equal thirds with no grid
   gap (their spacing is margin), so each string drops at 3.5, 10.5 and 17.5
   months of the 21, inside its role's span. Below 760px the badges stack
   and the strings go; the coloured spans stay to scale.

   Each role wears one of the day's three --graph-* colours, which
   js/palette.js measures to 4.5:1 against the page ground, so --bg text on
   them clears 4.5:1 too.
   -------------------------------------------------------------------------- */
.xp__tape { margin: 8px 0 0; }
.xp__rule {
  display: flex;
  height: 30px;
  border: 1px solid var(--line-strong);
  border-radius: 3px;
  /* A tick a month along the top edge, a long one every three months. */
  background:
    repeating-linear-gradient(90deg, var(--ink-soft) 0 1px, transparent 1px calc(100% / 7)) 0 0 / 100% 12px no-repeat,
    repeating-linear-gradient(90deg, var(--ink-muted) 0 1px, transparent 1px calc(100% / 21)) 0 0 / 100% 7px no-repeat,
    var(--surface);
}
.xp__rule span {
  display: flex;
  flex-basis: 0;
  align-items: flex-end;
  padding: 0 0 4px 6px;
  color: var(--ink-muted);
  font: 500 11px/1 var(--font-mono);
  letter-spacing: 0.08em;
}
.xp__rule span + span { border-left: 2px solid var(--ink); }
.xp__spans { display: flex; gap: 3px; height: 6px; margin-top: 3px; }
.xp__spans span { flex-basis: 0; border-radius: 3px; background: var(--c); }

.xp__roles {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  margin: var(--xp-drop) 0 0;
  padding: 0;
  list-style: none;
}
.xp__roles { --xp-drop: 56px; }
.xp__badge {
  position: relative;
  display: flex;
  flex-direction: column;
  margin: 0 12px;
  padding: 0 20px 20px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: var(--surface);
  box-shadow: var(--shadow-card);
}
.xp__badge:first-child { margin-left: 0; }
.xp__badge:last-child { margin-right: 0; }
/* The punched slot the clip goes through. */
.xp__badge::before {
  content: '';
  align-self: center;
  width: 46px;
  height: 8px;
  margin: 12px 0 0;
  border-radius: 4px;
  background: var(--bg-sunken);
  box-shadow: inset 0 1px 2px rgb(0 0 0 / 0.3);
}
/* The string: straight down from the role's span to the slot's middle. */
.xp__badge::after {
  content: '';
  position: absolute;
  left: 50%;
  top: calc(-1 * var(--xp-drop) - 1px);
  width: 2px;
  height: calc(var(--xp-drop) + 17px);
  translate: -50% 0;
  border-radius: 1px;
  background: var(--c);
}
.xp__co {
  margin: 14px -20px 16px;
  padding: 10px 20px;
  background: var(--c);
  color: var(--bg);
  font: 600 13px/1.3 var(--font-mono);
  letter-spacing: 0.06em;
  text-transform: uppercase;
}
.xp__role { margin: 0; color: var(--ink); font: 400 22px/1.2 var(--font-serif); }
.xp__when { margin: 6px 0 14px; color: var(--ink-muted); font: 400 12px/1.4 var(--font-mono); }
.xp__lines {
  margin: 0;
  padding-left: 1em;
  list-style: disc;
  color: var(--ink-body);
  font: 400 14.5px/1.5 var(--font-serif);
}
.xp__lines li + li { margin-top: 6px; }
.xp__lines li::marker { color: var(--c); }
.xp__case {
  align-self: flex-start;
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  margin-top: auto;
  padding-top: 14px;
  color: var(--link);
  font: 500 13px/1.3 var(--font-mono);
  text-underline-offset: 0.2em;
}
.xp__case::after { content: ' \2192'; white-space: pre; }
.xp__case:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }


/* A badge swings once on its string, from the tape, when pointed at. */
@media (prefers-reduced-motion: no-preference) {
  .js .xp__badge { transform-origin: 50% calc(-1 * var(--xp-drop)); }
  .js .xp__badge:hover { animation: xp-swing 1.4s ease-in-out; }
}
@keyframes xp-swing { 25% { rotate: 1.5deg; } 60% { rotate: -1deg; } 85% { rotate: 0.3deg; } }

/* Below 900px the badges are a row you swipe under the tape (as the
   project tiles, css/style.css §7); the strings no longer line up, so go. */
@media (max-width: 899.98px) {
  .xp__badge::after { display: none; }
  .xp__roles {
    display: flex;
    gap: 14px;
    margin: 20px calc(-1 * var(--gap-lg)) 0;
    padding: 2px var(--gap-lg) 12px;
    overflow-x: auto;
    scroll-snap-type: x mandatory;
    scroll-padding-inline: var(--gap-lg);
    scrollbar-width: none;
  }
  .xp__badge { flex: 0 0 min(84%, 360px); margin: 0; scroll-snap-align: start; }
}
