@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:wght@400;700&display=swap');

@font-face {
    font-family: 'Ali Meshref';
    src: url('AMoshref-NaskhV2-Regular.otf') format('truetype');
    font-weight: normal;
    font-style: normal;

}

@font-face {
    font-family: 'Lyon Arabic';
    src: url('lyon-arabic-display-medium.otf') format('opentype');
    font-weight: 500;
    font-style: normal;
}

:root {
    --light: #fff;
    --dark: #483535c6;
    --pink: #dac0bc;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}
body {
    background-color: var(--light);
    color: var(--dark);
    font-family: 'Instrument Serif', sans-serif;
}
body.loading {
    overflow: hidden;
}

/* ── Loader overlay ── */
.loader-overlay {
    position: fixed;
    inset: 0;
    z-index: 9999;
    background-color: var(--light);
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}
.loader-overlay.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}
.loader-spinner {
    width: 40px;
    height: 40px;
    border: 3px solid var(--pink);
    border-top-color: transparent;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}
@keyframes spin {
    to { transform: rotate(360deg); }
}

img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}
h1 {
    font-size: clamp(5rem, 6vw, 7rem);
    font-weight: 500;
    line-height: 0.8;
}
p {
    font-size: 1.35rem;
    line-height: 1;
}
section {
    width: 100%;
    height: 100dvh;
    position: relative;
    overflow: hidden;
}
.hero {
    height: 100lvh; /* use large viewport so no gap when mobile browser bars collapse */
    perspective: 1000px;
    color: var(--light);
    background-color: #e0c6c5; /* safety net: matches sky image tone */
    contain: layout style paint;
}

.outro {
    padding: 2rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    text-align: center;
    background-color: var(--light);
    overflow: visible;
}

.countdown-heading {
    color: var(--pink);
    font-family: 'Ali Meshref', sans-serif;
    font-size: clamp(2.3rem, 4vw, 3.5rem);
    margin-bottom: 2rem;
}

.countdown-wrapper {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: clamp(1rem, 3vw, 2.5rem);
    flex-wrap: wrap;
    width: 100%;
    max-width: 900px;
}

.countdown-box {
    background-color: var(--pink);
    width: clamp(120px, 20vw, 180px);
    aspect-ratio: 1;
    border-radius: 1rem;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: 0.1rem;
    will-change: transform;
}

.countdown-box .number {
    font-size: clamp(2.5rem, 5vw, 4rem);
    font-weight: 700;
    color: var(--light);
}

.countdown-box .label {
    font-size: clamp(1.3rem, 2vw, 1.9rem);
    color: var(--light);
    font-weight: 800;
    font-family: 'Ali Meshref', sans-serif;
}

@media (max-width: 600px) {
    .countdown-wrapper {
        max-width: 320px;
    }
}

.sky-container ,
.window-container, 
.hero-copy ,
.hero-header,
.hero-header2 {
    top: 0;
    left: 0;
    width: 100%;
    position: absolute;
    will-change: transform;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.sky-container {
    height: 130dvh;
}

.hero-copy{
    height: 100dvh; /* change to 100dvh when the sky is not visible */
    justify-content: center;
    display: flex;
    align-items: center;
    font-family: 'Ali Meshref', sans-serif;
    
}


.hero-copy h1{
    font-size: clamp(2rem, 2vw, 2.7rem);
    width: 90%;
    text-align: center;
    line-height: 1.9;
    color: var(--light);
    direction: rtl;
    text-shadow: 1px 1px 2px rgba(114, 82, 82, 0.3);
}
.split-word {
    display: inline-block;
}
.sender-text {
    color: #9a7477;
    font-size: clamp(1.4rem, 1.6vw, 1.8rem);
}

.window-container {
    height: 100dvh;

}

.hero-header {
    height: 100dvh;
    padding: 4rem 23%;
    display: flex;
    transform-style: preserve-3d;
    align-items: center;
    gap: 1rem;
}


.hero-header .col{
    flex:1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    gap: 2rem;
    direction: ltr;
}
.hero-header .col p{
    width: 100%;
}
.hero-header .col:nth-child(2) {
    align-items: flex-end;
    text-align: right;
}
.hero-header2 {
    height: 100dvh;
    display: flex;
    justify-content: center;
    align-items: center;
}
.hero-header2 img {
    position: absolute;
    width: auto;
    height: clamp(300px, 75dvh, 650px);
    object-fit: contain;
    filter: drop-shadow(1px 1px 2px rgba(106, 77, 77, 0.2));
}

.footer {
    background-color: var(--pink);
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    gap: clamp(2rem, 4vh, 3.5rem);
    padding: clamp(2rem, 5vw, 4rem);
    text-align: center;
    font-family: 'Lyon Arabic', sans-serif;
}
.footer-credit {
    color: var(--light);
    font-size: clamp(1rem, 1.5vw, 2rem);
}

.share-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: clamp(1.2rem, 3vw, 2rem);
    width: 100%;
    max-width: 600px;
}
.share-label {
    color: var(--light);
    font-family: 'Lyon Arabic', sans-serif;
    font-size: clamp(1.3rem, 3vw, 2rem);
    direction: rtl;
    text-align: center;
    line-height: 1.8;
    width: 100%;
    padding: 0 1rem;
}
.share-input-row {
    display: flex;
    gap: clamp(0.5rem, 1.5vw, 1rem);
    flex-wrap: wrap;
    justify-content: center;
    width: 100%;
    padding: 0 1rem;
}
.share-input-row input,
.share-input-row button {
    font-family: 'Lyon Arabic', sans-serif;
    font-size: clamp(1.1rem, 2.2vw, 1.4rem);
    line-height: 1;
    border-radius: 0.5rem;
    height: clamp(3rem, 5.5vw, 3.6rem);
    padding: 0 1.2rem;
}
.share-input-row input {
    border: 2px solid var(--light);
    background: transparent;
    color: var(--light);
    outline: none;
    min-width: 180px;
    flex: 1;
    max-width: 300px;
    text-align: center;
}
.share-input-row input::placeholder {
    color: rgba(255,255,255,0.5);
}
.share-input-row button {
    border: none;
    background-color: var(--light);
    color: var(--pink);
    font-weight: 700;
    cursor: pointer;
    transition: opacity 0.2s;
    white-space: nowrap;
    padding: 0 clamp(1.2rem, 3vw, 2rem);
    display: flex;
    align-items: center;
    justify-content: center;
}
.share-input-row button:hover {
    opacity: 0.85;
}
.share-copied {
    color: var(--light);
    font-family: 'Lyon Arabic', sans-serif;
    font-size: clamp(1rem, 1.5vw, 1.5rem);
    opacity: 0;
    transition: opacity 0.3s;
}
.share-copied.show {
    opacity: 1;
}

/* ── Scroll-down hint ── */
.scroll-hint {
    position: fixed;
    bottom: 10%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 100;
    opacity: 1;
    transition: opacity 5s ease;
    pointer-events: none;
}
.scroll-hint.hidden {
    opacity: 0;
}
.scroll-icon {
    width: 50px;
    height: 50px;
    border: 3px solid var(--light);
    border-radius: 50%;
    background: rgba(0, 0, 0, 0.125);
    position: relative;
    animation: scroll-bounce 1.5s infinite;
    -webkit-animation: scroll-bounce 1.5s infinite;
}
.scroll-icon::before {
    content: '';
    position: absolute;
    top: 38%;
    left: 50%;
    width: 14px;
    height: 14px;
    border-left: 3px solid var(--light);
    border-top: 3px solid var(--light);
    transform: translate(-50%, -10%) rotate(45deg);
}
@keyframes scroll-bounce {
    0%   { transform: translateY(0); }
    20%  { transform: translateY(12px); }
    40%  { transform: translateY(0); }
}
@-webkit-keyframes scroll-bounce {
    0%   { transform: translateY(0); }
    20%  { transform: translateY(12px); }
    40%  { transform: translateY(0); }
}

@media (max-width: 1000px) {
    h1 {
        font-size: 3rem;
    }
    p {
        font-size: 1.125rem;
    }
}
@media (max-width: 768px) {
    .hero-header2 img {
        filter: none;
    }
    .hero-copy h1 {
        text-shadow: none;
    }
    .hero {
        perspective: none;
    }
    .hero-header {
        transform-style: flat;
        will-change: auto;
        -webkit-backface-visibility: visible;
        backface-visibility: visible;
    }
    .hero-header img {
        image-rendering: -webkit-optimize-contrast;
    }
}