:root {
    --tm-primary: #9B111E;
    --tm-secondary: #D4AF37;
    --tm-ivory: #FFF8EC;
    --tm-dark: #2A1111;
    --tm-white: #FFFFFF;
    --tm-muted: rgba(42, 17, 17, 0.72);
    --tm-shadow: 0 24px 70px rgba(81, 0, 0, 0.14);
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body.tian-mi-body {
    margin: 0;
    color: var(--tm-dark);
    background:
        radial-gradient(circle at top left, rgba(212, 175, 55, 0.20), transparent 28rem),
        linear-gradient(180deg, var(--tm-ivory), #fffaf2 45%, var(--tm-ivory));
    font-family: Georgia, 'Times New Roman', serif;
}

a {
    color: inherit;
}

button,
input,
textarea,
select {
    font: inherit;
}

.tian-mi-invitation {
    overflow: hidden;
}

.tm-container {
    width: min(1080px, calc(100% - 40px));
    margin: 0 auto;
}

.tm-narrow {
    width: min(760px, calc(100% - 40px));
}

.tm-cover {
    position: relative;
    min-height: 100vh;
    padding: 34px 20px;
    display: grid;
    place-items: center;
    overflow: hidden;
    text-align: center;
    color: var(--tm-white);
    background-color: var(--tm-primary);
    background-image: var(--tm-cover-bg, none);
    background-size: cover;
    background-position: center;
}

.tm-cover::before,
.tm-cover::after,
.tm-section::before,
.tm-section::after {
    content: '';
    position: absolute;
    pointer-events: none;
}

.tm-cover::before {
    inset: 22px;
    border: 1px solid rgba(212, 175, 55, 0.62);
    border-radius: 34px;
    z-index: 2;
}

.tm-cover::after {
    inset: 42px;
    border: 1px solid rgba(255, 248, 236, 0.26);
    border-radius: 26px;
    z-index: 2;
}

.tm-cover-overlay {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 20%, rgba(212, 175, 55, 0.28), transparent 28rem),
        linear-gradient(180deg, rgba(66, 0, 0, 0.46), rgba(80, 0, 0, 0.92));
    z-index: 1;
}

.tm-pattern {
    position: absolute;
    width: 360px;
    height: 360px;
    opacity: 0.2;
    z-index: 1;
    background-image:
        linear-gradient(45deg, transparent 45%, rgba(212, 175, 55, 0.75) 45%, rgba(212, 175, 55, 0.75) 55%, transparent 55%),
        linear-gradient(-45deg, transparent 45%, rgba(212, 175, 55, 0.75) 45%, rgba(212, 175, 55, 0.75) 55%, transparent 55%);
    background-size: 36px 36px;
}

.tm-pattern-top {
    top: -90px;
    left: -90px;
    transform: rotate(12deg);
}

.tm-pattern-bottom {
    right: -90px;
    bottom: -90px;
    transform: rotate(12deg);
}

.tm-cover-inner {
    position: relative;
    z-index: 3;
    width: min(1060px, 100%);
    padding: 38px 16px;
}

.tm-cover-layout {
    display: grid;
    grid-template-columns: minmax(260px, 0.82fr) minmax(320px, 1fr);
    align-items: center;
    gap: clamp(28px, 6vw, 72px);
}

.tm-cover-photo-wrap {
    position: relative;
    display: flex;
    justify-content: center;
}

.tm-cover-photo-wrap::before {
    content: '';
    position: absolute;
    inset: 22px -10px -18px 26px;
    border: 1px solid rgba(212, 175, 55, 0.5);
    border-radius: 36px;
    transform: rotate(-4deg);
}

.tm-cover-photo {
    position: relative;
    width: min(360px, 82vw);
    aspect-ratio: 4 / 5;
    padding: 12px;
    border: 1px solid rgba(212, 175, 55, 0.82);
    border-radius: 36px;
    background:
        linear-gradient(145deg, rgba(255, 248, 236, 0.94), rgba(212, 175, 55, 0.42)),
        rgba(255, 255, 255, 0.16);
    box-shadow: 0 28px 72px rgba(0, 0, 0, 0.32);
    overflow: hidden;
}

.tm-cover-photo::before {
    content: '';
    position: absolute;
    inset: 22px;
    border: 1px solid rgba(255, 248, 236, 0.5);
    border-radius: 26px;
    z-index: 2;
    pointer-events: none;
}

.tm-cover-photo img {
    width: 100%;
    height: 100%;
    display: block;
    border-radius: 26px;
    object-fit: cover;
}

.tm-cover-photo-placeholder {
    height: 100%;
    display: grid;
    place-items: center;
    align-content: center;
    gap: 12px;
    border: 1px dashed rgba(155, 17, 30, 0.35);
    border-radius: 26px;
    color: var(--tm-primary);
    background: rgba(255, 248, 236, 0.7);
}

.tm-cover-photo-placeholder span {
    color: var(--tm-secondary);
    font-size: 64px;
    line-height: 1;
}

.tm-cover-photo-placeholder em {
    font-size: 13px;
    font-style: normal;
    font-weight: 700;
    letter-spacing: 2px;
    text-transform: uppercase;
}

.tm-cover-content {
    text-align: center;
}

.tm-symbol,
.tm-seal {
    width: 92px;
    height: 92px;
    margin: 0 auto 24px;
    display: grid;
    place-items: center;
    border: 2px solid var(--tm-secondary);
    border-radius: 50%;
    color: var(--tm-secondary);
    font-size: 52px;
    line-height: 1;
    background: rgba(42, 17, 17, 0.12);
    box-shadow: 0 0 42px rgba(212, 175, 55, 0.28);
}

.tm-cover-title {
    margin: 0 0 16px;
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 4px;
}

.tm-couple-name {
    margin: 0;
    font-size: clamp(42px, 10vw, 98px);
    font-weight: 500;
    line-height: 1.02;
    text-shadow: 0 18px 60px rgba(0, 0, 0, 0.32);
}

.tm-couple-name span {
    display: block;
    margin: 10px 0;
    color: var(--tm-secondary);
    font-size: 0.42em;
    font-style: italic;
}

.tm-date {
    margin: 28px 0;
    font-size: clamp(16px, 3vw, 20px);
    letter-spacing: 1px;
}

.tm-guest-box {
    width: min(420px, 100%);
    margin: 0 auto 28px;
    padding: 16px 20px;
    border: 1px solid rgba(212, 175, 55, 0.54);
    border-radius: 999px;
    background: rgba(255, 248, 236, 0.11);
    backdrop-filter: blur(10px);
}

.tm-guest-box span,
.tm-guest-box strong {
    display: block;
}

.tm-guest-box span {
    font-size: 13px;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: rgba(255, 255, 255, 0.76);
}

.tm-guest-box strong {
    margin-top: 3px;
    color: var(--tm-secondary);
    font-size: 20px;
}

.tm-button {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 28px;
    border: 0;
    border-radius: 999px;
    background: linear-gradient(135deg, var(--tm-secondary), #f5df8c);
    color: var(--tm-dark);
    font-weight: 700;
    line-height: 1;
    text-decoration: none;
    cursor: pointer;
    box-shadow: 0 16px 35px rgba(0, 0, 0, 0.22);
    transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.tm-button:hover,
.tm-button:focus {
    transform: translateY(-2px);
    box-shadow: 0 20px 44px rgba(0, 0, 0, 0.26);
}

.tm-section {
    position: relative;
    padding: 92px 0;
}

.tm-section-heading {
    width: min(760px, calc(100% - 40px));
    margin: 0 auto 48px;
    text-align: center;
}

.tm-section-heading h2 {
    margin: 8px 0 12px;
    color: var(--tm-primary);
    font-size: clamp(34px, 7vw, 58px);
    font-weight: 500;
    line-height: 1;
}

.tm-section-heading p {
    margin: 0;
    color: var(--tm-muted);
    font-size: 17px;
    line-height: 1.8;
}

.tm-small-symbol {
    color: var(--tm-secondary);
    font-size: 36px;
    line-height: 1;
}

.tm-quote-section {
    background:
        linear-gradient(180deg, rgba(155, 17, 30, 0.04), rgba(212, 175, 55, 0.06)),
        var(--tm-ivory);
}

.tm-quote {
    margin: 0;
    padding: 42px 34px;
    border: 1px solid rgba(212, 175, 55, 0.42);
    border-radius: 32px;
    background: rgba(255, 255, 255, 0.66);
    text-align: center;
    box-shadow: var(--tm-shadow);
}

.tm-quote p {
    margin: 0;
    font-size: clamp(22px, 5vw, 36px);
    line-height: 1.45;
    color: var(--tm-primary);
}

.tm-quote cite {
    display: block;
    margin-top: 18px;
    color: var(--tm-muted);
    font-style: normal;
}

.tm-couple-grid {
    display: grid;
    grid-template-columns: minmax(0, 1fr) 92px minmax(0, 1fr);
    gap: 24px;
    align-items: center;
}

.tm-couple-card,
.tm-event-card,
.tm-gift-card,
.tm-form-shell,
.tm-content-card {
    border: 1px solid rgba(212, 175, 55, 0.44);
    border-radius: 32px;
    background:
        linear-gradient(135deg, rgba(255, 255, 255, 0.9), rgba(255, 248, 236, 0.9));
    box-shadow: var(--tm-shadow);
}

.tm-couple-card {
    padding: 30px;
    text-align: center;
}

.tm-couple-photo {
    width: 220px;
    height: 220px;
    margin: 0 auto 22px;
    display: grid;
    place-items: center;
    overflow: hidden;
    border: 8px solid #fff5df;
    border-radius: 50%;
    background:
        radial-gradient(circle, rgba(212, 175, 55, 0.26), transparent),
        var(--tm-primary);
    background-size: cover;
    background-position: center;
    color: #fff;
    box-shadow: 0 20px 44px rgba(81, 0, 0, 0.14);
}

.tm-couple-card h3 {
    margin: 0 0 8px;
    color: var(--tm-primary);
    font-size: 30px;
    font-weight: 500;
}

.tm-couple-card p {
    margin: 0;
    color: var(--tm-muted);
    line-height: 1.7;
}

.tm-couple-middle {
    width: 92px;
    height: 92px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    color: var(--tm-secondary);
    font-size: 44px;
    background: var(--tm-primary);
    box-shadow: var(--tm-shadow);
}

.tm-countdown-section {
    padding: 32px 0;
    background: var(--tm-primary);
    color: var(--tm-white);
}

.tm-countdown-card {
    padding: 34px;
    border: 1px solid rgba(212, 175, 55, 0.42);
    border-radius: 30px;
    background:
        radial-gradient(circle at top, rgba(212, 175, 55, 0.17), transparent 24rem),
        rgba(255, 255, 255, 0.06);
    text-align: center;
}

.tm-countdown-card p {
    margin: 0 0 24px;
    letter-spacing: 2px;
    text-transform: uppercase;
    font-size: 13px;
    color: rgba(255, 255, 255, 0.8);
}

.tm-countdown-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 14px;
}

.tm-countdown-grid div {
    padding: 18px 8px;
    border-radius: 22px;
    background: rgba(255, 248, 236, 0.09);
}

.tm-countdown-grid strong,
.tm-countdown-grid span {
    display: block;
}

.tm-countdown-grid strong {
    color: var(--tm-secondary);
    font-size: clamp(30px, 7vw, 52px);
    line-height: 1;
}

.tm-countdown-grid span {
    margin-top: 8px;
    color: rgba(255, 255, 255, 0.76);
    font-size: 13px;
}

.tm-event-section,
.tm-gallery-section,
.tm-wishes-section {
    background: rgba(255, 255, 255, 0.35);
}

.tm-event-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 22px;
}

.tm-event-card {
    position: relative;
    padding: 32px 26px;
    text-align: center;
    overflow: hidden;
}

.tm-card-symbol {
    color: rgba(212, 175, 55, 0.24);
    font-size: 64px;
    line-height: 1;
}

.tm-event-card h3 {
    margin: 10px 0 18px;
    color: var(--tm-primary);
    font-size: 26px;
    font-weight: 500;
}

.tm-event-card p {
    margin: 8px 0;
    color: var(--tm-muted);
    line-height: 1.6;
}

.tm-event-date {
    color: var(--tm-dark) !important;
    font-weight: 700;
}

.tm-map-action {
    margin-top: 34px;
    text-align: center;
}

.tm-story-list {
    position: relative;
    width: min(860px, calc(100% - 40px));
}

.tm-story-list::before {
    content: '';
    position: absolute;
    top: 0;
    bottom: 0;
    left: 120px;
    width: 1px;
    background: rgba(212, 175, 55, 0.55);
}

.tm-story-item {
    position: relative;
    display: grid;
    grid-template-columns: 120px minmax(0, 1fr);
    gap: 28px;
    margin-bottom: 28px;
}

.tm-story-year {
    position: relative;
    z-index: 1;
    width: 92px;
    height: 92px;
    display: grid;
    place-items: center;
    border-radius: 50%;
    background: var(--tm-primary);
    color: var(--tm-secondary);
    font-weight: 700;
    box-shadow: var(--tm-shadow);
}

.tm-story-content {
    padding: 24px 28px;
    border-radius: 26px;
    background: rgba(255, 255, 255, 0.75);
    border: 1px solid rgba(212, 175, 55, 0.34);
}

.tm-story-content h3 {
    margin: 0 0 8px;
    color: var(--tm-primary);
    font-size: 25px;
}

.tm-story-content p {
    margin: 0;
    color: var(--tm-muted);
    line-height: 1.7;
}

.tm-gallery-grid {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
}

.tm-gallery-item,
.tm-gallery-placeholder {
    min-height: 280px;
    border-radius: 28px;
    overflow: hidden;
    background-color: var(--tm-primary);
    background-size: cover;
    background-position: center;
    box-shadow: 0 18px 42px rgba(81, 0, 0, 0.13);
}

.tm-gallery-item {
    position: relative;
    display: block;
}

.tm-gallery-item span,
.tm-gallery-placeholder span {
    position: absolute;
    opacity: 0;
}

.tm-gallery-placeholder {
    display: grid;
    place-items: center;
    color: rgba(255, 255, 255, 0.76);
    background:
        radial-gradient(circle, rgba(212, 175, 55, 0.34), transparent),
        var(--tm-primary);
}

.tm-form-shell {
    padding: clamp(26px, 5vw, 48px);
}

.tm-form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 18px;
}

.tm-form-grid label,
.tm-form-grid span {
    display: block;
}

.tm-form-grid span {
    margin-bottom: 8px;
    color: var(--tm-primary);
    font-weight: 700;
}

.tm-form-grid input,
.tm-form-grid select,
.tm-form-grid textarea {
    width: 100%;
    min-height: 48px;
    padding: 12px 14px;
    border: 1px solid rgba(155, 17, 30, 0.18);
    border-radius: 16px;
    background: #fffaf4;
    color: var(--tm-dark);
    outline: none;
}

.tm-form-grid textarea {
    resize: vertical;
}

.tm-full {
    grid-column: 1 / -1;
}

.tm-ajax-form .tm-button {
    margin-top: 22px;
}

.tm-form-message {
    margin-top: 14px;
    color: var(--tm-primary);
    font-weight: 700;
}

.tm-gift-card {
    padding: 38px;
    text-align: center;
}

.tm-gift-card span,
.tm-gift-card strong,
.tm-gift-card p {
    display: block;
}

.tm-gift-card span {
    color: var(--tm-primary);
    font-size: 20px;
    font-weight: 700;
}

.tm-gift-card strong {
    margin: 14px 0;
    font-size: clamp(30px, 8vw, 54px);
    color: var(--tm-secondary);
    letter-spacing: 2px;
}

.tm-gift-card p {
    margin: 0 0 22px;
    color: var(--tm-muted);
}

.tm-wish-list {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
    margin-top: 34px;
}

.tm-wish-card {
    padding: 22px;
    border-radius: 24px;
    background: rgba(255, 250, 244, 0.84);
    border: 1px solid rgba(212, 175, 55, 0.32);
}

.tm-wish-card h3 {
    margin: 0 0 8px;
    color: var(--tm-primary);
}

.tm-wish-card p {
    margin: 0;
    color: var(--tm-muted);
    line-height: 1.6;
}

.tm-closing-section {
    min-height: 520px;
    display: grid;
    place-items: center;
    text-align: center;
    color: #fff;
    background:
        radial-gradient(circle at top, rgba(212, 175, 55, 0.22), transparent 28rem),
        linear-gradient(180deg, var(--tm-primary), #51050d);
}

.tm-closing-section p {
    margin: 0 0 24px;
    color: rgba(255, 255, 255, 0.82);
    font-size: 18px;
    line-height: 1.8;
}

.tm-closing-section h2 {
    margin: 0;
    color: #fff;
    font-size: clamp(36px, 8vw, 72px);
    font-weight: 500;
}

.tm-closing-section h2 span {
    display: block;
    color: var(--tm-secondary);
    font-size: 0.45em;
}

.tm-closing-section small {
    display: block;
    margin-top: 24px;
    color: rgba(255, 255, 255, 0.68);
}

.tm-seal-large {
    width: 112px;
    height: 112px;
    font-size: 62px;
}

.tm-music-toggle {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 999;
    width: 54px;
    height: 54px;
    border: 0;
    border-radius: 50%;
    background: var(--tm-primary);
    color: var(--tm-secondary);
    box-shadow: var(--tm-shadow);
    cursor: pointer;
}

.tm-music-toggle[data-playing='true'] {
    animation: tmPulse 1.8s infinite;
}

@keyframes tmPulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.07); }
}

@media (max-width: 900px) {
    .tm-cover-layout {
        grid-template-columns: 1fr;
        gap: 30px;
    }

    .tm-cover-photo {
        width: min(320px, 78vw);
    }

    .tm-cover-inner {
        padding-top: 56px;
        padding-bottom: 56px;
    }
}

@media (max-width: 900px) {
    .tm-couple-grid,
    .tm-event-grid,
    .tm-gallery-grid,
    .tm-wish-list {
        grid-template-columns: 1fr;
    }

    .tm-couple-middle {
        margin: 0 auto;
    }
}

@media (max-width: 640px) {
    .tm-section {
        padding: 70px 0;
    }

    .tm-countdown-grid {
        grid-template-columns: repeat(2, minmax(0, 1fr));
    }

    .tm-form-grid {
        grid-template-columns: 1fr;
    }

    .tm-story-list::before {
        left: 42px;
    }

    .tm-story-item {
        grid-template-columns: 84px minmax(0, 1fr);
        gap: 16px;
    }

    .tm-story-year {
        width: 78px;
        height: 78px;
        font-size: 14px;
    }

    .tm-gallery-item,
    .tm-gallery-placeholder {
        min-height: 220px;
    }
}
