:root {
    --ivory: #fbf6ea;
    --cream: #fffaf0;
    --porcelain: #fffdf8;
    --ink: #253129;
    --muted: #5d675d;
    --sage: #6f8771;
    --sage-deep: #2e4738;
    --gold: #b9944a;
    --gold-soft: #ead599;
    --line: rgba(185, 148, 74, 0.28);
    --shadow: 0 18px 48px rgba(58, 45, 24, 0.14);
    --serif: "Cormorant Garamond", Georgia, "Times New Roman", serif;
    --sans: "Inter", system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
}

body {
    min-width: 320px;
    margin: 0;
    color: var(--ink);
    background: var(--ivory) url("/assets/bg-accent.svg") top right / min(74vw, 560px) no-repeat;
    font-family: var(--sans);
    font-size: 16px;
    line-height: 1.55;
}

body::before {
    content: "";
    position: fixed;
    inset: 0;
    pointer-events: none;
    background:
        linear-gradient(180deg, rgba(255,255,255,0.68), rgba(255,255,255,0) 24rem),
        radial-gradient(circle at 10% 8%, rgba(111,135,113,0.12), transparent 18rem);
    z-index: -1;
}

a {
    color: inherit;
}

main,
footer {
    width: min(100%, 760px);
    margin: 0 auto;
    padding: 0 18px;
}

.hero-shell {
    display: grid;
    gap: 28px;
    padding: 32px 0 40px;
}

.hero-copy {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
}

.eyebrow {
    margin: 0 0 12px;
    color: var(--sage-deep);
    font-size: 0.78rem;
    font-weight: 600;
    letter-spacing: 0.12em;
    text-transform: uppercase;
}

.crest {
    width: 64px;
    height: 64px;
    margin-bottom: 10px;
}

h1,
h2,
.formal-invite,
.event-card strong {
    font-family: var(--serif);
}

h1 {
    max-width: 10ch;
    margin: 0;
    color: var(--sage-deep);
    font-size: clamp(3.5rem, 19vw, 6.2rem);
    font-weight: 700;
    line-height: 0.9;
}

.subtitle {
    max-width: 24rem;
    margin: 16px 0 18px;
    color: var(--muted);
    font-size: 1.05rem;
}

.event-card {
    display: grid;
    gap: 4px;
    width: min(100%, 360px);
    margin: 0 0 18px;
    padding: 16px 20px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 253, 248, 0.82);
    box-shadow: 0 10px 26px rgba(58, 45, 24, 0.08);
}

.event-card strong {
    color: var(--sage-deep);
    font-size: 1.75rem;
    line-height: 1;
}

.event-card span {
    color: var(--muted);
    font-weight: 600;
}

.event-card em {
    color: var(--gold);
    font-style: normal;
    font-weight: 800;
}

.button {
    display: inline-flex;
    min-height: 48px;
    align-items: center;
    justify-content: center;
    gap: 8px;
    padding: 12px 20px;
    border: 1px solid transparent;
    border-radius: 999px;
    font-family: var(--sans);
    font-size: 1rem;
    font-weight: 700;
    text-decoration: none;
    cursor: pointer;
}

.button-primary {
    color: #fffdf8;
    background: linear-gradient(135deg, var(--sage-deep), #47674f);
    box-shadow: 0 12px 26px rgba(46, 71, 56, 0.25);
}

.button-primary:disabled {
    cursor: wait;
    opacity: 0.72;
}

.button-secondary {
    color: var(--sage-deep);
    border-color: var(--line);
    background: var(--porcelain);
}

.hero-image-frame {
    position: relative;
    width: 100%;
    max-width: 560px;
    aspect-ratio: 3 / 4;
    justify-self: center;
    overflow: hidden;
    border: 1px solid rgba(185, 148, 74, 0.36);
    border-radius: 18px;
    background:
        linear-gradient(145deg, rgba(255,250,240,0.92), rgba(234,213,153,0.22)),
        repeating-linear-gradient(90deg, rgba(185,148,74,0.12) 0 1px, transparent 1px 22px);
    box-shadow: var(--shadow);
}

.hero-image-frame img {
    position: relative;
    z-index: 2;
    display: block;
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.hero-image-frame img.is-missing {
    display: none;
}

.image-fallback {
    position: absolute;
    inset: 0;
    display: grid;
    place-content: center;
    gap: 10px;
    padding: 30px;
    text-align: center;
}

.image-fallback span {
    color: var(--sage-deep);
    font-family: var(--serif);
    font-size: 2rem;
    font-weight: 700;
}

.image-fallback strong {
    color: var(--gold);
    font-family: var(--sans);
    font-size: 0.8rem;
    letter-spacing: 0.16em;
    text-transform: uppercase;
}

.formal-invite {
    margin: 0 0 34px;
    padding: 34px 20px;
    border-top: 1px solid var(--line);
    border-bottom: 1px solid var(--line);
    text-align: center;
}

.divider {
    width: min(82vw, 320px);
    height: auto;
    margin-bottom: 18px;
}

.formal-invite p {
    margin: 8px 0;
    color: var(--sage-deep);
    font-size: clamp(1.35rem, 7vw, 2.25rem);
    line-height: 1.1;
}

.formal-invite .formal-note {
    max-width: 34rem;
    margin: 14px auto 0;
    color: var(--muted);
    font-family: var(--sans);
    font-size: 1rem;
    font-weight: 600;
    line-height: 1.45;
}

.formal-invite .host,
.formal-invite span {
    color: var(--gold);
    font-size: clamp(2.1rem, 10vw, 3.4rem);
    font-weight: 700;
}

.rsvp-section {
    padding: 4px 0 38px;
}

.form-card,
.admin-login,
.table-card,
.admin-panel {
    border: 1px solid var(--line);
    border-radius: 8px;
    background: rgba(255, 253, 248, 0.94);
    box-shadow: 0 12px 34px rgba(58, 45, 24, 0.09);
}

.form-card {
    padding: 24px 18px;
}

.form-card h2,
.admin-wrap h1 {
    margin: 0 0 18px;
    color: var(--sage-deep);
    font-family: var(--serif);
    font-size: 2.6rem;
    line-height: 1;
}

.rsvp-form {
    display: grid;
    gap: 10px;
}

.rsvp-deadline {
    margin: 4px 0 0;
    color: var(--sage-deep);
    font-weight: 800;
}

label,
legend {
    color: var(--sage-deep);
    font-weight: 700;
}

input,
select,
textarea {
    width: 100%;
    min-height: 46px;
    padding: 11px 12px;
    border: 1px solid rgba(46, 71, 56, 0.22);
    border-radius: 8px;
    background: #fffefa;
    color: var(--ink);
    font: inherit;
}

textarea {
    resize: vertical;
}

input:focus,
select:focus,
textarea:focus {
    border-color: var(--gold);
    outline: 3px solid rgba(185, 148, 74, 0.18);
}

fieldset {
    display: grid;
    gap: 8px;
    margin: 6px 0;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 8px;
}

.radio-line {
    display: flex;
    min-height: 36px;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.radio-line input {
    width: 18px;
    min-height: 18px;
}

.honeypot {
    position: absolute;
    left: -10000px;
    width: 1px;
    height: 1px;
    overflow: hidden;
}

.notice {
    margin: 0 0 18px;
    padding: 14px 16px;
    border-radius: 8px;
    font-weight: 700;
}

.notice p {
    margin: 0;
}

.notice p + p {
    margin-top: 8px;
}

.success {
    border: 1px solid rgba(111, 135, 113, 0.35);
    background: rgba(111, 135, 113, 0.13);
    color: var(--sage-deep);
}

.error {
    border: 1px solid rgba(132, 61, 52, 0.28);
    background: rgba(132, 61, 52, 0.08);
    color: #74342d;
}

footer {
    padding-bottom: 36px;
    text-align: center;
}

footer p {
    margin: 0;
    color: var(--sage-deep);
    font-family: var(--serif);
    font-size: 1.5rem;
    font-weight: 700;
}

footer small {
    display: block;
    margin-top: 6px;
    color: var(--muted);
    font-size: 0.95rem;
}

.admin-page,
.orphaned-page {
    background: #f7f3e9;
}

.admin-wrap {
    width: min(100%, 1120px);
    padding: 24px 16px 44px;
}

.admin-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
    margin-bottom: 18px;
}

.admin-login {
    display: grid;
    gap: 10px;
    max-width: 420px;
    padding: 20px;
}

.summary-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(170px, 1fr));
    gap: 12px;
    margin: 0 0 16px;
}

.summary-card {
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 8px;
    background: var(--porcelain);
}

.summary-card span {
    display: block;
    color: var(--muted);
    font-weight: 700;
}

.summary-card strong {
    display: block;
    margin-top: 4px;
    color: var(--sage-deep);
    font-family: var(--serif);
    font-size: 2.5rem;
    line-height: 1;
}

.admin-panels {
    display: grid;
    gap: 12px;
    margin-bottom: 16px;
}

.admin-panel {
    padding: 16px;
}

.admin-panel h2,
.table-card h2 {
    margin: 0 0 12px;
    color: var(--sage-deep);
    font-family: var(--serif);
    font-size: 1.8rem;
}

.admin-panel p {
    display: flex;
    justify-content: space-between;
    gap: 12px;
    margin: 8px 0;
}

.admin-actions {
    margin: 0 0 16px;
}

.table-card {
    padding: 14px;
}

.table-scroll {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
    font-size: 0.92rem;
}

th,
td {
    padding: 10px;
    border-bottom: 1px solid rgba(46, 71, 56, 0.12);
    text-align: left;
    vertical-align: top;
}

th {
    color: var(--sage-deep);
    background: rgba(111, 135, 113, 0.1);
    font-weight: 800;
}

.text-button {
    padding: 0;
    border: 0;
    background: transparent;
    color: #74342d;
    font: inherit;
    font-weight: 700;
    cursor: pointer;
}

@media (min-width: 760px) {
    main,
    footer {
        padding-right: 24px;
        padding-left: 24px;
    }

    .hero-shell {
        grid-template-columns: 0.95fr 1.05fr;
        align-items: center;
        width: min(100vw - 48px, 1120px);
        margin-left: 50%;
        padding-top: 54px;
        transform: translateX(-50%);
    }

    .hero-copy {
        align-items: flex-start;
        text-align: left;
    }

    .crest {
        width: 80px;
        height: 80px;
    }

    h1 {
        font-size: clamp(5rem, 9vw, 7.4rem);
    }

    .form-card {
        padding: 34px;
    }

    .admin-panels {
        grid-template-columns: 1fr 1fr;
    }
}
