/* Font declarations */
@font-face {
    font-family: '0xProto';
    src: url('../fonts/0xProto-Regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: '0xProto';
    src: url('../fonts/0xProto-Bold.otf') format('opentype');
    font-weight: bold;
    font-style: normal;
}

@font-face {
    font-family: '0xProto';
    src: url('../fonts/0xProto-Italic.otf') format('opentype');
    font-weight: normal;
    font-style: italic;
}

/* Variables for theme switching */
:root {
    --bg-color: #000000;
    --bg-color-rgb: 0, 0, 0;
    --text-color: #f5f5f5;
    --border-color: #333;
    --card-bg: #1a1a1a;
    --accent-color: #0071e3;
    --hover-color: #fff;
    --shadow-color: rgba(255, 255, 255, 0.1);
}

.light-mode {
    --bg-color: #ffffff;
    --bg-color-rgb: 255, 255, 255;
    --text-color: #1d1d1f;
    --border-color: #e5e5e5;
    --card-bg: #f5f5f7;
    --accent-color: #0071e3;
    --hover-color: #000;
    --shadow-color: rgba(0, 0, 0, 0.1);
}

/* Reset and base styles */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', 'Helvetica Neue', 'Fira Code', '0xProto', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-color);
    line-height: 1.5;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    padding-top: 150px; /* Space for fixed header */
}

.container {
    max-width: 980px;
    margin: 0 auto;
    padding: 2rem;
    position: relative;
}

/* Header and Navigation Sticky */
.header-container {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background-color: rgba(var(--bg-color-rgb), 0.85);
    z-index: 1000;
    padding: 1rem 0;
    transition: all 0.3s ease;
    backdrop-filter: blur(10px);
    -webkit-backdrop-filter: blur(10px);
    border-bottom: 1px solid var(--border-color);
}

.header-content {
    max-width: 980px;
    margin: 0 auto;
    padding: 0 2rem;
    position: relative;
}

.scrolled {
    box-shadow: 0 4px 12px var(--shadow-color);
    padding: 0.5rem 0;
}

.scrolled h1 {
    font-size: 24px;
    transition: all 0.3s ease;
    margin-bottom: 0.25rem;
}

.scrolled .subtitle {
    font-size: 14px;
    transition: all 0.3s ease;
    margin-bottom: 0;
}

.scrolled header {
    padding-top: 0.5rem;
    padding-bottom: 0.5rem;
}

.scrolled nav {
    opacity: 0;
    height: 0;
    overflow: hidden;
    transition: all 0.3s ease;
}

/* Theme toggle */
#theme-toggle {
    position: absolute;
    top: 1rem;
    right: 1rem;
    background: var(--accent-color);
    border: none;
    color: white;
    font-family: -apple-system, BlinkMacSystemFont, 'SF Pro Text', sans-serif;
    padding: 0.5rem 1rem;
    cursor: pointer;
    font-size: 0.9rem;
    border-radius: 980px;
    transition: all 0.3s ease;
    z-index: 1001;
}

#theme-toggle:hover {
    opacity: 0.9;
}

/* Typography */
h1, h2, h3 {
    font-weight: 600;
    margin-bottom: 1rem;
    color: var(--text-color);
}

h1 {
    font-size: 48px;
    letter-spacing: -0.5px;
    line-height: 1.1;
    font-weight: 700;
    transition: all 0.3s ease;
}

h2 {
    font-size: 28px;
    margin-top: 3rem;
    font-weight: 600;
}

h3 {
    font-size: 21px;
    margin-bottom: 0.5rem;
}

p {
    margin-bottom: 1.5rem;
    font-size: 17px;
}

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

a:hover {
    text-decoration: underline;
}

/* Header styles */
header {
    text-align: center;
    padding-top: 1rem;
    padding-bottom: 0.5rem;
}

.subtitle {
    font-size: 18px;
    font-weight: 400;
    margin-top: 0.25rem;
    margin-bottom: 0;
    color: var(--text-color);
    opacity: 0.8;
    transition: all 0.3s ease;
}

/* Navigation */
nav {
    text-align: center;
    padding-bottom: 0.5rem;
    transition: all 0.3s ease;
}

nav ul {
    display: flex;
    justify-content: center;
    list-style: none;
    flex-wrap: wrap;
}

nav li {
    margin: 0 1.5rem;
}

nav a {
    font-size: 14px;
    font-weight: 400;
    color: var(--accent-color);
    padding: 0.5rem 0;
    transition: all 0.3s ease;
}

nav a:hover {
    opacity: 0.7;
    text-decoration: none;
}

/* Section styles */
section {
    margin-bottom: 4rem;
    padding: 0;
}

/* Skills grid */
.skills-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 1rem;
    margin-top: 2rem;
}

.skill-item {
    background-color: var(--card-bg);
    border-radius: 12px;
    padding: 1rem;
    text-align: center;
    font-weight: 500;
    transition: all 0.3s ease;
    font-size: 15px;
}

.skill-item:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px var(--shadow-color);
}

/* Projects grid */
.project-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 2rem;
    margin-top: 2rem;
}

.project-item {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 1.5rem;
    transition: all 0.3s ease;
    box-shadow: 0 4px 8px var(--shadow-color);
}

.project-item:hover {
    transform: translateY(-6px);
    box-shadow: 0 8px 16px var(--shadow-color);
}

.project-item h3 {
    font-weight: 600;
}

.project-item p {
    color: var(--text-color);
    opacity: 0.8;
    font-size: 14px;
    margin-bottom: 1rem;
}

.project-link {
    display: inline-block;
    background-color: var(--accent-color);
    color: white;
    padding: 0.5rem 1.2rem;
    border-radius: 980px;
    font-size: 14px;
    margin-top: 1rem;
    transition: all 0.3s ease;
}

.project-link:hover {
    opacity: 0.9;
    text-decoration: none;
}

.project-skills {
    font-size: 13px;
    color: var(--accent-color);
    margin-bottom: 0.8rem;
    font-weight: 500;
}

/* Contact section */
.contact-info {
    background-color: var(--card-bg);
    border-radius: 16px;
    padding: 2rem;
    margin-top: 2rem;
    box-shadow: 0 4px 8px var(--shadow-color);
}

.contact-info p {
    margin-bottom: 1rem;
}

/* Footer */
footer {
    margin-top: 4rem;
    text-align: center;
    padding-top: 2rem;
    border-top: 1px solid var(--border-color);
    font-size: 12px;
    opacity: 0.8;
}

.terminal-cursor {
    animation: blink 1s infinite;
}

@keyframes blink {
    0%, 100% { opacity: 1; }
    50% { opacity: 0; }
}

/* Responsive adjustments */
@media (max-width: 768px) {
    .container {
        padding: 1.5rem;
    }
    
    h1 {
        font-size: 32px;
    }
    
    h2 {
        font-size: 24px;
    }
    
    nav ul {
        flex-direction: row;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    nav li {
        margin: 0.5rem 1rem;
    }
    
    .project-grid {
        grid-template-columns: 1fr;
    }
    
    #theme-toggle {
        display: none; /* Hide theme toggle on mobile */
    }
}

/* iPad specific adjustments */
@media (min-width: 768px) and (max-width: 1024px) {
    #theme-toggle {
        display: none; /* Hide theme toggle on iPads */
    }
}