/* FONT FAMILIES */
/** Regular */
@font-face {
    font-family: 'IBM Plex Sans';
    src: url('/assets/fonts/IBMPlexSans-VariableFont_wdth,wght.ttf') format('truetype');
    font-weight: 100 700;
    font-style: normal;
    font-display: swap;
}

/** Italic */
@font-face {
    font-family: 'IBM Plex Sans';
    src: url('/assets/fonts/IBMPlexSans-Italic-VariableFont_wdth,wght.ttf') format('truetype');
    font-weight: 100 700;
    font-style: italic;
    font-display: swap;
}

/** Symbols */
@font-face {
    font-family: 'Material Symbols Outlined';
    src: url('/assets/fonts/material_symbols_outlined.woff2') format('opentype');
    font-weight: 100 700;
    font-style: normal;
    font-display: swap;
}

.material-symbols-outlined {
    font-family: 'Material Symbols Outlined', sans-serif;
    font-weight: normal;
    font-style: normal;
    line-height: 0;
    letter-spacing: normal;
    text-transform: none;
    display: inline-block;
    white-space: nowrap;
    word-wrap: normal;
    direction: ltr;
    -webkit-font-feature-settings: 'liga';
    font-feature-settings: 'liga';
    -webkit-font-smoothing: antialiased;
    font-variation-settings: 'FILL' 0, 'wght' 400, 'GRAD' 0, 'opsz' 20;
}

* {
    box-sizing: border-box;
}

::selection {
    background: var(--text-main);
    color: #fff;
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }

    to {
        opacity: 1;
        transform: translateY(0);
    }
}

:root {
    /* GRAYSCALE PALETTE */
    --bg-color: #fafafa;
    --text-main: #1a1a1a;
    --text-secondary: #555555;
    --border-color: #e0e0e0;
    --accent-color: #000000;
    --hover-bg: #f0f0f0;

    /* ANIMATIONS */
    --transition-speed: 0.3s;
    --transition-ease: cubic-bezier(0.4, 0, 0.2, 1);
}

/* GENERAL */
body,
html {
    height: 100%;
    margin: 0;
    font-family: 'IBM Plex Sans', sans-serif;
    display: flex;
    flex-direction: column;
    line-height: 1.6;
    background-color: var(--bg-color);
    color: var(--text-main);
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
}

#particle-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1;
    /* Above body bg, below content */
    pointer-events: none;
    /* Let clicks pass through */
    opacity: 0.6;
    display: none;
    /* Hidden by default (mobile) */
}

@media (min-width: 1024px) {
    #particle-canvas {
        display: block;
        /* Visible on desktop */
    }
}

nav {
    display: flex;
    justify-content: center;
    align-items: center;
    background-color: transparent;
    padding: 20px;
    width: 100%;
    max-width: 800px;
    margin: 0 auto;
    gap: 30px;
    position: relative;
    /* Promote layer */
    z-index: 10;
}

@media (max-width: 450px) {
    nav {
        gap: 15px;
        padding: 20px 10px;
    }
}

nav a {
    flex: 1;
    text-align: center;
    font-size: 15px;
    text-decoration: none;
    padding: 10px 0;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all var(--transition-speed) var(--transition-ease);
    border-bottom: 2px solid transparent;
}

nav a:hover {
    color: var(--text-main);
    border-bottom: 2px solid var(--border-color);
}

.current {
    color: var(--text-main);
    border-bottom: 2px solid var(--accent-color);
}

.container {
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    flex: 1;
    align-items: center;
    flex: 1;
    padding: 30px 20px 30px 20px;
    position: relative;
    /* Promote layer */
    z-index: 10;
}

.containerchild {
    max-width: 984px;
    animation: fadeInUp 0.8s var(--transition-ease) forwards;
}

.box {
    margin-top: 20px;
    position: relative;
}

h1 {
    word-break: break-word;
    font-size: 2.5rem;
    font-weight: 700;
    letter-spacing: -0.5px;
    margin: 0;
    color: var(--accent-color);
}

h2 {
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: var(--text-main);
}

h3 {
    font-size: 1.125rem;
    font-weight: 500;
    margin: 15px 0 0 0;
    color: var(--text-main);
}

.project h3 {
    margin: 2px 0 0 0;
}

p {
    font-size: 1rem;
    font-weight: 400;
    margin: 10px 0 0 0;
    color: var(--text-secondary);
}

a {
    color: var(--accent-color);
    text-decoration: none;
    transition: color var(--transition-speed) var(--transition-ease);
}

a:hover {
    color: var(--text-secondary);
}

.contact-links {
    display: flex;
    flex-direction: column;
    gap: 10px;
    margin-top: 15px;
}

.contact-btn {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
    /* Reverted to full width */
    gap: 8px;
    /* Ensure spacing between text and icon */
    padding: 6px 12px;
    /* Match button padding */
    background-color: var(--accent-color);
    /* Match button bg */
    border: none;
    /* Match button border */
    border-radius: 0;
    /* Sharp corners as requested */
    color: #fff;
    /* Match button text */
    font-size: 15px;
    font-weight: 500;
    transition: background-color var(--transition-speed) var(--transition-ease);
    text-decoration: none;
    position: relative;
    overflow: hidden;
    z-index: 1;
}

.contact-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.1) 40%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.1) 60%, transparent 100%);
    animation: highlightSlide 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    z-index: -1;
}

.contact-btn:hover {
    background-color: var(--text-secondary);
    /* Match button hover */
    color: #fff !important;
}

.contact-btn .material-symbols-outlined {
    font-size: 18px;
}

.avatar {
    width: 100px;
    height: 100px;
    margin-bottom: 20px;
    transition: transform var(--transition-speed) var(--transition-ease);
}

.avatar:hover {
    transform: scale(1.05);
}

.squircle {
    mask-image: url(data:image/svg+xml;base64,PHN2ZyB3aWR0aD0nMjAwJyBoZWlnaHQ9JzIwMCcgeG1sbnM9J2h0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnJz48cGF0aCBkPSdNMTAwIDBDMjAgMCAwIDIwIDAgMTAwczIwIDEwMCAxMDAgMTAwIDEwMC0yMCAxMDAtMTAwUzE4MCAwIDEwMCAwWicvPjwvc3ZnPg==);
    mask-size: contain;
    mask-repeat: no-repeat;
    mask-position: center;
}

/* IMAGE GRID */
.widthCalculated {
    width: calc(100vw - 40px);
}

.imgdetail p {
    font-size: 12px;
    margin: 10px 0 0 0;
    overflow-x: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
}

#imgcontainer {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    /* MOBILE */
    gap: 20px;
}

@media (min-width: 640px) {
    #imgcontainer {
        grid-template-columns: repeat(3, 1fr);
        /* SMALL TABLETS */
    }
}

@media (min-width: 1024px) {
    #imgcontainer {
        grid-template-columns: repeat(4, 1fr);
        /* DESKTOP */
    }
}

.img img {
    /* BEST WIDTH: 570 (iPhone) - 615 (Samsung) */
    width: 100%;
    height: auto;
    display: block;
}

.imgdetail {
    display: grid;
    grid-template-rows: 1fr auto auto auto;
    text-align: center;
}

.img {
    display: flex;
    align-items: center;
    justify-content: center;
    height: 100%;
    background-color: var(--hover-bg);
}

/** PROJECTS */
ul {
    list-style: none;
    padding-left: 0;
    padding: 0;
    margin: 0;
}

.project ul {
    padding: 0 10px 10px 0;
}

ul li {
    position: relative;
    padding-left: 1.5em;
    word-break: keep-all;
    white-space: normal;
    font-size: 1rem;
    color: var(--text-secondary);
    margin-top: 10px;

}

ul li span {
    white-space: nowrap;
}

ul li::before {
    content: "— ";
    position: absolute;
    left: 0;
}

button,
.project-btn {
    padding: 6px 12px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 15px;
    background-color: var(--accent-color);
    color: #fff;
    border: none;
    transition: background-color var(--transition-speed) var(--transition-ease);
    position: relative;
    overflow: hidden;
    z-index: 1;
    text-decoration: none;
    /* For the anchor tag */
    border-radius: 0;
    /* Ensure sharp corners */
}

button::before,
.project-btn::before {
    content: '';
    position: absolute;
    top: 0;
    left: -150%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent 0%, rgba(255, 255, 255, 0.1) 40%, rgba(255, 255, 255, 0.3) 50%, rgba(255, 255, 255, 0.1) 60%, transparent 100%);
    animation: highlightSlide 3s cubic-bezier(0.4, 0, 0.2, 1) infinite;
    z-index: -1;
}

@keyframes highlightSlide {
    0% {
        left: -150%;
    }

    50% {
        left: 150%;
    }

    100% {
        left: -150%;
    }
}

button:hover,
.project-btn:hover {
    background-color: var(--text-secondary);
    color: #fff !important;
}

button:focus-visible,
a:focus-visible {
    outline: 2px solid var(--text-secondary);
    outline-offset: 2px;
}

.flex-container {
    display: flex;
    justify-content: space-between;
}

.project {
    background: linear-gradient(90deg, #00000000 0%, #00000000 50%, var(--hover-bg) 100%);
}

/** SKULL */
.viewer {
    width: 100%;
    height: auto;
    max-height: 375px;
    aspect-ratio: 4 / 3;
    background: #00000008;
}

.img-container {
    width: 100%;
    background: #00000008;
}

.img-container img {
    width: 100%;
    max-width: 500px;
    margin: auto;
    display: block;
}

video {
    width: 100%;
    max-width: 500px;
    margin: auto;
    display: block;
}

figure {
    margin: 15px 0 0 0;
}

figcaption {
    text-align: center;
    margin-top: 10px;
}