:root {
    color-scheme: light;
    --color-bg: #fbf6ec;
    --color-bg-soft: #f3ead8;
    --color-surface: #fffdf7;
    --color-surface-strong: #fff8e8;
    --color-primary: #173f33;
    --color-primary-soft: #2f6656;
    --color-accent: #b68a3c;
    --color-accent-soft: #ead8ac;
    --color-text: #243127;
    --color-muted: #66746b;
    --color-border: #e7dac3;
    --color-shadow: rgb(36 49 39 / 12%);
    --radius-card: 8px;
    --shadow-soft: 0 16px 42px var(--color-shadow);
    --shadow-light: 0 8px 26px rgb(36 49 39 / 8%);
}

* {
    box-sizing: border-box;
}

html {
    min-height: 100%;
    scroll-behavior: smooth;
}

body {
    min-width: 0;
    min-height: 100%;
    margin: 0;
    overflow-x: hidden;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    font-size: 16px;
    line-height: 1.65;
    color: var(--color-text);
    background:
        radial-gradient(circle at 50% -12rem, rgb(234 216 172 / 42%), transparent 26rem),
        linear-gradient(180deg, #fffaf0 0%, var(--color-bg) 42%, #f6edde 100%);
}

body.invitation-locked {
    overflow: hidden;
}

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

a {
    color: inherit;
}

button:focus-visible,
a:focus-visible,
main:focus-visible {
    outline: 3px solid rgb(182 138 60 / 58%);
    outline-offset: 4px;
}

.opening-cover {
    position: fixed;
    inset: 0;
    z-index: 20;
    display: grid;
    place-items: center;
    padding: 20px;
    overflow: hidden;
    background:
        linear-gradient(180deg, rgb(255 253 247 / 96%), rgb(246 237 220 / 97%)),
        radial-gradient(circle at 50% 16%, rgb(47 102 86 / 18%), transparent 22rem);
    transition: opacity 420ms ease, visibility 420ms ease, transform 420ms ease;
}

.opening-cover::before,
.opening-cover::after {
    position: absolute;
    content: "";
    pointer-events: none;
}

.opening-cover::before {
    inset: 14px;
    border: 1px solid rgb(182 138 60 / 24%);
    border-radius: 999px 999px 32px 32px;
}

.opening-cover::after {
    width: 230px;
    height: 230px;
    right: -90px;
    bottom: -80px;
    border: 1px solid rgb(23 63 51 / 12%);
    border-radius: 50%;
}

.invitation-opened .opening-cover {
    visibility: hidden;
    opacity: 0;
    transform: translateY(-18px);
    pointer-events: none;
}

.cover-ornament {
    position: absolute;
    width: min(82%, 330px);
    aspect-ratio: 1;
    border: 1px solid rgb(182 138 60 / 32%);
    border-radius: 50%;
    transform: rotate(18deg);
}

.cover-ornament::before,
.cover-ornament::after {
    position: absolute;
    inset: 22px;
    content: "";
    border: 1px solid rgb(23 63 51 / 15%);
    border-radius: 50%;
}

.cover-ornament::after {
    inset: 48px;
}

.cover-content {
    position: relative;
    width: min(100%, 430px);
    padding: 40px 20px;
    text-align: center;
}

.cover-label,
.cover-guest,
.cover-guest-name,
.cover-date {
    margin: 0;
}

.cover-label,
.eyebrow,
.profile-role,
.event-label {
    color: var(--color-accent);
    font-size: 0.78rem;
    font-weight: 800;
    letter-spacing: 0;
    text-transform: uppercase;
}

.cover-guest {
    margin-top: 14px;
    color: var(--color-muted);
}

.cover-guest-name {
    margin-top: 4px;
    color: var(--color-primary);
    font-weight: 800;
}

.cover-content h1,
.hero-inner h2,
.content-section h2 {
    color: var(--color-primary);
    font-family: Georgia, "Times New Roman", serif;
    font-weight: 500;
    letter-spacing: 0;
}

.cover-content h1,
.hero-inner h2 {
    margin: 22px 0 0;
    font-size: 2.85rem;
    line-height: 1.02;
}

.cover-date {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-top: 18px;
    padding: 8px 14px;
    border: 1px solid rgb(182 138 60 / 26%);
    border-radius: 999px;
    color: var(--color-primary);
    background: rgb(255 253 247 / 74%);
    font-weight: 800;
}

.primary-button,
.secondary-button,
.disabled-button,
.text-link {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 46px;
    border-radius: 999px;
    font-weight: 800;
    text-decoration: none;
}

.primary-button {
    margin-top: 28px;
    padding: 0 26px;
    border: 0;
    color: #fffdf7;
    background: var(--color-primary);
    box-shadow: 0 14px 26px rgb(23 63 51 / 24%);
    cursor: pointer;
}

.primary-button:hover {
    background: var(--color-primary-soft);
}

.page-shell {
    background: transparent;
}

.section-inner {
    width: min(100% - 32px, 1080px);
    margin: 0 auto;
}

.section-inner.narrow {
    width: min(100% - 32px, 720px);
}

.hero-section {
    min-height: 100svh;
    display: grid;
    align-items: center;
    padding: 76px 0 52px;
    text-align: center;
}

.hero-inner {
    position: relative;
    padding: 8px 0;
}

.hero-inner::before {
    display: block;
    width: 74px;
    height: 3px;
    margin: 0 auto 22px;
    content: "";
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
}

.hero-inner::after {
    display: block;
    width: 42px;
    height: 42px;
    margin: 22px auto 0;
    content: "";
    border: 1px solid rgb(182 138 60 / 30%);
    border-radius: 50%;
    box-shadow: inset 0 0 0 12px rgb(255 248 232 / 72%);
}

.eyebrow {
    margin: 0 0 12px;
}

.hero-subtitle {
    max-width: 720px;
    margin: 24px auto 0;
    color: #415248;
    font-size: 1rem;
}

.hero-date {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin: 24px 0 0;
    padding: 8px 14px;
    border: 1px solid rgb(23 63 51 / 14%);
    border-radius: 999px;
    color: var(--color-primary);
    background: rgb(255 253 247 / 70%);
    font-weight: 800;
}

.text-link {
    margin-top: 22px;
    color: var(--color-primary);
    text-decoration: underline;
    text-decoration-color: rgb(182 138 60 / 56%);
    text-underline-offset: 6px;
}

.content-section {
    padding: 58px 0;
}

.content-section h2 {
    margin: 0;
    font-size: 2rem;
    line-height: 1.16;
}

.countdown-section,
.event-section,
.story-section,
.rsvp-section,
.wish-section {
    background: rgb(255 253 247 / 70%);
    border-block: 1px solid rgb(231 218 195 / 66%);
}

.countdown-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 10px;
    margin-top: 28px;
}

.countdown-item {
    min-height: 104px;
    display: grid;
    place-items: center;
    padding: 18px 8px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    background:
        linear-gradient(180deg, rgb(255 253 247 / 94%), rgb(255 248 232 / 90%)),
        var(--color-surface);
    box-shadow: var(--shadow-light);
}

.countdown-item strong {
    color: var(--color-primary);
    font-size: 2.15rem;
    line-height: 1;
    font-variant-numeric: tabular-nums;
}

.countdown-item span {
    margin-top: 6px;
    color: var(--color-muted);
    font-size: 0.82rem;
    font-weight: 800;
    text-transform: uppercase;
}

.countdown-note {
    max-width: 620px;
    margin: 22px auto 0;
    color: var(--color-muted);
    text-align: center;
}

.couple-grid {
    display: grid;
    gap: 18px;
    margin-top: 28px;
}

.profile-card,
.event-card,
.gift-panel {
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    background: var(--color-surface);
    box-shadow: var(--shadow-soft);
}

.profile-card {
    position: relative;
    overflow: hidden;
    padding: 30px 22px;
    text-align: center;
}

.profile-card::before {
    position: absolute;
    inset: 0 0 auto;
    height: 4px;
    content: "";
    background: linear-gradient(90deg, transparent, var(--color-accent), transparent);
}

.profile-mark {
    width: 60px;
    height: 60px;
    display: grid;
    place-items: center;
    margin: 0 auto 16px;
    border: 1px solid var(--color-accent-soft);
    border-radius: 50%;
    color: var(--color-accent);
    background: var(--color-surface-strong);
    font-size: 1.55rem;
}

.profile-role,
.event-label {
    margin: 0;
}

.profile-card h3,
.event-card h3,
.story-list h3 {
    margin: 8px 0 0;
    color: var(--color-primary);
    font-size: 1.28rem;
    letter-spacing: 0;
}

.profile-card p:last-child,
.event-card p,
.story-list p,
.gift-panel p,
.prayer-section p {
    color: var(--color-muted);
}

.couple-divider {
    display: grid;
    place-items: center;
    width: 52px;
    height: 52px;
    margin: 0 auto;
    border-radius: 50%;
    color: #fffdf7;
    background: var(--color-primary);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.55rem;
    box-shadow: 0 10px 24px rgb(23 63 51 / 18%);
}

.event-grid {
    display: grid;
    gap: 16px;
    margin-top: 28px;
}

.event-card {
    position: relative;
    overflow: hidden;
    padding: 24px 20px;
}

.event-card::before {
    position: absolute;
    inset: 0 0 auto;
    height: 5px;
    content: "";
    background: var(--color-accent);
}

.event-card-1::before {
    background: #b68a3c;
}

.event-card-2::before {
    background: #173f33;
}

.event-card-3::before {
    background: #6f8d72;
}

.event-time {
    margin: 14px 0 0;
    color: var(--color-primary);
    font-weight: 800;
}

.event-place {
    margin: 8px 0 0;
}

.event-address {
    margin: 8px 0 0;
}

.event-notes {
    margin: 12px 0 0;
    padding-top: 12px;
    border-top: 1px solid rgb(231 218 195 / 78%);
    font-size: 0.94rem;
}

.secondary-button {
    min-width: 170px;
    margin-top: 18px;
    padding: 0 18px;
    border: 1px solid rgb(23 63 51 / 22%);
    color: var(--color-primary);
    background: #f7efdc;
}

.secondary-button:hover {
    color: #fffdf7;
    background: var(--color-primary);
}

.disabled-link {
    color: #7c7467;
    background: #eee5d1;
    cursor: not-allowed;
}

.disabled-link:hover {
    color: #7c7467;
    background: #eee5d1;
}

.gallery-grid {
    display: grid;
    gap: 14px;
    margin-top: 28px;
}

.rsvp-section {
    text-align: center;
}

.rsvp-card {
    display: grid;
    gap: 18px;
    margin-top: 28px;
    padding: 24px 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    background: var(--color-surface);
    box-shadow: var(--shadow-soft);
    text-align: left;
}

.rsvp-disabled {
    text-align: center;
}

.rsvp-disabled p {
    margin: 0;
    color: var(--color-muted);
}

.rsvp-options {
    display: grid;
    gap: 10px;
    margin: 0;
    padding: 0;
    border: 0;
}

.rsvp-options legend,
.form-field span {
    margin-bottom: 8px;
    color: var(--color-primary);
    font-weight: 800;
}

.rsvp-options label {
    display: grid;
    grid-template-columns: 20px 1fr;
    gap: 10px;
    align-items: start;
    padding: 12px;
    border: 1px solid rgb(231 218 195 / 84%);
    border-radius: var(--radius-card);
    background: #fffaf0;
}

.form-field {
    display: grid;
    gap: 8px;
}

.form-field select,
.form-field textarea {
    width: 100%;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    background: #fffdf7;
    color: var(--color-text);
    font: inherit;
}

.form-field select {
    min-height: 44px;
    padding: 0 12px;
}

.form-field textarea {
    resize: vertical;
    min-height: 112px;
    padding: 12px;
}

.form-field select:focus-visible,
.form-field textarea:focus-visible,
.rsvp-options input:focus-visible {
    outline: 3px solid rgb(182 138 60 / 58%);
    outline-offset: 3px;
}

.form-field select:disabled {
    color: #7c7467;
    background: #eee5d1;
}

.rsvp-submit {
    justify-self: start;
    margin-top: 0;
}

.rsvp-submit:disabled {
    opacity: 0.72;
    cursor: wait;
}

.rsvp-message {
    min-height: 1.5em;
    margin: 0;
    font-weight: 700;
}

.rsvp-message[data-state="success"] {
    color: #1f6b4e;
}

.rsvp-message[data-state="error"] {
    color: #9c3b30;
}

.wish-section {
    text-align: center;
}

.wish-card {
    display: grid;
    gap: 18px;
    margin-top: 28px;
    padding: 24px 20px;
    border: 1px solid var(--color-border);
    border-radius: var(--radius-card);
    background: var(--color-surface);
    box-shadow: var(--shadow-soft);
    text-align: left;
}

.wish-sender {
    margin: 0;
    color: var(--color-muted);
}

.wish-sender strong {
    color: var(--color-primary);
}

.wish-disabled {
    text-align: center;
}

.wish-disabled p {
    margin: 0;
    color: var(--color-muted);
}

.wish-submit {
    justify-self: start;
    margin-top: 0;
}

.wish-submit:disabled {
    opacity: 0.72;
    cursor: wait;
}

.wish-message {
    min-height: 1.5em;
    margin: 0;
    font-weight: 700;
}

.wish-message[data-state="success"] {
    color: #1f6b4e;
}

.wish-message[data-state="error"] {
    color: #9c3b30;
}

.wish-list {
    display: grid;
    gap: 12px;
    margin-top: 22px;
}

.wish-item,
.wish-empty {
    border: 1px solid rgb(231 218 195 / 84%);
    border-radius: var(--radius-card);
    background: #fffaf0;
    box-shadow: var(--shadow-light);
}

.wish-item {
    padding: 18px;
    text-align: left;
}

.wish-item strong {
    display: block;
    color: var(--color-primary);
}

.wish-item p {
    margin: 8px 0 0;
    color: var(--color-muted);
}

.wish-empty {
    margin: 0;
    padding: 18px;
    color: var(--color-muted);
}

.gallery-tile {
    min-height: 220px;
    display: grid;
    align-content: end;
    justify-items: start;
    padding: 20px;
    border: 1px solid rgb(182 138 60 / 24%);
    border-radius: var(--radius-card);
    color: #fffdf7;
    background:
        linear-gradient(135deg, rgb(23 63 51 / 78%), rgb(182 138 60 / 50%)),
        linear-gradient(180deg, #efe1c5, #fffaf1);
    box-shadow: var(--shadow-light);
}

.gallery-tile:nth-child(2) {
    background:
        linear-gradient(135deg, rgb(182 138 60 / 68%), rgb(47 102 86 / 74%)),
        linear-gradient(180deg, #f6edde, #dfd0b3);
}

.gallery-tile:nth-child(3) {
    background:
        linear-gradient(135deg, rgb(35 78 64 / 78%), rgb(234 216 172 / 72%)),
        linear-gradient(180deg, #fffdf7, #eee0c5);
}

.gallery-tile span {
    font-size: 1.1rem;
    font-weight: 800;
}

.gallery-tile small {
    display: block;
    margin-top: 6px;
    color: rgb(255 253 247 / 84%);
    font-size: 0.92rem;
}

.story-list {
    display: grid;
    gap: 18px;
    margin: 28px 0 0;
    padding: 0;
    list-style: none;
}

.story-list li {
    position: relative;
    display: grid;
    grid-template-columns: 50px 1fr;
    gap: 14px;
    align-items: start;
}

.story-list span {
    display: grid;
    place-items: center;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    color: #fffdf7;
    background: var(--color-primary);
    font-weight: 800;
    box-shadow: 0 8px 20px rgb(23 63 51 / 16%);
}

.story-list p {
    margin: 8px 0 0;
}

.prayer-section,
.gift-section {
    text-align: center;
}

.arabic-prayer {
    margin: 26px 0 18px;
    color: var(--color-primary);
    font-size: 1.42rem;
    line-height: 1.95;
}

.prayer-translation {
    max-width: 620px;
    margin: 0 auto 14px;
    font-style: italic;
}

.gift-panel {
    padding: 30px 22px;
}

.disabled-button {
    margin-top: 18px;
    padding: 0 18px;
    border: 1px solid var(--color-border);
    color: #7c7467;
    background: #eee5d1;
    cursor: not-allowed;
}

.site-footer {
    display: grid;
    gap: 4px;
    padding: 34px 20px 42px;
    color: #fffdf7;
    background:
        linear-gradient(180deg, var(--color-primary), #102d25);
    text-align: center;
}

.site-footer span {
    color: rgb(255 253 247 / 74%);
}

.site-footer p {
    max-width: 680px;
    margin: 8px auto 0;
    color: rgb(255 253 247 / 80%);
}

@media (min-width: 640px) {
    .section-inner,
    .section-inner.narrow {
        width: min(100% - 56px, 1080px);
    }

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

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

    .gallery-tile:first-child {
        grid-row: span 2;
        min-height: 454px;
    }

    .cover-content h1,
    .hero-inner h2 {
        font-size: 4rem;
    }

    .hero-subtitle {
        font-size: 1.12rem;
    }

    .content-section h2 {
        font-size: 2.58rem;
    }

    .countdown-item strong {
        font-size: 2.75rem;
    }

    .arabic-prayer {
        font-size: 1.72rem;
    }
}

@media (min-width: 768px) {
    .content-section {
        padding: 74px 0;
    }

    .couple-grid {
        grid-template-columns: 1fr 68px 1fr;
        align-items: center;
    }

    .couple-divider {
        width: 60px;
        height: 60px;
    }
}

@media (min-width: 1024px) {
    .event-grid {
        grid-template-columns: repeat(3, minmax(0, 1fr));
    }

    .gallery-grid {
        grid-template-columns: 1.2fr 1fr;
    }

    .cover-content h1,
    .hero-inner h2 {
        font-size: 5rem;
    }

    .content-section h2 {
        font-size: 3.05rem;
    }
}

@media (max-width: 380px) {
    body {
        font-size: 15px;
    }

    .section-inner,
    .section-inner.narrow {
        width: min(100% - 28px, 1080px);
    }

    .opening-cover {
        padding: 16px;
    }

    .cover-content {
        padding-inline: 8px;
    }

    .cover-content h1,
    .hero-inner h2 {
        font-size: 2.45rem;
    }

    .countdown-grid {
        gap: 8px;
    }

    .countdown-item {
        min-height: 96px;
    }
}
