@property --blob1-x {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 5%;
}

@property --blob1-y {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 85%;
}

@property --blob2-x {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 15%;
}

@property --blob2-y {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 65%;
}

@property --blob3-x {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 35%;
}

@property --blob3-y {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 50%;
}

@property --blob4-x {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 55%;
}

@property --blob4-y {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 30%;
}

@property --blob5-x {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 75%;
}

@property --blob5-y {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 60%;
}

@property --blob6-x {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 90%;
}

@property --blob6-y {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 20%;
}

@property --blob7-x {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 25%;
}

@property --blob7-y {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 15%;
}

@property --blob8-x {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 65%;
}

@property --blob8-y {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 80%;
}

@property --blob9-x {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 45%;
}

@property --blob9-y {
    syntax: '<percentage>';
    inherits: false;
    initial-value: 70%;
}

:root {
    --bg-color: #0a0a0a;
    --text-color: #ffffff;
    --accent-color: #444444;
    --secondary-color: #bbbbbb;
}

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

body {
    background-color: var(--bg-color);
    color: var(--text-color);
    font-family: 'Inter', sans-serif;
    letter-spacing: -0.02em;
    overflow-x: hidden;
    min-height: 100vh;
    width: 100vw;
    scrollbar-width: none;
}

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

body.no-scroll {
    overflow: hidden;
    height: 100vh;
}

#app {
    position: relative;
    width: 100%;
    height: 100%;
    z-index: 10;
}

#word-container {
    position: absolute;
    /* Centered base position */
    top: 50%;
    left: 50%;
    width: 100vw;
    height: 100vh;
    transform: translate(-50%, -50%);
    will-change: transform;
}

/* During physics animation, lock dimensions to pixels so resize can't affect layout */
#word-container.animating {
    width: var(--locked-width);
    height: var(--locked-height);
}

.letter {
    position: absolute;
    font-size: 15vw;
    /* MASSIVE typography */
    font-weight: 900;
    line-height: 1;
    letter-spacing: -0.06em;

    color: var(--text-color);

    text-transform: lowercase;
    user-select: none;
    transform-origin: center center;
    top: 0;
    left: 0;
    will-change: transform;
}

/* During physics animation, lock font-size to pixels so resize can't desync */
.letter-physics {
    font-size: var(--locked-font-size);
}

.stabilize-transition {
    /* When letters snap into their final target positions, smooth it out */
    transition: transform 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

#word-container.frozen {
    top: 3vh;
    left: 3vw;
    width: auto;
    height: auto;
    transform: none;
    display: flex;
    align-items: center;
    white-space: nowrap;
    letter-spacing: -0.06em;
}

.letter-frozen {
    position: relative !important;
    transform: none !important;
    font-size: min(6vw, 72px) !important;
}

#content-section {
    position: absolute;
    top: 18vh;
    left: 50%;
    transform: translateX(-50%);
    width: 80vw;
    max-width: 900px;
    text-align: center;
    opacity: 0;
    transition: opacity 1s ease;
}

.tagline {
    font-size: min(4vw, 48px);
    font-weight: 900;
    color: var(--text-color);
    margin-bottom: 2rem;
}

.sponsor-label {
    font-size: min(1.4vw, 17px);
    color: var(--secondary-color);
    margin-bottom: 1rem;
    font-weight: 900;
    letter-spacing: 0.12em;
}

.sponsor-row {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 3rem;
}

.sponsor {
    font-size: min(2.4vw, 29px);
    font-weight: 900;
    color: var(--text-color);
}

.sponsor-more {
    font-size: min(1.7vw, 20px);
    font-weight: 900;
    color: var(--secondary-color);
    font-style: italic;
    letter-spacing: 0.01em;
    margin-top: 0.75rem;
    text-align: center;
}

.prizes {
    font-size: min(2vw, 24px);
    font-weight: 900;
    color: var(--secondary-color);
    font-style: italic;
    letter-spacing: 0.01em;
    margin-top: 1.5rem;
}

.divider {
    border: none;
    border-top: 2px solid var(--accent-color);
    margin: 2rem 4rem;
}

.format-section {
    max-width: 800px;
    margin: 0 auto;
    text-align: center;
}

.event-block {
    margin-bottom: 2rem;
}

.event-date {
    font-size: min(1.9vw, 23px);
    font-weight: 900;
    color: var(--text-color);
    margin-bottom: 0.5rem;
}

.event-desc {
    font-size: min(1.4vw, 17px);
    font-weight: 900;
    color: var(--secondary-color);
    letter-spacing: 0.02em;
}

.event-highlights {
    list-style: none;
    padding: 0;
    font-size: min(1.4vw, 17px);
    font-weight: 900;
    color: var(--secondary-color);
    letter-spacing: 0.02em;
}

.event-highlights li {
    margin-bottom: 0.3rem;
}

.signup-btn {
    display: inline-block;
    margin-top: 2.5rem;
    padding: 1rem 3rem;
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    font-size: min(1.6vw, 19px);
    letter-spacing: -0.02em;
    text-transform: lowercase;
    text-decoration: none;
    color: var(--bg-color);
    background: var(--text-color);
    border: none;
    cursor: pointer;
    transition: transform 0.2s ease, opacity 0.2s ease;
}

.signup-btn:hover {
    transform: scale(1.05);
    opacity: 0.9;
}

.signup-page {
    position: relative;
    z-index: 10;
    max-width: 560px;
    margin: 0 auto;
    padding: 3rem 2rem 4rem;
}

.back-link {
    display: inline-block;
    font-size: 1.1rem;
    font-weight: 900;
    color: var(--secondary-color);
    text-decoration: none;
    margin-bottom: 2rem;
    letter-spacing: -0.04em;
    transition: color 0.2s ease;
}

.back-link:hover {
    color: var(--text-color);
}

.signup-title {
    font-size: 3rem;
    font-weight: 900;
    color: var(--text-color);
    margin-bottom: 2.5rem;
    letter-spacing: -0.03em;
}

.form-group {
    margin-bottom: 1.5rem;
    position: relative;
}

.form-group label {
    display: block;
    font-size: 0.85rem;
    font-weight: 900;
    color: var(--secondary-color);
    margin-bottom: 0.4rem;
    letter-spacing: 0.02em;
}

.form-group input[type="text"],
.form-group input[type="email"],
.form-group input[type="url"],
.form-group input[type="month"] {
    width: 100%;
    padding: 0.75rem 1rem;
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    font-size: 1rem;
    color: var(--text-color);
    background: rgba(255, 255, 255, 0.06);
    border: 2px solid var(--accent-color);
    outline: none;
    letter-spacing: -0.03em;
    transition: border-color 0.2s ease;
}

.form-group input:focus {
    border-color: rgba(200, 50, 180, 0.6);
}

.autocomplete-dropdown {
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: #1a1a1a;
    border: 2px solid var(--accent-color);
    border-top: none;
    max-height: 200px;
    overflow-y: auto;
    z-index: 50;
    display: none;
}

.autocomplete-dropdown.open {
    display: block;
}

.autocomplete-option {
    padding: 0.6rem 1rem;
    font-family: 'Inter', sans-serif;
    font-weight: 900;
    font-size: 0.9rem;
    color: var(--secondary-color);
    cursor: pointer;
    letter-spacing: -0.03em;
}

.autocomplete-option:hover,
.autocomplete-option.active {
    background: rgba(200, 50, 180, 0.15);
    color: var(--text-color);
}

.file-upload-area {
    padding: 1.5rem;
    border: 2px dashed var(--accent-color);
    text-align: center;
    cursor: pointer;
    transition: border-color 0.2s ease;
}

.file-upload-area:hover {
    border-color: rgba(200, 50, 180, 0.6);
}

.file-upload-hint {
    font-size: 0.9rem;
    font-weight: 900;
    color: var(--secondary-color);
    letter-spacing: -0.02em;
}

.file-upload-name {
    font-size: 0.85rem;
    font-weight: 900;
    color: var(--text-color);
    margin-top: 0.5rem;
}

.form-submit {
    width: 100%;
    margin-top: 1rem;
}

.form-status {
    margin-top: 1.5rem;
    font-size: 0.95rem;
    font-weight: 900;
    text-align: center;
    letter-spacing: -0.02em;
}

.form-status.success {
    color: #66ff88;
}

.form-status.error {
    color: #ff6666;
}

.optional-hint {
    font-size: 0.75rem;
    color: var(--secondary-color);
    font-weight: 900;
    font-style: italic;
}

.required {
    color: #ff6666;
}

@media (max-width: 768px) {
    .letter-frozen {
        font-size: 10vw !important;
    }

    #content-section {
        top: 20vh;
    }

    .tagline {
        font-size: 8vw;
    }

    .sponsor-label {
        font-size: 3.5vw;
    }

    .sponsor-row {
        gap: 1.5rem;
    }

    .sponsor {
        font-size: 6vw;
    }

    .sponsor-more {
        font-size: 4.5vw;
    }

    .prizes {
        font-size: 5vw;
    }

    .divider {
        margin: 1.5rem 2rem;
    }

    .format-section {
        max-width: 90vw;
    }

    .event-date {
        font-size: 5vw;
    }

    .event-desc {
        font-size: 4vw;
    }

    .event-highlights {
        font-size: 4vw;
    }

    .signup-btn {
        font-size: 4.5vw;
        padding: 0.8rem 2rem;
    }

    .signup-page {
        padding: 2rem 1.2rem 3rem;
    }

    .signup-title {
        font-size: 2rem;
    }
}

body::before {
    content: '';
    position: fixed;
    top: 0; left: 0;
    width: 100%; height: 100%;
    background:
        radial-gradient(ellipse 70% 70% at var(--blob1-x) var(--blob1-y), rgba(220, 200, 210, 0.35) 0%, transparent 50%),
        radial-gradient(ellipse 40% 40% at var(--blob1-x) calc(var(--blob1-y) + 6%), rgba(240, 210, 230, 0.22) 0%, transparent 45%),
        radial-gradient(ellipse 80% 80% at var(--blob2-x) var(--blob2-y), rgba(200, 50, 180, 0.38) 0%, transparent 50%),
        radial-gradient(ellipse 40% 40% at calc(var(--blob2-x) + 8%) var(--blob2-y), rgba(220, 80, 200, 0.22) 0%, transparent 45%),
        radial-gradient(ellipse 85% 85% at var(--blob3-x) var(--blob3-y), rgba(60, 40, 220, 0.42) 0%, transparent 50%),
        radial-gradient(ellipse 45% 45% at calc(var(--blob3-x) - 6%) calc(var(--blob3-y) + 8%), rgba(80, 60, 240, 0.25) 0%, transparent 45%),
        radial-gradient(ellipse 35% 35% at calc(var(--blob3-x) + 10%) calc(var(--blob3-y) - 5%), rgba(100, 50, 200, 0.18) 0%, transparent 40%),
        radial-gradient(ellipse 65% 65% at var(--blob4-x) var(--blob4-y), rgba(50, 30, 200, 0.38) 0%, transparent 50%),
        radial-gradient(ellipse 35% 35% at calc(var(--blob4-x) + 7%) calc(var(--blob4-y) + 10%), rgba(70, 40, 230, 0.18) 0%, transparent 40%),
        radial-gradient(ellipse 55% 55% at var(--blob5-x) var(--blob5-y), rgba(30, 20, 120, 0.32) 0%, transparent 50%),
        radial-gradient(ellipse 70% 70% at var(--blob6-x) var(--blob6-y), rgba(20, 100, 50, 0.28) 0%, transparent 50%),
        radial-gradient(ellipse 38% 38% at calc(var(--blob6-x) - 5%) calc(var(--blob6-y) + 7%), rgba(30, 130, 60, 0.18) 0%, transparent 45%),
        radial-gradient(ellipse 30% 30% at calc(var(--blob6-x) + 8%) calc(var(--blob6-y) - 4%), rgba(40, 150, 70, 0.12) 0%, transparent 40%),
        radial-gradient(ellipse 55% 55% at var(--blob7-x) var(--blob7-y), rgba(160, 70, 30, 0.22) 0%, transparent 50%),
        radial-gradient(ellipse 30% 30% at calc(var(--blob7-x) + 6%) calc(var(--blob7-y) - 5%), rgba(140, 60, 20, 0.14) 0%, transparent 45%),
        radial-gradient(ellipse 60% 60% at var(--blob8-x) var(--blob8-y), rgba(15, 80, 80, 0.3) 0%, transparent 50%),
        radial-gradient(ellipse 32% 32% at calc(var(--blob8-x) + 7%) var(--blob8-y), rgba(20, 110, 100, 0.18) 0%, transparent 45%),
        radial-gradient(ellipse 50% 50% at var(--blob9-x) var(--blob9-y), rgba(140, 55, 25, 0.2) 0%, transparent 50%),
        radial-gradient(ellipse 28% 28% at calc(var(--blob9-x) - 6%) calc(var(--blob9-y) + 6%), rgba(120, 50, 20, 0.14) 0%, transparent 40%);
    z-index: 1;
    pointer-events: none;
}

#grain-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 2;
    pointer-events: none;
    opacity: 0.15;
}

#glow-layer {
    position: fixed;
    top: -50%;
    left: -50%;
    width: 200%;
    height: 200%;
    filter: url(#grain);
    opacity: 0.3;
    pointer-events: none;
    z-index: 100;
}
