/* ═══════════════════════════════════════════════════════════════
   Work page — portfolio-as-software aesthetic
   ═══════════════════════════════════════════════════════════════ */

.page-work { --mono: 'JetBrains Mono', ui-monospace, monospace; }

/* ───── Sidebar — filter chips (override) ───── */
.work-side__chips {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

/* ───── Horizontal filter bar (above cards) ───── */
.work-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 28px;
}
.work-filter .work-chip {
  width: auto;
  gap: 10px;
}
@media (max-width: 640px) {
  .work-filter { gap: 6px; }
  .work-filter .work-chip { padding: 8px 12px; font-size: 12px; }
}
.work-chip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: 1px solid var(--gray-100);
  border-radius: 10px;
  font-family: var(--mono);
  font-size: 13px;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  transition: all .2s;
}
.work-chip:hover {
  background: var(--cream);
  border-color: var(--gray-300);
}
.work-chip.is-active {
  background: var(--text);
  color: var(--yellow);
  border-color: var(--text);
}
.work-chip__count {
  font-size: 10px;
  padding: 3px 8px;
  border-radius: 999px;
  background: var(--gray-100);
  color: var(--gray-500);
  min-width: 24px;
  text-align: center;
}
.work-chip:hover .work-chip__count {
  background: var(--white);
  color: var(--text);
}
.work-chip.is-active .work-chip__count {
  background: var(--yellow);
  color: var(--text);
}

.work-side__view {
  display: flex;
  gap: 6px;
}
.view-btn {
  flex: 1;
  padding: 8px;
  background: transparent;
  border: 1px solid var(--gray-100);
  border-radius: 8px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
  cursor: pointer;
  transition: all .2s;
}
.view-btn:hover { background: var(--cream); }
.view-btn.is-active {
  background: var(--text);
  color: var(--yellow);
  border-color: var(--text);
}

/* ───── Repo cards grid ───── */
.repo-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 22px;
}
.repo-grid.is-list {
  grid-template-columns: 1fr;
}
.repo-grid.is-list .repo-card__preview { display: none; }

.repo-card {
  background: var(--white);
  border: 1px solid var(--gray-100);
  border-radius: 16px;
  padding: 22px;
  position: relative;
  overflow: hidden;
  transition: transform .3s cubic-bezier(.16,1,.3,1), box-shadow .3s, border-color .3s;
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.repo-card:hover {
  border-color: var(--purple);
  box-shadow: 0 24px 50px rgba(139,168,136,.18);
}
.repo-card.is-hidden { display: none; }

.repo-card__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.repo-card__name {
  font-family: var(--mono);
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.2;
}
.repo-card__name strong { font-weight: 800; font-size: 17px; }
.repo-card__org {
  color: var(--gray-500);
  font-weight: 500;
  margin-right: 2px;
}
.repo-card__status {
  font-family: var(--mono);
  font-size: 11px;
  font-weight: 700;
  padding: 4px 10px;
  border-radius: 999px;
  letter-spacing: 0.04em;
  white-space: nowrap;
}
.repo-card__status--live {
  background: rgba(22,199,132,.14);
  color: #0f8e5f;
}
.repo-card__status--wip {
  background: rgba(255,238,88,.3);
  color: #8a7710;
}
.repo-card__status--rnd {
  background: rgba(139,168,136,.18);
  color: var(--purple-dark);
}

.repo-card__desc {
  margin: 0;
  font-size: 14px;
  color: var(--gray-700);
  line-height: 1.55;
}

.repo-card__preview {
  height: 160px;
  border-radius: 12px;
  overflow: hidden;
  display: grid;
  place-items: center;
  padding: 14px;
  position: relative;
}
.repo-card__preview-frame {
  width: 100%;
  background: var(--white);
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 8px 18px rgba(0,0,0,.18);
  transform: rotate(-1deg);
  transition: transform .35s;
}
.repo-card:hover .repo-card__preview-frame { transform: rotate(0); }
.rpv-bar {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 10px;
  background: #f5f5f0;
  border-bottom: 1px solid #e0e0d8;
}
.rpv-bar span {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: #ccc;
}
.rpv-bar span:nth-child(1) { background: #ff5f57; }
.rpv-bar span:nth-child(2) { background: #ffbd2e; }
.rpv-bar span:nth-child(3) { background: #28c941; }
.rpv-url {
  margin-left: 6px;
  font-family: var(--mono);
  font-size: 10px;
  color: var(--gray-500);
}
.rpv-body {
  padding: 18px 12px;
  text-align: center;
}
.rpv-title {
  font-size: 16px;
  font-weight: 800;
  letter-spacing: -0.01em;
  margin-bottom: 8px;
  color: var(--text);
}
.rpv-title--dark { color: var(--text); }
.rpv-cta {
  width: 80px; height: 22px;
  background: var(--purple);
  border-radius: 999px;
  margin: 0 auto;
}
.rpv-cta--dark { background: var(--text); }

.repo-card__preview-frame--code .rpv-code {
  padding: 16px;
  background: #1a2218;
  color: #d9e5d6;
  font-family: var(--mono);
  font-size: 11px;
  line-height: 1.5;
  white-space: pre;
  overflow: hidden;
  text-align: left;
}

.repo-card__tech {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  font-family: var(--mono);
  font-size: 12px;
  font-weight: 600;
  color: var(--gray-700);
}
.lang-dot {
  display: inline-block;
  width: 11px; height: 11px;
  border-radius: 50%;
  background: var(--c, var(--purple));
  margin-right: 4px;
  vertical-align: middle;
  box-shadow: 0 0 0 1px rgba(0,0,0,.06);
}

.repo-card__foot {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  padding-top: 12px;
  border-top: 1px dashed var(--gray-300);
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gray-500);
  margin-top: auto;
}
.repo-card__metric {
  display: inline-flex;
  align-items: center;
  font-weight: 700;
  color: var(--purple-dark);
}
.repo-card__year {
  margin-left: auto;
  color: var(--gray-500);
}

/* ───── Ship Log ───── */
.ship-log {
  padding: 100px 0;
  background: var(--cream);
}
.ship-log__head {
  text-align: center;
  margin-bottom: 50px;
}
.ship-log__head h2 {
  font-size: clamp(32px, 5vw, 52px);
  font-weight: 800;
  letter-spacing: -0.03em;
  margin: 10px 0 12px;
}
.ship-log__head p {
  color: var(--gray-700);
  font-size: 17px;
  max-width: 560px;
  margin: 0 auto;
}

.ship-log__list {
  max-width: 760px;
  margin: 0 auto;
  position: relative;
}
.ship-log__list::before {
  content: "";
  position: absolute;
  top: 22px; bottom: 22px;
  left: 70px;
  width: 2px;
  background: var(--gray-300);
}

.ship-log__item {
  display: grid;
  grid-template-columns: 100px 1fr auto;
  align-items: start;
  gap: 16px;
  padding: 18px 22px;
  position: relative;
  background: var(--white);
  border-radius: 14px;
  margin-bottom: 14px;
  border: 1px solid var(--gray-100);
  transition: transform .3s, box-shadow .3s;
}
.ship-log__item:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow);
}
.ship-log__item::before {
  content: "";
  position: absolute;
  left: -8px; top: 32px;
  width: 16px; height: 16px;
  border-radius: 50%;
  background: var(--purple);
  border: 3px solid var(--cream);
  z-index: 1;
}
.ship-log__hash {
  font-family: var(--mono);
  font-size: 12px;
  color: var(--gray-500);
  font-weight: 700;
  padding: 4px 8px;
  background: var(--gray-100);
  border-radius: 6px;
  text-align: center;
  align-self: start;
  margin-top: 2px;
}
.ship-log__body strong {
  display: block;
  font-size: 15px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 4px;
  line-height: 1.4;
}
.ship-log__body small {
  font-size: 13px;
  color: var(--gray-700);
  line-height: 1.5;
}
.ship-log__when {
  font-family: var(--mono);
  font-size: 11px;
  color: var(--gray-500);
  white-space: nowrap;
  padding-top: 4px;
}
.ship-log__tag {
  display: inline-block;
  font-family: var(--mono);
  font-size: 10px;
  font-weight: 800;
  padding: 2px 8px;
  border-radius: 4px;
  letter-spacing: 0.06em;
  margin-right: 8px;
  vertical-align: middle;
}
.ship-log__tag--ship      { background: rgba(22,199,132,.14); color: #0f8e5f; }
.ship-log__tag--deploy    { background: rgba(80,58,168,.14); color: var(--purple-dark); }
.ship-log__tag--design    { background: rgba(246,207,244,.5); color: #a14da0; }
.ship-log__tag--refactor  { background: rgba(255,238,88,.3); color: #8a7710; }

/* ───── Stack Distribution ───── */
.stack-dist {
  padding: 80px 0 100px;
}
.stack-dist__bar {
  display: flex;
  height: 22px;
  border-radius: 999px;
  overflow: hidden;
  max-width: 880px;
  margin: 0 auto 28px;
  background: var(--gray-100);
}
.stack-dist__bar span {
  position: relative;
  height: 100%;
  transition: filter .25s, transform .25s;
}
.stack-dist__bar span:hover {
  filter: brightness(1.1);
  transform: scaleY(1.15);
}
.stack-dist__bar span::after {
  content: attr(data-tip);
  position: absolute;
  bottom: calc(100% + 8px);
  left: 50%;
  transform: translateX(-50%) scale(0);
  background: var(--text);
  color: var(--cream);
  padding: 5px 12px;
  border-radius: 6px;
  font-family: var(--mono);
  font-size: 11px;
  white-space: nowrap;
  transition: transform .15s ease-out;
  transform-origin: bottom center;
  pointer-events: none;
}
.stack-dist__bar span:hover::after { transform: translateX(-50%) scale(1); }

.stack-dist__legend {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 18px;
  font-family: var(--mono);
  font-size: 13px;
  color: var(--gray-700);
}
.legend {
  display: inline-flex;
  align-items: center;
  gap: 4px;
}
.legend strong {
  margin-left: 6px;
  color: var(--text);
  font-weight: 800;
}

/* ───── Responsive ───── */
@media (max-width: 1080px) {
  .repo-grid { grid-template-columns: 1fr; }
  .work-side .svc-side__inner { display: block; }
  .work-side { position: static; }
}
@media (max-width: 720px) {
  .repo-card { padding: 18px; }
  .ship-log__list::before { left: 18px; }
  .ship-log__item {
    grid-template-columns: 60px 1fr;
    gap: 12px;
  }
  .ship-log__item::before { left: -4px; top: 24px; width: 12px; height: 12px; }
  .ship-log__when { grid-column: 2; padding-top: 0; font-size: 10px; }
  .repo-card__head { flex-direction: column; align-items: flex-start; }
}

/* Screenshot inside a browser-frame preview — landscape aspect */
.repo-card__preview--shot {
  height: auto;
  aspect-ratio: 16 / 9;
  padding: 14px;
}
.repo-card__preview--shot .repo-card__preview-frame {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.rpv-shot {
  display: block;
  width: 100%;
  flex: 1 1 auto;
  min-height: 0;
  object-fit: cover;
  object-position: top center;
}

/* Auto-rotating image carousel inside a browser-frame preview */
.rpv-carousel {
  position: relative;
  flex: 1 1 auto;
  min-height: 0;
  overflow: hidden;
  background: #0e1310;
}
.rpv-carousel__slide {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity .8s ease, transform 3s ease;
  pointer-events: none;
}
.rpv-carousel__slide.is-active {
  opacity: 1;
  transform: scale(1);
}
.rpv-carousel__dots {
  position: absolute;
  bottom: 10px;
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  gap: 6px;
  z-index: 2;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .35);
  backdrop-filter: blur(6px);
}
.rpv-carousel__dots span {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .35);
  transition: background .3s ease, width .3s ease;
}
.rpv-carousel__dots span.is-active {
  background: #fff;
  width: 18px;
  border-radius: 3px;
}
