/* ============================================
   ABOUT PAGE SPECIFIC STYLES
   Full-screen background video with typewriter text overlay
   Same layout, font sizes, and mobile settings as index page
   ============================================ */

/* Override body background from style.css to allow video blending */
body {
    min-height: 100vh;
    /* Match index: vertically centered block in the viewport */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 2rem;
    /* Ensure background extends behind status bar on iOS */
    background-attachment: fixed;
    /* CRITICAL: Body must be transparent for mix-blend-mode to work with video */
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    /* Remove any default background from style.css */
}

/* Mobile: vertically center text block like desktop */
@media (max-width: 768px) {
    body {
        /* Keep flex layout for vertical centering */
        display: flex !important;
        align-items: center !important;
        justify-content: center !important;
        /* Use global content well gutter via .container (var(--padding)) */
        padding: 0;
    }
    main {
        width: 100%;
        /* Mobile: vertically center like desktop */
        display: flex !important;
        align-items: center !important;
        justify-content: flex-start !important;
        min-height: 100vh !important;
    }
    /* Match desktop container padding */
    .container {
        padding: 0 var(--padding) !important;
        margin: 0 !important;
    }
}

main {
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    position: relative;
    z-index: 1;
    /* Don't isolate - allow text to blend with video */
    isolation: auto;
    width: 100%;
}

/* Video Background - must be in backdrop for mix-blend-mode */
.video-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    height: 100vh;
    height: 100dvh;
    /* CRITICAL: Video must be at z-index 0 or negative to be in backdrop */
    z-index: -1;
    overflow: hidden;
    /* Ensure video is behind everything */
    pointer-events: none;
}

.video-background video {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center;
    display: block;
}

/* Container for text - same as index page */
/* Uses default .container styles from style.css (max-width: 1440px, padding: 0 5vw) */
.container {
    position: relative;
    z-index: 1;
    /* CRITICAL: Remove any background that might block blending */
    background: transparent !important;
    background-color: transparent !important;
    background-image: none !important;
    /* Match index `.container` defaults (from style.css) */
    max-width: var(--max-width);
    margin: 0 auto;
    padding: 0 var(--padding);
    width: 100%;
    box-sizing: border-box;
}

/* Text wrapper to enable blending */
.text-wrapper {
    position: relative;
    background: transparent;
    /* Don't isolate - we want to blend with video backdrop */
    isolation: auto;
    /* Ensure left alignment - no centering */
    text-align: left;
    width: 100%;
}

/* Typewriter Text - same styling as index page */
.typewriter-text {
    font-size: 48px;
    font-weight: 450;
    line-height: 1.48; /* 148% - slightly more compact */
    min-height: 300px;
    position: relative;
    transition: color var(--transition-slow);
    font-family: var(--font-primary);
    font-optical-sizing: auto;
    font-variation-settings: "slnt" 0, "wdth" 100, "GRAD" 0, "ROND" 0;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    /* Near black text color */
    color: #1a1a1a;
    /* Match index: don't render HTML indentation whitespace as visible text */
    white-space: normal;
    word-wrap: break-word;
    background: transparent;
    /* Ensure text is above video but can blend with it */
    z-index: 1;
    /* Force hardware acceleration for smooth blending */
    will-change: contents;
    transform: translateZ(0);
    /* Match index: left-align text, no centering */
    text-align: left;
    width: 100%;
    /* Guarantee block-start feels like true top-left within the block */
    padding: 0;
    margin: 0;
    text-indent: 0;
}

/* Cursor styling */
.typewriter-text .cursor {
    background-color: #1a1a1a;
}

/* Clickable links - AI agent style with animated circular element - exact same as index page */
.typewriter-text .clickable-link {
    text-decoration: none !important;
    color: inherit !important;
    line-height: inherit !important; /* Inherit exact line-height from parent to prevent expansion */
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                padding-right 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                background 0.3s ease,
                backdrop-filter 0.3s ease !important;
    -webkit-tap-highlight-color: transparent !important;
    touch-action: manipulation;
    user-select: none;
    -webkit-user-select: none;
    cursor: pointer !important;
    position: relative;
    z-index: 1000 !important;
    pointer-events: auto !important;
    display: inline-block !important;
    /* 2px less vertical padding vs prior (2px -> 0px) */
    padding: 1px 16px; /* Balanced horizontal padding */
    margin: 1px 2px; /* 2px vertical gap between backgrounds in different lines */
    border-radius: 999px; /* Fully rounded background */
    background: rgba(119, 122, 129, 0.33) !important; /* #777A81 with 33% opacity */
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    /* Ensure links are always on top */
    isolation: isolate;
    vertical-align: baseline; /* Consistent baseline alignment */

    /* Circular element sizing/placement (kept INSIDE the pill background) */
    --orbit-size: 28px;  /* desktop default */
    --orbit-inset: 10px;  /* padding between circle and right edge of pill (added 2px) */
    --orbit-gap: 0px;   /* space between text and circle (reduced by 4px from 2px) */
}

/* Circular animated element - appears on hover/touch */
.typewriter-text .clickable-link::before {
    content: '';
    position: absolute;
    right: var(--orbit-inset);
    top: 50%;
    transform: translateY(-50%) scale(0);
    width: var(--orbit-size);
    height: var(--orbit-size);
    border-radius: 50%;
    background: transparent;
    box-shadow: none;
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s ease,
                width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                height 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: -1;
    pointer-events: none;
    will-change: transform, opacity;
}

/* Rotating gradient band inside circular element */
.typewriter-text .clickable-link::after {
    content: '';
    position: absolute;
    right: var(--orbit-inset);
    top: 50%;
    transform: translateY(-50%) scale(0) rotate(0deg);
    width: var(--orbit-size);
    height: var(--orbit-size);
    border-radius: 50%;
    /* Lighter "AI spectrum" band colors */
    background: conic-gradient(
        from 0deg,
        rgb(0, 255, 255),  /* cyan - more vibrant */
        rgb(0, 100, 255),   /* blue - more saturated */
        rgb(150, 0, 255),   /* violet - more vibrant */
        rgb(255, 0, 150),   /* pink - more saturated */
        rgb(255, 200, 0),   /* warm yellow - more vibrant */
        rgb(0, 255, 150),   /* mint - more saturated */
        rgb(0, 255, 255)   /* cyan loop */
    );
    /* Band mask tuned for 28px circle */
    mask: radial-gradient(circle, transparent 10px, black 10.5px, black 12.5px, transparent 13px);
    -webkit-mask: radial-gradient(circle, transparent 10px, black 10.5px, black 12.5px, transparent 13px);
    opacity: 0;
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                opacity 0.3s ease,
                width 0.3s cubic-bezier(0.34, 1.56, 0.64, 1),
                height 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    z-index: -1;
    pointer-events: none;
    animation: rotateGradient 3s linear infinite;
    animation-play-state: paused;
    will-change: transform, opacity;
    filter: saturate(1.15) brightness(1.05);
}

@keyframes rotateGradient {
    from {
        transform: translateY(-50%) scale(1) rotate(0deg);
    }
    to {
        transform: translateY(-50%) scale(1) rotate(360deg);
    }
}

.typewriter-text .clickable-link:hover,
.typewriter-text .clickable-link:active,
.typewriter-text .clickable-link.touching {
    text-decoration: none !important;
    color: inherit !important;
    /* Don't translate - keep left side fixed to avoid background moving right */
    padding-top: 1px !important;
    padding-bottom: 1px !important;
    padding-left: 16px !important;
    /* Reduce extension to avoid pushing into next line */
    padding-right: calc(16px + var(--orbit-size) + var(--orbit-gap) + var(--orbit-inset) - 4px) !important;
    background: rgba(119, 122, 129, 0.35) !important; /* #777A81 with 35% opacity on hover */
}

.typewriter-text .clickable-link:hover::before,
.typewriter-text .clickable-link:active::before,
.typewriter-text .clickable-link.touching::before {
    transform: translateY(-50%) scale(1);
    opacity: 1;
    width: var(--orbit-size);
    height: var(--orbit-size);
}.typewriter-text .clickable-link:hover::after,
.typewriter-text .clickable-link:active::after,
.typewriter-text .clickable-link.touching::after {
    transform: translateY(-50%) scale(1) rotate(0deg);
    opacity: 1;
    width: var(--orbit-size);
    height: var(--orbit-size);
    animation-play-state: running;
}

.typewriter-text .clickable-link:active {
    transform: translateX(4px) scale(0.98);
}

/* Desktop hover states */
@media (min-width: 769px) {
    .typewriter-text .clickable-link {
        cursor: pointer !important;
        pointer-events: auto !important;
    }
    
    .typewriter-text .clickable-link:hover {
        text-decoration: none !important;
    }
}

/* Mobile touch states */
@media (max-width: 768px) {
    .typewriter-text .clickable-link:active {
        transform: translateX(4px);
    }
}

/* Mobile responsive - same as index page */
@media (max-width: 768px) {
    body {
        padding: 0;
    }

    .typewriter-text {
        font-size: 40px;
        line-height: 1.48; /* 148% - slightly more compact */
    }
    
    /* Scale down circular element for 40px type */
    .typewriter-text .clickable-link {
        --orbit-size: 21px;
        --orbit-inset: 7px;
        --orbit-gap: 0px; /* Reduced by 4px from desktop */
    }

    .typewriter-text .clickable-link::after {
        mask: radial-gradient(circle, transparent 7.5px, black 8px, black 9.5px, transparent 10px);
        -webkit-mask: radial-gradient(circle, transparent 7.5px, black 8px, black 9.5px, transparent 10px);
    }
    
    /* Crop landscape video to portrait on mobile */
    .video-background video {
        object-fit: cover;
        object-position: center center;
    }
}

@media (max-width: 480px) {
    .typewriter-text {
        font-size: 28px;
        line-height: 1.48; /* 148% - slightly more compact */
    }
    
    /* Scale down circular element for 28px type */
    .typewriter-text .clickable-link {
        --orbit-size: 16px;
        --orbit-inset: 6px;
        --orbit-gap: 0px; /* Reduced by 4px from desktop */
    }

    .typewriter-text .clickable-link::after {
        mask: radial-gradient(circle, transparent 5.5px, black 6px, black 7px, transparent 7.5px);
        -webkit-mask: radial-gradient(circle, transparent 5.5px, black 6px, black 7px, transparent 7.5px);
    }
}
