/* ============================================
   1. CSS Variables (tokens from Figma, scaled ×0.75)
   ============================================ */
:root {
    --color-bg: #F8F3ED;
    --color-text: #614636;
    --color-heading: #614635;
    --color-button-border: #C5C9AB;
    --color-button-bg: #FFFFFF;

    --font-script: 'Annabelle', 'Brush Script MT', cursive;
    --font-display: 'Tai Heritage Pro', 'Cormorant Garamond', Georgia, serif;
    --font-body: 'Source Serif 4', 'Source Serif Pro', Georgia, serif;

    --container-max: 1440px;
    --content-max: 75rem; /* ~1200px */

    --space-section: 6.25rem;       /* 100px — gap between sections */
    --space-section-mobile: 3.5rem; /* 56px */

    --shadow-button: 0 0.25rem 0.25rem rgba(0, 0, 0, 0.05);
}

/* ============================================
   2. Local font
   ============================================ */
@font-face {
    font-family: 'Annabelle';
    src: url('assets/fonts/annabelle-cyr.woff2') format('woff2');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
    unicode-range: U+0000-007F, U+0400-04FF, U+0500-052F;
}

/* ============================================
   3. Reset & Base
   ============================================ */
*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    margin: 0;
    background: var(--color-bg);
    color: var(--color-text);
    font-family: var(--font-body);
    font-size: 1.125rem;
    line-height: 1.6;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

img {
    display: block;
    max-width: 100%;
    height: auto;
}

h1, h2, h3, p, ul {
    margin: 0;
    padding: 0;
}

ul {
    list-style: none;
}

a {
    color: inherit;
}

/* ============================================
   4. Layout (page container & sections)
   ============================================ */
.page {
    position: relative;
    max-width: var(--container-max);
    margin: 0 auto;
    overflow: hidden; /* clip decor that bleeds beyond container */
}

.section {
    position: relative;
    padding: 0 1.25rem;
    margin-bottom: var(--space-section);
    text-align: center;
    z-index: 1;
}

.section__title {
    font-family: var(--font-script);
    font-weight: 400;
    color: var(--color-heading);
    font-size: 4.5rem;        /* 72px */
    line-height: 1;
    margin-bottom: 2rem;
    position: relative;
    z-index: 2;
}

.section__divider {
    display: block;
    width: 22.625rem;          /* ~362px */
    max-width: 80%;
    height: auto;
    margin: 0 auto 1.75rem;
    position: relative;
    z-index: 2;
}

.section__divider--wide {
    width: 28.125rem;          /* 450px */
}

.section__body {
    max-width: 60rem;          /* 960px */
    margin: 0 auto;
    font-size: 1.3125rem;      /* 21px */
    line-height: 1.55;
    color: var(--color-text);
    position: relative;
    z-index: 2;
}

.section__body--narrow {
    max-width: 38.75rem;       /* 620px */
}

.section__body p + p {
    margin-top: 0.5rem;
}

/* ============================================
   5. Hero
   ============================================ */
.hero {
    position: relative;
    padding: 0 1.25rem;
    padding-top: 16.625rem;    /* ~266px, header top in scaled design */
    padding-bottom: 4rem;
    margin-bottom: var(--space-section);
    text-align: center;
    z-index: 1;
}

.hero__inner {
    position: relative;
    z-index: 2;
    max-width: 70rem;
    margin: 0 auto;
}

.hero__title {
    display: block;
    width: 24.375rem;          /* ~390px */
    max-width: 80%;
    height: auto;
    margin: 0 auto 1.5rem;
}

.hero__divider {
    display: block;
    width: 32.625rem;          /* ~522px */
    max-width: 90%;
    height: auto;
    margin: 0 auto 2.5rem;
}

.hero__date-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.5rem;
    font-family: var(--font-display);
    font-size: 3rem;           /* 48px */
    line-height: 1;
    color: var(--color-heading);
    margin-bottom: 1.25rem;
    font-feature-settings: 'lnum' 1, 'pnum' 1;
}

.hero__bullet {
    font-family: var(--font-body);
    font-weight: 700;
    font-size: 1.5rem;
    transform: translateY(-0.125rem);
}

.hero__place {
    font-family: var(--font-body);
    font-size: 1.875rem;       /* 30px */
    line-height: 1.2;
    color: var(--color-heading);
    font-feature-settings: 'lnum' 1, 'pnum' 1;
}

/* ============================================
   6. Program section
   ============================================ */
.program {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.75rem;
    font-family: var(--font-body);
    color: var(--color-heading);
}

.program__item {
    display: grid;
    grid-template-columns: 5rem 1.5rem 1fr;
    align-items: baseline;
    gap: 1rem;
    text-align: left;
}

.program__time {
    font-family: var(--font-display);
    font-size: 2.25rem;        /* 36px */
    line-height: 1;
    text-align: right;
    font-feature-settings: 'lnum' 1, 'pnum' 1;
}

.program__bullet {
    font-size: 1.5rem;
    text-align: center;
    color: var(--color-heading);
    font-weight: 300;
}

.program__text {
    font-size: 1.5rem;         /* 24px */
    line-height: 1.2;
}

/* ============================================
   7. RSVP button
   ============================================ */
.rsvp-button {
    display: inline-block;
    margin-top: 1.75rem;
    padding: 0.875rem 5rem;
    background: var(--color-button-bg);
    color: var(--color-heading);
    font-family: var(--font-body);
    font-size: 1.3125rem;
    font-weight: 300;
    text-decoration: none;
    border: 1px solid var(--color-button-border);
    border-radius: 1.5rem;
    box-shadow: var(--shadow-button);
    transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
    position: relative;
    z-index: 2;
}

.rsvp-button:hover,
.rsvp-button:focus-visible {
    transform: translateY(-1px);
    box-shadow: 0 0.4rem 0.6rem rgba(0, 0, 0, 0.08);
    background: #fdfbf6;
}

.rsvp-button:active {
    transform: translateY(0);
    box-shadow: var(--shadow-button);
}

/* ============================================
   8. Farewell (closing block)
   ============================================ */
.section--farewell {
    margin-bottom: 0;
    padding-bottom: 2.5rem;
}

.farewell__flowers {
    display: block;
    width: 100%;
    max-width: 50rem;          /* 800px */
    margin: 2.5rem auto 0;
    position: relative;
    z-index: 2;
}

/* ============================================
   9. Decorative side elements
   ============================================ */
.decor {
    position: absolute;
    pointer-events: none;
    user-select: none;
    z-index: 0;
}

/* Hero top corners — larger so they bridge into invitation area */
.decor--top-left {
    top: 0;
    left: 0;
    width: 42rem;              /* ~672px, capped by max-width on smaller viewports */
    max-width: 45%;
}

.decor--top-right {
    top: 0;
    right: 0;
    width: 36rem;              /* ~576px */
    max-width: 38%;
}

/* Decorations are spread evenly down both edges with visible gaps between them.
   Each anchored to a section, with top/bottom offsets tuned so they don't overlap. */

/* All side decor pulled up so farewell section is clean (per design request).
   Right edge, top → bottom: right-1 (invitation) → right-2 (gifts) → right-3 (rsvp) */
.decor--right-1 {
    top: -15.5rem;             /* extends up into hero/invitation boundary */
    right: 0;
    width: 11rem;              /* ~176px → ~477px tall */
}

.decor--right-2 {
    top: -17rem;               /* pulled up — sits in program/gifts boundary */
    right: 0;
    width: 9rem;               /* ~144px → ~501px tall */
}

.decor--right-3 {
    top: -17rem;               /* pulled up — sits in dress/rsvp boundary */
    right: 0;
    width: 11rem;              /* ~176px → ~272px tall */
}

/* Left edge, top → bottom: left-1 (invitation) → lesft-2 (gifts) → left-3 (rsvp) */
.decor--left-1 {
    top: -15.5rem;
    left: 0;
    width: 10rem;              /* ~160px → ~554px tall */
}

.decor--lesft-2 {
    top: -14rem;
    left: 0;
    width: 11rem;              /* ~176px → ~460px tall */
}

.decor--left-3 {
    top: -17rem;
    left: 0;
    width: 11rem;              /* ~176px → ~345px tall */
}

/* ============================================
   10. Animations
   ============================================ */
.animate-on-scroll {
    opacity: 0;
    transform: translateY(1.875rem);
    transition: opacity 0.8s cubic-bezier(0.16, 1, 0.3, 1),
                transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
    will-change: opacity, transform;
}

.animate-on-scroll.is-visible {
    opacity: 1;
    transform: translateY(0);
}

@media (prefers-reduced-motion: reduce) {
    .animate-on-scroll {
        opacity: 1;
        transform: none;
        transition: none;
    }

    .rsvp-button {
        transition: none;
    }
}

/* ============================================
   11. Mobile (<1024px)
   ============================================ */
@media (max-width: 1023px) {
    body {
        font-size: 1rem;
    }

    .page {
        overflow: hidden;
    }

    .section {
        padding: 0 1.25rem;
        margin-bottom: var(--space-section-mobile);
    }

    .section__title {
        font-size: 2.75rem;    /* 44px */
        margin-bottom: 1.25rem;
    }

    .section__divider {
        width: 16rem;
        margin-bottom: 1.25rem;
    }

    .section__divider--wide {
        width: 18rem;
    }

    .section__body {
        font-size: 1rem;
        line-height: 1.55;
    }

    /* Hero */
    .hero {
        padding-top: 8.5rem;
        padding-bottom: 2rem;
    }

    .hero__title {
        width: 9.35rem;        /* -15% от 11rem */
    }

    .hero__divider {
        width: 18rem;
        margin-bottom: 1.5rem;
    }

    .hero__date-row {
        font-size: 2rem;
        gap: 0.875rem;
        margin-bottom: 0.75rem;
    }

    .hero__bullet {
        font-size: 1.125rem;
    }

    .hero__place {
        font-size: 1.125rem;
        line-height: 1.4;
        padding: 0 0.5rem;
    }

    /* Program */
    .program__item {
        grid-template-columns: 3.5rem 1rem 1fr;
        gap: 0.625rem;
    }

    .program__time {
        font-size: 1.5rem;
    }

    .program__bullet {
        font-size: 1rem;
    }

    .program__text {
        font-size: 1.0625rem;
    }

    /* RSVP */
    .rsvp-button {
        padding: 0.75rem 2.5rem;
        font-size: 1rem;
    }

    /* Farewell flowers */
    .farewell__flowers {
        max-width: 100%;
        margin-top: 1.5rem;
    }

    /* Decor — reduce or hide */
    .decor--top-left {
        width: 60%;
        max-width: 16rem;
        transform: translateY(-1rem);
    }

    .decor--top-right {
        width: 50%;
        max-width: 14rem;
        transform: translateY(-1rem);
    }

    .decor--right-1,
    .decor--left-1,
    .decor--right-2,
    .decor--left-3,
    .decor--right-3,
    .decor--lesft-2 {
        display: none;
    }
}

/* Very small screens — tighten hero further */
@media (max-width: 380px) {
    .hero__date-row {
        font-size: 1.75rem;
    }

    .hero__place {
        font-size: 1rem;
    }

    .section__title {
        font-size: 2.25rem;
    }
}
