/* ── Reset & Base ─────────────────────────────────── */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

body {
  background: #060608;
  font-family: Lato, monospace;
  overflow-x: hidden;
  overflow-y: auto;
  min-height: 100vh;
}

/* Page wrapper — provides height context for absolute-positioned testimonial */
.page-wrap {
  position: relative;
  width: 100%;
  /* Tall enough to contain the nav ring + testimonial carousel below it */
  min-height: calc(50vh + min(90vw, 90vh, 480px) / 2 + 350px);
}

/* ── Hero text ────────────────────────────────────── */
/* Skip link for keyboard accessibility - only visible when focused */
.skip-link {
  position: absolute;
  top: -40px;
  left: 0;
  background: #fff;
  color: #000;
  padding: 8px 16px;
  text-decoration: none;
  border-radius: 0 0 4px 0;
  z-index: 10000;
  font-weight: bold;
  transition: top 0.2s;
}

.skip-link:focus {
  top: 0;
}

.hero {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 30vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.6rem;
  pointer-events: none;
  z-index: 10;
}

.hero h1 {
  margin: 0;
  font-family: 'Roboto Serif', serif;
  font-size: clamp(1.8rem, 7vw, 4rem);
  font-weight: 600;
  color: #fff;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  text-align: center;
  opacity: 0;
  animation: heroFadeIn 0.5s ease forwards;
}

.hero h4 {
  margin: 0;
  font-family: Lato, monospace;
  font-size: clamp(0.65rem, 1.6vw, 1.2rem);
  font-weight: 600;
  color: rgba(255,255,255,0.5);
  letter-spacing: 0.25em;
  text-transform: uppercase;
  text-align: center;
  opacity: 0;
  animation: heroFadeIn 3s ease forwards;
  animation-delay: 0.75s;
}

@keyframes heroFadeIn {
  from { opacity: 0; }
  to   { opacity: 1; }
}

.hero-social {
  display: flex;
  gap: 1rem;
  margin-top: 0.8rem;
  pointer-events: auto;
}

.hero-social a {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  transition: all 0.25s ease;
  text-decoration: none;
}

.hero-social a:hover {
  background: rgba(255,255,255,0.18);
  border-color: rgba(255,255,255,0.4);
  transform: translateY(-2px);
}

/* Focus indicators for accessibility - only visible when keyboard navigating */
.hero-social a:focus-visible {
  outline: 2px solid rgba(255,255,255,0.8);
  outline-offset: 2px;
}

button:focus-visible,
.modal-close:focus-visible {
  outline: 2px solid rgba(255,255,255,0.8);
  outline-offset: 2px;
}

input:focus-visible,
textarea:focus-visible {
  outline: 2px solid rgba(255,255,255,0.6);
  outline-offset: 1px;
}

.hero-social svg {
  width: 18px;
  height: 18px;
  fill: rgba(255,255,255,0.7);
  transition: fill 0.25s ease;
}

.hero-social a:hover svg {
  fill: #fff;
}

/* Mobile: top-align hero section */
@media (max-width: 768px) {
  .hero {
    height: auto;
    justify-content: flex-start;
    padding-top: 2rem;
  }
}

/* ── Background video ─────────────────────────────── */
#bg-video {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
  z-index: -1;
  pointer-events: none;
}

/* ── Vignette ─────────────────────────────────────── */
/*
  VIGNETTE CONTROLS — adjust these four variables:
    --v-top      : how far the dark edge reaches from the top    (0% = none, 100% = full height)
    --v-bottom   : how far the dark edge reaches from the bottom
    --v-left     : how far the dark edge reaches from the left
    --v-right    : how far the dark edge reaches from the right
*/
#vignette {
  --v-top:    40%;
  --v-bottom: 40%;
  --v-left:   30%;
  --v-right:  30%;

  position: fixed;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background: radial-gradient(
    ellipse at center,
    transparent 0%,
    transparent 30%,
    rgba(0,0,0,0.85) 100%
  );
  /* Override radial with a multi-stop linear approach using the CSS vars */
  background:
    linear-gradient(to bottom,
      rgba(0,0,0,0.85) 0%,
      transparent var(--v-top),
      transparent calc(100% - var(--v-bottom)),
      rgba(0,0,0,0.85) 100%
    ),
    linear-gradient(to right,
      rgba(0,0,0,0.85) 0%,
      transparent var(--v-left),
      transparent calc(100% - var(--v-right)),
      rgba(0,0,0,0.85) 100%
    );
}

/* ── Menu Container ───────────────────────────────── */
.menu-wrap {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: min(90vw, 90vh, 480px);
  aspect-ratio: 1;
  z-index: 2;
  overflow: visible;
}

#nav_menu {
  width: 100%;
  height: 100%;
  display: block;
  overflow: visible;
  cursor: pointer;
}

/* ── Spin keyframes ───────────────────────────────── */
@keyframes spin-cw {
  from { transform: scale(1) rotate(0deg);   }
  to   { transform: scale(1) rotate(360deg); }
}
@keyframes spin-ccw {
  from { transform: scale(1) rotate(0deg);    }
  to   { transform: scale(1) rotate(-360deg); }
}

/* ── Default State: scaled-to-zero layers ─────────── */
#outer_ring,
#square_dot_ring,
#inner_dot_ring {
  transform-origin: 232px 232px;
  transform: scale(0);
  transition: transform 0.25s cubic-bezier(0.34, 1.4, 0.64, 1);
}

/* outer_selectors: scale + opacity together */
#outer_selectors {
  transform-origin: 232px 232px;
  transform: scale(0);
  opacity: 0;
  transition:
    transform 0.25s cubic-bezier(0.34, 1.4, 0.64, 1),
    opacity   0.25s ease;
}

/* selection_ring: fully controlled by JS (scale + rotation) */
#selection_ring {
  /* inline transform set by JS */
}

/* ── Default State: opacity-zero layers ───────────── */
#button1, #button2, #button3, #button4 {
  opacity: 0;
  transition: opacity 0.25s ease;
  cursor: pointer;
}

/* Override display:none on highlight1's st0 class - visible for hover detection */
#highlight1, #highlight2, #highlight3, #highlight4 {
  display: block !important;
  opacity: 0;
  transition: opacity 0.2s ease;
  pointer-events: none;
}

/* When menu is open, highlights can detect hover to show text */
.menu-wrap.open #highlight1,
.menu-wrap.open #highlight2,
.menu-wrap.open #highlight3,
.menu-wrap.open #highlight4 {
  pointer-events: auto;
}

/* center ring always visible */
#center_ring { cursor: pointer; }

/* ── Page load progress indicator ──────────────── */
#load_progress_arc {
  fill: none;
  stroke: rgba(255,255,255,0.5);
  stroke-width: 2;
  stroke-linecap: round;
  stroke-dasharray: 396; /* 2 * π * 63 ≈ 396 */
  stroke-dashoffset: 396;
  transform: rotate(-90deg);
  transform-origin: 232px 232px;
  transition: stroke-dashoffset 0.3s ease;
}

#load_progress_text {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 16px;
  font-weight: 600;
  fill: rgba(255,255,255,0.6);
  text-anchor: middle;
  dominant-baseline: middle;
  transition: opacity 0.8s ease;
}

#load_progress_label {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 7px;
  font-weight: 400;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  fill: rgba(255,255,255,0.25);
  text-anchor: middle;
  dominant-baseline: middle;
  transition: opacity 0.8s ease;
}

/* fingerprint and logo fade + rotate animation */
#fingerprint_icon {
  pointer-events: none;
  opacity: 0;
  transform: rotateY(-90deg);
  transform-origin: 232px 232px;
  transform-style: preserve-3d;
  transition: opacity 5s ease-in-out, transform 5s linear;
}

#zmedia_logo {
  pointer-events: none;
  opacity: 0;
  /* Use translate to position, then rotateY for animation - translate happens AFTER rotation in transform order */
  transform: rotateY(-90deg) translate(187px, 185px);
  transform-origin: 232px 230px; /* Accounting for logo position in global coordinates */
  transform-style: preserve-3d;
  transition: opacity 5s ease-in-out, transform 5s linear;
}

#fingerprint_icon.active {
  opacity: 0.75;
  transform: rotateY(90deg);
}

#zmedia_logo.active {
  opacity: 0.75;
  transform: rotateY(90deg) translate(187px, 185px);
}

/* Dim center icons when menu is active so they don't clash with label text */
.menu-wrap.open #fingerprint_icon.active {
  opacity: 0.25;
}
.menu-wrap.open #zmedia_logo.active {
  opacity: 0.25;
}

@keyframes iconFade {
  0%, 45% { opacity: 0.75; }
  50%, 95% { opacity: 0; }
  100% { opacity: 0.75; }
}

/* center label text */
#center_label_text {
  transition: opacity 0.3s ease-in-out;
}

/* ── Pulse ring ───────────────────────────────────── */
/*
  The keyframe runs for 3 s total:
    0%   → 60%  : expand + fade  (≈1.8 s of visual motion)
    60%  → 100% : invisible hold (≈1.2 s gap before next pulse)
*/
@keyframes pulse-out {
  0%   { transform: scale(0);   opacity: 1; }
  60%  { transform: scale(1.5); opacity: 0; }
  100% { transform: scale(1.5); opacity: 0; }
}

#pulse_ring {
  transform-origin: 232px 232px;
  pointer-events: none;
  animation: pulse-out 3s ease-out infinite;
}

/* suppress while menu is open or center is hovered */
.menu-wrap.pulse-paused #pulse_ring {
  animation-play-state: paused;
  opacity: 0;
}

/* ── OPEN STATE ───────────────────────────────────── */
.menu-wrap.open #outer_ring,
.menu-wrap.open #square_dot_ring,
.menu-wrap.open #inner_dot_ring {
  transform: scale(1);
}

/* inner_dot_ring: spins clockwise 360° every 3 s */
.menu-wrap.open #inner_dot_ring {
  animation: spin-cw 9s linear infinite;
}

/* outer_selectors: spins counter-clockwise 360° every 3 s */
.menu-wrap.open #outer_selectors {
  transform: scale(1);
  opacity: 1;
  animation: spin-ccw 9s linear infinite;
}

.menu-wrap.open #button1,
.menu-wrap.open #button2,
.menu-wrap.open #button3,
.menu-wrap.open #button4 {
  opacity: 0.75;
}

/* ── ACTIVE BUTTON STATES ─────────────────────────── */
.menu-wrap.active-1 #button1    { opacity: 1   !important; }
.menu-wrap.active-1 #highlight1 { opacity: 0.15 !important; }
.menu-wrap.active-2 #button2    { opacity: 1   !important; }
.menu-wrap.active-2 #highlight2 { opacity: 0.15 !important; }
.menu-wrap.active-3 #button3    { opacity: 1   !important; }
.menu-wrap.active-3 #highlight3 { opacity: 0.15 !important; }
.menu-wrap.active-4 #button4    { opacity: 1   !important; }
.menu-wrap.active-4 #highlight4 { opacity: 0.15 !important; }

/* ── menu_text centered ───────────────────────────── */
#menu_text text {
  font-family: Consolas, 'Courier New', monospace;
  font-size: 28.2px;
  font-weight: 700;
  fill: #fff;
  text-anchor: middle;
  dominant-baseline: middle;
  /* neutralise the original translate transform */
  transform: none;
}

/* ── MODAL OVERLAY ────────────────────────────────── */
#modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 100;
  align-items: flex-start;
  justify-content: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2rem 0;
}
#modal-overlay.active { display: flex; }

/* Custom scrollbar for modal overlay */
#modal-overlay::-webkit-scrollbar {
  width: 10px;
}

#modal-overlay::-webkit-scrollbar-track {
  background: rgba(0,0,0,0.3);
}

#modal-overlay::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.3);
  border-radius: 5px;
}

#modal-overlay::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.4);
}

/* Firefox scrollbar */
#modal-overlay {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.3) rgba(0,0,0,0.3);
}

.modal-box {
  position: relative;
  width: min(94vw, 960px);
  max-height: none;
  background: rgba(6,6,8,0.45);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 3px;
  padding: 2rem 2rem 1.75rem;
  box-shadow: 0 0 100px rgba(255,255,255,0.03), 0 40px 80px rgba(0,0,0,0.6);
  margin: auto;
}

#modal-content {
  width: 100%;
  max-height: calc(90vh - 8rem);
  overflow-y: auto;
  overflow-x: hidden;
}

/* Custom scrollbar for modal content */
#modal-content::-webkit-scrollbar {
  width: 8px;
}

#modal-content::-webkit-scrollbar-track {
  background: rgba(255,255,255,0.05);
  border-radius: 4px;
}

#modal-content::-webkit-scrollbar-thumb {
  background: rgba(255,255,255,0.2);
  border-radius: 4px;
}

#modal-content::-webkit-scrollbar-thumb:hover {
  background: rgba(255,255,255,0.3);
}

/* Firefox scrollbar */
#modal-content {
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.2) rgba(255,255,255,0.05);
}

.modal-close {
  position: absolute;
  top: 1rem; right: 1rem;
  background: none;
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.6);
  font-family: Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  padding: 0.3rem 0.7rem;
  cursor: pointer;
  transition: all 0.2s;
}
.modal-close:hover {
  background: rgba(255,255,255,0.07);
  border-color: rgba(255,255,255,0.45);
  color: #fff;
}

.modal-title {
  font-size: 0.6rem;
  letter-spacing: 0.35em;
  color: rgba(255,255,255,0.3);
  text-transform: uppercase;
  margin-bottom: 1.25rem;
}

/* ── CAROUSEL shared ──────────────────────────────── */
.carousel-stage {
  position: relative;
  width: 100%;
  /* 92vh viewport minus modal chrome: title ~2rem, controls ~3rem, padding ~4rem */
  height: min(calc(92vh - 9rem), calc((min(94vw, 960px) - 4rem) * 9 / 16));
  background: #000;
  overflow: hidden;
}

.carousel-stage iframe {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  border: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
}
.carousel-stage iframe.active {
  opacity: 1;
  pointer-events: auto;
}

.photo-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s ease;
}
.photo-slide.active {
  opacity: 1;
  pointer-events: auto;
}
.photo-slide img {
  max-width: 100%;
  max-height: 100%;
  object-fit: contain;
  display: block;
}

.carousel-controls {
  display: flex;
  align-items: center;
  gap: 0.75rem;
  margin-top: 0.9rem;
}

.c-btn {
  flex-shrink: 0;
  background: none;
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.6);
  font-family: Consolas, monospace;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  padding: 0.35rem 0.9rem;
  cursor: pointer;
  transition: all 0.18s;
}
.c-btn:hover:not(:disabled) {
  background: rgba(255,255,255,0.07);
  color: #fff;
  border-color: rgba(255,255,255,0.45);
}
.c-btn:disabled { opacity: 0.18; cursor: default; }

.c-dots {
  flex: 1;
  display: flex;
  gap: 5px;
  flex-wrap: wrap;
  justify-content: center;
}
.c-dot {
  width: 5px; height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.2);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
}
.c-dot.active { background: rgba(255,255,255,0.9); transform: scale(1.5); }

.c-counter {
  flex-shrink: 0;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.25);
  min-width: 3.5em;
  text-align: right;
}

/* ── CONTACT FORM ─────────────────────────────────── */
.contact-form {
  display: flex;
  flex-direction: column;
  gap: 1rem;
  width: 100%;
  max-width: 900px;
}

.form-field {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}

.form-field label {
  font-family: Consolas, monospace;
  font-size: 0.65rem;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.5);
  text-transform: uppercase;
}

.form-field input,
.form-field textarea {
  font-family: Consolas, monospace;
  font-size: 0.85rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 2px;
  color: #fff;
  padding: 0.6rem 0.8rem;
  transition: all 0.2s;
}

.form-field input:focus,
.form-field textarea:focus {
  outline: none;
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.08);
}

.form-field textarea {
  resize: vertical;
  min-height: 120px;
}

.form-field select option {
  background: #1a1a1a;
  color: #fff;
}

.form-field select {
  font-family: Consolas, monospace;
  font-size: 0.85rem;
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.15);
  border-radius: 2px;
  color: #fff;
  padding: 0.6rem 0.8rem;
  transition: all 0.2s;
  appearance: none;
  cursor: pointer;
}

.form-field select:focus {
  outline: none;
  border-color: rgba(255,255,255,0.4);
  background: rgba(255,255,255,0.08);
}

.form-field select option {
  background: #1a1a1a;
  color: #fff;
}

.form-submit {
  align-self: flex-end;
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.25);
  color: #fff;
  font-family: Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  padding: 0.6rem 1.5rem;
  cursor: pointer;
  transition: all 0.2s;
}

.form-submit:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.5);
}

.form-status {
  font-family: Consolas, monospace;
  font-size: 0.75rem;
  text-align: center;
  padding: 0.6rem;
  border-radius: 2px;
  margin-top: 0.5rem;
}

.form-status.success {
  background: rgba(0,255,100,0.1);
  border: 1px solid rgba(0,255,100,0.3);
  color: rgba(0,255,100,0.9);
}

.form-status.error {
  background: rgba(255,50,50,0.1);
  border: 1px solid rgba(255,50,50,0.3);
  color: rgba(255,100,100,0.9);
}

/* ── VIDEO GRID & TABS ────────────────────────────── */
.modal-intro-text {
  font-family: Consolas, monospace;
  font-size: 0.85rem;
  line-height: 1.6;
  color: rgba(255,255,255,0.7);
  margin-bottom: 1.5rem;
  max-width: 800px;
}

.industry-tabs {
  display: flex;
  gap: 0.5rem;
  margin-bottom: 1.5rem;
  flex-wrap: wrap;
}

.tab-btn {
  background: rgba(255,255,255,0.05);
  border: 1px solid rgba(255,255,255,0.18);
  color: rgba(255,255,255,0.5);
  font-family: Consolas, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.15em;
  text-transform: uppercase;
  padding: 0.5rem 1rem;
  cursor: pointer;
  transition: all 0.2s;
}

.tab-btn:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.7);
  border-color: rgba(255,255,255,0.3);
}

.tab-btn.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-color: rgba(255,255,255,0.45);
}

.tab-content {
  display: none;
}

.tab-content.active {
  display: block;
}

.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 1rem;
  width: 100%;
}

.video-item {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
}

.video-item:hover {
  border-color: rgba(255,255,255,0.3);
  transform: translateY(-2px);
}

.video-item iframe {
  width: 100%;
  height: 100%;
  border: none;
}

.video-item-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.9), transparent);
  color: #fff;
  font-family: Consolas, monospace;
  font-size: 0.75rem;
  padding: 1rem 0.75rem 0.5rem;
  pointer-events: none;
}

/* ── PHOTO GRID ───────────────────────────────────── */
.photo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 1rem;
  width: 100%;
}

.photo-item {
  position: relative;
  aspect-ratio: 1;
  background: #000;
  border: 1px solid rgba(255,255,255,0.1);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s ease;
}

.photo-item:hover {
  border-color: rgba(255,255,255,0.3);
  transform: translateY(-2px);
}

.photo-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.photo-item-title {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: linear-gradient(to top, rgba(0,0,0,0.85), transparent);
  color: rgba(255,255,255,0.9);
  font-family: Consolas, monospace;
  font-size: 0.65rem;
  letter-spacing: 0.08em;
  padding: 1.5rem 0.6rem 0.5rem;
  line-height: 1.3;
  pointer-events: none;
}

/* ── UX CASE STUDY FULLSCREEN MODAL ─────────────── */
#ux-modal-overlay {
  display: none;
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.35);
  z-index: 200;
  align-items: flex-start;
  justify-content: center;
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  overflow-y: auto;
  overflow-x: hidden;
  padding: 2rem 0;
  scrollbar-width: thin;
  scrollbar-color: rgba(255,255,255,0.3) rgba(0,0,0,0.3);
}
#ux-modal-overlay.active { display: flex; }

#ux-modal-overlay::-webkit-scrollbar { width: 10px; }
#ux-modal-overlay::-webkit-scrollbar-track { background: rgba(0,0,0,0.3); }
#ux-modal-overlay::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.3); border-radius: 5px; }
#ux-modal-overlay::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.4); }

.ux-modal-box {
  width: min(94vw, 960px);
  max-height: none;
  overflow: visible;
}

.ux-modal-tabs {
  display: flex;
  gap: 4px;
  align-items: center;
  justify-content: center;
  padding: 0.8rem 0 1rem;
  flex-wrap: wrap;
  border-bottom: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 1rem;
}

.ux-tab-btn {
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.5);
  font-family: Consolas, monospace;
  font-weight: 700;
  font-size: 0.75rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 0.5rem 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
  white-space: nowrap;
}

.ux-tab-btn:hover {
  background: rgba(255,255,255,0.08);
  color: rgba(255,255,255,0.8);
  border-color: rgba(255,255,255,0.25);
}

.ux-tab-btn.active {
  background: rgba(255,255,255,0.12);
  color: #fff;
  border-color: rgba(255,255,255,0.35);
}

.ux-case-content {
  display: none;
}
.ux-case-content.active {
  display: block;
}

/* ── Case Study Styles ─────────────────────────── */
.cs-layout {
  display: flex;
  max-width: 1120px;
  margin: 0 auto;
  position: relative;
}

/* ── Table of Contents Sidebar ─────────────────── */
.cs-toc {
  position: sticky;
  top: 0;
  align-self: flex-start;
  width: 180px;
  min-width: 180px;
  padding: 56px 0 56px 28px;
  flex-shrink: 0;
}

.cs-toc-inner {
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cs-toc-label {
  font-family: Consolas, monospace;
  font-size: 9px;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.2);
  margin-bottom: 12px;
  padding-left: 12px;
}

.cs-toc-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 6px;
  text-decoration: none;
  cursor: pointer;
  transition: all 0.2s ease;
  border: none;
  background: none;
  width: 100%;
  text-align: left;
}

.cs-toc-link:hover {
  background: rgba(255,255,255,0.04);
}

.cs-toc-link.active {
  background: rgba(255,255,255,0.06);
}

.cs-toc-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  flex-shrink: 0;
  opacity: 0.4;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.cs-toc-link.active .cs-toc-dot {
  opacity: 1;
  transform: scale(1.3);
}

.cs-toc-text {
  font-family: Consolas, monospace;
  font-size: 11px;
  letter-spacing: 0.04em;
  color: rgba(255,255,255,0.3);
  transition: color 0.2s ease;
  line-height: 1.3;
}

.cs-toc-link:hover .cs-toc-text {
  color: rgba(255,255,255,0.55);
}

.cs-toc-link.active .cs-toc-text {
  color: rgba(255,255,255,0.85);
}

/* Progress line alongside TOC */
.cs-toc-progress {
  position: absolute;
  left: 28px;
  top: 56px;
  bottom: 56px;
  width: 2px;
  background: rgba(255,255,255,0.04);
  border-radius: 1px;
  overflow: hidden;
}

.cs-toc-progress-fill {
  width: 100%;
  background: linear-gradient(180deg, #E53935, #00C853, #4FC3F7);
  border-radius: 1px;
  transition: height 0.15s ease;
}

.cs-container {
  flex: 1;
  min-width: 0;
  max-width: 900px;
  color: #e8e8ec;
}

.cs-header {
  padding: 56px 48px 40px;
}

.cs-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 14px 5px 6px;
  border-radius: 100px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.07);
  margin-bottom: 20px;
}

.cs-badge-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #00C853;
}

.cs-badge-text {
  font-size: 11px;
  font-weight: 600;
  color: #9e9eae;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  font-family: Consolas, monospace;
}

.cs-badge-readtime {
  font-size: 10px;
  font-weight: 400;
  color: rgba(255,255,255,0.25);
  letter-spacing: 0.06em;
  font-family: Consolas, monospace;
  padding-left: 8px;
  border-left: 1px solid rgba(255,255,255,0.1);
}

.cs-title {
  font-family: 'Roboto Serif', serif;
  font-size: clamp(28px, 4.5vw, 46px);
  font-weight: 600;
  line-height: 1.1;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0 0 16px;
}

.cs-title-accent {
  background: linear-gradient(135deg, #4FC3F7, #00C853);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
}

.cs-tags {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.cs-tag {
  font-family: Consolas, monospace;
  font-size: 0.6rem;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  padding: 4px 12px;
  border-radius: 100px;
  border: 1px solid rgba(255,255,255,0.12);
  color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.03);
}

.cs-subtitle {
  font-family: Lato, monospace;
  font-size: 14px;
  line-height: 1.7;
  color: #8e8e9e;
  max-width: 560px;
  margin: 0;
}

.cs-meta {
  display: flex;
  gap: 32px;
  margin-top: 28px;
  flex-wrap: wrap;
}

.cs-meta-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: #5a5a6e;
  font-family: Consolas, monospace;
  margin-bottom: 4px;
}

.cs-meta-value {
  font-family: Consolas, monospace;
  font-size: 13px;
  font-weight: 600;
  color: #c8c8d0;
}

.cs-divider {
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, transparent 0%, rgba(255,255,255,0.06) 30%, rgba(255,255,255,0.06) 70%, transparent 100%);
}

.cs-section {
  padding: 56px 48px;
  max-width: 900px;
  margin: 0 auto;
}

.cs-section-badge {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.cs-section-icon {
  width: 30px;
  height: 30px;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
}

.cs-section-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  font-family: Consolas, monospace;
}

.cs-section-title {
  font-family: 'Roboto Serif', serif;
  font-size: clamp(22px, 3vw, 32px);
  font-weight: 600;
  line-height: 1.15;
  letter-spacing: -0.02em;
  color: #fff;
  margin: 0 0 14px;
}

.cs-section-desc {
  font-family: Lato, monospace;
  font-size: 13.5px;
  line-height: 1.75;
  color: #8e8e9e;
  max-width: 600px;
  margin: 0 0 40px;
}

.cs-img-caption {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 16px 12px;
  background: linear-gradient(to top, rgba(0,0,0,0.85) 0%, rgba(0,0,0,0.6) 60%, transparent 100%);
  z-index: 5;
  pointer-events: none;
}

.cs-img-caption-phase {
  font-family: Consolas, monospace;
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  line-height: 1;
  margin-bottom: 4px;
}

.cs-img-caption-phase--problem { color: rgba(229,57,53,0.9); }
.cs-img-caption-phase--solution { color: rgba(0,200,83,0.9); }

.cs-img-caption-desc {
  font-family: Consolas, monospace;
  font-size: 11px;
  font-weight: 400;
  letter-spacing: 0.03em;
  color: rgba(255,255,255,0.7);
  line-height: 1.4;
}

.cs-img-wrap {
  position: relative;
  border-radius: 10px;
  overflow: visible;
  margin-bottom: 36px;
}

.cs-img-wrap img {
  width: 100%;
  display: block;
  border-radius: 10px;
}

.cs-img-wrap--problem { border: 1px solid rgba(229,57,53,0.15); }
.cs-img-wrap--solution { border: 1px solid rgba(0,200,83,0.15); }

/* Background-positioned slice — reuses one full-page image per section */
.cs-img-slice {
  width: 100%;
  border-radius: 10px;
  background-size: 100% auto;
  background-repeat: no-repeat;
}

/* Annotation dots */
.cs-dot {
  position: absolute;
  z-index: 10;
  cursor: pointer;
}

.cs-dot-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  font-weight: 700;
  font-family: Consolas, monospace;
  transition: transform 0.2s ease;
}

.cs-dot:hover .cs-dot-circle { transform: scale(1.2); }

.cs-dot--problem .cs-dot-circle {
  background: #E53935;
  box-shadow: 0 0 0 3px rgba(229,57,53,0.25), 0 2px 8px rgba(0,0,0,0.3);
}

.cs-dot--solution .cs-dot-circle {
  background: #00C853;
  box-shadow: 0 0 0 3px rgba(0,200,83,0.25), 0 2px 8px rgba(0,0,0,0.3);
}

.cs-dot-tooltip {
  display: none;
  position: absolute;
  top: -4px;
  background: #1a1a2e;
  color: #f0f0f0;
  padding: 7px 12px;
  border-radius: 6px;
  font-size: 11px;
  font-family: Consolas, monospace;
  white-space: normal;
  max-width: 140px;
  width: max-content;
  box-shadow: 0 4px 20px rgba(0,0,0,0.5);
  letter-spacing: 0.01em;
  line-height: 1.45;
  pointer-events: none;
  z-index: 20;
}

.cs-dot:hover .cs-dot-tooltip { display: block; }

.cs-dot-tooltip--right { left: calc(100% + 10px); }
.cs-dot-tooltip--left { right: calc(100% + 10px); }

.cs-dot--problem .cs-dot-tooltip { border: 1px solid rgba(229,57,53,0.3); }
.cs-dot--solution .cs-dot-tooltip { border: 1px solid rgba(0,200,83,0.3); }

/* Card grids */
.cs-card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 14px;
}

.cs-card {
  padding: 22px 20px;
  border-radius: 12px;
}

.cs-card--problem {
  background: rgba(229,57,53,0.04);
  border: 1px solid rgba(229,57,53,0.1);
}

.cs-card--solution {
  background: rgba(0,200,83,0.03);
  border: 1px solid rgba(0,200,83,0.1);
}

.cs-card-icon { font-size: 20px; margin-bottom: 10px; }

.cs-card-title {
  font-family: 'Roboto Serif', serif;
  font-size: 13px;
  font-weight: 600;
  margin-bottom: 6px;
  color: #e8e8ec;
}

.cs-card-desc {
  font-family: Consolas, monospace;
  font-size: 12px;
  line-height: 1.6;
  color: #7e7e90;
}

/* Metric cards */
.cs-metrics {
  display: flex;
  gap: 14px;
  margin-bottom: 40px;
  flex-wrap: wrap;
}

.cs-metric {
  background: rgba(255,255,255,0.03);
  border: 1px solid rgba(255,255,255,0.07);
  border-radius: 12px;
  padding: 24px 20px;
  flex: 1 1 0;
  min-width: 170px;
}

.cs-metric-value {
  font-size: 32px;
  font-weight: 600;
  font-family: 'Roboto Serif', serif;
  background: linear-gradient(135deg, #00C853, #69F0AE);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.1;
  margin-bottom: 6px;
}

.cs-metric-label {
  font-family: Consolas, monospace;
  font-size: 12px;
  font-weight: 600;
  color: #c8c8d0;
  margin-bottom: 4px;
  letter-spacing: 0.02em;
}

.cs-metric-desc {
  font-family: Consolas, monospace;
  font-size: 11px;
  color: #6e6e80;
  line-height: 1.5;
}

/* Results outcomes */
.cs-outcomes {
  background: rgba(255,255,255,0.02);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: 14px;
  padding: 32px 28px;
}

.cs-outcomes-title {
  font-family: 'Roboto Serif', serif;
  font-size: 16px;
  font-weight: 600;
  margin: 0 0 22px;
  color: #fff;
}

.cs-outcome {
  margin-bottom: 22px;
}
.cs-outcome:last-child { margin-bottom: 0; }

.cs-outcome-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 6px;
}

.cs-outcome-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}

.cs-outcome-name {
  font-family: 'Roboto Serif', serif;
  font-size: 14px;
  font-weight: 600;
  color: #e8e8ec;
}

.cs-outcome-body {
  font-family: Lato, monospace;
  font-size: 12.5px;
  line-height: 1.7;
  color: #8e8e9e;
  padding-left: 16px;
}

/* Takeaway */
.cs-takeaway {
  margin-top: 48px;
  text-align: center;
  padding: 0 20px 40px;
}

.cs-takeaway-label {
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: #5a5a6e;
  font-family: Consolas, monospace;
  margin-bottom: 12px;
}

.cs-takeaway-text {
  font-family: 'Roboto Serif', serif;
  font-size: clamp(16px, 2.5vw, 22px);
  font-weight: 400;
  line-height: 1.5;
  color: #c8c8d0;
  max-width: 560px;
  margin: 0 auto;
  letter-spacing: -0.01em;
}

.cs-takeaway-text strong {
  color: #fff;
  font-weight: 600;
}

/* Responsive */
@media (max-width: 900px) {
  .cs-toc { display: none; }
  .cs-layout { max-width: 900px; }
}
@media (max-width: 640px) {
  .cs-header, .cs-section { padding: 36px 20px; }
  .cs-card-grid { grid-template-columns: 1fr; }
  .cs-metrics { flex-direction: column; }
  .ux-modal-tabs { justify-content: flex-start; }
}

/* ── Photo lightbox ──────────────────────────────── */
/* Screen reader only - visually hidden but accessible to screen readers */
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border-width: 0;
}

.photo-lightbox {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  z-index: 10000;
  cursor: pointer;
}

.photo-lightbox.active {
  display: flex;
}

.photo-lightbox img {
  max-width: 90vw;
  max-height: 85vh;
  object-fit: contain;
  user-select: none;
}

.lightbox-nav {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: rgba(255,255,255,0.6);
  font-family: Consolas, monospace;
  font-size: 1.2rem;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 10;
}

.lightbox-nav:hover {
  background: rgba(255,255,255,0.15);
  border-color: rgba(255,255,255,0.4);
  color: #fff;
}

.lightbox-nav--prev { left: 1rem; }
.lightbox-nav--next { right: 1rem; }

.lightbox-counter {
  font-family: Consolas, monospace;
  font-size: 0.6rem;
  letter-spacing: 0.15em;
  color: rgba(255,255,255,0.3);
}

.lightbox-info {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 1.5rem;
  flex-shrink: 0;
}

.lightbox-title {
  font-family: Consolas, monospace;
  font-size: 0.75rem;
  letter-spacing: 0.12em;
  color: rgba(255,255,255,0.6);
}

.lightbox-link {
  font-family: Consolas, monospace;
  font-size: 0.6rem;
  letter-spacing: 0.18em;
  color: rgba(255,255,255,0.5);
  text-decoration: none;
  border: 1px solid rgba(255,255,255,0.2);
  padding: 0.3rem 0.8rem;
  transition: all 0.2s;
  cursor: pointer;
}

.lightbox-link:hover {
  color: #fff;
  border-color: rgba(255,255,255,0.5);
  background: rgba(255,255,255,0.08);
}

/* ── Photo tab loading spinner ───────────────────── */
.photo-tab-loading {
  text-align: center;
  padding: 3rem;
  color: rgba(255,255,255,0.5);
  font-family: Consolas, monospace;
  font-size: 0.8rem;
  letter-spacing: 0.2em;
}

/* ── Testimonial Carousel ─────────────────────────── */

.testimonial-heading {
  position: absolute;
  top: calc(50% + min(90vw, 90vh, 480px) / 2);
  left: 50%;
  transform: translateX(-50%);
  font-family: Lato, sans-serif;
  font-size: 0.6rem;
  font-weight: 400;
  letter-spacing: 0.25em;
  text-transform: uppercase;
  color: rgba(255,255,255,0.5);
  z-index: 5;
}

.testimonial-carousel {
  position: absolute;
  /* 50px below the bottom edge of the center navigation ring */
  top: calc(50% + min(90vw, 90vh, 480px) / 2 + 50px);
  left: 50%;
  transform: translateX(-50%);
  width: min(500px, 85vw);
  z-index: 5;
  text-align: center;
  pointer-events: auto;
  padding-bottom: 2rem;
}

.testimonial-slide {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  animation: testimonialFadeIn 0.8s ease;
}

.testimonial-slide.active {
  display: flex;
}

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

.testimonial-avatar {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  border: 2px solid rgba(255,255,255,0.15);
  object-fit: cover;
  pointer-events: auto;
  cursor: pointer;
  transition: border-color 0.3s;
}

.testimonial-avatar:hover {
  border-color: rgba(255,255,255,0.5);
}

.testimonial-quote {
  font-family: Lato, monospace;
  font-size: clamp(0.7rem, 1.4vw, .9rem);
  color: rgba(255,255,255,0.45);
  line-height: 1.15;
  max-width: 500px;
}

.testimonial-meta {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}

.testimonial-name {
  font-family: 'Roboto Serif', monospace;
  font-size: .8rem;
  font-weight: 600;
  font-style: italic;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.699);
}

.testimonial-role {
  font-family: Lato, monospace;
  font-size: 0.7rem;
  letter-spacing: 0.08em;
  font-style: italic;
  color: rgba(255, 255, 255, 0.363);
}

.testimonial-dots {
  display: flex;
  gap: 6px;
  justify-content: center;
  margin-top: 4px;
  pointer-events: auto;
}

.testimonial-dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: rgba(255,255,255,0.15);
  cursor: pointer;
  transition: all 0.3s;
  border: none;
  padding: 0;
}

.testimonial-dot.active {
  background: rgba(255,255,255,0.5);
  transform: scale(1.3);
}

.testimonial-nav-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: 6px;
  pointer-events: auto;
}

.testimonial-nav {
  background: none;
  border: 1px solid rgba(255,255,255,0.1);
  color: rgba(255,255,255,0.3);
  font-family: Consolas, monospace;
  font-size: 0.85rem;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  padding: 0;
}

.testimonial-nav:hover {
  border-color: rgba(255,255,255,0.35);
  color: rgba(255,255,255,0.7);
  background: rgba(255,255,255,0.05);
}

@media (max-width: 640px) {
  .testimonial-carousel {
    top: calc(50% + min(90vw, 90vh, 480px) / 2);
  }
  .testimonial-quote { font-size: 0.65rem; line-height: 1.5; }
  .testimonial-avatar { width: 40px; height: 40px; }
  .testimonial-heading {  position: absolute;
                          top: calc(47% + min(90vw, 90vh, 480px) / 2); }
}
