/* ==========================================================================
   PROJECTS: portfolio cards with phone and laptop mockups
   ========================================================================== */

/* ---------- endless horizontal scroll ---------- */
.projects-viewport {
  overflow: hidden;
  padding: 10px 0;
  -webkit-mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  mask-image: linear-gradient(90deg, transparent, #000 6%, #000 94%, transparent);
  cursor: grab;
  /* sideways swipes move the projects, up and down still scrolls the page */
  touch-action: pan-y;
  user-select: none;
  -webkit-user-select: none;
}

.projects-viewport:focus-visible {
  outline: 2px solid rgba(51, 85, 255, .6);
  outline-offset: -2px;
}

.projects-viewport.is-dragging,
.projects-viewport.is-dragging .project-card {
  cursor: grabbing;
}

.projects-viewport img {
  -webkit-user-drag: none;
}

/* moved by js/site/projects.js */
.projects-track {
  display: flex;
  width: max-content;
  will-change: transform;
}

.projects-group {
  display: flex;
  gap: 22px;
  padding-right: 22px;
}

/* ---------- card ---------- */
.project-card {
  flex: none;
  width: 330px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: #0d1426;
  overflow: hidden;
  cursor: zoom-in;
  transition: border-color .3s;
}

.project-card--web {
  width: 560px;
}

.project-card:hover {
  border-color: rgba(51, 85, 255, .45);
}

.project-stage {
  height: 360px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  background:
    radial-gradient(70% 70% at 50% 45%, rgba(51, 85, 255, .22), transparent 70%),
    radial-gradient(50% 50% at 85% 90%, rgba(56, 214, 255, .12), transparent 70%);
}

.project-info {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 18px 22px;
  border-top: 1px solid var(--line);
}

.project-info h3 {
  font-size: 18px;
}

.project-info p {
  color: var(--muted);
  font-size: 13.5px;
  margin-top: 4px;
}

.project-type {
  flex: none;
  font-size: 11.5px;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: #b9bfd3;
}

/* ---------- phone mockup ---------- */
.phones {
  display: flex;
  align-items: center;
}

.phone {
  --phone-width: 146px;
  position: relative;
  width: var(--phone-width);
  aspect-ratio: 9 / 20.5;
  padding: 5px;
  border-radius: 24px;
  background: linear-gradient(145deg, #2c3046, #0a0b14);
  box-shadow: 0 24px 50px -18px rgba(0, 0, 0, .9), inset 0 0 0 1px rgba(255, 255, 255, .14);
}

/* phones stay upright: rotating a screenshot softens its text */
.phone:first-child {
  transform: translateY(-8px);
}

.phone:last-child {
  margin-left: 12px;
  transform: translateY(8px);
}

.phone:before {
  content: "";
  position: absolute;
  top: 10px;
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3px;
  border-radius: 50%;
  background: #070b16;
  z-index: 1;
}

.phone img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top;
  border-radius: 19px;
  background: #fff;
}

/* ---------- laptop mockup ---------- */
.laptop {
  width: 470px;
}

.laptop-lid {
  padding: 9px 9px 11px;
  border-radius: 14px 14px 3px 3px;
  background: linear-gradient(160deg, #2c3046, #0a0b14);
  box-shadow: 0 24px 40px -18px rgba(0, 0, 0, .9), inset 0 0 0 1px rgba(255, 255, 255, .14);
}

.laptop-screen {
  display: flex;
  flex-direction: column;
  aspect-ratio: 16 / 9;
  border-radius: 5px;
  overflow: hidden;
  background: var(--screen-color);
}

.browser-bar {
  flex: none;
  display: flex;
  align-items: center;
  gap: 4px;
  height: 15px;
  padding: 0 7px;
  background: #1b1e30;
}

.browser-bar i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #4b5067;
}

.browser-page {
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.laptop-page {
  display: block;
  width: 100%;
  height: auto;
}

/* a tall page moves from its top to its bottom, then back */
.laptop-page.is-scrolling {
  animation: pageScroll 14s ease-in-out infinite alternate;
}

@keyframes pageScroll {
  0%, 12%   { transform: translateY(0); }
  88%, 100% { transform: translateY(-68%); }
}

.laptop-base {
  position: relative;
  width: 114%;
  height: 12px;
  margin-left: -7%;
  border-radius: 2px 2px 12px 12px;
  background: linear-gradient(180deg, #4b5067, #1b1e30);
}

.laptop-base:before {
  content: "";
  position: absolute;
  top: 0;
  left: 50%;
  width: 64px;
  height: 5px;
  margin-left: -32px;
  border-radius: 0 0 6px 6px;
  background: #0a0b14;
}

/* ---------- full-size view ---------- */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 90;
  display: flex;
  flex-direction: column;
  padding: 18px;
  background: rgba(5, 6, 13, .94);
}

.lightbox[hidden] {
  display: none;
}

body.lightbox-open {
  overflow: hidden;
}

.lightbox-top {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: min(1200px, 100%);
  margin: 0 auto 14px;
}

.lightbox-top h3 {
  font-size: 20px;
}

.lightbox-close {
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  color: var(--text);
  font-size: 22px;
  cursor: pointer;
}

.lightbox-close:hover {
  border-color: rgba(255, 255, 255, .3);
}

.lightbox-images {
  flex: 1;
  min-height: 0;
  overflow: auto;
  display: flex;
  gap: 18px;
  width: min(1200px, 100%);
  margin: 0 auto;
}

.lightbox-images img {
  display: block;
  margin: auto;
  border-radius: 12px;
}

.lightbox-images--web img {
  max-width: 100%;
}

.lightbox-images--mobile img {
  height: 100%;
  border-radius: 18px;
}
