@font-face {
    font-family: 'Saint Amour Script';
    src: url('fonts/SaintAmourScript.woff2') format('woff2'),
         url('fonts/SaintAmourScript.ttf') format('truetype');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

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

:root {
    --ink: #3a3327;
    --ink-soft: #5c5446;
    --taupe: #79705f;
    --taupe-dark: #6e6557;
    --cream: #ece1cc;
    --cream-bright: #f5ecd6;
    --paper: #e6e1d6;
    --paper-hero: #dedcd5;
    --gold: #b89b6e;

    --line: rgba(58, 51, 39, 0.16);
    --line-cream: rgba(236, 225, 204, 0.35);

    --script: 'Saint Amour Script', cursive;
    --display: 'Playfair Display', serif;
    --body: 'Cormorant Garamond', serif;

    --max-w: 540px;
    --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

html {
    scroll-behavior: smooth;
    -webkit-font-smoothing: antialiased;
    text-rendering: optimizeLegibility;
    overflow-x: hidden;
    overscroll-behavior-y: none;
    /* Fills the iOS Safari overscroll gutters (top + bottom safe-area under the
       browser bar) with the first section's background instead of body's. */
    background: var(--paper-hero);
}

body {
    font-family: var(--body);
    color: var(--ink);
    background: var(--paper);
    overflow-x: hidden;
}

img { display: block; max-width: 100%; height: auto; }
a { text-decoration: none; color: inherit; }
em { font-style: italic; }

/* ============ REVEAL ============ */
[data-reveal] {
    opacity: 0;
    transform: translateY(26px);
    transition: opacity 1.1s var(--ease), transform 1.1s var(--ease);
}
[data-reveal].revealed {
    opacity: 1;
    transform: none;
}

[data-reveal="mask"] {
    opacity: 1;
    transform: none;
    clip-path: inset(0 0 100% 0);
    transition: clip-path 1.3s var(--ease);
}
[data-reveal="mask"].revealed {
    clip-path: inset(0 0 0 0);
}

/* Hero name lines slide up under a mask */
[data-reveal-name] {
    display: block;
    opacity: 0;
    transform: translateY(0.5em);
    transition: opacity 1s var(--ease), transform 1s var(--ease);
}
[data-reveal-name].revealed {
    opacity: 1;
    transform: none;
}

/* ============ HEADINGS ============ */
.heading {
    text-align: center;
    margin-bottom: 44px;
}

.heading--script {
    font-family: var(--script);
    font-weight: 400;
    font-size: clamp(80px, 18vw, 148px);
    line-height: 1.05;
    color: var(--ink);
    letter-spacing: 0.01em;
}

.heading--cream {
    color: var(--cream-bright);
    text-shadow: 0 1px 16px rgba(40, 34, 24, 0.25);
}

/* ============ FOCUS (keyboard) ============ */
a:focus-visible,
.btn:focus-visible,
.dresscode__color:focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 3px;
}
:focus:not(:focus-visible) { outline: none; }

/* ============ BUTTONS ============ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 13px 34px;
    font-family: var(--body);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.04em;
    border-radius: 100px;
    cursor: pointer;
    transition: background 0.45s ease, color 0.45s ease, transform 0.45s ease, border-color 0.45s ease;
    border: 1px solid var(--ink);
    background: transparent;
    color: var(--ink);
}
.btn:hover {
    background: var(--ink);
    color: var(--paper);
    transform: translateY(-2px);
}

.btn--cream {
    border-color: var(--line-cream);
    color: var(--cream);
}
.btn--cream:hover {
    background: var(--cream);
    color: var(--taupe);
    border-color: var(--cream);
}
.btn--ghost {
    background: transparent;
}

.btn--outline {
    border-color: rgba(58, 51, 39, 0.35);
    color: var(--ink-soft);
}
.btn--outline:hover {
    background: var(--ink-soft);
    color: var(--paper);
    border-color: var(--ink-soft);
}

.btn--sm {
    padding: 10px 24px;
    font-size: 14px;
}

/* ============ CORNER ORNAMENTS ============ */
.corner {
    position: absolute;
    width: clamp(78px, 22vw, 150px);
    height: clamp(90px, 26vw, 176px);
    background-repeat: no-repeat;
    background-size: contain;
    pointer-events: none;
    z-index: 1;
    opacity: 0;
    transition: opacity 1.4s ease 0.3s;
}
.revealed-corners .corner { opacity: 0.92; }

.corner--tl { top: 22px; left: 18px; background-image: url('figma-export/processed/corner-tl.webp'); background-position: top left; }
.corner--tr { top: 22px; right: 18px; background-image: url('figma-export/processed/corner-tr.webp'); background-position: top right; }
.corner--bl { bottom: 22px; left: 18px; background-image: url('figma-export/processed/corner-bl.webp'); background-position: bottom left; }
.corner--br { bottom: 22px; right: 18px; background-image: url('figma-export/processed/corner-br.webp'); background-position: bottom right; }

/* ============ HERO ============ */
.hero {
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* viewport-fit=cover lets the hero bg fill behind the Dynamic Island;
       add the inset back as padding so the names clear it. */
    padding: calc(28px + env(safe-area-inset-top)) 24px 28px;
    background: var(--paper-hero);
    position: relative;
}

/* Mobile: a column whose midpoint is the framed photo, so the frame lands
   at the viewport centre on load (justify-content:center overflows
   symmetrically). The top/bottom spacers equalise the names/meta blocks. */
.hero__grid {
    flex: 1 1 auto;
    width: 100%;
    max-width: 1180px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0;
}

.hero__lede { width: 100%; text-align: center; }

.hero__names {
    position: relative;
    width: min(94vw, 640px);
    max-width: 640px;
    margin: 0 auto;
    line-height: 0.92;
    font-weight: 400;
}

.hero__name {
    display: block;
    font-family: var(--script);
    font-size: clamp(66px, 22vw, 172px);
    font-weight: 400;
    line-height: 1.05;
    color: var(--ink);
}
.hero__name--1 { text-align: left; padding-left: 0.425em; }
.hero__name--2 { text-align: right; padding-right: 0.5em; margin-top: -0.22em; }

.hero__and {
    text-align: center;
    font-family: var(--script);
    font-size: 24vw;
    line-height: 0.3;
    color: var(--ink);
    margin: -0.18em 0 -0.14em;
    padding: 0;
}

.hero__meta {
    width: 100%;
    text-align: center;
}

.hero__date {
    font-family: var(--display);
    font-style: normal;
    font-weight: 500;
    font-size: clamp(27px, 7vw, 40px);
    letter-spacing: 0.06em;
    color: var(--ink);
    margin: 0 0 22px;
}

.hero__invite {
    font-family: var(--body);
    font-size: clamp(16px, 4.2vw, 19px);
    font-style: italic;
    color: var(--ink-soft);
    line-height: 1.85;
    max-width: 440px;
    margin: 0 18px 30px;
}
.hero__invite em { color: var(--ink); font-weight: 600; }

.hero__frame {
    width: min(80vw, 320px);
    aspect-ratio: 573 / 865;
}
.hero__frame img {
    width: 100%;
    height: 100%;
    object-fit: contain;
    animation: kenburns 18s ease-in-out infinite alternate;
}
@keyframes kenburns {
    from { transform: scale(1); }
    to   { transform: scale(1.03); }
}

/* ============ LOCATION ============ */
.location {
    position: relative;
    background: var(--taupe);
    padding: 96px 30px 104px;
    text-align: center;
    overflow: hidden;
}

.location__grid {
    position: relative;
    z-index: 2;
    max-width: var(--max-w);
    margin: 0 auto;
}

.location__photo {
    width: clamp(180px, 52vw, 250px);
    margin: 0 auto 30px;
    border-radius: 16px;
    overflow: hidden;
}
.location__photo img {
    display: block;
    width: 100%;
    aspect-ratio: 3 / 4;
    object-fit: cover;
    object-position: 2% center;
    filter: sepia(24%) saturate(86%) contrast(0.94) brightness(1.03);
}

.location__title {
    font-size: clamp(80px, 21vw, 168px);
    margin-bottom: 24px;
}

.location__venue {
    font-family: var(--display);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--cream);
    margin-bottom: 10px;
}

.location__address {
    font-family: var(--body);
    font-size: 17px;
    color: var(--cream);
    line-height: 1.6;
    opacity: 0.82;
    margin-bottom: 30px;
}

.location__actions {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============ TIMELINE ============ */
.timeline {
    padding: 60px 24px 0;
    max-width: var(--max-w);
    margin: 0 auto;
    text-align: center;
}

.timeline__title-heading {
    font-size: clamp(80px, 21vw, 168px);
    margin-bottom: 20px;
}

.timeline__track {
    --timeline-gap: 64px;
    --timeline-divider-height: 40px;

    position: relative;
    padding: 26px 0;
    margin-bottom: 12px;
}

.timeline__line {
    display: none;
}

.timeline__item {
    padding: 0;
    position: relative;
}

.timeline__item + .timeline__item {
    margin-top: var(--timeline-gap);
}

.timeline__time {
    font-family: var(--display);
    font-size: clamp(30px, 8vw, 38px);
    font-weight: 400;
    color: var(--ink);
    margin-bottom: 10px;
}

.timeline__title {
    font-family: var(--display);
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
    color: var(--ink);
    margin-bottom: 12px;
}

.timeline__desc {
    font-family: var(--body);
    font-size: 17px;
    font-style: italic;
    color: var(--ink-soft);
    line-height: 1.7;
    max-width: 360px;
    margin: 0 auto;
    white-space: pre-line;
}

.timeline__item + .timeline__item::before {
    content: '';
    position: absolute;
    top: calc((var(--timeline-gap) + var(--timeline-divider-height)) / -2);
    left: 50%;
    transform: translateX(-50%);
    width: 1px;
    height: var(--timeline-divider-height);
    background: var(--line);
}

.timeline__illustration {
    max-width: 300px;
    margin: 44px auto 0;
    opacity: 0.92;
}
.timeline__illustration img { width: 100%; }

/* ============ DRESSCODE ============ */
.dresscode {
    position: relative;
    background: var(--taupe);
    padding: 60px 30px;
    text-align: center;
    overflow: hidden;
}

.dresscode__content {
    position: relative;
    z-index: 2;
    max-width: var(--max-w);
    margin: 0 auto;
}

.dresscode__text {
    font-family: var(--body);
    font-size: 17px;
    font-style: italic;
    color: var(--cream-bright);
    line-height: 1.85;
    max-width: 360px;
    margin: 0 auto 44px;
    opacity: 0.95;
}

.dresscode__doily {
    position: relative;
    display: inline-block;
    width: clamp(300px, 88vw, 440px);
    aspect-ratio: 448 / 318;
}
.dresscode__doily-img {
    position: absolute;
    top: 50%;
    left: 50%;
    width: calc(100% * 318 / 448);
    filter: sepia(12%) saturate(75%) brightness(1.06) drop-shadow(0 14px 30px rgba(0, 0, 0, 0.22));
    transform: translate(-50%, -50%) rotate(90deg);
}

.dresscode__doily-content {
    position: absolute;
    inset: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transform: translateY(clamp(-18px, -3.5vw, -12px));
}

.dresscode__palette-label {
    font-family: var(--script);
    font-size: clamp(52px, 15vw, 82px);
    color: var(--taupe);
    line-height: 0.9;
    margin-bottom: 18px;
}

.dresscode__colors {
    display: flex;
    justify-content: center;
    margin-top: -4px;
    width: auto;
}
.dresscode__color {
    position: relative;
    width: clamp(42px, 9.4vw, 52px);
    height: clamp(42px, 9.4vw, 52px);
    border-radius: 50%;
    background: var(--c);
    box-shadow: 0 3px 12px rgba(0, 0, 0, 0.08), inset 0 0 0 1px rgba(255, 255, 255, 0.28);
    transition: transform 0.35s ease;
    cursor: pointer;
}
.dresscode__color + .dresscode__color { margin-left: clamp(-9px, -1.8vw, -7px); }
.dresscode__color:hover { transform: scale(1.25) translateY(-3px); }
.dresscode__legend {
    margin-top: 30px;
    font-family: var(--body);
    font-size: clamp(9.5px, 3vw, 13px);
    letter-spacing: 0.05em;
    text-transform: uppercase;
    white-space: nowrap;
    color: var(--cream-bright);
    opacity: 0.85;
}
@media (min-width: 900px) {
    .dresscode__legend { display: none; }
}

/* ============ DETAILS ============ */
.details {
    --details-envelope-width: clamp(152px, 26vw, 450px);
    --details-bouquet-width: clamp(250px, 54vw, 440px);
    padding: 60px 24px;
    width: 100%;
    max-width: none;
    margin: 0 auto;
    text-align: center;
    position: relative;
    overflow: hidden;
}

.details__decor {
    position: absolute;
    z-index: 0;
    opacity: 0.72;
    pointer-events: none;
}
.details__decor--left {
    top: 112px;
    left: 0;
    width: var(--details-envelope-width);
    transform: translateX(-24%) rotate(20deg);
}
.details__decor--right {
    top: 420px;
    right: 0;
    width: var(--details-bouquet-width);
    transform: translateX(45%) rotate(-25deg);
}

.details > :not(.details__decor) {
    position: relative;
    z-index: 1;
}

.details__gift-text { margin-bottom: 26px; }
.details__flowers-text { margin-bottom: 36px; }

.details__gift-text p,
.details__flowers-text p {
    font-family: var(--body);
    font-size: 17px;
    font-style: italic;
    line-height: 1.85;
    color: var(--ink);
    margin: 0 auto;
}
.details__gift-text p {
    max-width: min(384px, calc(100% - 78px));
    white-space: pre-line;
}
.details__flowers-text p {
    color: var(--ink-soft);
    max-width: min(358px, calc(100% - 78px));
}

/* ============ RSVP ============ */
.rsvp {
    padding: 60px 24px 96px;
    max-width: var(--max-w);
    margin: 0 auto;
}

.rsvp__frame {
    position: relative;
    padding: clamp(120px, 30vw, 172px) clamp(40px, 11vw, 64px);
    text-align: center;
}

/* Diagonal corner ribbons (top-left + bottom-right) instead of a full frame. */
.rsvp__ribbon {
    position: absolute;
    width: clamp(168px, 50vw, 290px);
    height: auto;
    pointer-events: none;
    opacity: 0.85;
    z-index: 0;
}
.rsvp__ribbon--tl { top: clamp(6px, 12vw, 102px); left: clamp(-12px, -28vw, 6px); }
.rsvp__ribbon--br { bottom: clamp(6px, 12vw, 92px); right: clamp(-12px, -18vw, 16px); transform: rotate(180deg); }

.rsvp__inner { position: relative; z-index: 1; max-width: 320px; margin: 0 auto; }

.rsvp__text {
    font-family: var(--body);
    font-size: 17px;
    font-style: italic;
    line-height: 1.85;
    color: var(--ink);
    margin-bottom: 30px;
}

.rsvp__organizer { margin-top: 40px; }
.rsvp__organizer p {
    font-family: var(--body);
    font-size: 16px;
    font-style: italic;
    line-height: 1.7;
    color: var(--ink-soft);
    margin-bottom: 20px;
}

.rsvp__contact-btns {
    display: flex;
    gap: 12px;
    justify-content: center;
    flex-wrap: wrap;
}

/* ============ CLOSING ============ */
.closing {
    background: var(--taupe);
    /* Extend taupe into the bottom safe-area so there's no light strip under
       the browser bar / home indicator on the last section. */
    padding: clamp(86px, 20vw, 112px) 24px calc(clamp(86px, 20vw, 112px) + env(safe-area-inset-bottom));
    text-align: center;
    position: relative;
    overflow: hidden;
}

.closing__lace {
    position: absolute;
    left: 0;
    right: 0;
    z-index: 3;
    height: clamp(54px, 14vw, 77px);
    background: url('figma-export/processed/footer-lace-custom.png') repeat-x center;
    background-size: auto 100%;
    opacity: 1;
    pointer-events: auto;
}
.closing__lace--top { top: 0; transform: scaleY(-1); }
.closing__lace--bottom { bottom: 0; }

.closing__content { position: relative; z-index: 2; }

.closing__text {
    font-family: var(--body);
    font-size: clamp(24px, 5.6vw, 34px);
    font-style: italic;
    color: var(--cream-bright);
    line-height: 1.35;
    opacity: 1;
}
.closing__text span {
    font: inherit;
    color: inherit;
}

/* ============ RESPONSIVE ============ */
@media (min-width: 768px) {
    .location { padding: 130px 48px; }
    .dresscode { padding: 130px 48px; }
    .timeline { padding: 130px 48px 0; }
    .details { padding: 130px 48px; }
    .rsvp { padding: 40px 48px 130px; }
    .closing { padding: 96px 48px; }
}

/* ---- Desktop: asymmetric compositions ---- */
@media (min-width: 900px) {
    .hero { padding: 96px 56px 104px; }
    .hero__grid {
        display: grid;
        grid-template-columns: 1fr auto;
        grid-template-rows: auto auto;
        grid-template-areas:
            "lede  frame"
            "meta  frame";
        align-items: center;
        column-gap: clamp(40px, 6vw, 88px);
        row-gap: 0;
        text-align: left;
    }
    .hero__lede { grid-area: lede; align-self: end; text-align: left; max-width: 620px; }
    .hero__names { margin: 0; width: auto; }
    .hero__name { font-size: clamp(80px, 9vw, 140px); }
    .hero__and { font-size: clamp(60px, 7vw, 92px); line-height: 0.3; padding-left: 1.3em; }
    .hero__meta {
        grid-area: meta;
        align-self: start;
        text-align: left;
        max-width: 620px;
        margin-top: clamp(24px, 4vw, 40px);
    }
    .hero__invite { margin: 0 0 30px; }
    .hero__frame {
        grid-area: frame;
        align-self: center;
        width: clamp(300px, 30vw, 390px);
    }

    /* Location two-column */
    .location__grid {
        max-width: 920px;
        display: grid;
        grid-template-columns: clamp(220px, 22vw, 280px) minmax(340px, 430px);
        grid-template-areas:
            "photo title"
            "photo info";
        align-items: center;
        justify-content: center;
        column-gap: clamp(40px, 6vw, 80px);
        row-gap: 0;
        text-align: left;
    }
    .location__photo { grid-area: photo; align-self: center; grid-row: span 2; margin: 0; width: 100%; }
    .location__title { grid-area: title; align-self: end; text-align: left; margin-bottom: 20px; }
    .location__info { grid-area: info; align-self: start; }
    .location__actions { justify-content: flex-start; }

    /* Timeline: four columns in a row */
    .timeline { max-width: 1000px; }
    .timeline__line { display: none; }
    .timeline__track {
        display: grid;
        grid-template-columns: repeat(4, 1fr);
        align-items: stretch;
        padding: 12px 0;
    }
    .timeline__item {
        padding: 8px 22px;
        margin-top: 0;
        text-align: center;
        display: flex;
        flex-direction: column;
        justify-content: center;
    }
    .timeline__item + .timeline__item {
        margin-top: 0;
        border-left: 1px solid var(--line);
    }
    /* divider was a horizontal rule between stacked items on mobile */
    .timeline__item + .timeline__item::before { display: none; }
    .timeline__time { font-size: clamp(30px, 3vw, 38px); }
    .timeline__desc { max-width: none; margin: 0; }

    /* Details with edge decor */
    .details { max-width: none; }
}

@media (min-width: 1024px) {
    :root { --max-w: 600px; }

    .location__venue { font-size: 18px; }
    .location__address { font-size: 18px; }

    .timeline__time { font-size: 42px; }
    .timeline__title { font-size: 19px; }
    .timeline__desc { font-size: 18px; }

    .dresscode__text { font-size: 19px; max-width: 420px; }

    .details__gift-text p,
    .details__flowers-text p { font-size: 19px; }

    .rsvp__text { font-size: 19px; }
    .rsvp__organizer p { font-size: 17px; }
    .rsvp__inner { max-width: 370px; }

    .closing__text { font-size: 34px; }
}

@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after { animation: none !important; }
    [data-reveal], [data-reveal-name] { transition: none; opacity: 1; transform: none; }
    [data-reveal="mask"] { clip-path: none; }
    .corner { transition: none; opacity: 0.92; }
}
