@keyframes spin {
    from { transform: translate(-50%, -50%) rotate(0deg) }
    to { transform: translate(-50%, -50%) rotate(360deg) }
}

body {
    display: grid;
    grid-template-rows: 1fr auto auto;
    background-repeat: no-repeat;
    height: 100%;
    transition: 
        background 0.5s ease,
        color 0.5s ease;
}

/* Cursor */
#cursor {
    display: none;
}

@media (pointer: fine) {
    #cursor {
        width: 1.2rem;
        height: 1.2rem;
        background-image: url('/assets/img/home/cursor.png');
        background-size: cover;
        display: none;
        opacity: 0.6;
        position: fixed;
        top: 0;
        left: 0;
        z-index: 99;
    }
}

/* Header */
header.banner {
    width: 100%;
    max-width: var(--width);
    display: flex;
    margin: 0 auto 3rem;
    font: italic 1.2rem var(--font-secondary);
    gap: 1rem;
}

header.banner h1 {
    font: normal 1rem var(--font-main);
    margin: 0;
}

header.banner h1 a {
    text-decoration: none;
}

/* Main */
main {
    width: 100%;
    max-width: var(--width);
    margin: 0 auto;
    position: relative;
}

main#home {
    align-self: end;
    margin-bottom: 0;
}

/* Blocks */
.home {
    display: grid;
    grid-template-columns: repeat(12, 1fr);
    align-items: start;
    padding: 2rem 2rem 0;
    border: 1px solid var(--color);
    border-bottom: 0;
    gap: 2rem 1rem;
    justify-items: space-between;
}

.home h1,
.home h2,
.home h3,
.home h4,
.home h5,
.home h6,
.home p {
    margin: 0;
}

.window {
    --start: auto;
    --span: 3;
    grid-column-start: var(--start);
    grid-column-end: span var(--span);
    border: 1px dotted var(--color);
    /* border-bottom: 2px solid var(--color); */
    text-align: center;
    place-items: center;
    display: grid;
    overflow: hidden;
    position: relative;
    min-height: 200px;
    padding: 0.5rem;
    transition: 0.2s box-shadow linear;
}

.window.break {
    grid-column-start: 1;
}

.window.small {
    min-height: 100px;
}

html.night .window {
    background-color: #222222;
}

button.door {
    grid-column-end: span 3;
    display: grid;
    width: 100%;
    height: 300px;
    max-width: 200px;
    justify-self: end;
    place-items: center;
    border: 1px solid var(--color);
    border-bottom: 0;
    transition: 0.2s box-shadow linear;
    cursor: pointer;
    background-color: transparent;
    font-size: 1rem;
    position: relative;
    font-family: var(--font-main);
    color: var(--color);
    overflow: hidden;
}

button.door::after {
    content: '';
    width: 15px;
    height: 15px;
    border-radius: 50%;
    border: 1px solid currentColor;
    position: absolute;
    top: 45%;
    right: 1rem;
    background-color: var(--background);
}

button.door .house-number {
    display: flex;
    gap: 0;
    border: 3px double currentColor;
    background-color: var(--background);
}

button.door .house-number span {
    outline: 1px solid currentColor;
    padding: 0.15rem 0.5rem;
    font-size: 0.7em;
}

button.door span.knock-log {
    position: absolute;
    font-size: 0.7rem;
    text-transform: uppercase;
    transition: 0.3s ease opacity;
}

button.door span.knock-log__other {
    color: var(--background);
    text-shadow: 0 0 1px var(--color);
}

button.door span.label {
    position: absolute;
    bottom: 0.5rem;
    opacity: 0.5;
}

/* Special windows + elements */
.hole {
    width: 1rem;
    aspect-ratio: 1;
    display: inline-block;
    background: var(--background);
    clip-path: ellipse();
    position: absolute;
    top: 0;
    left: 0;
    mix-blend-mode: difference;
}

html.night .hole {
    background: var(--link);
}

/* Now Playing */
.window.now-playing {
    padding: 0;
    display: block;
    height: 100%;
    max-height: 100px;
    overflow-y: auto;
    position: relative;
}

.window.now-playing .indicator {
    position: absolute;
    top: calc(50% - 0.75rem);
    left: 50%;
    transform: translate(-50%, -50%);
    user-select: none;
    animation: spin 3s linear infinite;
    display: none;
}

.window.now-playing .current-track {
    height: calc(100% - 1.5rem);
    display: flex;
    flex-direction: column;
    padding: 1rem;
    justify-content: space-between;
    white-space: nowrap;
}

.window.now-playing .inside {
    height: 100%;
}

.window.now-playing .label {
    width: 100%;
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
    border-top: 1px solid var(--color);
}

.window.now-playing ul.track-list {
    font-size: 0.7rem;
    width: 100%;
    list-style: none;
    margin: 0;
}

.window.now-playing ul.track-list li {
    border-top: 1px inset var(--color);
    white-space: nowrap;
}

/* Bodega */
.window.bodega {
    padding: 0;
    display: flex;
    flex-direction: column;
    justify-content: end;
    position: relative;
    cursor: pointer;
    overflow-y: auto;
}

.window.bodega::before,
.window.bodega::after {
    content: '';
    display: block;
    position: absolute;
    top: 0;
    width: 50%;
    height: 100%;
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    transition: 0.5s linear all;
    --mesh-width: 1px;
    --mesh-gap: 4px;
    background: 
        repeating-linear-gradient(currentColor, currentColor var(--mesh-width), transparent var(--mesh-width), transparent var(--mesh-gap), currentColor var(--mesh-gap)),
        repeating-linear-gradient(90deg, currentColor, currentColor var(--mesh-width), transparent var(--mesh-width), transparent var(--mesh-gap), currentColor var(--mesh-gap))
        ;
    background-size: 100% 100%;
    /* background-repeat: no-repeat; */
    border: 1px solid currentColor;
    mask: circle();
}

.window.bodega::before {
    left: 0;
}

.window.bodega::after {
    right: 0;
}

.window.bodega.clicked::before {
    transform: translateX(-90%);
}

.window.bodega.clicked::after {
    transform: translateX(90%);
}

.window.bodega .label {
    height: 1.5rem;
    display: flex;
    align-items: center;
    justify-content: center;
}

.window.bodega ul {
    list-style: none;
    margin: 0;
    padding: 0;
    width: 100%;
}

.window.bodega ul li {
    border-top: 1px inset var(--color);
}

.window.window.bodega ul li a {
    /* background-color: red; */
    display: block;
    padding: 0.1rem 10%;
    transition: 0.2s background-color ease;
}

.window.window.bodega ul li a:hover {
    /* background-color: white; */
}

/* Lately... */
.window.lately {
    position: relative;
}

@keyframes frameFade {
    from { opacity: 0.2; }
    to { opacity: 0; }
}

.window.lately .frame {
    position: absolute;
    background-color: var(--color);
    animation: frameFade 5s steps(12) forwards;
}

/* USB Locket */
.window.usb {
    --span: 2;
}

/* Adobo */
.window.adobo {
    border: 0;
    --width: 1px;
    background-image:
        repeating-linear-gradient(currentColor, currentColor var(--width), transparent var(--width), transparent 20%, currentColor 20%, currentColor calc(20% + var(--width)), transparent calc(20% + var(--width)), transparent calc(80% - var(--width))),
        repeating-linear-gradient(90deg, currentColor, currentColor var(--width), transparent var(--width), transparent calc(50% - (var(--width) / 2)))
        !important;
}

/* Gate */
.gate {
    --stroke: 1px;
    width: 100%;
    height: 20%;
    max-height: 80px;
    /* background-color: black; */
    background: 
        radial-gradient(circle at 50% calc(50% + var(--stroke)), transparent 40%, currentColor 40%, currentColor calc(40% + var(--stroke)), transparent calc(40% + var(--stroke))),
        linear-gradient(currentColor var(--stroke), transparent calc(var(--stroke) + 5px));
    background-size: 2% 25%;
    position: absolute;
    bottom: 0;
    left: 0;
    z-index: 50;
    user-select: none;
    /* opacity: 0.5; */
    /* border: 3px solid black; */
}

/* Footer */
footer {
    width: 100%;
    /* max-width: var(--width); */
    margin: 0 auto;
    font-size: 0.8rem;
    border-top: 1px solid var(--color);
    padding: 0.5rem 1rem 0;
    text-align: center;
    align-self: end;
}

/* Raindrops */
@keyframes rain {
    from {
        transform: rotate(90deg) translateX(0);
    }

    to {
        transform: rotate(90deg) translateX(calc(100vh + 20px));
    }
}

hr.rain {
    width: 30px;
    border-color: transparent;
    border-right-color: rgba(0, 0, 0, 1);
    border-right-width: 20px;
    position: fixed;
    bottom: 100%;
    transform-origin: 100% 50%;
    animation: 1s rain linear infinite;
    user-select: none;
}

html.night hr.rain {
    border-right-color: rgba(255, 255, 255, 0.3);
}

footer p:last-child {
    margin-bottom: 0;
}

/* Breakpoints */
@media screen and (max-width: 1200px) {
    .home {
        width: 95%;
        margin: 0 auto;
    }
}

@media screen and (max-width: 800px) {
    header.banner {
        justify-content: center;
    }

    .home {
        /* gap: 0.5rem ; */
        /* width: 85%; */
        margin: 0 auto;
        /* grid-template-columns: 1fr !important; */
    }

    .window {
        grid-column-start: 1;
        grid-column-end: span 12;
    }

    button.door {
        grid-column-start: 1;
        grid-column-end: span 12;
    }

    .spacer {
        display: none;
    }
}
