/* ==========================================================================
   GEO ORBIT — Modular Technical Capabilities Gallery
   Self-contained styles; safe to remove without affecting hero or homepage.
   ========================================================================== */

html.tech-modal-open {
  overflow: hidden;
}

.tech-gallery {
  position: relative;
  isolation: isolate;
  padding-block: 18px 34px;
  overflow: clip;
}

.tech-gallery::before,
.tech-gallery::after {
  content: "";
  position: absolute;
  inset-inline: 0;
  height: 1px;
  pointer-events: none;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .075), transparent);
}

.tech-gallery::before {
  top: 0;
}

.tech-gallery::after {
  bottom: 0;
}

.tech-gallery-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 14px;
}

.tech-gallery-intro {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 18px;
  min-width: 0;
}

.tech-gallery-title {
  font-family: var(--display);
  font-size: clamp(19px, 1.65vw, 23px);
  font-weight: 500;
  line-height: 1.35;
  color: #eceef3;
  margin: 0;
  letter-spacing: -.01em;
}

.tech-gallery-subtitle {
  font-size: 13.5px;
  line-height: 1.65;
  color: #9fa2ab;
  margin: 0;
}

.tech-gallery-hint {
  font-size: 12px;
  line-height: 1.5;
  color: #7e828c;
  white-space: nowrap;
  flex: none;
}

/* Horizontal strip viewport: subtle edge fade into OLED canvas */
.tech-gallery-viewport {
  position: relative;
  direction: ltr;
  width: 100%;
  overflow-x: clip;
  overflow-y: visible;
  padding-block: 14px;
  user-select: none;
  -webkit-user-select: none;
  touch-action: pan-y;
  mask-image: linear-gradient(90deg, transparent 0%, #000 5.5%, #000 94.5%, transparent 100%);
  -webkit-mask-image: linear-gradient(90deg, transparent 0%, #000 5.5%, #000 94.5%, transparent 100%);
}

.tech-gallery-track {
  --gallery-gap: 18px;
  display: flex;
  align-items: center;
  width: max-content;
  will-change: transform;
}

.tech-gallery-group {
  display: flex;
  align-items: center;
  gap: var(--gallery-gap);
  padding-right: var(--gallery-gap);
  flex: none;
}

.tech-gallery-group.is-touch-clone {
  display: none;
}

/* Individual frame card: quiet near-black at rest, silver rim on interaction */
.tech-gallery-item {
  direction: rtl;
  position: relative;
  display: block;
  width: 372px;
  height: 282px;
  padding: 0;
  margin: 0;
  border: 1px solid rgba(255, 255, 255, .085);
  border-radius: 12px;
  background: #060608;
  color: #eceef3;
  text-align: right;
  cursor: pointer;
  user-select: none;
  -webkit-user-select: none;
  -webkit-user-drag: none;
  flex: none;
  overflow: hidden;
  isolation: isolate;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .05),
    0 10px 26px rgba(0, 0, 0, .52);
  transform: translate3d(0, 0, 0) scale(1);
  transition:
    transform 280ms cubic-bezier(.2, .75, .25, 1),
    border-color 220ms var(--ease),
    box-shadow 260ms var(--ease);
}

.tech-gallery-item[data-ratio="4:3"] {
  width: 332px;
}

/* Restrained directional sheen & top silver rim revealed on hover/focus */
.tech-gallery-item::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  z-index: 2;
  opacity: 0;
  background:
    radial-gradient(ellipse 150px 14px at var(--pointer-x, 50%) 0%, rgba(255, 255, 255, .26), transparent 100%),
    linear-gradient(120deg, transparent calc(var(--pointer-x, 50%) - 28%), rgba(255, 255, 255, .045) var(--pointer-x, 50%), transparent calc(var(--pointer-x, 50%) + 22%));
  transition: opacity 220ms var(--ease);
}

.tech-gallery-frame {
  position: relative;
  display: flex;
  flex-direction: column;
  width: 100%;
  height: 100%;
  margin: 0;
  background: #050507;
  pointer-events: none;
}

.tech-gallery-frame img {
  width: 100%;
  height: calc(100% - 44px);
  object-fit: cover;
  display: block;
  flex: none;
  -webkit-user-drag: none;
  user-select: none;
  -webkit-user-select: none;
  pointer-events: none;
  filter: brightness(.93) saturate(.95);
  transition: filter 260ms var(--ease);
}

/* Dedicated slim graphite caption bar so artwork badges remain unobstructed */
.tech-gallery-overlay {
  height: 44px;
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 0 13px;
  border-top: 1px solid rgba(255, 255, 255, .065);
  background: linear-gradient(180deg, #0b0c10, #060608);
  pointer-events: none;
}

.tech-gallery-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  min-width: 0;
  overflow: hidden;
}

.tech-gallery-tag {
  display: none;
}

.tech-gallery-caption {
  font-family: var(--display);
  font-size: 13px;
  font-weight: 500;
  line-height: 1.4;
  color: #dcdfe6;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 200ms var(--ease);
}

.tech-gallery-ActionPill {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 24px;
  height: 24px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .03);
  color: #a6abb6;
  flex: none;
  transition:
    color 200ms var(--ease),
    border-color 200ms var(--ease),
    background 200ms var(--ease);
}

.tech-gallery-ActionPill svg {
  width: 12px;
  height: 12px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.6;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* Desktop fine-pointer interaction & cursor states */
@media (any-hover: hover) and (any-pointer: fine) {
  .tech-gallery-viewport,
  .tech-gallery-item {
    cursor: grab;
  }

  .tech-gallery-viewport.is-grabbing,
  .tech-gallery-viewport.is-grabbing .tech-gallery-item {
    cursor: grabbing;
  }

  .tech-gallery-item:hover,
  .tech-gallery-item:focus-visible {
    z-index: 4;
    transform: translate3d(0, -4px, 0) scale(1.032);
    border-color: rgba(236, 238, 246, .28);
    box-shadow:
      inset 0 1px 0 rgba(255, 255, 255, .2),
      0 18px 42px rgba(0, 0, 0, .78),
      0 0 0 1px rgba(255, 255, 255, .07);
  }

  .tech-gallery-item:hover::after,
  .tech-gallery-item:focus-visible::after {
    opacity: 1;
  }

  .tech-gallery-item:hover .tech-gallery-frame img,
  .tech-gallery-item:focus-visible .tech-gallery-frame img {
    filter: brightness(1.02) saturate(1.01);
  }

  .tech-gallery-item:hover .tech-gallery-caption,
  .tech-gallery-item:focus-visible .tech-gallery-caption {
    color: #ffffff;
  }

  .tech-gallery-item:hover .tech-gallery-ActionPill,
  .tech-gallery-item:focus-visible .tech-gallery-ActionPill {
    color: #f4f6fa;
    border-color: rgba(255, 255, 255, .26);
    background: rgba(255, 255, 255, .08);
  }
}

/* CSS keyframe fallback when JS controller is not active */
@media (any-hover: hover) and (any-pointer: fine) and (prefers-reduced-motion: no-preference) {
  .tech-gallery-track:not(.is-js-marquee) {
    animation: tech-gallery-marquee 56s linear infinite;
  }

  .tech-gallery-viewport:hover .tech-gallery-track:not(.is-js-marquee),
  .tech-gallery-viewport:has(.tech-gallery-item:focus-visible) .tech-gallery-track:not(.is-js-marquee),
  html.tech-modal-open .tech-gallery-track:not(.is-js-marquee) {
    animation-play-state: paused;
  }
}

.tech-gallery-item:focus-visible {
  outline: 2px solid #dedee3;
  outline-offset: 3px;
}

@keyframes tech-gallery-marquee {
  from {
    transform: translate3d(0, 0, 0);
  }
  to {
    transform: translate3d(-50%, 0, 0);
  }
}

/* Native scrolling owns both mobile autoplay and user swipes. */
@media (hover: none), (pointer: coarse) {
  .tech-gallery-viewport {
    direction: rtl;
    overflow-x: auto;
    touch-action: pan-x pan-y;
    scroll-snap-type: none;
    scroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    mask-image: none;
    -webkit-mask-image: none;
    padding-inline: max(20px, calc((100% - var(--content, 1160px)) / 2));
  }

  .tech-gallery-viewport::-webkit-scrollbar {
    display: none;
  }

  .tech-gallery-track {
    gap: var(--gallery-gap);
    animation: none !important;
    transform: none !important;
  }

  .tech-gallery-group {
    padding-right: 0;
  }

  .tech-gallery-group.is-clone {
    display: flex !important;
  }

  .tech-gallery-item {
    scroll-snap-align: start;
  }
}

@media (prefers-reduced-motion: reduce) {
  .tech-gallery-viewport {
    scroll-snap-type: x proximity;
  }
  .tech-gallery-track:not(.is-js-marquee) {
    animation: none !important;
  }
}

/* ==========================================================================
   Detail Overlay (<dialog>)
   ========================================================================== */

.tech-gallery-dialog {
  width: min(1020px, calc(100% - 40px));
  max-height: calc(100dvh - 40px);
  padding: 0;
  margin: auto;
  border: 1px solid rgba(236, 238, 244, .16);
  border-radius: 16px;
  background:
    linear-gradient(125deg, rgba(255, 255, 255, .04), rgba(255, 255, 255, .006) 45%) padding-box,
    linear-gradient(155deg, rgba(11, 12, 15, .96), rgba(5, 5, 7, .985)) padding-box;
  color: #eceef3;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, .12),
    0 28px 80px rgba(0, 0, 0, .86);
  backdrop-filter: blur(20px) saturate(105%);
  -webkit-backdrop-filter: blur(20px) saturate(105%);
  overflow: auto;
}

.tech-gallery-dialog:focus {
  outline: none;
}

.tech-gallery-dialog::backdrop {
  background:
    radial-gradient(ellipse 640px 440px at 50% 45%, rgba(150, 155, 165, .09), transparent 72%),
    rgba(2, 2, 4, .78);
  backdrop-filter: blur(7px);
  -webkit-backdrop-filter: blur(7px);
}

.tech-dialog-shell {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.tech-dialog-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px 22px;
  border-bottom: 1px solid rgba(255, 255, 255, .085);
  background: linear-gradient(110deg, rgba(255, 255, 255, .035), rgba(255, 255, 255, .006));
}

.tech-dialog-badge {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.tech-dialog-index {
  font: 600 11.5px/1 Arial, sans-serif;
  color: #d6d9e0;
  padding: 4px 8px;
  border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, .12);
  background: rgba(255, 255, 255, .04);
  white-space: nowrap;
  flex: none;
}

.tech-dialog-code {
  font: 600 11px/1.3 Arial, sans-serif;
  letter-spacing: .1em;
  color: #9ca0ac;
  text-transform: uppercase;
}

.tech-dialog-close {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 38px;
  padding: 6px 14px;
  border: 1px solid rgba(236, 238, 244, .15);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .08), rgba(255, 255, 255, .02)), rgba(18, 18, 22, .65);
  color: #e2e4ea;
  font-size: 13px;
  line-height: 1.4;
  white-space: nowrap;
  flex: none;
  cursor: pointer;
  transition: border-color 180ms var(--ease), background 180ms var(--ease), color 180ms var(--ease);
}

.tech-dialog-close:hover,
.tech-dialog-close:focus-visible {
  color: #ffffff;
  border-color: rgba(255, 255, 255, .34);
  background: linear-gradient(180deg, rgba(255, 255, 255, .13), rgba(255, 255, 255, .035)), rgba(24, 24, 29, .8);
}

.tech-dialog-close:focus-visible,
.tech-dialog-nav-btn:focus-visible {
  outline: 2px solid #dedee3;
  outline-offset: 3px;
}

.tech-dialog-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.38fr) minmax(290px, .92fr);
  gap: 26px;
  padding: 22px;
  align-items: stretch;
}

.tech-dialog-stage {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 360px;
  max-height: 62dvh;
  padding: 12px;
  border-radius: 12px;
  border: 1px solid rgba(255, 255, 255, .08);
  background:
    radial-gradient(ellipse at 50% 50%, rgba(180, 185, 195, .05), transparent 72%),
    #040406;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .06);
  overflow: hidden;
}

.tech-dialog-stage img {
  width: 100%;
  height: 100%;
  max-height: calc(62dvh - 24px);
  object-fit: contain;
  border-radius: 7px;
  display: block;
}

.tech-dialog-info {
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  gap: 20px;
  padding-block: 4px;
  min-width: 0;
}

.tech-dialog-copy h3 {
  font-family: var(--display);
  font-size: clamp(22px, 2.1vw, 27px);
  font-weight: 500;
  line-height: 1.4;
  color: #f2f4f8;
  margin: 0 0 14px;
}

.tech-dialog-copy p {
  font-size: 14.5px;
  line-height: 1.95;
  color: #b4b7c0;
  margin: 0;
}

.tech-dialog-meta {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .08);
}

.tech-dialog-meta-label {
  display: block;
  font-size: 12px;
  color: #8d919c;
  margin-bottom: 10px;
}

.tech-dialog-keywords {
  list-style: none;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tech-dialog-keywords li {
  font: 500 11.5px/1.4 Arial, sans-serif;
  color: #d6d8df;
  padding: 5px 10px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, .1);
  background: rgba(255, 255, 255, .035);
}

.tech-dialog-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
  border-top: 1px solid rgba(255, 255, 255, .08);
  margin-top: auto;
}

.tech-dialog-nav-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 42px;
  padding: 8px 16px;
  border: 1px solid rgba(236, 238, 244, .14);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255, 255, 255, .07), rgba(255, 255, 255, .015)), rgba(15, 16, 19, .75);
  color: #e2e4ea;
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: border-color 180ms var(--ease), background 180ms var(--ease), color 180ms var(--ease);
}

.tech-dialog-nav-btn:hover {
  color: #ffffff;
  border-color: rgba(255, 255, 255, .32);
  background: linear-gradient(180deg, rgba(255, 255, 255, .12), rgba(255, 255, 255, .03)), rgba(22, 23, 28, .85);
}

.tech-dialog-status {
  font-size: 12.5px;
  color: #989ca6;
  white-space: nowrap;
}

/* ==========================================================================
   Responsive Breakpoints
   ========================================================================== */

@media (max-width: 1080px) {
  .tech-gallery {
    padding-block: 16px 28px;
  }

  .tech-gallery-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 6px;
  }

  .tech-gallery-item {
    width: 336px;
    height: 256px;
  }

  .tech-gallery-item[data-ratio="4:3"] {
    width: 300px;
  }

  .tech-dialog-grid {
    grid-template-columns: 1fr;
    gap: 18px;
  }

  .tech-dialog-stage {
    min-height: 260px;
    max-height: 48dvh;
  }

  .tech-dialog-stage img {
    max-height: calc(48dvh - 24px);
  }
}

@media (max-width: 700px) {
  .tech-gallery {
    padding-block: 14px 24px;
  }

  .tech-gallery-head {
    align-items: stretch;
    direction: rtl;
    text-align: right;
    gap: 8px;
  }

  .tech-gallery-intro {
    flex-direction: column;
    align-items: stretch;
    gap: 6px;
  }

  .tech-gallery-title {
    font-size: 19px;
  }

  .tech-gallery-subtitle {
    font-size: 13px;
  }

  .tech-gallery-hint {
    font-size: 11.5px;
  }

  .tech-gallery-viewport {
    direction: rtl;
    overflow-x: auto;
    touch-action: pan-x pan-y;
    scroll-snap-type: none;
    scroll-behavior: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    mask-image: none;
    -webkit-mask-image: none;
    padding-inline: 20px;
    padding-block: 8px;
  }

  .tech-gallery-track {
    --gallery-gap: 12px;
    gap: var(--gallery-gap);
    animation: none !important;
    transform: none !important;
  }

  .tech-gallery-group {
    padding-right: 0;
  }

  .tech-gallery-group.is-clone {
    display: flex !important;
  }

  .tech-gallery-item,
  .tech-gallery-item[data-ratio="4:3"] {
    width: min(306px, calc(100vw - 56px));
    height: 238px;
    scroll-snap-align: start;
  }

  .tech-gallery-dialog {
    width: calc(100% - 20px);
    max-height: calc(100dvh - 24px);
    border-radius: 14px;
  }

  .tech-dialog-top {
    padding: 12px 16px;
  }

  .tech-dialog-close {
    min-height: 40px;
    padding-inline: 14px;
  }

  .tech-dialog-grid {
    padding: 16px;
    gap: 16px;
  }

  .tech-dialog-stage {
    min-height: 200px;
    max-height: 38dvh;
    padding: 8px;
  }

  .tech-dialog-stage img {
    max-height: calc(38dvh - 16px);
  }

  .tech-dialog-copy h3 {
    font-size: 20px;
    margin-bottom: 10px;
  }

  .tech-dialog-copy p {
    font-size: 13.5px;
    line-height: 1.85;
  }

  .tech-dialog-nav-btn {
    min-height: 44px;
    padding-inline: 16px;
  }
}
