/* ===================================================
   conc.quest - Kinetic Formalism
   Colors: #081C15, #2D6A4F, #1B4332, #52B788, #B7E4C7, #D8F3DC, #F1FAEE, #E9C46A
   Fonts: Bebas Neue, Work Sans, Space Mono
   =================================================== */

/* --- Reset & Base --- */
*, *::before, *::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    overflow-x: hidden;
}

body {
    background-color: #081C15;
    color: #B7E4C7;
    font-family: 'Work Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.65;
    letter-spacing: 0.01em;
    overflow-x: hidden;
}

/* --- Opening Animation Overlay --- */
#opening-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 10000;
    pointer-events: none;
}

#opening-line {
    position: absolute;
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: #52B788;
    transform: scaleX(0);
    transform-origin: center;
    animation: drawLine 500ms cubic-bezier(0.22, 1, 0.36, 1) 300ms forwards;
}

@keyframes drawLine {
    to { transform: scaleX(1); }
}

#opening-curtain-top,
#opening-curtain-bottom {
    position: absolute;
    left: 0;
    width: 100%;
    height: 50%;
    background-color: #081C15;
    transition: transform 600ms cubic-bezier(0.22, 1, 0.36, 1);
}

#opening-curtain-top {
    top: 0;
}

#opening-curtain-bottom {
    bottom: 0;
}

#opening-overlay.split #opening-curtain-top {
    transform: translateY(-100%);
}

#opening-overlay.split #opening-curtain-bottom {
    transform: translateY(100%);
}

#opening-overlay.done {
    display: none;
}

/* --- Fullscreen Sections --- */
.fullscreen-section {
    position: relative;
    width: 100%;
    height: 100vh;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* --- Bounce Animation --- */
.bounce-target {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.5s ease-out, transform 0.7s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.bounce-target.bounce-active {
    opacity: 1;
    transform: translateY(0);
}

/* --- Vertical Navigation --- */
#vertical-nav {
    position: fixed;
    right: 24px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9000;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 28px;
}

.nav-line {
    position: absolute;
    top: 0;
    bottom: 0;
    width: 2px;
    background-color: #52B788;
    opacity: 0.3;
    left: 50%;
    transform: translateX(-50%);
}

.nav-marker {
    width: 10px;
    height: 10px;
    background-color: #52B788;
    transform: rotate(45deg);
    position: relative;
    z-index: 1;
    cursor: pointer;
    transition: background-color 0.3s, transform 0.3s;
    opacity: 0.5;
}

.nav-marker.active {
    background-color: #E9C46A;
    opacity: 1;
    animation: navPulse 2s ease-in-out infinite;
}

@keyframes navPulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(233, 196, 106, 0.4); }
    50% { box-shadow: 0 0 0 6px rgba(233, 196, 106, 0); }
}

.nav-label {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%) rotate(-45deg);
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.7rem, 0.85vw, 0.85rem);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #B7E4C7;
    opacity: 0;
    transition: opacity 0.3s;
    white-space: nowrap;
}

.nav-marker:hover .nav-label {
    opacity: 1;
}

/* === SECTION 1: HERO === */
#section-hero {
    background-color: #081C15;
}

.hero-hexagon-mask {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 65vmin;
    height: 65vmin;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    overflow: hidden;
    opacity: 0;
    animation: hexReveal 600ms cubic-bezier(0.22, 1, 0.36, 1) 1000ms forwards;
}

@keyframes hexReveal {
    from {
        clip-path: polygon(50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%, 50% 50%);
        opacity: 1;
    }
    to {
        clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
        opacity: 1;
    }
}

.hero-photo-container {
    width: 100%;
    height: 100%;
    display: flex;
    align-items: center;
    justify-content: center;
}

.hero-photo-svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-domain-vertical {
    position: absolute;
    left: 32px;
    top: 50%;
    transform: translateY(-50%);
    writing-mode: vertical-rl;
    text-orientation: mixed;
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(1.2rem, 2vw, 1.8rem);
    letter-spacing: 0.3em;
    color: #F1FAEE;
    text-transform: uppercase;
    z-index: 10;
}

.hero-domain-vertical span {
    display: inline-block;
}

.hero-title {
    position: absolute;
    bottom: 15%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 0;
    z-index: 10;
    white-space: nowrap;
}

.hero-letter {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(4rem, 12vw, 10rem);
    line-height: 0.92;
    letter-spacing: 0.08em;
    color: #F1FAEE;
    text-transform: uppercase;
    display: inline-block;
}

.hero-triangle-accent {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 0;
    height: 0;
    border-bottom: 25vh solid #1B4332;
    border-left: 25vw solid transparent;
    z-index: 5;
}

/* === SECTION 2: THESIS === */
#section-thesis {
    background-color: #081C15;
}

.thesis-diagonal-photo {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: polygon(0 0, 100% 0, 0 100%);
    overflow: hidden;
}

.thesis-photo-svg {
    width: 100%;
    height: 100%;
    filter: contrast(1.1) saturate(0.85);
}

.thesis-text-zone {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    clip-path: polygon(100% 0, 100% 100%, 0 100%);
    background-color: #2D6A4F;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: flex-end;
    padding: 8vh 6vw 8vh 30vw;
}

.thesis-heading {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2rem, 6vw, 5rem);
    line-height: 0.92;
    letter-spacing: 0.08em;
    color: #F1FAEE;
    text-transform: uppercase;
    text-align: right;
    margin-bottom: 2rem;
}

.thesis-body {
    font-family: 'Work Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(0.95rem, 1.1vw, 1.15rem);
    line-height: 1.65;
    color: #B7E4C7;
    text-align: right;
    max-width: 500px;
}

/* === SECTION 3: MOTION GRID === */
#section-grid {
    background-color: #2D6A4F;
    flex-direction: column;
    padding: 4vh 4vw;
}

.section-title {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(2rem, 6vw, 5rem);
    line-height: 0.92;
    letter-spacing: 0.08em;
    color: #F1FAEE;
    text-transform: uppercase;
    margin-bottom: 4vh;
    z-index: 2;
}

.motion-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    grid-template-rows: repeat(2, 1fr);
    gap: 2vw;
    width: 90%;
    max-width: 1200px;
    height: 60vh;
    z-index: 2;
}

.parallelogram-card {
    overflow: hidden;
    transform: skewX(-12deg);
    clip-path: polygon(15% 0%, 100% 0%, 85% 100%, 0% 100%);
    transition: transform 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.parallelogram-card:hover {
    transform: skewX(-12deg) scale(1.03);
}

.grid-photo {
    width: 120%;
    height: 100%;
    margin-left: -10%;
    transform: skewX(12deg);
    filter: contrast(1.1) saturate(0.85);
    transition: filter 0.3s;
}

.parallelogram-card:hover .grid-photo {
    filter: contrast(1.15) saturate(1.1);
}

/* === SECTION 4: STATEMENT === */
#section-statement {
    background-color: #081C15;
    flex-direction: column;
}

#parallelogram-rain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    z-index: 1;
    pointer-events: none;
}

.rain-drop {
    position: absolute;
    width: 3px;
    background-color: #1B4332;
    transform: skewX(-15deg);
    top: -100px;
}

@keyframes rainFall {
    from { transform: skewX(-15deg) translateY(-100px); }
    to { transform: skewX(-15deg) translateY(calc(100vh + 100px)); }
}

.statement-word {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(6rem, 18vw, 16rem);
    line-height: 0.92;
    letter-spacing: 0.08em;
    color: #52B788;
    text-transform: uppercase;
    z-index: 2;
    position: relative;
}

.statement-sub {
    font-family: 'Work Sans', sans-serif;
    font-weight: 300;
    font-size: clamp(1rem, 1.5vw, 1.3rem);
    color: #B7E4C7;
    margin-top: 2rem;
    z-index: 2;
    position: relative;
    text-align: center;
    max-width: 600px;
    letter-spacing: 0.02em;
}

/* === SECTION 5: CLOSING === */
#section-closing {
    background-color: #081C15;
}

.closing-photo-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
}

.closing-photo-svg {
    width: 100%;
    height: 100%;
    object-fit: cover;
    filter: contrast(1.1) saturate(0.85);
}

.closing-hexagon-cutout {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    /* Inverted hexagon: dark surroundings with hexagonal window */
    background: #081C15;
    -webkit-mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Crect width='100' height='100' fill='white'/%3E%3Cpolygon points='50,15 80,32.5 80,67.5 50,85 20,67.5 20,32.5' fill='black'/%3E%3C/svg%3E");
    mask-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 100 100'%3E%3Crect width='100' height='100' fill='white'/%3E%3Cpolygon points='50,15 80,32.5 80,67.5 50,85 20,67.5 20,32.5' fill='black'/%3E%3C/svg%3E");
    -webkit-mask-size: 60vmin 60vmin;
    mask-size: 60vmin 60vmin;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: center;
    mask-position: center;
}

.closing-domain {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    display: flex;
    white-space: nowrap;
}

.closing-letter {
    font-family: 'Bebas Neue', sans-serif;
    font-size: clamp(3rem, 10vw, 8rem);
    line-height: 0.92;
    letter-spacing: 0.08em;
    color: #F1FAEE;
    text-transform: uppercase;
    display: inline-block;
}

.closing-tagline {
    position: absolute;
    bottom: 20%;
    left: 50%;
    transform: translateX(-50%);
    z-index: 5;
    font-family: 'Space Mono', monospace;
    font-size: clamp(0.7rem, 0.85vw, 0.85rem);
    text-transform: uppercase;
    letter-spacing: 0.15em;
    color: #E9C46A;
}

/* --- Honeycomb Clusters --- */
.honeycomb-cluster {
    position: absolute;
    z-index: 3;
    display: flex;
    gap: 4px;
    flex-wrap: wrap;
    width: 60px;
}

.honeycomb-1 {
    bottom: 15%;
    left: 8%;
}

.honeycomb-2 {
    top: 12%;
    right: 10%;
}

.mini-hexagon {
    width: 18px;
    height: 18px;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    border: 1px solid #52B788;
    background: transparent;
    position: relative;
}

.mini-hexagon::before {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    border: 1.5px solid #52B788;
    opacity: 0.4;
}

/* --- Geometric Background Shapes --- */
.geo-shape {
    position: absolute;
    pointer-events: none;
    z-index: 1;
}

.geo-triangle {
    width: 0;
    height: 0;
}

.geo-bg-1 {
    border-left: 50px solid transparent;
    border-right: 50px solid transparent;
    border-bottom: 86px solid #52B788;
    opacity: 0.08;
    top: 15%;
    right: 20%;
}

.geo-bg-2 {
    border-left: 30px solid transparent;
    border-right: 30px solid transparent;
    border-bottom: 52px solid #52B788;
    opacity: 0.12;
    bottom: 25%;
    left: 15%;
}

.geo-bg-3 {
    width: 60px;
    height: 60px;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    border: 2px solid #52B788;
    opacity: 0.1;
    top: 30%;
    right: 12%;
}

.geo-bg-3::before {
    content: '';
    position: absolute;
    inset: 0;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    border: 2px solid #52B788;
}

.geo-bg-4 {
    border-left: 80px solid transparent;
    border-right: 80px solid transparent;
    border-bottom: 138px solid #52B788;
    opacity: 0.06;
    bottom: 10%;
    right: 5%;
}

.geo-bg-5 {
    width: 40px;
    height: 40px;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    background: #52B788;
    opacity: 0.08;
    top: 20%;
    right: 25%;
}

.geo-bg-6 {
    border-left: 60px solid transparent;
    border-right: 60px solid transparent;
    border-bottom: 104px solid #B7E4C7;
    opacity: 0.06;
    top: 8%;
    left: 5%;
}

.geo-bg-7 {
    border-left: 40px solid transparent;
    border-right: 40px solid transparent;
    border-bottom: 69px solid #52B788;
    opacity: 0.1;
    bottom: 12%;
    right: 8%;
}

.geo-bg-8 {
    width: 400px;
    height: 400px;
    border-radius: 50%;
    background: #52B788;
    opacity: 0.05;
    top: -10%;
    right: -5%;
}

.geo-bg-9 {
    width: 300px;
    height: 300px;
    border-radius: 50%;
    background: #52B788;
    opacity: 0.06;
    bottom: -5%;
    left: -3%;
}

.geo-bg-10 {
    border-left: 100px solid transparent;
    border-right: 100px solid transparent;
    border-bottom: 173px solid #52B788;
    opacity: 0.04;
    top: 20%;
    left: 10%;
}

.geo-bg-11 {
    border-left: 60px solid transparent;
    border-right: 60px solid transparent;
    border-bottom: 104px solid #52B788;
    opacity: 0.06;
    bottom: 20%;
    right: 15%;
}

.geo-bg-12 {
    width: 80px;
    height: 80px;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    background: #52B788;
    opacity: 0.05;
    top: 40%;
    left: 5%;
}

/* --- Persistent Geometric Animation Layer --- */
#geo-animation-layer {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    pointer-events: none;
    z-index: 8000;
    overflow: hidden;
}

.geo-anim {
    position: absolute;
    pointer-events: none;
}

.geo-anim-triangle {
    width: 0;
    height: 0;
    border-left: 20px solid transparent;
    border-right: 20px solid transparent;
    border-bottom: 35px solid transparent;
    border-bottom-color: #52B788;
    opacity: 0;
    will-change: transform;
}

#geoAnim1 {
    top: 10%;
    left: 8%;
    opacity: 0.08;
    border-left-width: 25px;
    border-right-width: 25px;
    border-bottom-width: 43px;
}

#geoAnim2 {
    top: 60%;
    right: 12%;
    opacity: 0.06;
    border-left-width: 16px;
    border-right-width: 16px;
    border-bottom-width: 28px;
}

#geoAnim3 {
    width: 50px;
    height: 50px;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    border: 1.5px solid #52B788;
    top: 35%;
    left: 85%;
    opacity: 0.07;
}

#geoAnim4 {
    top: 80%;
    left: 20%;
    opacity: 0.05;
    border-left-width: 18px;
    border-right-width: 18px;
    border-bottom-width: 31px;
}

#geoAnim5 {
    width: 35px;
    height: 35px;
    clip-path: polygon(25% 0%, 75% 0%, 100% 50%, 75% 100%, 25% 100%, 0% 50%);
    border: 1px solid #52B788;
    top: 20%;
    left: 70%;
    opacity: 0.06;
}

.geo-anim-hexagon {
    will-change: transform;
}

/* --- Photo Treatment Overlay --- */
.thesis-diagonal-photo::after,
.closing-photo-bg::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: #2D6A4F;
    opacity: 0.15;
    mix-blend-mode: luminosity;
    pointer-events: none;
}

/* --- Mobile Adaptation (below 768px) --- */
@media (max-width: 768px) {
    #vertical-nav {
        position: fixed;
        right: auto;
        left: 50%;
        top: auto;
        bottom: 16px;
        transform: translateX(-50%) rotate(0deg);
        flex-direction: row;
        gap: 20px;
    }

    .nav-line {
        top: 50%;
        left: 0;
        right: 0;
        bottom: auto;
        width: auto;
        height: 2px;
        transform: translateY(-50%);
    }

    .nav-label {
        display: none;
    }

    .hero-domain-vertical {
        display: none;
    }

    .hero-title {
        bottom: 20%;
    }

    .hero-letter {
        font-size: clamp(3rem, 12vw, 6rem);
    }

    .hero-triangle-accent {
        border-bottom-width: 15vh;
        border-left-width: 30vw;
    }

    /* Thesis: vertical stack */
    .thesis-diagonal-photo {
        clip-path: polygon(0 0, 100% 0, 100% 55%, 0 55%);
    }

    .thesis-text-zone {
        clip-path: polygon(0 55%, 100% 55%, 100% 100%, 0 100%);
        padding: 2vh 6vw;
        align-items: center;
        justify-content: flex-start;
        padding-top: 58vh;
    }

    .thesis-heading,
    .thesis-body {
        text-align: center;
    }

    /* Motion grid: 2 columns */
    .motion-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, 1fr);
        width: 95%;
        height: 65vh;
    }

    .parallelogram-card {
        transform: skewX(-8deg);
    }

    .grid-photo {
        transform: skewX(8deg);
    }

    /* Statement */
    .statement-word {
        font-size: clamp(4rem, 16vw, 10rem);
    }

    /* Closing */
    .closing-letter {
        font-size: clamp(2.5rem, 10vw, 5rem);
    }

    .closing-hexagon-cutout {
        -webkit-mask-size: 70vmin 70vmin;
        mask-size: 70vmin 70vmin;
    }

    /* Reduce bounce travel */
    .bounce-target {
        transform: translateY(24px);
    }

    .bounce-target.bounce-active {
        transform: translateY(0);
    }

    #geo-animation-layer {
        display: none;
    }

    .honeycomb-cluster {
        display: none;
    }
}

/* --- Parallelogram Rain Texture (background pattern) --- */
.section-bg-rain {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    overflow: hidden;
    pointer-events: none;
}
