@import url('./fonts.css');

:root {
    --color-bg: #1a1714;
    --color-surface: #201c18;
    --color-primary: #c9a84c;
    --color-primary-soft: #e8d08a;
    --color-text: #faf7f2;
    --color-text-muted: rgba(250, 247, 242, 0.6);
    --color-border: rgba(201, 168, 76, 0.2);
    --font-primary: 'Jost', sans-serif;
    --font-serif: 'Cormorant Garamond', serif;
    --font-accent: 'Great Vibes', cursive;
    --spacing-section: 88px;
    --container-width: 760px;
    --card-padding: 28px;
    --radius-card: 0px;
    --radius-button: 0px;
    --transition-standard: all 0.3s ease;
    --fade-duration: 0.8s;
    --stagger-delay: 0.1s;
    --color-border-soft: rgba(201, 168, 76, 0.16);
    --color-border-strong: rgba(201, 168, 76, 0.38);
    --color-text-soft: rgba(250, 247, 242, 0.62);
    --color-text-dim: rgba(250, 247, 242, 0.45);
    --color-text-faint: rgba(250, 247, 242, 0.4);
    --color-text-placeholder: rgba(250, 247, 242, 0.4);
    --color-surface-soft: rgba(255, 255, 255, 0.04);
    --color-gold-surface-soft: rgba(201, 168, 76, 0.06);
    --color-gold-surface: rgba(201, 168, 76, 0.08);
    --color-gold-surface-strong: rgba(201, 168, 76, 0.15);
    --color-primary-glow: rgba(201, 168, 76, 0.12);
    --color-page-grid-line: rgba(255, 255, 255, 0.015);
    --color-overlay-backdrop: rgba(10, 8, 7, 0.78);
    --color-audio-bg: rgba(17, 14, 12, 0.68);
    --color-audio-hover-bg: rgba(17, 14, 12, 0.8);
    --color-audio-border: rgba(201, 168, 76, 0.24);
    --color-pulse-ring: rgba(201, 168, 76, 0.45);
    --color-pulse-ring-spread: rgba(201, 168, 76, 0);
    --color-input-focus-bg: rgba(255, 255, 255, 0.06);
    --shadow-hover: 0 12px 28px rgba(0, 0, 0, 0.18);
    --shadow-text-strong: 0 8px 28px rgba(0, 0, 0, 0.32);
    --shadow-text-soft: 0 2px 18px rgba(0, 0, 0, 0.3);
    --focus-ring: 0 0 0 3px rgba(201, 168, 76, 0.12);
    --page-gradient: linear-gradient(180deg, #1a1714 0%, #1a1714 100%);
    --intro-backdrop-gradient: linear-gradient(180deg, rgba(10, 8, 7, 0.96) 0%, rgba(18, 15, 13, 0.96) 45%, rgba(26, 23, 20, 0.98) 100%);
    --intro-card-gradient: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(201, 168, 76, 0.03));
    --button-fill-gradient: linear-gradient(135deg, rgba(201, 168, 76, 0.95), rgba(232, 208, 138, 0.95));
    --hero-overlay-gradient: linear-gradient(to bottom, rgba(26, 23, 20, 0.1) 0%, rgba(26, 23, 20, 0.18) 40%, rgba(26, 23, 20, 0.78) 76%, rgba(26, 23, 20, 1) 100%);
    --overlay-panel-gradient: linear-gradient(180deg, rgba(15, 12, 10, 0.98) 0%, rgba(24, 21, 18, 0.98) 100%);
    --overlay-close-gradient: linear-gradient(180deg, rgba(15, 12, 10, 0.92), rgba(15, 12, 10, 0));
    --rsvp-panel-gradient: linear-gradient(135deg, rgba(201, 168, 76, 0.05), rgba(201, 168, 76, 0.015));
    --gift-panel-gradient: linear-gradient(135deg, rgba(201, 168, 76, 0.05), rgba(255, 255, 255, 0.02));
    --cream: #faf7f2;
    --gold: #c9a84c;
    --gold-light: #e8d08a;
    --dark: #1a1714;
    --border-soft: rgba(201, 168, 76, 0.18);
    --surface-soft: rgba(255, 255, 255, 0.04);
    --shadow-soft: 0 20px 60px rgba(0, 0, 0, 0.28);
    --base-font-size: 13px;
    --hero-height: 100vh;
    --hero-padding: 0 24px 64px;
    --hero-content-width: 720px;
    --hero-content-padding-bottom: 36px;
    --hero-fade-duration: 1.35s;
    --hero-fade-offset: 44px;
    --hero-label-size: 10px;
    --hero-date-size: 11px;
    --hero-name-min: 54px;
    --hero-name-fluid: 12vw;
    --hero-name-max: 110px;
    --scroll-hint-text-size: 9px;
    --section-tag-size: 9px;
    --section-title-min: 34px;
    --section-title-fluid: 7vw;
    --section-title-max: 56px;
    --section-body-size: 13px;
    --countdown-number-size: 42px;
    --countdown-label-size: 8px;
    --detail-icon-size: 18px;
    --detail-title-size: 8px;
    --detail-value-size: 20px;
    --detail-sub-size: 10px;
    --rsvp-title-size: 38px;
    --rsvp-subtitle-size: 11px;
    --rsvp-input-size: 12px;
    --rsvp-choice-size: 10px;
    --rsvp-submit-size: 10px;
    --rsvp-success-text-size: 26px;
    --rsvp-success-sub-size: 11px;
    --footer-names-size: 30px;
    --footer-note-size: 10px;
    --countdown-finished-size: 30px;
    --space-xs: 8px;
    --space-sm: 12px;
    --space-md: 16px;
    --space-lg: 22px;
    --space-xl: 30px;
    --space-2xl: 40px;
    --space-3xl: 48px;
    --space-4xl: 56px;
    --space-section: 88px;
    --section-padding-top: 88px;
    --details-section-padding-top: 88px;
    --section-padding-inline: 24px;
    --section-tag-gap: 30px;
    --section-title-gap: 22px;
    --hero-label-gap: 16px;
    --hero-date-gap: 22px;
    --scroll-hint-bottom: 20px;
    --scroll-hint-gap: 8px;
    --divider-margin-top: 56px;
    --countdown-margin-top: 40px;
    --content-max-width: 760px;
    --countdown-gap: 12px;
    --details-margin-top: 40px;
    --details-grid-gap: 1px;
    --detail-card-padding-block: 28px;
    --detail-card-padding-inline: 20px;
    --rsvp-shell-padding-bottom: 88px;
    --rsvp-card-margin-top: 40px;
    --rsvp-card-padding-block: 48px;
    --rsvp-card-padding-inline: 32px;
    --rsvp-subtitle-gap: 32px;
    --rsvp-form-gap: 14px;
    --rsvp-choice-gap: 10px;
    --rsvp-submit-margin-top: 8px;
    --footer-padding-bottom: 48px;
    --divider-width: 320px;
    --divider-diamond-size: 6px;
    --scroll-arrow-width: 14px;
    --scroll-arrow-height: 48px;
    --scroll-arrow-stem-height: 36px;
    --scroll-arrow-head-size: 8px;
    --countdown-card-padding-top: 22px;
    --countdown-card-padding-inline: 8px;
    --countdown-card-padding-bottom: 16px;
    --rsvp-input-padding-block: 14px;
    --rsvp-input-padding-inline: 18px;
    --rsvp-choice-min-height: 48px;
    --rsvp-choice-padding: 12px;
    --rsvp-submit-padding-block: 16px;
    --rsvp-submit-padding-inline: 32px;
    --rsvp-success-icon-size: 32px;
}

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

[hidden] {
    display: none !important;
}

html.skip-intro .intro-screen {
    display: none !important;
}

html {
    scroll-behavior: smooth;
}

body.experience-locked {
    overflow: hidden;
}

body {
    min-height: 100vh;
    background:
        radial-gradient(circle at top, var(--color-primary-glow), transparent 28%),
        var(--page-gradient);
    color: var(--cream);
    font-size: var(--base-font-size);
    font-family: var(--font-primary);
    font-weight: 300;
    overflow-x: hidden;
}

body::before {
    content: '';
    position: fixed;
    inset: 0;
    background-image:
        linear-gradient(var(--color-page-grid-line) 1px, transparent 1px),
        linear-gradient(90deg, var(--color-page-grid-line) 1px, transparent 1px);
    background-size: 48px 48px;
    pointer-events: none;
    opacity: 0.35;
}

main,
footer {
    position: relative;
    z-index: 1;
}

.site-shell {
    opacity: 0;
    transform: translateY(18px);
    transition: opacity var(--fade-duration) cubic-bezier(0.22, 1, 0.36, 1), transform var(--fade-duration) cubic-bezier(0.22, 1, 0.36, 1);
}

.site-shell.is-visible {
    opacity: 1;
    transform: none;
}
.config-error-state {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: grid;
    place-items: center;
    padding: 24px;
    background:
        radial-gradient(circle at top, var(--color-primary-glow), transparent 28%),
        var(--page-gradient);
}

.config-error-state__card {
    width: min(100%, 560px);
    padding: 40px 32px;
    border: 1px solid var(--color-border-soft);
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.03), rgba(201, 168, 76, 0.05));
    box-shadow: var(--shadow-soft);
    text-align: center;
}

.config-error-state__eyebrow {
    margin-bottom: 14px;
    color: var(--color-text-soft);
    letter-spacing: 0.32em;
    text-transform: uppercase;
    font-size: 10px;
}

.config-error-state__title {
    margin-bottom: 16px;
    color: var(--cream);
    font-family: var(--font-serif);
    font-size: clamp(34px, 8vw, 54px);
    font-weight: 500;
    line-height: 0.95;
}

.config-error-state__body {
    margin: 0 auto 28px;
    max-width: 38ch;
    color: var(--color-text-soft);
    font-size: 13px;
    line-height: 1.8;
}

.config-error-state__action {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 48px;
    padding: 0 24px;
    border: 1px solid var(--color-border-strong);
    color: var(--color-bg);
    background: var(--button-fill-gradient);
    text-decoration: none;
    text-transform: uppercase;
    letter-spacing: 0.22em;
    font-size: 10px;
}

.config-error-state__action:focus-visible,
.config-error-state__action:hover {
    box-shadow: var(--shadow-hover);
}

/* ─── Intro screen ───────────────────────────────────────────────────────── */

.intro-screen {
    position: fixed;
    inset: 0;
    z-index: 60;
    display: grid;
    place-items: center;
    padding: 24px;
    transition: opacity var(--fade-duration) ease, visibility var(--fade-duration) ease;
}

.intro-screen.is-exiting {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.intro-screen__backdrop {
    position: absolute;
    inset: 0;
    background:
        radial-gradient(circle at 50% 20%, var(--color-primary-glow), transparent 34%),
        var(--intro-backdrop-gradient);
}

.intro-screen__content {
    position: relative;
    z-index: 1;
    width: min(100%, 420px);
    padding: 44px 28px 34px;
    border: 1px solid var(--color-border-soft);
    background: var(--intro-card-gradient);
    box-shadow: var(--shadow-soft);
    text-align: center;
    border-radius: var(--radius-card);
}

.intro-screen__content::before,
.intro-screen__content::after {
    content: '';
    position: absolute;
    left: 22px;
    right: 22px;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--color-primary), transparent);
}

.intro-screen__content::before {
    top: 0;
}

.intro-screen__content::after {
    bottom: 0;
}

.intro-screen__label {
    margin-bottom: 18px;
    color: var(--gold);
    font-size: 9px;
    letter-spacing: 0.42em;
    text-transform: uppercase;
}

.intro-screen__names {
    color: var(--cream);
    font-family: var(--font-accent);
    font-size: clamp(52px, 14vw, 86px);
    font-weight: 400;
    line-height: 1.04;
    text-shadow: var(--shadow-text-strong);
}

.intro-screen__names span {
    display: inline-block;
    margin: 0 0.1em;
    color: var(--gold);
    font-size: 0.58em;
}

.intro-screen__note {
    width: min(100%, 280px);
    margin: 18px auto 28px;
    color: var(--color-text-soft);
    font-size: 12px;
    line-height: 1.8;
    letter-spacing: 0.04em;
}

.intro-screen__open {
    position: relative;
    overflow: hidden;
    min-width: 180px;
    min-height: 48px;
    padding: 15px 28px;
    border: 1px solid var(--gold);
    background: transparent;
    color: var(--gold);
    cursor: pointer;
    font-size: 10px;
    letter-spacing: 0.34em;
    text-transform: uppercase;
    transition: var(--transition-standard);
    border-radius: var(--radius-button);
}

.intro-screen__open::before {
    content: '';
    position: absolute;
    inset: 0;
    z-index: -1;
    background: var(--button-fill-gradient);
    transform: translateX(-100%);
    transition: transform var(--fade-duration) ease;
}

.intro-screen__open:focus-visible {
    color: var(--gold-light);
    border-color: var(--gold-light);
}

/* ─── Audio toggle ───────────────────────────────────────────────────────── */

@keyframes audioPulse {
    0%,
    100% {
        box-shadow: 0 0 0 0 var(--color-pulse-ring);
        transform: scale(1);
    }

    50% {
        box-shadow: 0 0 0 8px var(--color-pulse-ring-spread);
        transform: scale(1.05);
    }
}

.audio-toggle {
    position: fixed;
    top: calc(18px + env(safe-area-inset-top));
    right: 18px;
    z-index: 55;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    min-height: 42px;
    padding: 10px 14px;
    border: 1px solid var(--color-audio-border);
    background: var(--color-audio-bg);
    color: var(--gold-light);
    backdrop-filter: blur(16px);
    cursor: pointer;
    letter-spacing: 0.18em;
    text-transform: uppercase;
    transition: var(--transition-standard);
    border-radius: var(--radius-button);
}

.audio-toggle.is-paused {
    color: var(--color-text-soft);
}

.audio-toggle.is-disabled {
    opacity: 0.72;
}

.audio-toggle__pulse {
    width: 8px;
    height: 8px;
    border-radius: 999px;
    background: var(--gold);
    box-shadow: 0 0 0 0 var(--color-pulse-ring);
    animation: audioPulse 1.8s ease infinite;
}

.audio-toggle.is-paused .audio-toggle__pulse,
.audio-toggle.is-disabled .audio-toggle__pulse {
    background: var(--color-text-dim);
    animation: none;
    box-shadow: none;
}

.audio-toggle__label {
    font-size: 9px;
}

.audio-toggle:focus-visible {
    border-color: var(--color-border-strong);
    box-shadow: var(--focus-ring);
}

/* ─── Base element resets ────────────────────────────────────────────────── */

button,
input {
    font: inherit;
}

:where(button, a, input, textarea, select, [role="button"], [tabindex]:not([tabindex="-1"])):focus-visible {
    outline: 2px solid var(--gold);
    outline-offset: 2px;
}

button {
    border: 0;
    font-family: var(--typo-button-family);
    font-size: var(--typo-button-size);
    font-weight: var(--typo-button-weight);
    letter-spacing: var(--typo-button-letterSpacing);
    line-height: var(--typo-button-lineHeight);
}

img {
    display: block;
    max-width: 100%;
}

/* ─── Content section (shared) ───────────────────────────────────────────── */

.content-section {
    width: min(100%, var(--container-width));
    margin: 0 auto;
    padding: var(--spacing-section) var(--section-padding-inline) 0;
    text-align: center;
}

#details.content-section {
    padding-top: var(--spacing-section);
}

/* ─── Reveal animation states (shared) ───────────────────────────────────── */

.section-tag,
.section-title,
.section-body,
.divider,
.countdown-wrap,
.details-grid,
.rsvp-section {
    opacity: 0;
    transform: translateY(16px);
}

.section-tag.visible,
.section-title.visible,
.section-body.visible,
.divider.visible,
.countdown-wrap.visible,
.details-grid.visible,
.rsvp-section.visible {
    opacity: 1;
    transform: none;
}

/* ─── Section typography (shared) ────────────────────────────────────────── */

.section-tag {
    display: block;
    margin-bottom: var(--section-tag-gap);
    color: var(--gold);
    font-family: var(--typo-eyebrow-family);
    font-size: var(--typo-eyebrow-size);
    font-weight: var(--typo-eyebrow-weight);
    letter-spacing: var(--typo-eyebrow-letterSpacing);
    text-transform: var(--typo-eyebrow-textTransform);
    line-height: var(--typo-eyebrow-lineHeight);
    transition: opacity var(--fade-duration) ease, transform var(--fade-duration) ease;
}

.section-title {
    margin-bottom: var(--section-title-gap);
    color: var(--cream);
    font-family: var(--typo-sectionTitle-family);
    font-size: var(--typo-sectionTitle-size);
    font-weight: var(--typo-sectionTitle-weight);
    line-height: var(--typo-sectionTitle-lineHeight);
    transition: opacity var(--fade-duration) ease 0.1s, transform var(--fade-duration) ease 0.1s;
}

.section-body {
    color: var(--color-text-soft);
    font-family: var(--typo-body-family);
    font-size: var(--typo-body-size);
    font-weight: var(--typo-body-weight);
    line-height: var(--typo-body-lineHeight);
    letter-spacing: 0.05em;
    transition: opacity var(--fade-duration) ease 0.2s, transform var(--fade-duration) ease 0.2s;
}

.section-highlight {
    color: var(--gold);
    font-weight: 300;
}

/* ─── Divider (shared) ───────────────────────────────────────────────────── */

.divider {
    display: flex;
    align-items: center;
    gap: 16px;
    width: min(100%, var(--divider-width));
    margin: var(--divider-margin-top) auto 0;
    transition: opacity var(--fade-duration) ease, transform var(--fade-duration) ease;
}

.divider-line {
    flex: 1;
    height: 1px;
    background: linear-gradient(to right, transparent, var(--gold), transparent);
}

.divider-diamond {
    width: var(--divider-diamond-size);
    height: var(--divider-diamond-size);
    background: var(--gold);
    transform: rotate(45deg);
}

/* ─── Footer (shared) ────────────────────────────────────────────────────── */

footer {
    padding: 0 var(--section-padding-inline) var(--footer-padding-bottom);
    text-align: center;
}

.footer-names {
    margin-bottom: 12px;
    color: var(--gold-light);
    font-family: var(--typo-footer-family);
    font-size: var(--typo-footer-size);
    font-style: var(--typo-footer-style);
    font-weight: var(--typo-footer-weight);
}

.footer-note {
    color: var(--color-text-faint);
    font-family: var(--typo-eyebrow-family);
    font-size: var(--typo-eyebrow-size);
    font-weight: var(--typo-eyebrow-weight);
    letter-spacing: 0.2em;
    text-transform: uppercase;
    line-height: 1.6;
}

/* ─── Responsive: shared components ─────────────────────────────────────── */

@media (max-width: 640px) {
    .content-section {
        padding-top: min(var(--spacing-section), 40px);
    }

    .config-error-state__card {
        padding: 32px 24px;
    }

    .config-error-state__body {
        font-size: 12px;
    }

    #details.content-section {
        padding-top: min(var(--spacing-section), 40px);
    }

    .intro-screen {
        padding: 18px;
    }

    .intro-screen__content {
        padding: 38px 22px 28px;
    }

    .intro-screen__label {
        margin-bottom: 14px;
    }

    .intro-screen__note {
        margin: 16px auto 24px;
        line-height: 1.7;
    }

    .intro-screen__open {
        width: 100%;
    }

    .audio-toggle {
        top: calc(14px + env(safe-area-inset-top));
        right: 14px;
        min-height: 38px;
        padding: 9px 12px;
        gap: 8px;
    }
}

@media (max-width: 480px) {
    .content-section {
        padding-top: min(var(--spacing-section), 32px);
    }

    #details.content-section {
        padding-top: min(var(--spacing-section), 32px);
    }
}

@media (min-width: 641px) and (max-width: 900px) {
    .content-section,
    .extra-content {
        width: min(100%, 840px);
    }
}

@media (min-width: 768px) {
    .intro-screen__open:hover::before {
        transform: translateX(0);
    }

    .intro-screen__open:hover {
        color: var(--dark);
        transform: translateY(-2px);
    }

    .audio-toggle:hover {
        transform: translateY(-2px);
        border-color: var(--color-border-strong);
        background: var(--color-audio-hover-bg);
    }
}

@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;
    }

    .hero-content,
    .hero-content.is-visible {
        opacity: 1;
        transform: none;
        transition: none;
    }
}

@media (max-width: 768px) {
  .editor-savebar {
    padding: 10px 16px;
    gap: 8px;
    flex-wrap: wrap;
  }
  .editor-save-status {
    width: 100%;
    text-align: center;
  }
  .editor-save-actions {
    flex-wrap: wrap;
    width: 100%;
  }
  .editor-save-actions .btn {
    width: 100%;
    box-sizing: border-box;
    justify-content: center;
  }
}

/* ─── Animações de entrada premium — intro screen hero ───────────────────── */

@keyframes introHeroPhotoReveal {
    from {
        opacity: 0;
        transform: scale(1.04);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

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

@keyframes introHeroBtnReveal {
    from { opacity: 0; }
    to   { opacity: 1; }
}

.anim-hero-photo {
    will-change: opacity, transform;
    animation: introHeroPhotoReveal 0.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0s both;
}

.anim-hero-name {
    will-change: opacity, transform;
    animation: introHeroTextReveal 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.2s both;
}

.anim-hero-subtitle {
    will-change: opacity, transform;
    animation: introHeroTextReveal 0.7s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.35s both;
}

.anim-hero-btn {
    will-change: opacity;
    animation: introHeroBtnReveal 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.5s both;
}

@media (prefers-reduced-motion: reduce) {
    .anim-hero-photo,
    .anim-hero-name,
    .anim-hero-subtitle,
    .anim-hero-btn {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* ─── Animações de entrada premium — hero principal pós-abertura ─────────── */

@keyframes heroPhotoReveal {
    from { opacity: 0; transform: scale(1.05); }
    to   { opacity: 1; transform: scale(1); }
}

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

.anim-main-photo {
    animation: heroPhotoReveal 2.2s cubic-bezier(0.25, 0.46, 0.45, 0.94) both;
    will-change: opacity, transform;
}

.anim-main-name {
    animation: heroTextReveal 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 0.6s both;
    will-change: opacity, transform;
}

.anim-main-subtitle {
    animation: heroTextReveal 1.8s cubic-bezier(0.25, 0.46, 0.45, 0.94) 1.1s both;
    will-change: opacity, transform;
}

@media (prefers-reduced-motion: reduce) {
    .anim-main-photo,
    .anim-main-name,
    .anim-main-subtitle {
        animation: none;
        opacity: 1;
        transform: none;
    }
}
