/* Design tokens: Interfood green and grey from the brand guidelines, the night blue of the save-the-date film. */
:root {
    --color-primary: #2bb353;
    --color-primary-hover: #45c96b;
    --color-on-primary: #06120a;
    --color-text: #ffffff;
    --color-text-muted: #aeb4c6;
    --color-background: #0a0e1e;
    --color-surface: #10162e;
    --color-border: #232b4a;
    --color-glow: rgb(43 179 83 / 0.18);
    --color-error: #ff8a80;

    --font-family-base: "Outfit", system-ui, sans-serif;
    --font-family-heading: var(--font-family-base);
    --font-size-base: 1.125rem;
    --font-size-lead: clamp(1.25rem, 1.1rem + 0.6vw, 1.5rem);
    --font-size-title: clamp(1.875rem, 1.1rem + 3.6vw, 4.5rem);
    --font-size-display: clamp(2.25rem, 1.2rem + 5vw, 6rem);
    --line-height-base: 1.6;

    --radius: 1rem;
    --container-width: 75rem;
    --text-width: 42rem;
    --gutter: 1.5rem;
}

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

body {
    margin: 0;
    font-family: var(--font-family-base);
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    color: var(--color-text);
    background: var(--color-background);
    -webkit-font-smoothing: antialiased;
}

img,
video {
    display: block;
    max-width: 100%;
    height: auto;
}

h1,
h2,
h3 {
    font-family: var(--font-family-heading);
    font-weight: 500;
    line-height: 1.1;
    margin: 0;
}

p {
    margin: 0;
}

a {
    color: inherit;
}

:focus-visible {
    outline: 2px solid var(--color-primary);
    outline-offset: 4px;
}

.container {
    width: 100%;
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 var(--gutter);
}

.section {
    padding: clamp(4rem, 3rem + 4vw, 7rem) 0;
}

.section + .section {
    padding-top: 0;
}

/* Moving points of light behind everything: hundreds of individuals, not yet one whole */
.lights {
    position: fixed;
    inset: 0;
    z-index: -1;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

/* Header */
.site-header {
    padding: 1.75rem 0;
}

.site-header .container {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 1rem;
}

.site-header-logo img {
    width: 11rem;
}

.site-header-event {
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

/* Hero: the headline and the film, together in the first screen */
.hero {
    padding: clamp(1rem, 4vh, 3rem) 0 0;
    text-align: center;
}

.hero-title {
    font-size: var(--font-size-title);
    letter-spacing: 0.01em;
    text-transform: uppercase;
}

.film {
    position: relative;
    width: min(100%, (100svh - 21rem) * 16 / 9);
    min-width: min(100%, 40rem);
    margin: clamp(1.5rem, 4vh, 3rem) auto 0;
    overflow: hidden;
    border: 1px solid var(--color-border);
    border-radius: var(--radius);
    background: var(--color-surface);
    box-shadow: 0 0 6rem var(--color-glow);
    aspect-ratio: 16 / 9;
}

.film-video {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.film-sound {
    position: absolute;
    left: 50%;
    bottom: 1.25rem;
    display: inline-flex;
    align-items: center;
    gap: 0.6rem;
    padding: 0.7rem 1.25rem;
    border: 1px solid rgb(255 255 255 / 0.35);
    border-radius: 999px;
    font: inherit;
    font-size: 1rem;
    font-weight: 500;
    color: var(--color-text);
    background: rgb(10 14 30 / 0.6);
    backdrop-filter: blur(8px);
    white-space: nowrap;
    cursor: pointer;
    transform: translateX(-50%);
    transition: background-color 0.2s, border-color 0.2s;
}

.film-sound:hover {
    border-color: var(--color-primary);
    background: rgb(10 14 30 / 0.85);
}

.film-sound svg {
    width: 1.25rem;
    height: 1.25rem;
    fill: var(--color-primary);
}

/* Above the browser's own controls when they show (no autoplay, reduced motion) */
.film-video[controls] + .film-sound {
    bottom: 4.5rem;
}

.film-sound[hidden] {
    display: none;
}

/* Intro text */
.intro {
    max-width: var(--text-width);
    margin: 0 auto;
    text-align: center;
}

.intro p + p {
    margin-top: 1.5rem;
}

.intro-lead {
    font-size: var(--font-size-lead);
    color: var(--color-text-muted);
}

.intro-teaser {
    font-size: var(--font-size-lead);
    font-weight: 500;
}

/* Save the date */
.save-the-date {
    max-width: 52rem;
    margin: 0 auto;
    padding: clamp(2.5rem, 2rem + 3vw, 4.5rem) var(--gutter);
    border: 1px solid var(--color-border);
    border-radius: calc(var(--radius) * 1.5);
    background: radial-gradient(ellipse at 50% 0%, var(--color-glow), transparent 70%), var(--color-surface);
    text-align: center;
}

.save-the-date-mark {
    width: 2.25rem;
    margin: 0 auto 1.5rem;
}

.save-the-date-title {
    font-size: var(--font-size-display);
    font-weight: 600;
    text-transform: uppercase;
    color: var(--color-primary);
}

.save-the-date-dates {
    margin-top: 0.75rem;
    font-size: var(--font-size-title);
    font-weight: 500;
    line-height: 1.1;
    text-transform: uppercase;
}

.save-the-date-event {
    margin-top: 1rem;
    font-size: 1rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.save-the-date-note {
    max-width: 32rem;
    margin: 2rem auto 0;
    color: var(--color-text-muted);
}

.save-the-date-action {
    margin-top: 2.5rem;
}

/* Button */
.button {
    display: inline-flex;
    align-items: center;
    gap: 0.75rem;
    min-height: 3.5rem;
    padding: 0.875rem 1.75rem;
    border: 0;
    border-radius: 999px;
    font: inherit;
    font-weight: 600;
    text-decoration: none;
    color: var(--color-on-primary);
    background: var(--color-primary);
    cursor: pointer;
    transition: background-color 0.2s, transform 0.2s;
}

.button:hover {
    background: var(--color-primary-hover);
    transform: translateY(-2px);
}

.button svg {
    flex: none;
    width: 1.25rem;
    height: 1.25rem;
    fill: currentColor;
}

/* Panel: the password page and the 404 */
.panel {
    max-width: 32rem;
    margin: 0 auto;
    padding: clamp(2.5rem, 2rem + 2vw, 3.5rem) clamp(var(--gutter), 1rem + 2.5vw, 3.5rem);
    border: 1px solid var(--color-border);
    border-radius: calc(var(--radius) * 1.5);
    background: radial-gradient(ellipse at 50% 0%, var(--color-glow), transparent 70%), var(--color-surface);
    text-align: center;
}

.panel-mark {
    width: 2.25rem;
    margin: 0 auto 1.5rem;
}

.panel-title {
    font-size: clamp(1.75rem, 1.25rem + 1.5vw, 2.75rem);
    text-transform: uppercase;
}

.panel-note {
    margin-top: 1rem;
    color: var(--color-text-muted);
    text-wrap: balance;
}

.panel-action {
    margin-top: 2rem;
}

/* Login form on the password page */
.login-form {
    display: grid;
    gap: 0.75rem;
    margin-top: 2rem;
    text-align: left;
}

.login-form-label {
    padding: 0 1.25rem;
    font-size: 0.875rem;
    font-weight: 500;
    letter-spacing: 0.14em;
    text-transform: uppercase;
    color: var(--color-text-muted);
}

.login-form-input {
    min-height: 3.5rem;
    padding: 0 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    font: inherit;
    color: var(--color-text);
    background: var(--color-background);
}

.login-form-input[aria-invalid="true"] {
    border-color: var(--color-error);
}

.login-form-error {
    padding: 0 1.25rem;
    font-size: 1rem;
    color: var(--color-error);
}

.login-form .button {
    justify-content: center;
    margin-top: 0.75rem;
}

/* Preview bar: only for visitors who logged in while the site is in preview */
body:has(.preview-bar) {
    padding-bottom: 4.5rem;
}

.preview-bar {
    position: fixed;
    left: 1rem;
    bottom: 1rem;
    z-index: 100;
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 0.25rem 1rem;
    padding: 0.5rem 0.5rem 0.5rem 1.25rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    font-size: 0.875rem;
    background: rgb(16 22 46 / 0.9);
    backdrop-filter: blur(8px);
}

.preview-bar-label {
    font-weight: 500;
    color: var(--color-primary);
}

.preview-bar form {
    display: contents;
}

.preview-bar-action {
    padding: 0.4rem 0.9rem;
    border: 1px solid var(--color-border);
    border-radius: 999px;
    font: inherit;
    color: var(--color-text);
    background: none;
    cursor: pointer;
}

.preview-bar-action:hover {
    border-color: var(--color-primary);
}

/* Footer */
.site-footer {
    padding: 2.5rem 0;
    font-size: 0.875rem;
    color: var(--color-text-muted);
}

.site-footer .container {
    display: flex;
    align-items: center;
    justify-content: center;
}

@media (max-width: 40rem) {
    :root {
        --gutter: 1rem;
    }

    .site-header-logo img {
        width: 8.5rem;
    }

    .site-header-event {
        font-size: 0.75rem;
    }

    .film {
        min-width: 0;
    }

    .film-sound {
        bottom: 0.75rem;
        padding: 0.5rem 1rem;
        font-size: 0.875rem;
    }

    .film-video[controls] + .film-sound {
        bottom: 3.5rem;
    }

    .save-the-date-event {
        font-size: 0.8125rem;
        letter-spacing: 0.08em;
    }

    .preview-bar {
        right: 1rem;
        justify-content: center;
        border-radius: var(--radius);
    }

    .button {
        width: 100%;
        justify-content: center;
        gap: 0.5rem;
        padding: 0.875rem 1rem;
        font-size: 1rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    .button,
    .film-sound {
        transition: none;
    }

    .button:hover {
        transform: none;
    }
}
