/* ============================================
   STEP 1 REDESIGN - INTERACTIVE CHIP EXPLORER
   Precision Scientific Visualization
   ============================================ */

/* Import Technical Font */
@import url('https://fonts.googleapis.com/css2?family=Oxanium:wght@300;400;600;700&family=JetBrains+Mono:wght@400;500&display=swap');

/* Step 1 Container - Uses technology-style background from section-transitions.css */
.snap-page[data-step="1"] {
  background: transparent;
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  min-height: 100vh;
  max-width: unset !important;
}

/* Background handled by section-transitions.css */

/* ============================================
   HEADER SECTION
   ============================================ */

.step1-modern-header {
  text-align: center;
  position: relative;
  z-index: 1;
  max-width: 1200px;
  margin-top: 2rem;
  margin-bottom: 1rem;
  animation: headerReveal 1.2s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes headerReveal {
  from {
    opacity: 0;
    transform: translateY(-40px);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* Glowing Accent Line */
.step1-modern-header::before {
  content: '';
  display: block;
  width: clamp(80px, 10vw, 150px);
  height: 2px;
  background: linear-gradient(90deg,
    transparent 0%,
    rgba(255, 107, 0, 0.3) 10%,
    #ff6b00 50%,
    rgba(255, 107, 0, 0.3) 90%,
    transparent 100%);
  margin: 0 auto clamp(1.5rem, 3vh, 2.5rem);
  box-shadow:
    0 0 10px rgba(255, 107, 0, 0.8),
    0 0 20px rgba(255, 107, 0, 0.4),
    0 0 40px rgba(255, 107, 0, 0.2);
  animation: pulseLine 3s ease-in-out infinite;
}

@keyframes pulseLine {
  0%, 100% {
    opacity: 1;
    box-shadow:
      0 0 10px rgba(255, 107, 0, 0.8),
      0 0 20px rgba(255, 107, 0, 0.4);
  }
  50% {
    opacity: 0.7;
    box-shadow:
      0 0 15px rgba(255, 107, 0, 1),
      0 0 30px rgba(255, 107, 0, 0.6),
      0 0 50px rgba(255, 107, 0, 0.3);
  }
}

/* Main Title */
.step1-main-title {
  font-family: 'Oxanium', sans-serif;
  font-size: clamp(2rem, 4.5vw, 3.2rem);
  font-weight: 700;
  line-height: 1.2;
  letter-spacing: 0.02em;
  position: relative;
  color: #ff6b00;
  max-width: unset;
  text-shadow:
    0 2px 4px rgba(0, 0, 0, 0.1),
    0 4px 8px rgba(255, 107, 0, 0.3);
  animation: titleFadeIn 1s cubic-bezier(0.16, 1, 0.3, 1) 0.2s both;
}

@keyframes titleFadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
    filter: blur(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
    filter: blur(0);
  }
}

/* Subtitle */
.step1-subtitle {
  font-family: 'Oxanium', sans-serif;
  font-size: 1.8rem;
  font-weight: 500;
  letter-spacing: 0.05em;
  line-height: 1.6;
  text-align: center;
  width: 100%;
  animation: subtitleFade 1.5s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
}

@keyframes subtitleFade {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   TOGGLE SECTION
   ============================================ */

.step1-header-stack {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1.5rem;
  margin-bottom: clamp(2rem, 4vh, 3rem);
  position: relative;
  z-index: 1;
}


/* Toggle Buttons */
.node-btn {
  padding: 0.75rem 2.5rem;
  border: 1px solid transparent;
  background: transparent;
  color: rgba(255, 255, 255, 0.5);
  font-family: 'Oxanium', sans-serif;
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: 0.1em;
  border-radius: 50px;
  cursor: pointer;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}

.node-btn::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(255, 107, 0, 0.1), rgba(255, 140, 0, 0.1));
  opacity: 0;
  transition: opacity 0.4s ease;
}

.node-btn:hover {
  color: rgba(255, 255, 255, 0.9);
  border-color: rgba(255, 107, 0, 0.3);
}

.node-btn:hover::before {
  opacity: 1;
}

/* Active Button State */
.node-btn.is-active {
  background: linear-gradient(135deg, #ff6b00, #ff8c00);
  color: white;
  border-color: rgba(255, 140, 0, 0.5);
  box-shadow:
    0 0 20px rgba(255, 107, 0, 0.6),
    0 4px 15px rgba(255, 107, 0, 0.4),
    inset 0 1px 2px rgba(255, 255, 255, 0.2);
}

.node-btn.is-active::before {
  opacity: 0;
}

/* ============================================
   CHIP EXPLORER CONTAINER
   ============================================ */

.chip-explorer-container {
  width: 100%;
  position: relative;
  z-index: 1;
  margin: 0 auto;
  padding: 0 2rem;
}

.chip-explorer {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  opacity: 0;
  pointer-events: none;
  transition: all 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.chip-explorer.is-active {
  opacity: 1;
  pointer-events: auto;
  position: relative;
}

/* ============================================
   LATERAL CONTAINER LAYOUT
   ============================================ */

.chip-lateral-container {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 500px;
}

/* ============================================
   BASE CHIP LAYER
   ============================================ */

.chip-base-layer {
  position: relative;
  width: 100%;
  max-width: 750px;
  margin: 0 auto;
  border-radius: 16px;
  border: 2px solid rgba(255, 107, 0, 0.3);
  box-shadow:
    0 0 40px rgba(255, 107, 0, 0.2),
    0 10px 50px rgba(0, 0, 0, 0.8),
    inset 0 1px 2px rgba(255, 107, 0, 0.1);
  z-index: 10;
  transition: transform 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

/* Shift chip to right when left panel is active (only for 127µm since 250µm is always shifted) */
#chip-explorer-127 .chip-lateral-container.left-panel-active .chip-base-layer {
  transform: translateX(0);
}

/* Always shift 250µm chip to right since panel is always visible */
#chip-explorer-250 .chip-base-layer {
  transform: translateX(250px);
}

/* Hide View button and Close button for 250µm since panel is always visible */
#chip-explorer-250 .chip-view-btn,
#chip-explorer-250 .lateral-close-btn {
  display: none;
}

/* Connection Arrow for 250µm */
.connection-arrow-250 {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 15;
}

.arrow-path-250 {
  opacity: 0.8;
  animation: arrowPulse250 3s ease-in-out infinite;
}

@keyframes arrowPulse250 {
  0%, 100% {
    opacity: 0.6;
    stroke-width: 2;
  }
  50% {
    opacity: 1;
    stroke-width: 2.5;
  }
}

/* Connection Arrow SVG - Dotted box to left panel */
.connection-arrow-svg {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  width: 600px;
  pointer-events: none;
  z-index: 2500;
  overflow: visible;
}
.twofifty.connection-arrow-svg{
  position: absolute;
    top: 35%;
    left: 56%;
    transform: translate(-50%, -50%);
    width: 900px;
    pointer-events: none;
    z-index: 2500;
    overflow: visible;
}
.connection-arrow-svg.left-smallum{
  position: absolute;
  top: 57%;
  left: 37%;
  transform: translate(-50%, -50%);
  width: 500px;
  pointer-events: none;
  z-index: 2500;
  overflow: visible;
}
.connection-arrow-svg.right-smallum{
    position: absolute;
    top: 60%;
    left: 74.5%;
    transform: translate(-50%, -50%);
    width: 370px;
    pointer-events: none;
    z-index: 2500;
    overflow: visible;
}

.connection-arrow-svg .arrow-path {
  opacity: 0.9;
}

/* ============================================
   DYNAMIC SVG ARROW CONNECTOR
   Responsive arrows that connect chip to panels
   ============================================ */
.dynamic-arrow-connector {
  position: fixed;
  top: 0;
  left: 0;
  width: 100vw;
  height: 100vh;
  pointer-events: none;
  z-index: 2500;
  overflow: visible;
}

.dynamic-arrow-connector .dynamic-arrow-line {
  stroke: #FF6B00;
  stroke-width: 2.5;
  stroke-linecap: round;
  fill: none;
  opacity: 0.9;
}

.dynamic-arrow-connector .dynamic-arrow-line.hidden {
  opacity: 0;
}

@keyframes arrowPulseDynamic {
  0%, 100% {
    opacity: 0.6;
    stroke-width: 2;
  }
  50% {
    opacity: 1;
    stroke-width: 2.5;
  }
}

/* Hide 127µm arrows at 1720px and below */
@media (max-width: 1720px) {
  .dynamic-arrow-line[data-source*="127"] {
    display: none !important;
  }
}

/* Hide all dynamic arrows on mobile */
@media (max-width: 768px) {
  .dynamic-arrow-connector {
    display: none !important;
  }
}

/* Hide Show Images buttons and Close buttons for 127µm since panels are always visible */
#chip-explorer-127 .chip-view-btn,
#chip-explorer-127 .lateral-close-btn {
  display: none;
}

/* Make 127µm lateral panels always visible when explorer is active */
#chip-explorer-127.is-active .lateral-panel {
  opacity: 1;
  pointer-events: auto;
}

@keyframes baseLayerReveal {
  from {
    opacity: 0;
    transform: translateY(40px) rotateX(10deg);
  }
  to {
    opacity: 1;
    transform: translateY(0) rotateX(0);
  }
}

.chip-base-img {
  width: 100%;
  height: auto;
  display: block;
  border-radius: 8px;
  filter: brightness(1.1) contrast(1.1);
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

/* ============================================
   CHIP VIEW BUTTONS (Top View / Side View)
   ============================================ */

.chip-view-btn {
  position: absolute;
  cursor: pointer;
  z-index: 20;
  transition: all 0.3s ease;
  transform-origin: center;
  animation: magnifyPulse 2.6s ease-in-out infinite;
  border: none;
  background: transparent;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.chip-view-btn-left {
  left: 24%;
  top: 75%;
  transform: translateY(-50%);
}

.chip-view-btn-right {
  left: 15%;
  bottom: 0%;
}

@keyframes magnifyPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.02); }
}

.chip-view-btn .btn-icon {
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at 30% 30%, #ffd08a, #ff7a00 65%, #d95700);
  border: 2px solid rgba(255, 255, 255, 0.85);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.35),
    0 0 22px rgba(255, 140, 0, 0.65);
  backdrop-filter: blur(1px);
  flex-shrink: 0;
}

.chip-view-btn .btn-icon svg {
  width: 24px;
  height: 24px;
  color: #fff;
  filter: drop-shadow(0 2px 2px rgba(0, 0, 0, 0.55));
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
}

.chip-view-btn .btn-text {
  background: rgba(20, 25, 35, 0.95);
  color: #ffffff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 12px;
  white-space: nowrap;
  border: 1px solid rgba(255, 107, 0, 0.4);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.5),
    0 0 15px rgba(255, 107, 0, 0.2);
  backdrop-filter: blur(8px);
  pointer-events: none;
  opacity: 0.95;
  transition: all 0.3s ease;
}

.chip-view-btn:hover {
  transform: scale(1.1);
}

.chip-view-btn-left:hover {
  transform: translateY(-50%) scale(1.1);
}

.chip-view-btn:hover .btn-icon svg {
  color: #ffaa00;
  transform: rotate(15deg);
}

.chip-view-btn:hover .btn-text {
  background: rgba(255, 107, 0, 0.9);
  border-color: rgba(255, 140, 0, 0.8);
  box-shadow:
    0 4px 15px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(255, 107, 0, 0.5);
}

.chip-view-btn.active .btn-icon {
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.35),
    0 0 30px rgba(255, 140, 0, 0.9);
}

/* 127µm Button Positions */
.chip-view-btn-left-127 {
  left: 20%;
  bottom: 10%;
}

.chip-view-btn-right-127 {
  right: 5%;
  bottom: 10%;
}

/* ============================================
   LATERAL PANELS (Side Detail Views)
   ============================================ */

.lateral-panel {
  position: absolute;
  top: 55%;
  transform: translateY(-58%);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 50;
  width: 50%;
  max-width: 600px;
}
.zoom-left-127.lateral-panel, .zoom-right-127.lateral-panel{
  max-width:400px;
}

/* Make 250µm left panel always visible */
.zoom-center-250.lateral-left {
  opacity: 1;
  pointer-events: auto;
}

/* Make 127µm panels always visible */
.zoom-left-127.lateral-left,
.zoom-right-127.lateral-right {
  opacity: 1;
  pointer-events: auto;
}

.lateral-left {
  left: 100px;
  justify-content: flex-start;
  padding-left: 2rem;
}

.lateral-right {
  right: 100px;
  justify-content: flex-end;
  padding-right: 2rem;
}

.lateral-panel.active {
  opacity: 1;
  pointer-events: auto;
  z-index: 100;
}

/* Lateral Content Container */
.lateral-content {
  position: relative;
  max-width: 700px;
  width: 100%;
  background: linear-gradient(135deg, rgba(10, 14, 23, 0.95), rgba(20, 25, 35, 0.98));
  border: 2px solid rgba(255, 107, 0, 0.5);
  border-radius: 20px;
  padding: 1rem;
  box-shadow:
    0 0 60px rgba(255, 107, 0, 0.3),
    0 20px 50px rgba(0, 0, 0, 0.9),
    inset 0 1px 2px rgba(255, 107, 0, 0.2);
  backdrop-filter: blur(20px);
  transform: scale(0.9);
  opacity: 0;
  transition: all 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
  z-index: 100;
}

.lateral-panel.active .lateral-content {
  transform: scale(1);
  opacity: 1;
}

/* Make 250µm left panel content always visible */
.zoom-center-250.lateral-left .lateral-content {
  transform: scale(1);
  opacity: 1;
}

/* Make 127µm panel content always visible */
.zoom-left-127.lateral-left .lateral-content,
.zoom-right-127.lateral-right .lateral-content {
  transform: scale(1);
  opacity: 1;
}

/* Lateral Images */
.lateral-img {
  width: 100%;
  height: auto;
  border-radius: 12px;
  border: 2px solid rgba(255, 107, 0, 0.4);
  box-shadow:
    0 0 30px rgba(255, 107, 0, 0.3),
    0 10px 40px rgba(0, 0, 0, 0.7);
  filter: brightness(1.15) contrast(1.1);
  display: block;
}

/* Dual Image Layout (for 127µm with 2 stacked images) */
.lateral-dual .lateral-content {
  display: flex;
  flex-direction: column;
  gap: 1.5rem;
}

.lateral-img-container {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

.lateral-img-container:last-of-type {
  margin-bottom: 0;
}

.lateral-img-small {
  max-height: 200px;
  object-fit: contain;
}

/* Lateral Label */
.lateral-label {
  font-family: 'JetBrains Mono', monospace;
  color: #ff8c00;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  text-align: center;
  padding: .5rem;
  background: rgba(255, 107, 0, 0.1);
  border: 1px solid rgba(255, 107, 0, 0.3);
  border-radius: 10px;
  box-shadow:
    0 0 15px rgba(255, 107, 0, 0.2),
    inset 0 1px 2px rgba(255, 107, 0, 0.1);
}
  .lateral-label.description-text{
    font-size: 1.3rem;
  }

/* Close Button for Lateral Panels */
.lateral-close-btn {
  position: absolute;
  top: 1rem;
  right: 1rem;
  width: 40px;
  height: 40px;
  background: rgba(255, 107, 0, 0.2);
  border: 2px solid rgba(255, 107, 0, 0.5);
  border-radius: 50%;
  color: #ff8c00;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 50;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

.lateral-close-btn svg {
  width: 20px;
  height: 20px;
  transition: transform 0.3s ease;
}

.lateral-close-btn:hover {
  background: rgba(255, 107, 0, 0.4);
  border-color: rgba(255, 140, 0, 0.8);
  transform: scale(1.1) rotate(90deg);
  box-shadow:
    0 0 25px rgba(255, 107, 0, 0.6),
    0 0 50px rgba(255, 107, 0, 0.3);
}

.lateral-close-btn:hover svg {
  transform: rotate(90deg);
}

.lateral-close-btn:active {
  transform: scale(0.95);
}

/* Connector Lines with Arrows */
.lateral-connector {
  position: absolute;
  width: 250px;
  height: 100px;
  pointer-events: none;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.4, 0, 0.2, 1) 0.2s;
}

.lateral-panel.active .lateral-connector {
  opacity: 1;
}

.lateral-left .lateral-connector {
  right: -50px;
  top: 50%;
  transform: translateY(-50%);
}

.lateral-right .lateral-connector {
  left: -50px;
  top: 50%;
  transform: translateY(-50%);
}

/* Animated Connector Line */
.connector-line {
  stroke-dasharray: 400;
  stroke-dashoffset: 400;
  animation: drawLine 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards;
}

.lateral-panel.active .connector-line {
  animation: drawLine 1.5s cubic-bezier(0.4, 0, 0.2, 1) forwards,
             pulseGlow 3s ease-in-out infinite 1.5s;
}

@keyframes drawLine {
  to {
    stroke-dashoffset: 0;
  }
}

@keyframes pulseGlow {
  0%, 100% {
    filter: drop-shadow(0 0 5px rgba(255, 107, 0, 0.5));
  }
  50% {
    filter: drop-shadow(0 0 15px rgba(255, 107, 0, 0.9));
  }
}

/* ============================================
   DOTTED OVERLAY - 250µm Bottom Left Corner
   ============================================ */

.dotted-overlay {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
  animation: dottedPulse 3s ease-in-out infinite;
}

@keyframes dottedPulse {
  0%, 100% {
    opacity: 0.7;
  }
  50% {
    opacity: 1;
  }
}

/* ============================================
   MAGNIFYING GLASS HOTSPOTS
   ============================================ */

.magnify-hotspot {
  position: absolute;
  cursor: pointer;
  z-index: 10;
  transition: all 0.3s ease;
    position: absolute;          /* assuming you place it over the image */
    z-index: 20;
    cursor: zoom-in;
    transform-origin: center;
}

/* 250µm New Magnifying Glass Positions */
.magnify-center-250 {
  left: 24%;
  top: 75%;
  transform: translateY(-50%);
}

.magnify-bottom-250 {
  left: 15%;
  bottom: 0%;
}
@keyframes magnifyPulse{
  0%,100% { transform: scale(1); }
  50%     { transform: scale(1.02); }
}

.magnify-hotspot{
  animation: magnifyPulse 2.6s ease-in-out infinite;
}
/* Magnifying Glass Arrows */
.magnify-arrow {
  position: absolute;
  left: 85px;
  top: 50%;
  transform: translateY(-50%);
  width: 140px;
  height: 100px;
  pointer-events: none;
  z-index: -1;
  opacity: 0.9;
}

.arrow-to-center {
  animation: arrowPulseCenter 2.5s ease-in-out infinite;
}

.arrow-to-bottom {
  animation: arrowPulseBottom 2.5s ease-in-out infinite 0.5s;
  /* Straight line up from magnifying glass */
  top: auto;
  transform: none;
  bottom: 0;
  left: 18px;
  width: 20px;
  height: 60px;
  overflow: visible;
}

@keyframes arrowPulseCenter {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

@keyframes arrowPulseBottom {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

/* Main chip magnifying glasses - Outside the box */
.magnify-bottom-left {
  left: -120px;
  bottom: 0%;
}

.magnify-bottom-right {
  right: -120px;
  bottom: 0%;
}

/* Connector lines from magnifying glass to box corner */
.magnify-bottom-left::before,
.magnify-bottom-right::before {
  content: '';
  position: absolute;
  top: 50%;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg,
    rgba(255, 107, 0, 0.3),
    rgba(255, 140, 0, 0.8),
    rgba(255, 107, 0, 0.3));
  box-shadow: 0 0 10px rgba(255, 107, 0, 0.5);
  z-index: -1;
  animation: connectorPulse 2s ease-in-out infinite;
}

.magnify-bottom-left::before {
  left: 80px;
}

.magnify-bottom-right::before {
  right: 80px;
}

/* Arrow heads pointing to corners */
.magnify-bottom-left::after,
.magnify-bottom-right::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-style: solid;
  filter: drop-shadow(0 0 8px rgba(255, 107, 0, 0.6));
}

.magnify-bottom-left::after {
  left: 140px;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent rgba(255, 140, 0, 0.9);
}

.magnify-bottom-right::after {
  right: 140px;
  border-width: 6px 10px 6px 0;
  border-color: transparent rgba(255, 140, 0, 0.9) transparent transparent;
}

/* OptZ Magnifying Glass Positions - Outside the box */
.magnify-optz-left {
  left: -120px;
  bottom: 70%;
  transform: translateY(50%);
}

.magnify-optz-right {
  right: -120px;
  bottom: 70%;
  transform: translateY(50%);
}

/* Connector lines from magnifying glass to box corner */
.magnify-optz-left::before,
.magnify-optz-right::before {
  content: '';
  position: absolute;
  top: 50%;
  width: 60px;
  height: 2px;
  background: linear-gradient(90deg,
    rgba(255, 107, 0, 0.3),
    rgba(255, 140, 0, 0.8),
    rgba(255, 107, 0, 0.3));
  box-shadow: 0 0 10px rgba(255, 107, 0, 0.5);
  z-index: -1;
  animation: connectorPulse 2s ease-in-out infinite;
}

@keyframes connectorPulse {
  0%, 100% {
    opacity: 0.6;
  }
  50% {
    opacity: 1;
  }
}

.magnify-optz-left::before {
  left: 80px;
}

.magnify-optz-right::before {
  right: 80px;
}

/* Arrow heads pointing to corners */
.magnify-optz-left::after,
.magnify-optz-right::after {
  content: '';
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 0;
  height: 0;
  border-style: solid;
  filter: drop-shadow(0 0 8px rgba(255, 107, 0, 0.6));
}

.magnify-optz-left::after {
  left: 140px;
  border-width: 6px 0 6px 10px;
  border-color: transparent transparent transparent rgba(255, 140, 0, 0.9);
}

.magnify-optz-right::after {
  right: 140px;
  border-width: 6px 10px 6px 0;
  border-color: transparent rgba(255, 140, 0, 0.9) transparent transparent;
}

.hotspot-indicator{
  width: 44px;
  height: 44px;
  border-radius: 999px;
  display: grid;
  place-items: center;

  /* modern orange badge */
  background: radial-gradient(circle at 30% 30%, #ffd08a, #ff7a00 65%, #d95700);
  border: 2px solid rgba(255,255,255,0.85);

  /* depth + glow */
  box-shadow:
    0 10px 24px rgba(0,0,0,0.35),
    0 0 22px rgba(255,140,0,0.65);

  /* keep it crisp on busy backgrounds */
  backdrop-filter: blur(1px);
}

@keyframes hotspotPulse {
  0%, 100% {
    box-shadow:
      0 0 20px rgba(255, 107, 0, 0.4),
      0 0 40px rgba(255, 107, 0, 0.2);
  }
  50% {
    box-shadow:
      0 0 30px rgba(255, 107, 0, 0.6),
      0 0 60px rgba(255, 107, 0, 0.3);
  }
}


.magnify-icon {
  width: 24px;
  height: 24px;
  color: #fff; /* currentColor now becomes white */
  filter: drop-shadow(0 2px 2px rgba(0,0,0,0.55));
}

.magnify-hotspot:hover .magnify-icon {
  color: #ffaa00;
  transform: rotate(15deg);
}

/* Magnifying Glass Pill Labels */
.magnify-pill {
  position: absolute;
  left: 100%;
  top: 50%;
  transform: translateY(-50%);
  margin-left: 2px;
  background: rgba(20, 25, 35, 0.95);
  color: #ffffff;
  font-family: 'JetBrains Mono', monospace;
  font-size: 0.75rem;
  font-weight: 500;
  padding: 0.4rem 0.8rem;
  border-radius: 12px;
  white-space: nowrap;
  border: 1px solid rgba(255, 107, 0, 0.4);
  box-shadow:
    0 4px 12px rgba(0, 0, 0, 0.5),
    0 0 15px rgba(255, 107, 0, 0.2);
  backdrop-filter: blur(8px);
  z-index: 5;
  pointer-events: none;
  opacity: 0.95;
  transition: all 0.3s ease;
}

.magnify-hotspot:hover .magnify-pill {
  background: rgba(255, 107, 0, 0.9);
  border-color: rgba(255, 140, 0, 0.8);
  box-shadow:
    0 4px 15px rgba(0, 0, 0, 0.6),
    0 0 20px rgba(255, 107, 0, 0.5);
}

/* ============================================
   ZOOM REVEAL LAYERS - SIDE PANEL
   ============================================ */

.zoom-reveal-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  background: rgba(10, 14, 23, 0.98);
  backdrop-filter: blur(20px);
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  pointer-events: none;
  transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
  z-index: 50;
  box-shadow:
    0 0 60px rgba(0, 0, 0, 0.9),
    inset 0 0 100px rgba(255, 107, 0, 0.05);
  overflow: hidden;
  border: 2px solid rgba(255, 107, 0, 0.5);
  border-radius: 16px;
}

.zoom-reveal-layer.active {
  opacity: 1;
  pointer-events: auto;
}

/* SVG Connection Arrow - Hidden for overlay mode */
.connection-arrow {
  display: none;
}

.zoom-content {
  position: relative;
  width: 100%;
  max-width: 90vw;
  max-height: 90vh;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 1rem;
  padding: 1rem;
  margin: auto;
  box-sizing: border-box;
}

/* Close Button */
.zoom-close-btn {
  position: absolute;
  top: 1.5rem;
  right: 1.5rem;
  width: 45px;
  height: 45px;
  background: rgba(255, 107, 0, 0.2);
  border: 2px solid rgba(255, 107, 0, 0.5);
  border-radius: 50%;
  color: #ff8c00;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 110;
  transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(10px);
}

.zoom-close-btn svg {
  width: 24px;
  height: 24px;
  transition: transform 0.3s ease;
}

.zoom-close-btn:hover {
  background: rgba(255, 107, 0, 0.4);
  border-color: rgba(255, 140, 0, 0.8);
  transform: scale(1.1) rotate(90deg);
  box-shadow:
    0 0 30px rgba(255, 107, 0, 0.6),
    0 0 60px rgba(255, 107, 0, 0.3);
}

.zoom-close-btn:hover svg {
  transform: rotate(90deg);
}

.zoom-close-btn:active {
  transform: scale(0.95);
}

/* ============================================
   ZOOM IMAGES
   ============================================ */

.zoom-img {
  width: 100%;
  max-width: min(500px, 80vw);
  max-height: 70vh;
  object-fit: contain;
  height: auto;
  border-radius: 12px;
  border: 2px solid rgba(255, 107, 0, 0.4);
  box-shadow:
    0 0 40px rgba(255, 107, 0, 0.3),
    0 10px 40px rgba(0, 0, 0, 0.8);
  filter: brightness(1.15) contrast(1.1);
  animation: zoomImageReveal 0.8s cubic-bezier(0.16, 1, 0.3, 1);
  flex-shrink: 1;
}

@keyframes zoomImageReveal {
  from {
    opacity: 0;
    transform: scale(0.85) translateY(30px);
    filter: brightness(1.15) contrast(1.1) blur(10px);
  }
  to {
    opacity: 1;
    transform: scale(1) translateY(0);
    filter: brightness(1.15) contrast(1.1) blur(0);
  }
}

.zoom-img-topdown {
  animation-delay: 0.1s;
}

.zoom-img-optz {
  animation-delay: 0.3s;
}

.zoom-img-optz-full {
  max-width: 1000px;
}

/* Zoom Label */
.zoom-label {
  font-family: 'JetBrains Mono', monospace;
  font-size: clamp(0.85rem, 1.5vw, 1rem);
  color: #ff8c00;
  text-transform: uppercase;
  letter-spacing: 0.12em;
  padding: 0.75rem 1.25rem;
  background: rgba(255, 107, 0, 0.1);
  border: 1px solid rgba(255, 107, 0, 0.3);
  border-radius: 8px;
  backdrop-filter: blur(10px);
  box-shadow:
    0 0 20px rgba(255, 107, 0, 0.2),
    inset 0 1px 2px rgba(255, 107, 0, 0.1);
  animation: labelSlide 0.8s cubic-bezier(0.16, 1, 0.3, 1) 0.5s both;
  max-width: 100%;
  text-align: center;
  box-sizing: border-box;
  word-wrap: break-word;
  flex-shrink: 0;
}

@keyframes labelSlide {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* ============================================
   RESPONSIVE DESIGN
   ============================================ */

@media (max-width: 1440px) {
  .chip-base-layer,
  .chip-optz-layer {
    max-width: 700px;
  }

  .chip-explorer-container {
    padding: 0 1.5rem;
    max-width: 1400px;
  }

  .lateral-content {
    max-width: 550px;
    padding: 2rem;
  }

  .lateral-connector {
    width: 200px;
  }

  .lateral-left .lateral-connector {
    right: -40px;
  }

  .lateral-right .lateral-connector {
    left: -40px;
  }
}

@media (max-width: 1024px) {
  .chip-lateral-container {
    min-height: auto;
  }

  .chip-base-layer,
  .chip-optz-layer {
    max-width: 600px;
    padding: 1.5rem;
  }

  /* Don't shift 127µm chip */
  #chip-explorer-127 .chip-lateral-container.left-panel-active .chip-base-layer {
    transform: translateX(0);
  }

  /* Always shift 250µm chip to right for tablets */
  #chip-explorer-250 .chip-base-layer {
    transform: translateX(180px);
  }

  /* Adjust panel position for tablets */
  .lateral-left {
    left: 60px;
  }

  .chip-explorer-container {
    max-width: 100%;
    padding: 0 1rem;
  }

  /* Adjust lateral panels for tablets */
  .lateral-left,
  .lateral-right {
    width: 60%;
    max-width: 600px;
  }

  .lateral-left {
    padding-left: 1rem;
  }

  .lateral-right {
    padding-right: 1rem;
  }

  .lateral-content {
    max-width: 100%;
  }

  /* Adjust connector lines on tablet */
  .lateral-connector {
    width: 150px;
  }

  .lateral-left .lateral-connector {
    right: -30px;
  }

  .lateral-right .lateral-connector {
    left: -30px;
  }

  /* Keep view buttons in original positions */
  .chip-view-btn-left {
    left: 24%;
    top: 75%;
    transform: translateY(-50%);
  }

  .chip-view-btn-right {
    left: 15%;
    bottom: 0%;
    transform: none;
  }

  .chip-view-btn .btn-icon {
    width: 44px;
    height: 44px;
  }

  .chip-view-btn .btn-icon svg {
    width: 24px;
    height: 24px;
  }
}

@media (max-width: 910px) {
  .chip-base-layer,
  .chip-optz-layer {
    max-width: 100%;
  }

  /* Don't shift 127µm chip */
  #chip-explorer-127 .chip-lateral-container.left-panel-active .chip-base-layer {
    transform: translateX(0);
  }

  /* Always shift 250µm chip to right for smaller tablets */
  #chip-explorer-250 .chip-base-layer {
    transform: translateX(120px);
  }

  .lateral-left,
  .lateral-right {
    width: 70%;
    max-width: 500px;
  }

  .lateral-left {
    padding-left: 0.5rem;
  }

  .lateral-right {
    padding-right: 0.5rem;
  }

  .lateral-content {
    max-width: 100%;
    padding: 1.5rem;
  }

  .lateral-connector {
    display: none;
  }

  .chip-view-btn .btn-icon {
    width: 38px;
    height: 38px;
  }

  .chip-view-btn .btn-icon svg {
    width: 20px;
    height: 20px;
  }

  .chip-view-btn .btn-text {
    font-size: 0.7rem;
    padding: 0.35rem 0.7rem;
  }

  /* 127µm button positions for mobile */
  .chip-view-btn-left-127 {
    left: 15%;
    bottom: 8%;
  }

  .chip-view-btn-right-127 {
    right: 15%;
    bottom: 8%;
  }
}
@media (max-width: 1818px) {
  .connection-arrow-svg.right-smallum,
  .connection-arrow-svg.left-smallum {
    display:none;
  }
}
/* Shrink lateral panels as screen gets smaller */
@media (max-width: 1720px) {
  .lateral-panel {
    width: 40%;
    max-width: 450px;
  }

  .lateral-content {
    padding: 1.5rem;
  }

  #chip-explorer-250 .chip-base-layer {
    transform: translateX(200px);
  }
  .twofifty.connection-arrow-svg{
    left:54%;
    width:56%;
  }
}

@media (max-width: 1500px) {
  .lateral-panel {
    width: 35%;
    max-width: 380px;
  }

  .chip-base-layer {
    max-width: 650px;
  }

  #chip-explorer-250 .chip-base-layer {
    transform: translateX(150px);
  }
    .twofifty.connection-arrow-svg{
        left: 51%;
        width: 47%;
  }
}

@media (max-width: 1300px) {
  .lateral-panel {
    width: 30%;
    max-width: 320px;
  }

  .chip-base-layer {
    max-width: 550px;
  }

  .lateral-content {
    padding: 1.2rem;
  }

  #chip-explorer-250 .chip-base-layer {
    transform: translateX(120px);
  }
}

@media (max-width: 1100px) {
  .lateral-panel {
    width: 28%;
    max-width: 280px;
  }

  .chip-base-layer {
    max-width: 450px;
  }

  #chip-explorer-250 .chip-base-layer {
    transform: translateX(100px);
  }
}

@media (max-width: 768px) {
  .snap-page[data-step="1"] {
    padding: 2rem 1rem;
    overflow-x: hidden;
  }

  /* Hide arrows on mobile */
  .connection-arrow-svg {
    display: none !important;
  }

  /* Stack layout vertically */
  .chip-lateral-container {
    flex-direction: column;
    align-items: center;
    gap: 1.5rem;
  }

  /* Reset chip transforms - no shifting */
  #chip-explorer-250 .chip-base-layer,
  #chip-explorer-127 .chip-base-layer,
  #chip-explorer-127 .chip-lateral-container.left-panel-active .chip-base-layer {
    transform: none !important;
  }

  /* Make lateral panels stack naturally */
  .lateral-panel {
    position: relative !important;
    top: auto !important;
    left: auto !important;
    right: auto !important;
    transform: none !important;
    width: 100% !important;
    max-width: 100% !important;
    padding: 0 !important;
  }

  .lateral-left,
  .lateral-right {
    order: 1;
  }

  .chip-base-layer {
    order: 0;
  }

  .chip-explorer-container {
    overflow: hidden;
  }

  #chip-explorer-250,
  #chip-explorer-127 {
    overflow-x: hidden;
  }

  .lateral-content {
    transform: scale(1) !important;
    opacity: 1 !important;
  }

  .step1-modern-header {
    max-width: 100%;
    padding: 0 1rem;
  }

  .step1-toggle {
    padding: 0.4rem;
    width: 100%;
    max-width: 100%;
    display: flex;
    justify-content: center;
  }

  .node-btn {
    padding: 0.6rem 1.5rem;
    font-size: 0.9rem;
    flex: 1;
    max-width: 45%;
  }

  .chip-explorer-container {
    padding: 0 1rem;
  }

  .chip-base-layer,
  .chip-optz-layer {
    padding: 1rem;
    max-width: 100%;
    margin-left: auto;
    margin-right: auto;
  }

  .lateral-content {
    padding: 1.5rem;
    max-width: 100%;
  }

  .lateral-img {
    margin-bottom: 1rem;
  }

  .lateral-label {
    font-size: 0.85rem;
    padding: 0.6rem 0.8rem;
  }

  .chip-view-btn .btn-icon {
    width: 38px;
    height: 38px;
  }

  .chip-view-btn .btn-icon svg {
    width: 20px;
    height: 20px;
  }

  .chip-view-btn .btn-text {
    font-size: 0.7rem;
    padding: 0.35rem 0.7rem;
  }

  .lateral-connector {
    display: none;
  }

  /* 127µm button positions for tablet */
  .chip-view-btn-left-127 {
    left: 12%;
    bottom: 8%;
  }

  .chip-view-btn-right-127 {
    right: 12%;
    bottom: 8%;
  }
}

@media (max-width: 480px) {
  /* Reset all transforms on small mobile */
  #chip-explorer-127 .chip-lateral-container.left-panel-active .chip-base-layer,
  #chip-explorer-250 .chip-base-layer,
  #chip-explorer-127 .chip-base-layer {
    transform: none !important;
  }

  .step1-main-title {
    font-size: 1.5rem;
  }

  .step1-subtitle {
    font-size: 1.8rem;
    font-weight: 600;
  }

  .step1-modern-header {
    width: 100%;
    max-width: 100%;
    padding: 0 0.5rem;
  }

  .step1-toggle {
    flex-direction: column;
    width: 100%;
    max-width: 280px;
  }

  .node-btn {
    width: 100%;
  }

  .chip-explorer-container {
    max-width: 100%;
    width: 100%;
    overflow-x: hidden;
  }

  .chip-explorer {
    width: 100%;
    max-width: 100%;
  }

  .chip-base-layer,
  .chip-optz-layer {
    max-width: 100%;
    width: 100%;
    padding: 0.8rem;
    box-sizing: border-box;
  }

  .chip-base-img,
  .chip-optz-img {
    width: 100%;
    max-width: 100%;
  }

  .lateral-left,
  .lateral-right {
    width: 90%;
    max-width: 400px;
  }

  .lateral-left {
    padding-left: 0.25rem;
  }

  .lateral-right {
    padding-right: 0.25rem;
  }

  .lateral-content {
    padding: 1.2rem;
    max-width: 100%;
  }

  /* Dual image layout adjustments for mobile */
  .lateral-dual .lateral-content {
    gap: 1rem;
  }

  .lateral-img-container {
    gap: 0.5rem;
  }

  .lateral-img {
    border-radius: 8px;
  }

  .lateral-img-small {
    max-height: 150px;
  }

  .lateral-label {
    font-size: 0.75rem;
    padding: 0.5rem 0.6rem;
    letter-spacing: 0.08em;
  }


  .lateral-close-btn {
    top: 0.75rem;
    right: 0.75rem;
    width: 35px;
    height: 35px;
  }

  .lateral-close-btn svg {
    width: 18px;
    height: 18px;
  }

  .lateral-connector {
    display: none;
  }

  .chip-view-btn .btn-icon {
    width: 35px;
    height: 35px;
  }

  .chip-view-btn .btn-icon svg {
    width: 18px;
    height: 18px;
  }

  .chip-view-btn .btn-text {
    display: none;
  }

  .chip-view-btn-left {
    left: 20%;
    top: 70%;
  }

  .chip-view-btn-right {
    left: 12%;
    bottom: 5%;
  }

  /* 127µm button positions for mobile */
  .chip-view-btn-left-127 {
    left: 10%;
    bottom: 5%;
  }

  .chip-view-btn-right-127 {
    right: 10%;
    bottom: 5%;
  }
}

/* ============================================
   ACCESSIBILITY
   ============================================ */

@media (prefers-reduced-motion: reduce) {
  .snap-page[data-step="1"]::before,
  .snap-page[data-step="1"]::after,
  .connector-line,
  .lateral-content {
    animation: none !important;
  }

  .chip-explorer,
  .lateral-panel,
  .lateral-img,
  .node-btn,
  .chip-view-btn {
    transition: opacity 0.2s ease, transform 0.2s ease !important;
  }
}

/* Focus States for Keyboard Navigation */
.node-btn:focus-visible,
.chip-view-btn:focus-visible,
.lateral-close-btn:focus-visible {
  outline: 3px solid rgba(255, 140, 0, 0.8);
  outline-offset: 4px;
}
