:root {
    --font-heading: "Fanwood Text", serif;
    --font-middle: "Podkova", serif;
    --font-body: "Maitree", serif;
    --color-primary: #b8342a;
    --color-primary-dark: #8a2720;
    --color-text: #2c2416;
    --color-text-dark: #1a150d;
    --color-text-light: #5c5347;
    --color-bg-light: #f5efe6;
    --color-bg-pink: #f9f4eb;
    --washi-cream: #faf6ef;
    --washi-gold: #c9a55c;
    --qr-ink: #c9a55c;
    --qr-bg: var(--washi-cream);
}

*,
*::before,
*::after {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    margin: 0;
    min-height: 100vh;
    overflow-x: hidden;
    font-family: var(--font-body);
    color: var(--color-text);
    background-color: #fef2e2;
    background-image: image-set(
        url("/assets/bg3.optimized.webp") type("image/webp"),
        url("/assets/bg3.optimized.jpg") type("image/jpeg")
    );
    background-size: cover;
    background-position: center;
    background-attachment: fixed;
}

h1,
h2,
h3,
p,
ul {
    margin: 0;
}

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

.site-shell {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 900px;
    margin: 0 auto;
    padding: 0 1rem;
}

.stack-md {
    margin-bottom: 1rem;
}

.stack-lg {
    margin-bottom: 2rem;
}

.stack-xl {
    margin-bottom: 3rem;
}

.mt-lg {
    margin-top: 1.5rem;
}

.text-center-block {
    text-align: center;
}

.font-picker {
    position: sticky;
    top: 0.75rem;
    z-index: 20;
    display: none;
    grid-template-columns: 1fr;
    gap: 0.75rem;
    margin: 0.75rem auto 0;
    padding: 0.75rem;
    border: 1px solid rgba(201, 165, 92, 0.55);
    background: rgba(250, 246, 239, 0.9);
    box-shadow:
        3px 3px rgba(184, 52, 42, 0.12),
        0 12px 30px rgba(26, 21, 13, 0.12);
    backdrop-filter: blur(10px);
}

.font-picker__eyebrow {
    margin-bottom: 0.2rem;
    font-family: var(--font-middle);
    font-size: 0.75rem;
    font-weight: 700;
    letter-spacing: 0.16em;
    text-transform: uppercase;
    color: var(--color-primary);
}

.font-picker__details {
    font-size: 0.8rem;
    line-height: 1.4;
    color: var(--color-text-light);
}

.font-picker__controls {
    display: grid;
    grid-template-columns: auto minmax(0, 1fr) auto;
    gap: 0.4rem;
}

.font-picker__button,
.font-picker__select {
    min-height: 2.25rem;
    border: 1px solid rgba(201, 165, 92, 0.7);
    border-radius: 0;
    background: var(--washi-cream);
    color: var(--color-text-dark);
    font-family: var(--font-body);
    font-size: 0.85rem;
}

.font-picker__button {
    width: 2.25rem;
    cursor: pointer;
    font-size: 1.3rem;
    line-height: 1;
}

.font-picker__select {
    width: 100%;
    padding: 0 0.5rem;
}

.font-picker__button:hover,
.font-picker__select:hover {
    border-color: var(--color-primary);
}

.bleed-wrap {
    position: relative;
    left: 50%;
    width: 100vw;
    max-width: 100vw;
    transform: translateX(-50%);
}

.hero {
    margin-bottom: 1rem;
    padding: 2rem 0 1rem;
    text-align: center;
}

.hero__kanji {
    margin-bottom: 0.5rem;
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.3rem;
    color: var(--color-primary);
}

.hero__title {
    margin: 0.5rem 0;
    font-family: var(--font-heading);
    font-size: 2.5rem;
    font-weight: 600;
    white-space: nowrap;
    letter-spacing: 0.05em;
    color: var(--color-text-dark);
    text-shadow: 1px 1px 0 rgba(201, 165, 92, 0.3);
}

.hero__ampersand {
    font-size: 1.4rem;
    color: var(--washi-gold);
}

.ampersand {
    font-size: inherit;
}

.hero__subtitle {
    margin-top: 1rem;
    font-family: var(--font-middle);
    font-size: 1.1rem;
    letter-spacing: 0.1rem;
    color: var(--color-text-light);
}

.hero__date {
    margin-bottom: 2rem;
    padding: 0 1rem;
    font-size: 1.1rem;
    white-space: nowrap;
    letter-spacing: 0.025em;
    color: var(--color-text-light);
}

.hero__cat-wrap {
    width: 320px;
    margin: 0 auto;
}

.hero__cat-image {
    width: 100%;
    aspect-ratio: 1 / 1;
    object-fit: cover;
    object-position: center 45%;
}

.hero__message-wrap {
    max-width: 500px;
    margin: 0 auto;
    padding: 0 1rem;
}

.hero__message {
    font-size: 1.1rem;
    line-height: 1.625;
    text-align: center;
    color: var(--color-text);
}

.card {
    position: relative;
    border: 1px solid var(--washi-gold);
    border-radius: 1.5rem;
    overflow: hidden;
    background: linear-gradient(180deg, #faf6ef, #f5efe6);
    box-shadow:
        inset 0 0 60px rgba(201, 165, 92, 0.1),
        4px 4px rgba(184, 52, 42, 0.1),
        8px 8px 20px rgba(26, 21, 13, 0.12);
}

.card--section {
    margin-bottom: 2rem;
    padding: 1.5rem;
}

.card--rsvp::before,
.info-section::before {
    display: none;
}

.section-title {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    margin-bottom: 1rem;
    padding-bottom: 0.5rem;
    font-family: var(--font-middle);
    font-size: 1.5rem;
    font-weight: 600;
    color: var(--color-text-dark);
}

.section-title::after {
    content: "";
    position: absolute;
    left: 0;
    bottom: 0;
    width: 100%;
    height: 3px;
    border-radius: 2px;
    background: linear-gradient(90deg, var(--color-primary), var(--washi-gold));
}

.section-subtitle {
    margin-top: 1.5rem;
    margin-bottom: 0.75rem;
    font-size: 1.2rem;
    font-weight: 600;
    color: var(--color-primary);
}

.section-intro {
    font-size: 1rem;
    line-height: 1.625;
}

.info-list {
    margin-bottom: 1.5rem;
    padding-left: 0;
    list-style: none;
    font-size: 0.95rem;
    line-height: 1.625;
}

.info-list li + li {
    margin-top: 0.5rem;
}

.panel {
    position: relative;
}

.panel--soft {
    border-radius: 0;
    background: linear-gradient(135deg, #faf6ef, #f5efe6);
    box-shadow:
        inset 0 0 30px rgba(201, 165, 92, 0.08),
        2px 2px 8px rgba(26, 21, 13, 0.08);
}

.panel--soft::before {
    content: "";
    position: absolute;
    inset: -1px;
    border: 1px solid rgba(201, 165, 92, 0.3);
    pointer-events: none;
}

.place-panel {
    margin-top: 1.5rem;
    margin-bottom: 1rem;
    padding: 1rem;
    backdrop-filter: blur(4px);
}

.place-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1rem;
}

.place-img-wrapper {
    width: 280px;
    height: 100px;
    overflow: hidden;
    border-radius: 0.5rem;
}

.text-line {
    font-size: 0.95rem;
    line-height: 1.625;
    color: var(--color-text);
}

.text-line--lead {
    margin-bottom: 0.5rem;
    font-size: 1rem;
}

.text-dark {
    color: var(--color-text-dark);
}

.timeline {
    position: relative;
    margin: 1.5rem 0;
}

.timeline-item {
    position: relative;
    display: grid;
    grid-template-columns: 70px 40px 1fr;
    align-items: start;
    gap: 0.75rem;
    margin-bottom: 1rem;
    opacity: 0;
    animation: slideInTimeline 0.6s ease forwards;
}

.timeline-item:nth-child(1) {
    animation-delay: 0.1s;
}

.timeline-item:nth-child(2) {
    animation-delay: 0.2s;
}

.timeline-item:nth-child(3) {
    animation-delay: 0.3s;
}

.timeline-item:nth-child(4) {
    animation-delay: 0.4s;
}

.timeline-item:nth-child(5) {
    animation-delay: 0.5s;
}

.timeline-item::before {
    content: "";
    position: absolute;
    left: 92.5px;
    top: 38px;
    width: 1px;
    height: calc(100% + 1rem);
    background: linear-gradient(
        180deg,
        var(--color-primary),
        var(--washi-gold)
    );
}

.timeline-item-last::before {
    display: none;
}

.timeline-time {
    padding-top: 0.25rem;
    text-align: right;
    font-family: var(--font-body);
    font-size: 1rem;
    font-weight: 700;
    letter-spacing: 0.025em;
    color: var(--color-primary);
}

.timeline-time__extra {
    display: block;
    margin-top: 0.125rem;
    font-size: 0.85em;
    opacity: 0.7;
}

.timeline-icon {
    position: relative;
    z-index: 2;
    display: flex;
    width: 40px;
    height: 40px;
    align-items: center;
    justify-content: center;
    border: 2px solid var(--color-primary);
    border-radius: 9999px;
    background: linear-gradient(135deg, #faf6ef, #f5efe6);
    font-size: 1.2rem;
    box-shadow: 2px 2px var(--washi-gold);
}

.timeline-content {
    padding: 0.75rem 1rem;
    backdrop-filter: blur(4px);
}

.timeline-content__title {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text-dark);
}

.timeline-content__note {
    margin-top: 0.375rem;
    font-size: 0.85rem;
    font-style: italic;
    line-height: 1.625;
    color: var(--color-text-light);
}

.gift-grid {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    gap: 1rem;
}

.gift-text {
    border-left: none;
    padding-left: 0;
}

.gift-text__body {
    margin-bottom: 0.75rem;
}

.gift-text__body--last {
    margin-bottom: 0;
}

.qr-code-clickable {
    background: var(--qr-bg);
    color: var(--qr-ink);
    border: 3px solid var(--color-text-dark);
    border-radius: 0;
    box-shadow: 3px 3px var(--washi-gold);
    outline: none;
    cursor: pointer;
    transition:
        transform 0.15s ease,
        box-shadow 0.15s ease;
}

.qr-code-clickable:hover {
    transform: scale(1.05);
    box-shadow: 0 8px 30px rgba(196, 30, 58, 0.25);
}

.gift-qr {
    display: flex;
    flex-shrink: 0;
    width: 200px;
    height: 200px;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.qr-wrapper {
    position: relative;
}

.qr-svg,
.qr-svg svg,
.qr-svg img,
.gift-qr__svg,
.lightbox__qr {
    width: 100%;
    height: 100%;
}

.qr-svg .qr-bg {
    fill: var(--qr-bg);
}

.qr-svg .qr-ink {
    fill: var(--qr-ink);
}

.contact-grid {
    display: flex;
    flex-wrap: wrap;
    justify-content: center;
    gap: 1rem 2rem;
    text-align: center;
}

.contact-card {
    min-width: 140px;
}

.contact-name {
    margin-bottom: 0.125rem;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text-dark);
}

.contact-phone {
    font-size: 0.9rem;
    color: var(--color-primary);
}

.contact-ps {
    margin: 0;
    padding-top: 2rem;
    font-style: italic;
    line-height: 1.5;
    color: var(--color-text-light);
}

.decor-cat {
    position: absolute;
    top: 0;
    right: 0;
    z-index: 2;
    width: min(36vw, 320px);
    height: min(96vh, 1200px);
    pointer-events: none;
}

.decor-cat__image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    object-position: right;
    filter: drop-shadow(0 2px 8px rgba(0, 0, 0, 0.08));
}

.rsvp-form {
    display: flex;
    flex-direction: column;
    gap: 1.25rem;
    margin-top: 1.5rem;
}

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

.form-label {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--color-text);
}

.form-help {
    font-size: 0.75rem;
    color: #7b7469;
}

.form-control {
    padding: 0.75rem 1rem;
    border: 1px solid var(--washi-gold);
    border-radius: 0;
    background: #faf6ef;
    font-size: 0.95rem;
    color: var(--color-text);
    box-shadow: inset 2px 2px 4px rgba(26, 21, 13, 0.05);
    transition:
        box-shadow 0.15s ease,
        border-color 0.15s ease,
        background-color 0.15s ease;
}

.form-control:focus {
    outline: none;
    background: #fff;
    border-color: var(--color-primary);
    box-shadow:
        inset 2px 2px 4px rgba(26, 21, 13, 0.05),
        0 0 0 2px rgba(184, 52, 42, 0.2);
}

.form-options {
    display: flex;
    flex-direction: column;
    gap: 0.5rem;
    margin-top: 0.5rem;
}

.option-card {
    display: flex;
    align-items: flex-start;
    gap: 0.5rem;
    padding: 0.625rem;
    border: 1px solid rgba(201, 165, 92, 0.4);
    border-radius: 0;
    background: #faf6ef;
    cursor: pointer;
}

.option-card:hover {
    border-color: var(--color-primary);
    background: var(--color-bg-light);
}

.option-card__radio {
    width: 1.25rem;
    height: 1.25rem;
    margin-top: 0.25rem;
    flex-shrink: 0;
    cursor: pointer;
    accent-color: var(--color-primary);
}

.option-card__text {
    font-size: 0.9rem;
    line-height: 1.5;
}

.drink-poll {
    display: grid;
    gap: 0.5rem;
}

.drink-poll__item {
    display: flex;
    align-items: center;
    gap: 0.5rem;
}

.drink-poll__input {
    width: 5rem;
    text-align: center;
}

.text-underline {
    text-decoration: underline;
}

.resize-none {
    resize: none;
}

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

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

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    border: none;
    text-decoration: none;
    cursor: pointer;
    font-weight: 500;
}

.btn--primary {
    padding: 0.375rem 0.75rem;
    border-radius: 0.5rem;
    background: var(--color-primary);
    color: #fff;
    font-size: 0.85rem;
    transition: background-color 0.15s ease;
}

.btn--primary:hover {
    background: var(--color-primary-dark);
}

.rsvp-deadline-note {
    margin-bottom: 0.5rem;
    font-size: 0.9rem;
    font-weight: 400;
    color: #888;
}

.btn--submit {
    align-self: flex-start;
    margin-top: 1.5rem;
    border-radius: 9999px;
}

.btn--submit:disabled {
    cursor: not-allowed;
    background: #d1d5db;
}

.btn-reset {
    border: none;
    background: transparent;
    padding: 0;
}

.lightbox {
    position: fixed;
    inset: 0;
    z-index: 10000;
    display: none;
    align-items: center;
    justify-content: center;
    background: rgba(0, 0, 0, 0.85);
    backdrop-filter: blur(16px);
}

.lightbox.active {
    display: flex;
    animation: fadeIn 0.3s ease;
}

.lightbox__inner {
    position: relative;
    max-width: 90vw;
    max-height: 90vh;
    animation: zoomIn 0.3s ease;
}

.lightbox__close {
    position: absolute;
    top: -50px;
    right: 0;
    display: flex;
    width: 2.5rem;
    height: 2.5rem;
    align-items: center;
    justify-content: center;
    border-radius: 9999px;
    background: #fff;
    color: var(--color-primary);
    font-size: 2rem;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

.lightbox__qr {
    width: 80vmin;
    height: 80vmin;
    max-width: 90vw;
    max-height: 90vh;
    border-radius: 0.75rem;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.lightbox__hint {
    position: absolute;
    left: 50%;
    bottom: -50px;
    transform: translateX(-50%);
    font-size: 0.875rem;
    text-align: center;
    color: #fff;
    opacity: 0.8;
}

.rsvp-success {
    display: none;
    padding: 1rem 0;
    text-align: center;
}

.rsvp-success__emoji {
    font-size: 3.5rem;
}

.rsvp-success__text {
    margin: 1rem 0;
    font-size: 1.2rem;
}

.site-footer {
    position: relative;
    padding: 3rem 0;
    text-align: center;
    color: #6b7280;
}

.site-footer::before {
    content: "";
    display: block;
    width: 200px;
    height: 1px;
    margin: 0 auto 2rem;
    background: linear-gradient(
        90deg,
        transparent,
        var(--washi-gold),
        var(--color-primary),
        var(--washi-gold),
        transparent
    );
}

.site-footer__emoji {
    margin-bottom: 1rem;
    font-size: 1.5rem;
    letter-spacing: 0.2rem;
}

.site-footer__poem {
    font-size: 0.95rem;
    font-style: italic;
    line-height: 2;
    color: var(--color-text-light);
}

.site-footer__copyright {
    margin-top: 1.5rem;
    font-size: 0.875rem;
}

.sakura {
    position: fixed;
    top: -10%;
    z-index: 0;
    font-size: 1.5rem;
    line-height: 2rem;
    opacity: 0.6;
    filter: sepia(30%) saturate(80%);
    animation: fall 10s linear infinite;
}

.sakura:nth-child(1) {
    left: 10%;
    animation-duration: 12s;
}
.sakura:nth-child(2) {
    left: 20%;
    animation-duration: 15s;
    animation-delay: 2s;
}
.sakura:nth-child(3) {
    left: 30%;
    animation-duration: 11s;
    animation-delay: 4s;
}
.sakura:nth-child(4) {
    left: 70%;
    animation-duration: 14s;
    animation-delay: 1s;
}
.sakura:nth-child(5) {
    left: 80%;
    animation-duration: 13s;
    animation-delay: 3s;
}
.sakura:nth-child(6) {
    left: 90%;
    animation-duration: 16s;
    animation-delay: 5s;
}
.sakura:nth-child(7) {
    left: 50%;
    animation-duration: 8s;
    animation-delay: 1s;
}
.sakura:nth-child(8) {
    left: 33%;
    animation-duration: 9s;
    animation-delay: 7s;
}
.sakura:nth-child(9) {
    left: 66%;
    animation-duration: 14s;
    animation-delay: 9s;
}
.sakura:nth-child(10) {
    left: 25%;
    animation-duration: 11s;
    animation-delay: 4s;
}
.sakura:nth-child(11) {
    left: 75%;
    animation-duration: 16s;
    animation-delay: 6s;
}

.emitted-heart {
    position: fixed;
    z-index: 1000;
    pointer-events: none;
    font-size: 1.5rem;
    line-height: 2rem;
    animation: emit 1.8s ease-out forwards;
}

img.emoji {
    display: inline-block !important;
    width: 1em !important;
    height: 1em !important;
    max-width: 1em !important;
    max-height: 1em !important;
    margin: 0 0.05em 0 0.1em;
    vertical-align: -0.1em;
    object-fit: contain;
}

.sakura img.emoji,
.emitted-heart img.emoji {
    width: 1.5rem !important;
    height: 1.5rem !important;
    max-width: 1.5rem !important;
    max-height: 1.5rem !important;
}

@keyframes fall {
    0% {
        top: -10%;
        transform: rotate(0deg) translate(0);
    }

    100% {
        top: 110%;
        transform: rotate(360deg) translate(50px);
    }
}

@keyframes celebrate {
    0%,
    100% {
        transform: scale(1) rotate(0deg);
    }

    25% {
        transform: scale(1.1) rotate(-5deg);
    }

    75% {
        transform: scale(1.1) rotate(5deg);
    }
}

@keyframes emit {
    0% {
        opacity: 1;
        transform: scale(0.5) translateY(0);
    }

    100% {
        opacity: 0;
        transform: scale(1.2) translateY(-150px);
    }
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

@keyframes zoomIn {
    from {
        opacity: 0;
        transform: scale(0.8);
    }

    to {
        opacity: 1;
        transform: scale(1);
    }
}

@keyframes slideInTimeline {
    from {
        opacity: 0;
        transform: translate(-20px);
    }

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

@media (min-width: 640px) {
    .site-shell {
        padding: 0 2rem;
    }

    .hero__kanji {
        font-size: 1.2rem;
        letter-spacing: 0.5rem;
    }

    .hero__title {
        font-size: 3.5rem;
    }

    .hero__ampersand {
        font-size: 2rem;
    }

    .hero__subtitle {
        font-size: 1.3rem;
        letter-spacing: 0.2rem;
    }

    .hero__date {
        font-size: 1.3rem;
        letter-spacing: 0.05em;
    }

    .hero__cat-wrap {
        width: 400px;
    }

    .card--section {
        padding: 2.5rem;
    }

    .section-title {
        font-size: 1.8rem;
    }

    .section-subtitle {
        margin-top: 2rem;
        font-size: 1.3rem;
    }

    .section-intro {
        font-size: 1.1rem;
    }

    .info-list,
    .text-line,
    .timeline-content__title,
    .form-label,
    .option-card__text,
    .site-footer__poem {
        font-size: 1rem;
    }

    .place-panel {
        padding: 1.25rem 1.5rem;
    }

    .place-grid {
        gap: 1.5rem;
    }

    .place-img-wrapper {
        height: 120px;
    }

    .timeline-item {
        grid-template-columns: 80px 45px 1fr;
        gap: 1rem;
        margin-bottom: 1.25rem;
    }

    .timeline-item::before {
        left: 102.5px;
        height: calc(100% + 1.2rem);
    }

    .timeline-time {
        font-size: 1.1rem;
    }

    .timeline-icon {
        width: 45px;
        height: 45px;
        font-size: 1.4rem;
    }

    .timeline-content {
        padding: 0.875rem 1.25rem;
    }

    .timeline-content__note {
        font-size: 0.95rem;
    }

    .gift-grid {
        gap: 2rem;
    }

    .contact-grid {
        column-gap: 3rem;
    }

    .btn--primary {
        font-size: 0.9rem;
    }

    .form-control {
        padding: 1rem 1.25rem;
    }

    .form-options {
        gap: 0.75rem;
    }

    .option-card {
        gap: 0.75rem;
        padding: 0.75rem;
    }

    .site-footer__emoji {
        font-size: 1.8rem;
        letter-spacing: 0.3rem;
    }

    .site-footer__copyright {
        font-size: 1rem;
    }
}

@media (max-width: 640px) {
    .place-grid,
    .gift-grid {
        grid-template-columns: 1fr;
    }

    .gift-qr {
        width: 160px;
        height: 160px;
        margin: 0 auto;
    }

    .place-img-wrapper {
        width: 100%;
        max-width: 280px;
        margin: 0 auto;
    }

    .decor-cat {
        display: none;
    }
}
