/* Portfolio-specific styles */
@import url('https://fonts.googleapis.com/css2?family=Merriweather:wght@300;400;700&display=swap');
@import url('globals.css');

html, body {
    font-family: 'Merriweather', serif;
    overflow-x: hidden;
    background-color: var(--bg-primary);
}

body {
    background: var(--bg-primary);
    padding-top: 60px;
    transition: background-color 0.3s ease;
    position: relative;
}

.content {
    padding: 32px 32px;
    max-width: 1000px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.nav-bar {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 32px;
}

.contact-link {
    color: var(--text-secondary);
    font-size: 0.95rem;
    font-weight: 400;
}

.contact-link.animated-underline-link:hover {
    color: var(--accent);
}

.page-header {
    margin-bottom: 48px;
}

.page-title {
    color: var(--text-primary);
    font-size: 4rem;
    font-weight: 300;
    margin: 0;
    font-family: Georgia, serif;
    letter-spacing: -0.03em;
    line-height: 1.1;
}

/* Projects Section */
.projects-section {
    margin-bottom: 120px;
}

.projects-section h2 {
    font-size: 1.5rem;
    color: var(--text-tertiary);
    margin-bottom: 48px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-family: 'Merriweather', serif;
    text-align: left;
}

.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 56px;
}

.project-card {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 56px;
    background: var(--bg-secondary);
    border-radius: 16px;
    overflow: hidden;
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    align-items: center;
    padding: 40px;
    margin-left: -4px;
    margin-right: -4px;
    position: relative;
}

/* Subtle card texture */
.project-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.02;
    pointer-events: none;
    background-image: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" width="200" height="200"><filter id="cardnoise"><feTurbulence type="fractalNoise" baseFrequency="1.2" numOctaves="3" /></filter><rect width="100%" height="100%" filter="url(%23cardnoise)" /></svg>');
    border-radius: 16px;
}

.project-card:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.project-image {
    width: 100%;
    aspect-ratio: 3/2;
    overflow: hidden;
    border-radius: 12px;
    background: linear-gradient(135deg, var(--bg-primary), var(--bg-secondary));
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.12);
}

.project-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.placeholder-image {
    color: var(--text-secondary);
    font-size: 1.5rem;
    font-family: Georgia, serif;
    opacity: 0.8;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 100%;
    height: 100%;
    font-weight: 500;
}

.project-info {
    display: flex;
    flex-direction: column;
    gap: 20px;
    position: relative;
    z-index: 1;
}

.project-image {
    position: relative;
    z-index: 1;
}

.project-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.project-info h3 {
    color: var(--text-primary);
    font-size: 1.75rem;
    font-family: Georgia, serif;
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.3;
    margin: 0;
}

.project-info p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
}

.tag {
    background: var(--accent);
    color: var(--bg-primary);
    padding: 4px 12px;
    border-radius: 6px;
    font-size: 0.75rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.project-meta {
    margin: 4px 0 0 0;
}

.project-meta .first-worked {
    color: var(--text-tertiary);
    font-size: 0.9rem;
    font-style: italic;
}

.project-actions {
    display: flex;
    gap: 12px;
    margin-top: 8px;
}

.btn-primary, .btn-secondary {
    padding: 12px 24px;
    border-radius: 10px;
    text-decoration: none;
    font-weight: 500;
    transition: all 0.3s ease;
    border: 1px solid transparent;
    cursor: pointer;
    font-family: 'Merriweather', serif;
    font-size: 0.95rem;
    letter-spacing: 0.01em;
    display: inline-block;
}

.btn-primary {
    background: var(--accent);
    color: var(--bg-primary);
    border-color: var(--accent);
}

.btn-primary:hover {
    background: var(--accent-hover);
    border-color: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 8px 24px rgba(123, 95, 199, 0.4);
}

.btn-secondary {
    background: transparent;
    color: var(--text-secondary);
    border-color: var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--bg-secondary);
    border-color: var(--border-hover);
    color: var(--text-primary);
}

.btn-secondary:disabled {
    cursor: not-allowed;
    opacity: 0.4;
}

/* Commits Section */
.commits-section {
    margin-bottom: 120px;
}

.commits-section h2 {
    font-size: 1.5rem;
    color: var(--text-tertiary);
    margin-bottom: 16px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-family: 'Merriweather', serif;
    text-align: left;
}

.commits-section h3 {
    font-size: 2rem;
    color: var(--accent);
    margin-bottom: 48px;
    margin-top: 80px;
    font-family: Georgia, serif;
    font-weight: 400;
    letter-spacing: -0.02em;
}

.commits-section h3:first-of-type {
    margin-top: 0;
}

.commits-section h3:has(+ .project-description) {
    margin-bottom: 20px;
}

.commits-section .project-description {
    color: var(--text-tertiary);
    font-size: 1.05rem;
    line-height: 1.7;
    margin-bottom: 32px;
    max-width: 800px;
}

.commits-section .inline-link {
    color: var(--accent);
    font-weight: 500;
}

.commits-section .inline-link.animated-underline-link:hover {
    color: var(--accent-hover);
}

.commits-list {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.commit-item {
    background: var(--bg-secondary);
    border-radius: 16px;
    padding: 40px;
    margin-left: -4px;
    margin-right: -4px;
    border: 1px solid var(--border);
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.commit-item:hover {
    border-color: var(--accent);
    transform: translateY(-2px);
}

.commit-content h4 {
    color: var(--text-primary);
    font-size: 1.4rem;
    margin-bottom: 16px;
    font-family: Georgia, serif;
    font-weight: 400;
    letter-spacing: -0.02em;
    line-height: 1.4;
}

.commit-content p {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    margin-bottom: 0;
}

.commit-content ul {
    color: var(--text-secondary);
    font-size: 1rem;
    line-height: 1.7;
    margin: 0;
    padding-left: 24px;
}

.commit-content li {
    margin-bottom: 8px;
}

.commit-content li:last-child {
    margin-bottom: 0;
}

code {
    font-family: 'Monaco', 'Menlo', 'Courier New', monospace;
    font-size: 0.8em;
    background: var(--bg-primary);
    color: var(--accent);
    padding: 2px 6px;
    border-radius: 4px;
    border: 1px solid var(--border);
    word-break: break-word;
    overflow-wrap: break-word;
}

.commit-meta {
    display: flex;
    justify-content: flex-end;
    gap: 10px;
    flex-wrap: wrap;
    margin-top: 24px;
}

.repo-link {
    color: var(--bg-primary);
    background: var(--accent);
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    padding: 8px 16px;
    border-radius: 8px;
    border: 1px solid transparent;
    transition: all 0.25s ease;
    display: inline-block;
}

.repo-link:hover {
    background: var(--accent-hover);
    transform: translateY(-2px);
    box-shadow: 0 4px 16px rgba(123, 95, 199, 0.4);
}

/* Dark mode project images */
@media (prefers-color-scheme: dark) {
    .project-card[data-project="booklet"] .project-image {
        background-image: url('portfolio_assets/Booklet-Dark.webp');
        background-size: cover;
        background-position: center;
    }

    .project-card[data-project="booklet"] .project-image img {
        opacity: 0;
    }

    .project-card[data-project="pixellate"] .project-image {
        background-image: url('portfolio_assets/Pixellate-Dark.webp');
        background-size: cover;
        background-position: center;
    }

    .project-card[data-project="pixellate"] .project-image img {
        opacity: 0;
    }

    .project-card[data-project="pointto"] .project-image {
        background-image: url('portfolio_assets/PointTo-Dark.webp');
        background-size: cover;
        background-position: center;
    }

    .project-card[data-project="pointto"] .project-image img {
        opacity: 0;
    }

    .project-card[data-project="dominos"] .project-image {
        background-image: url('portfolio_assets/Dominos-Dark.webp');
        background-size: cover;
        background-position: center;
    }

    .project-card[data-project="dominos"] .project-image img {
        opacity: 0;
    }

    .project-card[data-project="base4096"] .project-image {
        background-image: url('portfolio_assets/base4096-Dark.webp');
        background-size: cover;
        background-position: center;
    }

    .project-card[data-project="base4096"] .project-image img {
        opacity: 0;
    }

    .project-card[data-project="photostat"] .project-image {
        background-image: url('portfolio_assets/PhotoStat-Dark.webp');
        background-size: cover;
        background-position: center;
    }

    .project-card[data-project="photostat"] .project-image img {
        opacity: 0;
    }
}

/* Tablet and smaller */
@media (max-width: 1024px) {
    .project-card {
        gap: 40px;
        padding: 40px;
    }
}

/* Mobile landscape / smaller tablets */
@media (max-width: 900px) {
    .content {
        padding: 24px 28px;
    }

    .page-header {
        margin-bottom: 32px;
    }

    .page-title {
        font-size: 3rem;
    }

    .contact-link {
        font-size: 1rem;
    }

    .project-card {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 36px;
    }

    .projects-section {
        margin-bottom: 100px;
    }

    .projects-grid {
        gap: 44px;
    }
}

/* Mobile portrait */
@media (max-width: 768px) {
    .content {
        padding: 20px 20px;
    }

    .page-header {
        margin-bottom: 28px;
    }

    .page-title {
        font-size: 2.5rem;
    }

    .contact-link {
        font-size: 0.9rem;
    }

    .projects-section {
        margin-bottom: 80px;
    }

    .projects-section h2,
    .commits-section h2 {
        font-size: 1.2rem;
        margin-bottom: 32px;
    }

    .commits-section h3 {
        font-size: 1.6rem;
        margin-bottom: 32px;
    }

    .projects-grid {
        gap: 36px;
    }

    .project-card {
        padding: 28px;
        gap: 24px;
    }

    .project-info h3 {
        font-size: 1.5rem;
    }

    .project-info p {
        font-size: 0.95rem;
    }

    .project-info {
        gap: 16px;
    }

    .commit-item {
        padding: 28px;
    }

    .commit-content h4 {
        font-size: 1.25rem;
    }

    .commit-content p {
        font-size: 0.95rem;
    }
}

/* Small mobile */
@media (max-width: 480px) {
    .content {
        padding: 16px 16px;
    }

    .page-header {
        margin-bottom: 24px;
    }

    .page-title {
        font-size: 2rem;
    }

    .contact-link {
        font-size: 0.85rem;
    }

    .nav-bar {
        margin-bottom: 24px;
    }

    .back-home,
    .contact-link {
        font-size: 0.85rem;
    }

    .projects-section {
        margin-bottom: 60px;
    }

    .projects-section h2,
    .commits-section h2 {
        font-size: 1rem;
        margin-bottom: 24px;
    }

    .commits-section {
        margin-bottom: 60px;
    }

    .commits-section h3 {
        font-size: 1.4rem;
        margin-bottom: 24px;
    }

    .projects-grid {
        gap: 28px;
    }

    .project-card {
        padding: 24px;
        gap: 20px;
        border-radius: 12px;
    }

    .project-image {
        border-radius: 8px;
    }

    .project-info h3 {
        font-size: 1.3rem;
    }

    .project-info p {
        font-size: 0.9rem;
    }

    .project-actions {
        flex-direction: column;
    }

    .project-actions .btn-primary,
    .project-actions .btn-secondary {
        width: 100%;
        text-align: center;
    }

    .commit-item {
        padding: 24px;
        border-radius: 12px;
    }

    .commit-content h4 {
        font-size: 1.1rem;
    }

    .commit-content p {
        font-size: 0.9rem;
    }

    .commit-meta {
        justify-content: flex-start;
        margin-top: 20px;
    }

    .repo-link {
        font-size: 0.85rem;
        padding: 6px 12px;
    }
}
