*,
*:after,
*:before {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-height: 100vh;
    font-family: 'Open Sans', sans-serif;
    font-weight: 80;
    background: black;
    color: hsl(0 0% 90%);
    overflow-x: hidden;
    margin: 0;
    padding: 0;
}

p {
    max-width: 40ch;
}

/* Main container with scroll snap */
main {
    scroll-snap-type: y mandatory;
    height: 100vh;
    overflow-y: scroll;
    overflow-x: hidden;
}

/* Each section takes full viewport height */
section {
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
}

/* Articles within sections also take full height */
article {
    height: 100vh;
    scroll-snap-align: start;
    position: relative;
    overflow: hidden;
}

:is(h1, h2) {
    font-weight: 70;
    font-size: clamp(3rem, 3.35vw + 1rem, 8rem);
    letter-spacing: -0.075ch;
    margin: 0;
}

h1 {
    color: hsl(0 0% 90%);
}

/* Navigation */
nav {
    position: fixed;
    top: 0;
    right: 0;
    padding: 1rem;
    z-index: 999;
    display: flex;
    justify-content: flex-end;
}

a:first-of-type {
    width: 48px;
    aspect-ratio: 1;
    display: grid;
    place-items: center;
    color: white;
}

/* Content styling */
.content {
    margin: 0 auto;
    width: 900px;
    max-width: 100%;
    height: 100%;
    z-index: 2;
    position: absolute;
    inset: 0;
    padding: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
}

#linkwithlogo {
    width: 160px;
    height: 67px;
    padding: 0px;
    display: none;
    background: rgba(255, 255, 255, 0.1);
    border-radius: 5px;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    /* Hide logo by default */
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#linkwithlogo img {
    width: 150px;
    background-color: white;
    padding: 5px;
    margin-left: 5px;
    margin-top: 8px;
    transition: transform .5s;
    transform-origin: left top;
}

/* Show logo from second slide onwards */
section:nth-of-type(n+2) ~ nav #linkwithlogo,
section:nth-of-type(2) ~ nav #linkwithlogo {
    opacity: 1;
    visibility: visible;
}

/* Alternative approach for showing logo from second slide onwards */
body:not(.first-slide) nav #linkwithlogo {
    opacity: 1;
    visibility: visible;
}

#finalText {
    background: rgba(0, 0, 0, .5);
    padding: 20px;
    border-radius: 10px;
    margin-top: 20px;
    max-height: 90vh;
    overflow-y: auto;
}

#finalText h2 {
    margin-top: 50px;
}

#finalText .row {
    text-align: justify;
}

#finalText .row {
    display: flex;
    flex-flow: row wrap;
    gap: 2rem;
}

#finalText .column1 {
    order: 1;
    width: 50%;
    flex: 1;
    min-width: 300px;
}

#finalText .column2 {
    order: 2;
    width: 50%;
    flex: 1;
    min-width: 300px;
}

@media (max-height: 940px) and (max-width: 768px) {
    #finalText {
        min-height: 100vh;
    }
    #finalText h2 {
        margin-top: 450px;
    }
}

/* @media (max-width: 456px) {
    .content {
        width: 370px;
        padding: 1rem;
    }
    
    #finalText {
        padding-top: 100px;
        margin: 0.5rem;
    }
    
    #finalText .row {
        flex-direction: column;
        overflow-y: auto;
        display: flex;
        flex-wrap: wrap;
    }

    #finalText .column1 {
        width: 100%;
        flex: 1;
        min-width: 0;
    }
    
    #finalText .column2 {
        width: 100%;
        flex: 1;
        min-width: 0;
    }
} */

.contentimg {
    width: 100%;
    background: white;
    padding: 5px;
}

/* Background images */
.fixed {
    position: absolute;
    inset: 0;
    z-index: 1;
}

.fixed img:not(.contentimg) {
    height: 100%;
    width: 100%;
    object-fit: cover;
    filter: brightness(0.5);
}

/* First section styling */
section:first-of-type {
    padding: 2rem 1rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

section:first-of-type .fixed {
    z-index: 1;
}

section:first-of-type .fixed .content {
    margin: 0 auto;
    width: 900px;
    max-width: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 6rem 2rem;
    height: 100%;
}

section:first-of-type {
    background: black;
}

section:first-of-type p {
    font-size: clamp(1rem, 0.2vw + 1rem, 2rem);
}

/* Second section articles */
section:nth-of-type(2) article:first-of-type .fixed {
    z-index: 1;
}

section:nth-of-type(2) .content {
    display: flex;
    padding: 4rem 1rem;
    align-items: center;
    justify-content: center;
    text-align: center;
}

section:nth-of-type(2) article:first-of-type .content {
    align-items: flex-end;
}

section:nth-of-type(2) article:first-of-type .fixed::after {
    content: "";
    position: absolute;
    inset: 0;
    background: hsl(0 0% 0% / 0.25);
}

section:nth-of-type(2) article:first-of-type h2 {
    padding: 1rem 0;
}

section:nth-of-type(2) article:nth-of-type(2) .fixed {
    background: black;
    z-index: 1;
}

/* Specific: reduce font size here to have one-liner */
section:nth-of-type(2) article:nth-of-type(2) .content h2 {
    font-size: clamp(3rem, 0.5vw + 2rem, 4rem);
}

section:nth-of-type(2) article:nth-of-type(3) .content {
    align-items: flex-start;
}

section:nth-of-type(2) article:nth-of-type(3) .fixed {
    z-index: 1;
}

section:nth-of-type(2) article:nth-of-type(3) img {
    filter: saturate(0.5) brightness(0.5);
}

/* Chat container styling */
.chat-container {
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
}

.text-blocks {
    max-width: 100%;
    width: 100%;
    display: flex;
    flex-direction: column;
    gap: 2rem;
    align-items: center;
}

.text-blocks p {
    display: inline-block;
    border-radius: 6px;
    margin: 0;
    font-size: clamp(1.5rem, 0.5vw + 1rem, 4rem);
    font-weight: 120;
    padding: 1rem 2rem;
    background: rgba(0, 0, 0, 0.7);
    border-radius: 10px;
    max-width: 80%;
    text-align: center;
}

.text-blocks p:nth-of-type(even) {
    align-self: flex-end;
    text-align: right;
    color: hsl(173 100% 51%);
}

.text-blocks p:nth-of-type(odd) {
    align-self: flex-start;
}

.filler {
    display: none;
}

/* Simple fade-in animation for content */
.content {
    opacity: 0;
    transform: translateY(20px);
    animation: fadeInUp 0.8s ease-out forwards;
    animation-delay: 0.3s;
}

@keyframes fadeInUp {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .text-blocks p {
        font-size: clamp(1rem, 0.3vw + 0.8rem, 2rem);
        padding: 0.8rem 1.5rem;
    }
    
    #finalText .row {
        flex-direction: column;
    }
    
    #finalText .column1,
    #finalText .column2 {
        width: 100%;
        min-width: auto;
    }
}

/* Smooth transitions for better UX */
* {
    transition: opacity 0.3s ease, transform 0.3s ease;
}

/* Ensure proper scrolling behavior */
html {
    scroll-padding-top: 0;
}

/* Hide scrollbar for cleaner look */
main::-webkit-scrollbar {
    width: 0px;
}

main {
    scrollbar-width: none;
    -ms-overflow-style: none;
}