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

:root {
    --color-dark: #f0ece6;
    --color-medium: #c8c0b4;
    --color-light: #9a9288;
    --color-accent: #b08d57;
    --color-accent-light: #d4b980;
    --color-bg: #1a1714;
    --font-cursive: 'Alex Brush', cursive;
    --font-serif: 'Cormorant Garamond', Georgia, serif;
    --font-sans: 'Figtree', system-ui, sans-serif;
}

html { scroll-behavior: smooth; }

/* ── Page-load animations ── */
@keyframes fade-slide-up {
    from { opacity: 0; transform: translateY(20px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes bubble-in {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}

@keyframes pill-pop {
    from { opacity: 0; transform: scale(0.85); }
    to { opacity: 1; transform: scale(1); }
}

@keyframes think-pulse {
    0%, 100% { opacity: 0.6; }
    50% { opacity: 1; }
}

body {
    font-family: var(--font-serif);
    color: var(--color-dark);
    background-color: var(--color-bg);
    min-height: 100vh;
    overflow-x: hidden;
}

/* ── Hero Section ── */
.hero {
    position: relative;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 100vh;
    padding: 0 24px 140px;
    padding-top: 8vh;
    text-align: center;
    background-color: var(--color-bg);
    overflow: hidden;
}

/* ── Bento Background ── */
.bento-wrap {
    position: absolute;
    inset: 0;
    overflow: hidden;
    z-index: 0;
    display: none;
}

.hero-bg {
    position: absolute;
    inset: 0;
    z-index: 0;
    background-size: cover;
    background-position: center;
    background-image: url('/images/5.jpeg');
    filter: brightness(0.4);
}

@media (orientation: portrait) {
    .hero-bg {
        background-image: url('/images/2.jpeg');
        filter: brightness(0.5);
    }
}

.bento-scroll {
    display: flex;
    flex-direction: row;
    animation: bentoScroll 80s linear infinite;
}

.bento-scroll:hover {
    animation-play-state: paused;
}

@keyframes bentoScroll {
    0% { transform: translateX(0); }
    100% { transform: translateX(-50%); }
}

.bento-grid {
    display: grid;
    grid-template-columns: repeat(4, minmax(200px, 25vw));
    grid-template-rows: repeat(3, minmax(200px, 33vh));
    gap: 8px;
    padding: 8px;
    flex-shrink: 0;
}

.bento-grid img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 12px;
    filter: brightness(0.5);
    transition: filter 0.5s ease;
}

.bento-grid img:hover {
    filter: brightness(0.7);
}

.bento-grid .b1 { grid-column: 1 / 3; grid-row: 1 / 3; }
.bento-grid .b2 { grid-column: 3; grid-row: 1; }
.bento-grid .b3 { grid-column: 4; grid-row: 1; }
.bento-grid .b4 { grid-column: 3 / 5; grid-row: 2; }
.bento-grid .b5 { grid-column: 1 / 3; grid-row: 3; }
.bento-grid .b6 { grid-column: 3; grid-row: 3; }
.bento-grid .b7 { grid-column: 4; grid-row: 3; }

.hero-title, .hero-subtitle, .flourish,
.date-block, .date-text, .venue-text, .action-buttons {
    position: relative;
    z-index: 1;
    animation: fade-slide-up 0.6s ease-out both;
}

.flourish        { animation-delay: 0s; }
.hero-title      { animation-delay: 0.1s; }
.date-text       { animation-delay: 0.2s; }
.venue-text      { animation-delay: 0.3s; }
.action-buttons  { animation-delay: 0.4s; }

/* ── Hero Typography ── */
.flourish {
    font-size: 28px;
    color: var(--color-accent);
    letter-spacing: 12px;
    margin-bottom: 40px;
    opacity: 0.6;
}

.hero-title {
    font-family: var(--font-cursive);
    font-size: clamp(3rem, 8vw, 6.5rem);
    font-weight: 400;
    color: var(--color-dark);
    line-height: 1.2;
    letter-spacing: 2px;
    margin-bottom: 16px;
}

.hero-subtitle {
    font-family: var(--font-serif);
    font-size: 14px;
    font-weight: 300;
    letter-spacing: 3px;
    text-transform: uppercase;
    color: #fff;
    opacity: 0.9;
    margin-bottom: 24px;
}

.date-block { margin-bottom: 20px; }

.date-label {
    font-family: var(--font-serif);
    font-size: 13px;
    font-weight: 300;
    letter-spacing: 4px;
    text-transform: uppercase;
    color: #fff;
    opacity: 0.9;
    margin-bottom: 8px;
}

.date-text {
    font-family: var(--font-serif);
    font-size: clamp(1.4rem, 3vw, 2rem);
    font-weight: 400;
    color: var(--color-dark);
    letter-spacing: 2px;
    margin-bottom: 8px;
}

.venue-text {
    font-family: var(--font-serif);
    font-size: 18px;
    font-weight: 500;
    color: var(--color-dark);
    letter-spacing: 1px;
    line-height: 1.6;
    margin-bottom: 28px;
}

/* ── Pill Button ── */
.btn-pill {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 12px 28px;
    border-radius: 9999px;
    border: 1px solid rgba(255,255,255,0.2);
    background: #fff;
    color: #1a1a1a;
    font-family: var(--font-sans);
    font-size: 15px;
    font-weight: 500;
    letter-spacing: 0.3px;
    text-decoration: none;
    cursor: pointer;
    transition: filter 0.2s ease;
}

.btn-pill:hover { filter: brightness(0.9); }

.action-buttons { display: flex; flex-direction: column; gap: 16px; width: fit-content; margin: 0 auto; }

.cal-buttons { display: flex; gap: 16px; }

.btn-rsvp {
    display: block;
    width: 100%;
    box-sizing: border-box;
    padding: 16px 28px;
    border-radius: 9999px;
    border: none;
    background: #c4547a;
    color: #fff;
    font-family: var(--font-sans);
    font-size: 17px;
    font-weight: 600;
    letter-spacing: 0.5px;
    text-decoration: none;
    text-align: center;
    cursor: pointer;
    transition: filter 0.2s ease;
}

.btn-rsvp:hover { filter: brightness(0.85); }

.btn-pill .cal-icon {
    width: 20px;
    height: 20px;
    flex-shrink: 0;
    border-radius: 4px;
    object-fit: contain;
}

/* ══════════════════════════════════
   Chat Panel — fixed bottom drawer
   ══════════════════════════════════ */
.chat-panel {
    position: fixed;
    bottom: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 90%;
    max-width: 740px;
    z-index: 50;
    display: flex;
    flex-direction: column;
    padding: 0 20px 28px;
    pointer-events: none;
}

.chat-panel > * { pointer-events: auto; }

/* ── Chat Drawer wrapper ── */
.chat-drawer-wrap {
    position: relative;
    margin-bottom: 10px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    transition: max-height 0.3s ease, opacity 0.2s ease;
}

body.chat-active .chat-drawer-wrap {
    max-height: 50vh;
    opacity: 1;
}

body.chat-minimized .chat-drawer-wrap {
    max-height: 0;
    opacity: 0;
}

.chat-drawer-wrap .chat-drawer-bg {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-radius: 28px;
    border: 1px solid rgba(0,0,0,0.08);
    box-shadow: 0 4px 24px rgba(0,0,0,0.1);
    z-index: -1;
    pointer-events: none;
}

.chat-drawer-inner {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 16px 24px;
    height: 420px;
    max-height: 50vh;
    box-sizing: border-box;
    overflow-y: auto;
}

.chat-drawer-spacer { flex: 1 1 auto; }

.chat-drawer-inner::-webkit-scrollbar { width: 4px; }
.chat-drawer-inner::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.15);
    border-radius: 4px;
}

/* ── Close Button ── */
.chat-close-btn {
    display: none;
    position: absolute;
    top: 10px;
    right: 10px;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    border: 1px solid rgba(0,0,0,0.1);
    background: rgba(0,0,0,0.06);
    color: #333;
    cursor: pointer;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    line-height: 1;
    font-family: var(--font-sans);
    transition: background 0.2s ease;
    z-index: 2;
}

.chat-close-btn:hover { background: rgba(0,0,0,0.12); }

body.chat-active .chat-close-btn { display: flex; }
body.chat-minimized .chat-close-btn { display: none; }

/* ── Minimized: collapse drawer ── */
body.chat-minimized .chat-drawer { max-height: 0; }
body.chat-minimized .chat-drawer-bg { height: 0; }

/* ── Input ── */
.chat-input-wrapper {
    width: 100%;
    text-align: left;
    flex-shrink: 0;
    animation: fade-slide-up 0.4s ease-out 0.6s both;
}

.chat-input-container {
    position: relative;
    display: flex;
    align-items: center;
    width: 100%;
}

@keyframes glow-pulse {
    0%, 100% { box-shadow: 0 0 20px rgba(255,255,255,0.5), 0 0 50px rgba(255,255,255,0.15), 0 0 80px rgba(255,255,255,0.05); }
    50% { box-shadow: 0 0 30px rgba(255,255,255,0.7), 0 0 60px rgba(255,255,255,0.25), 0 0 100px rgba(255,255,255,0.1); }
}

.chat-input {
    width: 100%;
    padding: 18px 60px 18px 24px;
    border-radius: 9999px;
    border: 1px solid rgba(255,255,255,0.3);
    background: #fff;
    font-family: var(--font-sans);
    font-size: 16px;
    color: #1a1a1a;
    outline: none;
    animation: glow-pulse 3s ease-in-out infinite;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.chat-input::placeholder { color: #999; font-weight: 300; }
.chat-input:focus {
    animation: none;
    border-color: #c4547a;
    box-shadow: 0 0 0 3px rgba(196, 84, 122, 0.15);
}

.chat-send-btn {
    position: absolute;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    width: 42px;
    height: 42px;
    border-radius: 50%;
    border: none;
    background: #1a1a1a;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: filter 0.2s ease;
    flex-shrink: 0;
}

.chat-send-btn:hover { filter: brightness(1.3); }
.chat-send-btn svg { width: 18px; height: 18px; }

/* ── Suggestion Pills ── */
.suggestions {
    display: flex;
    gap: 8px;
    justify-content: center;
    margin-bottom: 10px;
}

.suggestion-pill {
    padding: 7px 16px;
    border-radius: 9999px;
    border: 1px solid #ddd;
    background: #fff;
    font-family: var(--font-sans);
    font-size: 12px;
    font-weight: 400;
    color: #666;
    cursor: pointer;
    white-space: nowrap;
    transition: border-color 0.2s ease, color 0.2s ease;
    animation: pill-pop 0.3s ease-out both;
}

.suggestion-pill:hover {
    border-color: #999;
    color: #1a1a1a;
}

body.chat-active .suggestions { display: none; }
body.chat-minimized .suggestions { display: none; }

/* ── Message Bubbles ── */
.chat-bubble {
    max-width: 80%;
    padding: 12px 18px;
    border-radius: 20px;
    font-family: var(--font-sans);
    font-size: 15px;
    line-height: 1.5;
    animation: bubble-in 0.25s ease-out;
    word-wrap: break-word;
    text-align: left;
}

.chat-bubble.user {
    align-self: flex-end;
    background: #c4547a;
    color: #fff;
    border-bottom-right-radius: 6px;
}

.chat-bubble.assistant {
    align-self: flex-start;
    background: #e8e4df;
    color: #333;
    border: 1px solid rgba(0,0,0,0.06);
    border-bottom-left-radius: 6px;
}

.chat-bubble.error {
    align-self: flex-start;
    background: #fdf0ef;
    color: #c0392b;
    border: 1px solid rgba(192, 57, 43, 0.2);
    border-bottom-left-radius: 6px;
}

.chat-bubble.thinking {
    align-self: flex-start;
    background: #f3f0ed;
    border: 1px solid rgba(0,0,0,0.06);
    border-bottom-left-radius: 6px;
    color: #999;
    min-width: 120px;
    animation: bubble-in 0.25s ease-out, think-pulse 1.5s ease-in-out infinite;
}

/* ── Global ── */
input, select, textarea, button { font-family: var(--font-sans); }

/* ── Responsive ── */
@media (max-width: 600px) {
    .bento-grid {
        grid-template-columns: repeat(2, 1fr);
        grid-template-rows: repeat(3, minmax(150px, 25vh));
    }
    .bento-grid .b1 { grid-column: 1; grid-row: 1; }
    .bento-grid .b2 { grid-column: 2; grid-row: 1; }
    .bento-grid .b3 { grid-column: 1; grid-row: 2; }
    .bento-grid .b4 { grid-column: 2; grid-row: 2; }
    .bento-grid .b5 { grid-column: 1; grid-row: 3; }
    .bento-grid .b6, .bento-grid .b7 { display: none; }

    .hero { padding: 32px 20px 140px; }
    .hero-subtitle { font-size: 12px; letter-spacing: 2px; margin-bottom: 20px; }
    .venue-text { font-size: 16px; }
    .flourish { font-size: 22px; letter-spacing: 8px; margin-bottom: 32px; }
    .btn-pill { padding: 10px 24px; font-size: 14px; }
    .btn-rsvp { font-size: 15px; padding: 14px 24px; }
    .chat-input { padding: 16px 54px 16px 20px; font-size: 15px; }
    .chat-send-btn { width: 38px; height: 38px; }
    .chat-send-btn svg { width: 16px; height: 16px; }
    .cal-buttons { flex-wrap: wrap; justify-content: center; }
}
