[hidden] { display: none !important; }

.visually-hidden {
    position: absolute;
    width: 1px; height: 1px;
    padding: 0; margin: -1px;
    overflow: hidden; clip: rect(0,0,0,0);
    white-space: nowrap; border: 0;
}

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

html {
    scroll-behavior: smooth;
    scroll-snap-type: y mandatory;
    /* Offset for fixed nav so sections snap below it, not behind it */
    scroll-padding-top: var(--nav-height);
    font-size: 16px;
    -webkit-text-size-adjust: 100%;
}

body {
    background-color: var(--color-background);
    color: var(--color-text);
    font-family: var(--font-sans);
    font-weight: 400;
    line-height: 1.75;
    overflow-x: hidden;
}

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

ol, ul {
    list-style: none;
}

figure {
    margin: 0;
}

a {
    color: inherit;
    text-decoration: none;
}

button {
    cursor: pointer;
    border: none;
    background: none;
    font: inherit;
}

/* ================================================
   Variables
================================================ */
:root {
    --color-background: #FFF8FA;
    --color-surface:    #FDEAF2;
    --color-text:       #2D1A22;
    --color-muted:      #9E7080;
    --color-accent:     #E8A0B8;
    --color-accent-dark:#C4607A;
    --color-border:     #F2D0DD;
    --color-white:      #FFFFFF;

    --font-serif: 'Cormorant Garamond', Georgia, 'Times New Roman', serif;
    --font-sans:  'Inter', system-ui, -apple-system, sans-serif;

    --space-xs:  0.5rem;
    --space-sm:  1rem;
    --space-md:  2rem;
    --space-lg:  4rem;
    --space-xl:  6rem;
    --space-2xl: 10rem;

    --transition-base: 0.3s ease;
    --transition-slow: 0.6s ease;

    --nav-height: 64px;
    --container-max: 1200px;
    --container-narrow: 760px;
}

/* ================================================
   Typography
================================================ */
.section-label {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-muted);
    margin-bottom: var(--space-sm);
}

.section-title {
    font-family: var(--font-serif);
    font-size: clamp(2rem, 4vw, 3rem);
    font-weight: 300;
    letter-spacing: 0.02em;
    /* Increased from 1.15 — Vietnamese diacritics need vertical breathing room */
    line-height: 1.35;
    color: var(--color-text);
}

/* ================================================
   Global Utilities
================================================ */
.container {
    width: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--space-md);
}

/* ================================================
   Navigation
================================================ */
.nav {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 100;
    height: var(--nav-height);
    transition: background-color var(--transition-base), box-shadow var(--transition-base);
}

.nav.is-scrolled {
    background-color: rgba(250, 248, 245, 0.96);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 1px 0 var(--color-border);
}

.nav__inner {
    display: flex;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    max-width: var(--container-max);
    margin-inline: auto;
    padding-inline: var(--space-md);
}

.nav__logo {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 400;
    letter-spacing: 0.08em;
    color: var(--color-white);
    transition: color var(--transition-base);
}

.nav.is-scrolled .nav__logo {
    color: var(--color-text);
}

.nav__menu {
    display: flex;
    align-items: center;
    /* Responsive gap prevents overflow with long Vietnamese nav labels */
    gap: clamp(1.25rem, 2.5vw, var(--space-lg));
}

.nav__link {
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.85);
    transition: color var(--transition-base), opacity var(--transition-base);
    position: relative;
}

.nav__link::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    width: 0;
    height: 1px;
    background-color: currentColor;
    transition: width var(--transition-base);
}

.nav__link:hover::after,
.nav__link:focus-visible::after {
    width: 100%;
}

.nav__link:hover,
.nav__link:focus-visible {
    color: rgba(255, 255, 255, 1);
    outline: none;
}

.nav.is-scrolled .nav__link {
    color: var(--color-muted);
}

.nav.is-scrolled .nav__link:hover,
.nav.is-scrolled .nav__link:focus-visible {
    color: var(--color-text);
}

.nav__hamburger {
    display: none;
    flex-direction: column;
    gap: 5px;
    padding: 4px;
    z-index: 110;
}

.nav__hamburger span {
    display: block;
    width: 22px;
    height: 1px;
    background-color: var(--color-white);
    transition: transform var(--transition-base), opacity var(--transition-base), background-color var(--transition-base);
    transform-origin: center;
}

.nav.is-scrolled .nav__hamburger span {
    background-color: var(--color-text);
}

.nav__hamburger[aria-expanded="true"] span:nth-child(1) {
    transform: translateY(6px) rotate(45deg);
}
.nav__hamburger[aria-expanded="true"] span:nth-child(2) {
    opacity: 0;
}
.nav__hamburger[aria-expanded="true"] span:nth-child(3) {
    transform: translateY(-6px) rotate(-45deg);
}

/* ================================================
   Hero
================================================ */
.hero {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    scroll-snap-align: start;
    background-color: #5E2D3A;
}

.hero__image-wrap {
    position: absolute;
    inset: 0;
}

.hero__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    background-color: var(--color-surface);
}

.hero__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(20, 17, 14, 0.35) 0%,
        rgba(20, 17, 14, 0.20) 40%,
        rgba(20, 17, 14, 0.45) 100%
    );
}

.hero__content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--color-white);
    padding: var(--space-lg) var(--space-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.25rem;
}

.hero__eyebrow {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.85);
    animation: fadeInDown 1.2s ease both;
    max-width: 80vw;
    text-align: center;
    line-height: 1.7;
}

.hero__names {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.25em;
    animation: fadeInUp 1.2s ease 0.2s both;
}

.hero__name {
    font-family: var(--font-serif);
    /* Slightly reduced max to accommodate long Vietnamese names gracefully */
    font-size: clamp(2rem, 7.5vw, 6rem);
    font-weight: 300;
    letter-spacing: 0.04em;
    line-height: 1.1;
    font-style: italic;
    color: var(--color-white);
    word-break: break-word;
    overflow-wrap: break-word;
    max-width: 90vw;
}

.hero__ampersand {
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 4vw, 2.5rem);
    font-weight: 300;
    font-style: italic;
    color: var(--color-accent);
    line-height: 1;
    margin-block: 0.15em;
}

.hero__date {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.22em;
    color: rgba(255,255,255,0.85);
    animation: fadeInUp 1.2s ease 0.35s both;
}

.hero__scroll {
    position: absolute;
    bottom: 2.5rem;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    z-index: 2;
    animation: fadeInUp 1.2s ease 0.55s both;
}

.hero__scroll-text {
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.65);
}

.hero__scroll-line {
    display: block;
    width: 1px;
    height: 48px;
    background: rgba(255,255,255,0.4);
    animation: scrollPulse 2s ease-in-out infinite;
}

/* ================================================
   Invite
================================================ */
.invite {
    padding-block: clamp(2rem, 5vh, 4rem);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    scroll-snap-align: start;
    background: var(--color-background);
}

.invite__inner {
    display: flex;
    justify-content: center;
    width: 100%;
}

.invite__card {
    max-width: min(580px, 80vw);
    width: 100%;
    text-align: center;
    padding: var(--space-xl) var(--space-lg);
    border: 1px solid var(--color-border);
    background: var(--color-background);
}

.invite__intro {
    font-family: var(--font-serif);
    font-size: clamp(1rem, 1.4vw, 1.25rem);
    font-weight: 300;
    font-style: italic;
    line-height: 2;
    color: var(--color-text);
    margin-block: var(--space-md);
}

.invite__names {
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 2.4vw, 2rem);
    font-weight: 300;
    font-style: italic;
    line-height: 1.4;
    color: var(--color-text);
    margin-block: var(--space-sm);
}

.invite__amp {
    font-size: 0.7em;
    color: var(--color-accent-dark);
    font-style: italic;
}

.invite__divider {
    width: 48px;
    height: 1px;
    background: var(--color-accent);
    margin: var(--space-md) auto;
}

.invite__when {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.1em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.invite__where {
    font-family: var(--font-sans);
    font-size: 0.8125rem;
    letter-spacing: 0.08em;
    color: var(--color-muted);
    margin-top: 0.25rem;
}

/* ================================================
   Couple
================================================ */
.couple {
    padding-block: clamp(2rem, 5vh, 4rem);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    scroll-snap-align: start;
}

.couple__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.couple__header {
    text-align: center;
    margin-bottom: var(--space-md);
}

.couple__layout {
    display: grid;
    grid-template-columns: 1fr 320px 1fr;
    gap: var(--space-md);
    align-items: center;
    width: 100%;
}

.couple__photo {
    overflow: hidden;
}

.couple__photo img {
    width: 100%;
    height: 400px;
    object-fit: cover;
    background-color: var(--color-surface);
    transition: transform 0.8s ease;
}

.couple__photo.photo--missing {
    background-color: var(--color-surface);
    height: 400px;
    display: block;
}

.couple__photo.photo--missing img {
    display: none;
}

.couple__photo:hover img {
    transform: scale(1.03);
}

/* Bride: veil/portrait from top, keep face visible */
.couple__photo--bride img {
    object-position: center 15%;
}

/* Groom: seated portrait, keep face/upper body centered */
.couple__photo--groom img {
    object-position: center 10%;
}

.couple__names {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: var(--space-sm);
    padding-inline: var(--space-md);
}

.couple__name {
    font-family: var(--font-serif);
    font-size: clamp(1.75rem, 2.6vw, 2.5rem);
    font-weight: 300;
    font-style: italic;
    letter-spacing: 0.02em;
    line-height: 1.25;
    color: var(--color-text);
}

.couple__and {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 300;
    font-style: italic;
    color: var(--color-accent);
    line-height: 1;
}

.couple__quote {
    font-family: var(--font-serif);
    font-size: 1.125rem;
    font-style: italic;
    font-weight: 300;
    color: var(--color-muted);
    line-height: 1.9;
    margin-top: var(--space-sm);
    max-width: 280px;
}

/* ================================================
   Story
================================================ */
.story {
    padding-block: clamp(2rem, 5vh, 4rem);
    background-color: var(--color-surface);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    scroll-snap-align: start;
}

.story__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.story__header {
    text-align: center;
    margin-bottom: var(--space-md);
}

.story__timeline {
    width: 100%;
    max-width: var(--container-narrow);
    display: flex;
    flex-direction: column;
    gap: 0;
    position: relative;
}

.story__timeline::before {
    content: '';
    position: absolute;
    left: 50%;
    top: 0;
    bottom: 0;
    width: 1px;
    background: var(--color-border);
    transform: translateX(-50%);
}

.story__item {
    display: grid;
    grid-template-columns: 1fr 40px 1fr;
    gap: var(--space-md);
    align-items: start;
    padding-block: var(--space-sm);
}

.story__item:nth-child(odd) .story__content {
    grid-column: 1;
    text-align: right;
    order: -1;
}

.story__item:nth-child(even) .story__content {
    grid-column: 3;
    text-align: left;
}

.story__item:nth-child(odd) .story__marker {
    grid-column: 2;
    order: 0;
}

.story__item:nth-child(even) .story__marker {
    grid-column: 2;
}

.story__marker {
    width: 9px;
    height: 9px;
    border-radius: 50%;
    background: var(--color-accent);
    border: 2px solid var(--color-surface);
    outline: 1px solid var(--color-accent);
    margin-top: 0.35rem;
    justify-self: center;
    flex-shrink: 0;
}

.story__content {
    display: flex;
    flex-direction: column;
    gap: 0.35rem;
}

.story__year {
    font-family: var(--font-serif);
    font-size: 3rem;
    font-weight: 300;
    font-style: italic;
    color: var(--color-accent);
    line-height: 1;
}

.story__title {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-weight: 400;
    letter-spacing: 0.02em;
    color: var(--color-text);
    line-height: 1.35;
}

.story__text {
    font-size: 1rem;
    color: var(--color-muted);
    line-height: 1.85;
    margin-top: 0.25rem;
}

/* ================================================
   Wedding
================================================ */
.wedding {
    padding-block-start: clamp(3rem, 10vh, 5rem);
    padding-block-end: clamp(2rem, 5vh, 4rem);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    scroll-snap-align: start;
}

.wedding__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.wedding__header {
    text-align: center;
    margin-bottom: var(--space-md);
}

/* Calendar card */
.wedding__calendar {
    width: 200px;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 8px 32px rgba(45, 26, 34, 0.12), 0 2px 8px rgba(45, 26, 34, 0.06);
    background: #fff;
    margin-top: var(--space-sm);
}

.wedding__cal-header {
    background: var(--color-accent-dark);
    padding: 0.75rem 1.25rem;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
}

.wedding__cal-weekday {
    font-family: var(--font-sans);
    font-size: 0.6875rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: rgba(255, 255, 255, 0.78);
}

.wedding__cal-month {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 600;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: #fff;
}

.wedding__cal-body {
    background: #fff;
    padding: 1.25rem 1.25rem 0.75rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wedding__cal-day {
    font-family: var(--font-serif);
    font-size: 6rem;
    font-weight: 300;
    font-style: italic;
    color: var(--color-text);
    line-height: 1;
}

.wedding__cal-footer {
    background: var(--color-surface);
    padding: 0.5rem 1.25rem;
    text-align: center;
    border-top: 1px solid var(--color-border);
}

.wedding__cal-year {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.18em;
    color: var(--color-muted);
    text-transform: uppercase;
}

.wedding__events {
    display: grid;
    grid-template-columns: 1fr 1px 1fr;
    gap: 0 var(--space-xl);
    width: 100%;
    max-width: 860px;
    margin-top: var(--space-md);
}

.wedding__divider {
    background-color: var(--color-border);
    align-self: stretch;
}

.wedding__event {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    gap: 0.5rem;
    padding-inline: var(--space-md);
}

.wedding__event-label {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: var(--color-muted);
    margin-bottom: var(--space-xs);
}

.wedding__event-time {
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 3vw, 2rem);
    font-weight: 300;
    font-style: italic;
    color: var(--color-text);
    line-height: 1.2;
}

.wedding__event-venue {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-weight: 400;
    color: var(--color-text);
    margin-top: 0.25rem;
}

.wedding__event-address {
    font-size: 1rem;
    color: var(--color-muted);
    line-height: 1.75;
}

/* ================================================
   Buttons
================================================ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 0.9375rem 2rem;
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    transition: background-color var(--transition-base), color var(--transition-base), border-color var(--transition-base);
    cursor: pointer;
    border: none;
}

.btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 3px;
}

.btn--outline {
    background-color: transparent;
    border: 1px solid var(--color-border);
    color: var(--color-muted);
    margin-top: var(--space-sm);
}

.btn--outline:hover {
    border-color: var(--color-accent);
    color: var(--color-text);
}

.btn--primary {
    background-color: var(--color-accent-dark);
    color: #fff;
    padding: 1.125rem 3rem;
    font-size: 0.9375rem;
    letter-spacing: 0.08em;
    margin-top: var(--space-sm);
}

.btn--primary:hover {
    background-color: #8a3a56;
}

/* ================================================
   Countdown
================================================ */
.countdown {
    padding-block-start: clamp(3rem, 12vh, 6rem);
    padding-block-end: clamp(3rem, 8vh, 5rem);
    background-color: var(--color-surface);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    scroll-snap-align: start;
}

.countdown__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.countdown__header {
    text-align: center;
    margin-bottom: var(--space-md);
}

.countdown__timer {
    display: flex;
    align-items: flex-start;
    gap: clamp(var(--space-md), 5vw, var(--space-xl));
}

.countdown__unit {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.5rem;
    min-width: 60px;
}

.countdown__value {
    font-family: var(--font-serif);
    font-size: clamp(3rem, 8vw, 5.5rem);
    font-weight: 300;
    font-style: italic;
    color: var(--color-text);
    line-height: 1;
    min-width: 2ch;
    text-align: center;
}

.countdown__label {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.countdown__past {
    font-family: var(--font-serif);
    font-size: 1.25rem;
    font-style: italic;
    font-weight: 300;
    color: var(--color-muted);
    text-align: center;
}

/* ================================================
   Gallery
================================================ */
.gallery {
    padding-block: clamp(1.5rem, 4vh, 3rem);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    scroll-snap-align: start;
}

.gallery__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
}

.gallery__header {
    text-align: center;
    margin-bottom: var(--space-sm);
}

/* ================================================
   Carousel
================================================ */
.gallery__carousel {
    position: relative;
    width: 100%;
    overflow: hidden;
    user-select: none;
}

.gallery__track {
    display: flex;
    transition: transform 0.55s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    will-change: transform;
}

.gallery__slide {
    flex-shrink: 0;
    width: 100%;
    margin: 0;
}

.gallery__slide img {
    width: 100%;
    height: calc(100dvh - 200px);
    min-height: 380px;
    max-height: 700px;
    object-fit: cover;
    object-position: center 20%;
    display: block;
}

/* Per-slide object-position overrides */
.gallery__slide:nth-child(2) img {
    object-position: center 48%;
}

.gallery__slide:nth-child(3) img {
    object-position: center 58%;
}

.gallery__slide:nth-child(6) img {
    object-position: center 72%;
}

.gallery__btn {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: rgba(255, 255, 255, 0.85);
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    border: 1px solid var(--color-border);
    width: 44px;
    height: 44px;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.125rem;
    color: var(--color-text);
    transition: background var(--transition-base), opacity var(--transition-base);
    z-index: 2;
    padding: 0;
    line-height: 1;
}

.gallery__btn:hover {
    background: rgba(255, 255, 255, 0.98);
}

.gallery__btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.gallery__btn--prev { left: 1rem; }
.gallery__btn--next { right: 1rem; }

.gallery__dots {
    display: flex;
    justify-content: center;
    gap: 0.5rem;
    margin-top: 1rem;
    padding-bottom: 0.25rem;
}

.gallery__dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: var(--color-border);
    border: none;
    cursor: pointer;
    padding: 0;
    transition: background var(--transition-base), transform var(--transition-base);
    flex-shrink: 0;
}

.gallery__dot.is-active {
    background: var(--color-accent-dark);
    transform: scale(1.3);
}

/* ================================================
   Quote
================================================ */
.quote-section {
    padding-block: clamp(2rem, 5vh, 4rem);
    background-color: var(--color-surface);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    scroll-snap-align: start;
}

.quote-section__inner {
    display: flex;
    justify-content: center;
}

.quote-block {
    max-width: 640px;
    text-align: center;
}

.quote-block__text {
    font-family: var(--font-serif);
    font-size: clamp(1.5rem, 3.5vw, 2.25rem);
    font-weight: 300;
    font-style: italic;
    color: var(--color-text);
    line-height: 1.5;
    margin-bottom: var(--space-md);
}

.quote-block__source {
    font-family: var(--font-sans);
    font-size: 0.875rem;
    font-weight: 400;
    letter-spacing: 0.1em;
    color: var(--color-muted);
    font-style: normal;
}

/* ================================================
   RSVP
================================================ */
.rsvp {
    padding-block: clamp(2rem, 5vh, 4rem);
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    flex-direction: column;
    justify-content: center;
    scroll-snap-align: start;
}

.rsvp__inner {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.rsvp__header {
    text-align: center;
    margin-bottom: var(--space-sm);
}

.rsvp__subtitle {
    font-family: var(--font-serif);
    font-size: 1.1875rem;
    font-style: italic;
    font-weight: 300;
    color: var(--color-muted);
    margin-top: var(--space-sm);
    line-height: 1.7;
}

.rsvp__form {
    width: 100%;
    max-width: 480px;
    display: flex;
    flex-direction: column;
    gap: var(--space-sm);
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
}

.form-label {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: 0.06em;
    text-transform: uppercase;
    color: var(--color-muted);
}

.form-label--optional {
    font-weight: 400;
    letter-spacing: 0;
    text-transform: none;
    font-size: 0.9375rem;
}

.form-input,
.form-select {
    width: 100%;
    padding: 0.875rem 1rem;
    background-color: var(--color-background);
    border: 1px solid var(--color-border);
    border-radius: 0;
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-text);
    transition: border-color var(--transition-base);
    -webkit-appearance: none;
    appearance: none;
}

.form-input:focus,
.form-select:focus {
    outline: none;
    border-color: var(--color-accent);
}

.form-input::placeholder {
    color: var(--color-muted);
    opacity: 0.6;
}

.form-textarea {
    resize: vertical;
    min-height: 80px;
}

.form-select {
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' stroke='%238A8278' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 1rem center;
    padding-right: 2.5rem;
    cursor: pointer;
}

/* The fieldset IS .form-group--radio — reset its browser defaults directly */
fieldset.form-group--radio {
    border: none;
    padding: 0;
    min-inline-size: 0;
}

.form-radio-group {
    display: flex;
    flex-direction: column;
    gap: 0.75rem;
}

.form-radio {
    display: flex;
    align-items: center;
    gap: 0.75rem;
    cursor: pointer;
}

.form-radio input[type="radio"] {
    position: absolute;
    opacity: 0;
    width: 0;
    height: 0;
}

.form-radio__indicator {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    border: 1px solid var(--color-border);
    flex-shrink: 0;
    transition: border-color var(--transition-base);
    position: relative;
    background-color: var(--color-background);
}

.form-radio__indicator::after {
    content: '';
    position: absolute;
    inset: 3px;
    border-radius: 50%;
    background-color: var(--color-accent);
    opacity: 0;
    transition: opacity var(--transition-base);
}

.form-radio input[type="radio"]:checked + .form-radio__indicator {
    border-color: var(--color-accent);
}

.form-radio input[type="radio"]:checked + .form-radio__indicator::after {
    opacity: 1;
}

.form-radio input[type="radio"]:focus-visible + .form-radio__indicator {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

.form-radio__text {
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-text);
    letter-spacing: 0.02em;
}

.form-error {
    font-size: 0.875rem;
    color: #c0392b;
    display: none;
}

.form-error.is-visible {
    display: block;
}

.form-input.is-error,
.form-select.is-error {
    border-color: #c0392b;
}

.rsvp__success {
    width: 100%;
    max-width: 480px;
    text-align: center;
    padding: var(--space-xl);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-sm);
}

.rsvp__success-icon {
    font-size: 2rem;
    color: var(--color-accent);
    margin-bottom: var(--space-sm);
}

.rsvp__success-title {
    font-family: var(--font-serif);
    font-size: 2rem;
    font-weight: 300;
    font-style: italic;
    color: var(--color-text);
}

.rsvp__success-text {
    font-size: 1rem;
    font-weight: 400;
    color: var(--color-muted);
    line-height: 1.8;
}

/* ================================================
   Closing / Footer
================================================ */
.closing {
    position: relative;
    min-height: 100vh;
    min-height: 100dvh;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    scroll-snap-align: start;
    background-color: #5E2D3A;
}

.closing__image-wrap {
    position: absolute;
    inset: 0;
}

.closing__image {
    width: 100%;
    height: 100%;
    object-fit: cover;
    object-position: center 30%;
    background-color: var(--color-surface);
}

.closing__overlay {
    position: absolute;
    inset: 0;
    background: linear-gradient(
        to bottom,
        rgba(20, 17, 14, 0.5) 0%,
        rgba(20, 17, 14, 0.3) 50%,
        rgba(20, 17, 14, 0.6) 100%
    );
}

.closing__content {
    position: relative;
    z-index: 1;
    text-align: center;
    color: var(--color-white);
    padding: var(--space-lg) var(--space-md);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: var(--space-md);
}

.closing__eyebrow {
    font-family: var(--font-sans);
    font-size: 0.9375rem;
    font-weight: 500;
    letter-spacing: 0.08em;
    text-transform: uppercase;
    color: rgba(255,255,255,0.85);
    line-height: 2;
}

.closing__names {
    font-family: var(--font-serif);
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    font-weight: 300;
    font-style: italic;
    color: var(--color-white);
    line-height: 1.2;
    text-align: center;
}

.closing__and {
    font-size: clamp(1.25rem, 3vw, 2rem);
    color: var(--color-accent);
}

.closing__date {
    font-family: var(--font-sans);
    font-size: 1rem;
    font-weight: 400;
    letter-spacing: 0.2em;
    color: rgba(255,255,255,0.8);
}

.closing__heart {
    font-size: 1.25rem;
    color: var(--color-accent);
    margin-top: var(--space-sm);
}

/* ================================================
   Animations
================================================ */
@keyframes fadeInDown {
    from { opacity: 0; transform: translateY(-16px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(20px); }
    to   { opacity: 1; transform: translateY(0); }
}

@keyframes scrollPulse {
    0%, 100% { opacity: 0.4; transform: scaleY(1); }
    50%       { opacity: 0.9; transform: scaleY(1.05); }
}

/* Scroll reveal */
.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.75s ease, transform 0.75s ease;
}

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

/* Staggered children in reveal parents */
.countdown__timer .reveal:nth-child(1) { transition-delay: 0.0s; }
.countdown__timer .reveal:nth-child(2) { transition-delay: 0.1s; }
.countdown__timer .reveal:nth-child(3) { transition-delay: 0.2s; }
.countdown__timer .reveal:nth-child(4) { transition-delay: 0.3s; }

.gallery__grid .reveal:nth-child(1) { transition-delay: 0.05s; }
.gallery__grid .reveal:nth-child(2) { transition-delay: 0.10s; }
.gallery__grid .reveal:nth-child(3) { transition-delay: 0.15s; }
.gallery__grid .reveal:nth-child(4) { transition-delay: 0.20s; }
.gallery__grid .reveal:nth-child(5) { transition-delay: 0.25s; }
.gallery__grid .reveal:nth-child(6) { transition-delay: 0.30s; }

/* Reduced motion */
@media (prefers-reduced-motion: reduce) {
    *, *::before, *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    html {
        scroll-behavior: auto;
        scroll-snap-type: none;
    }
    .reveal {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

/* ================================================
   Responsive
================================================ */

/* Tablet: ≤ 1024px */
@media (max-width: 1024px) {
    :root {
        --space-2xl: 7rem;
    }

    .couple__layout {
        grid-template-columns: 1fr 1fr;
        grid-template-rows: auto auto;
        gap: var(--space-md);
    }

    .couple__photo--bride  { grid-column: 1; grid-row: 1; }
    .couple__photo--groom  { grid-column: 2; grid-row: 1; }
    .couple__names         { grid-column: 1 / -1; grid-row: 2; }

    .couple__photo img,
    .couple__photo.photo--missing {
        height: 360px;
    }

    .wedding__events {
        gap: 0 var(--space-lg);
    }

    .story__timeline::before {
        left: 20px;
    }

    .story__item {
        grid-template-columns: 40px 1fr;
        gap: var(--space-sm);
    }

    .story__item .story__marker {
        grid-column: 1;
        grid-row: 1;
        justify-self: start;
        margin-left: 6px;
    }

    .story__item:nth-child(odd) .story__content,
    .story__item:nth-child(even) .story__content {
        grid-column: 2;
        grid-row: 1;
        text-align: left;
        order: unset;
    }
}

/* Mobile: ≤ 768px */
@media (max-width: 768px) {
    :root {
        --space-xl:  4rem;
        --space-2xl: 5rem;
    }

    /* Invite card mobile — reduce horizontal padding so text breathes */
    .invite__card {
        padding: var(--space-md) var(--space-sm);
        max-width: calc(100% - 2.5rem);
    }

    .invite__intro {
        font-size: 1rem;
        line-height: 1.85;
    }

    .invite__names {
        font-size: 1.375rem;
    }

    /* Nav mobile */
    .nav__hamburger {
        display: flex;
    }

    .nav__menu {
        position: fixed;
        inset: 0;
        z-index: 99;
        background-color: var(--color-background);
        flex-direction: column;
        justify-content: center;
        gap: var(--space-lg);
        transform: translateX(100%);
        transition: transform 0.45s cubic-bezier(0.76, 0, 0.24, 1);
    }

    .nav__menu.is-open {
        transform: translateX(0);
    }

    .nav__link {
        font-size: 0.875rem;
        letter-spacing: 0.08em;
        color: var(--color-muted);
    }

    .nav__link:hover {
        color: var(--color-text);
    }

    /* Couple */
    .couple__layout {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .couple__photo--bride,
    .couple__photo--groom {
        grid-column: 1;
        /* Reset grid-row from tablet rule — both photos were overlapping same cell */
        grid-row: auto;
    }

    .couple__photo img,
    .couple__photo.photo--missing {
        height: 260px;
    }

    .couple__names {
        grid-column: 1;
        grid-row: auto;
        padding-inline: 0;
    }

    /* Story */
    .story__timeline::before {
        left: 12px;
    }

    .story__item {
        grid-template-columns: 28px 1fr;
        padding-block: var(--space-md);
    }

    .story__item .story__marker {
        margin-left: 2px;
    }

    /* Wedding */
    .wedding__events {
        grid-template-columns: 1fr;
        gap: var(--space-xl);
    }

    /* Remove excessive inner side padding on mobile — container already has padding */
    .wedding__event {
        padding-inline: 0;
    }

    .wedding__divider {
        height: 1px;
        width: 60px;
        justify-self: center;
    }

    /* Countdown — reduce gap so 4 units fit at 390px+ without overflow */
    .countdown__timer {
        gap: 1.25rem;
    }

    /* Gallery carousel — full-width on mobile */
    .gallery__slide img {
        height: calc(100dvh - 180px);
        min-height: 300px;
        max-height: 520px;
    }

    .gallery__btn {
        width: 36px;
        height: 36px;
        font-size: 0.9375rem;
    }

    /* RSVP */
    .rsvp__form {
        gap: var(--space-sm);
    }

    /* Prevent iOS Safari auto-zoom on input focus */
    .form-input,
    .form-select {
        font-size: 1rem;
    }

    .btn--primary {
        width: 100%;
    }
}

/* Small mobile: ≤ 375px */
@media (max-width: 375px) {
    :root {
        --space-lg: 3rem;
        --space-xl: 3.5rem;
    }

    /* Tighter side padding at 320-375px to give content more breathing room */
    .container {
        padding-inline: 1.25rem;
    }

    /* At 320px: 4×60px + 3×32px = 336px > 256px available → overflow
       Fix: remove min-width, reduce gap and font-size so units shrink.
       Math: font 2.25rem→36px, 2ch≈41px, 4×41+3×12=200px < 256 ✓ */
    .countdown__timer {
        gap: 0.75rem;
    }

    .countdown__unit {
        min-width: 0;
    }

    .countdown__value {
        font-size: clamp(2.25rem, 9vw, 3rem);
        min-width: 0;
    }

    /* Hero scroll indicator less dominant on very small screens */
    .hero__scroll {
        margin-top: var(--space-sm);
    }

    .couple__photo img,
    .couple__photo.photo--missing {
        height: 240px;
    }
}
