:root {
  --gallery-gap: 20px;
  --gallery-radius: 22px;
  --gallery-bg: #edf4ff;
  --gallery-orange: #ff6a2d;
  --gallery-orange-soft: #ff9d4d;
  --gallery-navy: #071a35;
  --gallery-navy-2: #10355a;
  --gallery-surface: #ffffff;
  --gallery-line: rgba(9, 28, 53, 0.09);
  --gallery-shadow: rgba(7, 26, 53, 0.12);
  --gallery-shadow-strong: rgba(7, 26, 53, 0.18);
  --gallery-muted: #516b87;
}

.gallery-page {
  overflow-x: hidden;
  background: var(--gallery-bg);
}

.gallery-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #06182f 0%, #0a2545 38%, #123c68 100%);
  color: #fff;
  isolation: isolate;
}

.gallery-hero-bg {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(rgba(255,255,255,0.05) 1px, transparent 1px), linear-gradient(90deg, rgba(255,255,255,0.05) 1px, transparent 1px);
  background-size: 36px 36px;
  mask-image: linear-gradient(90deg, rgba(0,0,0,0.9), rgba(0,0,0,0.2));
  opacity: 0.8;
}

.gallery-hero-bg .shape {
  position: absolute;
  border-radius: 50%;
  filter: blur(8px);
  opacity: 0.7;
  animation: galleryFloat 12s ease-in-out infinite;
}

.gallery-hero-bg .shape-one {
  width: 320px;
  height: 320px;
  background: rgba(255, 116, 58, 0.18);
  right: -70px;
  top: 60px;
}

.gallery-hero-bg .shape-two {
  width: 380px;
  height: 380px;
  background: rgba(73, 147, 255, 0.14);
  left: -120px;
  bottom: 0;
  animation-delay: 1.5s;
}

.gallery-hero-bg .shape-three {
  width: 220px;
  height: 220px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  right: 18%;
  bottom: 14%;
  background: rgba(255,255,255,0.02);
  animation-delay: 2.5s;
}

.gallery-hero-bg .shape-four {
  width: 160px;
  height: 160px;
  background: rgba(255, 185, 53, 0.12);
  left: 42%;
  top: 40px;
  animation-delay: 3s;
}

.gallery-hero-bg .particle {
  position: absolute;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.9);
  box-shadow: 0 0 16px rgba(255,255,255,0.8);
  animation: galleryPulse 8s ease-in-out infinite;
}

.p-1 { top: 18%; left: 18%; }
.p-2 { top: 25%; right: 26%; animation-delay: 1.8s; }
.p-3 { bottom: 26%; left: 26%; animation-delay: 2.6s; }
.p-4 { bottom: 14%; right: 15%; animation-delay: 3.2s; }
.p-5 { top: 48%; left: 58%; animation-delay: 1.2s; }

.gallery-hero-inner {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  align-items: center;
  min-height: 560px;
  gap: 34px;
}

.gallery-hero-copy {
  max-width: 650px;
}

.gallery-hero-copy .eyebrow {
  display: inline-block;
  margin-bottom: 18px;
  font-size: 12px;
  letter-spacing: 0.25em;
  font-weight: 800;
  text-transform: uppercase;
  color: #ff9b35;
}

.gallery-hero-copy h1 {
  margin: 0;
  font-size: clamp(2.5rem, 5vw, 5rem);
  line-height: 1.05;
  letter-spacing: -0.06em;
}

.gallery-hero-copy p {
  margin: 18px 0 0;
  max-width: 610px;
  font-size: 1.08rem;
  line-height: 1.8;
  color: rgba(221, 233, 247, 0.92);
}

.gallery-hero-badges {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.gallery-hero-badges span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255,255,255,0.18);
  background: rgba(255,255,255,0.06);
  color: #eff5ff;
  font-size: 0.82rem;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

.gallery-hero-visual {
  position: relative;
  min-height: 410px;
  display: grid;
  place-items: center;
}

.hero-svg-scene {
  width: min(100%, 500px);
  height: auto;
  display: block;
  filter: drop-shadow(0 28px 26px rgba(3, 12, 22, 0.24));
  animation: gallerySvgFloat 8s ease-in-out infinite;
}

.hero-scene-main,
.hero-student,
.hero-trainer,
.hero-desks,
.hero-gallery-icons,
.hero-camera,
.hero-particles,
.hero-panel,
.hero-orb {
  transform-origin: center;
}

.hero-scene-main {
  animation: galleryFloatPanel 7.5s ease-in-out infinite;
}

.hero-student-left { animation: galleryStudentLeft 7s ease-in-out infinite; }
.hero-student-right { animation: galleryStudentRight 8s ease-in-out infinite; }
.hero-trainer { animation: galleryTrainer 7.8s ease-in-out infinite; }
.hero-gallery-icons { animation: galleryFloatPanel 8.6s ease-in-out infinite; }
.hero-camera { animation: galleryCamera 8.2s ease-in-out infinite; }
.hero-panel-one { animation: galleryPulsePanel 10s ease-in-out infinite; }
.hero-panel-two { animation: galleryPulsePanel 10s ease-in-out infinite 1.2s; }
.hero-orb-one { animation: galleryOrb 13s ease-in-out infinite; }
.hero-orb-two { animation: galleryOrb 12s ease-in-out infinite 1.8s; }

.hero-panel {
  fill: rgba(255,255,255,0.09);
  stroke: rgba(255,255,255,0.15);
}

.hero-orb {
  fill: rgba(255,255,255,0.08);
  stroke: rgba(255,255,255,0.12);
}

.screen-glow rect {
  animation: galleryScreenGlow 6s ease-in-out infinite alternate;
}

@keyframes gallerySvgFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-10px); }
}

@keyframes galleryFloatPanel {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(0.7deg); }
}

@keyframes galleryStudentLeft {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px) translateX(-4px); }
}

@keyframes galleryStudentRight {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-6px) translateX(4px); }
}

@keyframes galleryTrainer {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-7px); }
}

@keyframes galleryCamera {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-8px) rotate(3deg); }
}

@keyframes galleryPulsePanel {
  0%, 100% { opacity: 0.7; transform: translateY(0); }
  50% { opacity: 1; transform: translateY(-6px); }
}

@keyframes galleryOrb {
  0%, 100% { opacity: 0.5; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.12); }
}

@keyframes galleryScreenGlow {
  0% { opacity: 0.66; }
  100% { opacity: 1; }
}

.gallery-shell {
  padding: 70px 0 90px;
  background: linear-gradient(180deg, #f7fafe 0%, #eef5ff 100%);
}

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

.gallery-header h2 {
  margin: 8px 0 0;
  font-size: clamp(2rem, 3vw, 3rem);
  letter-spacing: -0.05em;
  color: var(--gallery-navy);
}

.gallery-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
  background: rgba(255, 106, 45, 0.1);
  color: var(--gallery-orange);
  border: 1px solid rgba(255, 106, 45, 0.16);
}

.eyebrow-inline {
  color: var(--gallery-orange) !important;
  font-size: 0.75rem;
  text-transform: uppercase;
  letter-spacing: 0.18em;
  font-weight: 800;
}

.eyebrow-inline.light {
  color: rgba(255,255,255,0.9) !important;
}

.gallery-intro {
  max-width: 760px;
  margin: 0 0 30px;
  color: var(--gallery-muted);
  font-size: 1.05rem;
  line-height: 1.8;
}

.gallery-grid {
  columns: 3 300px;
  column-gap: 18px;
}

.gallery-item {
  position: relative;
  display: inline-block;
  width: 100%;
  margin: 0 0 18px;
  break-inside: avoid;
  padding: 0;
  opacity: 0;
  transform: translateY(18px);
  transition: opacity 0.55s ease, transform 0.55s ease;
  animation: revealCard 0.7s cubic-bezier(0.2, 0.8, 0.2, 1) forwards;
  animation-delay: var(--delay, 0ms);
}

.gallery-item.feature,
.gallery-item.wide,
.gallery-item.tall,
.gallery-item.small {
  width: 100%;
}

.gallery-item.is-visible {
  opacity: 1;
  transform: translateY(0);
}

.gallery-card {
  position: relative;
  display: block;
  width: 100%;
  overflow: hidden;
  border: 1px solid var(--gallery-line);
  border-radius: 20px;
  background: var(--gallery-surface);
  box-shadow: 0 12px 30px var(--gallery-shadow);
  cursor: pointer;
  padding: 0;
  transition: transform 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}

.gallery-card img {
  width: 100%;
  height: auto;
  aspect-ratio: 4 / 3;
  object-fit: cover;
  display: block;
  transition: transform 0.45s ease, filter 0.35s ease, opacity 0.35s ease;
}

.gallery-item.feature .gallery-card img {
  aspect-ratio: 4 / 5;
}

.gallery-item.wide .gallery-card img {
  aspect-ratio: 16 / 9;
}

.gallery-item.tall .gallery-card img {
  aspect-ratio: 4 / 6;
}

.gallery-card:hover,
.gallery-card:focus-visible {
  transform: translateY(-4px);
  box-shadow: 0 18px 34px var(--gallery-shadow-strong);
  border-color: rgba(255, 106, 45, 0.22);
}

.gallery-card:hover img,
.gallery-card:focus-visible img {
  transform: scale(1.04);
  filter: brightness(0.96) saturate(1.05);
}

.gallery-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
  background: linear-gradient(180deg, rgba(7, 26, 53, 0.14), rgba(7, 26, 53, 0.72));
  opacity: 0;
  transition: opacity 0.35s ease;
}

.gallery-icon {
  display: inline-grid;
  place-items: center;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  border: 1px solid rgba(255,255,255,0.28);
  backdrop-filter: blur(4px);
  transform: scale(0.85);
  transition: transform 0.35s ease, background 0.35s ease;
}

.gallery-icon i {
  font-size: 1.2rem;
}

.gallery-view-text {
  font-size: 0.73rem;
  font-weight: 800;
  letter-spacing: 0.17em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.35s ease, transform 0.35s ease;
}

.gallery-card:hover .gallery-overlay,
.gallery-card:focus-visible .gallery-overlay {
  opacity: 1;
}

.gallery-card:hover .gallery-icon,
.gallery-card:focus-visible .gallery-icon {
  transform: scale(1);
  background: rgba(255, 123, 71, 0.22);
}

.gallery-card:hover .gallery-view-text,
.gallery-card:focus-visible .gallery-view-text {
  opacity: 1;
  transform: translateY(0);
}

.gallery-empty {
  display: grid;
  place-items: center;
  gap: 14px;
  text-align: center;
  padding: 64px 28px;
  border-radius: 28px;
  background: linear-gradient(135deg, rgba(255,255,255,0.8), rgba(230,240,255,0.8));
  border: 1px solid rgba(9, 28, 53, 0.08);
  box-shadow: 0 18px 38px rgba(9, 28, 53, 0.08);
}

.gallery-empty-icon {
  display: inline-grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 22px;
  background: linear-gradient(145deg, rgba(255, 106, 45, 0.18), rgba(255, 157, 77, 0.14));
  color: var(--gallery-orange);
  font-size: 2rem;
}

.gallery-empty h3 {
  margin: 0;
  color: var(--gallery-navy);
  font-size: clamp(1.5rem, 2vw, 2rem);
}

.gallery-empty p {
  margin: 0;
  color: var(--gallery-muted);
}

.gallery-cta {
  padding: 30px 0 90px;
  background: linear-gradient(180deg, #eef5ff 0%, #f8fbff 100%);
}

.cta-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: clamp(28px, 4vw, 42px);
  background: linear-gradient(135deg, rgba(7,26,53,0.97), rgba(11, 56, 94, 0.98));
  border-radius: 30px;
  border: 1px solid rgba(255,255,255,0.06);
  box-shadow: 0 28px 56px rgba(7,26,53,0.18);
}

.cta-box h3 {
  margin: 12px 0 8px;
  font-size: clamp(1.8rem, 3vw, 2.7rem);
  letter-spacing: -0.04em;
  color: #fff;
}

.cta-box p {
  margin: 0;
  color: rgba(220, 232, 247, 0.9);
  font-size: 1.02rem;
}

.cta-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
}

.btn,
.btn-primary,
.btn-dark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border-radius: 999px;
  padding: 14px 26px;
  font-size: 0.94rem;
  font-weight: 800;
  text-transform: none;
  letter-spacing: 0.02em;
  transition: transform 0.3s ease, box-shadow 0.3s ease, background 0.3s ease, border-color 0.3s ease;
}

.btn-primary {
  background: linear-gradient(135deg, var(--gallery-orange), var(--gallery-orange-soft));
  color: #fff !important;
  box-shadow: 0 18px 28px rgba(255, 106, 45, 0.2);
}

.btn-primary:hover,
.btn-primary:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 26px 36px rgba(255, 106, 45, 0.26);
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.gallery-lightbox.is-open {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.gallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(3, 10, 17, 0.82);
  backdrop-filter: blur(8px);
}

.gallery-lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 1100px);
  max-height: 86vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  background: rgba(9, 20, 32, 0.85);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: 16px;
  box-shadow: 0 30px 60px rgba(0,0,0,0.36);
  padding: 18px 18px 16px;
}

.lightbox-media-wrap {
  width: 100%;
  display: grid;
  place-items: center;
  min-height: 180px;
}

#lightboxImage {
  display: block;
  width: 100%;
  max-width: 100%;
  max-height: 78vh;
  object-fit: contain;
  border-radius: 10px;
  background: rgba(7, 26, 53, 0.3);
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(255,255,255,0.12);
  background: rgba(12, 30, 48, 0.78);
  color: #fff;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.lightbox-close {
  top: 14px;
  right: 14px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  padding: 12px 16px;
  border-radius: 999px;
  font-weight: 700;
}

.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }

.lightbox-close:hover,
.lightbox-nav:hover,
.lightbox-close:focus-visible,
.lightbox-nav:focus-visible {
  background: rgba(255, 106, 45, 0.18);
  border-color: rgba(255, 106, 45, 0.3);
  transform: translateY(-50%) scale(1.02);
}

.lightbox-close:hover,
.lightbox-close:focus-visible {
  transform: scale(1.04);
}

.lightbox-footer {
  color: rgba(255,255,255,0.82);
  font-size: 0.84rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-weight: 700;
}

@media (max-width: 1199px) {
  .gallery-grid {
    columns: 2 290px;
  }
}

@media (max-width: 767px) {
  .gallery-shell {
    padding-top: 58px;
  }

  .gallery-grid {
    columns: 2 220px;
  }

  .cta-box {
    flex-direction: column;
    align-items: flex-start;
  }
}

@media (max-width: 480px) {
  .gallery-grid {
    columns: 1;
  }

  .gallery-lightbox-dialog {
    width: 96vw;
    padding: 16px 10px 14px;
  }

  .lightbox-nav {
    padding: 10px 12px;
    font-size: 0.78rem;
  }
}

@keyframes galleryFloat {
  0%, 100% { transform: translateY(0px); }
  50% { transform: translateY(-12px); }
}

@keyframes galleryPulse {
  0%, 100% { opacity: 0.8; transform: scale(1); }
  50% { opacity: 1; transform: scale(1.15); }
}

@keyframes revealCard {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.btn-dark {
  background: #fff;
  color: var(--gallery-navy) !important;
  border: 1px solid rgba(255,255,255,0.14);
}

.btn-dark:hover,
.btn-dark:focus-visible {
  transform: translateY(-3px);
  box-shadow: 0 18px 26px rgba(5, 18, 35, 0.18);
}

.gallery-lightbox {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: grid;
  place-items: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.gallery-lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}

.gallery-lightbox-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(5, 16, 28, 0.8);
  backdrop-filter: blur(10px);
}

.gallery-lightbox-dialog {
  position: relative;
  z-index: 1;
  width: min(92vw, 1080px);
  max-height: 92vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 26px;
  transform: scale(0.92);
  opacity: 0;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.gallery-lightbox.is-open .gallery-lightbox-dialog {
  transform: scale(1);
  opacity: 1;
}

.lightbox-close,
.lightbox-nav {
  position: absolute;
  border: 1px solid rgba(255,255,255,0.14);
  background: rgba(8, 22, 39, 0.52);
  color: #fff;
  z-index: 5;
  cursor: pointer;
}

.lightbox-close {
  top: 16px;
  right: 16px;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  font-size: 1.2rem;
}

.lightbox-nav {
  top: 50%;
  transform: translateY(-50%);
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 12px 18px;
  border-radius: 999px;
  font-size: 0.9rem;
  font-weight: 700;
}

.lightbox-prev { left: 18px; }
.lightbox-next { right: 18px; }

.lightbox-media-wrap {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  max-height: 82vh;
  width: 100%;
  border-radius: 26px;
  overflow: hidden;
  background: rgba(255,255,255,0.02);
  box-shadow: 0 26px 72px rgba(0,0,0,0.35);
}

.lightbox-media-wrap img {
  display: block;
  max-width: 100%;
  max-height: 82vh;
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 26px;
  background: rgba(255,255,255,0.05);
}

.lightbox-footer {
  position: absolute;
  left: 50%;
  bottom: 20px;
  transform: translateX(-50%);
  padding: 10px 16px;
  border-radius: 999px;
  background: rgba(8, 22, 39, 0.56);
  color: #fff;
  font-weight: 700;
  letter-spacing: 0.08em;
}

@keyframes galleryFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-18px); }
}

@keyframes galleryPulse {
  0%, 100% { opacity: 0.3; transform: scale(0.9); }
  50% { opacity: 1; transform: scale(1.2); }
}

@keyframes galleryCardFloat {
  0%, 100% { transform: rotate(4deg) translateY(0); }
  50% { transform: rotate(4deg) translateY(-14px); }
}

@keyframes revealCard {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (max-width: 1100px) {
  .gallery-hero-inner { grid-template-columns: 1fr; min-height: auto; padding: 70px 0 60px; }
  .gallery-hero-copy { max-width: 100%; }
  .gallery-hero-visual { min-height: 320px; }
  .gallery-grid { columns: 2 290px; }
  .cta-box { flex-direction: column; align-items: flex-start; }
}

@media (max-width: 760px) {
  .gallery-hero-copy h1 { max-width: 540px; }
  .gallery-hero-badges { gap: 10px; }
  .gallery-shell { padding-top: 72px; }
  .gallery-header { align-items: flex-start; flex-direction: column; }
  .gallery-grid { columns: 2 200px; }
  .lightbox-nav { top: auto; bottom: 24px; }
  .lightbox-prev { left: 16px; }
  .lightbox-next { right: 16px; }
  .lightbox-close { top: 12px; right: 12px; }
  .gallery-lightbox-dialog { width: min(94vw, 900px); }
}

@media (max-width: 480px) {
  .gallery-hero-inner { padding: 54px 0 46px; }
  .gallery-hero-badges span { padding: 8px 12px; }
  .gallery-grid { columns: 1; }
  .gallery-card { border-radius: 18px; }
  .cta-box { border-radius: 22px; }
  .cta-actions { width: 100%; }
  .cta-actions .btn,
  .cta-actions .btn-primary,
  .cta-actions .btn-dark { width: 100%; }
  .lightbox-nav { padding: 10px 12px; font-size: 0.76rem; }
  .lightbox-nav span { display: none; }
  .lightbox-close { width: 42px; height: 42px; }
  .lightbox-footer { bottom: 18px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
