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

:root {
    color-scheme: only light;
    --oliveGreen: #414B26;
    --bg1: #f8f0de;
    --color-text-primary: #333;
    --color-text-secondary: #70745A;
    --color-text-muted: #999;
    --color-white: #ffffff;
    --color-accent-line: #D8A874;
    --color-danger: #b3261e;
    --color-danger-bg: #fff8f8;
    --color-olive-80: rgba(65, 75, 38, 0.8);
    --color-olive-20: rgba(65, 75, 38, 0.2);
    --color-olive-08: rgba(65, 75, 38, 0.08);
    --color-overlay-black-28: rgba(0, 0, 0, 0.28);
    --color-white-95: rgba(255, 255, 255, 0.95);
    --color-white-88: rgba(255, 255, 255, 0.88);
    --color-white-78: rgba(255, 255, 255, 0.78);
    --color-white-56: rgba(255, 255, 255, 0.56);
    --color-white-40: rgba(255, 255, 255, 0.4);
    --color-white-38: rgba(255, 255, 255, 0.38);
    --color-transparent-white: rgba(255, 255, 255, 0);
    --intro-image: url("../assets/images/intro.webp?v=20260802-1");
}

html, body {
    color-scheme: only light;
    width: 100%;
    overscroll-behavior-y: none;
    overscroll-behavior: none;
}

body {
    background: var(--bg1);
    font-family: "Inter", sans-serif;
    line-height: 1.6;
    color: var(--color-text-primary);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.page {
    display: flex;
    flex-direction: column;
    width: 100%;
    position: relative;
}

/* Full-height sections */
.full-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 40px 24px;
    width: 100%;
    margin: 20px;
}

html.is-safari-ios .full-section {
    min-height: 100svh;
}

.introduction-section {
    position: relative;
    overflow: hidden;
    background-color: var(--bg1);
    isolation: isolate;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
}

.introduction-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background-image: var(--intro-image);
    background-repeat: no-repeat;
    background-size: cover;
    background-position: 100% center;
    opacity: 0.7;
    z-index: -1;
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
    transform: translateZ(0);
    will-change: background-position;
}

body.intro-pan-started .introduction-section::before {
    animation: intro-pan 80s ease-out forwards;
}

.introduction-section::after {
    content: "";
    position: absolute;
    inset: 0;
    background: var(--color-white-40);
    z-index: 0;
    pointer-events: none;
}

.introduction-section > * {
    position: relative;
    z-index: 1;
}

.intro-ceremony-divider {
    width: 100%;
    height: 2px;
    background-color: var(--oliveGreen);
    margin: 0;
    padding: 0;
}

.post-intro-flow {
    position: relative;
    width: 100%;
    background-color: var(--bg1);
    overflow: visible;
    isolation: isolate;
}

.post-intro-flow::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        radial-gradient(ellipse 74.25% 14% at 217.5px 300.336px, var(--color-white-95) 0%, var(--color-white-56) 34%, var(--color-transparent-white) 100%),
        radial-gradient(ellipse 48% 14% at 337.125px 1293.508px, var(--color-white-78) 0%, var(--color-white-38) 34%, var(--color-transparent-white) 100%);
    z-index: 1;
    mix-blend-mode: screen;
    opacity: 0.95;
    pointer-events: none;
}

.post-intro-flow > * {
    position: relative;
}

.post-intro-flow img:not(.transition-bird-image) {
    position: relative;
    z-index: 0;
}

.post-intro-flow .transition-bird-image {
    z-index: 0;
}

.post-intro-flow h1,
.post-intro-flow h2,
.post-intro-flow h3,
.post-intro-flow h4,
.post-intro-flow h5,
.post-intro-flow h6,
.post-intro-flow p,
.post-intro-flow span:not(.schedule-line),
.post-intro-flow label,
.post-intro-flow li,
.post-intro-flow small,
.post-intro-flow strong,
.post-intro-flow em,
.post-intro-flow time,
.post-intro-flow a,
.post-intro-flow button,
.post-intro-flow .rsvp-submit,
.post-intro-flow .btn,
.post-intro-flow .schedule-dot,
.post-intro-flow .transition-copy,
.post-intro-flow .guest-name,
.post-intro-flow .guest-choice,
.post-intro-flow .guest-list,
.post-intro-flow .submit-status {
    position: relative;
    z-index: 2;
}

.post-intro-flow .full-section {
    margin: 0;
}

.post-intro-flow .ceremony-section,
.post-intro-flow .transition-section,
.post-intro-flow .venue-section,
.post-intro-flow .schedule-main-section,
.post-intro-flow .wedding-list-section,
.post-intro-flow .rsvp-section,
.post-intro-flow .venue-schedule-divider {
    overflow: visible;
}

.ceremony-section {
    background-color: var(--bg1);
    position: relative;
    overflow: hidden;
    justify-content: flex-start;
    align-items: stretch;
    padding-top: 0;
}

.ceremony-section .section-title {
    position: relative;
    top: auto;
    left: auto;
    transform: none;
    font-size: 3.3rem;
    color: var(--oliveGreen);
    width: calc(100% - 48px);
    margin: clamp(-72px, -12vw, -52px) auto 12px;
    z-index: 2;
}

.ceremony-top-leaves {
    position: relative;
    display: block;
    width: calc(100% + 48px);
    height: auto;
    max-width: none;
    margin: 0 -24px;
    padding: 0;
    z-index: 0;
    pointer-events: none;
}

.leaves-divider-section {
    width: 100%;
    margin: 0;
    padding: 0;
    line-height: 0;
}

.leaves-divider-image {
    display: block;
    width: 100%;
    height: auto;
    margin: 100px 0;
    padding: 0;
}

.transition-section {
    --transition-leaves-width: 55%;
    display: flex;
    flex-direction: row;
    background: var(--bg1);
    position: relative;
    overflow: hidden;
    min-height: 0 !important;
    height: auto;
    width: 100%;
    margin: 0;
    padding: 0;
    justify-content: flex-start;
    align-items: stretch;
}

html.is-safari-ios .transition-section {
    min-height: 0 !important;
}

.transition-side-image {
    position: relative;
    display: block;
    flex: 0 0 var(--transition-leaves-width);
    align-self: flex-start;
    width: var(--transition-leaves-width);
    max-width: var(--transition-leaves-width);
    height: auto;
    margin: 0;
    padding: 0;
    z-index: 0;
}

.transition-bird-image {
    position: absolute;
    display: block;
    width: calc(var(--transition-leaves-width) / 2);
    height: auto;
    left: calc(
        var(--transition-leaves-width) +
        ((100% - var(--transition-leaves-width)) / 2) -
        (var(--transition-leaves-width) / 4)
    );
    top: 50%;
    transform: translateY(-50%);
    margin: 0;
    padding: 0;
    z-index: 0;
    pointer-events: none;
}

.transition-copy {
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 36px;
    width: 100%;
    max-width: 720px;
    margin: 0 auto;
    padding: 0;
    text-align: center;
}

.transition-section .transition-message {
    font-size: clamp(1.45rem, 6vw, 4.2rem);
    font-weight: 300;
    font-family: "Cormorant Garamond", serif;
    text-align: center;
    color: var(--oliveGreen);
    margin: 0;
    line-height: 1.1;
    z-index: 2;
    max-width: 24ch;
    text-wrap: balance;
}

.thank-you-screen .transition-message {
    font-size: clamp(1.9rem, 8vw, 4.2rem);
    font-weight: 300;
    font-family: "Cormorant Garamond", serif;
    text-align: center;
    margin: 0 20px 180px 20px;
    line-height: 1.1;
    z-index: 2;
}

.transition-divider {
    position: static;
    width: 100%;
    height: auto;
    margin: 0;
}

.transition-section .section-placeholder.transition-note {
    margin-top: 0;
    font-family: "Inter", sans-serif;
    font-weight: 300;
    color: var(--oliveGreen);
}

.thank-you-screen .section-placeholder.transition-note {
    margin-top: 40px;
    font-family: "Inter", sans-serif;
    font-weight: 300;
    max-width: 720px;
}

.venue-section {
    background-color: var(--bg1);
    position: relative;
    overflow: visible;
    min-height: auto;
}

.venue-section .section-title {
    color: var(--oliveGreen);
    font-size: 3.3rem;
}

.venue-section .venue-image {
    z-index: 0;
}

.venue-schedule-divider {
    position: relative;
    z-index: 0;
    width: 100%;
    margin: 0;
    padding: 0;
    line-height: 0;
}

.venue-schedule-divider--between {
    z-index: 0;
    margin-bottom: 0;
}

.venue-schedule-divider--between + .schedule-main-section {
    padding-top: 40px;
}

.venue-schedule-divider-image {
    position: relative;
    z-index: 0;
    display: block;
    width: 100%;
    height: auto;
    margin: 70px 0;
    padding: 0;
}

.venue-schedule-divider-image--right {
    width: 45vw;
    max-width: 45vw;
    margin: 0 0 0 auto;
}

.venue-schedule-divider-image--full {
    width: 100%;
    max-width: none;
    margin: 0;
    padding: 0;
}

html.is-safari-ios .venue-section {
    min-height: auto;
}

.schedule-section {
    background-color: var(--bg1);
}

.schedule-main-section .section-title {
    color: var(--oliveGreen);
    font-size: 3.3rem;
}

.wedding-list-section {
    min-height: auto;
    justify-content: center;
    align-items: center;
    text-align: center;
}

html.is-safari-ios .wedding-list-section {
    min-height: auto;
}

.wedding-list-section .section-title {
    color: var(--oliveGreen);
    font-size: 3.3rem;
}

.wedding-list-section .section-title,
.rsvp-section .section-title {
    position: relative;
}

.wedding-list-section .section-title::after,
.rsvp-section .section-title::after {
    content: "";
    position: absolute;
    top: calc(100% + 2px);
    left: 50%;
    width: 1.6cm;
    height: 1px;
    background-color: var(--oliveGreen);
    opacity: 0.3;
    transform: translateX(-50%);
    pointer-events: none;
}

.schedule-main-section {
    position: relative;
    overflow: hidden;
    min-height: auto;
    padding: 40px 24px;
    justify-content: center;
    align-items: center;
}

.schedule-main-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 68% 34% at 50% 62%, var(--color-white-88) 0%, var(--color-white-40) 34%, var(--color-transparent-white) 100%);
    z-index: 1;
    mix-blend-mode: screen;
    opacity: 0.92;
    pointer-events: none;
}

html.is-safari-ios .schedule-main-section {
    min-height: auto;
}

.schedule-main-section > * {
    position: relative;
    z-index: 2;
}

.schedule-content {
    height: auto;
    width: 100%;
    margin-top: 0;
    padding: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.schedule-divider {
    display: none;
}

.schedule-date {
    font-size: 0.9375rem;
    font-weight: 300;
    font-family: "Inter", sans-serif;
    text-align: center;
    color: var(--color-text-secondary);
    letter-spacing: 2px;
    margin: 0 0 24px;
    padding-left: 40px;
    padding-right: 40px;
    white-space: nowrap;
}

.schedule-timeline {
    position: relative;
    width: 100%;
    max-width: 760px;
    height: 320px;
    margin-top: 16px;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
}

.schedule-timeline::before {
    content: "";
    position: absolute;
    top: -38px;
    left: 50%;
    width: 1.6cm;
    height: 1px;
    background-color: var(--oliveGreen);
    opacity: 0.3;
    transform: translateX(-50%);
}

.schedule-row {
    display: grid;
    grid-template-columns: 1fr 10px 1fr;
    align-items: center;
    column-gap: 24px;
    width: 100%;
}

.post-intro-flow .schedule-line {
    position: absolute;
    top: 5px;
    bottom: 5px;
    left: 50%;
    width: 1.5px;
    z-index: 3;
    background-color: var(--oliveGreen);
    transform: translateX(-50%);
}

.schedule-dot {
    position: relative;
    z-index: 2;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background-color: var(--oliveGreen);
    border: none;
}

.schedule-time,
.schedule-event {
    font-size: 15px;
    font-weight: 300;
    font-family: "Inter", sans-serif;
    color: var(--oliveGreen);
    line-height: 1.2;
}

.schedule-time {
    text-align: right;
}

.schedule-event {
    text-align: left;
}

h2 {
    font-family: "Cormorant Garamond", serif;
    font-weight: 300;
    color: var(--oliveGreen);
}

.section-title {
    font-size: 2.2rem;
    font-weight: 600;
    font-family: "Cormorant Garamond", serif;
    text-align: center;
    margin-bottom: 24px;
    color: var(--color-text-primary);
}

.section-placeholder {
    font-size: 1rem;
    color: var(--color-text-muted);
    text-align: center;
    max-width: 600px;
}

.section-placeholder-directions {
    margin-top: 2.2em;
    font-size: calc(0.99rem * 0.75);
    color: var(--color-olive-80);
    line-height: 1.35;
    text-wrap: normal;
}

.section-placeholder-directions strong {
    font-weight: 600;
}

.greeting {
    text-align: center;
    font-size: 2rem;
    font-weight: 600;
    font-family: "Cormorant Garamond", serif;
    color: var(--color-text-primary);
    margin-bottom: 24px;
}

.intro-logo {
    height: 16.67vh;
    width: auto;
    max-width: 90%;
    display: block;
    margin: 20px auto 20px;
}

.intro-title {
    font-size: clamp(2.4rem, 16vw, 6.5rem);
    font-weight: 100;
    font-family: "Cormorant Garamond", serif;
    text-align: center;
    color: var(--oliveGreen);
    margin: 20px 20px 20px 20px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.intro-date {
    font-size: 1.15rem;
    font-weight: 600;
    font-family: "Inter", sans-serif;
    font-stretch: condensed;
    text-align: center;
    color: var(--color-text-secondary);
    margin: 60px 20px 0 20px;
    padding: 0;
    white-space: nowrap;
}

.intro-address {
    font-size: 1.15rem;
    font-weight: 300;
    font-family: "Inter", sans-serif;
    font-stretch: condensed;
    text-align: center;
    color: var(--oliveGreen);
    letter-spacing: normal;
    margin: 0 20px 20px 20px;
    padding: 0;
    white-space: nowrap;
}

.intro-invitation {
    font-size: 1.25rem;
    font-weight: 300;
    font-family: "Inter", sans-serif;
    text-align: center;
    color: var(--oliveGreen);
    margin: 24px 20px 20px 20px;
    padding: 0;
    line-height: 1.4;
}

@keyframes intro-pan {
    from {
        background-position: 100% center;
    }
    to {
        background-position: 0% center;
    }
}

.ceremony-image {
    display: block;
    width: calc(100% + 48px);
    max-width: none;
    height: auto;
    margin: 0 -24px 24px;
    padding: 0;
}

.venue-image {
    display: block;
    width: calc(100% + 48px);
    max-width: none;
    height: auto;
    margin: 0 -24px 24px;
    padding: 0;
    opacity: 0.715;
}

.ceremony-subtitle {
    font-family: "Inter", sans-serif;
    font-weight: 300;
    color: var(--color-text-secondary);
    font-size: 1.25rem;
    text-align: center;
    margin-bottom: 24px;
}

.ceremony-location {
    font-size: 1rem;
    color: var(--color-text-secondary);
    text-align: center;
    margin-bottom: 24px;
    font-family: "Inter", sans-serif;
    font-weight: 300;
}

/* Reusable Button Component */
.btn {
    display: inline-block;
    padding: 12px 32px;
    border: none;
    border-radius: 0;
    font-family: "Inter", sans-serif;
    font-weight: 300;
    font-size: 1rem;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s ease;
    text-align: center;
}

.btn:hover {
    opacity: 0.9;
}

.btn-primary {
    background-color: var(--oliveGreen);
    color: var(--color-white);
}

.ceremony-section .btn {
    align-self: center;
    margin-top: 24px;
}

.venue-section .btn {
    position: relative;
    z-index: 5;
    margin-top: 24px;
}

.rsvp-bottom-leaves-wrap {
    width: 100%;
    margin: 0;
    padding: 0;
    line-height: 0;
}

.rsvp-bottom-leaves-image {
    display: block;
    width: 100%;
    height: auto;
    margin: 0;
    padding: 0;
}

.ceremony-top-leaves,
.leaves-divider-image,
.transition-side-image,
.transition-bird-image,
.venue-schedule-divider-image,
.rsvp-bottom-leaves-image {
    opacity: 0.9;
}

.transition-bird-image {
    opacity: 1;
}

.ceremony-top-leaves {
    opacity: 0.9;
}

/* Mobile responsiveness */
@media (max-width: 768px) {
    .full-section {
        margin: 0;
    }
}

/* Mobile-first responsive design */
@media (min-width: 320px) {
    body {
        font-size: 16px;
    }
}

@media (min-width: 768px) {
    body {
        max-width: 600px;
        margin: 0 auto;
    }

    .full-section {
        margin: 0;
    }

    .page::before,
    .page::after {
        content: "";
        position: absolute;
        top: 0;
        bottom: 0;
        width: 1px;
        background-color: var(--color-accent-line);
        pointer-events: none;
        z-index: 20;
    }

    .page::before {
        left: 0;
    }

    .page::after {
        right: 0;
    }
}
