@import url("https://fonts.googleapis.com/css2?family=Azeret+Mono:ital,wght@0,100..900;1,100..900&display=swap");
@font-face {
    font-family: "wom";
    src: url("src/wom.woff2") format("woff2");
    font-weight: 400;
    font-style: normal;
    font-display: swap;
}

:root {
    --color-1: #010102;
    --color-2: #ce4f48;
    --color-3: #f49319;
    --color-4: #1044ef;
    --color-5: #1b93c7;
    --color-6: #25dbb7;
    --color-7: #85e45e;
    --color-8: #b6b496;

    --color-bg: var(--color-8); --color-fg: var(--color-1); --color-accent: var(--color-4);
    --color-link: var(--color-4); --color-muted: var(--color-6); --color-border: var(--color-5);
    --color-elev-bg: color-mix(in srgb,var(--color-1) 92%,var(--color-5)); --color-overlay: var(--color-1);
    --alt-bg: var(--color-1); --alt-fg: var(--color-7);
    --footer-img-desk: 150px; --footer-img-mobile: 100px; --brand-size: clamp(26px, 6vw, 50px);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { width: 100%; margin: 0 auto; overflow-x: hidden; }
body { background: var(--color-bg); color: var(--color-fg); font-family: "Azeret Mono", serif; font-weight: 300; font-style: normal; }
body.page-home { height: 100vh; display: flex; flex-direction: column; overflow: hidden; }
body.page-home main#content { flex: 1; position: relative; overflow: hidden; display: flex; }
body.page-home footer { flex-shrink: 0; }

h1 { font-family: "wom", serif; font-weight: 400; font-style: normal; font-size: clamp(30px, 6vw, 75px); }
h1, h2, h3, nav a, nav p { text-transform: uppercase; font-weight: normal; }
p, a { line-height: 120%; }
a, a:visited { color: var(--color-link); text-decoration: none; }
a:hover { color: var(--color-fg); text-decoration: underline; }
a.headerlink { color: var(--color-fg); text-decoration: none; }
ul { list-style: none; padding-left: 16px; }
hr { border: none; border-bottom: 1px solid var(--color-fg); color: var(--color-bg); }

header, main, footer { padding: 1rem; }
header { top: 0; background: transparent; z-index: 1000; }
header h1 { margin: 0 0 1rem; animation: text-wave 6s ease-in-out infinite; display: inline-block; position: relative; z-index: 10; view-transition-name: site-header; }
main, nav { overflow-y: auto; }
footer { margin-bottom: 10px; }

.homenavcontainer { display: flex; justify-content: space-between; flex-direction: row; position: relative; z-index: 10; }
.homenavcontainer > img { height: clamp(50px, 12vw, 100px); width: auto; padding: .5rem .5rem 0 0; }
.navsection { display: inline-block; }
.navsection a { font-size: clamp(12px, 3.5vw, 16px); white-space: nowrap; position: relative; z-index: auto; }
nav .navsection a[aria-current="page"] { color: var(--color-fg); text-decoration: none; pointer-events: none; cursor: default; }

.homenavcontainer .vidimage-wrapper, .homenavcontainer .vidimage-wrapper img { display: block; }
.homenavcontainer .vidimage-wrapper img { height: clamp(50px, 12vw, 100px); width: auto; padding: .5rem .5rem 0 0; }

.grid-container { max-width: 100%; display: flex; flex-wrap: wrap; justify-content: space-evenly; }
.grid-container > a { text-decoration: none; }
.grid-container > a > div > img { width: 200px; }
.grid-container > a:hover .image-hover { opacity: 1; }

.image-wrapper, .vidimage-wrapper, .footer-card__imgwrap { position: relative; }
.start-image { width: 100%; max-width: unset; border: 1px solid var(--color-bg); }
.image-hover, .vidimage-hover { position: absolute; inset: 0 auto auto 0; opacity: 0; pointer-events: none; }
.image-hover { transition: opacity 1s ease-out; border: 1px solid var(--color-fg); }
.vidimage-hover { inset: 0; animation: myfade 3s 1s reverse forwards; }

.aboutcontainer, .vidaboutcontainer, #about-contact-container { display: flex; justify-content: space-between; gap: 1rem; align-items: start; }
#about-contact-container { display: grid; grid-template-columns: auto 1fr; }
.vidaboutcontainer { display: grid; grid-template-columns: 1fr auto; }
.about.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }

.aboutcontainer > img, #about-contact-container img, .vidaboutcontainer > img,
.aboutcontainer .vidimage-wrapper img, #about-contact-container .vidimage-wrapper img,
.vidaboutcontainer .vidimage-wrapper img, .footer-card__img, .footer-card__imgwrap img {
    width: auto; height: var(--footer-img-desk);  margin: .25rem 0; max-width: 100%; object-fit: cover; display: block;
}
.aboutcontainer > img { padding-left: .5rem; }

.audio-player { background: var(--color-bg); padding: 1rem; text-align: center; max-width: 80%; margin: 2rem auto; }
.audio-player h2 { font-family: "wom", serif; color: var(--color-fg); margin-bottom: 1rem; overflow: hidden; }
audio { width: 80%; padding: 10px 15px; }
audio::-webkit-media-controls-panel { background-color: var(--color-bg); }
audio::-webkit-media-controls-current-time-display, audio::-webkit-media-controls-time-remaining-display { color: var(--color-fg); }
.aud-img { max-width: 30%; }

.vidheader, .vidbody { animation: myvidtrans 3s 1s forwards; }
.vidhr { animation: myhrtrans 3s 1s forwards; }
.page-v .vidheaderlink { animation: mytexttrans 3s 1s forwards; }

.linkscontainer > li { margin-bottom: 1rem; }
.linkscontainer > li > a > img { max-height: 100px; max-width: 100px; margin-right: 1rem; }

.article { width: inherit; height: auto; margin: 2rem 0; text-align: justify; text-justify: inter-word; padding-top: 10px; }
.article > h1, .article > h5 { text-align: center; }
.articleFlex { display: flex; justify-content: center; }
.articleImg { display: inline-block; margin: 0 auto; max-height: 300px; max-width: 90%; cursor: pointer; }
.article-content { display: flex; flex-direction: row; align-items: center; column-gap: 2rem; }
.article-text { flex: 1 1 auto; max-width: 60ch; }
.article-text p { margin: 0; }
.swappable-image { width: 333px; height: 333px; max-width: 100%; object-fit: cover; display: block; }

.viewport, .glass-overlay, .modal { position: fixed; inset: 0; }
.viewport { width: 100vw; height: 100vh; overflow: hidden; z-index: 1; }
.gallery-container { position: relative; z-index: 1; width: 300vw; height: 300vh; padding: 120px 50px 50px; cursor: grab; transition: transform .1s ease-out; }
.gallery-container:active { cursor: grabbing; }
.image-item { position: absolute; cursor: pointer; transition: .3s cubic-bezier(.25,.46,.45,.94); width: 222px; height: 222px; }
.image-item img { width: 100%; height: 100%; object-fit: cover; transition: transform .3s ease; }
.image-item:hover { transform: scale(1.05) rotate(2deg); z-index: 10; }
.image-item:hover img { transform: scale(1.1); }

.tooltip { position: fixed; background: var(--color-bg); backdrop-filter: blur(10px); padding: 15px; pointer-events: none; opacity: 0; transform: translateY(10px); transition: .3s ease; z-index: 1000; min-width: 200px; border: 1px solid var(--color-border); }
.tooltip.show { opacity: 1; transform: translateY(0); }
.tooltip-image { width: 80px; height: 80px; object-fit: cover; margin-bottom: 10px; }
.tooltip-title { font-weight: bold; color: var(--color-accent); font-size: 14px; }

.modal { background: #010102; backdrop-filter: blur(20px); display: none; justify-content: center; align-items: center; z-index: 100; animation: modalFadeIn .3s ease; }
.modal-content { display: flex; max-width: 90%; max-height: 90%; background: color-mix(in srgb,var(--color-bg) 10%,transparent); backdrop-filter: blur(20px); overflow: hidden; }
.modal-image { max-width: 70%; max-height: 100%; object-fit: contain; }
.modal-info { padding: 40px; color: var(--color-8); min-width: 300px; display: flex; flex-direction: column; justify-content: center; }
.modal-title { font-family: "Azeret Mono", serif; font-size: 28px; font-weight: bold; margin-bottom: 20px; }
.modal-description { font-family: "Azeret Mono", serif; font-size: clamp(12px, 2.5vw, 16px); line-height: 1.6; opacity: .9; color: var(--color-8); white-space: pre-line; overflow-wrap: break-word; hyphens: auto; }
.close-modal { position: absolute; top: 30px; right: 30px; background: rgba(255,255,255,.2); border: none; color: var(--color-8); font-size: 24px; width: 50px; height: 50px; border-radius: 50%; cursor: pointer; backdrop-filter: blur(10px); transition: .3s ease; }
.close-modal:hover { background: var(--color-2); color: var(--color-8); transform: scale(1.1); }
.glass-overlay { z-index: 0; transition: backdrop-filter .3s ease; }
.glass-overlay.blurred { backdrop-filter: blur(40px) saturate(200%); background: var(--color-bg); }

.footer-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1.5rem; align-items: start; }
.footer-spacer { display: block; }
.footer-card { display: grid; grid-template-columns: auto auto; align-items: start; column-gap: 1rem; }

#gifwrap { display: flex; justify-content: center; align-items: center; margin: 0 auto; padding: 0; max-width: 100%; overflow: hidden; background-size: cover; background-position: center; }
#gifwrap img, #gifwrap video { width: auto !important; height: auto; max-width: 100%; max-height: calc(100vh - 160px); object-fit: contain; image-rendering: auto; }
#cycling-career-container { display: inline-flex; align-items: baseline; white-space: pre; position: relative; vertical-align: bottom; }
.career-text { position: relative; display: inline-block; opacity: 1; }
.glitching { animation: text-glitch .4s cubic-bezier(.25,.46,.45,.94) both; color: var(--color-fg); }
.hidden { display: none !important; }

@keyframes myfade { from { opacity: 1; } to { opacity: 0; } }
@keyframes myvidtrans { from { background-color: var(--color-bg); } to { background-color: var(--alt-bg); } }
@keyframes myhrtrans { from { border-bottom: 1px solid var(--color-fg); } to { border-bottom: 1px solid var(--alt-fg); } }
@keyframes mytexttrans { from { color: var(--color-fg); } to { color: var(--alt-fg); } }
@keyframes modalFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes text-glitch {
    0% { text-shadow: 2px 0 var(--color-2), -2px 0 var(--color-6); transform: translate(0); }
    20% { text-shadow: 2px 0 var(--color-3), -2px 0 var(--color-5); transform: translate(-2px, 1px); opacity: .8; }
    40% { text-shadow: -2px 0 var(--color-8), 2px 0 var(--color-1); transform: translate(2px, -1px); opacity: 1; }
    60% { text-shadow: 2px 0 var(--color-5), -2px 0 var(--color-3); transform: translate(-1px, 2px); }
    80% { text-shadow: -1px 0 var(--color-6), 1px 0 var(--color-2); transform: translate(1px, -2px); }
    100% { text-shadow: none; transform: translate(0); opacity: 1; }
}
::view-transition-group(root) { animation-duration: .666s; }
::view-transition-old(root) { animation: pixel-glitch-out .666s steps(8,end) both; }
::view-transition-new(root) { animation: pixel-glitch-in .666s steps(8,end) both; mix-blend-mode: plus-lighter; }
@keyframes pixel-glitch-out {
    0% { clip-path: inset(0 0 0 0); transform: translate(0); } 10% { clip-path: inset(10% 0 88% 0); transform: translate(-5px, 2px); }
    30% { clip-path: inset(88% 0 10% 0); transform: translate(5px, -2px); filter: hue-rotate(90deg); } 50% { clip-path: inset(45% 0 53% 0); transform: translate(-5px, 0); filter: invert(1); }
    70% { clip-path: inset(0 0 0 0); opacity: 1; } 100% { opacity: 0; transform: translate(0); }
}
@keyframes pixel-glitch-in {
    0% { opacity: 0; transform: translateX(20px); } 20% { opacity: 1; clip-path: inset(20% 0 78% 0); transform: translate(-5px, 0); }
    40% { clip-path: inset(60% 0 38% 0); transform: translate(5px, 5px); filter: hue-rotate(-90deg); } 60% { clip-path: inset(5% 0 92% 0); transform: translate(-2px, -2px); }
    80% { clip-path: inset(0 0 0 0); } 100% { opacity: 1; transform: translate(0); }
}

@media (max-width: 800px) {
    header, main, footer { padding: .5rem; }
    .image-hover { opacity: 1; animation: 2s myfade infinite alternate; }
    .modal-content { flex-direction: column; max-width: 95%; }
    .modal-image { max-width: 100%; max-height: 40vh; height: auto; }
    .modal-info { min-width: auto; padding: 20px; }
    .tooltip, #closeModal, .footer-spacer { display: none !important; }
    .image-item { width: 150px; height: 150px; }
    .article-content { flex-direction: column; align-items: center; row-gap: 1rem; column-gap: 0; width: 100%; }
    .swappable-image { width: 100%; max-width: 300px; height: auto; aspect-ratio: 1/1; min-width: 150px; align-self: center; }
    .article-text { width: 100%; max-width: none; flex: none; }
    .article-text p { line-height: 1.4; font-size: 14px; }
    .grid-2, .grid-4 { display: grid; grid-gap: 1rem; }
    .grid-2 { grid-template-columns: repeat(2, 1fr); }
    .grid-4 { grid-template-columns: repeat(4, 1fr); }
    .homenavcontainer { padding: .5rem .75rem; display: grid; grid-template-columns: 1fr auto; grid-template-rows: auto auto; gap: .5rem; }
    .homenavcontainer > header { display: contents; }
    .homenavcontainer header h1 { grid-column: 1; grid-row: 1; font-size: var(--brand-size); line-height: 1.05; margin: 0; }
    .homenavcontainer > img, .homenavcontainer .vidimage-wrapper { grid-column: 2; grid-row: 1; height: calc(var(--brand-size) + 4px); width: auto; justify-self: end; padding: 0; }
    .homenavcontainer .vidimage-wrapper img { height: calc(var(--brand-size) + 4px); padding: 0; }
    .homenavcontainer header nav { grid-column: 1 / -1; grid-row: 2; width: 100%; }
    .homenavcontainer header .navsection { display: flex; flex-wrap: nowrap; gap: 0 .5rem; overflow-x: auto; }
    .homenavcontainer header .navsection a { font-size: clamp(12px, 3vw, 15px); white-space: nowrap; }
    .about.grid-2 { display: block; }
    .aboutcontainer, .vidaboutcontainer { display: grid; grid-template-columns: 1fr auto; column-gap: 1rem; row-gap: .5rem; align-items: start; }
    .aboutabout { grid-column: 1; }
    .aboutcontainer > img, .vidaboutcontainer > img, .aboutcontainer .vidimage-wrapper, .vidaboutcontainer .vidimage-wrapper { grid-column: 2; justify-self: end; }
    .aboutcontainer > img, .vidaboutcontainer > img, .aboutcontainer .vidimage-wrapper img, .vidaboutcontainer .vidimage-wrapper img, .footer-card__img, .footer-card__imgwrap img {
        height: var(--footer-img-mobile); margin: .25rem 0;
    }
    .aboutcontainer .vidimage-wrapper .vidimage-hover, .vidaboutcontainer .vidimage-wrapper .vidimage-hover { animation: myfade 3s 1s reverse forwards; }
    .footer-grid { grid-template-columns: 1fr; }
    .footer-card { grid-template-columns: 1fr auto; column-gap: .75rem; }
}