:root {
    --bg-color: #f5f5f7;
    --text-color: #1d1d1f;
    --card-bg: #ffffff;
    --accent-color: #0071e3;
    --nav-bg: rgba(255, 255, 255, 0.8);
    --shadow: 0 4px 6px -1px rgba(0, 0, 0, 0.1), 0 2px 4px -1px rgba(0, 0, 0, 0.06);
}

@media (prefers-color-scheme: dark) {
    :root {
        --bg-color: #000000;
        --text-color: #f5f5f7;
        --card-bg: #1c1c1e;
        --nav-bg: rgba(28, 28, 30, 0.8);
    }
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    margin: 0;
    padding: 0;
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
}

/* Navigation */
nav {
    position: sticky;
    top: 0;
    background-color: var(--nav-bg);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(0,0,0,0.1);
    z-index: 1000;
    display: flex;
    justify-content: center;
    padding: 0.8rem 0;
}

@media (prefers-color-scheme: dark) {
    nav {
        border-bottom: 1px solid rgba(255,255,255,0.1);
    }
}

nav ul {
    list-style: none;
    padding: 0;
    margin: 0;
    display: flex;
    gap: 2rem;
}

nav a {
    text-decoration: none;
    color: var(--text-color);
    font-size: 0.8rem;
    font-weight: 500;
    opacity: 0.8;
    transition: opacity 0.2s;
}

nav a:hover, nav a.active {
    opacity: 1;
}

/* Base Layout */
.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 4rem 2rem;
    animation: fadeIn 0.8s ease-out;
}

/* Hero Section (Home) */
.hero {
    text-align: center;
    padding: 4rem 0;
}

.profile-img {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 1.5rem;
    box-shadow: var(--shadow);
}

.hero h1 {
    font-size: 3.5rem;
    letter-spacing: -0.015em;
    margin: 0.5rem 0;
    font-weight: 700;
}

.hero .subtitle {
    font-size: 1.5rem;
    color: var(--text-color);
    opacity: 0.6;
    margin-bottom: 2rem;
    font-weight: 400;
}

/* Bento Grid for About/Skills */
.bento-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 1.5rem;
    margin-top: 4rem;
}

.bento-card {
    background-color: var(--card-bg);
    border-radius: 18px;
    padding: 2rem;
    box-shadow: var(--shadow);
    transition: transform 0.3s ease;
}

.bento-card:hover {
    transform: scale(1.02);
}

.bento-card h2 {
    font-size: 1.5rem;
    margin-top: 0;
    margin-bottom: 1rem;
}

.tag-container {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.tag {
    background-color: rgba(0, 113, 227, 0.1);
    color: var(--accent-color);
    padding: 0.4rem 0.8rem;
    border-radius: 20px;
    font-size: 0.9rem;
    font-weight: 600;
}

/* Apps Grid (Apps Page) */
.apps-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    padding-top: 2rem;
}

.app-card {
    background-color: var(--card-bg);
    border-radius: 20px;
    overflow: hidden;
    box-shadow: var(--shadow);
    transition: transform 0.3s cubic-bezier(0.165, 0.84, 0.44, 1);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.app-card:hover {
    transform: translateY(-8px);
}

.app-icon-placeholder {
    height: 160px;
    background: linear-gradient(135deg, #FF9A9E 0%, #FECFEF 99%, #FECFEF 100%); 
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 4rem;
}

.app-icon-foodsaver {
    background: linear-gradient(135deg, #a8e063 0%, #56ab2f 100%); 
}

.app-content {
    padding: 1.5rem;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
}

.app-content h3 {
    margin: 0;
    font-size: 1.3rem;
    font-weight: 600;
}

.app-content p {
    font-size: 0.95rem;
    opacity: 0.8;
    margin: 0.5rem 0 1.5rem 0;
    flex-grow: 1;
}

.app-button {
    display: inline-block;
    background-color: var(--bg-color); /* Button background fits theme */
    color: var(--accent-color);
    padding: 0.6rem 1.2rem;
    border-radius: 20px;
    text-decoration: none;
    font-weight: 600;
    font-size: 0.9rem;
    text-align: center;
    align-self: flex-start;
    background-color: rgba(0, 113, 227, 0.1);
}

.app-button:hover {
    background-color: var(--accent-color);
    color: white;
}

/* Footer */
footer {
    text-align: center;
    padding: 3rem;
    font-size: 0.8rem;
    opacity: 0.5;
    margin-top: auto;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

/* Contact Page specific styles */
.contact-card {
    cursor: pointer;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 200px;
}

.contact-card:active {
    transform: scale(0.98);
}

.contact-card .icon {
    font-size: 3rem;
    margin-bottom: 1rem;
    background: var(--bg-color);
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
}

/* Dialog / Modal Styles */
dialog {
    border: none;
    border-radius: 20px;
    padding: 2rem;
    background: var(--card-bg);
    color: var(--text-color);
    box-shadow: 0 20px 40px rgba(0,0,0,0.2);
    max-width: 400px;
    width: 90%;
    backdrop-filter: blur(20px);
}

dialog::backdrop {
    background: rgba(0, 0, 0, 0.3);
    backdrop-filter: blur(5px);
}

dialog h3 {
    margin-top: 0;
    margin-bottom: 1rem;
    font-size: 1.5rem;
}

dialog p {
    margin-bottom: 1.5rem;
    opacity: 0.8;
}

.dialog-buttons {
    display: flex;
    flex-direction: column;
    gap: 0.8rem;
}

.dialog-btn {
    padding: 1rem;
    border-radius: 12px;
    border: none;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s, background-color 0.2s;
}

.dialog-btn.primary {
    background-color: var(--accent-color);
    color: white;
}

.dialog-btn.secondary {
    background-color: rgba(0, 113, 227, 0.1);
    color: var(--accent-color);
}

.dialog-btn.close {
    background-color: transparent;
    color: var(--text-color);
    opacity: 0.6;
    margin-top: 0.5rem;
}

.dialog-btn:hover {
    transform: scale(1.02);
}
