/* ===================
   Global Variables
   =================== */
:root {
    --hero-text-anim-delay: 0.15s;
}

/* ===================
   Base Styles
   =================== */
* {
    margin: 0;
    cursor: none;
}

a {
    text-decoration: none;
    user-select: none;
    -webkit-user-drag: none;
}

@keyframes fade-in {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.custom-cursor {
    width: 40px;
    height: 40px;
    border: 2px solid #fff;
    border-radius: 50%;
    opacity: 0.15;
    position: fixed;
    pointer-events: none;
    transform: translate(-50%, -50%);
    transition: width 0.2s, height 0.2s;
    z-index: 9999;
}

.custom-cursor.clicked {
    width: 30px;
    height: 30px;
}

body {
    margin: 0;
    padding: 0;
    font-family: 'Montserrat', sans-serif;
    background-color: #090C08;
    color: #fff;
    overflow-x: hidden;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    position: relative;
}

/* ===================
   Layout & Grid
   =================== */
.main-container {
    width: 100%;
    max-width: 1400px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 40px;
    padding: 0 40px;
    margin: 0 auto;
    min-height: 100vh;
    align-items: center;
}

.left-content {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    max-width: 700px;
}

.slides-content {
    display: flex;
    justify-content: center;
    align-items: center;
    width: 100%;
    position: relative;
}

#skew {
    position: relative;
    transform-style: preserve-3d;
    opacity: 0;
    animation: fade-in 0.8s cubic-bezier(0.23, 1, 0.32, 1) forwards;
    animation-delay: 2s;
}

.presentation-slide {
    background: #171a177e;
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    padding: 30px;
    width: 100%;
    max-width: 500px;
    aspect-ratio: 16/10;
    backdrop-filter: blur(5px);
    transform-origin: center center;
    will-change: transform, opacity, filter;
    transition: all 0.5s cubic-bezier(0.25, 0.1, 0.25, 1.0);
    transform-style: preserve-3d;
    transform: translateZ(0);
    display: flex;
    flex-direction: column;
    gap: 20px;
    font-family: 'Montserrat', sans-serif;
    position: relative;
    z-index: 1;
    box-shadow: 10px 10px 0px #171a173b;
}

.presentation-slide h1 {
    color: white;
    font-size: 1.8rem;
    margin-bottom: 20px;
    font-weight: 500;
}

.presentation-slide p {
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    line-height: 1.6;
    font-weight: 400;
}

.background-gradient {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: radial-gradient(circle 175vh at 0% -25%, #130b23, #090C08);
    z-index: -3;
    pointer-events: none;
    user-select: none;
    opacity: 0;
    animation: fade-in 1s ease-in forwards;
    animation-delay: 2s;
}

#background-dots {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100vh;
    z-index: -1;
}

@keyframes fade-in-partial {
    from {
        opacity: 0;
    }
    to {
        opacity: 0.5;
    }
}

@keyframes intro-text-fade-in {
    from {
        opacity: 0;
        transform: translateX(5px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes slide-up-out {
    0% {
        opacity: 1;
        transform: translateY(0);
    }
    100% {
        opacity: 0;
        transform: translateY(-20px);
    }
}

@keyframes slide-up-in {
    0% {
        opacity: 0;
        transform: translateY(20px);
    }
    100% {
        opacity: 1;
        transform: translateY(0);
    }
}

.hero-text {
    user-select: none;
    position: relative;
    width: 100%;
    margin: 0 auto 3vh;
    font-family: 'Libre Baskerville', serif;
    font-size: 2.5rem;
    color: white;
    text-align: center;
    z-index: 1;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.25em;
    overflow: hidden;
}

.hero-text .word {
    display: inline-block;
    opacity: 0;
    animation: intro-text-fade-in 0.5s cubic-bezier(0.25, 0.1, 0.25, 1.0) forwards;
    color: #ffffff78;
}

.hero-text .highlight {
    opacity: 0;
    animation: 0;
}

.hero-text .word:nth-child(1) {
    animation-delay: calc(0s + var(--hero-text-anim-delay));
}

.hero-text .word:nth-child(2) {
    animation-delay: calc(0.75s + var(--hero-text-anim-delay));
}

.hero-text .word:nth-child(4) {
    animation-delay: calc(1.15s + var(--hero-text-anim-delay));
    margin: 0 -0.5em;
}

.highlight-container {
    position: relative;
    height: 2.5rem;
    display: inline-flex;
    align-items: center;
    overflow: hidden;
    transition: width 0.5s cubic-bezier(0.25, 0.1, 0.25, 1.0);
    width: var(--container-width, 150px);
}

#hero-sub-period {
    color: #ffffff78;
}

.hero-text .highlight {
    color: #b956e3;
    font-weight: bolder;
    position: absolute;
    left: 0;
    right: 0;
    opacity: 0;
    white-space: nowrap;
    width: 100%;
    text-align: left;
    display: inline-block;
}

.hero-text .highlight.active {
    opacity: 1;
    transform: translateY(0);
    position: absolute;
    z-index: 2;
}

.hero-text .highlight.slide-up-out {
    animation: slide-up-out 0.5s forwards cubic-bezier(0.25, 0.1, 0.25, 1.0);
    z-index: 1;
}

.hero-text .highlight.slide-up-in {
    animation: slide-up-in 0.5s forwards cubic-bezier(0.25, 0.1, 0.25, 1.0);
    z-index: 2;
}

.hero-subtext {
    font-family: 'Libre Baskerville', serif;
    color: rgba(255, 255, 255, 0.6);
    font-size: 1.1rem;
    text-align: center;
    margin: 0.15vh auto 1vh;
    opacity: 0;
    animation: fade-in 0.5s cubic-bezier(0.25, 0.1, 0.25, 1.0) forwards;
    animation-delay: 1.3s;
    font-weight: 400;
    width: 80%;
}

/* ===================
   Pills Section
   =================== */
.pills-container {
    position: relative;
    width: 100%;
    max-width: 800px;
    margin: 2vh auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
    justify-content: center;
    opacity: 1;
}

@keyframes pill-fade-in {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.pills-row {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

.pills-row.secondary {
    margin-left: -20px;
    justify-content: flex-start;
    padding-left: 10%;
}

.pill {
    flex: 0 1 auto;
    min-width: 120px;
    max-width: 170px;
    display: flex;
    align-items: center;
    gap: 8px;
    background: rgba(255, 255, 255, 0.05);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    backdrop-filter: blur(5px);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.8rem;
    color: rgba(255, 255, 255, 0.8);
    white-space: nowrap;
    transition: all 0.2s ease;
    opacity: 0;
    animation: pill-fade-in 0.5s cubic-bezier(0.25, 0.1, 0.25, 1.0) forwards;
}

.pill:hover {
    background: rgba(255, 255, 255, 0.1);
    transform: translateY(-1px);
}

.pill svg {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
}

.pill.purple svg {
    fill: #b956e3;
}

.pill.blue svg {
    fill: #56a0e3;
}

.pill.orange svg {
    fill: #e3a256;
}

/* First row pills */
.pills-row:nth-child(1) .pill:nth-child(1) { animation-delay: 1.5s; }
.pills-row:nth-child(1) .pill:nth-child(2) { animation-delay: 1.7s; }
.pills-row:nth-child(1) .pill:nth-child(3) { animation-delay: 1.9s; }
.pills-row:nth-child(1) .pill:nth-child(4) { animation-delay: 2.1s; }

/* Second row pills */
.pills-row:nth-child(2) .pill:nth-child(1) { animation-delay: 2.3s; }
.pills-row:nth-child(2) .pill:nth-child(2) { animation-delay: 2.5s; }
.pills-row:nth-child(2) .pill:nth-child(3) { animation-delay: 2.7s; }
.pills-row:nth-child(2) .pill:nth-child(4) { animation-delay: 2.9s; }

/* ===================
   Input Section
   =================== */
.input-container {
    animation: fade-in-partial 0.5s cubic-bezier(0.25, 0.1, 0.25, 1.0) forwards;
    animation-delay: 3.1s;
    position: relative;
    width: 90%;
    max-width: 550px;
    margin: 3vh auto 0;
    display: flex;
    align-items: center;
    opacity: 0;
}

.input-box-container {
    width: 100%;
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.085);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    backdrop-filter: blur(5px);
    border-radius: 10px;
    display: none;
}

.input-box {
    flex: 1;
    background: transparent;
    border: none;
    padding: 8px;
    color: white;
    font-size: 0.9rem;
    font-family: 'Montserrat', sans-serif;
    outline: none;
}

.input-box::placeholder {
    color: rgba(255, 255, 255, 0.5);
}

.send-button {
    background: transparent;
    border: none;
    padding: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s ease;
}

.send-button:hover {
    transform: scale(1.1);
}

.send-button svg {
    fill: white;
    width: 20px;
    height: 20px;
    opacity: 0.7;
}

/* ===================
   Checkbox Section
   =================== */
.checkbox-container {
    animation: fade-in-partial 0.5s cubic-bezier(0.25, 0.1, 0.25, 1.0) forwards;
    animation-delay: 3.2s;
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 16px;
    width: 90%;
    max-width: 550px;
    margin: 0 auto;
    opacity: 0;
    padding-top: 16px;
}

.checkbox-label {
    display: flex;
    align-items: center;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.85rem;
    transition: color 0.2s ease;
}

.checkbox-label:hover {
    color: white;
}

.custom-checkbox {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    border: 1px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    margin-right: 8px;
    background: rgba(255, 255, 255, 0.08);
    position: relative;
    transition: all 0.2s ease;
}

.custom-checkbox:checked {
    background: transparent;
    border-color: rgba(255, 255, 255, 0.9);
    border-width: 2px;
}

.custom-checkbox:checked::after {
    content: '';
    position: absolute;
    width: 4px;
    height: 8px;
    border: solid white;
    border-width: 0 2px 2px 0;
    top: 2px;
    left: 5px;
    transform: rotate(45deg);
}

/* ===================
   Slide Deck
   =================== */
.slide-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 20px;
    align-items: center;
    justify-content: center;
}

.slide-content svg {
    max-height: 200px;
    width: 100%;
    transition: all 0.3s ease;
}

.slide-content svg:hover {
    transform: scale(1.02);
}

.slide-content p {
    text-align: center;
    margin-top: auto;
}

/* ===================
   SVG Visualizations
   =================== */
.algorithm-viz rect {
    transition: all 0.3s ease;
}

.algorithm-viz rect:hover {
    opacity: 1;
    transform: translateY(-5px);
}

.complexity-viz path {
    transition: all 0.3s ease;
}

.complexity-viz path:hover {
    opacity: 1;
    stroke-width: 2;
}

.marble-slide-text {
    color: #b956e3;
    font-weight: bold;
    font-family: 'Libre Baskerville', serif;
}

.db-viz rect {
    transition: all 0.3s ease;
}

.db-viz rect:hover {
    opacity: 1;
    transform: scale(1.05);
}

.recursion-viz circle {
    transition: all 0.3s ease;
}

.recursion-viz circle:hover {
    opacity: 1;
    transform: scale(1.1);
}

.oop-viz rect {
    transition: all 0.3s ease;
}

.oop-viz rect:hover {
    opacity: 1;
    transform: translateY(-2px);
}

.dp-viz rect {
    transition: all 0.3s ease;
}

.dp-viz rect:hover {
    opacity: 1;
}

.graph-viz circle {
    transition: all 0.3s ease;
}

.graph-viz circle:hover {
    opacity: 1;
    width: 44px;
    height: 44px;
}

/* ===================
   Animations
   =================== */
@keyframes slide-in {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ===================
   Media Queries
   =================== */
@media (max-width: 1024px) {
    .main-container {
        grid-template-columns: 1fr;
        padding: 40px 20px;
    }

    .slides-content {
        display: none;
    }
}

@media (max-width: 768px) {
    .hero-text {
        font-size: 2rem;
    }
    
    .pills-container {
        margin-top: 5vh;
    }
    
    .pills-row.secondary {
        margin-top: 12px;
    }
    
    .pill {
        font-size: 0.8rem;
        padding: 5px 10px;
    }

    .checkbox-container {
        max-width: 450px;
        gap: 12px;
    }
}

@media (max-width: 480px) {
    .hero-text {
        font-size: 1.8rem;
    }
    
    .main-container {
        padding: 10vh 16px 0;
    }
    
    .pills-row {
        flex-wrap: wrap;
    }
    
    .pill {
        width: calc(50% - 6px);
        margin-bottom: 8px;
    }

    .input-container {
        padding: 3px 8px;
    }

    .checkbox-container {
        flex-direction: column;
        align-items: flex-start;
        max-width: 350px;
        margin-top: 12px;
        gap: 8px;
    }

    .checkbox-label {
        font-size: 0.8rem;
    }
}

@media (max-height: 700px) {
    .main-container {
        padding-top: 6vh;
    }
    
    .hero-text {
        margin-bottom: 2vh;
    }
    
    .pills-container {
        margin-top: 2vh;
    }
    
    .input-container {
        margin-top: 2vh;
    }

    .checkbox-container {
        margin-top: 10px;
    }
}

.teach-me-button {
    width: 100%;
    background: rgba(255, 255, 255, 0.085);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 12px 24px;
    border-radius: 10px;
    color: rgba(255, 255, 255, 0.8);
    font-family: 'Montserrat', sans-serif;
    font-size: 0.9rem;
    backdrop-filter: blur(5px);
    transition: all 0.2s ease;
    text-align: center;
}

.teach-me-button:hover {
    background: rgba(255, 255, 255, 0.35);
    transform: translateY(-1px);
}

@keyframes pop-in {
    0% {
        opacity: 0;
        transform: scale(0.95) translateY(10px);
        filter: blur(10px);
    }
    50% {
        opacity: 0.5;
        transform: scale(1.02) translateY(-5px);
        filter: blur(0px);
    }
    100% {
        opacity: 1;
        transform: scale(1) translateY(0);
        filter: blur(0px);
    }
}

/* Hover effects */
#skew:hover::before {
    transform: translateZ(-20px) translateX(12px) translateY(12px);
}

#skew:hover::after {
    transform: translateZ(-12px) translateX(6px) translateY(6px);
}

#skew:hover .presentation-slide {
    transform: translateZ(4px);
}