
/* ========================================
   LOVELLE LAB — Yours in Starlight
   File: typography.css
   Version: 2.0
   Responsive Scrollable Letter
======================================== */


/* 01. TYPOGRAPHY SETTINGS */

:root {

    --font-letter: "Great Vibes", cursive;
    --font-interface: "Cormorant Garamond", serif;

    --letter-font-size: clamp(24px, 2.7vw, 42px);
    --letter-line-height: 1.6;

    --letter-color: #E8C9AD;
    --letter-glow: rgba(232, 201, 173, 0.15);

    --letter-top: 5%;
    --letter-bottom: 45%;

    --letter-max-width: 1100px;

    --letter-scroll-track: rgba(232, 201, 173, 0.04);
    --letter-scroll-thumb: rgba(201, 164, 119, 0.35);
    --letter-scroll-hover: rgba(201, 164, 119, 0.65);
}


/* ========================================
   02. LETTER CONTAINER
======================================== */

.letter-container {

    position: absolute;

    top: var(--letter-top);
    bottom: var(--letter-bottom);
    left: 50%;

    width: min(88%, var(--letter-max-width));

    height: auto;
    min-height: 0;

    transform: translateX(-50%);

    display: flex;

    flex-direction: column;

    align-items: center;
    justify-content: flex-start;

    box-sizing: border-box;

    perspective: 1200px;

    overflow: visible;

    pointer-events: none;

    z-index: var(--z-letter);
}


/* ========================================
   03. LETTER CONTENT
======================================== */

.letter-content {

    position: relative;

    flex: 0 0 auto;

    width: 100%;
    max-width: 100%;

    min-height: 0;

    box-sizing: border-box;

    padding: 12px 24px 20px;

    font-family: var(--font-letter);
    font-size: var(--letter-font-size);
    font-weight: 400;

    line-height: var(--letter-line-height);

    color: var(--letter-color);

    text-align: center;

    opacity: 0;
    visibility: hidden;

    transform-style: preserve-3d;

    overflow: visible;

    overflow-wrap: anywhere;

    pointer-events: none;
}


/* ========================================
   04. LETTER PARAGRAPH
======================================== */

.letter-paragraph {

    display: block;

    position: relative;

    width: 100%;
    max-width: 100%;

    margin: 0 0 18px;

    transform-style: preserve-3d;
}

.letter-paragraph:last-child {

    margin-bottom: 0;
}


/* ========================================
   05. LETTER LINE
======================================== */

.letter-line {

    position: relative;

    display: block;

    width: 100%;
    max-width: 100%;

    min-height: 1.6em;

    text-align: center;

    transform-style: preserve-3d;
}


/* ========================================
   06. INDIVIDUAL WORD
======================================== */

.letter-word {

    position: relative;

    display: inline-block;

    max-width: 100%;

    white-space: nowrap;

    transform-style: preserve-3d;
}


/* ========================================
   07. INDIVIDUAL CHARACTER
======================================== */

.letter-char {

    position: relative;

    display: inline-block;

    font-family: inherit;
    font-size: inherit;
    font-weight: inherit;

    color: inherit;

    opacity: 0;

    transform:
        translate3d(0, 0, 0)
        rotateX(0deg)
        rotateY(0deg)
        rotateZ(0deg);

    transform-origin: center center;

    transform-style: preserve-3d;

    backface-visibility: visible;

    text-shadow:
        0 0 8px var(--letter-glow);
}


/* ========================================
   08. SPACE BETWEEN WORDS
======================================== */

.letter-space {

    display: inline-block;

    width: 0.25em;
    height: 1em;

    white-space: pre;
}


/* ========================================
   09. FLYING CHARACTER LAYER
======================================== */

.flying-char {

    position: absolute;

    display: inline-block;

    font-family: var(--font-letter);
    font-size: var(--letter-font-size);

    color: var(--letter-color);

    pointer-events: none;

    transform-origin: center center;

    transform-style: preserve-3d;

    backface-visibility: visible;

    text-shadow:
        0 0 6px rgba(232, 201, 173, 0.12);

    will-change: transform, opacity;
}


/* ========================================
   10. LETTER SIGNATURE
======================================== */

.letter-signature {

    display: block;

    position: relative;

    width: 100%;

    margin-top: 24px;
    margin-bottom: 12px;

    font-family: var(--font-letter);

    font-size: 0.8em;

    line-height: 1.5;

    color: var(--gold-primary, #C9A477);

    overflow-wrap: anywhere;

    opacity: 0;
}


/* ========================================
   11. OPENING STATE

   Preserve flying text animation.
======================================== */

.experience.is-opening .letter-container {

    overflow: hidden;

    pointer-events: none;
}

.experience.is-opening .letter-content {

    visibility: visible;

    opacity: 1;

    pointer-events: none;
}


/* ========================================
   12. OPENED STATE

   Enable independent letter scrolling.
======================================== */

.experience.is-open .letter-container {

    overflow-x: hidden;
    overflow-y: auto;

    pointer-events: auto;

    overscroll-behavior: contain;

    touch-action: pan-y;

    -webkit-overflow-scrolling: touch;

    scrollbar-width: thin;

    scrollbar-color:
        var(--letter-scroll-thumb)
        var(--letter-scroll-track);
}

.experience.is-open .letter-content {

    visibility: visible;

    opacity: 1;

    pointer-events: auto;
}


/* ========================================
   13. CLOSING STATE
======================================== */

.experience.is-closing .letter-container {

    overflow: hidden;

    pointer-events: none;
}

.experience.is-closing .letter-content {

    visibility: visible;

    opacity: 1;

    pointer-events: none;
}


/* ========================================
   14. ASSEMBLED TEXT STATE
======================================== */

.letter-content.is-assembled {

    text-shadow:
        0 0 10px rgba(232, 201, 173, 0.08);
}

.letter-content.is-assembled .letter-char {

    opacity: 1;

    transform:
        translate3d(0, 0, 0)
        rotateX(0deg)
        rotateY(0deg)
        rotateZ(0deg);
}


/* ========================================
   15. CUSTOM SCROLLBAR

   Burgundy & Champagne Gold
======================================== */

.letter-container::-webkit-scrollbar {

    width: 4px;
}

.letter-container::-webkit-scrollbar-track {

    background: var(--letter-scroll-track);

    border-radius: 20px;
}

.letter-container::-webkit-scrollbar-thumb {

    background: var(--letter-scroll-thumb);

    border-radius: 20px;
}

.letter-container::-webkit-scrollbar-thumb:hover {

    background: var(--letter-scroll-hover);
}

.letter-container::-webkit-scrollbar-button {

    display: none;
}

.letter-container::-webkit-scrollbar-corner {

    background: transparent;
}


/* ========================================
   16. INTERACTION HINT
======================================== */

.interaction-hint {

    font-family: var(--font-interface);

    font-size: clamp(13px, 1.2vw, 16px);

    font-style: italic;
    font-weight: 400;

    letter-spacing: 1.5px;

    color: var(--text-primary);

    text-shadow:
        0 0 8px rgba(232, 201, 173, 0.08);
}


/* ========================================
   17. LARGE DESKTOP
======================================== */

@media screen and (min-width: 1600px) {

    :root {

        --letter-font-size: 42px;

        --letter-max-width: 1200px;

        --letter-top: 5%;

        --letter-bottom: 45%;
    }
}


/* ========================================
   18. TABLET
======================================== */

@media screen and (max-width: 1024px) {

    :root {

        --letter-font-size:
            clamp(24px, 3.5vw, 36px);

        --letter-top: 5%;

        --letter-bottom: 45%;
    }

    .letter-container {

        width: 88%;
    }

    .letter-content {

        padding: 10px 16px 20px;
    }

    .letter-paragraph {

        margin-bottom: 16px;
    }
}


/* ========================================
   19. MOBILE TYPOGRAPHY
======================================== */

@media screen and (max-width: 768px) {

    :root {

        --letter-font-size:
            clamp(23px, 5.5vw, 32px);

        --letter-line-height: 1.55;

        --letter-top: 4%;

        --letter-bottom: 43%;
    }

    .letter-container {

        width: 90%;

        height: auto;

        min-height: 0;
    }

    .letter-content {

        padding: 10px 12px 20px;
    }

    .letter-paragraph {

        margin-bottom: 14px;
    }

    .letter-line {

        min-height: 1.55em;
    }

    .letter-signature {

        margin-top: 18px;

        margin-bottom: 10px;
    }

    .interaction-hint {

        font-size: 13px;
    }

    .letter-container::-webkit-scrollbar {

        width: 3px;
    }
}


/* ========================================
   20. SMALL MOBILE
======================================== */

@media screen and (max-width: 375px) {

    :root {

        --letter-font-size: 22px;

        --letter-line-height: 1.5;

        --letter-top: 3%;

        --letter-bottom: 44%;
    }

    .letter-container {

        width: 92%;
    }

    .letter-content {

        padding: 8px 10px 16px;
    }

    .letter-paragraph {

        margin-bottom: 12px;
    }
}


/* ========================================
   21. SHORT SCREENS
======================================== */

@media screen and (max-height: 650px) {

    :root {

        --letter-font-size:
            clamp(22px, 2.5vw, 32px);

        --letter-line-height: 1.45;

        --letter-top: 3%;

        --letter-bottom: 48%;
    }

    .letter-paragraph {

        margin-bottom: 10px;
    }

    .letter-signature {

        margin-top: 16px;
    }
}


/* ========================================
   22. LANDSCAPE / VERY SHORT SCREENS
======================================== */

@media screen and (max-height: 500px) {

    :root {

        --letter-font-size: 22px;

        --letter-line-height: 1.35;

        --letter-top: 2%;

        --letter-bottom: 52%;
    }

    .letter-content {

        padding: 5px 12px 12px;
    }

    .letter-paragraph {

        margin-bottom: 8px;
    }

    .letter-signature {

        margin-top: 10px;
    }
}


/* ========================================
   END OF TYPOGRAPHY.CSS
   LOVELLE LAB — Yours in Starlight
======================================== */
/* ========================================
   HIDDEN SCROLLBAR — CINEMATIC EXPERIENCE
======================================== */

.experience.is-open .letter-container {
    overflow-y: auto;
    overflow-x: hidden;

    scrollbar-width: none !important;
    -ms-overflow-style: none;

    touch-action: pan-y;
    overscroll-behavior: contain;

    -webkit-overflow-scrolling: touch;
}

.letter-container::-webkit-scrollbar {
    display: none !important;
    width: 0 !important;
    height: 0 !important;
}