@import url('https://fonts.googleapis.com/css2?family=Bitcount+Prop+Single:wght@500&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Montserrat:ital,wght@0,100..900;1,100..900&display=swap');
@import url('https://fonts.googleapis.com/css2?family=Ubuntu+Mono&display=swap');

/* Scrollbar*/
::-webkit-scrollbar {
    width: 5px;
}

::-webkit-scrollbar-track {
    background: #141414;
}

::-webkit-scrollbar-thumb {
    background: #343434;
}

::-webkit-scrollbar-thumb:hover {
    background: #383838;
}

/* Base styles */
html, body {
    padding: 0;
    margin: 0;
    scroll-behavior: smooth;
    background-color: #141414;
}

html {
    -webkit-text-size-adjust: 100%;
    text-size-adjust: 100%;
}

body {
    overflow-x: hidden;
    min-height: 100vh;
    max-width: 100vw;
    display: flex;
    flex-direction: column;
}

*, *::before, *::after {
    box-sizing: border-box;
}

progress {
	background-color: whiteSmoke !important;
	border-radius: 3px !important;
	box-shadow: 0 2px 3px rgba(0,0,0,.5) inset !important;
}

/* Typography */

h1 {
    font-family: "Bitcount Prop Single", system-ui;
    font-optical-sizing: auto;
    font-weight: 500;
    font-style: normal;
    font-variation-settings: "slnt" 0, "CRSV" 0.5, "ELSH" 0, "ELXP" 0;
    font-size: clamp(2rem, 4.5vw, 5rem);
    margin: 0 0 1rem 0;
    padding: 0;
}

h2 {
    font-family: "Montserrat", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    font-size: clamp(1rem, 2.5vw, 1.5rem);
    margin: 0;
}

h3 {
    font-family: "Montserrat", sans-serif;
    font-optical-sizing: auto;
    font-weight: 400;
    font-style: normal;
    margin: 0;
}

p, li {
    font-family: "Montserrat", sans-serif;
    line-height: 1.6;
    color: white;
}

a {
    font-family: "Montserrat", sans-serif;
    line-height: 1;
    color: white;
}

.timestamp {
    margin-top: 1vh;
    font-family: "Montserrat", sans-serif;
    font-weight: 300;
    margin-bottom: 0;
    color: #888; 
    font-size: 0.9rem;
}

.highlighter-rouge pre.highlight {
    background-color: #252525 !important;
    padding: 1.25rem;
    margin: 1.5rem 0;
    border-radius: 8px;
    border: 1px solid #2a2a2a;
    overflow-x: auto;
    display: block;
}

.highlighter-rouge code {
    font-family: "Ubuntu Mono", monospace;
    color: #e0e0e0;
    background: transparent !important;
    padding: 0 !important;            
}

/* Layout */

.container-fluid {
    padding: 0;
    margin: 0;
}

.container {
    max-width: 800px;
    padding: 1.25rem 1.25rem 1.25rem 1.25rem;
    margin: 1.5rem auto;
    color: white;
    width: 100%;
}

.is-centered {
    display: flex;
    justify-content: center;
    align-items: center;
    text-align: center;
    padding: 1rem;
}

/* Hero section */

#main-hero {
    --dot-bg: #141414;
    --dot-color: white;
    --dot-size: 1px;
    --dot-space: 22px;
    background:
        linear-gradient(90deg, var(--dot-bg) calc(var(--dot-space) - var(--dot-size)), transparent 1%) center / var(--dot-space) var(--dot-space),
        linear-gradient(var(--dot-bg) calc(var(--dot-space) - var(--dot-size)), transparent 1%) center / var(--dot-space) var(--dot-space),
        var(--dot-color);
    color: white;
    min-height: 100vh;
    flex-direction: column;
}

/* Navigation */

nav {
    display: flex;
    align-items: center;
    justify-content: space-between;
    width: 100%;
    min-height: 60px;
    background-color: #202020;
    color: white;
    position: sticky;
    top: 0;
    z-index: 1000;
    padding: 0.5rem 0;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.3);
}

.left-side {
    padding-left: 1.5%;
}

.center {
    display: flex;
    gap: 0.5rem;
}

.right-side {
    padding-right: 1.5%;
}

.nav-img {
    height: 40px;
    width: 40px;
    border-radius: 15%;
    display: block;
}

/* Buttons and Tooltips */

.button-square {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background-color: #292929;
    height: 44px;
    width: 44px;
    border-radius: 15%;
    text-decoration: none;
    color: white;
    transition: background-color 0.2s ease;
    position: relative;
}

.button-square:hover {
    background-color: #383838;
}

/* Skillbars */

.skill {
    margin-bottom: 15px;
}

.skill-name {
    display: flex;
    justify-content: space-between;
    margin-bottom: 10px;
    font-style: 14px;
    text-transform: uppercase;
    letter-spacing: .5px;
    font-family: "Montserrat", sans-serif;
}

.skill-level {
    color: #888;
}

.progress-container {
    width: 100%;
    height: 17.5px;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
    --dot-bg: #141414;
    --dot-color: #666;
    --dot-size: 2px;
    --dot-space: 7.5px;
    background:
        linear-gradient(90deg, var(--dot-bg) calc(var(--dot-space) - var(--dot-size)), transparent 1%) center / var(--dot-space) var(--dot-space),
        linear-gradient(var(--dot-bg) calc(var(--dot-space) - var(--dot-size)), transparent 1%) center / var(--dot-space) var(--dot-space),
        var(--dot-color);
}

.progress-fill {
    height: 100%;
    background-color: white;
    transition: width 1s ease-out;
    border-radius: 3px 0 0 3px;
}

@keyframes fillProgress {
    from {
        width: 0;
    }
}

.progress-fill {
    animation: fillProgress 1s ease-out;
}

/* Footer */

footer {
    background-color: #202020;
    text-align: center;
    margin-top: 5vh !important;
}

footer > p {
    margin-top: 5vh;
    margin-bottom: 5vh;
}

footer > p > a {
    color: white;
    transition: color .25s;
}

footer > p > a:hover {
    color: #888;
}

/* Shared tooltip styles */
.button-square::before,
.left-side a::before {
    content: attr(data-tooltip);
    position: absolute;
    top: calc(100% + 8px);
    left: 50%;
    transform: translateX(-50%);
    background-color: #1a1a1a;
    color: white;
    padding: 6px 10px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
    font-family: "Montserrat", sans-serif;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.4);
    z-index: 10001;
}

.button-square:hover::before,
.left-side a:hover::before {
    opacity: 1;
}

/* Tooltip arrow */
.button-square::after {
    content: "";
    position: absolute;
    top: calc(100% + 2px);
    left: 50%;
    transform: translateX(-50%);
    border: 5px solid transparent;
    border-bottom-color: #1a1a1a;  
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.2s ease;
}

.button-square:hover::after {
    opacity: 1;
}

/* Card system */
.card {
    background-color: #202020;
    border-radius: 12px;
    padding: 1.5rem;
    display: flex;
    flex-direction: column;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
    border: 1px solid #2a2a2a;
    text-decoration: none;
    color: white;
}

.card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 16px rgba(0, 0, 0, 0.4);
    border-color: #383838;
}

/* Projects section */
#projects {
    display: flex;
    flex-direction: column;
}

.row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(min(300px, 100%), 1fr)); 
    gap: 1.5rem;
    width: 100%;
}

.row:not(:last-child) {
    margin-bottom: 1.5rem;
}

.project-card {
    min-height: 250px;
}

.project-card:hover {
    background-color: #202020;
}

.card-header {
    margin-bottom: 1rem;
    padding-bottom: 0.75rem;
    border-bottom: 1px solid #2a2a2a;
}

.card-header h3 {
    font-family: "Montserrat", sans-serif;
    font-size: 1.5rem;
    font-weight: 600;
    margin: 0;
    color: white;
}

.card-body {
    flex: 1;
    margin-bottom: 1rem;
}

.card-body p {
    margin: 0;
    color: #d0d0d0;
}

.card-footer {
    display: flex;
    gap: 0.75rem;
    padding-top: 0.75rem;
    border-top: 1px solid #2a2a2a;
    margin-top: auto;
}

.card-btn {
    flex: 1;
    padding: 0.5rem 1rem;
    background-color: #292929;
    color: white;
    text-decoration: none;
    text-align: center;
    border-radius: 6px;
    font-family: "Montserrat", sans-serif;
    font-size: 0.9rem;
    transition: background-color 0.2s ease;
    border: 1px solid #343434;
}

.card-btn:hover {
    background-color: #383838;
    border-color: #4a4a4a;
}

.card-btn-primary {
    background-color: #3a3a3a;
}

.card-btn-primary:hover {
    background-color: #4a4a4a;
}

/* Contact me / Social media section */
#contact-me {
    display: flex;
    flex-direction: column;
}

.social-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.social-card {
    align-items: center;
    justify-content: center;
    gap: 0.75rem;
}

.social-card:hover {
    background-color: #252525;
}

.social-card svg {
    flex-shrink: 0;
}

.social-card span {
    font-family: "Montserrat", sans-serif;
    font-size: 0.9rem;
    font-weight: 500;
}

/* Responsiveness */

@media (max-width: 768px) {
    .container {
        padding: 1.25rem 1rem 15px 1rem;
        margin: 1rem auto;
    }

    .left-side {
        padding-left: 3%;
    }
    
    .right-side {
        padding-right: 3%;
    }
    
    .nav-img {
        height: 36px;
        width: 36px;
    }
    
    .button-square {
        height: 40px;
        width: 40px;
    }
    
    #main-hero {
        --dot-space: 18px;
    }
    
    nav {
        min-height: 56px;
    }
    
    p {
        font-size: 0.95rem;
    }

    #main-hero > div {
        max-width: 85%;
    }
}

@media (max-width: 768px) {
    nav .center a[data-tooltip="My PC and Homelab"],
    nav .center a[data-tooltip="Homelab Dashboard"] {
        display: none;
    }
}

@media (max-width: 480px) {
    .container {
        padding: 1rem 0.75rem;
    }

    .nav-img {
        height: 32px;
        width: 32px;
    }

    #projects {
        gap: 1.5rem;
    }

    .project-card {
        padding: 1rem;
    }

    .social-grid {
        grid-template-columns: repeat(2, 1fr);
        gap: 0.75rem;
    }

    .row {
        grid-template-columns: 1fr;
    }
}