/* ---------- SCREEN GALLERY (Mobbin-style strip) ---------- */

.screen-gallery {
  --sg-ease: cubic-bezier(0.22, 1, 0.36, 1);
  --sg-fade: clamp(48px, 8vw, 120px);
  width: 100%;
  max-width: 100%;
  margin: clamp(36px, 5vw, 64px) 0 clamp(28px, 4vw, 48px);
  padding: 28px 0 36px;
  overflow: hidden;
}

.screen-gallery__head {
  width: 100%;
  max-width: var(--container);
  margin: 0 auto clamp(20px, 3vw, 32px);
  padding-inline: var(--gutter);
  box-sizing: border-box;
}

.screen-gallery__head .sec-head {
  margin-bottom: 0;
}

.screen-gallery__scroller {
  position: relative;
  width: 100%;
  min-width: 0;
  overflow: hidden;
  padding: 20px 0 28px;
  /* Soft edge dissolve — no solid vertical cut */
  -webkit-mask-image: linear-gradient(
    90deg,
    transparent 0,
    #000 var(--sg-fade),
    #000 calc(100% - var(--sg-fade)),
    transparent 100%
  );
  mask-image: linear-gradient(
    90deg,
    transparent 0,
    #000 var(--sg-fade),
    #000 calc(100% - var(--sg-fade)),
    transparent 100%
  );
}

.screen-gallery__scroller--marquee {
  cursor: grab;
}

.screen-gallery__track {
  display: flex;
  width: max-content;
  gap: clamp(20px, 2.8vw, 40px);
  align-items: flex-start;
  will-change: transform;
  animation: sg-marquee var(--sg-marquee-duration, 40s) linear infinite;
}

.screen-gallery__track.is-paused {
  animation-play-state: paused;
}

.screen-gallery__scroller.is-static .screen-gallery__track {
  animation: none;
}

.screen-gallery__scroller.is-static {
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scrollbar-width: none;
  -ms-overflow-style: none;
  scroll-snap-type: x proximity;
  -webkit-overflow-scrolling: touch;
}

.screen-gallery__scroller.is-static::-webkit-scrollbar {
  display: none;
}

.screen-gallery__item {
  flex: 0 0 auto;
  width: min(275px, 72vw); /* +25% vs 220px */
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  position: relative;
  z-index: 0;
  /* Opacity-only entrance — transform fill-mode was fighting hover */
  animation: sg-fade-in 0.85s var(--sg-ease) both;
  transition: transform 0.5s var(--sg-ease);
  transform: translate3d(0, 0, 0);
  cursor: pointer;
}

.screen-gallery__item:nth-child(1) { animation-delay: 0.04s; }
.screen-gallery__item:nth-child(2) { animation-delay: 0.1s; }
.screen-gallery__item:nth-child(3) { animation-delay: 0.16s; }
.screen-gallery__item:nth-child(4) { animation-delay: 0.22s; }
.screen-gallery__item:nth-child(5) { animation-delay: 0.28s; }
.screen-gallery__item:nth-child(6) { animation-delay: 0.34s; }
.screen-gallery__item:nth-child(7) { animation-delay: 0.4s; }
.screen-gallery__item:nth-child(8) { animation-delay: 0.46s; }
.screen-gallery__item:nth-child(9) { animation-delay: 0.52s; }
.screen-gallery__item:nth-child(10) { animation-delay: 0.58s; }
.screen-gallery__item:nth-child(n + 11) { animation-delay: 0.64s; }

.screen-gallery__label {
  margin: 0;
  font-family: var(--font-sans, inherit);
  font-size: 0.9375rem;
  font-weight: 700;
  color: #0f172a;
  text-align: center;
  letter-spacing: -0.01em;
  transition: color 0.35s var(--sg-ease);
}

.screen-gallery__phone {
  width: 100%;
  aspect-ratio: 9 / 19.5;
  border-radius: 32px;
  background: #0f172a;
  padding: 10px;
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.08),
    0 18px 40px -18px rgba(15, 23, 42, 0.35);
  overflow: hidden;
  transition: box-shadow 0.5s var(--sg-ease);
}

.screen-gallery__screen {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: top center;
  border-radius: 24px;
  background: #f1f5f9;
}

/* Lift the whole card (label + frame) so the bezel doesn't get clipped mid-hover */
.screen-gallery__item:hover,
.screen-gallery__item:focus-within {
  z-index: 5;
  transform: translate3d(0, -14px, 0) scale(1.035);
}

.screen-gallery__item:hover .screen-gallery__phone,
.screen-gallery__item:focus-within .screen-gallery__phone {
  box-shadow:
    0 0 0 1px rgba(15, 23, 42, 0.12),
    0 32px 64px -22px rgba(15, 23, 42, 0.48);
}

.screen-gallery__item:hover .screen-gallery__label,
.screen-gallery__item:focus-within .screen-gallery__label {
  color: #020617;
}

@keyframes sg-fade-in {
  from {
    opacity: 0;
  }
  to {
    opacity: 1;
  }
}

@keyframes sg-marquee {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(var(--sg-marquee-distance, -50%), 0, 0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen-gallery__item {
    animation: none;
    transition: none;
  }

  .screen-gallery__track {
    animation: none !important;
  }

  .screen-gallery__label,
  .screen-gallery__phone {
    transition: none;
  }

  .screen-gallery__item:hover,
  .screen-gallery__item:focus-within {
    transform: none;
  }
}

.screen-gallery__phone--empty .screen-gallery__screen {
  display: flex;
  align-items: center;
  justify-content: center;
  background:
    linear-gradient(160deg, #f8fafc 0%, #e2e8f0 100%);
  color: #94a3b8;
  font-size: 0.75rem;
  font-weight: 600;
  text-align: center;
  padding: 16px;
}

@media (max-width: 900px) {
  .screen-gallery {
    --sg-fade: clamp(32px, 10vw, 72px);
  }
}

@media (max-width: 640px) {
  .screen-gallery {
    --sg-fade: 20px;
    margin-block: 28px 24px;
    padding-block: 16px 20px;
  }

  .screen-gallery__item {
    width: min(210px, 70vw);
    scroll-snap-align: center;
  }

  .screen-gallery__phone {
    border-radius: 28px;
    padding: 8px;
  }

  .screen-gallery__screen {
    border-radius: 20px;
  }

  .screen-gallery__label {
    font-size: 0.875rem;
  }

  .screen-gallery__scroller {
    padding-block: 12px 20px;
  }
}

/* ---------- FIELD APP SHOWROOM ---------- */

.screen-gallery {
  --sg-active: #a3e635;
  --sg-x: 74%;
  --sg-y: 42%;
  position: relative;
  isolation: isolate;
  margin-block: 0;
  padding-block: clamp(64px, 8vw, 112px) clamp(54px, 7vw, 92px);
  background:
    linear-gradient(rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    linear-gradient(90deg, rgba(15, 23, 42, 0.035) 1px, transparent 1px),
    radial-gradient(circle at 86% 8%, color-mix(in srgb, var(--sg-active) 9%, transparent), transparent 28%),
    linear-gradient(180deg, #f8faf9 0%, #ffffff 46%, #f6f8f7 100%);
  background-size: 48px 48px, 48px 48px, auto, auto;
  transition: --sg-active 0.6s var(--sg-ease);
}

.screen-gallery::before {
  content: "";
  position: absolute;
  z-index: -1;
  inset: 0;
  pointer-events: none;
  background:
    radial-gradient(
      circle 340px at var(--sg-x) var(--sg-y),
      color-mix(in srgb, var(--sg-active) 12%, transparent),
      transparent 72%
    );
  opacity: 0.85;
  transition: opacity 0.4s var(--sg-ease);
}

.screen-gallery::after {
  content: "FIELD APPLICATIONS · REAL INTERFACES · PRODUCTION SYSTEMS";
  position: absolute;
  right: clamp(28px, 4vw, 72px);
  bottom: 20px;
  color: rgba(15, 23, 42, 0.32);
  font-family: var(--font-mono);
  font-size: 0.6rem;
  font-weight: 600;
  letter-spacing: 0.16em;
  pointer-events: none;
}

.screen-gallery__head {
  display: grid;
  grid-template-columns: minmax(0, 0.95fr) minmax(380px, 0.72fr);
  align-items: end;
  gap: clamp(32px, 6vw, 92px);
  margin-bottom: clamp(26px, 4vw, 48px);
}

.screen-gallery__head .sec-head {
  max-width: 720px;
}

.screen-gallery__selection-note {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  margin: 18px 0 0;
  color: #64748b;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 700;
  letter-spacing: 0.035em;
}

.screen-gallery__selection-note::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--sg-active);
}

.screen-gallery__selection-note span {
  padding: 5px 9px;
  border: 1px solid color-mix(in srgb, var(--sg-active) 30%, rgba(15, 23, 42, 0.08));
  border-radius: 999px;
  color: #334155;
  background: color-mix(in srgb, var(--sg-active) 7%, rgba(255, 255, 255, 0.88));
}

.screen-gallery__brief {
  position: relative;
  display: flex;
  height: 390px;
  min-height: 390px;
  min-width: 0;
  flex-direction: column;
  padding: clamp(20px, 2.4vw, 30px);
  border: 1px solid rgba(15, 23, 42, 0.1);
  border-radius: 24px;
  background:
    linear-gradient(145deg, rgba(255, 255, 255, 0.9), rgba(248, 250, 252, 0.72)),
    radial-gradient(circle at 100% 0%, color-mix(in srgb, var(--sg-active) 16%, transparent), transparent 50%);
  box-shadow:
    0 24px 60px -36px rgba(15, 23, 42, 0.32),
    inset 0 1px 0 rgba(255, 255, 255, 0.9);
  overflow: hidden;
}

.screen-gallery__brief::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 3px;
  background: linear-gradient(90deg, var(--sg-active), color-mix(in srgb, var(--sg-active) 18%, transparent));
  transform-origin: left;
  animation: sg-brief-line 5s var(--sg-ease) infinite;
}

.screen-gallery__brief-top,
.screen-gallery__brief-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  color: #64748b;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
}

.screen-gallery__brief-top b {
  color: var(--sg-active);
  font-size: 0.85rem;
}

.screen-gallery__brief-status {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
}

.screen-gallery__brief-status i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--sg-active);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--sg-active) 13%, transparent);
  animation: sg-status-pulse 2.2s ease-in-out infinite;
}

.screen-gallery__brief-category {
  margin: 24px 0 7px;
  color: var(--sg-active);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 700;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.screen-gallery__brief h3 {
  margin: 0;
  color: #0f172a;
  font-family: var(--font-display);
  font-size: clamp(1.7rem, 2.5vw, 2.7rem);
  line-height: 1.05;
  letter-spacing: -0.045em;
}

.screen-gallery__brief-copy {
  max-width: 55ch;
  min-height: 6.4em;
  margin: 12px 0 0;
  color: #475569;
  font-size: 0.9rem;
  line-height: 1.6;
}

.screen-gallery__brief-tags {
  display: flex;
  min-height: 64px;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 7px;
  margin: 16px 0 22px;
  padding: 0;
  list-style: none;
}

.screen-gallery__brief-tags li {
  padding: 6px 10px;
  border: 1px solid color-mix(in srgb, var(--sg-active) 38%, rgba(15, 23, 42, 0.12));
  border-radius: 999px;
  background: color-mix(in srgb, var(--sg-active) 7%, rgba(255, 255, 255, 0.8));
  color: #334155;
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 600;
}

@media (min-width: 769px) {
  .screen-gallery__brief-tags {
    min-height: 31px;
    flex-wrap: nowrap;
    gap: clamp(4px, 0.45vw, 7px);
  }

  .screen-gallery__brief-tags li {
    flex: 0 1 auto;
    min-width: 0;
    padding-inline: clamp(5px, 0.55vw, 9px);
    font-size: clamp(0.5rem, 0.58vw, 0.6rem);
    text-align: center;
    white-space: nowrap;
  }
}

.screen-gallery__brief-foot {
  margin-top: auto;
  padding-top: 14px;
  border-top: 1px solid rgba(15, 23, 42, 0.08);
  font-size: 0.56rem;
}

.screen-gallery__brief-foot strong {
  color: #0f172a;
  font-size: 0.72rem;
}

.screen-gallery__scroller {
  z-index: 1;
  padding-block: 26px 50px;
}

.screen-gallery__track {
  gap: clamp(18px, 2.3vw, 34px);
  align-items: flex-start;
}

.screen-gallery__item {
  --sg-accent: #10b981;
  width: min(244px, 72vw);
  gap: 12px;
  outline: none;
}

.screen-gallery__label {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  width: 100%;
  min-height: 48px;
  padding: 0 5px;
  color: #0f172a;
  text-align: left;
}

.screen-gallery__label-index {
  color: var(--sg-accent);
  font-family: var(--font-mono);
  font-size: 0.62rem;
  font-weight: 700;
}

.screen-gallery__label-copy {
  display: flex;
  min-width: 0;
  flex-direction: column;
  gap: 3px;
}

.screen-gallery__label-copy strong {
  overflow: hidden;
  font-size: 0.88rem;
  line-height: 1.1;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen-gallery__label-copy small {
  overflow: hidden;
  color: #64748b;
  font-family: var(--font-mono);
  font-size: 0.53rem;
  font-weight: 500;
  letter-spacing: 0.03em;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.screen-gallery__label-state {
  width: 8px;
  height: 8px;
  border: 1px solid color-mix(in srgb, var(--sg-accent) 56%, #cbd5e1);
  border-radius: 50%;
  background: #fff;
  transition: background 0.3s var(--sg-ease), box-shadow 0.3s var(--sg-ease);
}

.screen-gallery__phone {
  position: relative;
  border: 1px solid rgba(15, 23, 42, 0.28);
  background: linear-gradient(145deg, #182033, #020617);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.8),
    0 24px 52px -26px rgba(15, 23, 42, 0.46);
  transition:
    border-color 0.45s var(--sg-ease),
    box-shadow 0.5s var(--sg-ease),
    filter 0.45s var(--sg-ease);
}

.screen-gallery__phone::after {
  content: "";
  position: absolute;
  inset: 0;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: inherit;
  pointer-events: none;
}

.screen-gallery__item:hover,
.screen-gallery__item:focus-visible,
.screen-gallery__item.is-active {
  z-index: 5;
  transform: translate3d(0, -16px, 0) scale(1.035);
}

.screen-gallery__item:hover .screen-gallery__phone,
.screen-gallery__item:focus-visible .screen-gallery__phone,
.screen-gallery__item.is-active .screen-gallery__phone {
  border-color: color-mix(in srgb, var(--sg-accent) 70%, rgba(15, 23, 42, 0.28));
  box-shadow:
    0 0 0 1px color-mix(in srgb, var(--sg-accent) 35%, transparent),
    0 36px 72px -30px color-mix(in srgb, var(--sg-accent) 34%, rgba(15, 23, 42, 0.56));
}

.screen-gallery__item:hover .screen-gallery__label-state,
.screen-gallery__item:focus-visible .screen-gallery__label-state,
.screen-gallery__item.is-active .screen-gallery__label-state {
  background: var(--sg-accent);
  box-shadow: 0 0 0 5px color-mix(in srgb, var(--sg-accent) 16%, transparent);
}

@keyframes sg-brief-line {
  0% { transform: scaleX(0.16); opacity: 0.45; }
  48%, 100% { transform: scaleX(1); opacity: 1; }
}

@keyframes sg-status-pulse {
  0%, 100% { transform: scale(1); opacity: 0.74; }
  50% { transform: scale(1.18); opacity: 1; }
}

@media (max-width: 1050px) {
  .screen-gallery__head {
    grid-template-columns: 1fr;
    align-items: start;
  }

  .screen-gallery__brief {
    max-width: 760px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .screen-gallery__brief::after,
  .screen-gallery__brief-status i {
    animation: none;
  }
}
