/* Tako & Vepkhia wedding invitation (Weddsite pro-1). All styles for index.html.
   Mobile-only build: base rules target phones, and above 769px the page is
   replaced by the desktop notice. script.js drives the classes used here
   (is-locked, scrollable, content-revealed, open). */

:root {
    /* 1% of the usable viewport height, written by the inline head script and
       re-pinned by script.js. Falls back to 1vh with JS off. */
    --vh: 1vh;

    --paper: #faf6f1;
    --paper-alt: #f7f2ea;
    --paper-deep: #f1e9db;
    --ink: #3a3028;
    --ink-soft: #5a5048;
    --muted: #8a7e6b;
    --blue: #3f5e88;
    --blue-dark: #2a5e7b;
    --gold: #c9b26e;
    --gold-light: #e6cd8a;
    --cream: #fbf4e6;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    /* stops the rubber-band overscroll that makes the toolbar flap */
    overscroll-behavior-y: none;
    scrollbar-width: thin;
    scrollbar-color: transparent transparent;
}

body {
    min-height: 100vh;
    min-height: 100svh;
    background-color: #c5b49a;
    overscroll-behavior-y: none;
}

/* Intro scroll gate. Never position:fixed / overflow:hidden on html/body:
   Chrome iOS opened from a chat app freezes its viewport short when the
   document stops being scrollable. script.js traps touchmove/scroll instead. */
html.is-locked,
html.is-locked body {
    overscroll-behavior: none;
    touch-action: none;
}

/* ---------- VIEWPORT HEIGHT PIN ----------
   In-app browsers (Instagram / Messenger) resize the whole webview when their
   native nav bar slides, so vh/svh/dvh all move mid-scroll. The floors come
   first, the pinned value must come last and win. Never use dvh here. */
.hero {
    min-height: 100vh;
    min-height: 100svh;
}

.vh-lock body,
.vh-lock .hero {
    min-height: calc(var(--vh) * 100);
}

/* ---------- CUSTOM SCROLLBAR (fades in once the envelope opens) ---------- */
html.scrollable {
    scrollbar-color: rgba(201, 178, 110, 0.55) transparent;
    transition: scrollbar-color 0.6s ease;
}

html::-webkit-scrollbar {
    width: 8px;
}

html::-webkit-scrollbar-track {
    background: transparent;
}

html::-webkit-scrollbar-thumb {
    background-color: rgba(201, 178, 110, 0);
    border-radius: 4px;
    transition: background-color 0.6s ease;
}

html.scrollable::-webkit-scrollbar-thumb {
    background-color: rgba(201, 178, 110, 0.55);
}

/* ---------- LOADING SCREEN ----------
   Out-ranks the envelope (z 10). */
.loader {
    position: fixed;
    inset: 0;
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: #e8ddd2;
    transition: opacity 0.6s ease, background-color 1.5s ease, color 1.5s ease, border-color 1.5s ease;
}

.loader.hidden {
    opacity: 0;
    pointer-events: none;
}

.loader-spinner {
    width: 38px;
    height: 38px;
    border: 2px solid rgba(201, 178, 110, 0.25);
    border-top-color: var(--gold);
    border-radius: 50%;
    animation: loaderSpin 0.9s linear infinite;
}

@keyframes loaderSpin {
    to { transform: rotate(360deg); }
}

/* ---------- PAGE SHELL ---------- */
.page-content {
    visibility: hidden;
    position: relative;
    z-index: 0;
    background-color: var(--paper);
    font-family: 'Noto Serif Georgian', 'Cormorant Garamond', serif;
    color: var(--ink);
}


.page-content.bg-visible {
    visibility: visible;
}

/* ---------- HERO ----------
   Full-bleed sunset photo; the couple stands in the lower half, so every line
   of text sits in the sky above them. */
.hero {
    --hero-pad: 9;
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    text-align: center;
    padding: 9vh 1.5rem 2rem;
    overflow: hidden;
}

.vh-lock .hero {
    padding-top: calc(var(--vh) * var(--hero-pad));
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-image: url('bg.jpg');
    background-size: cover;
    background-position: center top;
    background-repeat: no-repeat;
}

/* Darkens only the sky band behind the text, so cream type reads without
   muddying the sunset and the couple below. */
.hero::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: 1;
    background-image:
        linear-gradient(to bottom, rgba(22, 30, 50, 0.42) 0%, rgba(22, 30, 50, 0.12) 42%, rgba(22, 30, 50, 0) 60%),
        linear-gradient(to top, rgba(15, 18, 30, 0.55) 0%, rgba(15, 18, 30, 0) 22%);
}


.hero > *:not(.hero-bg) {
    position: relative;
    z-index: 2;
    opacity: 0;
    transform: translateY(15px);
    transition: opacity 2.4s ease, transform 1.8s ease, color 1.5s ease, background-color 1.5s ease, border-color 1.5s ease;
}

.page-content.content-revealed .hero > *:not(.hero-bg) {
    opacity: 1;
    transform: translateY(0);
}

.page-content.content-revealed .hero .hero-date { transition-delay: 0.35s; }

.hero-names {
    font-family: 'Noto Serif Georgian', 'Cormorant Garamond', serif;
    font-size: 2.6rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    line-height: 1.2;
    color: var(--cream);
    text-shadow: 0 2px 18px rgba(15, 20, 35, 0.45);
}

.hero-names .amp {
    display: block;
    font-family: 'Cormorant Garamond', serif;
    font-size: 0.55em;
    font-weight: 500;
    color: var(--gold-light);
    margin: 0.1em 0;
}

.hero-date {
    margin-top: 1.1rem;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    color: var(--cream);
    text-shadow: 0 1px 10px rgba(15, 20, 35, 0.5);
}

/* Scroll hint, pinned to the bottom centre of the hero. The lower gradient
   in .hero::before keeps it readable over the white dress. Centred with auto
   margins, not translateX: the hero reveal rule animates `transform` on every
   child, and a second transform here would be overwritten by it. Selector is
   `.hero > .hero-scroll` so it outranks that rule's position: relative. */
.hero > .hero-scroll {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 1.4rem;
    bottom: calc(env(safe-area-inset-bottom, 0px) + 1.4rem);
    width: max-content;
    margin: 0 auto;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-decoration: none;
    color: var(--cream);
}

.page-content.content-revealed .hero .hero-scroll { transition-delay: 0.9s; }

.hero-scroll__arrows {
    position: relative;
    width: 30px;
    height: 44px;
    filter: drop-shadow(0 1px 4px rgba(15, 20, 35, 0.6));
}

.hero-scroll__arrows svg {
    position: absolute;
    top: 0;
    left: 0;
    width: 30px;
    height: 30px;
    animation: scrollChevron 1.7s ease-in-out infinite;
}

.hero-scroll__arrows svg:nth-child(2) {
    animation-delay: 0.35s;
}

@keyframes scrollChevron {
    0% { transform: translateY(0); opacity: 0.9; }
    60% { transform: translateY(14px); opacity: 0; }
    61% { transform: translateY(-4px); opacity: 0; }
    100% { transform: translateY(0); opacity: 0.9; }
}

/* ---------- INVITATION CARD ----------
   Follows the client's paper invitation: address line, guest name, a hairline,
   then the invitation, names, date / hour / hall each on a line, and parents.
   Framed with a thin double gold rule like the printed card. */
.invite-section {
    padding: 3.5rem 1.25rem;
    background-color: var(--paper);
}

.invite-card {
    position: relative;
    max-width: 30rem;
    margin: 0 auto;
    padding: 2.6rem 1.5rem 2.4rem;
    text-align: center;
    background-color: #fff;
    border: 1px solid rgba(201, 178, 110, 0.7);
    border-radius: 4px;
    box-shadow: 0 10px 34px rgba(58, 48, 40, 0.07);
}

/* inner rule of the double frame */
.invite-card::before {
    content: '';
    position: absolute;
    inset: 7px;
    border: 1px solid rgba(201, 178, 110, 0.35);
    border-radius: 2px;
    pointer-events: none;
}

.invite-title {
    font-size: 1.05rem;
    letter-spacing: 0.08em;
    color: var(--gold);
}

.invite-guest[hidden] {
    display: none;
}

.invite-guest {
    margin-top: 0.35rem;
    font-size: 1.45rem;
    font-weight: 500;
    line-height: 1.35;
    color: var(--blue);
    overflow-wrap: anywhere;
}

.invite-rule {
    display: block;
    width: 70%;
    height: 1px;
    margin: 1.4rem auto;
    background-image: linear-gradient(to right, transparent, var(--gold), transparent);
}

.invite-lead {
    font-size: 1rem;
    line-height: 1.8;
    color: var(--ink-soft);
}

.invite-names {
    margin-top: 1rem;
    font-family: 'Noto Serif Georgian', 'Cormorant Garamond', serif;
    font-size: 2rem;
    font-weight: 400;
    line-height: 1.25;
    color: var(--blue);
}

.invite-names .amp {
    font-family: 'Cormorant Garamond', serif;
    font-weight: 500;
    color: var(--gold);
}

.invite-when {
    margin-top: 1.4rem;
    font-size: 1rem;
    line-height: 1.8;
    color: var(--ink);
}

.invite-parents {
    margin-top: 1.8rem;
}

.invite-parents__label {
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    color: var(--gold);
}

.invite-parents__names {
    margin-top: 0.2rem;
    font-size: 1rem;
    color: var(--ink);
}

/* ---------- SHARED SECTION TYPE ---------- */
.section-label {
    text-align: center;
    font-size: 0.85rem;
    letter-spacing: 0.14em;
    color: var(--gold);
    margin-bottom: 1rem;
    font-weight: 600;
}

.section-divider {
    width: 60px;
    height: 1px;
    background-image: linear-gradient(to right, transparent, var(--gold), transparent);
    margin: 0 auto 2rem;
}

.section-heading {
    text-align: center;
    font-family: 'Noto Serif Georgian', 'Cormorant Garamond', serif;
    font-size: 1.6rem;
    font-weight: 400;
    line-height: 1.35;
    color: var(--blue);
}


/* ---------- SCROLL REVEAL ---------- */
.reveal {
    opacity: 0;
    transform: translateY(40px);
    transition: opacity 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                transform 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94),
                background-color 1.5s ease, color 1.5s ease, border-color 1.5s ease;
}

.reveal.visible {
    opacity: 1;
    transform: translateY(0);
}

/* ---------- COUNTDOWN ---------- */
.countdown-section {
    padding: 3.5rem 1.25rem;
    text-align: center;
    background-color: #f8f1e8;
}


.countdown-boxes {
    display: flex;
    justify-content: center;
    gap: 0.6rem;
    flex-wrap: nowrap;
}

.countdown-box {
    display: flex;
    flex-direction: column;
    align-items: center;
    min-width: 0;
}

.countdown-number {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2.6rem;
    font-weight: 600;
    color: var(--blue);
    line-height: 1;
}


.countdown-label {
    font-size: 0.75rem;
    letter-spacing: 0.08em;
    color: var(--muted);
    margin-top: 0.4rem;
    font-weight: 500;
}


.countdown-separator {
    font-family: 'Cormorant Garamond', serif;
    font-size: 2rem;
    color: var(--gold);
    align-self: flex-start;
    margin-top: 0.2rem;
    opacity: 0.6;
}

/* ---------- MESSAGE ---------- */
.message-section {
    padding: 4.5rem 1.5rem;
    text-align: center;
    max-width: 750px;
    margin: 0 auto;
}

.message-section .section-heading {
    margin-bottom: 2rem;
}

.message-section p {
    font-size: 1rem;
    line-height: 2;
    color: var(--ink-soft);
    margin-bottom: 1.2rem;
}


.message-signature {
    margin-top: 2rem;
    font-family: 'Noto Serif Georgian', 'Cormorant Garamond', serif;
}

.message-section .message-signature {
    font-size: 1.05rem;
    color: var(--blue);
}


/* ---------- TIMELINE ----------
   Line on the left with numbered dots, cards to the right. */
.timeline-section {
    padding: 4.5rem 1.25rem;
    background-color: var(--paper-alt);
}


.timeline-section .section-heading {
    margin-bottom: 3rem;
}

.timeline {
    position: relative;
    max-width: 800px;
    margin: 0 auto;
}

.timeline::before {
    content: '';
    position: absolute;
    left: 20px;
    top: 0;
    bottom: 0;
    width: 1px;
    background-image: linear-gradient(to bottom, transparent, var(--gold) 15%, var(--gold) 85%, transparent);
    transform: translateX(-50%);
}

.timeline-step {
    position: relative;
    padding-left: 3.5rem;
    margin-bottom: 3rem;
}

.timeline-step:last-child {
    margin-bottom: 0;
}

.timeline-dot {
    position: absolute;
    left: 20px;
    top: 1.4rem;
    width: 42px;
    height: 42px;
    border-radius: 50%;
    background-color: var(--paper);
    border: 2px solid var(--gold);
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.1rem;
    font-weight: 700;
    color: var(--gold);
    z-index: 2;
    box-shadow: 0 2px 12px rgba(201, 178, 110, 0.2);
}


.timeline-card {
    background-color: #fff;
    border-radius: 12px;
    padding: 1.5rem;
    box-shadow: 0 4px 24px rgba(58, 48, 40, 0.06);
    border: 1px solid rgba(201, 178, 110, 0.15);
    cursor: pointer;
    transition: transform 0.3s ease, box-shadow 0.3s ease, background-color 1.5s ease, border-color 1.5s ease, color 1.5s ease;
}


.timeline-card:active {
    transform: scale(0.98);
}

.timeline-time {
    font-family: 'Cormorant Garamond', serif;
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--gold);
    line-height: 1;
    margin-bottom: 0.5rem;
}

.timeline-card h3 {
    font-family: 'Noto Serif Georgian', 'Cormorant Garamond', serif;
    font-size: 1.25rem;
    font-weight: 500;
    color: var(--blue);
    margin-bottom: 0.7rem;
}


.card-location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: fit-content;
    font-size: 0.95rem;
    color: var(--muted);
    letter-spacing: 0.02em;
    text-decoration: none;
    border-bottom: 1px solid rgba(138, 126, 107, 0.35);
    padding-bottom: 2px;
    transition: color 0.25s ease, border-color 0.25s ease, background-color 1.5s ease;
}

.card-location:hover {
    color: var(--blue);
    border-color: rgba(63, 94, 136, 0.45);
}



.card-location-icon {
    width: 16px;
    height: 16px;
    flex-shrink: 0;
    opacity: 0.7;
}

/* ---------- TIMELINE POPUP ---------- */
.popup-overlay {
    position: fixed;
    inset: 0;
    z-index: 200;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(0, 0, 0, 0.35);
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.25s ease, background-color 1.5s ease, color 1.5s ease, border-color 1.5s ease;
}

.popup-overlay.active {
    opacity: 1;
    pointer-events: all;
}

.popup {
    background-color: #fff;
    border-radius: 16px;
    padding: 2rem 1.8rem;
    max-width: 420px;
    width: calc(100% - 3rem);
    box-shadow: 0 24px 60px rgba(0, 0, 0, 0.18);
    border-top: 3px solid var(--gold);
    transform: translateY(20px) scale(0.97);
    opacity: 0;
    font-family: 'Noto Serif Georgian', 'Cormorant Garamond', serif;
    transition: transform 0.25s ease, opacity 0.25s ease, background-color 1.5s ease, color 1.5s ease, border-color 1.5s ease;
}


.popup-overlay.active .popup {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.popup-title {
    font-size: 1.35rem;
    font-weight: 500;
    color: var(--blue);
    margin-bottom: 0.4rem;
}


.popup-location {
    font-size: 0.9rem;
    color: var(--gold);
    letter-spacing: 0.04em;
    margin-bottom: 1.1rem;
    font-weight: 600;
}

.popup-body {
    font-size: 0.98rem;
    line-height: 1.8;
    color: var(--ink-soft);
}


.popup-map {
    margin-top: 1.1rem;
}

.popup-map a {
    font-size: 0.9rem;
    color: var(--blue);
    text-decoration: none;
    border-bottom: 1px solid rgba(63, 94, 136, 0.35);
    transition: color 0.25s ease, border-color 0.25s ease, background-color 1.5s ease;
}


.popup-close {
    margin-top: 1.5rem;
    display: inline-block;
    font-size: 0.85rem;
    letter-spacing: 0.08em;
    color: var(--muted);
    cursor: pointer;
    border: none;
    background: none;
    font-family: inherit;
    padding: 0;
}

/* ---------- FOOTER ---------- */
.footer {
    padding: 3rem 1.5rem 2.5rem;
    text-align: center;
    background-color: var(--paper-deep);
}


.footer__names {
    font-family: 'Noto Serif Georgian', 'Cormorant Garamond', serif;
    font-size: 1.4rem;
    font-weight: 400;
    letter-spacing: 0.04em;
    color: var(--blue);
}


.footer__rule {
    display: block;
    width: 46px;
    height: 1px;
    margin: 0.9rem auto;
    background-image: linear-gradient(to right, transparent, var(--gold), transparent);
}

.footer__date {
    font-size: 0.85rem;
    letter-spacing: 0.06em;
    color: var(--muted);
}


.credit {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    margin-top: 1.6rem;
    text-decoration: none;
    opacity: 0.3;
    transition: opacity 0.4s ease, background-color 1.5s ease, color 1.5s ease, border-color 1.5s ease;
}

.credit:hover {
    opacity: 0.75;
}

.credit__logo {
    width: 18px;
    height: 18px;
    display: block;
}

.credit__text {
    font-family: 'Cormorant Garamond', 'Noto Serif Georgian', serif;
    font-size: 0.8rem;
    letter-spacing: 0.06em;
    color: var(--blue);
}


/* ---------- ENVELOPE ----------
   Four CSS-border triangles over a fixed overlay. Flaps stay on plain vh/vw:
   the overlay is inset:0 and only shown while the page is JS-locked, so the
   in-app nav bar never moves under it. Opens by itself once the loader clears
   (script.js), or earlier on tap. */
.envelope-parent {
    position: fixed;
    inset: 0;
    z-index: 10;
    cursor: pointer;
    overflow: hidden;
}

.envelope-part {
    position: absolute;
    width: 0;
    height: 0;
    box-sizing: content-box;
    transition: transform 3s cubic-bezier(0.4, 0, 0.2, 1), opacity 3s ease, background-color 1.5s ease, border-color 1.5s ease, color 1.5s ease;
}

.envelope-part.top {
    z-index: 3;
    top: 0;
    left: 0;
    border-left: 50vw solid transparent;
    border-right: 50vw solid transparent;
    border-top: 50vh solid #e8ddd2;
    filter: drop-shadow(0 6px 8px rgba(0, 0, 0, 0.22));
}

.envelope-part.bottom {
    z-index: 1;
    bottom: 0;
    left: 0;
    border-left: 50vw solid transparent;
    border-right: 50vw solid transparent;
    border-bottom: 50vh solid #ddd3c6;
}

.envelope-part.left {
    z-index: 2;
    top: 0;
    left: 0;
    border-top: 50vh solid transparent;
    border-bottom: 50vh solid transparent;
    border-left: 50vw solid #e4d9ce;
    filter: drop-shadow(4px 0 6px rgba(0, 0, 0, 0.15));
}

.envelope-part.right {
    z-index: 2;
    top: 0;
    right: 0;
    border-top: 50vh solid transparent;
    border-bottom: 50vh solid transparent;
    border-right: 50vw solid #e4d9ce;
    filter: drop-shadow(-4px 0 6px rgba(0, 0, 0, 0.15));
}

.wax {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    z-index: 5;
    pointer-events: none;
    transition: opacity 0.8s ease, transform 0.5s ease, background-color 1.5s ease;
}

.wax img {
    width: 12rem;
    height: auto;
    display: block;
}

.envelope-parent.open {
    pointer-events: none;
}

.envelope-parent.open .wax {
    opacity: 0;
    transform: translate(-50%, -50%) scale(1.01);
}

.envelope-parent.open .envelope-part.top {
    transform: translateY(-100%);
    opacity: 0;
}

.envelope-parent.open .envelope-part.bottom {
    transform: translateY(100%);
    opacity: 0;
    transition-delay: 0.3s;
}

.envelope-parent.open .envelope-part.left {
    transform: translateX(-100%);
    opacity: 0;
    transition-delay: 0.15s;
}

.envelope-parent.open .envelope-part.right {
    transform: translateX(100%);
    opacity: 0;
    transition-delay: 0.15s;
}

/* ---------- DESKTOP NOTICE ---------- */
.mobile-prompt {
    display: none;
}

/* ---------- REDUCED MOTION ---------- */
@media (prefers-reduced-motion: reduce) {
    .hero-scroll__arrows svg {
        animation: none;
    }

    .hero-scroll__arrows svg:nth-child(2) {
        display: none;
    }

    .reveal,
    .hero > *:not(.hero-bg) {
        transform: none;
        transition-duration: 0.3s;
        transition-delay: 0s;
    }

    .envelope-part,
    .wax {
        transition-duration: 0.6s;
        transition-delay: 0s;
    }
}

/* ---------- 481px+ : larger phones ---------- */
@media (min-width: 481px) {
    .hero-names {
        font-size: 2.9rem;
    }

    .countdown-boxes {
        gap: 1.2rem;
    }

    .countdown-number {
        font-size: 3.2rem;
    }

    .wax img {
        width: 14rem;
    }
}

/* ---------- 769px+ : desktop shows the notice only ----------
   The site is designed for phones; above this width the envelope, hero and
   every section are hidden and replaced with a blank backdrop + this card. */
@media (min-width: 769px) {
    .loader,
    .page {
        display: none;
    }

    html,
    body {
        background-color: var(--paper-deep);
    }

    .mobile-prompt {
        display: flex;
        flex-direction: column;
        align-items: center;
        gap: 14px;
        position: fixed;
        top: 50%;
        left: 50%;
        transform: translate(-50%, -50%);
        z-index: 9999;
        width: 340px;
        padding: 22px 20px 20px;
        background-color: rgba(255, 255, 255, 0.96);
        border: 1px solid rgba(201, 178, 110, 0.3);
        border-radius: 18px;
        text-align: center;
        box-shadow: 0 10px 34px rgba(63, 94, 136, 0.22);
        transition: opacity 0.35s ease, transform 0.35s ease;
    }

    .mobile-prompt.hidden {
        opacity: 0;
        transform: translate(-50%, calc(-50% + 16px));
        pointer-events: none;
    }

    .mobile-prompt__icon {
        width: 52px;
        height: 52px;
        display: block;
        opacity: 0.8;
    }

    .mobile-prompt__text {
        font-family: 'Noto Serif Georgian', Georgia, serif;
        font-size: 13px;
        letter-spacing: 0.03em;
        line-height: 1.65;
        color: var(--ink);
    }

    .mobile-prompt__close {
        position: absolute;
        top: 10px;
        right: 12px;
        background: none;
        border: none;
        cursor: pointer;
        font-size: 14px;
        color: rgba(63, 94, 136, 0.45);
        padding: 4px 6px;
        line-height: 1;
    }
}
