﻿:root {
    --bg-color: #ffffff;
    --text-color: #333333;
    --heading-color: #226e93;
    --nav-bg: #ffffff;
    --nav-shadow: rgba(0, 0, 0, 0.08);
    --card-bg: #f7fbfd;
    --card-border: #d7e6ee;
    --card-active-bg: #eef6f9;
    --screenshot-bg: #f0f0f0;
    --secondary-text: #4f6b7a;
    --contact-border: #cccccc;
    --link-hover: #1a5673;
}

.dark-mode {
    --bg-color: #121212;
    --text-color: #e0e0e0;
    --heading-color: #4db8ff;
    --nav-bg: #1e1e1e;
    --nav-shadow: rgba(0, 0, 0, 0.3);
    --card-bg: #1e1e1e;
    --card-border: #333333;
    --card-active-bg: #2c2c2c;
    --screenshot-bg: #2c2c2c;
    --secondary-text: #b0b0b0;
    --contact-border: #333333;
    --link-hover: #7fcfff;
}

h1 {
    margin-bottom: 0;
}

nav {
    position: sticky;
    top: 0;
    z-index: 1000;
    background-color: var(--nav-bg);
    padding: 2px 20px;
    text-align: center;
    display: grid;
    grid-template-columns: 1fr 1fr;
    align-items: center;
    box-shadow: 0 2px 0 var(--nav-shadow);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

html {
    scroll-behavior: smooth;
}


body {
    margin: 0;
    line-height: 1.6;
    font-family: 'Inter', Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    transition: background-color 0.3s ease, color 0.3s ease;
}

p {
    line-height: 1.6;
    font-family: 'Inter', Arial, sans-serif;
}

h1, h2, h3, h4, h5, h6 {
    color: var(--heading-color);
    font-family: 'Inter', Arial, sans-serif;
    transition: color 0.3s ease;
}

.nav-left {
    text-align: left;
    justify-content: left;
    display: flex;
    flex-direction: row;
}
.nav-right {
    justify-content: right;
    text-align: right;
    display: flex;
    flex-direction: row;
    align-items: center;
}

.nav-element {
    margin: 0 5px;
    white-space: nowrap;
    color: var(--heading-color);
    text-decoration: none;
    font-weight: bold;
    font-Size: 1.4rem;
    transition: color 0.3s ease;
}

.nav-element:focus-visible {
    outline: 3px solid var(--heading-color);
    outline-offset: 4px;
    border-radius: 4px;
}

img {
    width: 100%;
    height: auto;
    border-radius: 10px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.project-image {
    aspect-ratio: 16/9;
    object-fit: cover;
    object-position: center;
}

.project-title {
    font-size: 1.4rem;
}

main {
    padding-bottom: 20px;
}

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

.content {
    width: 90%;
    max-width: 100rem;
    margin: 0 auto;
}

.content > * {
    width: 100%;
}

.grid-container {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    width: 100%;
    max-width: 100rem;
    gap: 20px;
}

.project-container {
    padding: 10px;
    margin: 0;
    border-radius: 12px;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.3s ease;
    text-align: center;
}

.project-container:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: var(--heading-color);
}

.project-container:active {
    transform: scale(0.98);
    background-color: var(--card-active-bg);
}

.project-container img {
    width: 100%;
    height: auto;
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
}

.project-container a { 
    text-decoration: none;
    color: var(--heading-color);
    display: block;
}

.project-cta {
    display: block;
    text-align: center;
    font-weight: bold;
    margin-top: 10px;
    color: var(--heading-color);
    font-size: 1rem;
}

.project-cta::after {
    content: ' \2192'; /* Unicode right arrow */
}

.screenshots {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
}

.project-screenshot {
    width: 100%;
    max-height: 450px;
    object-fit: contain;
    background-color: var(--screenshot-bg);
    transition: background-color 0.3s ease;
}

.project-date {
    font-size: 20px; 
    color: var(--heading-color);
    margin-bottom: 0;
}

.project-description {
    text-align: justify;
}

.project-link-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 16px;
}

.project-link-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 16px;
    padding: 24px;
    border-radius: 12px;
    text-decoration: none;
    width: 320px;
    flex: 0 1 auto;
    background-color: var(--card-bg);
    border: 1px solid var(--card-border);
    color: inherit;
    transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background-color 0.3s ease;
    text-align: center;
}

.project-link-card:hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.08);
    border-color: var(--heading-color);
}

.project-link-logo-box {
    width: 126px;
    height: 60px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.project-link-image {
    max-width: 100%;
    max-height: 100%;
    width: auto;
    height: auto;
    object-fit: contain;
    box-shadow: none;
    border-radius: 0;
}

.logo-dark {
    display: none;
}

.dark-mode .logo-light {
    display: none;
}

.dark-mode .logo-dark {
    display: block;
}

.project-link-text h3 {
    margin: 0 0 4px 0;
    font-size: 1.05rem;
}

.project-link-text p {
    margin: 0;
    color: var(--secondary-text);
    line-height: 1.4;
    min-width: 0;
    transition: color 0.3s ease;
}

.content > * {
    min-width: 0;
}

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

.description--short {
    display: none;
}

.description--long {
    display: block;
}

#view-projects {
    display: none;
}

#contact-me {
    display: none;
}

@media (max-width: 768px) {
    .grid-container {
        grid-template-columns: 1fr;
    }

    .screenshots {
        grid-template-columns: 1fr;
    }
    
    .nav-right .nav-element:not([href="#contact"]):not([href="index.html#projects"]) {
        display: none;
    }
    
    .theme-toggle {
        display: flex !important;
    }
    
    .nav-right a[href="#projects"],
    .nav-right a[href="index.html#projects"],
    .nav-right a[href="https://github.com/jackoberto"],
    .nav-right a[href="https://www.linkedin.com/in/jackkarlsson/"] {
        display: none;
    }

    .description--short {
        display: block;
    }

    .description--long {
        display: none;
    }
    
    #view-projects {
        display: inline;
    }
    
    #contact-me {
        display: inline;
    }
}

.contact {
    margin-top: 3rem;
    border-top: 1px solid var(--contact-border);
    padding: 1rem;
    text-align: center;
    transition: border-top 0.3s ease;
}

.contact a {
    font-size: 1.1rem;
}

.nav-element:active {
    background-color: var(--card-active-bg);
    transform: scale(0.95);
    border-radius: 4px;
}

.project-link-card:active {
    transform: scale(0.98);
    background-color: var(--card-active-bg);
}

p > a {
    color: var(--heading-color);
    text-decoration: underline;
    font-weight: 600;
    transition: color 0.2s ease;
}

p > a:hover {
    color: var(--link-hover);
}

p > a:active {
    background-color: rgba(34, 110, 147, 0.1);
}

#projects {
    margin-top: 4rem;
}

.theme-toggle {
    background: none;
    border: none;
    cursor: pointer;
    color: var(--heading-color);
    font-size: 1.4rem;
    padding: 0 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 5px;
    transition: transform 0.2s ease, color 0.3s ease;
}

.theme-toggle:hover {
    transform: scale(1.1);
}

.theme-toggle:focus-visible {
    outline: 3px solid var(--heading-color);
    outline-offset: 4px;
    border-radius: 4px;
}

.sun-icon {
    display: none;
}

.moon-icon {
    display: block;
}

.dark-mode .sun-icon {
    display: block;
}

.dark-mode .moon-icon {
    display: none;
}