* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

.ia-button-wrapper {
    position: relative;
    display: flex;
    align-items: center;
}

.ia-flyout {
    position: absolute;
    bottom: calc(100% - 12px);
    left: 4px;
    transform: translateY(10px);
    display: flex;
    gap: 0px;
    padding: 30px 16px 10px;
    border-radius: 40px;
    transition: opacity 0.25s ease, transform 0.25s ease;
    opacity: 0;
    pointer-events: none;
    z-index: 1600;
}

.stack-image.clickable {
    cursor: pointer;
    transition: transform 0.2s ease;
}

.stack-image.clickable:hover {
    transform: scale(1.02);
}

.image-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
}

.image-modal.active {
    opacity: 1;
    pointer-events: auto;
}

.modal-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.8);
}

.modal-image {
    position: relative;
    max-width: 90%;
    max-height: 90%;
    object-fit: contain;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.modal-close {
    position: absolute;
    top: 20px;
    right: 20px;
    width: 40px;
    height: 40px;
    border: none;
    background: white;
    border-radius: 50%;
    font-size: 24px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    transition: transform 0.2s ease;
}

.modal-close:hover {
    transform: scale(1.1);
}

.mini-control-island {
    position: fixed;
    bottom: calc(8vh - 20px);
    left: 50%;
    transform: translateX(-50%);
    z-index: 4000;
    display: flex;
    justify-content: center;
    align-items: center;
}

.segmented-toggle {
    position: relative;
    display: flex;
    background-color: rgba(0, 0, 0, 0.05);
    border-radius: 40px;
    padding: 4px;
    backdrop-filter: blur(14px);
}

.segment-option {
    position: relative;
    z-index: 2;
    padding: 12px 24px;
    border: none;
    background: none;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    border-radius: 36px;
    cursor: pointer;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.segment-option.active {
    color: #000;
}

.segment-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    height: calc(100% - 8px);
    background-color: white;
    border-radius: 36px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ia-flyout[aria-hidden="false"] {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.ia-flyout-btn {
    opacity: 0;
    height: 40px;
    padding: 0 26px;
    min-width: 150px;
    white-space: nowrap;
    line-height: 40px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transform: translateY(12px) scale(0.95);
    transition: transform 0.25s ease, opacity 0.25s ease;
    background-color: white;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    border-radius: 32px;
    cursor: pointer;
    border: none;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.ia-flyout-btn:hover {
    background-color: #f0f0f0;
    transform: translateY(-6px) scale(1);
}

.ia-flyout[aria-hidden="false"] .ia-flyout-btn {
    opacity: 1;
    transform: translateY(-6px) scale(1);
}

.ia-flyout[aria-hidden="false"] .ia-flyout-btn:nth-child(1) {
    transform: translate(-10px, -10px) scale(1);
}

.ia-flyout[aria-hidden="false"] .ia-flyout-btn:nth-child(2) {
    transform: translate(10px, -10px) scale(1);
}

.segment-option {
    position: relative;
    z-index: 2;
    padding: 12px 24px;
    border: none;
    background: none;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    border-radius: 36px;
    cursor: pointer;
    transition: color 0.3s ease;
    white-space: nowrap;
}

.segment-option.active {
    color: #000;
}

.segment-indicator {
    position: absolute;
    top: 4px;
    left: 4px;
    height: calc(100% - 8px);
    background-color: white;
    border-radius: 36px;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), width 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    z-index: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

.mini-control-btn {
    border: none;
    border-radius: 30px;
    padding: 8px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #343434;
    background: rgba(255, 255, 255, 0.8);
    cursor: pointer;
    transition: all 0.2s ease;
    backdrop-filter: blur(12px);
}

.mini-control-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-1px);
}

@media (max-width: 600px) {
    .mini-control-island {
        position: fixed;
        top: 80px;
        left: 50%;
        transform: translateX(-50%);
        bottom: auto;
        flex-wrap: wrap;
        gap: 8px;
        padding: 8px 12px;
        width: calc(100% - 40px);
        max-width: 320px;
        z-index: 1500;
    }

    .segment-option[data-view="ia"]::after {
        content: "IA";
    }
    
    .segment-option[data-view="ia"] {
        font-size: 0;
    }
    
    .segment-option[data-view="ia"]::after {
        font-size: 14px;
    }

    .segmented-toggle {
        width: 100%;
        padding: 2px;
    }

    .segment-option {
        padding: 8px 12px;
        font-size: 12px;
        flex: 1;
    }

    .mini-control-btn {
        flex: 1 1 calc(50% - 10px);
        text-align: center;
        font-size: 12px;
    }

    .ia-flyout {
        flex-direction: column;
        align-items: stretch;
        bottom: auto;
        top: calc(100% - 12px);
        transform: translateY(-10px);
        gap: 8px;
        padding: 8px 12px;
    }
    
    .ia-flyout[aria-hidden="false"] {
        transform: translateY(0);
    }
    
    .ia-flyout-btn {
        transform: translateY(-8px) scale(0.95);
        height: 32px;
        padding: 0 12px;
        min-width: 100px;
        font-size: 12px;
        line-height: 32px;
        border-radius: 20px;
    }
    
    .ia-flyout-btn:hover {
        transform: translateY(2px) scale(1);
    }
    
    .ia-flyout[aria-hidden="false"] .ia-flyout-btn {
        transform: translateY(2px) scale(1);
    }
    
    .ia-flyout[aria-hidden="false"] .ia-flyout-btn:nth-child(1) {
        transform: translate(-5px, 2px) scale(1);
    }
    
    .ia-flyout[aria-hidden="false"] .ia-flyout-btn:nth-child(2) {
        transform: translate(-5px, 2px) scale(1);
    }
}

body {
    font-family: 'Avenir', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    overflow-x: hidden;
    min-height: 300vh;
    padding-top: 120px;
}
/* Header */
header {
    position: fixed;
    top: 0;
    width: 100%;
    z-index: 3000;
    background-color: #FFFFFF;
    box-shadow: 0px 4px 4px 0px rgba(148, 147, 147, 0.063);
    transition: transform 0.3s ease, opacity 0.3s ease;
}

header.header-hidden {
    transform: translateY(-120%);
    opacity: 0;
}

#mob-ham-nav {
    display: none;
}

.navigation {
    height: 100px;
    background: white;
    padding: 0 4% 0 1.5%;
    z-index: 4;
    position: relative;
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.site-logo {
    position: relative;
    float: left;
    width: 80px;
    top: auto;
    border-radius: 50%;
    object-fit: cover;
}

.logo-link {
    display: inline-flex;
    align-items: center;
    margin-left: 0;
}

ul.nav-menu {
    margin-left: auto;
    margin-right: 0;
}

.nav-menu a {
    color: #212121;
    text-decoration: none;
}

.nav-menu a:hover {
    color: #002d5a;
    text-decoration: none;
}

ul.nav-menu {
    float: right;
    margin-right: 1%;
    list-style: none;
    margin: 40px 20px 20px 20px;
   
}

li.nav-item {
    display: inline-block;
    line-height: 50px;
    margin: 0 25px;
    margin-bottom: 25px;
}

.nav-item a {
    position: relative;
    padding: 25px 0;
    font-family: 'Avenir', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    font-size: 24px;
    color: #212121;
}

.nav-item a:hover {
    color: #002d5a;
}

.nav-item.btn2 a {
    color: #f2f2f2;
}

label #res-sign-one,
label #res-sign-two {
    display: none;
    position: absolute;
    right: 20px;
    top: 10px;
    font-size: 32px;
    color: #212121;
    line-height: 30px;
    cursor: pointer;
}

.btn2 { 
  border: none;
  background: linear-gradient(to bottom right, #1ecfc9 20%, #0761bb 100%);
  color: #FFFFFF; 
  border-radius: 10px;
  text-align: center;
  padding-right: 24px;
  padding-left: 18px;
  width: 150px;
  height: 60px;
  padding-top: 8px;
  padding-bottom: 8px;
  transition: all 0.2s ease;
  margin-right:20px;
  transition-duration: 1s;
      border-style: none;
      box-shadow: 0px 6px 6px 0px rgba(47,102,144,0.1) ;
}
.btn2:hover{
  transform: scale(1.1);
}

.btn2:active{
  transform: scale(1.1);
  transition: all 0.2s ease;
  text-decoration: none; 
  color: white;
}

.btn2:link{
  transform: scale(1.1);
  text-decoration: none; 
  color: white;
}

/* Background iframe */
.loading-animation {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
}

.loading-spinner {
    width: 60px;
    height: 60px;
    border: 4px solid #1ecfc920;
    border-top: 4px solid #0761bb;
    border-radius: 50%;
    animation: spin 1s linear infinite;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

.loading-animation.hidden {
    display: none;
}

.background-iframe {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: 1;
    opacity: 0.83;
    transition: opacity 0.3s ease;
    pointer-events: auto;
}

.background-iframe.interactive {
    pointer-events: auto;
    z-index: 10;
    opacity: 1;
}

.background-iframe.hidden {
    opacity: 0;
}

.background-iframe iframe {
    width: 100%;
    height: 100vh;
    border: none;
    pointer-events: auto;
    background: transparent;
    display: block;
    touch-action: pan-y;
    -webkit-overflow-scrolling: touch;
}

.background-iframe iframe[hidden] {
    display: none;
}

.image-stack {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 24px;
    padding: 4vw;
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(12px);
    box-shadow: inset 0 0 80px rgba(0, 0, 0, 0.05);
}

.image-stack[hidden] {
    display: none;
}

.image-stack img {
    width: min(90%, 900px);
    border-radius: 20px;
    box-shadow: 0 25px 60px rgba(0, 0, 0, 0.2);
    border: 1px solid rgba(255, 255, 255, 0.7);
}

/* Glassmorphism popup styling */
.popup {
    position: fixed;
    top: 50%;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(15px) saturate(180%);
    -webkit-backdrop-filter: blur(2px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 2rem;
    box-shadow: 0 8px 32px rgba(31, 38, 135, 0.2), inset 0 4px 20px rgba(255, 255, 255, 0.3);
    padding: 30px;
    padding-bottom: 110px;
    max-width: 400px;
    width: 90%;
    z-index: 1000;
    opacity: 0;
    transform: translateY(20px);
    transition: all 0.3s ease;
    pointer-events: none;
    box-shadow: 100px 2px 100px 600px rgba(255, 255, 255, 0.25);
}

.popup.active {
    opacity: 1;
    transform: translateY(0);
    pointer-events: auto;
}

.popup h2 {
    color: #343434;
    margin-bottom: 20px;
    font-size: 24px;
    font-weight: 600;
    font-family: 'Avenir', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.popup h3 {
    color: #343434;
    margin: 15px 0 10px 0;
    font-size: 18px;
    font-weight: 500;
    font-family: 'Avenir', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.popup p,
.popup li {
    color: #343434;
    line-height: 1.6;
    margin-bottom: 10px;
    font-family: 'Avenir', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
}

.popup ul {
    margin-left: 20px;
    margin-bottom: 15px;
}

/* Popup positions */
.popup-1 { top: 16vh; left: 2%; max-height: 72vh; overflow-y: auto; }
.popup-2 { top: 12vh; left: 2%; max-height: 72vh; overflow-y: auto; }
.popup-3 { top: 12vh; left: 2%; max-height: 72vh; overflow-y: auto; }
.popup-4 { top: 12vh; left: 2%; max-height: 72vh; overflow-y: auto; }
.popup-5 { top: 12vh; left: 2%; max-height: 72vh; overflow-y: auto; }
.popup-6 { top: 12vh; left: 2%; max-height: 72vh; overflow-y: auto; }
.popup-7 { top: 12vh; left: 2%; max-height: 72vh; overflow-y: auto; }

.toggle-container {
    display: flex;
    flex-direction: column-reverse;
    align-items: center;
    gap: 1px;
    transform: translateY(5px);
}

.toggle-label {
    font-size: 10px;
    color: #343434;
    margin-bottom: 0;
    font-weight: 500;
    text-align: center;
}

.control-bar {
    position: fixed;
    bottom: 5vh;
    left: 2%;
    width: 90%;
    max-width: 400px;
    transform: none;
    background-color: #ffffff20;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 12px 24px;
    border-radius: 50px;
    z-index: 2000;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 20px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
}

/* Toggle button */
.toggle-overlay {
    position: relative;
    width: 60px;
    height: 30px;
    background: #ffffff20;
    border-radius: 15px;
    padding: 3px;
    cursor: pointer;
    transition: background 0.3s;
    border: none;
    outline: none;
}

.toggle-overlay.active {
    background: linear-gradient(to bottom right, #1ecfc9 20%, #0761bb 100%);
}

.toggle-slider {
    position: absolute;
    top: 3px;
    left: 3px;
    width: 24px;
    height: 24px;
    background: white;
    border-radius: 50%;
    transition: transform 0.3s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.toggle-overlay.active .toggle-slider {
    transform: translateX(30px);
}

.toggle-icon {
    width: 16px;
    height: 16px;
    display: block;
}

.toggle-overlay:hover {
    transform: scale(1.05);
}

/* Navigation buttons */
.nav-buttons {
    display: flex;
    gap: 10px;
}

.nav-btn {
    padding: 8px 16px;
    font-size: 14px;
    font-weight: 500;
    color: #343434;
    background: rgba(255, 255, 255, 0.7);
    border: none;
    border-radius: 50px;
    cursor: pointer;
    transition: all 0.3s ease;
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(10px);
    box-shadow: 2px 2px 100px 500px rgba(52, 52, 52, 0.1);
}

.nav-btn:hover {
    background: rgba(255, 255, 255, 1);
    transform: translateY(-2px);
}

.overlay-container.active .nav-btn:hover {
    background: rgba(74, 144, 226, 0.1);
}

.nav-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background: rgba(200, 200, 200, 0.2);
}

/* Spacer content for scrolling */
.spacer {
    height: 50vh;
    width: 100%;
}

/* Overlay container */
.back-button {
    position: fixed;
    top: 20px;
    left: 20px;
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 20px;
    background: rgba(255, 255, 255, 0.25);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 40px;
    color: #333;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    z-index: 2001;
    text-decoration: none;
    opacity: 1;
    pointer-events: auto;
}

.back-button:hover {
    background: rgba(255, 255, 255, 1);
    border: 1px solid rgba(255, 255, 255, 0.5);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
}

.back-button:active {
    background: rgba(255, 255, 255, 1);
    transform: translateY(0);
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.1);
}

.back-icon {
    width: 20px;
    height: 20px;
    stroke: #343434;
}

.overlay-container.active .back-button:hover {
    background: rgba(74, 144, 226, 0.1);
}

.overlay-container {
    position: relative;
    z-index: 999;
}

/* Hidden state */
.overlay-hidden .popup {
    opacity: 0 !important;
    pointer-events: none !important;
}

/* Responsive */
@media (max-width: 900px) {
    body {
        padding-top: 80px;
    }

    .navigation {
        padding: 10px 16px;
    }

    .nav-menu {
        position: absolute;
        top: 100%;
        right: 0;
        background: rgba(255, 255, 255, 0.95);
        flex-direction: column;
        gap: 12px;
        padding: 20px;
        border-radius: 20px;
        min-width: 220px;
        box-shadow: 0 10px 30px rgba(0, 0, 0, 0.15);
        transform: translateY(10px);
        opacity: 0;
        pointer-events: none;
        transition: opacity 0.2s ease, transform 0.2s ease;
        z-index: 10;
    }

    .nav-item.btn2 a {
        width: 100%;
        text-align: center;
    }

    .hamburger {
        display: flex;
        align-items: center;
        justify-content: center;
    }

    #mob-ham-nav:checked ~ .hamburger #res-sign-one {
        display: none;
    }

    #mob-ham-nav:checked ~ .hamburger #res-sign-two {
        display: block;
    }

    #mob-ham-nav:checked ~ .nav-menu {
        opacity: 1;
        pointer-events: auto;
        transform: translateY(0);
    }

    .nav-menu,
    .logo-link {
        position: relative;
    }

    .nav-menu a {
        color: #343434;
    }
}

@media (max-width: 768px) {
    .popup {
        max-width: 85%;
        padding: 20px;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%);
        top: auto !important;
        bottom: 110px;
        max-height: calc(100vh - 220px);
        overflow-y: auto;
    }

    .popup.active {
        transform: translateX(-50%) translateY(0);
    }

    .popup-1,
    .popup-2,
    .popup-3,
    .popup-4,
    .popup-5,
    .popup-6,
    .popup-7 {
        left: 50% !important;
        right: auto !important;
    }

    .background-iframe,
    .background-iframe iframe {
        width: 100%;
    }

    .control-bar {
        position: fixed;
        left: 50%;
        transform: translateX(-50%);
        width: calc(100% - 32px);
        bottom: 20px;
        top: auto;
        justify-content: center;
        flex-wrap: wrap;
        gap: 12px;
    }
}
