:root {
    --paper: #fbf7f1;
    --ink: #433a35;
    --muted: #7c6e65;
    --rose: #a85d5d;
    --line: #dfd2c5;
    --white: #fff;
    --shadow: 0 18px 45px #513b2924;
    font-family: Georgia, "Noto Serif KR", "Noto Serif Khmer", serif;
    color: var(--ink);
    background: #e9e0d7
}

* {
    box-sizing: border-box
}

html {
    scroll-behavior: smooth
}

body {
    margin: 0;
    background: var(--paper)
}

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

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

main {
    max-width: 520px;
    margin: auto;
    background: var(--paper);
    min-height: 100vh;
    box-shadow: var(--shadow);
    overflow: hidden
}

.hero {
    height: min(82vh, 740px);
    position: relative;
    background: #d5cbc3
}

.hero picture,
.hero img {
    width: 100%;
    height: 100%;
    display: block
}

.heroLayer {
    position: absolute;
    inset: 0;
    opacity: 0;
    transition: opacity .5s ease-in-out;
    pointer-events: none
}

.heroLayer.active {
    opacity: 1
}

.hero img {
    object-fit: cover
}

.hero:after {
    content: "";
    position: absolute;
    inset: 45% 0 0;
    background: linear-gradient(transparent, #2f241fc7)
}

.heroText {
    position: absolute;
    z-index: 1;
    bottom: 3.5rem;
    color: white;
    text-align: center;
    width: 100%;
    padding: 1.5rem;
    text-shadow: 0 2px 12px #0008
}

.heroText h1 {
    font-size: clamp(2.3rem, 10vw, 3.7rem);
    font-weight: 400;
    margin: .5rem 0
}

.heroText p {
    letter-spacing: .16em
}

.langs {
    height: 56px;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 1.2rem;
    position: sticky;
    top: 0;
    background: #fbf7f1ee;
    backdrop-filter: blur(12px);
    z-index: 5;
    border-bottom: 1px solid #eadfd4
}

.langs a {
    color: var(--muted);
    text-decoration: none;
    font-family: system-ui, sans-serif;
    font-size: .85rem
}

.langs a.active {
    color: var(--rose);
    font-weight: 700
}

.section {
    text-align: center;
    padding: 5rem 1.5rem
}

.section+.section {
    border-top: 1px solid var(--line)
}

h2 {
    font-weight: 400;
    line-height: 1.35;
    font-size: 1.8rem;
    margin: .5rem 0 1.5rem
}

.section p {
    line-height: 1.9;
    color: var(--muted)
}

.kicker {
    font: 600 .75rem system-ui, sans-serif !important;
    letter-spacing: .2em;
    text-transform: uppercase;
    color: var(--rose) !important
}

.ornament {
    font-size: 1.6rem;
    color: var(--rose)
}

.detail {
    display: flex;
    flex-direction: column;
    gap: .45rem;
    margin: 1.7rem 0
}

.detail span {
    color: var(--muted)
}

button,
.outline {
    min-height: 46px;
    border-radius: 999px;
    padding: .7rem 1.35rem;
    cursor: pointer
}

.outline {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--line);
    background: transparent;
    color: var(--ink);
    text-decoration: none
}

.primary {
    border: 0;
    background: var(--rose);
    color: #fff;
    min-width: 180px
}

.gallery {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 5px;
    margin: 2rem -1rem 1.4rem
}

.tile {
    border: 0;
    padding: 0;
    border-radius: 2px;
    overflow: hidden;
    aspect-ratio: 3/4;
    background: #ddd;
    min-height: 0
}

.tile img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    transition: transform .4s
}

.tile:active img {
    transform: scale(.97)
}

.tile.hidden {
    display: none
}

.message {
    padding: 1.1rem;
    text-align: left;
    background: #fff;
    border: 1px solid #eadfd4;
    border-radius: 14px;
    margin: .7rem 0
}

.message b {
    display: block;
    margin-bottom: .35rem
}

.message p {
    margin: 0;
    white-space: pre-wrap;
    line-height: 1.55
}

.pending {
    font: 600 .7rem system-ui;
    color: #9a6b27;
    background: #fff2d8;
    padding: .25rem .55rem;
    border-radius: 99px;
    float: right
}

.empty {
    margin: 2rem 0 !important
}

.rsvp {
    background: #f2e7dd
}

.gift {
    background: #fbf7f1
}

.giftNotice {
    color: var(--muted);
    line-height: 1.7;
    text-align: center
}

.sheetContent {
    padding: 2rem 1.4rem calc(2rem + env(safe-area-inset-bottom));
    overflow: auto;
    max-height: 92vh
}

.sheetContent>.kicker,
.sheetContent>h2 {
    text-align: center
}

.bankAccounts {
    display: grid;
    gap: 1.25rem;
    margin-top: 1.5rem
}

.bankAccountGroup>h3 {
    margin: 0 0 .6rem;
    color: var(--rose);
    font-size: 1.05rem;
    text-align: left
}

.bankAccountList {
    display: grid;
    gap: .65rem
}

.bankAccount {
    padding: 1.1rem;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: #fff
}

.bankAccount h4 {
    margin: 0 0 .75rem;
    font-size: 1rem
}

.bankAccount p {
    margin: .3rem 0;
    color: var(--muted);
    font: .9rem system-ui, sans-serif
}

.bankAccount code {
    display: block;
    margin: .9rem 0;
    padding: .75rem;
    border-radius: 8px;
    background: var(--paper);
    color: var(--ink);
    font: 600 1rem/1.4 ui-monospace, monospace;
    word-break: break-all
}

.copyAccount {
    width: 100%
}

footer {
    text-align: center;
    padding: 4rem 1.5rem 6rem;
    background: #403833;
    color: white
}

footer p {
    line-height: 1.8
}

footer .outline {
    color: white;
    border-color: #ffffff55
}

.viewer {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    max-width: none;
    max-height: none;
    margin: 0;
    padding: 0;
    border: 0;
    background: #111;
    color: white
}

.viewer[open] {
    display: grid;
    place-items: center
}

.viewer::backdrop {
    background: #111
}

.viewer img {
    max-width: 100%;
    max-height: 100%;
    object-fit: contain;
    touch-action: pinch-zoom
}

.close,
.nav {
    position: absolute;
    z-index: 2;
    width: 48px;
    height: 48px;
    border: 0;
    border-radius: 50%;
    background: #0008;
    color: white;
    padding: 0;
    font: 300 2rem system-ui
}

.close {
    top: max(12px, env(safe-area-inset-top));
    right: 14px
}

.nav {
    top: 50%;
    transform: translateY(-50%)
}

.prev {
    left: 10px
}

.next {
    right: 10px
}

.count {
    position: absolute;
    bottom: max(18px, env(safe-area-inset-bottom));
    background: #0009;
    border-radius: 99px;
    padding: .5rem 1rem;
    font: 14px system-ui
}

.sheet {
    border: 0;
    border-radius: 24px 24px 0 0;
    padding: 0;
    width: min(520px, 100%);
    max-width: none;
    margin: auto auto 0;
    max-height: 92vh;
    background: var(--paper)
}

.sheet::backdrop {
    background: #1d1612a3
}

.sheet form {
    padding: 2rem 1.4rem calc(2rem + env(safe-area-inset-bottom));
    overflow: auto;
    max-height: 92vh
}

.sheet .close {
    color: var(--ink);
    background: transparent;
    top: 8px
}

.sheet label,
.sheet legend {
    display: block;
    text-align: left;
    font: 600 .85rem system-ui;
    margin: 1rem 0 .4rem
}

.sheet input,
.sheet textarea,
.sheet select {
    width: 100%;
    font-size: 16px;
    padding: .8rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    background: white;
    color: var(--ink)
}

.sheet textarea {
    min-height: 100px;
    resize: vertical
}

.sheet fieldset {
    border: 0;
    padding: 0;
    margin: 0
}

.choice {
    display: flex !important;
    margin: 0 !important;
    width: auto;
    position: relative
}

.attendanceChoices {
    display: grid;
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
    gap: .5rem;
    width: 100%
}

.choice input {
    position: absolute;
    opacity: 0
}

.choice span {
    width: 100%;
    padding: .8rem;
    border: 1px solid var(--line);
    border-radius: 10px;
    text-align: center
}

.choice input:checked+span {
    background: var(--rose);
    color: white;
    border-color: var(--rose)
}

.check {
    display: flex !important;
    align-items: center;
    gap: .6rem
}

.check input {
    width: 20px
}

.trap {
    position: absolute !important;
    left: -10000px
}

.formStatus {
    font: 14px system-ui;
    color: var(--rose)
}

:focus-visible {
    outline: 3px solid #d48b61;
    outline-offset: 3px
}

@media(max-width:350px) {
    .gallery {
        grid-template-columns: repeat(2, 1fr)
    }
}

@media(prefers-reduced-motion:reduce) {
    * {
        scroll-behavior: auto !important;
        transition: none !important
    }
}

body.locked {
    overflow: hidden
}

[data-t] {
  white-space: pre-line;
}
