:root {
    font-size: 1rem;
    background: #bbbac9;
    color-scheme: dark;
    scroll-behavior: smooth;
}

* {
    transition: all 0.5s;
    font-family: "Figtree", sans-serif;
    color: white;
}

@property --grad-1 {
    syntax: '<color>';
    initial-value: rgb(184 193 215);
    inherits: true;
}

@property --grad-2 {
    syntax: '<color>';
    initial-value: rgb(247 177 176);
    inherits: true;
}

:root {
    --grad-1: rgb(184 193 215);
    --grad-2: rgb(247 177 176);

    background:--grad-1;
    transition: --grad-1 0s, --grad-2 0s;
}

body {
    --scroll:0;
    margin: 0;
    padding: 0;
    height: 100svh;
    max-height: 100svh;
    overflow: hidden auto;

    position: relative;
}

#bg, #orange, #stars {
    position:fixed;
    z-index:-7;
    inset:0;
}

/* Sky */
#bg {
    background: var(--grad-1);
    background: linear-gradient(var(--grad-1) 0%, var(--grad-2) 100%);
    transition: background 0s, opacity 1s;
    transition-timing-function: linear;
}

/* Mountain */
#bg::before {
    content: "";
    display: block;
    position: absolute;
    inset:0;
    z-index:-6;
    background-image: url("/?originalUrl=https%3A%2F%2Fhackphs.tech%2Fstatic%2Fmountain.svg");

    background-repeat: no-repeat;
    background-position-x: center;
    background-position-y: calc(50% + var(--scroll)*100vh);
    background-size: cover;
    /* filter: blur(min(calc(max(var(--scroll)-0,0) * 8rem),2rem)); */

    transition: filter 0.2s, background-position-y 0.2s, opacity 1s, transform 1s;
}

/* Stars */
#bg::after {
    content: "";
    display: block;
    position: absolute;
    inset:0;
    z-index:-8;
    /* background: #df763308; */
    background-image: url("/?originalUrl=https%3A%2F%2Fhackphs.tech%2Fstatic%2Fstars.svg");

    background-repeat: no-repeat;
    background-position-x: center;
    background-position-y: calc(50% + var(--scroll)*3vh);
    background-size: cover;
    opacity:1;
    /* transform: scale(1.2); */
    /* filter: blur(min(calc(var(--scroll) * 4rem),2rem)); */

    transition:filter 0.2s, opacity 1s, transform 0.2s;
}

@media screen and (max-width:650px) {
    #bg::after {
        opacity: calc(1 - var(--scroll) * var(--scroll));
    }
}

#bg.no::before {
    /* opacity:0; */
    transform:translateY(100vh);
}

@property --anim-time {
    syntax: '<number>';
    inherits: false;
    initial-value: 0;
}

@keyframes twinkle {
    0% {
        --anim-time: 0.0;
    }
    50% {
        --anim-time: 0.5;
    }
    100% {
        --anim-time: 1.0;
    }
}

#stars div.star {
    --scale: calc((var(--scroll) + 1) * var(--scroll));
    --offset:0;
    --x-pos:1;
    --y-pos:1;
    --spd:1;
    /* --anim-time: 0; */

    /* opacity:calc(var(--scale) * sin(calc((var(--time) + var(--offset)) * 1deg))); */
    opacity: calc(var(--scroll) * min(max(sin(var(--anim-time) * 2 * 3.1415 * var(--spd)) * 2 - 1,0),1));
    /* --scale: var(--anim-time); */
    position:absolute;
    width:calc(0.4rem + var(--offset)*0.075rem);
    height:calc(0.4rem + var(--offset)*0.075rem);
    transform:scale(var(--scale));
    background-image: url("/?originalUrl=https%3A%2F%2Fhackphs.tech%2Fstatic%2Fstar.svg");
    background-size:cover;
    background-position:center;
    left: calc(var(--x-pos) * 100vw);
    top: calc(var(--y-pos) * 100vh);

    animation: twinkle 60s linear calc(var(--offset) * -60s) infinite;
    transition: all 0.5s, left 0s, top 0s;
}

#orange {
    z-index:-6;
    background: #df763320;
    opacity: max(calc(1 - var(--scroll)*2),0);
    transition: none;
}

#content {
    padding-inline:4rem;
}

#content h1 {
    margin-bottom: 2rem;
    font-size:4rem;
    font-size:4rem;
}

#content h2 {
    font-size:2.5rem;
}

#content {
    font-size: 1.3rem;
}

@media screen and (min-aspect-ratio:16/9) {
    #bg, #bg::before, #bg::after {
        background-size: 101%;
    }
}

#outer {
    display: flex;
    height: 100svh;
    padding: 3rem;
    box-sizing: border-box;
    position: relative;
    z-index: 2;
}

#top-container {
    align-items: center;
    gap: 2rem;
}

#desc a {
    color: #cdf;
    text-decoration: none;
    &:hover {
        text-decoration: underline;
    }
}

#icon {
    position: absolute;
    width: 6rem;
    margin: 1rem;
}

#top-container h1 {
    font-size: 6rem;
    margin: 4rem 0 1rem 0;
}

#top-container h1.but-blue {
    color: rgb(62, 151, 192);
}

#top-container h2 {
    font-size: 2.5rem;
    font-style: italic;
    font-weight: 200;
    margin: 0;
    margin-bottom: 1rem;
}

#desc {
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(2rem);
    -webkit-backdrop-filter: blur(2rem);
    border-radius: 1rem;
    padding: 1rem;
    max-width: 50ch;
}

#desc p {
    font-size: 1.1rem;
    margin: 0;
}

.button.register {
    backdrop-filter: blur(2rem);
    -webkit-backdrop-filter: blur(2rem);
    position: relative;
    top: 0;
    transition: top 0.1s, all 0.2s;
    display:inline-block;
    font-size:2.5rem;
    padding: 1rem;
    letter-spacing: 0.05rem;
    margin-top:1rem;
    border-radius: 1rem;
    background-image: linear-gradient(90deg, rgba(61, 76, 119, 0.9) 50%, #0005 50%);
    background-size: 200%;
    background-position-x: 100%;
    border:2px solid white;
    
    text-decoration: none;

    &:hover {
        background-position-x: 0%;
        cursor:not-allowed;
    }
    &:active {
        top:0.1rem;
    }
}

.button.register i {
    position: relative;
    left:0;
    transition:left 0.1s;
}
.button.register:hover i {
    left:5px;
}

@media screen and (max-width:749px) and (max-aspect-ratio:1.5) {
    #content {
        padding-inline:1rem;
    }

    #outer {
        padding: 2rem 1rem 1rem 1rem;
    }

    #top-container h1 {
        font-size: 10vw;
        text-align: center;
        margin-top: 6rem;
        margin-bottom: 0;
        border-radius: 10rem;
        padding: 0.5rem 1.5rem;
        background: rgba(0, 0, 0, 0.2);
        backdrop-filter: blur(2rem);
        -webkit-backdrop-filter: blur(2rem);
    }

    #top-container h1.but-blue {
        color: #5ac7fa;
    }

    #top-container h2 {
        font-size: 4vw;
        background: rgba(0, 0, 0, 0.2);
        backdrop-filter: blur(2rem);
        -webkit-backdrop-filter: blur(2rem);
        padding: 1rem;
        border-radius: 10rem;
        margin-top: 1rem;
        margin:0;
    }

    #top-container {
        display: flex;
        flex-direction: column;
        justify-items: center;
        width: 100%;
    }

    .button.register {
        margin:0;
        border-radius:4rem;
    }
}

@media screen and (max-height:650px) and (min-aspect-ratio:1.5) {
    #icon {
        width: 4rem;
    }

    #top-container h1 {
        margin-top: 2rem;
        margin-bottom: 0;
        font-size: 14svh;
    }

    #top-container h2 {
        font-size: 7svh;
    }

    :root {
        font-size: calc(min(1rem, 4svh));
    }
}

#birdy {
    display: none;
    position: absolute;
    width: 100px;
    z-index: 0;
    top: 0px;
    right: -200px;
}

#top-container h1 {
    z-index: 2;
    position: relative;
}

#icon-mobile {
    display: none;
}

@media screen and (max-width:500px) {
    #icon {
        display: none;
    }

    #top-container h1 {
        margin: 0;
    }

    #content h1 {
        font-size:3rem;
    }

    #content h2 {
        font-size:2rem;
    }

    #bg::after {
        background-position-x: 90%;
    }
}

@media screen and (max-width:500px) and (max-aspect-ratio:1) {
    #icon-mobile {
        display: block;
        position: relative;
        max-width: 100%;
        min-height: 0;
        z-index: 0;
        margin: 0 2rem;
        box-sizing: border-box;
        flex-grow: 1;
    }


    #top-container {
        flex-direction: column;
        justify-content: space-around;
        gap: 0.5rem;
        box-sizing: border-box;
        min-height: 90svh;
        height: 90svh;
        max-height: 90svh;
        padding: 2rem;

        overflow: hidden;
    }

    #outer {
        padding: 0;
    }
}

button * {
    padding: 0;
    margin: 0;
}

footer {
    padding:1rem;
}

footer p {
    margin: 0;
    color: rgb(55, 33, 29);
    font-style: italic;
    font-weight: 200;
}

details:first-of-type {
    border-top: 1px solid white;
}

details {
    border-bottom: solid white 1px;
    border-left: solid white 1px;
    border-right: solid white 1px;
    background-color: #0002;
}

#faq-box {
    backdrop-filter: blur(0.5rem);
    -wekbit-backdrop-filter: blur(0.5rem);
    border-radius: .5rem;
}

details summary {
    display: flex;
    align-items: center;
    justify-content: space-between;
    transition: all 0.2s, border-bottom 0s;
    background: #0005;
}

details summary i {
    padding:0;
    transform:rotateZ(0deg);
    transition:transform 0.2s;
}
details[open] summary i {
    transform:rotateZ(180deg);
}

details[open] summary {
    border-bottom: 1px solid white;
    background: #6665;
}

details summary:hover {
    background: #ccc5;
}

details * {
    padding: 0.5rem;
    box-sizing: border-box;
}

details summary:hover {
    cursor: pointer;
}

details:first-of-type {
    border-radius: .5rem .5rem 0 0;
}

details:first-of-type summary {
    border-radius: .5rem .5rem 0 0;
}

details:last-of-type {
    border-radius: 0 0 .5rem .5rem;
}

details:last-of-type:not([open]) summary {
    border-radius: 0 0 .5rem .5rem;
}

/* Schedule */
table {
    border: 1px solid white;
    width: 100%;
    margin-top: 1rem;
    border-spacing: 0;
    border-radius: .5rem;
    overflow: hidden;
    backdrop-filter: blur(0.5rem);
}

thead td {
    background-color: #111c;
    border-bottom: 1px solid white;
    transition: none;
}

td {
    padding: .5rem;
}

tbody td {
    background-color: #222a;
}

tbody tr:hover td {
    background-color: #444a;
}

tbody tr:nth-child(2n) td {
    background-color: #333a;
}

tbody tr:nth-child(2n):hover td {
    background-color: #444a;
}

tr td:nth-child(1) {
    width: 8ch;
}

/* Links */
#content a, footer a {
    padding: 0;
}

#content a:hover, footer a:hover *, dialog a:hover {
    color: #76aef8;
}

footer a:hover span {
    text-decoration: underline;
}

footer a {
    text-decoration: none;
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    gap:.3ch;

}

footer {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    flex-wrap: wrap-reverse;
    row-gap:1rem;
}

#contact {
    gap:1rem;
    display: flex;
    flex-direction: row;
    flex-wrap: wrap;
    row-gap:0.25rem;
}

.sponsor-section {
    display: flex;
    flex-direction:row;
    gap:2rem;
    justify-content:space-evenly;
    /* width: 100%; */
    flex-wrap: wrap;
    margin-bottom:2rem;
}

.sponsor-section a{
    transition: all 0.1s;
    display: flex;
    justify-content: center;
    align-items: center;
}

.sponsor-section a img {
    height:10rem;
}


.sponsor-section a.pure-buttons img {
    height:7rem;
}

@media screen and (max-width:450px) {
    .sponsor-section a.pure-buttons img {
        height:unset;
        width:100%;
    }
}

@media screen and (max-width:300px) {
    .sponsor-section a.pure-buttons img {
        height:unset;
        width:100%;
    }
}

.sponsor-section a:hover {
    scale:105%;
}

.section {
    margin-bottom:4rem;
    min-height:100vh;
    display: flex;
    flex-direction: column;
    justify-content: center;
}

.section:last-of-type {
    min-height:1px;
}

@keyframes popin {
    0% {
        transform:translateY(-200%);
        opacity:0;
    }
    100% {
        transform:translateY(0%);
        opacity:1;
    }
}

#mlh-trust-badge {
    opacity:0;
    animation:popin 2s forwards;
    animation-delay:0s;
}

@media screen and (max-width:500px) {
    #mlh-trust-badge {
        transform:translateX(40px);
        /* This is a horrible janky fix but i want to fix other things first lemme cook */
    }
}

#about div {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(2rem);
    -webkit-backdrop-filter: blur(2rem);
    border-radius: 1rem;
    padding: 1rem;
    margin-bottom:2rem;
    &:hover {
        background: rgba(20, 20, 20, 0.3);
    }
}

#about div h2 {
    margin-block:0;
}

#top-chevron {
    position: absolute;
    bottom: 2vh;
    left: 0;
    display: flex;
    flex-direction: row;
    justify-content: center;
    right: 0;
    font-size: 4rem;
    text-decoration: none;
}

#buttons button, #button .button, dialog button {
    background: #0005;
    border: 1px #bbb solid;
    border-radius: 0.5rem;
    backdrop-filter: blur(1rem);
    -webkit-backdrop-filter: blur(1rem);
    position: relative;
    top: 0;
    transition: top 0.1s, all 0.2s;

    padding: 0.5rem;
    font-size: 1rem;
}

#buttons a.button {
    display:inline-block;
    &:hover {
        text-decoration: none;
    }
}

#buttons button:hover, #buttons .button:hover {
    cursor: pointer;
    background: #ccc5;
}

#buttons button:active, #buttons .button:active {
    top: 0.1rem;
}

#buttons {
    display: flex;
    position: fixed;
    box-sizing: border-box;
    top: unset;
    bottom: 0.5rem;
    right: 0.5rem;
    z-index: 2;
    flex-direction: row;
    gap: .5rem;

    transition: right 1s;
}

#buttons .section-button {
    box-sizing: border-box;
    z-index: 2;
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    height: 2.5rem;
    aspect-ratio: 1;
    font-size: 1.25rem;
}

#buttons.gone {
    right:-100%;
}

@media screen and (max-width:800px) {
    #buttons .section-button {
        gap:0;
    }

    .section-button span {
        width: 0;
        overflow: hidden;
        transition: width .5s;
    }

    .section-button:hover {
        gap: 0.5rem;
    }

    #faq-button:hover span {
        width: 4.2ch;
    }

    #schedule-button:hover span {
        width: 7ch;
    }

    #sponsor-button:hover span {
        width:7ch;
    }
}

dialog {
    background-color: #0005;
    backdrop-filter: blur(10px);
    padding: 1rem;
    box-sizing: border-box;

}

@media screen and (min-width:501px) and (min-height:401px) {
    dialog {
        min-width: calc(min(max(50%, 80ch), 100vw - 4rem));
        max-width: calc(100vw - 4rem);
        max-height: calc(100vh - 4rem);
        border-radius: 1rem;
        border: 1px solid white;
    }

    dialog::backdrop {
        backdrop-filter: blur(5px);
        -webkit-backdrop-filter: blur(5px);
    }
}

@media screen and (max-width:600px),
(max-height:400px) {
    dialog {
        border: none;
        margin: 0;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        box-sizing: border-box;
        min-width: 100vw;
        min-height: 100svh;
        padding: 1.5rem;
        border-radius: 0;
    }


}

dialog h1 {
    margin: 0;
    font-size: 3rem;
    text-align: center;
}

dialog button.close {
    width: 2.5rem;
    height: 2.5rem;
    border-radius: 1.25rem;
    position: absolute;
    z-index: 3;
    top: 1.5rem;
    right: 1.5rem;

    &:active {
        top: 1.6rem;
    }

    &:hover {
        background: #ccc5;
    }
}

#photo-close {
    position:fixed;
    z-index:100000000;
    top: calc(2rem + var(--scroll)*1px);
    right:2rem;
    transform:scale(0);
    background: #000a;
    &:hover {
        background: #888a;
    }
}

dialog:has(.expanded) #photo-close {
    transform: scale(1);
}

dialog[open] input {
    width: calc(min(100%, 30ch));
    font-size: 1.25rem;
    padding: .25rem;
}

dialog[open] button,
dialog[open] input {
    background: #0003;
}

dialog {
    opacity: 0;
    transition: all .5s;
}

dialog:not([open]) {
    display: block;
    max-width: 0;
    max-height: 0;
    overflow: hidden;
    margin: 0;
    padding: 0;
    position: absolute;
    top: 0;
    left: 0;
    z-index: -100;
}

dialog[open] {
    opacity: 1;
}

button.close:hover {
    cursor: pointer;
}

dialog {
    font-size:1.5rem;
}

#participant-notice {
    font-size: 1rem;
}

div.photo-grid {
    width:100%;
    display: flex;
    flex-direction:row;
    gap:1rem;
    flex-wrap: wrap;
    justify-content: center;
}

.photo-grid img {
    /* height:15rem;
    max-width: 20rem; */
    height:100%;
    width:100%;
    object-fit: cover;
}

.photo-grid {
    --size: 200px;
    --tgt: 15;
}

@media screen and (max-width:1000px) {
    .photo-grid {
        --size: 200px;
        /* --tgt: 8; */
    }
}

.photo-grid div {
    height:15rem;
    width:var(--size);
    position:relative;
    border-radius:1rem;
    border: 1px solid transparent;
    box-sizing: border-box;
    overflow:hidden;
    /* transform:scale(1); */

    /* transition:width 0s, transform 0.2s; */
    /* transition:none; */
}

.photo-grid div.expanded {
    overflow:unset;
}

.photo-grid div.expanded img {
    position: fixed;
    z-index:10000;
    left:1rem;
    top: calc(1rem + var(--scroll) * 1px);

    height:calc(100% - 2rem);
    width: calc(100% - 2rem);
    object-fit: contain;
    /* background:#0008; */
    /* border: 2px solid transparent; */

    transition: all 0.2s, top 0ms;
}

.photo-grid div.expanded img:hover {
    /* border: 2px solid #76aef8; */
    /* cursor: pointer; */
}

dialog:has(div.expanded) {
    overflow:hidden;
}

dialog:has(div.expanded) #photo-bg {
    background:#0008;
    left:0;
    right:0;
    top:calc(var(--scroll)*1px);
    height:100%;
    position:fixed;
    z-index:1000;
}

.photo-grid div::before {
    content: "";
    display: block;
    position: absolute;
    inset:0;
    background:#0000;

    border-radius:1rem;

    transition:background 0.2s;
}

.photo-grid div:hover:not(.expanded) {
    cursor:pointer;
    border: 1px solid #76aef8;
}

.photo-grid div:hover::before {
    background: #0004;
}

#year-dropdown {
    position: absolute;
    font-weight:normal;
    font-size:2rem;
    flex-direction: column;
    gap:0.5rem;

    transform:scale(0);
    display: flex;
    border-radius:1rem;
    
    padding:1rem;
    background: rgba(0, 0, 0, 0.2);
    backdrop-filter: blur(2rem);
    -webkit-backdrop-filter: blur(2rem);
    transform-origin: center top;
}

#year-dropdown b {
    text-wrap-mode: nowrap;
}

#year-dropdown hr {
    margin:0;
}

#year-dropdown a {
    text-decoration: none;
}
#year {
    transform: scale(1);
    display:inline-block;
}
@media screen and (max-width: 749px) {
    #year>span.arrow i {
        display: none;
    }
}
@media screen and (min-width: 750px) {
    #year>span {
        text-decoration: underline;
    }

    #year>span.arrow i {
        transform:translateX(-2rem) scale(0.25);
    }

    #year:hover>span.arrow>i {
        color:#538ad1;
        transform:rotateZ(180deg) translateX(2rem) scale(0.25);
    }

    #year:hover>span {
        color:#538ad1;
        transform: scale(1.1);
    }

    #year>span:hover {
        cursor:pointer;
    }

    #year:hover #year-dropdown {
        transform:scale(1);
    }
    
    #year-dropdown a:hover {
        color:#76aef8;
        font-size:4rem;
    }
}

#banner {
    left:0;
    right:0;
    top:0;
    height:1rem;
    padding:1rem;
    background:gray;
    display: flex;
    flex-direction: row;

    justify-content: space-between;
    align-items: center;
}

#banner .x-button {
    &:hover {
        cursor: pointer;
    }
}

#banner a:hover {
    color: #9ec8ff;
}

#banner.hidden {
    display: none;
}

#banner span {
    max-width: calc(100% - 100px);
}

#register-warning {
    display: none;
    background:rgba(0, 0, 0, 0.2);
    max-width:50rch;
    margin-top:1rem;
    padding:1rem;
    border-radius:1rem;
    backdrop-filter:blur(1rem);
    color:#eee;
    font-style:italic;
    font-size:0.75rem;
}

#register-warning.show {
    display: block;
}