:root {
    color-scheme: light;
    font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #f7f1e8;
    color: #241c18;
}

body {
    margin: 0;
    min-width: 320px;
}

#app {
    --theme-background: #f7f1e8;
    --theme-primary: #a34f35;
    --theme-text: #241c18;
    --theme-on-primary: #ffffff;
    box-sizing: border-box;
    min-height: 100svh;
    padding: max(1.5rem, env(safe-area-inset-top)) max(1.25rem, env(safe-area-inset-right)) max(1.5rem, env(safe-area-inset-bottom)) max(1.25rem, env(safe-area-inset-left));
}

.guest-page {
    align-items: center;
    background: var(--theme-background);
    box-sizing: border-box;
    display: flex;
    justify-content: center;
    min-height: calc(100svh - 3rem);
}

.guest-card {
    box-sizing: border-box;
    max-width: 31rem;
    padding: clamp(2rem, 7vw, 3.75rem) clamp(1.5rem, 7vw, 3.5rem);
    text-align: center;
    width: 100%;
}

.monogram {
    align-items: center;
    border: 1px solid color-mix(in srgb, var(--theme-primary) 70%, transparent);
    border-radius: 50%;
    color: var(--theme-primary);
    display: inline-flex;
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.25rem;
    font-weight: 600;
    height: 4.5rem;
    justify-content: center;
    letter-spacing: 0.04em;
    margin-bottom: 1.75rem;
    width: 4.5rem;
}

.event-name,
.guest-title {
    color: var(--theme-text);
    font-family: Georgia, "Times New Roman", serif;
}

.event-name {
    font-size: clamp(2rem, 9vw, 3rem);
    font-weight: 500;
    line-height: 1.1;
    margin: 0;
}

.guest-title {
    font-size: clamp(1.65rem, 7vw, 2.25rem);
    font-weight: 500;
    line-height: 1.16;
    margin: 0;
}

.guest-subtitle,
.guest-copy,
.guest-note,
.phase-note {
    color: var(--theme-text);
    font-size: 1rem;
    line-height: 1.55;
}

.guest-subtitle {
    margin: 0.75rem auto 2rem;
    max-width: 22rem;
}

.guest-copy {
    margin: 1rem auto 2rem;
    max-width: 25rem;
}

.guest-actions {
    display: grid;
    grid-auto-rows: 1fr;
    gap: 0.75rem;
    margin: 0 auto;
    max-width: 25rem;
}

.guest-button {
    border: 1px solid var(--theme-primary);
    border-radius: 0.75rem;
    box-sizing: border-box;
    font: inherit;
    font-size: 1rem;
    font-weight: 650;
    min-height: 3.25rem;
    padding: 0.75rem 1rem;
}

.guest-button--primary {
    background: var(--theme-primary);
    color: var(--theme-on-primary);
}

.guest-button--secondary {
    background: transparent;
    color: var(--theme-text);
}

.guest-button:disabled {
    cursor: not-allowed;
    opacity: 0.62;
}

.guest-note {
    margin: 1.5rem auto 0;
    max-width: 22rem;
}

.consent-note,
.phase-note {
    color: color-mix(in srgb, var(--theme-text) 76%, var(--theme-background));
    font-size: 0.875rem;
    margin: 1rem auto 0;
    max-width: 25rem;
}

.guest-button--retry {
    margin-top: 0.5rem;
}

.guest-button--link {
    background: transparent;
    border-color: transparent;
    color: var(--theme-text);
    text-decoration: underline;
}

.guest-preview {
    align-items: center;
    display: flex;
    height: min(38svh, 22rem);
    justify-content: center;
    margin: 1.25rem auto 1.5rem;
    width: 100%;
}

.guest-preview img {
    max-height: 100%;
    max-width: 100%;
    object-fit: contain;
}

.moment-selector {
    border: 0;
    margin: 0 auto 1.5rem;
    max-width: 25rem;
    padding: 0;
    text-align: left;
}

.moment-selector__title {
    color: var(--theme-text);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.35rem;
    font-weight: 500;
    line-height: 1.2;
    padding: 0;
    text-align: center;
    width: 100%;
}

.moment-selector__help {
    color: color-mix(in srgb, var(--theme-text) 72%, var(--theme-background));
    font-size: 0.875rem;
    line-height: 1.45;
    margin: 0.4rem 0 0.9rem;
    text-align: center;
}

.moment-options {
    display: grid;
    gap: 0.6rem;
}

.moment-option {
    align-items: center;
    background: color-mix(in srgb, var(--theme-background) 88%, white);
    border: 1px solid color-mix(in srgb, var(--theme-text) 18%, transparent);
    border-radius: 0.85rem;
    box-sizing: border-box;
    cursor: pointer;
    display: flex;
    gap: 0.75rem;
    min-height: 4rem;
    padding: 0.7rem 0.85rem;
    transition: border-color 180ms ease, box-shadow 180ms ease, transform 180ms ease;
}

.moment-option:hover {
    border-color: color-mix(in srgb, var(--theme-primary) 58%, transparent);
}

.moment-option:has(input:focus-visible) {
    outline: 3px solid #245c7a;
    outline-offset: 3px;
}

.moment-option--selected {
    border-color: var(--theme-primary);
    box-shadow: 0 0 0 1px var(--theme-primary), 0 0.6rem 1.5rem color-mix(in srgb, var(--theme-primary) 12%, transparent);
    transform: translateY(-1px);
}

.moment-option__copy {
    display: grid;
    flex: 1;
    gap: 0.15rem;
    min-width: 0;
}

.moment-option__hashtag {
    color: var(--theme-primary);
    font-family: Georgia, "Times New Roman", serif;
    font-size: 1.1rem;
    font-weight: 600;
}

.moment-option__description {
    color: color-mix(in srgb, var(--theme-text) 76%, var(--theme-background));
    font-size: 0.78rem;
    line-height: 1.35;
}

.moment-option__current {
    background: color-mix(in srgb, var(--theme-primary) 12%, var(--theme-background));
    border-radius: 999px;
    color: var(--theme-primary);
    flex: none;
    font-size: 0.68rem;
    font-weight: 750;
    letter-spacing: 0.08em;
    padding: 0.35rem 0.5rem;
    text-transform: uppercase;
}

.upload-progress {
    accent-color: var(--theme-primary);
    height: 0.75rem;
    margin: 1.25rem 0 0;
    width: 100%;
}

.upload-progress--indeterminate {
    animation: progress-pulse 1.2s ease-in-out infinite;
}

@keyframes progress-pulse {
    50% { opacity: 0.45; }
}

.sr-only {
    clip: rect(0, 0, 0, 0);
    clip-path: inset(50%);
    height: 1px;
    overflow: hidden;
    position: absolute;
    white-space: nowrap;
    width: 1px;
}

.guest-button:focus-visible {
    outline: 3px solid #245c7a;
    outline-offset: 3px;
}

@media (orientation: landscape) and (max-height: 540px) {
    #app {
        padding-bottom: 1rem;
        padding-top: 1rem;
    }

    .guest-card {
        padding-bottom: 1.5rem;
        padding-top: 1.5rem;
    }

    .monogram {
        margin-bottom: 0.75rem;
    }

    .guest-subtitle {
        margin-bottom: 1rem;
    }

    .guest-preview {
        height: min(32svh, 14rem);
    }
}

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        scroll-behavior: auto !important;
        transition-duration: 0.01ms !important;
    }
}
