
@import url('https://fonts.googleapis.com/css2?family=DM+Sans:wght@400;500;600;700&family=Playfair+Display:wght@400;500;600;700&display=swap');

:root {
    --ink: #40352f;
    --muted: #8a7d73;
    --cream: #f8f4ee;
    --rose: #b77c78;
    --rose-dark: #98615e;
    --line: #e8ddd2;
    --white: #fffdfa;
    --gold: #b99a70;
    --shadow: 0 20px 60px rgba(64, 53, 47, .10);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 20px;
    -webkit-text-size-adjust: 100%;
}

body {
    margin: 0;
    overflow-x: hidden;
    background: var(--cream);
    color: var(--ink);
    font-family: 'DM Sans', sans-serif;
    -webkit-font-smoothing: antialiased;
}

body,
button,
input,
textarea {
    font-family: 'DM Sans', sans-serif;
}

button,
a {
    -webkit-tap-highlight-color: transparent;
}

a {
    color: var(--rose-dark);
}

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

audio,
video,
iframe {
    max-width: 100%;
}

button,
input,
textarea,
select {
    max-width: 100%;
}

[hidden] {
    display: none !important;
}

/* ==============================
   TRANG GIỚI THIỆU
============================== */

.landing,
.invitation {
    min-height: 100vh;
}

.landing {
    position: relative;
    overflow: hidden;
    padding: 32px 20px 60px;
    text-align: center;
    background:
        radial-gradient(ellipse at 10% 10%, rgba(255,255,255,.9), transparent 35%),
        radial-gradient(ellipse at 90% 80%, rgba(226,196,183,.25), transparent 35%),
        linear-gradient(145deg, #fbf8f3, #eee3d9);
}

.landing::before,
.landing::after {
    content: "✦";
    position: absolute;
    color: rgba(183, 124, 120, .25);
    font-size: 35px;
    pointer-events: none;
}

.landing::before {
    top: 18%;
    left: 8%;
}

.landing::after {
    right: 8%;
    bottom: 18%;
}

.landing__ornament {
    margin: 15px 0 75px;
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 5px;
}

.eyebrow {
    color: var(--rose);
    font-size: 10px;
    font-weight: 600;
    letter-spacing: 4px;
    line-height: 1.8;
}

.landing h1,
.section h1,
.section h2,
.cover__names,
.sample-names {
    font-family: 'Playfair Display', serif;
    font-weight: 400;
}

.landing h1 {
    margin: 22px 0;
    font-size: clamp(38px, 8vw, 72px);
    line-height: 1.2;
}

.landing h1 em {
    color: var(--rose);
}

.landing__desc {
    max-width: 480px;
    margin: 0 auto 30px;
    color: var(--muted);
    line-height: 1.9;
}

.intro {
    max-width: 650px;
    margin: 90px auto 35px;
    padding: 55px 25px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    line-height: 1.9;
}

.intro h2,
.section h2 {
    font-family: 'Playfair Display', serif;
    font-size: 36px;
    font-weight: 400;
    line-height: 1.3;
}

.sample-names {
    margin: 28px;
    font-size: 30px;
}

.sample-names span,
.cover__names span {
    padding: 0 8px;
    color: var(--rose);
}

.muted {
    color: var(--muted);
    font-size: 13px;
}

/* ==============================
   BUTTON
============================== */

.button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    padding: 14px 30px;
    border: 1px solid var(--rose);
    border-radius: 2px;
    background: var(--rose);
    color: white;
    font-size: 11px;
    font-weight: 600;
    letter-spacing: 2px;
    text-align: center;
    text-decoration: none;
    cursor: pointer;
    transition:
        background .3s ease,
        color .3s ease,
        transform .3s ease,
        box-shadow .3s ease;
}

.button:hover {
    transform: translateY(-2px);
    background: transparent;
    color: var(--rose-dark);
    box-shadow: 0 8px 20px rgba(183, 124, 120, .12);
}

.button:active {
    transform: translateY(0);
}

.button:disabled {
    cursor: wait;
    opacity: .75;
}

/* ==============================
   BÌA THIỆP
============================== */

.invitation {
    overflow: hidden;
    background: var(--white);
}

.cover {
    position: relative;
    display: flex;
    min-height: 100svh;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    padding: 70px 22px;
    background:
        radial-gradient(ellipse at center, rgba(255,253,249,.98) 0%, rgba(243,232,223,.96) 75%),
        var(--cream);
    text-align: center;
    transition:
        opacity .65s ease,
        transform .65s ease,
        filter .65s ease;
}

.cover::before {
    position: absolute;
    inset: 18px;
    border: 1px solid rgba(185, 154, 112, .45);
    content: "";
    pointer-events: none;
}

.cover::after {
    position: absolute;
    inset: 25px;
    border: 1px solid rgba(185, 154, 112, .18);
    content: "";
    pointer-events: none;
}

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

.cover__names {
    margin: 25px 0;
    font-size: clamp(38px, 9vw, 66px);
    line-height: 1.35;
}

.cover__date {
    margin: 12px 0 35px;
    color: var(--muted);
    font-size: 13px;
    letter-spacing: 1px;
}

.cover--opened {
    transform: scale(1.04);
    filter: blur(3px);
    opacity: 0;
    pointer-events: none;
}

/* ==============================
   NỘI DUNG THIỆP
============================== */

.invitation__content {
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    background: var(--white);
    animation: invitationReveal .9s ease both;
}

@keyframes invitationReveal {
    from {
        opacity: 0;
        transform: translateY(25px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.section {
    padding: 75px 24px;
    border-bottom: 1px solid var(--line);
    text-align: center;
}

.section--center {
    max-width: 720px;
    margin: 0 auto;
    line-height: 1.9;
}

.section h1 {
    font-size: clamp(34px, 7vw, 55px);
    line-height: 1.25;
}

.section h1 span {
    color: var(--rose);
}

.section h2 {
    margin: 15px 0 25px;
}

.section p {
    line-height: 1.9;
}

/* ==============================
   GIA ĐÌNH
============================== */

.family-grid,
.event-list {
    display: grid;
    max-width: 720px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
    margin: 30px auto;
}

.family-card,
.event-card {
    padding: 28px 20px;
    border: 1px solid var(--line);
    background: #fff;
    box-shadow: 0 8px 25px rgba(64, 53, 47, .035);
}

.family-card h3,
.event-card h3 {
    color: var(--rose);
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    font-weight: 400;
}

.family-card p,
.event-card p {
    margin: 8px 0;
}

.family-card small {
    display: block;
    margin-top: 15px;
    color: var(--muted);
    line-height: 1.8;
}

/* ==============================
   SỰ KIỆN
============================== */

.event-card a {
    display: inline-block;
    margin-top: 12px;
    color: var(--rose-dark);
    font-size: 13px;
    text-decoration: underline;
    text-underline-offset: 4px;
}

/* ==============================
   ALBUM ẢNH
============================== */

.gallery {
    display: grid;
    max-width: 720px;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin: 30px auto;
}

.gallery img {
    width: 100%;
    height: 260px;
    border-radius: 2px;
    background: #f1e9e2;
    object-fit: cover;
    transition: transform .4s ease;
}

.gallery img:hover {
    transform: scale(1.025);
}

/* ==============================
   LỜI CẢM ƠN
============================== */

.thanks {
    padding: 55px 22px;
    color: var(--rose);
    font-family: 'Playfair Display', serif;
    font-size: 24px;
    font-style: italic;
    line-height: 1.7;
    text-align: center;
}

/* ==============================
   QUẢN TRỊ
============================== */

.admin-wrap {
    display: grid;
    min-height: 100vh;
    place-items: center;
    padding: 20px;
}

.admin-form {
    width: min(100%, 430px);
    padding: 35px;
    background: white;
    box-shadow: var(--shadow);
}

.admin-form h1 {
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 400;
}

.admin-form label {
    display: block;
    margin: 18px 0;
    font-size: 13px;
}

.admin-form input {
    display: block;
    width: 100%;
    margin-top: 7px;
    padding: 13px;
    border: 1px solid var(--line);
    border-radius: 2px;
    outline: none;
}

.admin-form input:focus {
    border-color: var(--rose);
}

.admin-form .button {
    width: 100%;
}

.admin-form > a:not(.button) {
    display: block;
    margin-top: 18px;
    text-align: center;
}

.error {
    color: #b42318;
    font-size: 13px;
}

/* ==============================
   RESPONSIVE - TABLET
============================== */

@media (max-width: 768px) {
    .section {
        padding: 60px 22px;
    }

    .gallery img {
        height: 220px;
    }
}

/* ==============================
   RESPONSIVE - MOBILE
============================== */

@media (max-width: 600px) {
    .landing {
        padding: 25px 18px 45px;
    }

    .landing__ornament {
        margin-bottom: 60px;
        font-size: 9px;
        letter-spacing: 4px;
    }

    .landing h1 {
        font-size: clamp(36px, 10vw, 48px);
    }

    .intro {
        margin-top: 65px;
        padding: 40px 15px;
    }

    .intro h2,
    .section h2 {
        font-size: 30px;
    }

    .cover {
        min-height: 100svh;
        padding: 55px 25px;
    }

    .cover::before {
        inset: 12px;
    }

    .cover::after {
        inset: 18px;
    }

    .cover__names {
        font-size: clamp(35px, 10vw, 48px);
    }

    .family-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .family-card {
        padding: 22px 12px;
    }

    .family-card h3 {
        font-size: 22px;
    }

    .event-list {
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 10px;
    }

    .event-card {
        padding: 22px 12px;
    }

    .event-card h3 {
        font-size: 22px;
    }

    .section {
        padding: 52px 18px;
    }

    .section h1 {
        font-size: 36px;
    }

    .gallery {
        gap: 8px;
    }

    .gallery img {
        height: 180px;
    }

    .thanks {
        padding: 42px 20px;
        font-size: 21px;
    }

    .admin-form {
        padding: 25px;
    }

    .admin-wrap {
        align-items: start;
        padding: 16px;
    }

    .admin-form h1 {
        font-size: clamp(26px, 8vw, 32px);
    }

    .admin-form input {
        min-height: 48px;
        font-size: 16px;
    }

    .button {
        max-width: 100%;
        padding-right: 20px;
        padding-left: 20px;
        white-space: normal;
    }
}

/* Tôn trọng thiết lập giảm chuyển động của thiết bị */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        animation-duration: .01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: .01ms !important;
    }
}

/* =================================
   WEDDING INVITATION - ENHANCEMENT
================================= */

.cover {
    isolation: isolate;
}

.cover__photo {
    position: absolute;
    inset: 0;
    z-index: -2;
}

.cover__photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.cover__overlay {
    position: absolute;
    inset: 0;
    z-index: -1;
    background: linear-gradient(
        180deg,
        rgba(255, 250, 244, .75),
        rgba(255, 250, 244, .58)
    );
}

.cover__inner {
    width: 100%;
    max-width: 700px;
}

.cover__ornament,
.section__ornament {
    margin: 22px 0;
    color: var(--gold);
    font-family: 'Playfair Display', serif;
    font-size: 35px;
}

.cover__subtitle {
    color: var(--muted);
    font-size: 10px;
    letter-spacing: 5px;
}

.cover__divider {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 15px;
    margin: 20px 0;
}

.cover__divider span {
    width: 55px;
    height: 1px;
    background: var(--gold);
}

.cover__divider i {
    color: var(--rose);
    font-style: normal;
}

.cover__time {
    margin-top: -5px;
    color: var(--muted);
    font-size: 13px;
}

.cover__button {
    margin-top: 20px;
}

.cover__button span {
    margin-right: 10px;
}

.cover__hint {
    margin-top: 15px;
    color: var(--muted);
    font-size: 11px;
    letter-spacing: 1px;
}

.hero-section {
    padding-top: 90px;
    padding-bottom: 90px;
}

.hero-section__intro {
    color: var(--muted);
    font-family: 'Playfair Display', serif;
    font-size: 20px;
    font-style: italic;
}

.hero-section__message {
    max-width: 580px;
    margin: 25px auto;
}

.hero-section h1 span {
    color: var(--rose);
}

.section__description {
    max-width: 520px;
    margin: 0 auto 30px;
    color: var(--muted);
}

.family-card__icon,
.event-card__icon {
    color: var(--gold);
    font-size: 28px;
}

.family-card {
    border-radius: 3px;
}

.event-card {
    border-radius: 3px;
}

.event-card__date {
    margin: 15px 0;
    color: var(--rose-dark);
    font-family: 'Playfair Display', serif;
    font-size: 21px;
}

.event-card__venue {
    font-weight: 600;
}

.event-card__address {
    color: var(--muted);
    font-size: 13px;
}

.event-card__map {
    display: inline-block;
    margin-top: 15px;
    padding: 10px 18px;
    border: 1px solid var(--rose);
    font-size: 10px;
    letter-spacing: 1px;
    text-decoration: none;
    transition: .3s;
}

.event-card__map:hover {
    background: var(--rose);
    color: white;
}

.story-section__content {
    max-width: 650px;
    margin: 25px auto 0;
    line-height: 2;
}

.gallery__item {
    margin: 0;
    overflow: hidden;
    background: white;
}

.gallery__item img {
    transition: transform .5s ease;
}

.gallery__item:hover img {
    transform: scale(1.05);
}

.gallery__item figcaption {
    padding: 10px;
    color: var(--muted);
    font-size: 12px;
}

.countdown {
    max-width: 520px;
    margin: 45px auto 0;
    padding: 25px 15px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
}

.countdown__title {
    color: var(--rose);
    font-size: 10px;
    letter-spacing: 3px;
}

.countdown__grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px;
    margin-top: 20px;
}

.countdown__item {
    display: flex;
    flex-direction: column;
    gap: 7px;
}

.countdown__item strong {
    color: var(--ink);
    font-family: 'Playfair Display', serif;
    font-size: 32px;
    font-weight: 400;
}

.countdown__item span {
    color: var(--muted);
    font-size: 11px;
}

.thanks h2 {
    margin: 15px 0;
    font-family: 'Playfair Display', serif;
    font-size: 40px;
    font-weight: 400;
}

.thanks p:not(.eyebrow) {
    max-width: 500px;
    margin: 15px auto;
    line-height: 1.9;
}

.thanks__names {
    margin-top: 30px;
    font-family: 'Playfair Display', serif;
    font-size: 25px;
}

.thanks__names span {
    padding: 0 8px;
    color: var(--rose);
}

@media(max-width: 600px) {
    .hero-section {
        padding-top: 65px;
        padding-bottom: 65px;
    }

    .countdown {
        padding: 20px 5px;
    }

    .countdown__grid {
        gap: 5px;
    }

    .countdown__item strong {
        font-size: 27px;
    }

    .countdown__item span {
        font-size: 10px;
    }

    .cover__subtitle {
        letter-spacing: 3px;
    }
}

/* ==================================
   WEDDING 3D COVERFLOW
================================== */

.wedding-3d {
    --slide-width: 310px;

    position: relative;
    width: 100%;
    max-width: 1000px;
    margin: 55px auto 35px;
    padding: 20px 0 55px;
    perspective: 1200px;
    overflow: hidden;
    touch-action: pan-y;
}

.wedding-3d__stage {
    position: relative;
    width: 100%;
    height: 440px;
    transform-style: preserve-3d;
}

.wedding-3d__slide {
    position: absolute;
    width: var(--slide-width);
    height: 400px;
    top: 20px;
    left: 50%;

    border: 5px solid #fff;
    border-radius: 12px;
    overflow: hidden;

    background: #eee4dc;
    box-shadow: 0 20px 50px rgba(50, 30, 20, .2);

    transform: translateX(-50%) scale(.65);
    opacity: 0;
    visibility: hidden;

    transition:
        transform .75s cubic-bezier(.2,.7,.2,1),
        opacity .75s ease,
        filter .75s ease;

    transform-style: preserve-3d;
    will-change: transform;
}

.wedding-3d__slide img {
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.wedding-3d__caption {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 35px 12px 20px;
    color: white;
    text-align: center;

    font-family: 'Playfair Display', serif;
    font-size: 20px;

    background: linear-gradient(
        transparent,
        rgba(0, 0, 0, .7)
    );
}

/* Ảnh chính giữa */

.wedding-3d__slide.is-center {
    opacity: 1;
    visibility: visible;
    z-index: 5;

    transform:
        translateX(-50%)
        translateZ(100px)
        scale(1);

    filter: brightness(1);
}

/* Ảnh bên trái */

.wedding-3d__slide.is-left {
    opacity: .8;
    visibility: visible;
    z-index: 3;

    transform:
        translateX(calc(-50% - 250px))
        rotateY(32deg)
        scale(.78);

    filter: brightness(.75);
}

/* Ảnh bên phải */

.wedding-3d__slide.is-right {
    opacity: .8;
    visibility: visible;
    z-index: 3;

    transform:
        translateX(calc(-50% + 250px))
        rotateY(-32deg)
        scale(.78);

    filter: brightness(.75);
}

/* Ảnh phía xa */

.wedding-3d__slide.is-hidden-left {
    opacity: .25;
    visibility: visible;
    z-index: 1;

    transform:
        translateX(calc(-50% - 440px))
        rotateY(45deg)
        scale(.55);
}

.wedding-3d__slide.is-hidden-right {
    opacity: .25;
    visibility: visible;
    z-index: 1;

    transform:
        translateX(calc(-50% + 440px))
        rotateY(-45deg)
        scale(.55);
}

/* Nút chuyển ảnh */

.wedding-3d__arrow {
    position: absolute;
    top: 43%;
    z-index: 10;

    width: 45px;
    height: 45px;

    border: 1px solid #fff;
    border-radius: 50%;

    background: rgba(183, 124, 120, .9);
    color: white;

    font-size: 30px;
    line-height: 1;
    cursor: pointer;

    transition: .3s;
}

.wedding-3d__arrow:hover {
    background: #8f5d5a;
    transform: scale(1.1);
}

.wedding-3d__arrow--prev {
    left: 10px;
}

.wedding-3d__arrow--next {
    right: 10px;
}

/* Dấu chấm */

.wedding-3d__dots {
    display: flex;
    justify-content: center;
    gap: 10px;
    margin-top: 15px;
}

.wedding-3d__dot {
    width: 9px;
    height: 9px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #ddc9bd;
    cursor: pointer;
    transition: .3s;
}

.wedding-3d__dot.active {
    width: 25px;
    border-radius: 10px;
    background: #b77c78;
}

/* Mobile */

@media (max-width: 600px) {
    .wedding-3d {
        padding-top: 10px;
        overflow: hidden;
    }

    .wedding-3d__stage {
        height: 360px;
    }

    .wedding-3d__slide {
        width: 235px;
        height: 320px;
        top: 15px;
    }

    .wedding-3d__slide.is-left {
        transform:
            translateX(calc(-50% - 155px))
            rotateY(32deg)
            scale(.68);
    }

    .wedding-3d__slide.is-right {
        transform:
            translateX(calc(-50% + 155px))
            rotateY(-32deg)
            scale(.68);
    }

    .wedding-3d__slide.is-hidden-left {
        transform:
            translateX(calc(-50% - 270px))
            rotateY(45deg)
            scale(.5);
    }

    .wedding-3d__slide.is-hidden-right {
        transform:
            translateX(calc(-50% + 270px))
            rotateY(-45deg)
            scale(.5);
    }

    .wedding-3d__arrow {
        width: 36px;
        height: 36px;
        font-size: 23px;
    }

    .wedding-3d__caption {
        font-size: 17px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .wedding-3d__slide {
        transition: none;
    }
}
