@import url('https://fonts.googleapis.com/css2?family=Instrument+Serif:ital@0;1&display=swap');

/* Local UI font — TWK Lausanne (selected weights) */
@font-face {
    font-family: 'TWK Lausanne';
    src: url('fonts/TWKLausanne-400.woff2') format('woff2'),
        url('fonts/TWKLausanne-400.woff') format('woff');
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TWK Lausanne';
    src: url('fonts/TWKLausanne-700.woff2') format('woff2'),
        url('fonts/TWKLausanne-700.woff') format('woff');
    font-weight: 700;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'TWK Lausanne';
    src: url('fonts/TWKLausanne-800.woff2') format('woff2'),
        url('fonts/TWKLausanne-800.woff') format('woff');
    font-weight: 800;
    font-style: normal;
    font-display: swap;
}

* {
    font-family: "Instrument Serif", serif;
}

body {
    background-color: black;
    position: relative;
    height: 100dvh;
    width: 100dvw;
    max-width: 100%;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

img.header-logo {
    position: absolute;
    height: clamp(72px, 12vw, 150px);
    top: 0;
    left: 2rem;
}

p.text-bg {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    margin-bottom: 0;
    color: #373737;
    font-size: 6dvw;
    font-weight: 400;
    letter-spacing: 0;
    width: 100%;
    text-align: center;
    z-index: 0;
}

header.header-title,
div.body-inputs,
div.body-text {
    z-index: 1;
}

header.header-title {
    margin-top: auto;
    padding-top: 5rem;
    /* ensure at least 5rem visual offset from top */
}

header.header-title p {
    color: white;
    font-size: clamp(28px, 6vw, 50px);
    font-weight: 400;
}

div.participant-row {
    margin-left: 0;
    margin-right: 0;
    text-align: center;
    gap: 0.5rem;
}

div.body-inputs {
    width: 40%;
    margin-top: 2rem;
    display: flex;
    flex-direction: column;
    row-gap: 0.75rem;
    overflow-y: auto;
    max-height: 45dvh;
    overscroll-behavior: contain;
    scrollbar-gutter: stable both-edges;
    padding-bottom: 5px;
}

div.body-inputs input.input-email,
div.body-inputs input.input-name {
    background-color: black;
    border: 1px solid white;
    color: #FFFFFF;
    font-size: 18px;
    font-weight: 400;
    padding: 5px 25px;
    border-radius: 1000px;
    width: 100%;
}

/* Input placeholders use Lausanne for crisp UI text */
.body-inputs input::placeholder {
    font-family: 'TWK Lausanne', system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    font-weight: 400;
}
.body-inputs input::-webkit-input-placeholder {
    font-family: 'TWK Lausanne', system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    font-weight: 400;
}
.body-inputs input::-moz-placeholder {
    font-family: 'TWK Lausanne', system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    font-weight: 400;
}

div.body-inputs button {
    background: none;
    border: none;
    border-radius: 50%;
    padding: 0;
}

div.body-inputs button img {
    height: 35px;
}

/* Remove button (text “×”) for extra participants */
div.body-inputs button.remove-button {
    color: #FFFFFF;
    font-size: 28px;
    line-height: 1;
    cursor: pointer;
    border-radius: 0;
    padding: 0 6px;
}

div.body-text {
    color: white;
    font-size: clamp(24px, 6vw, 50px);
    font-weight: 400;
    margin-top: auto;
}

div.body-submit button.btn-submit {
    color: #686868;
    background-color: #FFF7F7;
    padding: 7px 50px;
    font-weight: 700;
    font-family: 'TWK Lausanne', system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    margin-top: 1rem;
}

div.footer-cta {
    margin-top: auto;
}

div.footer-cta a {
    color: #8C8C8C;
    text-decoration: none;
    font-weight: 400;
    font-family: 'TWK Lausanne', system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

div.footer-cta a strong {
    font-weight: 800;
    font-family: 'TWK Lausanne', system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
    color: white;
}

footer.footer-links {
    margin-right: auto;
}

footer.footer-links ul {
    display: flex;
    gap: 5rem;
    margin-top: 3rem;
    flex-direction: row;
    list-style: none;
}

footer.footer-links ul li,
footer.footer-links ul li a {
    color: white;
    font-weight: 400;
    font-size: 10px;
    font-family: 'TWK Lausanne', system-ui, -apple-system, "Segoe UI", Arial, sans-serif;
}

footer.footer-links ul li a {
    text-decoration: none;
}

/* Basic validation state */
div.body-inputs input.invalid {
    border-color: #FF4D4F;
}

/* Clean, minimal scrollbars (page) */
html,
body {
    scrollbar-width: thin;
    /* Firefox */
    scrollbar-color: #3A3A3A #0F0F0F;
    /* thumb, track */
}

body::-webkit-scrollbar {
    /* Chrome/Edge/Safari */
    width: 10px;
    height: 10px;
    right: -100px;
}

body::-webkit-scrollbar-track {
    background: #0F0F0F;
}

body::-webkit-scrollbar-thumb {
    background-color: #3A3A3A;
    border-radius: 999px;
    border: 2px solid #0F0F0F;
    /* inset look on dark bg */
}

body::-webkit-scrollbar-thumb:hover {
    background-color: #555555;
}

body::-webkit-scrollbar-corner {
    background: #0F0F0F;
}

/* Clean, minimal scrollbars (participants list) */
.body-inputs {
    scrollbar-width: thin;
    scrollbar-color: rgba(0, 0, 0, 0) transparent;
    transition: ease-in-out scrollbar-color 0.2s;
}

.body-inputs:hover {
    scrollbar-color: #555555 transparent;
}

/* WebKit: hide by default, show on hover */
.body-inputs::-webkit-scrollbar {
    width: 0;
    /* hidden */
}

.body-inputs:hover::-webkit-scrollbar {
    width: 8px;
    /* show on hover */
}

.body-inputs::-webkit-scrollbar-track {
    background: transparent;
}

.body-inputs::-webkit-scrollbar-thumb {
    background-color: #555555;
    border-radius: 999px;
    border: 2px solid transparent;
    /* slim pill on transparent track */
}

.body-inputs:hover::-webkit-scrollbar-thumb:hover {
    background-color: #777777;
}

/* Tablet adjustments */
@media (max-width: 991.98px) {
    header.header-title {
        margin-top: auto;
        padding-top: 5rem;
    }

    div.body-inputs {
        width: 60%;
    }

    /* Place name and plus/remove inline; email spans full width */
    .participant-row {
        display: grid;
        grid-template-columns: 1fr auto;
        column-gap: 0.5rem;
        row-gap: 0.5rem;
        align-items: center;
        text-align: initial;
    }

    .participant-row>.col:first-child {
        /* email */
        grid-column: 1 / -1;
    }

    .participant-row>.col:nth-child(2) {
        /* name */
        grid-column: 1;
    }

    .participant-row>.col-auto {
        /* plus/remove */
        grid-column: 2;
        justify-self: end;
    }

    .col-1 {
        width: auto;
        padding: 0;
    }

    .participant-remove {
        display: flex;
    }

    .remove-button {
        margin-top: auto;
        margin-bottom: auto;
    }
}

/* Mobile adjustments */
@media (max-width: 575.98px) {
    header.header-title {
        margin-top: auto;
        padding-top: 5rem;
    }

    .col-1 {
        width: auto;
        padding: 0;
    }

    .participant-remove {
        display: flex;
    }

    .remove-button {
        margin-top: auto;
        margin-bottom: auto;
    }

    div.body-inputs {
        width: 90%;
        max-height: 38dvh;
    }

    /* Keep name + plus/remove inline; email spans full width */
    .participant-row {
        display: grid;
        grid-template-columns: 1fr auto;
        column-gap: 0.5rem;
        row-gap: 0.5rem;
        align-items: center;
        text-align: initial;
    }

    .participant-row>.col:first-child {
        grid-column: 1 / -1;
    }

    .participant-row>.col:nth-child(2) {
        grid-column: 1;
    }

    .participant-row>.col-auto {
        grid-column: 2;
        justify-self: end;
    }

    /* Slightly smaller icons on small screens */
    div.body-inputs button img {
        height: 28px;
    }

    div.body-inputs button.remove-button {
        font-size: 24px;
    }

    /* Footer wraps with tighter gaps */
    footer.footer-links ul {
        flex-wrap: wrap;
        gap: 1.25rem;
        row-gap: 0.5rem;
    }

    /* Logo edge breathing space */
    img.header-logo {
        left: 1rem;
    }
}

/* ==== Motion & Micro-interactions (appended) ==== */
/* Respect reduced-motion preferences */
@media (prefers-reduced-motion: reduce) {

    *,
    *::before,
    *::after {
        animation: none !important;
        transition: none !important;
        scroll-behavior: auto !important;
    }
}

/* Subtle background drift for motto */
p.text-bg {
    will-change: transform, opacity;
    animation: bg-drift 18s ease-in-out 1s infinite alternate;
}

/* Staggered fade-ups on load */
header.header-title p {
    animation: fade-up .6s ease-out .1s both;
}

div.body-inputs {
    animation: fade-up .6s ease-out .2s both;
}

div.body-text {
    animation: fade-up .6s ease-out .3s both;
}

/* Inputs focus glow */
div.body-inputs input.input-email,
div.body-inputs input.input-name {
    transition: border-color .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
}

div.body-inputs input.input-email:focus,
div.body-inputs input.input-name:focus {
    outline: none;
    border-color: #FFFFFF;
    box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.08);
}

/* Add button micro-interaction */
div.body-inputs button {
    cursor: pointer;
}

div.body-inputs button img {
    transition: transform .2s ease, filter .2s ease;
}

div.body-inputs button.add-button:hover img {
    transform: scale(1.06) rotate(3deg);
    filter: brightness(1.15);
}

div.body-inputs button.add-button:active img {
    transform: scale(0.98);
}

/* Remove button micro-interaction */
div.body-inputs button.remove-button {
    transition: transform .18s ease, color .18s ease;
}

div.body-inputs button.remove-button:hover {
    transform: rotate(90deg) scale(1.08);
    color: #E6E6E6;
}

div.body-inputs button.remove-button:active {
    transform: rotate(90deg) scale(0.96);
}

/* Submit hover */
div.body-submit button.btn-submit {
    transition: transform .2s ease, box-shadow .2s ease, background-color .2s ease, color .2s ease;
}

div.body-submit button.btn-submit:hover {
    transform: translateY(-1px);
    box-shadow: 0 6px 20px rgba(255, 247, 247, 0.06);
}

div.body-submit button.btn-submit:active {
    transform: translateY(0);
}

/* Footer link hover */
div.footer-cta a {
    transition: color .2s ease;
}

div.footer-cta a:hover {
    color: #B3B3B3;
}

/* Participant row enter/leave */
.participant-row.appear {
    animation: row-enter .24s ease-out both;
}

.participant-row.leaving {
    animation: row-leave .18s ease-in both;
}

/* Keyframes */
@keyframes fade-up {
    from {
        opacity: 0;
        transform: translateY(12px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes bg-drift {
    0% {
        opacity: 0.32;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 0.38;
        transform: translate(-50%, -50%) scale(1.02);
    }
}

@keyframes row-enter {
    from {
        opacity: 0;
        transform: translateY(8px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes row-leave {
    from {
        opacity: 1;
        transform: translateY(0);
    }

    to {
        opacity: 0;
        transform: translateY(-6px);
    }
}