:root {
    --page-bg: #f0e6d7;
    --page-bg-deep: #e2d2bb;
    --paper: #fbf5ea;
    --paper-edge: #eadfcf;
    --ink: #3a2d24;
    --muted: #78675a;
    --line: rgba(99, 77, 58, 0.16);
    --navy: #334b63;
    --navy-deep: #233546;
    --rosewood: #8d5f58;
    --gold: #c7a86e;
    --success: #4d6b58;
    --error: #956154;
    --shadow: 0 30px 90px rgba(61, 45, 29, 0.12);
    --shadow-soft: 0 12px 26px rgba(61, 45, 29, 0.08);
    --radius-xl: 34px;
    --radius-lg: 26px;
    --radius-md: 18px;
}

* {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: 'Manrope', sans-serif;
    color: var(--ink);
    background:
        radial-gradient(circle at top left, rgba(199, 168, 110, 0.22), transparent 22rem),
        radial-gradient(circle at top right, rgba(51, 75, 99, 0.14), transparent 20rem),
        linear-gradient(180deg, var(--page-bg) 0%, var(--page-bg-deep) 100%);
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea {
    font: inherit;
}

.container {
    width: min(1180px, calc(100% - 32px));
    margin: 0 auto;
}

.hero {
    padding: 40px 0 24px;
}

.hero__inner {
    text-align: center;
}

.hero__eyebrow,
.page-label,
.footer__eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    letter-spacing: 0.26em;
    text-transform: uppercase;
    font-size: 0.7rem;
    color: var(--navy);
}

.hero__eyebrow::before,
.hero__eyebrow::after,
.page-label::before,
.page-label::after,
.footer__eyebrow::before,
.footer__eyebrow::after {
    content: '';
    width: 26px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(51, 75, 99, 0.55), transparent);
}

.hero__title,
.page-title {
    font-family: 'EB Garamond', serif;
}

.hero__title {
    margin: 18px 0 14px;
    font-size: clamp(3.3rem, 8vw, 6.4rem);
    font-weight: 600;
    line-height: 0.92;
}

.hero__title span {
    color: var(--rosewood);
}

.hero__copy {
    max-width: 760px;
    margin: 0 auto;
    color: var(--muted);
    line-height: 1.9;
}

.hero__meta {
    display: flex;
    justify-content: center;
    gap: 18px;
    flex-wrap: wrap;
    margin-top: 18px;
    color: var(--navy-deep);
    font-size: 0.9rem;
}

.mode-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 34px;
    padding: 0 14px;
    margin-bottom: 18px;
    border-radius: 999px;
    border: 1px solid transparent;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 0.64rem;
}

.mode-badge--php {
    background: rgba(51, 75, 99, 0.12);
    border-color: rgba(51, 75, 99, 0.18);
    color: var(--navy);
}

.mode-badge--local {
    background: rgba(141, 95, 88, 0.12);
    border-color: rgba(141, 95, 88, 0.18);
    color: var(--rosewood);
}

.book {
    padding-bottom: 72px;
    perspective: 2200px;
}

.book__spread {
    position: relative;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 0;
    margin-bottom: 34px;
    border-radius: var(--radius-xl);
    overflow: hidden;
    box-shadow: var(--shadow);
    transform-style: preserve-3d;
    background: linear-gradient(180deg, rgba(93, 73, 54, 0.08), rgba(93, 73, 54, 0.02));
}

.book__spread::before {
    content: '';
    position: absolute;
    top: 18px;
    bottom: 18px;
    left: 50%;
    width: 20px;
    transform: translateX(-50%);
    background: linear-gradient(180deg, rgba(177, 149, 110, 0.42), rgba(240, 230, 215, 0.08), rgba(177, 149, 110, 0.42));
    border-radius: 999px;
    z-index: 2;
}

.book__spread::after {
    content: '';
    position: absolute;
    inset: auto 6% -16px 6%;
    height: 36px;
    background: radial-gradient(ellipse at center, rgba(61, 45, 29, 0.18), transparent 70%);
    filter: blur(10px);
    z-index: 0;
}

.book__spread:hover .book__page--left {
    transform: perspective(1800px) rotateY(2.2deg);
}

.book__spread:hover .book__page--right {
    transform: perspective(1800px) rotateY(-2.2deg);
}

.book__tab {
    position: absolute;
    top: 32px;
    z-index: 4;
    min-height: 34px;
    display: inline-flex;
    align-items: center;
    padding: 0 14px;
    border-radius: 12px 12px 0 0;
    font-size: 0.64rem;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    color: #fff9f1;
    box-shadow: 0 10px 20px rgba(61, 45, 29, 0.12);
}

.book__tab--left {
    left: 34px;
    background: linear-gradient(180deg, #bf9d64 0%, #a88650 100%);
}

.book__tab--right {
    right: 34px;
    background: linear-gradient(180deg, #617792 0%, #42566f 100%);
}

.book__page {
    min-height: 560px;
    padding: 44px 40px;
    background:
        linear-gradient(180deg, rgba(255, 255, 255, 0.08), rgba(255, 255, 255, 0)),
        var(--paper);
    position: relative;
    transition: transform 0.45s ease, box-shadow 0.45s ease;
    z-index: 1;
}

.book__page::before {
    content: '';
    position: absolute;
    inset: 14px;
    border: 1px solid rgba(199, 168, 110, 0.22);
    pointer-events: none;
}

.book__page::after {
    content: '';
    position: absolute;
    top: 12px;
    bottom: 12px;
    width: 14px;
    pointer-events: none;
}

.book__page--left {
    border-right: 1px solid var(--paper-edge);
    transform-origin: right center;
    box-shadow: inset -18px 0 30px rgba(166, 143, 112, 0.08);
}

.book__page--right {
    border-left: 1px solid rgba(255, 255, 255, 0.5);
    transform-origin: left center;
    box-shadow: inset 18px 0 30px rgba(166, 143, 112, 0.08);
}

.book__page--left::after {
    right: 0;
    background: linear-gradient(270deg, rgba(126, 101, 73, 0.14), transparent);
}

.book__page--right::after {
    left: 0;
    background: linear-gradient(90deg, rgba(126, 101, 73, 0.14), transparent);
}

.page-corner {
    position: absolute;
    top: 0;
    width: 62px;
    height: 62px;
    z-index: 3;
    pointer-events: none;
}

.page-corner::before,
.page-corner::after {
    content: '';
    position: absolute;
    top: 0;
    width: 100%;
    height: 100%;
    clip-path: polygon(0 0, 100% 0, 100% 100%);
}

.page-corner--left {
    right: 0;
}

.page-corner--right {
    right: 0;
}

.page-corner--left::before,
.page-corner--right::before {
    background: linear-gradient(135deg, rgba(255, 248, 237, 0.92), rgba(231, 217, 196, 0.96));
    box-shadow: -6px 8px 16px rgba(61, 45, 29, 0.1);
}

.page-corner--left::after,
.page-corner--right::after {
    width: 70%;
    height: 70%;
    right: 0;
    background: linear-gradient(135deg, rgba(184, 160, 126, 0.24), transparent 65%);
}

.page-title {
    margin: 18px 0 14px;
    font-size: clamp(2.4rem, 5vw, 4rem);
    line-height: 0.96;
    font-weight: 600;
}

.page-copy {
    color: var(--muted);
    line-height: 1.92;
    max-width: 520px;
}

.guest-block,
.mini-note,
.timeline-item,
.countdown-card,
.comment-card,
.form-alert {
    border-radius: var(--radius-md);
}

.guest-block {
    margin-top: 26px;
    padding: 18px 20px;
    border: 1px solid var(--line);
    background: rgba(51, 75, 99, 0.04);
}

.guest-block__label {
    display: block;
    margin-bottom: 8px;
    font-size: 0.68rem;
    letter-spacing: 0.24em;
    text-transform: uppercase;
    color: var(--navy);
}

.guest-block__name {
    font-family: 'EB Garamond', serif;
    font-size: 1.8rem;
}

.mini-note {
    margin-top: 22px;
    padding: 20px;
    background: rgba(141, 95, 88, 0.08);
    border: 1px solid rgba(141, 95, 88, 0.14);
}

.mini-note__title {
    display: block;
    margin-bottom: 8px;
    font-size: 0.74rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--rosewood);
}

.mini-note p {
    color: var(--muted);
    line-height: 1.8;
}

.paper-portrait,
.gallery-card {
    position: relative;
    overflow: hidden;
    border-radius: 22px;
}

.paper-portrait::before,
.gallery-card::before {
    content: '';
    position: absolute;
    inset: 10px;
    border: 1px solid rgba(255, 245, 233, 0.3);
}

.paper-portrait--main {
    min-height: 310px;
    background: linear-gradient(145deg, #45627d 0%, #27384a 100%);
}

.paper-portrait--secondary {
    min-height: 190px;
    background: linear-gradient(145deg, #b58b70 0%, #8b6459 100%);
}

.paper-portrait__caption,
.gallery-card span {
    position: absolute;
    left: 18px;
    right: 18px;
    bottom: 18px;
    color: #fff8ef;
    z-index: 1;
}

.paper-stack {
    display: grid;
    gap: 18px;
    margin-top: 18px;
}

.quote-card {
    margin: 0;
    padding: 22px 24px;
    background: rgba(51, 75, 99, 0.06);
    border: 1px solid rgba(51, 75, 99, 0.12);
    font-family: 'EB Garamond', serif;
    font-size: 1.6rem;
    line-height: 1.35;
    color: var(--navy-deep);
}

.timeline-list {
    display: grid;
    gap: 16px;
    margin-top: 22px;
}

.timeline-item {
    padding: 18px 20px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.48);
}

.timeline-item span {
    display: block;
    margin-bottom: 8px;
    font-size: 0.68rem;
    letter-spacing: 0.22em;
    text-transform: uppercase;
    color: var(--navy);
}

.timeline-item strong {
    display: block;
    font-size: 1.04rem;
}

.timeline-item p {
    margin-top: 8px;
    color: var(--muted);
    line-height: 1.75;
}

.countdown-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
    margin-top: 24px;
}

.countdown-card {
    padding: 22px 18px;
    text-align: center;
    background: rgba(51, 75, 99, 0.06);
    border: 1px solid rgba(51, 75, 99, 0.12);
    box-shadow: var(--shadow-soft);
}

.countdown-card strong {
    display: block;
    font-family: 'EB Garamond', serif;
    font-size: 3rem;
    color: var(--navy-deep);
    line-height: 1;
}

.countdown-card span {
    display: block;
    margin-top: 8px;
    font-size: 0.66rem;
    letter-spacing: 0.2em;
    text-transform: uppercase;
    color: var(--muted);
}

.gallery-ribbon {
    display: grid;
    gap: 16px;
    margin-top: 24px;
}

.gallery-card {
    min-height: 220px;
    box-shadow: var(--shadow-soft);
}

.gallery-card--soft {
    background: linear-gradient(145deg, #d9b89e 0%, #b58671 100%);
}

.gallery-card--earth {
    background: linear-gradient(145deg, #8b6c5a 0%, #634a3f 100%);
}

.gallery-card--wide {
    min-height: 260px;
    background: linear-gradient(145deg, #45627d 0%, #2a3d50 100%);
}

.gallery-card--deep {
    min-height: 170px;
    margin-top: 18px;
    background: linear-gradient(145deg, #6d7d67 0%, #495748 100%);
}

.page-actions {
    display: flex;
    gap: 14px;
    margin-top: 22px;
    flex-wrap: wrap;
}

.button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 50px;
    padding: 0 24px;
    border: 1px solid transparent;
    border-radius: 999px;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    font-size: 0.7rem;
    transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.button:hover {
    transform: translateY(-2px);
}

.button--primary {
    background: linear-gradient(135deg, var(--navy) 0%, var(--navy-deep) 100%);
    color: #fff9f1;
    box-shadow: 0 12px 26px rgba(35, 53, 70, 0.22);
}

.rsvp-form {
    margin-top: 24px;
}

.field {
    width: 100%;
    min-height: 54px;
    padding: 0 16px;
    border-radius: 16px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
    color: var(--ink);
    outline: none;
}

.field:focus {
    border-color: rgba(51, 75, 99, 0.34);
    box-shadow: 0 0 0 4px rgba(51, 75, 99, 0.08);
}

.field--textarea {
    min-height: 150px;
    padding: 16px;
    resize: vertical;
}

.attendance-options {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 16px 0;
}

.attendance-option {
    display: flex;
    align-items: center;
    gap: 10px;
    min-height: 52px;
    padding: 0 14px;
    border-radius: 999px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.62);
}

.guestbook__list {
    display: grid;
    gap: 12px;
    margin-top: 18px;
    max-height: 420px;
    overflow: auto;
    padding-right: 4px;
}

.guestbook__list::-webkit-scrollbar {
    width: 6px;
}

.guestbook__list::-webkit-scrollbar-thumb {
    background: rgba(51, 75, 99, 0.28);
    border-radius: 999px;
}

.comment-card {
    padding: 18px;
    border: 1px solid var(--line);
    background: rgba(255, 255, 255, 0.72);
    box-shadow: var(--shadow-soft);
}

.comment-card__head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    margin-bottom: 10px;
}

.comment-card__name {
    color: var(--navy-deep);
}

.comment-card__message {
    color: var(--muted);
    line-height: 1.8;
}

.status-pill {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    min-height: 28px;
    padding: 0 12px;
    border-radius: 999px;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    font-size: 0.62rem;
}

.status-pill--attending {
    background: rgba(77, 107, 88, 0.12);
    color: var(--success);
}

.status-pill--absent {
    background: rgba(149, 97, 84, 0.12);
    color: var(--error);
}

.form-alert {
    margin-top: 18px;
    padding: 14px 16px;
    border: 1px solid transparent;
    line-height: 1.7;
}

.form-alert--success {
    color: var(--success);
    background: rgba(77, 107, 88, 0.12);
    border-color: rgba(77, 107, 88, 0.16);
}

.form-alert--error {
    color: var(--error);
    background: rgba(149, 97, 84, 0.12);
    border-color: rgba(149, 97, 84, 0.16);
}

.footer {
    padding: 0 0 70px;
    text-align: center;
}

.footer__copy {
    max-width: 700px;
    margin: 16px auto 0;
    color: var(--muted);
    line-height: 1.9;
}

.preview-page {
    min-height: 100vh;
    display: grid;
    place-items: center;
}

.preview-card {
    width: min(100%, 760px);
    padding: 42px 34px;
    text-align: center;
    border-radius: var(--radius-xl);
    background: var(--paper);
    box-shadow: var(--shadow);
}

.reveal {
    opacity: 0;
    transform: translateY(28px);
    transition: opacity 0.85s ease, transform 0.85s ease;
}

.reveal--visible,
.reveal.is-visible {
    opacity: 1;
    transform: none;
}

@media (max-width: 980px) {
    .book__spread {
        grid-template-columns: 1fr;
    }

    .book__spread::before {
        display: none;
    }

    .book__tab {
        top: 18px;
    }

    .book__page {
        min-height: auto;
    }

    .book__page--left,
    .book__page--right {
        border: none;
        transform: none !important;
    }
}

@media (max-width: 640px) {
    .hero__meta,
    .attendance-options,
    .page-actions,
    .comment-card__head {
        flex-direction: column;
        align-items: flex-start;
        display: flex;
    }

    .attendance-options {
        display: grid;
        grid-template-columns: 1fr;
    }

    .book__page {
        padding: 30px 22px;
    }

    .book__tab {
        position: static;
        border-radius: 999px;
        margin: 14px 0 0 16px;
        width: fit-content;
    }

    .book__spread {
        padding-top: 12px;
    }
}