/* Selected Projects and Skills experience. */
body.selected-preview-active { min-width: 0; }
body.selected-preview-active.skills-in-view .back-to-top {
  opacity: 0;
  pointer-events: none;
  transform: translateY(12px);
}

.selected-preview-active .brand,
.selected-preview-active .language-toggle,
.selected-preview-active .nav-menu a,
.selected-preview-active .build-link,
.selected-preview-active .site-footer nav a {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

.selected-preview-active .story-toggle,
.selected-preview-active .back-to-top {
  min-width: 44px;
  min-height: 44px;
}

/* C — Mountain Descent, now grounded with real photography. */
.selected-preview-active .skills {
  min-height: 0;
  padding-bottom: 145px;
}

.selected-preview-active .skills .section-heading {
  max-width: 720px;
  margin-bottom: 42px;
}

.selected-preview-active .skills .section-heading h2 {
  margin-top: 12px;
  color: #172b58;
  font: 700 clamp(28px, 3.4vw, 42px)/1.1 var(--mono);
  letter-spacing: -.05em;
}

.selected-preview-active .skills .eyebrow { color: #2d230e; }

.selected-preview-active .skills .eyebrow::before {
  content: '';
  display: inline-block;
  width: 18px;
  height: 2px;
  margin-right: 10px;
  background: #d6a13a;
  vertical-align: middle;
}

.selected-skills-host,
.selected-skills-host * {
  min-width: 0;
  box-sizing: border-box;
}

.selected-skills-host ol,
.selected-skills-host ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.skills-mountain-descent { position: relative; }

.mountain-caption {
  margin: 0 0 28px;
  color: #203663;
  font: 650 8px/1.4 var(--mono);
  letter-spacing: .1em;
  text-align: center;
  text-transform: uppercase;
}

.mountain-route {
  position: relative;
  display: flow-root;
}

.mountain-route::before {
  content: '';
  position: absolute;
  top: 0;
  bottom: 10px;
  left: 50%;
  width: 3px;
  border-radius: 99px;
  background: linear-gradient(#e6efff, #d5ad48 48%, #3e704d);
  box-shadow: 0 0 0 7px rgba(222, 235, 252, .06);
  transform: translateX(-50%);
}

.mountain-step {
  position: relative;
  width: calc(50% - 42px);
  margin-bottom: 34px;
}

.mountain-step:nth-child(odd) { margin-right: auto; }
.mountain-step:nth-child(even) { margin-left: auto; }

.mountain-marker {
  position: absolute;
  z-index: 3;
  top: 26px;
  display: grid;
  width: 42px;
  height: 30px;
  place-items: center;
  border: 1px solid rgba(242, 205, 92, .34);
  border-radius: 7px;
  background: #314f8a;
  box-shadow: 0 7px 16px rgba(25, 45, 94, .2);
  color: #f1ce61;
  font: 700 9px/1 var(--mono);
}

.mountain-step:nth-child(odd) .mountain-marker { right: -63px; }
.mountain-step:nth-child(even) .mountain-marker { left: -63px; }

.mountain-row {
  position: relative;
  display: block;
  min-height: 205px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid rgba(232, 241, 255, .1);
  border-radius: 23px 23px 10px 10px;
  background: linear-gradient(150deg, rgba(48, 84, 154, .94), rgba(31, 64, 131, .94));
  box-shadow: 0 16px 34px rgba(28, 49, 103, .2);
  content-visibility: visible;
  contain: none;
}

.mountain-row::after {
  content: '';
  position: absolute;
  right: -14%;
  bottom: -37%;
  width: 76%;
  height: 70%;
  background: linear-gradient(145deg, transparent 48%, rgba(224, 235, 255, .045) 49% 53%, transparent 54%);
  pointer-events: none;
}

.mountain-step:nth-child(3) .mountain-row,
.mountain-step:nth-child(4) .mountain-row {
  background: linear-gradient(150deg, rgba(43, 91, 137, .95), rgba(28, 70, 109, .95));
}

.mountain-copy {
  position: relative;
  z-index: 1;
}

.mountain-copy h3 {
  margin: 0;
  color: #f0c858;
  font: 700 9px/1.4 var(--mono);
  letter-spacing: .15em;
}

.mountain-summary {
  margin: 8px 0 18px;
  color: rgba(237, 242, 251, .67);
  font-size: 11px;
  line-height: 1.55;
}

.mountain-copy ul {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
}

.mountain-copy li {
  display: block;
  min-width: 0;
  height: auto;
  padding: 0;
  border-radius: 0;
  background: none;
  box-shadow: none;
  color: inherit;
  font-size: inherit;
  font-weight: inherit;
  white-space: normal;
  transform: none;
  transition: none;
}

.mountain-copy li:hover { background: none; transform: none; }

.tech-brand-link {
  display: flex;
  min-height: 96px;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 10px 5px 8px;
  border: 1px solid rgba(223, 232, 255, .075);
  border-radius: 12px;
  background: rgba(12, 31, 83, .42);
  color: #edf2fb;
  font-size: 9px;
  font-weight: 650;
  line-height: 1.3;
  text-align: center;
  transition: border-color .2s, background .2s, transform .2s;
}

.tech-brand-link[href]:hover {
  border-color: rgba(239, 204, 92, .32);
  background: rgba(20, 48, 112, .78);
  transform: translateY(-2px);
}

.tech-mark {
  display: grid;
  width: 54px;
  height: 40px;
  flex: none;
  place-items: center;
  border: 0;
  background: transparent;
  color: #f1ce60;
}

.tech-mark img {
  display: block;
  width: auto;
  height: auto;
  max-width: var(--mark-w, 34px);
  max-height: var(--mark-h, 34px);
  object-fit: contain;
}

.tech-mark.is-wide {
  width: 70px;
}

.tech-mark.is-wordmark {
  width: 62px;
  height: 30px;
  border: 1px solid rgba(239, 204, 92, .18);
  border-radius: 8px;
  background: rgba(7, 25, 74, .72);
  color: #f1ce60;
  font: 750 8px/1 var(--mono);
  letter-spacing: .04em;
}

.tech-mark.is-generic {
  width: 40px;
  height: 40px;
  border: 1px solid rgba(239, 204, 92, .14);
  border-radius: 10px;
  background: rgba(7, 25, 74, .62);
}

.tech-mark.is-generic svg {
  width: 28px;
  height: 28px;
}

.tech-mark-typescript { --mark-w: 36px; --mark-h: 36px; }
.tech-mark-astro { --mark-w: 66px; --mark-h: 23px; }
.tech-mark-react { --mark-w: 38px; --mark-h: 36px; }
.tech-mark-nextjs { --mark-w: 36px; --mark-h: 36px; }
.tech-mark-nodejs { --mark-w: 35px; --mark-h: 35px; }
.tech-mark-python { --mark-w: 33px; --mark-h: 38px; }
.tech-mark-powershell {
  width: 44px;
  height: 44px;
}
.tech-mark-powershell img {
  width: 42px;
  height: 42px;
  max-width: none;
  max-height: none;
}
.tech-mark-bun { --mark-w: 36px; --mark-h: 34px; }
.tech-mark-jetson {
  width: 70px;
  height: 44px;
}
.tech-mark-jetson img {
  width: 68px;
  height: 42px;
  max-width: none;
  max-height: none;
  object-fit: contain;
}
.tech-mark-cuda {
  width: 58px;
  height: 58px;
}
.tech-mark-cuda img {
  width: 58px;
  height: 58px;
  max-width: none;
  max-height: none;
  border-radius: 8px;
}
.tech-mark-linux { --mark-w: 32px; --mark-h: 37px; }
.tech-mark-claude { --mark-w: 36px; --mark-h: 36px; }
.tech-mark-mcp {
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #f4f3ef;
}
.tech-mark-mcp { --mark-w: 30px; --mark-h: 30px; }
.tech-mark-openclaw {
  --mark-w: 32px;
  --mark-h: 32px;
  width: 40px;
  height: 40px;
  border-radius: 10px;
  background: #fff0df;
}
.tech-mark-openclaw img { image-rendering: pixelated; }
.tech-name {
  display: flex;
  min-width: 0;
  min-height: 2.6em;
  align-items: flex-start;
  justify-content: center;
  overflow-wrap: anywhere;
  text-wrap: balance;
}

.tech-astro .tech-name {
  visibility: hidden;
}

.tech-cuda .tech-name { display: none; }

.brand-credits {
  width: min(760px, 100%);
  margin: 8px auto 0;
  color: #263d6b;
  font-size: 10px;
}

.brand-credits summary {
  width: max-content;
  margin: 0 auto;
  padding: 8px 12px;
  color: #1b3568;
  cursor: pointer;
  font: 700 9px/1.3 var(--mono);
  letter-spacing: .07em;
  text-transform: uppercase;
}

.brand-credit-intro {
  max-width: 620px;
  margin: 8px auto 0;
  text-align: center;
}

.brand-credits ul {
  display: grid;
  gap: 6px;
  margin-top: 9px;
  padding: 16px 18px;
  border: 1px solid rgba(35, 61, 112, .13);
  border-radius: 12px;
  background: rgba(221, 234, 252, .18);
  line-height: 1.55;
}

.brand-credits a {
  color: #153873;
  text-decoration: underline;
  text-underline-offset: 2px;
}

/* Selected project direction D — Firefly Clearing. */
.selected-preview-active .projects { min-width: 0; }

.selected-preview-active .forest-heading {
  max-width: 720px;
  margin-bottom: 44px;
}

.selected-preview-active .chosen-project-title {
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 11px 0 0 !important;
  overflow: visible !important;
  clip: auto !important;
  white-space: normal !important;
  color: #e3ece5;
  font: 700 clamp(30px, 4vw, 48px)/1.08 var(--mono);
  letter-spacing: -.055em;
}

.chosen-project-intro {
  max-width: 620px;
  margin: 17px 0 0;
  color: rgba(218, 233, 222, .62);
  font-size: 14px;
  line-height: 1.7;
}

.chosen-project-host,
.chosen-project-clearing,
.chosen-project-clearing * {
  min-width: 0;
  box-sizing: border-box;
}

.chosen-project-card {
  display: grid;
  width: 100%;
  min-height: 0;
  grid-template-columns: minmax(0, 1.2fr) minmax(300px, .8fr);
  gap: 26px;
  padding: 14px;
  border: 1px solid rgba(230, 202, 104, .1);
  background: rgba(7, 44, 24, .9);
  box-shadow: 0 22px 50px rgba(0, 18, 7, .3);
  content-visibility: visible;
  contain: none;
}

.chosen-project-card .browser-window {
  width: 100%;
  min-height: 0;
  aspect-ratio: 16 / 10;
  align-self: start;
}

.chosen-project-card .project-copy { padding: 26px 22px 26px 0; }

.chosen-project-context {
  order: -1;
  display: block;
  margin: 13px 0 0;
  color: rgba(218, 190, 91, .72);
  font: 700 8px/1.35 var(--mono);
  letter-spacing: .14em;
}

.chosen-project-card .project-link {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
}

.chosen-project-clearing {
  position: relative;
  overflow: hidden;
  padding: 42px;
  border: 1px solid rgba(224, 195, 94, .12);
  border-radius: 48% 48% 24px 24px / 15% 15% 24px 24px;
  background:
    radial-gradient(circle at 50% 18%, rgba(75, 124, 74, .28), transparent 34%),
    radial-gradient(ellipse at 50% 100%, #14552f 0, #0a3e23 49%, #062d19 100%);
  box-shadow: inset 0 18px 60px rgba(2, 22, 11, .24), 0 25px 65px rgba(0, 17, 7, .2);
}

.chosen-project-clearing::before,
.chosen-project-clearing::after {
  content: '';
  position: absolute;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #efd25b;
  box-shadow: 0 0 16px #efce4d, 86px 44px 0 -1px #efd25b, 86px 44px 13px #efce4d, 184px -16px 0 #efd25b, 184px -16px 14px #efce4d;
  opacity: .66;
  animation: selected-firefly 4s ease-in-out infinite alternate;
  pointer-events: none;
}

.chosen-project-clearing::before { top: 62px; left: 42px; }
.chosen-project-clearing::after { right: 230px; bottom: 110px; animation-delay: -2s; }
.chosen-clearing-stage { position: relative; z-index: 1; }
.chosen-clearing-panel[hidden] { display: none; }

.chosen-firefly-tabs {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 22px;
}

.chosen-firefly-tab {
  display: grid;
  min-height: 58px;
  grid-template-columns: 18px 28px 1fr;
  align-items: center;
  padding: 9px 13px;
  border: 1px solid rgba(223, 193, 88, .13);
  border-radius: 13px;
  background: rgba(4, 35, 18, .66);
  color: rgba(221, 234, 224, .6);
  text-align: left;
  cursor: pointer;
  transition: border-color .2s, background .2s, color .2s, transform .2s;
}

.chosen-firefly-tab:hover,
.chosen-firefly-tab[aria-selected='true'] {
  border-color: rgba(238, 203, 84, .42);
  background: rgba(14, 70, 37, .84);
  color: #eef5ef;
  transform: translateY(-2px);
}

.chosen-firefly-tab i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #d4b94e;
  box-shadow: 0 0 12px rgba(235, 207, 86, .72);
}

.chosen-firefly-tab span {
  color: #d9b849;
  font: 700 9px/1 var(--mono);
}

.chosen-firefly-tab strong {
  overflow: hidden;
  font: 700 10px/1.25 var(--mono);
  text-overflow: ellipsis;
  white-space: nowrap;
}

@keyframes selected-firefly {
  to { opacity: .28; transform: translate(9px, -7px); }
}

@media (max-width: 1000px) {
  .tech-brand-link { font-size: 9px; }
  .chosen-project-card { grid-template-columns: 1fr; }
  .chosen-project-card .project-copy { padding: 24px 17px; }
  .chosen-project-clearing { padding: 30px; }
}

@media (max-width: 900px) {
  .mountain-route::before { left: 18px; transform: none; }
  .mountain-step,
  .mountain-step:nth-child(odd),
  .mountain-step:nth-child(even) {
    width: calc(100% - 46px);
    margin-right: 0;
    margin-left: 46px;
  }
  .mountain-step .mountain-marker,
  .mountain-step:nth-child(odd) .mountain-marker,
  .mountain-step:nth-child(even) .mountain-marker {
    right: auto;
    left: -46px;
    width: 36px;
  }
  .mountain-copy ul { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .mountain-row { min-height: 205px; }
}

@media (max-width: 760px) {
  body.selected-preview-active { overflow-x: clip; }
  .selected-preview-active .section-wrap { width: min(calc(100% - 28px), var(--page)); }
  .selected-preview-active .project-card,
  .selected-preview-active .platform-card {
    content-visibility: visible;
    contain: none;
    contain-intrinsic-size: none;
  }

  .selected-preview-active .nav-shell { padding-right: 8px; }
  .selected-preview-active .menu-toggle { width: 44px; height: 44px; margin-left: 0; }
  .selected-preview-active .language-toggle { min-width: 44px; min-height: 44px; justify-content: center; }
  .selected-preview-active .nav-menu a { display: flex; min-height: 44px; align-items: center; }

  .selected-preview-active .skills { padding: 86px 0 112px; }
  .selected-preview-active .skills .section-heading { margin-bottom: 30px; }
  .selected-preview-active .skills .section-heading h2 { font-size: clamp(27px, 9vw, 38px); }
  .hero.story-active .hero-content > :not(.hero-actions) { opacity: 0; }
  .mountain-caption { margin-bottom: 22px; }
  .mountain-route::before { left: 18px; transform: none; }
  .mountain-step,
  .mountain-step:nth-child(odd),
  .mountain-step:nth-child(even) {
    width: calc(100% - 46px);
    margin-right: 0;
    margin-bottom: 25px;
    margin-left: 46px;
  }

  .mountain-step .mountain-marker,
  .mountain-step:nth-child(odd) .mountain-marker,
  .mountain-step:nth-child(even) .mountain-marker {
    top: 22px;
    right: auto;
    left: -46px;
    width: 36px;
    height: 28px;
  }

  .mountain-row { min-height: 0; padding: 19px 15px 20px; }
  .mountain-copy { min-height: 0; }
  .mountain-summary { margin-bottom: 14px; }
  .mountain-copy ul { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .tech-brand-link { min-height: 96px; font-size: 9px; }
  .brand-credits { font-size: 9px; }

  .selected-preview-active .projects { padding-top: 68px; }
  .selected-preview-active .forest-heading { margin-bottom: 34px; }
  .selected-preview-active .chosen-project-title { font-size: clamp(29px, 10vw, 40px); }
  .chosen-project-intro { margin-top: 13px; font-size: 13px; line-height: 1.6; }
  .chosen-project-clearing {
    margin-inline: -4px;
    padding: 20px 12px 16px;
    border-radius: 46% 46% 18px 18px / 8% 8% 18px 18px;
  }

  .chosen-project-card {
    display: flex;
    flex-direction: column;
    gap: 0;
    padding: 9px;
  }

  .chosen-project-card .browser-window { min-height: 0; aspect-ratio: 16 / 10; }
  .chosen-project-card .project-copy { padding: 25px 14px 20px; }
  .chosen-project-card .project-copy p { font-size: 13px; line-height: 1.65; }
  .chosen-firefly-tabs {
    grid-template-columns: repeat(3, minmax(150px, 1fr));
    overflow-x: auto;
    padding: 3px 2px 10px;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
  }
  .chosen-firefly-tabs::-webkit-scrollbar { display: none; }
  .chosen-firefly-tab { min-height: 64px; scroll-snap-align: center; }
  .chosen-firefly-tab strong { text-overflow: clip; white-space: normal; }
}

@media (max-width: 350px) {
  .selected-preview-active .nav-tools { gap: 3px; }
  .selected-preview-active .language-toggle > span[aria-hidden='true'],
  .selected-preview-active .language-toggle .lang-other { display: none; }
  .selected-preview-active .brand { max-width: 94px; }
  .mountain-row { padding-inline: 13px; }
  .tech-brand-link { min-height: 92px; padding-inline: 3px; font-size: 8.5px; }
}

@media (hover: none) {
  .tech-brand-link[href]:hover,
  .chosen-firefly-tab:hover { transform: none; }
}

@media (prefers-reduced-motion: reduce) {
  .chosen-project-clearing::before,
  .chosen-project-clearing::after { animation: none; }
  .tech-brand-link,
  .chosen-firefly-tab { transition: none; }
}
