:root {
    --t4-red: #e50914;
    --t4-red-dark: #9d050b;
    --t4-red-deep: #5f0508;
    --t4-bg: #050505;
    --t4-panel: #141414;
    --t4-panel-2: #1d1d1d;
    --t4-text: #f5f5f5;
    --t4-muted: #b3b3b3;
    --t4-soft: rgba(255, 255, 255, 0.08);
    --t4-line: rgba(255, 255, 255, 0.13);
    --t4-shadow: 0 22px 70px rgba(0, 0, 0, 0.72);
    --t4-radius: 14px;
    --t4-phone-width: 500px;
    --t4-safe-bottom: env(safe-area-inset-bottom, 0px);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    background: var(--t4-bg);
    scroll-behavior: smooth;
}

body.t4-body {
    min-height: 100vh;
    margin: 0;
    color: var(--t4-text);
    font-family: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #000;
    overflow-x: hidden;
}

body.t4-body:not(.invitation-open):not(.is-preview) {
    overflow: hidden;
}

a {
    color: inherit;
    text-decoration: none;
}

button,
input,
textarea,
select {
    font: inherit;
}

img {
    display: block;
    max-width: 100%;
}

.t4-loader {
    position: fixed;
    inset: 0;
    z-index: 1000;
    display: grid;
    gap: 1.1rem;
    place-items: center;
    align-content: center;
    background: #000;
    color: var(--t4-red);
    font-family: "Bebas Neue", sans-serif;
    font-size: clamp(2.5rem, 11vw, 5rem);
    letter-spacing: 0.06em;
    transition: opacity 0.45s ease, visibility 0.45s ease;
}

.t4-loader__status {
    display: grid;
    gap: 0.55rem;
    width: min(62vw, 260px);
    color: rgba(255, 255, 255, 0.74);
    font-family: "Inter", system-ui, sans-serif;
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-align: center;
    text-transform: uppercase;
}

.t4-loader__bar,
.t4-gate-loader div {
    position: relative;
    height: 3px;
    overflow: hidden;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.18);
}

.t4-loader__bar i,
.t4-gate-loader i {
    position: absolute;
    inset: 0 auto 0 0;
    width: 38%;
    border-radius: inherit;
    background: var(--t4-red);
    animation: t4-loader-slide 1.35s ease-in-out infinite;
}

.t4-loader.is-hidden {
    opacity: 0;
    visibility: hidden;
}

@keyframes t4-loader-slide {
    0% {
        transform: translateX(-105%);
    }
    55% {
        transform: translateX(125%);
    }
    100% {
        transform: translateX(285%);
    }
}

.t4-app {
    min-height: 100vh;
    background:
        radial-gradient(circle at 20% 0%, rgba(229, 9, 20, 0.18), transparent 30rem),
        linear-gradient(180deg, #080808 0%, #000 48%, #090909 100%);
}

.t4-desktop-cover {
    display: none;
}

.t4-phone {
    position: relative;
    width: min(100%, var(--t4-phone-width));
    min-height: 100vh;
    margin: 0 auto;
    background: var(--t4-bg);
    overflow: hidden;
}

.t4-gate,
.t4-section {
    position: relative;
    width: 100%;
    min-height: 100svh;
    padding: 1.35rem;
    overflow: hidden;
}

.t4-gate {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: flex-end;
    justify-content: center;
    background: var(--t4-cover) center / cover no-repeat;
    transition: opacity 0.58s ease, visibility 0.58s ease, transform 0.58s ease;
}

.t4-gate__shade,
.t4-desktop-cover__shade {
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.35) 38%, rgba(0, 0, 0, 0.96) 100%),
        linear-gradient(90deg, rgba(0, 0, 0, 0.78), transparent 48%, rgba(0, 0, 0, 0.42));
}

.t4-gate__inner {
    position: relative;
    z-index: 2;
    width: min(100%, 430px);
    padding: 6rem 0 calc(2.3rem + var(--t4-safe-bottom));
}

.t4-brand {
    color: var(--t4-red);
    font-family: "Bebas Neue", sans-serif;
    font-size: 2rem;
    letter-spacing: 0.08em;
    line-height: 1;
    text-shadow: 0 8px 26px rgba(0, 0, 0, 0.7);
}

.t4-brand--gate {
    margin-bottom: 1rem;
}

.t4-kicker,
.t4-date-text,
.t4-copy,
.t4-guest-box span,
.t4-event-card p,
.t4-event-card b,
.t4-story-item p,
.t4-bank-card small,
.t4-bank-card p {
    color: var(--t4-muted);
}

.t4-kicker {
    margin: 0 0 0.55rem;
    font-size: 0.72rem;
    font-weight: 700;
    letter-spacing: 0.18em;
    text-transform: uppercase;
}

.t4-gate h1,
.t4-desktop-cover h1 {
    margin: 0;
    font-family: "Bebas Neue", sans-serif;
    font-weight: 400;
    letter-spacing: 0.02em;
    line-height: 0.88;
    text-transform: uppercase;
}

.t4-gate h1 {
    max-width: 7ch;
    font-size: clamp(4.6rem, 21vw, 7.5rem);
}

.t4-date-text {
    margin: 0.9rem 0 1rem;
    font-size: 0.84rem;
    font-weight: 700;
}

.t4-gate-loader {
    display: grid;
    gap: 0.45rem;
    width: min(100%, 260px);
    margin: 1rem 0 0;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.66rem;
    font-weight: 700;
    letter-spacing: 0.14em;
    text-transform: uppercase;
}

.t4-gate-loader div {
    width: 100%;
}

.t4-meta {
    position: relative;
    z-index: 2;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin: 1rem 0;
}

.t4-meta span {
    padding: 0.24rem 0.45rem;
    border: 1px solid var(--t4-line);
    border-radius: 999px;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.66rem;
    font-weight: 700;
}

.t4-guest-box {
    width: min(100%, 360px);
    margin: 1.35rem 0;
    padding: 0.85rem 1rem;
    border: 1px solid var(--t4-line);
    border-radius: 10px;
    background: rgba(20, 20, 20, 0.78);
    backdrop-filter: blur(10px);
}

.t4-guest-box span,
.t4-guest-box strong {
    display: block;
}

.t4-guest-box span {
    margin-bottom: 0.25rem;
    font-size: 0.72rem;
}

.t4-guest-box strong {
    font-size: 1.05rem;
}

.t4-button,
.copy-btn,
.t4-bank-card a {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.34rem;
    min-height: 32px;
    padding: 0.36rem 0.78rem;
    border: 0;
    border-radius: 999px;
    background: var(--t4-red);
    color: #fff;
    font-weight: 700;
    font-size: 0.8rem;
    line-height: 1.15;
    cursor: pointer;
    box-shadow: 0 8px 20px rgba(229, 9, 20, 0.24);
}

.t4-button--small,
.t4-bank-card a,
.copy-btn {
    min-height: 29px;
    padding: 0.32rem 0.66rem;
    font-size: 0.74rem;
}

.copy-btn,
.t4-bank-card a {
    background: #fff;
    color: #111;
    box-shadow: none;
}

.t4-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 1.05em;
    min-width: 1.05em;
    font-size: 1.04em;
    line-height: 1;
    flex: 0 0 auto;
    transform: translateY(0.01em);
}

.t4-button span,
.copy-btn span,
.t4-bank-card a span {
    display: block;
    line-height: 1.15;
}

.t4-button--play-date {
    position: relative;
    z-index: 2;
    margin-top: 0.1rem;
}

.t4-content {
    opacity: 0;
    visibility: hidden;
    transform: translateY(1rem);
    transition: opacity 0.45s ease, visibility 0.45s ease, transform 0.45s ease;
}

.invitation-open .t4-gate {
    opacity: 0;
    visibility: hidden;
    transform: scale(1.03);
    pointer-events: none;
}

.invitation-open .t4-content,
.is-preview .t4-content {
    opacity: 1;
    visibility: visible;
    transform: none;
}

.t4-topbar {
    position: sticky;
    top: 0;
    z-index: 40;
    display: flex;
    align-items: center;
    gap: 0.85rem;
    min-height: 56px;
    padding: 0.8rem 1.1rem;
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.94), rgba(0, 0, 0, 0.58));
    backdrop-filter: blur(12px);
}

.t4-topbar span {
    margin-right: auto;
    color: var(--t4-red);
    font-family: "Bebas Neue", sans-serif;
    font-size: 1.35rem;
    letter-spacing: 0.06em;
}

.t4-topbar a {
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.74rem;
    font-weight: 700;
}

.t4-opening-photo::before,
.t4-countdown-section::before,
.t4-closing-section::before {
    content: "";
    position: absolute;
    inset: 0;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.12), rgba(0, 0, 0, 0.2) 34%, #050505 94%),
        linear-gradient(90deg, rgba(0, 0, 0, 0.82), transparent 70%);
    pointer-events: none;
}

.t4-opening-photo {
    min-height: auto;
    padding-top: 2rem;
    background: #050505;
}

.t4-photo-arch {
    position: relative;
    width: min(100%, 330px);
    aspect-ratio: 2 / 3;
    margin: 0 auto 1.25rem;
    border-radius: 14px;
    overflow: hidden;
    background: #1b1b1b;
    box-shadow: var(--t4-shadow);
}

.t4-photo-arch img,
.t4-couple-photo img,
.t4-gallery-grid img,
.t4-story-item img,
.t4-closing-photo img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.t4-section-title {
    position: relative;
    z-index: 2;
    width: 100%;
    margin-bottom: 1rem;
}

.t4-section-title p {
    margin: 0 0 0.25rem;
    color: var(--t4-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.t4-section-title h2,
.t4-closing-section h2 {
    margin: 0;
    font-size: clamp(1.45rem, 6vw, 2rem);
    font-weight: 700;
    letter-spacing: -0.03em;
}

.t4-copy {
    position: relative;
    z-index: 2;
    margin: 0;
    font-size: 0.8rem;
    line-height: 1.62;
}

.t4-quote-section,
.t4-couple-section,
.t4-countdown-section,
.t4-event-section,
.t4-story-section,
.t4-gallery-section,
.t4-gift-section,
.t4-rsvp-section,
.t4-closing-section {
    min-height: auto;
    padding-top: 2.3rem;
    padding-bottom: 2.3rem;
    background: #050505;
}

.t4-quote-section,
.t4-gift-section {
    background:
        radial-gradient(circle at 88% 14%, rgba(229, 9, 20, 0.23), transparent 16rem),
        linear-gradient(180deg, #090202 0%, #050505 76%);
}

.t4-event-section {
    background:
        linear-gradient(180deg, rgba(229, 9, 20, 0.12), transparent 18rem),
        #050505;
}

.t4-rsvp-section {
    background:
        radial-gradient(circle at 8% 0%, rgba(229, 9, 20, 0.18), transparent 15rem),
        #050505;
}

.t4-oval-card,
.t4-panel,
.t4-story-panel,
.t4-event-card,
.t4-couple-card,
.t4-bank-card {
    position: relative;
    z-index: 2;
    border: 1px solid var(--t4-line);
    border-radius: var(--t4-radius);
    background: linear-gradient(180deg, rgba(32, 32, 32, 0.98), rgba(14, 14, 14, 0.98));
    box-shadow: 0 16px 45px rgba(0, 0, 0, 0.5);
}

.t4-quote-section .t4-oval-card {
    overflow: hidden;
    padding: 1.35rem 1.15rem 1.2rem;
    border-color: rgba(255, 255, 255, 0.18);
    border-radius: 18px;
    background:
        linear-gradient(140deg, rgba(126, 5, 9, 0.94), rgba(38, 3, 5, 0.96) 56%, rgba(13, 13, 13, 0.98)),
        var(--t4-cover) center / cover no-repeat;
}

.t4-quote-section .t4-oval-card::before {
    content: "\201C";
    position: absolute;
    top: -1.1rem;
    right: 1rem;
    color: rgba(255, 255, 255, 0.12);
    font-family: Georgia, serif;
    font-size: 6.8rem;
    line-height: 1;
    pointer-events: none;
}

.t4-quote-section .t4-oval-card h2,
.t4-quote-section .t4-oval-card p {
    color: #fff;
}

.t4-quote-section .t4-oval-card h2 {
    max-width: 88%;
    margin-bottom: 0.65rem;
    font-size: clamp(1.12rem, 4.8vw, 1.45rem);
    letter-spacing: -0.01em;
}

.t4-quote-section .t4-oval-card p {
    max-width: 92%;
    color: rgba(255, 255, 255, 0.82);
    font-size: 0.78rem;
    line-height: 1.62;
}

.t4-gift-section .t4-panel,
.t4-rsvp-section .t4-panel {
    border-color: rgba(229, 9, 20, 0.36);
    background: linear-gradient(160deg, rgba(95, 5, 8, 0.95), rgba(18, 18, 18, 0.98) 58%);
}

.t4-oval-card,
.t4-panel,
.t4-story-panel {
    padding: 1.15rem;
}

.t4-oval-card h2 {
    margin: 0 0 0.8rem;
    font-size: 1.35rem;
}

.t4-oval-card p {
    margin: 0;
    color: var(--t4-muted);
    line-height: 1.7;
}

.t4-couple-list,
.t4-event-list,
.t4-story-list {
    position: relative;
    z-index: 2;
    display: grid;
    gap: 1rem;
}

.t4-couple-list {
    justify-items: center;
    gap: 1.25rem;
}

.t4-couple-card {
    width: min(100%, 330px);
    padding: 0;
    overflow: hidden;
    border-color: rgba(255, 255, 255, 0.18);
    background: #121212;
}

.t4-couple-card:nth-child(even) {
    border-color: rgba(229, 9, 20, 0.35);
    background: linear-gradient(180deg, rgba(70, 4, 7, 0.98), rgba(18, 18, 18, 0.98));
}

.t4-couple-photo {
    position: relative;
    aspect-ratio: 2 / 3;
    border-radius: var(--t4-radius);
    overflow: hidden;
    background: #222;
}

.t4-couple-photo::after {
    content: "";
    position: absolute;
    inset: 0;
    z-index: 1;
    background:
        linear-gradient(180deg, rgba(0, 0, 0, 0.03) 18%, rgba(0, 0, 0, 0.3) 52%, rgba(0, 0, 0, 0.94) 100%),
        linear-gradient(90deg, rgba(0, 0, 0, 0.42), transparent 45%, rgba(0, 0, 0, 0.2));
    pointer-events: none;
}

.t4-couple-photo img {
    transition: transform 0.45s ease, filter 0.45s ease;
}

.t4-couple-card:hover .t4-couple-photo img {
    transform: scale(1.035);
    filter: brightness(1.05);
}

.t4-couple-overlay {
    position: absolute;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 2;
    padding: 4.5rem 1rem 1rem;
}

.t4-couple-overlay small {
    display: inline-flex;
    margin-bottom: 0.45rem;
    padding: 0.2rem 0.5rem;
    border-radius: 999px;
    background: rgba(229, 9, 20, 0.92);
    color: #fff;
    font-size: 0.62rem;
    font-weight: 700;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.t4-couple-card h3,
.t4-event-card h3,
.t4-story-item h3 {
    margin: 0 0 0.35rem;
    font-size: 1.05rem;
    font-weight: 700;
}

.t4-couple-card h3 {
    font-family: "Bebas Neue", sans-serif;
    font-size: clamp(2.35rem, 11vw, 3.45rem);
    font-weight: 400;
    line-height: 0.9;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    text-shadow: 0 5px 22px rgba(0, 0, 0, 0.88);
}

.t4-couple-card p {
    margin: 0 0 0.5rem;
    color: rgba(255, 255, 255, 0.78);
    font-size: 0.76rem;
    line-height: 1.45;
}

.t4-couple-card a {
    display: inline-flex;
    align-items: center;
    width: fit-content;
    padding: 0.35rem 0.55rem;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.14);
    color: #fff;
    font-size: 0.78rem;
    font-weight: 700;
}

.t4-countdown-section {
    background: var(--t4-backdrop) center / cover no-repeat;
}

.t4-countdown-section::before {
    background:
        radial-gradient(circle at 18% 12%, rgba(229, 9, 20, 0.24), transparent 18rem),
        linear-gradient(180deg, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.94));
}

.t4-premiere-card {
    position: relative;
    z-index: 2;
    padding: 1.15rem;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: 18px;
    background:
        linear-gradient(180deg, rgba(18, 18, 18, 0.88), rgba(6, 6, 6, 0.96)),
        var(--t4-cover) center / cover no-repeat;
    box-shadow: var(--t4-shadow);
    overflow: hidden;
}

.t4-premiere-card::before {
    content: "";
    position: absolute;
    inset: 0;
    background: linear-gradient(90deg, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.62));
    pointer-events: none;
}

.t4-premiere-card > * {
    position: relative;
    z-index: 2;
}

.t4-premiere-date {
    display: grid;
    gap: 0.35rem;
    margin: 0.35rem 0 1rem;
    padding: 0.85rem;
    border-left: 3px solid var(--t4-red);
    background: rgba(255, 255, 255, 0.06);
    border-radius: 0 10px 10px 0;
}

.t4-premiere-date span {
    color: var(--t4-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.t4-premiere-date strong {
    color: #fff;
    font-size: 1rem;
    line-height: 1.35;
}

.t4-countdown-frame {
    position: relative;
    z-index: 2;
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 0.55rem;
    margin: 1rem 0 1.1rem;
}

.t4-countdown-frame div {
    min-height: 82px;
    padding: 0.72rem 0.45rem;
    border: 1px solid var(--t4-line);
    border-radius: 10px;
    background: rgba(0, 0, 0, 0.68);
    text-align: center;
}

.t4-countdown-frame strong,
.t4-event-date strong {
    display: block;
    color: #fff;
    font-family: "Bebas Neue", sans-serif;
    font-size: 2.65rem;
    line-height: 0.95;
    font-weight: 400;
}

.t4-countdown-frame span,
.t4-event-date span {
    color: var(--t4-muted);
    font-size: 0.68rem;
    font-weight: 700;
    letter-spacing: 0.1em;
    text-transform: uppercase;
}

.t4-event-card {
    display: grid;
    grid-template-columns: 92px 1fr;
    gap: 0.8rem;
    min-height: 0;
    padding: 0.72rem;
    overflow: hidden;
}

.t4-event-card:nth-child(odd) {
    border-color: rgba(229, 9, 20, 0.35);
    background: linear-gradient(145deg, rgba(86, 4, 8, 0.98), rgba(16, 16, 16, 0.98) 62%);
}

.t4-event-card:nth-child(even) {
    background: linear-gradient(145deg, rgba(24, 24, 24, 0.98), rgba(76, 5, 8, 0.95));
}

.t4-event-card::before {
    content: "";
    position: absolute;
    inset: 0;
    opacity: 0.22;
    background: var(--t4-backdrop) center / cover no-repeat;
}

.t4-event-card > *,
.t4-event-info > * {
    position: relative;
    z-index: 2;
}

.t4-event-thumb {
    position: relative;
    z-index: 2;
    display: grid;
    place-items: center;
    min-height: 136px;
    border-radius: 10px;
    background:
        linear-gradient(180deg, rgba(229, 9, 20, 0.42), rgba(0, 0, 0, 0.78)),
        var(--t4-event-poster) center / cover no-repeat;
    overflow: hidden;
}

.t4-event-thumb::after {
    content: "";
    position: absolute;
    inset: 0;
    border: 1px solid rgba(255, 255, 255, 0.16);
    border-radius: inherit;
}

.t4-event-thumb span {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 54px;
    height: 54px;
    border-radius: 999px;
    background: rgba(0, 0, 0, 0.72);
    color: #fff;
    font-size: 1.1rem;
    font-weight: 700;
}

.t4-event-date {
    display: flex;
    align-items: center;
    gap: 0.55rem;
    margin: 0.38rem 0 0.45rem;
}

.t4-event-date strong {
    font-size: 3.1rem;
}

.t4-event-card b {
    display: block;
    margin: 0.55rem 0 0.65rem;
    color: #fff;
    font-size: 0.86rem;
    font-weight: 700;
}

.t4-event-card h3 {
    font-size: 1.15rem;
}

.t4-event-card p {
    margin: 0;
    font-size: 0.76rem;
}

.t4-story-item {
    display: grid;
    grid-template-columns: 112px 1fr;
    gap: 0.85rem;
    padding: 0.7rem 0;
    border-top: 1px solid var(--t4-line);
}

.t4-story-item:first-child {
    border-top: 0;
}

.t4-story-item img {
    width: 112px;
    aspect-ratio: 16 / 10;
    border-radius: 8px;
}

.t4-story-item small {
    color: var(--t4-red);
    font-weight: 700;
}

.t4-story-item p {
    margin: 0;
    font-size: 0.76rem;
    line-height: 1.5;
}

.t4-gallery-shell {
    position: relative;
    z-index: 2;
}

.t4-gallery-grid {
    display: grid;
    grid-auto-flow: column;
    grid-auto-columns: minmax(135px, 42%);
    gap: 0.65rem;
    overflow-x: auto;
    padding: 0 0 0.8rem;
    scroll-snap-type: x mandatory;
    scrollbar-width: none;
}

.t4-gallery-grid::-webkit-scrollbar {
    display: none;
}

.t4-gallery-nav {
    display: none;
}

.gallery-trigger {
    aspect-ratio: 2 / 3;
    padding: 0;
    border: 0;
    border-radius: 9px;
    overflow: hidden;
    background: #222;
    scroll-snap-align: start;
}

.t4-bank-card {
    margin-top: 0.85rem;
    padding: 1rem;
    overflow: hidden;
}

.t4-bank-card:nth-of-type(odd) {
    border-color: rgba(229, 9, 20, 0.42);
    background: linear-gradient(135deg, rgba(112, 5, 9, 0.96), rgba(18, 18, 18, 0.98));
}

.t4-address-card {
    background: linear-gradient(135deg, rgba(21, 21, 21, 0.98), rgba(104, 5, 9, 0.94));
}

.t4-bank-name {
    display: block;
    color: #fff;
    font-size: 1.35rem;
    font-weight: 700;
    letter-spacing: 0.01em;
}

.t4-bank-card span:not(.t4-location-icon) {
    font-size: 0.86rem;
}

.t4-bank-card span:not(.t4-location-icon),
.t4-bank-card small,
.t4-bank-card p {
    display: block;
    margin-top: 0.35rem;
}

.t4-gift-actions {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.45rem;
    margin-top: 0.85rem;
}

.t4-gift-actions .copy-btn,
.t4-gift-actions a {
    margin: 0;
    gap: 0.36rem;
    min-height: 31px;
    padding-top: 0.32rem;
    padding-bottom: 0.32rem;
    line-height: 1.12;
    white-space: nowrap;
}

.t4-gift-actions .t4-icon {
    font-size: 0.95em;
    transform: translateY(0);
}

.t4-location-icon {
    display: grid;
    place-items: center;
    width: 54px;
    height: 54px;
    margin-bottom: 0.65rem;
    color: var(--t4-red);
}

.t4-location-icon svg {
    width: 100%;
    height: 100%;
    fill: currentColor;
}

.t4-wishes-composer {
    margin-top: 1rem;
    padding: 0.9rem;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 12px;
    background: rgba(0, 0, 0, 0.32);
}

.guestbook-form {
    display: grid;
    gap: 0.62rem;
}

.guestbook-form input,
.guestbook-form textarea,
.guestbook-form select {
    width: 100%;
    border: 1px solid rgba(255, 255, 255, 0.12);
    border-radius: 8px;
    background: rgba(8, 8, 8, 0.82);
    color: #fff;
    padding: 0.68rem 0.72rem;
    font-size: 0.78rem;
    line-height: 1.35;
    outline: none;
}

.guestbook-form select {
    padding-right: 2.25rem;
    appearance: none;
    -webkit-appearance: none;
    background-image:
        linear-gradient(45deg, transparent 50%, rgba(255, 255, 255, 0.72) 50%),
        linear-gradient(135deg, rgba(255, 255, 255, 0.72) 50%, transparent 50%);
    background-position:
        calc(100% - 1rem) 50%,
        calc(100% - 0.74rem) 50%;
    background-size: 0.3rem 0.3rem, 0.3rem 0.3rem;
    background-repeat: no-repeat;
}

.guestbook-form textarea {
    min-height: 96px;
    resize: vertical;
}

.guestbook-form input:focus,
.guestbook-form textarea:focus,
.guestbook-form select:focus {
    border-color: rgba(229, 9, 20, 0.72);
    box-shadow: 0 0 0 2px rgba(229, 9, 20, 0.18);
}

.t4-wishes-actions {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 0.55rem;
}

.t4-wishes-actions .t4-button {
    min-height: 34px;
    white-space: nowrap;
}

.guestbook-list {
    margin-top: 0.78rem;
}

.guestbook-list-card {
    max-height: min(420px, 56vh);
    overflow: auto;
    padding: 0.72rem 0.86rem;
    border: 1px solid rgba(255, 255, 255, 0.11);
    border-radius: 12px;
    background: linear-gradient(135deg, rgba(18, 18, 18, 0.96), rgba(8, 8, 8, 0.96));
    scrollbar-width: thin;
    scrollbar-color: rgba(229, 9, 20, 0.55) rgba(255, 255, 255, 0.05);
}

.guestbook-list-card::-webkit-scrollbar {
    width: 6px;
}

.guestbook-list-card::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
}

.guestbook-list-card::-webkit-scrollbar-thumb {
    border-radius: 999px;
    background: rgba(229, 9, 20, 0.55);
}

.guestbook-item {
    display: block;
    position: relative;
    padding: 0.58rem 0;
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
}

.guestbook-item:first-child {
    padding-top: 0;
}

.guestbook-item:last-child {
    padding-bottom: 0;
    border-bottom: 0;
}

.guestbook-item::before {
    display: none;
}

.guestbook-item strong {
    display: block;
    color: #fff;
    font-size: 0.78rem;
    line-height: 1.28;
    overflow-wrap: anywhere;
}

.guestbook-item small {
    display: block;
    margin-top: 0.1rem;
    color: rgba(255, 255, 255, 0.48);
    font-size: 0.6rem;
    line-height: 1.25;
    font-weight: 700;
    letter-spacing: 0.04em;
    text-transform: uppercase;
}

.guestbook-item p {
    margin: 0.18rem 0 0;
    color: rgba(255, 255, 255, 0.76);
    font-size: 0.7rem;
    line-height: 1.46;
    overflow-wrap: anywhere;
}

.guestbook-item.is-empty {
    text-align: center;
    opacity: 0.78;
}

@media (max-width: 420px) {
    .guestbook-list-card {
        max-height: 390px;
        padding: 0.66rem 0.74rem;
    }

    .guestbook-item {
        padding: 0.54rem 0;
    }
}

.t4-closing-section {
    background: var(--t4-cover) center / cover no-repeat;
}

.t4-closing-photo {
    position: relative;
    z-index: 2;
    width: min(100%, 300px);
    aspect-ratio: 2 / 3;
    margin: 0 auto 1.2rem;
    border-radius: 14px;
    overflow: hidden;
    box-shadow: var(--t4-shadow);
}

.t4-closing-section h2 {
    position: relative;
    z-index: 2;
    margin-top: 1rem;
    font-family: "Bebas Neue", sans-serif;
    font-size: clamp(3.5rem, 18vw, 5rem);
    font-weight: 400;
    line-height: 0.9;
    text-transform: uppercase;
}

.t4-footer {
    padding: 1.1rem 1rem calc(1.1rem + var(--t4-safe-bottom));
    background: #101010;
    color: var(--t4-muted);
    text-align: center;
    font-size: 0.78rem;
}

.t4-footer a {
    color: #fff;
    font-weight: 700;
}

.music-toggle {
    position: fixed;
    right: max(1rem, env(safe-area-inset-right, 0px));
    bottom: calc(1rem + var(--t4-safe-bottom));
    z-index: 70;
    display: grid;
    place-items: center;
    width: 42px;
    height: 42px;
    border: 0;
    border-radius: 50%;
    background: var(--t4-red);
    color: #fff;
    font-weight: 700;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(0, 0, 0, 0.48);
}

.music-toggle .t4-icon {
    width: auto;
    min-width: 0;
    font-size: 18px;
}

.music-icon {
    display: inline-flex;
    align-items: center;
    justify-content: center;
}

.music-icon--pause,
.music-toggle.is-playing .music-icon--play {
    display: none;
}

.music-toggle.is-playing .music-icon--pause {
    display: inline-flex;
}

.toast {
    position: fixed;
    left: 50%;
    bottom: calc(5rem + var(--t4-safe-bottom));
    z-index: 90;
    transform: translateX(-50%) translateY(0.6rem);
    padding: 0.7rem 0.9rem;
    border-radius: 8px;
    background: rgba(255, 255, 255, 0.94);
    color: #111;
    font-size: 0.82rem;
    font-weight: 800;
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.25s ease, visibility 0.25s ease, transform 0.25s ease;
}

.toast.is-visible {
    opacity: 1;
    visibility: visible;
    transform: translateX(-50%);
}

.gallery-lightbox {
    position: fixed;
    inset: 0;
    z-index: 120;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.92);
    padding: 1rem;
}

.gallery-lightbox.is-open {
    display: flex;
}

.gallery-lightbox__image {
    max-width: 100%;
    max-height: 84vh;
    border-radius: 10px;
}

.gallery-lightbox__close,
.gallery-lightbox__nav {
    position: absolute;
    border: 0;
    border-radius: 999px;
    background: rgba(255, 255, 255, 0.16);
    color: #fff;
    cursor: pointer;
}

.gallery-lightbox__close {
    top: 1rem;
    right: 1rem;
    width: 42px;
    height: 42px;
    font-size: 1.8rem;
}

.gallery-lightbox__nav {
    top: 50%;
    width: 42px;
    height: 42px;
    font-size: 2rem;
    transform: translateY(-50%);
}

.gallery-lightbox__nav--prev {
    left: 1rem;
}

.gallery-lightbox__nav--next {
    right: 1rem;
}

.reveal {
    opacity: 0;
    transform: translateY(1rem);
    transition: opacity 0.65s ease, transform 0.65s ease;
}

.reveal.is-visible,
.t4-gate .reveal {
    opacity: 1;
    transform: none;
}

#youtubeMusicFrame {
    position: fixed;
    width: 1px;
    height: 1px;
    left: -9999px;
    top: -9999px;
    opacity: 0;
    pointer-events: none;
}

@media (min-width: 960px) {
    .t4-app {
        display: grid;
        grid-template-columns: 1fr var(--t4-phone-width);
        min-height: 100vh;
    }

    .t4-desktop-cover {
        position: fixed;
        inset: 0 var(--t4-phone-width) 0 0;
        display: flex;
        align-items: flex-end;
        padding: 3rem;
        background: var(--t4-cover) center / cover no-repeat;
        overflow: hidden;
    }

    .t4-desktop-cover .t4-brand {
        position: absolute;
        z-index: 3;
        top: 2rem;
        left: 3rem;
        font-size: 2.6rem;
    }

    .t4-desktop-cover__photo {
        position: absolute;
        right: 5vw;
        bottom: 5vh;
        z-index: 2;
        width: min(26vw, 340px);
        aspect-ratio: 2 / 3;
        border-radius: 18px;
        overflow: hidden;
        box-shadow: var(--t4-shadow);
    }

    .t4-desktop-cover__image {
        width: 100%;
        height: 100%;
        object-fit: cover;
    }

    .t4-desktop-cover__text {
        position: relative;
        z-index: 3;
        max-width: 620px;
        padding-bottom: 3rem;
    }

    .t4-desktop-cover h1 {
        max-width: 9ch;
        font-size: clamp(6rem, 10vw, 10rem);
    }

    .t4-desktop-cover p {
        margin: 0.55rem 0;
        color: var(--t4-muted);
        font-weight: 700;
        letter-spacing: 0.1em;
        text-transform: uppercase;
    }

    .t4-movie-progress {
        width: min(100%, 420px);
        margin-top: 1.65rem;
    }

    .t4-movie-progress__meta {
        display: flex;
        align-items: center;
        justify-content: space-between;
        gap: 1rem;
        margin-bottom: 0.55rem;
        color: rgba(255, 255, 255, 0.7);
        font-size: 0.68rem;
        font-weight: 700;
        letter-spacing: 0.12em;
        text-transform: uppercase;
    }

    .t4-movie-progress__track {
        position: relative;
        height: 4px;
        overflow: hidden;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.2);
        box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06);
    }

    .t4-movie-progress__track::after {
        content: "";
        position: absolute;
        top: 50%;
        right: 0;
        width: 9px;
        height: 9px;
        border-radius: 999px;
        background: rgba(255, 255, 255, 0.8);
        transform: translateY(-50%);
    }

    .t4-movie-progress__track i {
        position: absolute;
        inset: 0 auto 0 0;
        width: calc(var(--t4-scroll-progress, 0) * 100%);
        border-radius: inherit;
        background: var(--t4-red);
        box-shadow: 0 0 18px rgba(229, 9, 20, 0.6);
        transition: width 0.12s linear;
    }

    .t4-gallery-shell {
        padding: 0 2.25rem;
    }

    .t4-gallery-grid {
        grid-auto-columns: minmax(130px, 38%);
        padding-bottom: 0;
        scroll-behavior: smooth;
    }

    .t4-gallery-nav {
        position: absolute;
        top: 50%;
        z-index: 4;
        display: grid;
        place-items: center;
        width: 34px;
        height: 34px;
        border: 1px solid rgba(255, 255, 255, 0.14);
        border-radius: 999px;
        background: rgba(16, 16, 16, 0.86);
        color: #fff;
        cursor: pointer;
        box-shadow: 0 10px 28px rgba(0, 0, 0, 0.45);
        transform: translateY(-50%);
    }

    .t4-gallery-nav--prev {
        left: 0;
    }

    .t4-gallery-nav--next {
        right: 0;
    }

    .t4-gallery-nav .t4-icon {
        width: auto;
        min-width: 0;
        font-size: 0.82rem;
    }

    .t4-phone {
        grid-column: 2;
        margin: 0;
        min-height: 100vh;
        box-shadow: -30px 0 80px rgba(0, 0, 0, 0.7);
    }

    .t4-gate {
        width: var(--t4-phone-width);
        left: auto;
        right: 0;
    }

    .music-toggle {
        right: calc(1rem + (100vw - var(--t4-phone-width) - 0px));
    }
}

@media (max-width: 420px) {
    .t4-gate,
    .t4-section {
        padding-left: 1rem;
        padding-right: 1rem;
    }

    .t4-story-item {
        grid-template-columns: 96px 1fr;
    }

    .t4-couple-card {
        width: min(100%, 305px);
    }

    .t4-event-card {
        grid-template-columns: 82px 1fr;
        gap: 0.65rem;
    }

    .t4-event-thumb {
        min-height: 128px;
    }

    .t4-wishes-actions {
        grid-template-columns: 1fr;
    }

    .t4-wishes-actions .t4-button {
        width: fit-content;
    }

    .t4-story-item img {
        width: 96px;
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        scroll-behavior: auto !important;
        transition-duration: 0.001ms !important;
    }
}
