/* ═══ ONE MINUTE INVITES — card.css ═══
   The invitation's calibrated styles. Carried over from the licensed
   renderer verbatim on Oct 11 2026; this is the pixel reference. Change
   with intent and re-run the contract check. */
/* ============================================
   ONE MINUTE INVITES
   ============================================ */

/* ========================================
   RESET & BASE STYLES
   ======================================== */

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

input {
    -webkit-appearance: none;
    appearance: none;
    border-style: solid;
}

html {
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    text-rendering: optimizeLegibility;
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
    overflow-y: scroll;
    scrollbar-width: none;
    -ms-overflow-style: none;
}

html::-webkit-scrollbar {
    display: none;
}

body {
    font-family: var(--body-font);
    font-optical-sizing: auto;
    font-variant-numeric: oldstyle-nums;
    font-variant-ligatures: common-ligatures;
    font-kerning: normal;
    background-color: var(--boot-bg, #4e4b47);
    color: var(--ink-color);
    line-height: 1.6;
    scrollbar-width: none;
    -ms-overflow-style: none;
    min-height: 100vh;
    overflow-y: hidden;
    overflow-x: clip;
    padding: 0;
    -webkit-overflow-scrolling: touch;
}

body::-webkit-scrollbar {
    display: none;
}

/* Global link underline consistency */
a {
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

/* ========================================
   CSS CUSTOM PROPERTIES (THEME SYSTEM)
   ======================================== */

:root {
    --theme-paper: #fafafa;
    --ink-color: #2a2a2a;

    /* The first-paint color (page, loading screen, bg layer, notch strips) is the
       CSS variable --boot-bg, but it is intentionally NOT given a value here.
       invite.php sets it server-side to the invite's theme color, and every use
       site carries its own fallback: var(--boot-bg, #4e4b47). Defining a default
       in :root would lose to invite.php's value or vice-versa depending on source
       order, so the fallback lives at the use site instead. If you see #4e4b47 on
       a real invite, invite.php is not setting the variable (check its marker). */

    /* Header font */
    --header-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --header-font-weight: 400;
    --header-font-style: normal;
    /* Optical sizing for the title. Defaults to auto (correct for Fraunces,
       Inter, Newsreader, etc.). Set to 'none' per-font for variable display
       faces whose hairlines thin to near-invisibility at large opsz —
       notably Bodoni Moda, where auto opsz at display sizes made the title
       vanish during the fade. */
    --header-optical-sizing: auto;
    /* Explicit opsz pin for variable faces where `optical-sizing: none` isn't
       enough cross-browser (Safari resolves the default opsz to a thin display
       cut). `normal` = no override; set per-font in applyFonts(). */
    --header-font-variation: normal;
    /* Smoothing mode for the title/subtitle. Default 'antialiased' keeps the
       rendering stable across the slide-up. But antialiased renders strokes
       lighter, which makes high-contrast hairline faces (e.g. Boska) lose
       their thin strokes. Set to 'auto' per-font for those faces so the
       hairlines render at full sub-pixel weight. */
    --header-font-smoothing: antialiased;
    /* Piecewise clamp: --*-small interpolates 380→440, --*-large interpolates 440→1024.
       Media query at 440px swaps which one --header-font-size resolves to.
       --*-mobile-px / --*-desktop-px are raw numerics for fitTitle's webview cap. */
    --header-font-size-small: clamp(36px, 36px + 0vw, 36px);
    --header-font-size-large: clamp(36px, 30.6px + 1.3699vw, 44px);
    --header-font-size: var(--header-font-size-small);
    --header-font-size-mobile-px: 36;
    --header-font-size-desktop-px: 44;
    --header-sub-size-small: clamp(24px, 24px + 0vw, 24px);
    --header-sub-size-large: clamp(24px, 19.9521px + 1.0274vw, 30px);
    --header-sub-size: var(--header-sub-size-small);
    --header-sub-size-mobile-px: 24;
    --header-sub-size-desktop-px: 30;
    --header-font-letter-spacing: normal;
    --header-label-size-small: clamp(20px, 20px + 0vw, 20px);
    --header-label-size-large: clamp(20px, 18.6507px + 0.3425vw, 22px);
    --header-label-size: var(--header-label-size-small);
    --header-label-size-mobile-px: 20;
    --header-label-size-desktop-px: 22;

    /* Body font — generous readable floor: 20px mobile / 22px desktop */
    --body-font: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --body-font-weight: 400;
    --body-font-style: normal;
    --body-font-size-small: clamp(20px, 20px + 0vw, 20px);
    --body-font-size-large: clamp(20px, 18.6507px + 0.3425vw, 22px);
    --body-font-size: var(--body-font-size-small);
    --body-font-size-mobile-px: 20;
    --body-font-size-desktop-px: 22;
    --body-font-letter-spacing: normal;

    /* ── Subtitle font (defaults to header font, falls back to body when overridden) ── */
    --subtitle-font: var(--header-font);
    --subtitle-font-weight: var(--header-font-weight);
    --subtitle-font-style: var(--header-font-style);
    --subtitle-letter-spacing: var(--header-font-letter-spacing);

    /* ── Label font (defaults to header font; per-theme can route to body) ── */
    --label-font: var(--header-font);
    --label-font-weight: var(--header-font-weight);
    --label-font-style: var(--header-font-style);
    --label-letter-spacing: var(--header-font-letter-spacing);
    --label-text-transform: none;

    /* Dividers are soft ink, not a fourth color — the invite is strictly
       theme + paper + ink, on every scheme. */
    --color-border: color-mix(in srgb, var(--ink-color) 22%, transparent);
    --color-error: #c0392b;
    --color-hover: rgba(0, 0, 0, 0.3);
    --ease-out: cubic-bezier(0.4, 0, 0.2, 1);

    /* Section vertical padding — same piecewise clamp pattern as the font sizes.
       --section-padding-small interpolates 380→440 (68px → 77px, unchanged from prior design).
       --section-padding-large interpolates 440→1024 (77px → 88px) — gentler ramp so desktop
       doesn't stretch out to 120px. Media query at 440px swaps which one is active. */
    --section-padding-small: clamp(68px, 10vw + 33px, 77px);
    --section-padding-large: clamp(77px, 68.71px + 1.8836vw, 88px);
    --section-padding: var(--section-padding-small);
}

/* ========================================
   LOADING SCREEN
   ======================================== */

.loading-screen {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: transparent;
    /* opacity < 1 makes Safari 26 skip this fixed element when choosing the
       toolbar/notch tint (documented behavior), forcing it to sample the <body>
       instead. 0.999 is visually identical to 1. This is what makes the notch
       color deterministic instead of "right on some refreshes." */
    opacity: 0.999;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    z-index: 9999;
}

.loading-bg-fill {
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 680px;
    height: 100vh;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
    z-index: 1;
    opacity: 0;
}

#mainContent {
    position: relative;
    z-index: 1;
}

#bgLayer {
    position: fixed;
    inset: 0;
    background-color: transparent;
    /* Same as the loading screen: opacity < 1 keeps Safari from sampling this
       fixed layer for the notch tint. The photo is on ::after (never sampled
       anyway), and the solid color comes from <body>. */
    opacity: 0.999;
    z-index: 0;
    pointer-events: none;
}


#bgLayer::after {
    content: '';
    position: fixed;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 100%;
    max-width: 680px;
    height: 100vh;
    background-size: cover;
    background-position: center center;
    background-repeat: no-repeat;
}

.loading-screen.hidden {
    opacity: 0;
    pointer-events: none;
    visibility: hidden;
    transition: opacity 0.2s ease-out, visibility 0s linear 0.2s;
}

/* ========================================
   ERROR CONTAINER
   ======================================== */

.error-container {
    max-width: 520px;
    margin: 40px auto;
    background: var(--theme-paper);
    border-radius: 0;
    overflow: hidden;
    box-shadow: 8px 8px 16px rgba(0, 0, 0, 0.12);
    animation: fadeInUp 0.5s var(--ease-out);
}

.error-section {
    padding: 56px 40px;
    text-align: center;
    font-family: var(--body-font);
}

.error-header {
    padding-bottom: 40px;
    border-bottom: 1px solid var(--color-border);
    margin-bottom: 40px;
}

.error-icon-container {
    width: 64px;
    height: 64px;
    margin: 0 auto 24px;
    background: transparent;
    border: 2px solid var(--ink-color);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: clamp(32px, 19.3333px + 3.3333vw, 34px);
    font-weight: 700;
    color: var(--ink-color);
    line-height: 1;
}

.error-title {
    font-size: clamp(32px, 6.6667px + 6.6667vw, 36px);
    font-weight: 600;
    color: var(--ink-color);
    margin-bottom: 16px;
    letter-spacing: -0.5px;
}

.error-subtitle {
    font-size: clamp(20px, 13.6667px + 1.6667vw, 21px);
    color: var(--ink-color);
    line-height: 1.7;
}

.error-message {
    color: var(--color-error);
    font-size: 18px;
    margin-top: 0;
    margin-bottom: 16px;
    display: none;
}

.error-suggestions-header {
    font-size: 16px;
    font-weight: 500;
    color: var(--ink-color);
    letter-spacing: 0;
    text-transform: none;
    margin-bottom: 24px;
}

.error-suggestions ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.error-suggestions li {
    display: block;
    padding: 14px 0;
    font-size: clamp(18px, 11.6667px + 1.6667vw, 19px);
    color: var(--ink-color);
    line-height: 1.7;
    border-bottom: 1px solid var(--color-border);
}

.error-suggestions li:last-child {
    border-bottom: none;
}

.error-suggestions li::before {
    content: none;
}

/* ─── Error screen scaling at and above 440px ───
   Mirrors the invitation card's 440px swap: each error element's
   font-size hands off from the small-segment clamp (380→440) above
   to the large-segment clamp (440→1024) below. */
@media (min-width: 440px) {
    .error-icon-container {
        font-size: clamp(34px, 29.4795px + 1.0274vw, 40px);
    }
    .error-title {
        font-size: clamp(36px, 29.9726px + 1.3699vw, 44px);
    }
    .error-subtitle {
        font-size: clamp(21px, 18.7397px + 0.5137vw, 24px);
    }
    .error-message {
        font-size: clamp(18px, 16.4932px + 0.3425vw, 20px);
    }
    .error-suggestions-header {
        font-size: clamp(16px, 14.4932px + 0.3425vw, 18px);
    }
    .error-suggestions li {
        font-size: clamp(19px, 18.2466px + 0.1712vw, 20px);
    }
}

/* ========================================
   MAIN CARD CONTAINER
   ======================================== */

.event-container {
    max-width: 520px;
    margin: 0 auto;
    will-change: opacity, transform;
}

.event-card {
    background: var(--theme-paper);
    border: none;
    border-radius: 0;
    overflow: hidden;
    position: relative;
    box-shadow: 0 0 10px rgba(0,0,0,0.08);
}

.event-card-content {
    padding: 0 clamp(24px, 4vw + 15px, 56px);
    position: relative;
    z-index: 2;
}

.event-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url(/backgrounds/paper_grain_overlay_alpha.avif);
    background-size: 400px 400px;
    background-repeat: repeat;
    background-position: center;
    opacity: 0.05;
    pointer-events: none;
    z-index: 1;
}

/* ========================================
   EVENT HEADER
   ======================================== */

.event-header {
    background: transparent;
    color: var(--ink-color);
    text-align: center;
    padding: clamp(48px, 3vw + 45px, 72px) 0 clamp(32px, 5vw + 16px, 61px) 0;
    position: relative;
    margin: 0;
    z-index: 2;
}

.invited-label {
    font-family: var(--label-font);
    font-size: var(--header-label-size);
    font-weight: var(--label-font-weight);
    font-style: var(--label-font-style);
    letter-spacing: var(--label-letter-spacing);
    font-optical-sizing: auto;
    font-kerning: normal;
    hanging-punctuation: first last;
    margin-bottom: clamp(16px, 1vw + 16px, 24px);
    color: var(--ink-color);
    text-transform: var(--label-text-transform);
    line-height: 1.4;
}

.event-title {
    font-family: var(--header-font);
    font-size: var(--header-font-size);
    font-weight: var(--header-font-weight);
    font-style: var(--header-font-style);
    letter-spacing: var(--header-font-letter-spacing);
    font-optical-sizing: var(--header-optical-sizing, auto);
    font-variation-settings: var(--header-font-variation, normal);
    font-kerning: normal;
    hanging-punctuation: first last;
    text-wrap: pretty;
    line-height: var(--title-line-height, 1.15);
    color: var(--ink-color);
    overflow-wrap: normal;
    word-break: keep-all;
    hyphens: none;
    /* Pin antialiasing mode so it can't switch between the animated and
       resting states of the slide-up (a cause of the perceived "snap").
       Variable-driven so high-contrast hairline faces can opt back into
       'auto' to preserve thin strokes. */
    -webkit-font-smoothing: var(--header-font-smoothing, antialiased);
    -moz-osx-font-smoothing: grayscale;
}

/* Title→subtitle gap is owned by the subtitle so it disappears when the
   subtitle isn't rendered (no orphan gap below the title). */
.event-title + .event-subtitle {
    margin-top: clamp(20px, 1vw + 20px, 28px);
}

.event-subtitle {
    font-family: var(--subtitle-font);
    font-size: var(--header-sub-size);
    font-weight: var(--subtitle-font-weight);
    font-style: var(--subtitle-font-style);
    letter-spacing: var(--subtitle-letter-spacing);
    /* Follows the same opsz pin as the title. Bodoni Moda only ever appears
       as a display/header font, and High Fashion's subtitle is display-
       sourced, so when the title pins opsz off the subtitle does too —
       fixing the same hairline-vanish on the subtitle. Body-sourced
       subtitles in other themes are unaffected (their header isn't Bodoni,
       so the variable stays auto). */
    font-optical-sizing: var(--header-optical-sizing, auto);
    font-variation-settings: var(--header-font-variation, normal);
    font-kerning: normal;
    hanging-punctuation: first last;
    line-height: 1.25;
    margin-bottom: 0;
    color: var(--ink-color);
    overflow-wrap: normal;
    word-break: keep-all;
    hyphens: none;
    /* Pin antialiasing mode — this italic subtitle is where the
       post-slide-up snap was most visible. Variable-driven so hairline
       faces can opt into 'auto'. */
    -webkit-font-smoothing: var(--header-font-smoothing, antialiased);
    -moz-osx-font-smoothing: grayscale;
}

.event-header::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 1px;
    background: var(--ink-color);
    opacity: 0.35;
}

/* ========================================
   SECTION CONTAINERS
   ======================================== */

.section {
    padding: var(--section-padding) 0;
    background: transparent;
    position: relative;
    text-align: center;
}

.section:first-child {
    padding-top: var(--section-padding);
}

.section:last-child {
    padding-bottom: var(--section-padding);
}

/* ========================================
   DETAIL ROWS
   ======================================== */

.detail-row {
    display: block;
    text-align: center;
    padding: 0;
    margin-bottom: clamp(72px, 3vw + 60px, 100px);
}

.detail-row:first-of-type {
    padding-top: 0;
}

.detail-row:last-child {
    padding-bottom: 0;
    margin-bottom: 0;
}

.datetime-calendar-group {
    margin-bottom: clamp(72px, 3vw + 60px, 100px);
}

.datetime-group {
    margin-bottom: 0;
}

/* Tight spacing within the date/time block — label hugs content */
.datetime-group .detail-row {
    margin-bottom: 4px;
}

.countdown-row {
    margin-bottom: 0;
    margin-top: 16px;
}

.countdown-row .countdown-simple {
    margin-top: 0;
}

.calendar-actions-group {
    display: grid;
    grid-template-columns: max-content;
    justify-content: center;
    gap: 8px;
    margin-top: 16px;
    max-width: 100%;
}

.calendar-actions-group .calendar-popover-wrapper,
.calendar-actions-group .share-popover-wrapper {
    padding: 0;
}

/* OMI (sanctioned additive, Oct 2026): side-by-side RSVP buttons. They are
   the invite's own .action-link, so size, type, paper, and grain match the
   calendar and share buttons by construction. Rendered ONLY when the event
   payload carries rsvp.mode === 'buttons'; every other invite is byte-identical. */
.rsvp-actions-group {
    grid-template-columns: max-content max-content;
    margin-top: 14px;
}
@media (max-width: 359px) {
    .rsvp-actions-group { grid-template-columns: max-content; }
}

.detail-text-multiday {
    display: flex;
    flex-direction: column;
    gap: 6px;
    align-items: center;
}

.detail-text {
    font-family: var(--body-font);
    font-size: var(--body-font-size);
    font-weight: var(--body-font-weight);
    font-style: var(--body-font-style);
    letter-spacing: var(--body-font-letter-spacing);
    hyphens: none;
    color: var(--ink-color);
    line-height: 1.6;
    overflow-wrap: normal;
    word-break: normal;
}

.detail-text-date {
    font-family: var(--body-font);
    font-size: var(--body-font-size);
    font-weight: 600;
    font-style: var(--body-font-style);
    letter-spacing: var(--body-font-letter-spacing);
    color: var(--ink-color);
    line-height: 1.4;
    overflow-wrap: break-word;
    word-break: normal;
}

.detail-text-time {
    font-family: var(--body-font);
    font-size: var(--body-font-size);
    font-weight: var(--body-font-weight);
    font-style: var(--body-font-style);
    letter-spacing: var(--body-font-letter-spacing);
    color: var(--ink-color);
    line-height: 1.6;
    overflow-wrap: break-word;
    word-break: normal;
}

.detail-text-important {
    font-family: var(--body-font);
    font-size: var(--body-font-size);
    font-weight: var(--body-font-weight);
    font-style: var(--body-font-style);
    letter-spacing: var(--body-font-letter-spacing);
    hyphens: none;
    text-wrap: pretty;
    color: var(--ink-color);
    line-height: 1.6;
    overflow-wrap: normal;
    word-break: normal;
}

.detail-text-links {
    font-family: var(--body-font);
    font-size: var(--body-font-size);
    font-weight: var(--body-font-weight);
    font-style: var(--body-font-style);
    letter-spacing: var(--body-font-letter-spacing);
    color: var(--ink-color);
    line-height: 1.6;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.detail-text-links a {
    display: block;
    margin-bottom: 10px;
}

.detail-text-links a:last-child {
    margin-bottom: 0;
}

/* Section labels: Date, Address, Please Note — header font, label size */
.detail-label {
    font-family: var(--label-font);
    font-size: var(--header-label-size);
    font-weight: var(--label-font-weight);
    font-style: var(--label-font-style);
    letter-spacing: var(--label-letter-spacing);
    font-optical-sizing: auto;
    color: var(--ink-color);
    display: block;
    margin-bottom: 12px;
    line-height: 1.4;
    text-transform: var(--label-text-transform);
}

.detail-text a.location-link {
    display: inline;
    text-decoration: none;
    font-weight: var(--body-font-weight);
    transition: opacity 0.2s ease;
    color: var(--ink-color);
}

.detail-text a.location-link:hover {
    opacity: 0.7;
}

.location-venue {
    font-family: var(--body-font);
    font-size: var(--body-font-size);
    font-weight: 600;
    font-style: var(--body-font-style);
    letter-spacing: var(--body-font-letter-spacing);
    color: var(--ink-color);
    display: block;
    line-height: 1.4;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
}

.location-address {
    font-family: var(--body-font);
    font-size: var(--body-font-size);
    font-weight: var(--body-font-weight);
    font-style: var(--body-font-style);
    letter-spacing: var(--body-font-letter-spacing);
    color: var(--ink-color);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    display: block;
    margin-top: 6px;
    line-height: 1.6;
}

.detail-text a {
    font-family: var(--body-font);
    font-size: var(--body-font-size);
    font-weight: var(--body-font-weight);
    color: var(--ink-color);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    transition: opacity 0.2s ease;
    overflow-wrap: anywhere;
    word-break: break-word;
}

.detail-text a:hover {
    opacity: 0.7;
}

.detail-text a:active {
    opacity: 0.6;
}

.next-day-text {
    display: block;
    margin-top: 6px;
    color: var(--ink-color);
    font-size: var(--body-font-size);
    font-weight: var(--body-font-weight);
}

/* ========================================
   COUNTDOWN TIMER
   ======================================== */

.countdown-simple {
    display: block;
    margin-top: 0;
    font-family: var(--body-font);
    font-size: var(--body-font-size);
    font-weight: var(--body-font-weight);
    font-style: var(--body-font-style);
    letter-spacing: var(--body-font-letter-spacing);
    color: var(--ink-color);
    line-height: 1.6;
}

.countdown-simple:empty {
    display: none;
}

/* ========================================
   DESCRIPTION & INFO BOX CONTENT
   ======================================== */

.description,
.info-box-content {
    font-family: var(--body-font);
    font-size: var(--body-font-size);
    font-weight: var(--body-font-weight);
    font-style: var(--body-font-style);
    letter-spacing: var(--body-font-letter-spacing);
    hyphens: none;
    text-wrap: pretty;
    hanging-punctuation: first last;
    line-height: 1.7;
    color: var(--ink-color);
    overflow-wrap: normal;
    word-break: normal;
    text-align: center;
    white-space: pre-line;
}

.description a,
.info-box-content a {
    color: var(--ink-color);
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    font-weight: var(--body-font-weight);
    overflow-wrap: anywhere;
    word-break: break-word;
}

.description a:hover,
.info-box-content a:hover {
    opacity: 0.7;
}

/* ========================================
   BUTTONS
   ======================================== */

.btn {
    width: auto;
    min-width: 200px;
    padding: 18px 40px;
    height: auto;
    font-family: var(--body-font);
    font-size: var(--body-font-size);
    font-weight: 500;
    letter-spacing: var(--body-font-letter-spacing);
    border: 2px solid var(--ink-color);
    background: transparent;
    color: var(--ink-color);
    border-radius: 0;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    cursor: pointer;
    transition: background 0.2s var(--ease-out), color 0.2s var(--ease-out);
    margin-bottom: 0;
    text-decoration: none;
}

.btn-primary {
    background: transparent;
    color: var(--ink-color);
    border: 2px solid var(--ink-color);
    box-shadow: none;
}

.btn-primary:hover:not(:disabled) {
    background: var(--ink-color);
    color: var(--theme-paper);
}

.btn-primary:focus-visible {
    outline: 3px solid var(--ink-color);
    outline-offset: 2px;
}

.btn-primary:disabled {
    opacity: 0.4;
    pointer-events: none;
}

/* ========================================
   INFO BOXES
   ======================================== */

.info-box {
    padding: 0;
    margin-bottom: clamp(72px, 3vw + 60px, 100px);
}

.info-box:first-of-type {
    padding-top: 0;
}

.info-box:last-child {
    margin-bottom: 0;
    padding-bottom: 0;
}

/* Info box labels — match .detail-label exactly so labels are consistent
   across the whole invite (RSVP, Hosted by, Schedule, Cost, etc.) */
.info-box-label {
    font-family: var(--label-font);
    font-size: var(--header-label-size);
    font-weight: var(--label-font-weight);
    font-style: var(--label-font-style);
    letter-spacing: var(--label-letter-spacing);
    font-optical-sizing: auto;
    color: var(--ink-color);
    text-transform: var(--label-text-transform);
    margin-bottom: 12px;
    line-height: 1.4;
}

/* ========================================
   ACTION LINKS & POPOVERS
   ======================================== */

.calendar-popover-wrapper,
.share-popover-wrapper {
    margin: 0;
    padding: 0;
    display: flex;
    justify-content: center;
    width: 100%;
}

.action-link {
    font-family: var(--body-font);
    font-size: var(--body-font-size);
    font-weight: var(--body-font-weight);
    font-style: var(--body-font-style);
    letter-spacing: var(--body-font-letter-spacing);
    color: var(--ink-color);
    background: var(--theme-paper);
    border: 1px solid var(--ink-color);
    border-radius: 0;
    padding: 0 20px;
    min-height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    white-space: nowrap;
    cursor: pointer;
    text-decoration: none;
    transition: opacity 0.2s ease;
    position: relative;
    overflow: hidden;
}

.action-link::before {
    content: '';
    position: absolute;
    inset: 0;
    background-image: url(/backgrounds/paper_grain_overlay_alpha.avif);
    background-size: 400px 400px;
    background-repeat: repeat;
    background-position: center;
    opacity: 0.05;
    pointer-events: none;
    z-index: 0;
}

.action-link span {
    position: relative;
    z-index: 1;
}

.section .action-link:last-child,
.section .calendar-popover-wrapper:last-child,
.section .share-popover-wrapper:last-child {
    padding-bottom: 0;
}

.action-link:hover,
.action-link:active,
.action-link:focus {
    opacity: 0.7;
}

.popover-portal {
    position: fixed;
    z-index: 1000;
    pointer-events: none;
}

.popover-portal.open {
    pointer-events: all;
}

/* The maker's mark: a brand footnote on the paper. Full ink for legibility,
   a touch smaller than body text, set off by a short hairline rule, with a
   small margin keeping it clear of the paper's bottom edge. */
.omi-mark{ display:block; text-align:center; padding:34px 0 18px;
    font-family:var(--body-font); font-weight:var(--body-font-weight);
    font-style:var(--body-font-style);
    font-size:13px; letter-spacing:.05em;
    color:var(--ink-color); text-decoration:none }
/* A portal that is not open does not exist on screen. This is absolute:
   no transition state, timing quirk, or third-party injection can paint
   a closed popover. */
.popover-portal:not(.open) { display: none !important; }
.popover-content {
    position: fixed;
    background: var(--theme-paper);
    border: 1px solid var(--ink-color);   /* matches .action-link — the invite's buttons */
    border-radius: 4px;
    box-shadow: 0 2px 12px rgba(0,0,0,0.12);
    padding: 16px;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1000;
    max-width: min(260px, calc(100vw - 64px));
}

.popover-portal.open .popover-content {
    opacity: 1;
    visibility: visible;
    pointer-events: all;
}

.popover-option {
    font-family: var(--body-font);
    font-size: var(--body-font-size);
    font-weight: var(--body-font-weight);
    color: var(--ink-color);
    padding: 10px 12px;
    display: block;
    border-radius: 4px;
    text-decoration: underline;
    text-decoration-thickness: 1px;
    text-underline-offset: 4px;
    line-height: 1.5;
    text-align: center;
    transition: opacity 0.2s ease;
}

.popover-option:hover,
.popover-option:active {
    opacity: 0.7;
}

.popover-option:focus {
    outline: 2px solid var(--ink-color);
    outline-offset: -2px;
}

.download-toast {
    position: fixed;
    bottom: 30px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: var(--ink-color);
    color: var(--theme-paper);
    padding: 16px 32px;
    border-radius: 4px;
    font-family: var(--body-font);
    font-size: var(--body-font-size);
    font-weight: 500;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    opacity: 0;
    transition: opacity 0.2s ease, transform 0.2s ease;
    white-space: nowrap;
    max-width: calc(100% - 40px);
    text-align: center;
}

.download-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ========================================
   DIVIDERS
   ======================================== */

.section::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 1px;
    background: var(--ink-color);
    opacity: 0.35;
}

.section:first-of-type::before {
    content: none;
}

/* ========================================
   ANIMATIONS
   ======================================== */

@keyframes fadeInUp {
    from { opacity: 0; transform: translateY(40px); }
    to { opacity: 1; transform: translateY(0); }
}

#scrollClip {
    position: fixed;
    inset: 0;
    overflow-y: auto;
    overflow-x: clip;
    z-index: 1;
    -webkit-overflow-scrolling: touch;
    padding: clamp(40px, 3vw + 35px, 64px) clamp(12px, 2vw + 4px, 24px);
    transform: translate3d(0, 100%, 0);
    will-change: transform;
    /* Keep this element promoted to its own GPU layer at all times —
       before, during, and after the slide-up. Without this, the browser
       promotes the layer when the transform animation starts and DEMOTES
       it when the animation ends; that demote re-rasterizes all the text
       with a different anti-aliasing path, which is the "font snaps after
       slide-up" artifact. backface-visibility:hidden + a persistent 3D
       transform (translateZ via translate3d) keeps the layer stable so the
       text is rasterized once and never re-rendered. */
    backface-visibility: hidden;
    -webkit-backface-visibility: hidden;
    -webkit-font-smoothing: antialiased;
}

@keyframes slideUpFromBottom {
    from { transform: translate3d(0, 100%, 0); }
    to { transform: translate3d(0, 0, 0); }
}

#scrollClip.revealing {
    z-index: 10000;
    animation: slideUpFromBottom 0.7s cubic-bezier(0.5, 0, 0.5, 1) forwards;
}

/* ========================================
   RESPONSIVE - LARGE MOBILE (430px+, e.g. iPhone Pro Max)
   Font sizes are now driven by piecewise clamps + the @media (min-width: 440px)
   block below; this query only adjusts non-font layout details.
   ======================================== */

@media (min-width: 430px) and (max-width: 639px) {
    .action-link {
        padding: 0 22px;
    }
}

/* ========================================
   PIECEWISE CLAMP SWAP (440px+)
   At and above 440px (Pro Max width), swap the active font-size variable from
   the small-segment clamp (380→440) to the large-segment clamp (440→1024).
   This preserves the three calibrated anchors (mobile/large-mobile/desktop)
   exactly while interpolating smoothly between them at every viewport width.
   ======================================== */

@media (min-width: 440px) {
    :root {
        --header-font-size: var(--header-font-size-large);
        --header-sub-size: var(--header-sub-size-large);
        --header-label-size: var(--header-label-size-large);
        --body-font-size: var(--body-font-size-large);
        --section-padding: var(--section-padding-large);
    }
}

/* ========================================
   RESPONSIVE - DESKTOP
   Font sizes and most spacing now use clamp() — see the variables and rules
   above. This query handles only what clamp() can't: container width,
   pointer-only hover behaviors, and popover max-width.
   ======================================== */

@media (min-width: 640px) {
    body {
        padding: 0;
    }

    .event-container {
        max-width: 560px;
    }

    .action-link {
        padding: 0 28px;
    }

    /* (maker's mark styles live once, in the base stylesheet) */
.popover-content {
        max-width: min(320px, calc(100vw - 64px));
    }

    .action-link:hover {
        transform: none;
    }
}

/* ========================================
   UTILITY CLASSES
   ======================================== */

.skip-link {
    position: absolute;
    top: -9999px;
    left: -9999px;
    background: var(--ink-color);
    color: var(--theme-paper);
    padding: 8px 16px;
    text-decoration: none;
    border-radius: 0;
    font-weight: 600;
    z-index: 10000;
}

.skip-link:focus {
    top: 0;
    left: 0;
}

.hidden {
    display: none !important;
}

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

#main-content:focus {
    outline: none;
}

*:focus-visible,
button:focus-visible,
.btn:focus-visible,
a:focus-visible {
    outline: 2px solid var(--ink-color);
    outline-offset: 2px;
}

/* ========================================
   REDUCED MOTION
   ======================================== */

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

    .loading-bg-fill {
        transition: none !important;
    }

    .event-container {
        animation: none !important;
    }

    #scrollClip {
        transform: none !important;
    }

    #scrollClip.revealing {
        animation: none !important;
    }

    .loading-screen {
        animation: none !important;
    }

}
