/* A small, skimmable route through the hands-on lessons, and the stamp card that records it. */

/* Stamp art: ghosted until earned, then inked in its own color at a slight hand-stamped tilt. */
.xr-stamp-art { display: block; flex: 0 0 auto; aspect-ratio: 1; }
.xr-stamp-svg { display: block; width: 100%; height: 100%; overflow: visible; }
.xr-stamp-svg text { fill: currentColor; stroke: none; font-family: var(--mono); font-weight: 600; }
.xr-stamp-svg .xr-stamp-date { font-weight: 500; letter-spacing: .08em; }
.xr-stamp-art[data-paint="ghost"] { color: #5f8492; opacity: .6; }
.xr-stamp-art[data-paint="ghost"] .xr-stamp-svg { stroke-dasharray: 3 2.4; }
.xr-stamp-art[data-paint="ghost"] .xr-stamp-svg text { opacity: .7; }
.xr-stamp-art[data-paint^="in"], .xr-award-art {
  color: var(--stamp); transform: rotate(var(--tilt, 0deg));
  filter: drop-shadow(0 0 6px color-mix(in srgb, var(--stamp) 30%, transparent));
}
.is-fresh > .xr-stamp-art, .is-fresh .xr-kit-link > .xr-stamp-art, .xr-award.is-in .xr-award-art { animation: xr-stamp-slam .5s cubic-bezier(.2,.9,.25,1.15) both; }
@keyframes xr-stamp-slam {
  0% { opacity: 0; transform: scale(1.65) rotate(calc(var(--tilt, 0deg) - 9deg)); }
  55% { opacity: 1; transform: scale(.93) rotate(var(--tilt, 0deg)); }
  100% { opacity: 1; transform: scale(1) rotate(var(--tilt, 0deg)); }
}

/* Welcome guide */
.xr-journey {
  margin-top: 22px; padding-top: 20px; border-top: 1px solid #72e5ef35; color: #e6f7fb;
}
.xr-journey-head { display: flex; justify-content: space-between; align-items: end; gap: 18px; margin-bottom: 12px; }
.xr-journey-head h3 { margin: 5px 0 0; color: #e6f7fb; font: 500 20px/1.25 var(--display); }
.xr-journey-progress { flex: 0 0 auto; margin: 0 0 2px; color: #a9c5d0; font: 500 10px/1.4 var(--mono); letter-spacing: .06em; text-transform: uppercase; }
.xr-journey-list { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; list-style: none; margin: 0; padding: 0; }
/* An odd last stop takes the full row instead of leaving a gap. */
.xr-journey-list > .xr-journey-card:last-child:nth-child(odd) { grid-column: 1 / -1; }
.xr-journey-card {
  position: relative; display: grid; grid-template-columns: 50px minmax(0, 1fr); align-items: start; gap: 0 14px;
  min-width: 0; padding: 14px 14px 6px; border: 1px solid #35505d; border-radius: 8px; background: #0b202a;
  transition: border-color .18s ease, background-color .18s ease;
}
.xr-journey-art { grid-row: span 2; width: 50px; margin-top: 2px; }
.xr-journey-copy { min-width: 0; }
.xr-journey-number { display: block; color: #72e5ef; font: 500 10px/1.4 var(--mono); letter-spacing: .1em; text-transform: uppercase; }
.xr-journey-copy h4 { margin: 3px 0 0; color: #e4f7fa; font: 500 14px/1.35 var(--sans); }
.xr-journey-copy p { margin: 6px 0 0; color: #a9c1cc; font: 400 13px/1.55 var(--sans); }
.xr-journey-link {
  grid-column: 2; display: inline-flex; align-items: center; justify-self: start; gap: 7px; min-height: 44px;
  color: #9cf1f7; font: 500 12px/1.4 var(--sans); text-underline-offset: 4px;
}
.xr-journey-link:hover { color: #fff; }
.xr-journey-card.is-complete { border-color: color-mix(in srgb, var(--stamp) 45%, #35505d); background: color-mix(in srgb, var(--stamp) 6%, #0b202a); }
.xr-journey-card.is-complete .xr-journey-number { color: var(--stamp); }
.xr-journey-hint { margin: 12px 0 0; color: #8eabb8; font: 400 11px/1.6 var(--mono); }
.xr-journey :focus-visible { outline: 2px solid #72e5ef; outline-offset: 3px; }
.xr-lesson[id^="xr-journey-"] { scroll-margin-top: 100px; }
.xr-active .xr-welcome { scroll-margin-top: 100px; }
@media (max-width: 699px) {
  .xr-journey { padding-top: 16px; }
  .xr-journey-list { grid-template-columns: 1fr; }
  .xr-journey-head { align-items: start; }
  .xr-journey-head h3 { font-size: 18px; }
}
@media (max-width: 390px) { .xr-journey-head { flex-wrap: wrap; gap: 8px; } }

/* The "Try this" note above each lesson, with the stamp it earns. */
.xr-discovery-note {
  padding: 16px 18px; margin-block: 16px 24px;
  border-left: 2px solid var(--stamp, #72e5ef); border-radius: 0 8px 8px 0; background: #102d38;
}
.xr-discovery-body { display: flex; align-items: center; gap: 18px; }
.xr-discovery-copy { flex: 1 1 auto; min-width: 0; }
.xr-discovery-note p { max-width: 70ch; margin-top: 6px; color: #d4e9ee; font: 400 14px/1.6 var(--sans); }
.xr-discovery-note .xr-discovery-why { margin-top: 12px; color: #abc7d2; font-size: 13px; }
.xr-discovery-why strong { display: block; margin-bottom: 3px; color: #a1e4df; font-weight: 600; }
.xr-discovery-note.is-complete .xr-kicker { color: var(--stamp); }
.xr-note-art { width: 84px; margin-right: 4px; }
@media (max-width: 520px) { .xr-note-art { width: 58px; margin-right: 0; } .xr-discovery-body { gap: 12px; } .xr-discovery-note { padding: 14px 14px 14px 16px; } }

/* Field kit trigger: a signal-strength meter with one bar per stamp, each lit in its stamp's ink. */
.xr-kit-bars { display: inline-flex; align-items: flex-end; gap: 2px; height: 14px; }
.xr-kit-bars i {
  width: 3px; height: calc(4px + var(--i, 1) * 10px); border-radius: 1px; background: #44606c;
  transition: background-color .3s ease, box-shadow .3s ease;
}
.xr-kit-bars i:nth-child(1) { --i: 0; } .xr-kit-bars i:nth-child(2) { --i: .2; } .xr-kit-bars i:nth-child(3) { --i: .4; }
.xr-kit-bars i:nth-child(4) { --i: .6; } .xr-kit-bars i:nth-child(5) { --i: .8; } .xr-kit-bars i:nth-child(n+6) { --i: 1; }
.xr-kit-bars i.is-lit { background: var(--stamp); }
.xr-kit-trigger.is-full .xr-kit-bars i { box-shadow: 0 0 6px color-mix(in srgb, var(--stamp) 60%, transparent); }
.xr-kit-bars i.is-fresh { animation: xr-bar-ping 1.2s ease-out; }
@keyframes xr-bar-ping {
  0% { box-shadow: 0 0 0 0 var(--stamp); }
  40% { box-shadow: 0 0 0 4px color-mix(in srgb, var(--stamp) 25%, transparent); }
  100% { box-shadow: 0 0 0 0 transparent; }
}
.xr-kit-trigger[aria-expanded=true] { border-color: #72e5ef; background: #72e5ef1a; }
.xr-tools :focus-visible { outline: 2px solid #72e5ef; outline-offset: 2px; }

/* Field kit panel: anchored under the bar, never covering more of the page than it needs. */
.xr-kit, .xr-award {
  position: absolute; top: calc(100% + 10px); right: 0; z-index: 1;
  border: 1px solid #35505d; background: #0b1821fa; color: #e6f7fb;
  box-shadow: 0 22px 60px #000a, 0 0 0 1px #72e5ef10;
}
.xr-kit {
  width: 396px; max-width: calc(100vw - 24px); max-height: calc(100svh - 96px); overflow-y: auto; overscroll-behavior: contain;
  background-color: #0b1821;
  padding: 16px 16px 8px; border-radius: 14px;
  background-image: linear-gradient(#72e5ef06 1px, transparent 1px), linear-gradient(90deg, #72e5ef06 1px, transparent 1px);
  background-size: 18px 18px; transform-origin: top right; animation: xr-kit-in .18s ease-out;
}
@keyframes xr-kit-in { from { opacity: 0; transform: translateY(-4px) scale(.985); } }
.xr-kit-head { display: grid; grid-template-columns: minmax(0, 1fr) auto auto; align-items: center; gap: 12px; margin-bottom: 14px; }
.xr-kit-title { margin: 4px 0 0; color: #e6f7fb; font: 500 20px/1.2 var(--display); outline: none; }
.xr-kit-count { margin: 0; color: #87a5b3; font: 500 12px/1 var(--mono); white-space: nowrap; }
.xr-kit-count strong { color: #9cf1f7; font-size: 22px; font-weight: 500; }
.xr-kit-close {
  display: grid; place-items: center; width: 44px; height: 44px; border: 1px solid #35505d; border-radius: 50%;
  background: transparent; color: #c5dde6; font: 22px/1 var(--sans);
}
.xr-kit-close:hover { border-color: #72e5ef; color: #fff; }
.xr-kit-grid { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 6px; list-style: none; margin: 0; padding: 0; }
.xr-kit-link {
  display: grid; justify-items: center; align-content: start; gap: 6px; height: 100%; padding: 12px 4px 10px;
  border: 1px dashed #2f4c58; border-radius: 10px; background: #07151dcc; color: inherit; text-align: center; text-decoration: none;
  transition: border-color .18s ease, background-color .18s ease;
}
.xr-kit-link:hover { border-color: #72e5ef; background: #0d2630; }
.xr-kit-stamp .xr-stamp-art { width: min(74px, 100%); margin-bottom: 2px; }
.xr-kit-name { color: #a9c1cc; font: 600 11.5px/1.25 var(--sans); }
.xr-kit-meta { color: #6f8d9a; font: 500 9px/1.3 var(--mono); letter-spacing: .08em; text-transform: uppercase; }
.xr-kit-stamp.is-earned .xr-kit-link { border-style: solid; border-color: color-mix(in srgb, var(--stamp) 32%, #2f4c58); }
.xr-kit-stamp.is-earned .xr-kit-name { color: #e6f7fb; }
.xr-kit-stamp.is-earned .xr-kit-meta { color: var(--stamp); }
.xr-kit-next {
  margin: 12px 0 0; padding: 10px 12px; border-left: 2px solid #72e5ef; border-radius: 0 6px 6px 0;
  background: #102630; color: #cfe3ea; font: 400 12.5px/1.55 var(--sans);
}
.xr-kit-next .xr-kicker { display: block; margin-bottom: 2px; }
.xr-kit-foot { display: flex; justify-content: space-between; align-items: center; gap: 12px; margin-top: 4px; }
.xr-kit-foot a { display: inline-flex; align-items: center; gap: 6px; min-height: 44px; color: #9cf1f7; font: 500 12px/1.4 var(--sans); text-underline-offset: 4px; }
.xr-kit-foot a:hover { color: #fff; }
.xr-kit-clear {
  min-height: 44px; padding: 0 2px; border: 0; background: none; color: #7c99a6;
  font: 500 10px/1 var(--mono); letter-spacing: .08em; text-transform: uppercase;
}
.xr-kit-clear:hover { color: #c5dde6; }
.xr-kit-clear[data-confirm=true] { color: #ff9b85; }

/* Award card: one line of feedback under the bar, gone after a few seconds. */
.xr-award {
  display: grid; grid-template-columns: 52px minmax(0, 1fr) auto; align-items: center; gap: 12px;
  width: 316px; max-width: calc(100vw - 24px); padding: 10px 10px 10px 12px; border-radius: 12px;
  border-color: color-mix(in srgb, var(--stamp) 40%, #35505d);
  opacity: 0; transform: translateY(-6px); transition: opacity .2s ease, transform .2s ease;
}
.xr-award.is-in { opacity: 1; transform: none; }
.xr-award-art { width: 52px; }
.xr-award-copy { display: grid; gap: 3px; min-width: 0; }
.xr-award-copy .xr-kicker { color: var(--stamp); }
.xr-award-copy strong { color: #e6f7fb; font: 600 14px/1.3 var(--sans); }
.xr-award-open {
  min-height: 44px; padding: 0 12px; border: 1px solid #3e606e; border-radius: 7px;
  background: #102630; color: #d2e7ef; font: 500 12px/1 var(--sans); white-space: nowrap;
}
.xr-award-open:hover { border-color: #72e5ef; background: #163440; }

@media (max-width: 699px) {
  .xr-kit, .xr-award { top: calc(100% + 8px); }
  .xr-kit { max-height: calc(100svh - 160px - env(safe-area-inset-bottom)); padding: 14px 12px 6px; }
  .xr-kit-stamp .xr-stamp-art { width: min(62px, 100%); }
  .xr-kit-trigger { gap: 0; }
}

/* Minimap pips: one small shape per stamp beside its station dot, hollow until stamped.
   Ink mixes toward the bar's own ink so pips read on both the light and dark station skins. */
.minimap-quests { display: none; }
.xr-active .minimap-quests { position: absolute; display: flex; gap: 2px; pointer-events: none; }
.xr-active .minimap-quest {
  --quest: #72e5ef; position: relative; width: 7px; height: 7px;
  background: color-mix(in srgb, var(--quest) 72%, var(--mm-ink)); clip-path: circle(50%);
}
.xr-active .minimap-quest::after { content: ''; position: absolute; inset: 1.5px; background: rgb(var(--mm-bg)); clip-path: inherit; }
.xr-active .minimap-quest.is-complete::after { display: none; }
.xr-active .minimap-quest[data-pip=diamond] { width: 8px; height: 8px; clip-path: polygon(50% 0, 100% 50%, 50% 100%, 0 50%); }
.xr-active .minimap-quest[data-pip=square] { clip-path: inset(0 round 1px); }
.xr-active .minimap-quest[data-pip=tag] { width: 6px; height: 8px; clip-path: inset(0 round 3px); }
.xr-active .minimap-quest[data-pip=hex] { width: 7px; height: 8px; clip-path: polygon(50% 0, 100% 25%, 100% 75%, 50% 100%, 0 75%, 0 25%); }
.xr-active .minimap-quest[data-pip=octagon] { width: 8px; height: 8px; clip-path: polygon(30% 0, 70% 0, 100% 30%, 100% 70%, 70% 100%, 30% 100%, 0 70%, 0 30%); }
.xr-active .minimap-quest[data-pip=diamond]::after, .xr-active .minimap-quest[data-pip=hex]::after,
.xr-active .minimap-quest[data-pip=octagon]::after { inset: 1.8px; }
@media (min-width: 1024px) {
  .xr-active .minimap-quests { top: 3px; right: 1px; flex-direction: column; align-items: center; }
}
@media (max-width: 1023.98px) {
  .xr-active .minimap-quests { top: 6px; left: 50%; transform: translateX(-50%); }
}

@media (prefers-reduced-motion: reduce) {
  .xr-journey-card, .xr-kit-link, .xr-kit-bars i, .xr-award { transition: none; }
  .xr-kit, .is-fresh > .xr-stamp-art, .is-fresh .xr-kit-link > .xr-stamp-art,
  .xr-award.is-in .xr-award-art, .xr-kit-bars i.is-fresh { animation: none; }
}

.xr-sw-engineering strong { color: #d9f3f8; font-weight: 600; }
.xr-lesson .xr-sw-engineering p + p { margin-top: 12px; }
/* A 16px search field avoids Safari zooming the page when the keyboard opens. */
.xr-guide input[type=search] { font-size: 16px; }

/* Give the learning invitation its own full-width row below the introduction. */
.xr-active .xr-welcome { grid-column: 1 / -1; }
@media (min-width: 1024px) {
  .xr-active .xr-welcome { display: grid !important; grid-template-columns: .85fr 1.5fr; align-items: start; gap: 40px; margin-top: 0; padding: 30px; }
  .xr-welcome h2 { font-size: 30px; margin-block: 12px 16px; }
  .xr-welcome .xr-welcome-actions { margin-top: 24px; }
  .xr-journey { margin: 0; padding: 0; border: 0; }
}
