/* --------------------- Root & Body --------------------- */
:root {
    --page-bg: oklch(29.89% 0.01634 295.536);
    --text-main: oklch(0.9672 0 0);
    --text-side: oklch(0.859 0.0095 52.08);
    --text-title: oklch(0.7947 0.0273 44.67);
    --link-color: oklch(75.204% 0.03336 230.532);
    --link-hover: oklch(0.834651 0.09846 233.4933);
    --link-glow: oklch(0.6566 0.137 238.84);
    --bar-alpha: oklch(0 0 0 / 1);
}

* {
    box-sizing: border-box;
}

html,
body {
    min-height: 100%;
}

body {
    isolation: isolate;
    -webkit-font-smoothing: antialiased;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
    background-color: var(--page-bg);
    transition: background-color .5s ease;
    font-family: "Recursive", sans-serif;
    margin: 0;
    overflow-x: hidden;
}

body:has(#index-greeting:hover) {
    --page-bg: oklch(15.481% 0.00804 325.855);
}

body.hi-background-running .hi-scroll-row,
body.hi-background-running .hi-scroll-track {
    animation-play-state: running;
}

body.hi-background-visible #hi-burst-layer {
    opacity: 1;
}

body.hi-background-visible #hi-cutoff-bar {
    opacity: 1;
}

/* --------------------- Animation --------------------- */
@keyframes animate-fade {
    0% { opacity: 0; }
    100% { opacity: 1; }
}

@keyframes animate-dropdown {
    0% { max-height: 0;}
    100% { max-height: 14.5rem; }
}

/*
@keyframes animate-explode {
    0% {transform: translateY(0), translateX(0)}
    100% {transform: translateY(), translateX()}
}
    */
/* --------------------- Anchor & Main --------------------- */
a {
    color: var(--link-color);
    transition: color 200ms cubic-bezier(0.76, 0, 0.24, 1), text-shadow 2s cubic-bezier(0.76, 0, 0.24, 1);
}

a:hover {
    color: var(--link-hover);
    text-shadow: 0 0 5px var(--link-glow);
}

main,
.site-footer {
    position: relative;
    z-index: 2;
}

main {
    width: 100%;
    padding-inline: clamp(1rem, 4vw, 3rem);
    flex: 1;
}

img {
    max-width: 100%;
    height: auto;
}

.image-media {
    border: 1px solid oklch(0.8 0.03 280 / 0.35);
    border-radius: 0.75rem;
}

/* --------------------- Header --------------------- */
.nav-link {
    font-size: 1.2rem;
    transition: 
        letter-spacing 500ms cubic-bezier(0.76, 0, 0.24, 1),
        color 500ms cubic-bezier(0.76, 0, 0.24, 1),
        text-shadow 2s cubic-bezier(0.76, 0, 0.24, 1);
}

.nav-link:hover {
    letter-spacing: clamp(0.05em, 1vw, 0.5em);
}

.header {
    width: 100%;
    position: sticky;
    top: 0;
    z-index: 10;
    background-color: oklch(36.759% 0.07934 310.207 / 0.25);
    padding: 0.5rem 0 1rem;
    overflow: hidden;
    opacity: 1;
    transition: max-height 500ms ease, opacity 500ms ease, padding 500ms ease, background-color 500ms ease;
    max-height: 14.5rem;
    animation-name: animate-dropdown, animate-fade;
    animation-duration: .5s;
    animation-delay: .1s;
    animation-fill-mode: backwards;
}

.header.tiny {
    max-height: 0;
    opacity: 0;
    padding-top: 0;
    padding-bottom: 0;
}

.directory ul {
    display: flex;
    margin: 0;
    padding: 0;
    list-style: none;
    gap: 0.75rem;
    justify-content: center;
    flex-wrap: wrap;
}

.directory a {
    position: relative;
    text-decoration: none;
}

/* --------------------- Nav Link Changing Colors --------------------- */
body:has(.nav-link[data-page="home"]:hover) {
    --page-bg:oklch(29.139% 0.01601 325.882);
    --text-main: oklch(96% 0.03144 322);
    --text-side: oklch(96% 0.03144 322);
    --text-title: oklch(65% 0.03144 322);
    --link-color: oklch(0% 0 0 / 0);
    --link-hover: oklch(82% 0.03144 322);
    --link-glow: oklch(78.135% 0.06674 322.811);
}

body:has(.nav-link[data-page="about"]:hover) {
    --page-bg:oklch(41.871% 0.02832 179.401);
    --text-main: oklch(96% 0.02832 179.401);
    --text-side: oklch(96% 0.02832 179.401);
    --text-title: oklch(65% 0.02832 179.401);
    --link-color: oklch(0% 0 0 / 0);
    --link-hover: oklch(82% 0.02832 179.401);
    --link-glow: oklch(74.233% 0.08796 177.618);
}

body:has(.nav-link[data-page="projects"]:hover) {
    --page-bg:oklch(40.341% 0.10945 359.164);
    --text-main: oklch(96% 0.10945 359.164);
    --text-side: oklch(96% 0.10945 359.164);
    --text-title: oklch(65% 0.10945 359.164);
    --link-color: oklch(0% 0 0 / 0);
    --link-hover: oklch(82% 0.10945 359.164);
    --link-glow: oklch(77.452% 0.13044 356.142);
}

body:has(.nav-link[data-page="seen-this-man"]:hover) {
    --page-bg: oklch(36.261% 0.07443 20.213);
    --text-main: oklch(96% 0.13987 23.978);
    --text-side: oklch(96% 0.13987 23.978);
    --text-title: oklch(65% 0.13987 23.978);
    --link-color: oklch(0% 0 0 / 0);
    --link-hover: oklch(82% 0.13987 23.978);
    --link-glow: oklch(75.799% 0.14469 21.019);
}

body:has(.nav-link[data-page="writing"]:hover) {
    --page-bg: oklch(39.433% 0.06293 153.393);
    --text-main: oklch(96% 0.11913 135.947);
    --text-side: oklch(96% 0.11913 135.947);
    --text-title: oklch(65% 0.11913 135.947);
    --link-color: oklch(0% 0 0 / 0);
    --link-hover: oklch(82% 0.11913 135.947);
    --link-glow: oklch(85.955% 0.14552 134.846);
}

/* --------------------- Footer --------------------- */
.site-footer {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    padding: 1rem;
    
}

.social-media-row {
    justify-self: end;
    display: flex;
    justify-content: flex-end;
    padding: 1rem;
    gap: 1rem;
}

.social-link {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    width: 2rem;
    height: 2rem;
    transition: transform 0.25s ease, filter 0.25s ease;
}

.social-link img {
    width: 100%;
    height: 100%;
    object-fit: contain;
}

.social-link:hover {
    transform: translateY(-0.15rem);
    filter: drop-shadow(0 0 0.35rem var(--link-glow));
}

.badge-row {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 0.5rem;
    flex-wrap: wrap;
}

.badge-row img{
    image-rendering: pixelated;
}

/* --------------------- Text --------------------- */
.title-text,
.title-subtext,
.nav-link {
    animation-name: animate-fade;
    animation-duration: .5s;
    animation-delay: .1s;
    animation-fill-mode: backwards;
}

.page-text,
.page-title,
.side-text-left,
.side-text-right {
    transition: color .5s cubic-bezier(0.76, 0, 0.24, 1), text-shadow .3s ease;
}

.title-text {
    font-family: "Rubik Iso", system-ui;
    text-align: center;
    color: var(--text-title);
    font-size: 3rem;
    font-weight: 700;
    margin: 0;
    letter-spacing: 0.05em;
    transition: letter-spacing 1.2s cubic-bezier(0.32, 0.53, 0.45, 0.19), text-shadow 0.4s ease, color .5s ease;
    position: relative;
}

.title-text::before,
.title-text::after {
    color: rgba(0, 0, 0, 0);
    content: attr(data-text);
    position: absolute;
    inset: 0;
    text-align: center;
    pointer-events: none;
    transition: transform 2s cubic-bezier(0.37, 0, 0.63, 1), color 4s ease, text-shadow 2s cubic-bezier(0.55, 0, 1, 0.45);
}

.title-text:hover::before {
    color: oklch(81.986% 0.14434 214.275 / 0.75);
    transform: translate(clamp(4rem, 25vw, 34rem), 0);
}

.title-text:hover::after {
    color: oklch(0.8 0.18 20 / 0.75);
    transform: translate(clamp(-34rem, -25vw, -4rem), 0);
}

.title-text:hover {
    letter-spacing: 0.12em;
    text-shadow: 0 0 1rem currentColor;
}

.title-subtext {
    color: var(--text-title);
    font-size: 1rem;
    font-weight: 400;
    text-align: center;
    margin: 0.25rem 0 1rem;
    transition: letter-spacing 0.3s ease, text-shadow 0.3s ease, color .5s ease;
}

.title-subtext:hover {
    letter-spacing: 0.06em;
    text-shadow: 0 0 2rem currentColor;
}

.page-title {
    font-size: 2.6rem;
    color: var(--text-title);
    padding: 3rem;
    text-shadow: 2px 2px oklch(0% 0 0 / 0.342);
    text-align: center;
    animation-duration: 0.5s;
    animation-name: animate-fade;
    animation-delay: 0.5s;
    animation-fill-mode: backwards;
}

.page-text {
    max-width: 60rem;
    margin-inline: auto;
    line-height: 1.6;
    font-size: 1.2rem;
    color: var(--text-main);
    text-align: center;
    animation-duration: 0.5s;
    animation-name: animate-fade;
    animation-delay: 0.5s;
    animation-fill-mode: backwards;
}

/* --------------------- Index.HTML Elements --------------------- */
#index-greeting{
    position:relative;
    width: fit-content;
    margin: clamp(8rem, 25vh, 20rem) auto 0;
    padding: 0;
    line-height: 1;
    font-size: clamp(6rem, 25vw, 28rem);
    cursor: pointer;
    user-select: none;
    z-index: 3;
    transition: transform 0.4s ease, text-shadow 3s ease, color 900ms ease;
}

#index-greeting:hover {
    text-shadow: 0 0 1.5rem currentcolor;
    transform: translateY(-1rem);
}

#hi-burst-layer {
    position: fixed;
    top: calc(var(--header-bottom, 0px) + 1.25rem);
    left: 0;
    right: 0;
    bottom: 0;
    pointer-events: none;
    overflow: hidden;
    will-change: opacity;
    contain: paint;
    z-index: 1;
    opacity: 0;
    transition: opacity 2.5s ease-out;
}

#hi-cutoff-bar {
    position: fixed;
    top: var(--header-bottom, 0px);
    left: 0;
    width: 100%;
    height: 1.25rem;
    background-color: var(--bar-alpha);
    z-index: 9;
    pointer-events: none;

    opacity: 0;
    transition: opacity 2.5s ease-out;
}


.hi-scroll-row,
.hi-scroll-track {
    animation-play-state: paused;
    will-change: transform;
}

.hi-scroll-row {
    position: absolute;
    left: 0;
    width: 100%;
    overflow: visible;
    opacity: 0.65;
    animation: hi-row-drift 12s ease-in-out infinite alternate;
}

.hi-scroll-track {
    display: flex;
    width: max-content;
    gap: 2rem;
    animation: hi-wall-scroll 18s linear infinite;
}

.hi-scroll-group {
    display: flex;
    gap: 2rem;
    padding-right: 2rem;
    font-family: "Rubik Iso", system-ui;
    font-size: clamp(4rem, 12vw, 12rem);
    font-weight: 700;
    white-space: nowrap;
}

.hi-scroll-row span {
    color: oklch(80% 0.22 var(--hi-hue, 220));
    text-shadow: 0 0 0.35rem currentColor;
    opacity: 0.65;
}

.hi-scroll-row.reverse .hi-scroll-track {
    animation-name: hi-wall-scroll-reverse;
}

.hi-scroll-row:nth-child(1) {
    --hi-hue: 220;
}

.hi-scroll-row:nth-child(2) {
    --hi-hue: 20;
}

.hi-scroll-row:nth-child(3) {
    --hi-hue: 135;
}

.hi-scroll-row:nth-child(4) {
    --hi-hue: 300;
}

.hi-scroll-row:nth-child(5) {
    --hi-hue: 60;
}

.hi-scroll-row:nth-child(6) {
    --hi-hue: 180;
}

.hi-scroll-row:nth-child(7) {
    --hi-hue: 40;
}

.hi-scroll-row.slow {
    animation-duration: 18s;
}

@keyframes hi-wall-scroll-reverse {
    from {
        transform: translate3d(-50%, 0, 0);
    }

    to {
        transform: translate3d(0, 0, 0);
    }
}

@keyframes hi-row-drift {
    from {
        transform:translateY(-1.5rem);
    }

    to {
        transform: translateY(1.5rem);
    }
}

@keyframes hi-wall-scroll {
    from {
    transform: translate3d(0, 0, 0);
    }

    to {
        transform: translate3d(-50%, 0, 0);
    }
}

.burst-particle {
    position: fixed;
    left: var(--start-x);
    top: var(--start-y);
    width: 0.65rem;
    aspect-ratio: 1 / 1;
    border-radius: 50%;
    background-color: oklch(80% 0.22 var(--hue));
    color: oklch(80% 0.22 var(--hue));
    box-shadow: 0 0 0.75rem currentColor;
    pointer-events: none;
    z-index: 999;
    animation: burst-particle var(--duration) ease-out forwards;
}

@keyframes burst-particle {
    0% {
        opacity: 1;
        transform: translate(-50%, -50%) scale(1);
    }

    100% {
        opacity: 0;
        transform:
            translate(
                calc(-50% + var(--travel-x)),
                calc(-50% + var(--travel-y))
            )
            scale(0);
    }
}

.side-text-right,
.side-text-left {
    font-size: clamp(.9rem, 2vw, 1.3rem);
    color: var(--text-side);
    writing-mode: vertical-rl;
    text-orientation: upright;
    position: fixed;
    top: 25%;
    transform: translateY(-5%);
    z-index: 1;
    animation-duration: 0.5s;
    animation-name: animate-fade;
    animation-delay: 0.5s;
    animation-fill-mode: backwards;
}

.side-text-left {
    left: 1.25rem;
}

.side-text-right {
    right: 1.25rem;
}

/* --------------------- About.HTML Elements --------------------- */
#i-am-statement{
    display: grid;
    text-align: center;
}

.warning-text {
    text-align: center;
}

#writing-list {
    display: grid;
    gap: 1rem;
    text-align: center;
}

/* --------------------- Writing.HTML Elements --------------------- */

.writing-card {
    display: grid;
    gap: 1rem;
    max-width: 50rem;
    margin: 0 auto;
    text-decoration: none;
    color: inherit;
    padding: 1rem;
    border: 1px solid oklch(0.8 0.03 280 / 0.35);
    border-radius: 0.75rem;
    background-color: oklch(0.35 0.03 295 / 0.5);
    transition: transform 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.writing-card:hover {
    transform: translateY(-0.25rem);
    border-color: oklch(0.8 0.08 230);
    background-color: oklch(0.4 0.04 295 / 0.65);
}

#categories-list {
    display: grid;
    gap: 1rem;
    text-align: center;
}

.category {
    font-size: clamp(2rem, 8vw, 5rem);
    font-family:monospace;
    display: block;
    text-decoration: none;
    color: inherit;
    padding: 2rem;
    border-radius: 0.75rem;
    transition: transform 0.25s ease, border-color 0.25s ease, background-color 0.25s ease;
}

.category:hover {
    transform: translateY(-0.25rem);
    background-color: oklch(0.4 0.04 295 / 0.65);
}

.writing-category-layout {
    display: grid;
    grid-template-columns: 1fr auto;
    align-items: center;
    justify-content: center;
    gap: 2rem;
    max-width: 80rem;
    margin: 0 auto;
}

.writing-category-options {
    display: grid;
    gap: 1rem;
}

.writing-category-image {
    max-width: 36rem;
}

/* --------------------- Album-reviews.HTML Elements --------------------- */

#album-list {
    display: grid;
    gap: 0.5rem;
}

.album-card {
    display: block;
    text-decoration: none;
    color: inherit;
    transition: transform 0.25s ease, color .25s ease, text-shadow 2s ease;
}

.album-card article {
    display: grid;
    grid-template-columns: 4rem 1fr;
    gap: 0.5rem;
    align-items: center;
    max-width: 32rem;
    margin: 0 auto;
    padding:0.51rem;
    border: 1px solid oklch(0.8 0.03 280 / 0.35);
    border-radius: 0.5rem;
    background-color: oklch(0.35 0.03 295 / 0.5);
}

.album-card:hover {
    transform: translateY(-0.15rem);
}

.album-cover-card {
    width: 4rem;
    aspect-ratio: 1 / 1;
    object-fit: cover;
}

.album-meta h3,
.album-meta p{
    margin: 0;
}

.album-meta {
    text-align: left;
}

.album-meta h3 {
    font-size: 1rem;
}

.album-meta p {
    font-size: 0.85rem;
    line-height: 1.3;
}

.review-content {
    display: block;
    margin: 0 auto;
    max-width: 80rem;
}

.review-text {
    font-optical-sizing: auto;
    text-indent: 3rem;
    text-wrap: balance;
    text-align: center;
    margin: 0 auto;
    font-size: 1.2rem;
    max-width: 64rem;
    width: min(100%, 64rem);
    line-height: 1.8rem;
}

.review-title {
    font-size: 2.5rem;
    color: var(--text-title);
    transition: text-shadow 300ms ease, color 500ms ease, transform 300ms ease;
}

.review-title:hover {
    transform: translateY(-0.15rem);
    text-shadow: 0 0 1rem currentColor;
    color: oklch(71.427% 0.02001 13.331 / 0.75);
}

.review-subtitle {
    font-size: 1rem;
    font-style: italic;
    color: var(--text-side);
}

.review-rating {
    text-align: center;
    font-size: 4rem;
}

.album-cover-review {
    width: min(100%, 32rem);
    aspect-ratio: 1 / 1;
}

/* --------------------- Accessibility --------------------- */
@media (max-width: 700px) {
    main {
        width: 100%;
        padding-inline: 1rem;
    }

    .header {
        max-height: none;
        overflow: visible;
        padding: 0.75rem 0.75rem 1rem;
    }

    .header.tiny {
        max-height: none;
        opacity: 1;
        padding: 0.75rem 0.75rem 1rem;
    }

    .title-text {
        font-size: clamp(1.8rem, 10vw, 2.8rem);
        letter-spacing: 0.03em;
    }

    .title-subtext {
        font-size: 0.85rem;
        margin-bottom: 0.75rem;
    }

    .directory ul {
        display: grid;
        grid-template-columns: repeat(2, minmax(0, 1fr));
        gap: 0.5rem;
        width: 100%;
    }

    .directory li {
        min-width: 0;
    }

    .directory a {
        display: block;
        padding: 0.5rem;
        text-align: center;
        border: 1px solid oklch(0.8 0.03 280 / 0.35);
        border-radius: 0.5rem;
        background-color: oklch(0 0 0 / 0.18);
    }

    .nav-link {
        font-size: 0.9rem;
    }

    .nav-link:hover {
        letter-spacing: normal;
    }

    .side-text-left,
    .side-text-right {
        display: none;
    }

    #index-greeting {
        font-size: clamp(5rem, 32vw, 9rem);
        margin: clamp(4rem, 14vh, 7rem) auto 0;
        max-width: 100%;
    }

    #index-greeting:hover {
        transform: none;
        text-shadow: 0 0 1rem currentColor;
    }

    .hi-scroll-group {
        font-size: clamp(3rem, 18vw, 6rem);
        gap: 1rem;
        padding-right: 1rem;
    }

    .hi-scroll-track {
        gap: 1rem;
    }

    #hi-cutoff-bar {
        height: 0.75rem;
    }

    #hi-burst-layer {
        top: calc(var(--header-bottom, 0px) + 0.75rem);
    }

    .burst-particle {
        width: 0.4rem;
        box-shadow: 0 0 0.35rem currentColor;
    }

    .site-footer {
        grid-template-columns: 1fr;
        gap: 0.75rem;
        padding: 1rem;
    }

    .footer-spacer {
        display: none;
    }

    .badge-row,
    .social-media-row {
        justify-self: center;
    }

    .badge-row {
        gap: 0.35rem;
    }

    .badge-row img {
        max-width: 5.5rem;
    }

    .social-media-row {
        padding: 0;
    }

    .review-text {
        text-indent: 0;
        text-align: left;
        font-size: 1rem;
        line-height: 1.65rem;
    }

    .review-title {
        font-size: clamp(1.8rem, 10vw, 2.5rem);
        text-align: center;
    }

    .review-rating {
        font-size: 2.5rem;
    }
}

@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.001ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.001ms !important;
        scroll-behavior: auto !important;
    }
}

@media (max-width: 800px) {
    .writing-category-layout {
        grid-template-columns: 1fr;
    }

    .writing-category-image {
        justify-self: center;
    }
}