/* Root page (/sites/default). Palette and type follow the Invity platform (invityui). */

@font-face {
    font-family: 'Josefin Sans';
    src: url('/sites/commonassets/fonts/Josefin-Sans-Light.ttf') format('truetype');
    font-weight: 300;
    font-display: swap;
}

@font-face {
    font-family: 'Josefin Sans';
    src: url('/sites/commonassets/fonts/Josefin-Sans.ttf') format('truetype');
    font-weight: 400;
    font-display: swap;
}

@font-face {
    font-family: 'Salita';
    src: url('/sites/commonassets/fonts/Salita-Regular.ttf') format('truetype');
    font-display: swap;
}

:root {
    --rose: #cb8b8c;
    --blush: #ecd0c5;
    --sage: #bac5a3;
    --sage-dark: #778065;
    --gold: #e3c98f;
    --cream: #ebe0cc;
    --ink: #333333;
}

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

body {
    min-height: 100vh;
    display: grid;
    place-items: center;
    padding: 24px 16px;
    overflow-x: hidden;
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 300;
    color: var(--ink);
    background-color: var(--cream);
}

/* ---------- Layout ---------- */

.home {
    position: relative;
    width: 100%;
    max-width: 520px;
}

.card {
    position: relative;
    z-index: 2;
    padding: 48px 32px 40px;
    text-align: center;
    background: #fff url('/sites/default/assets_default/images/paper_texture.jpg') center / cover;
    border-radius: 1.5rem;
    box-shadow:
        0 4px 6px -1px rgba(0, 0, 0, 0.08),
        0 24px 48px -24px rgba(0, 0, 0, 0.18);
    animation: rise 0.9s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

/* ---------- Logo ---------- */

.logo {
    width: min(70%, 260px);
    aspect-ratio: 499.714 / 218.207;
    margin: 0 auto 28px;
    background-color: var(--rose);
    -webkit-mask: url('/sites/commonassets/images/invityLogo.svg') center / contain no-repeat;
    mask: url('/sites/commonassets/images/invityLogo.svg') center / contain no-repeat;
}

/* ---------- Text ---------- */

.title {
    font-family: 'Salita', serif;
    font-weight: normal;
    font-size: clamp(1.9rem, 8vw, 2.6rem);
    line-height: 1.2;
    color: var(--rose);
    margin-bottom: 16px;
}

.text {
    font-size: clamp(1rem, 4vw, 1.2rem);
    line-height: 1.6;
    color: #555;
    max-width: 34ch;
    margin: 0 auto 32px;
    animation: fade 0.8s ease 1.1s both;
}

/* ---------- Button ---------- */

.button {
    position: relative;
    display: inline-block;
    overflow: hidden;
    padding: 14px 32px;
    min-height: 44px;
    font-family: 'Josefin Sans', sans-serif;
    font-weight: 400;
    font-size: 1.05rem;
    color: #000;
    text-decoration: none;
    background-color: var(--sage);
    border-radius: 18px;
    box-shadow: 0 6px 0 -1px var(--sage-dark);
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.3s ease, color 0.3s ease;
    animation: fade 0.8s ease 1.3s both;
}

.button:hover,
.button:focus-visible {
    background-color: var(--sage-dark);
    color: #fff;
    transform: translateY(-3px);
    box-shadow: 0 9px 0 -1px #5d644f;
}

.button:active {
    transform: translateY(3px);
    box-shadow: 0 2px 0 -1px #5d644f;
}

.button:focus-visible {
    outline: 3px solid var(--rose);
    outline-offset: 3px;
}

/* ---------- Floating decorations ---------- */

.deco {
    position: absolute;
    z-index: 3;
    -webkit-mask-position: center;
    mask-position: center;
    -webkit-mask-size: contain;
    mask-size: contain;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    border: none;
    padding: 0;
    cursor: pointer;
}

.deco-balloons {
    top: -40px;
    width: 64px;
    aspect-ratio: 30.89 / 42.928;
    background-color: var(--rose);
    -webkit-mask-image: url('/sites/commonassets/images/invityBallons001.svg');
    mask-image: url('/sites/commonassets/images/invityBallons001.svg');
}

.deco-left {
    left: -14px;
    animation: float 5s ease-in-out infinite;
}

.deco-right {
    right: -14px;
    transform: scaleX(-1);
    animation: float 5.5s ease-in-out -2.5s infinite;
}

.deco-balloons.popped {
    animation: pop-out 0.25s ease-in forwards;
}

.deco-balloons.returning {
    animation: drift-in 1s cubic-bezier(0.2, 0.9, 0.3, 1.2) both;
}

/* ---------- Ornament ---------- */

.ornament {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 12px;
    margin: -4px auto 18px;
    max-width: 240px;
}

.ornament::before,
.ornament::after {
    content: '';
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--rose));
}

.ornament::after {
    background: linear-gradient(to left, transparent, var(--rose));
}

.ornament svg {
    width: 18px;
    height: 18px;
    fill: var(--rose);
    animation: twinkle 3s ease-in-out infinite;
}

/* ---------- Footer ---------- */

.footer {
    position: relative;
    z-index: 2;
    margin-top: 28px;
    text-align: center;
    font-size: 0.9rem;
    color: #8a7f7a;
    animation: fade 0.8s ease 1.6s both;
}

.footer a {
    color: var(--rose);
    text-decoration: none;
    border-bottom: 1px dashed currentColor;
}

.footer a:hover {
    border-bottom-style: solid;
}

.footer span[aria-hidden] {
    margin: 0 6px;
}

/* ---------- Easter egg ---------- */

/* Both layers share one grid cell, so the card keeps its size while they crossfade. */
.card {
    display: grid;
}

.card-main,
.card-secret {
    grid-area: 1 / 1;
    transition: opacity 1.2s ease, filter 1.2s ease, visibility 0s linear 1.2s;
}

.card-secret {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 20px;
    cursor: pointer;
    opacity: 0;
    filter: blur(6px);
    visibility: hidden;
}

.card-secret svg {
    width: 22px;
    height: 22px;
    fill: var(--rose);
    animation: twinkle 3s ease-in-out infinite;
}

.card-secret p {
    max-width: 26em;
    font-family: 'Salita', serif;
    font-size: clamp(1rem, 4.2vw, 1.25rem);
    line-height: 1.6;
    color: var(--rose);
}

.card.revealing .card-main {
    opacity: 0;
    filter: blur(6px);
    visibility: hidden;
}

.card.revealing .card-secret {
    opacity: 1;
    filter: none;
    visibility: visible;
    transition-delay: 0.9s, 0.9s, 0s;
}

.card:not(.revealing) .card-main {
    transition-delay: 0.9s, 0.9s, 0s;
}

/* Balloon pop confetti (created by home.js) */
.burst {
    position: fixed;
    z-index: 10;
    width: 8px;
    height: 12px;
    border-radius: 2px;
    background: var(--rose);
    pointer-events: none;
}

/* ---------- Keyframes ---------- */

@keyframes pop-out {
    0%   { scale: 1; opacity: 1; }
    40%  { scale: 1.25; opacity: 1; }
    100% { scale: 0; opacity: 0; }
}

@keyframes drift-in {
    from { translate: 0 120px; opacity: 0; }
    to   { translate: 0 0; opacity: 1; }
}

@keyframes twinkle {
    0%, 100% { scale: 1; rotate: 0deg; opacity: 1; }
    50%      { scale: 0.7; rotate: 45deg; opacity: 0.6; }
}


@keyframes rise {
    from { opacity: 0; transform: translateY(40px) scale(0.96); }
    to   { opacity: 1; transform: none; }
}

@keyframes fade {
    from { opacity: 0; transform: translateY(10px); }
    to   { opacity: 1; transform: none; }
}

@keyframes float {
    0%, 100% { translate: 0 0; }
    50%      { translate: 0 -14px; }
}

/* ---------- Responsive ---------- */

@media (max-width: 480px) {
    .card {
        padding: 40px 22px 32px;
    }

    .deco-balloons { width: 52px; }
    .deco-left     { left: -4px; }
    .deco-right    { right: -4px; }
}
