/* 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);
}

html {
    scroll-behavior: smooth;
    scroll-padding-top: 32px;
}

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;
}

.nav-bar .back-nav {
    margin-bottom: 0;
}

.nav-links {
    display: flex;
    align-items: center;
    gap: 20px;
}

.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;
}

.page-intro {
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.7;
    margin: 20px 0 0 0;
    font-family: Georgia, serif;
}

/* Featured project card — dark hero strip above the rest of the portfolio */
.featured-section {
    margin: 40px 0 80px;
}

/* Wrapper catches hover so the inner card can transform without escaping the cursor */
.featured-card-wrapper {
    display: block;
}

.featured-card {
    position: relative;
    display: grid;
    grid-template-columns: 0.85fr 1fr;
    gap: 48px;
    align-items: center;
    padding: 48px;
    background:
        radial-gradient(900px 500px at 90% 10%, rgba(52, 211, 153, 0.18), transparent 60%),
        radial-gradient(600px 400px at 0% 100%, rgba(56, 189, 248, 0.10), transparent 70%),
        #0A1020;
    color: #F1F5F9;
    border: 1px solid #1F2937;
    border-radius: 20px;
    overflow: hidden;
    text-decoration: none;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1),
                border-color 0.3s ease,
                box-shadow 0.3s ease;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.18);
}

.featured-card::before {
    /* Subtle grid texture in the background */
    content: '';
    position: absolute;
    inset: 0;
    background-image:
        linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
        linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
    background-size: 48px 48px;
    mask-image: radial-gradient(ellipse 60% 70% at 80% 30%, black 30%, transparent 80%);
    pointer-events: none;
}

.featured-card-wrapper:hover .featured-card {
    transform: translateY(-3px);
    border-color: rgba(52, 211, 153, 0.4);
    box-shadow: 0 28px 56px rgba(0, 0, 0, 0.32);
}

.featured-card-device {
    position: relative;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 360px;
}

.featured-card-device::before {
    /* Glow halo behind the watch */
    content: '';
    position: absolute;
    inset: 8% 12%;
    background: radial-gradient(ellipse at center, rgba(52, 211, 153, 0.28), transparent 70%);
    filter: blur(40px);
    z-index: 0;
}

.featured-watch {
    position: relative;
    width: 240px;
    aspect-ratio: 280 / 440;
    z-index: 1;
    filter: drop-shadow(0 28px 40px rgba(0, 0, 0, 0.55));
    transform: perspective(1200px) rotateY(-6deg) rotateX(3deg);
    transition: transform 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.featured-card-wrapper:hover .featured-watch {
    transform: perspective(1200px) rotateY(-3deg) rotateX(1deg) translateY(-4px);
}

.featured-watch-screen {
    /* Measured against the 1120x1760 webp: screen area is 834w x 994h, starts 384px from top */
    position: absolute;
    top: 21.818%;     /* 384 / 1760 */
    left: 12.768%;    /* (1120 - 834) / 2 / 1120 */
    width: 74.464%;   /* 834 / 1120 */
    height: 56.477%;  /* 994 / 1760 */
    border-radius: 28px;
    overflow: hidden;
    background: #000;
}

.featured-watch-screen video {
    display: block;
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    /* Width matches the screen container; height stays proportional (no stretching) */
    width: 100%;
    height: auto;
    transition: opacity 0.5s ease-in-out;
}

.featured-watch-frame {
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    user-select: none;
    -webkit-user-drag: none;
    z-index: 2;
}


/* watchOS-style "app loading" spinner shown while the video buffers.
   Transparent background so the video element's <poster> (first frame)
   shows through — user gets meaningful content immediately instead of
   black-screen-with-spinner. */
.watch-loader {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    background: transparent;
    z-index: 1; /* below the frame (z-index 2) so the bezels clip it */
    pointer-events: none;
    transition: opacity 0.35s ease;
}

.watch-loader.hidden {
    opacity: 0;
}

/* watchOS-style 6-dot throbber: brightness rotates around the circle */
.watch-loader-spinner {
    position: relative;
    width: 36px;
    height: 36px;
}

.watch-loader-spinner > div {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 8px;
    height: 8px;
    margin: -4px 0 0 -4px;
    border-radius: 50%;
    background: #FFFFFF;
    animation: watchSpinnerFade 0.9s linear infinite;
}

.watch-loader-spinner > div:nth-child(1) { transform: translate(0, -12px);         animation-delay: 0s; }
.watch-loader-spinner > div:nth-child(2) { transform: translate(10.392px, -6px);   animation-delay: -0.75s; }
.watch-loader-spinner > div:nth-child(3) { transform: translate(10.392px, 6px);    animation-delay: -0.6s; }
.watch-loader-spinner > div:nth-child(4) { transform: translate(0, 12px);          animation-delay: -0.45s; }
.watch-loader-spinner > div:nth-child(5) { transform: translate(-10.392px, 6px);   animation-delay: -0.3s; }
.watch-loader-spinner > div:nth-child(6) { transform: translate(-10.392px, -6px);  animation-delay: -0.15s; }

@keyframes watchSpinnerFade {
    0% { opacity: 1; }
    100% { opacity: 0.22; }
}

.featured-card-info {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    gap: 18px;
    min-width: 0;
}

.featured-card-eyebrow {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    padding: 6px 14px;
    background: rgba(52, 211, 153, 0.14);
    border: 1px solid rgba(52, 211, 153, 0.4);
    border-radius: 999px;
    color: #6EE7B7;
    font-family: 'Merriweather', serif;
    font-size: 0.75rem;
    font-weight: 500;
    letter-spacing: 0.04em;
    width: fit-content;
    text-transform: uppercase;
}

.featured-card-status-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #34D399;
    box-shadow: 0 0 0 4px rgba(52, 211, 153, 0.18);
}

.featured-card-title {
    margin: 0;
    font-size: clamp(2rem, 3.5vw, 2.75rem);
    font-family: Georgia, serif;
    font-weight: 400;
    letter-spacing: -0.025em;
    line-height: 1.1;
    color: #F8FAFC;
}

.featured-card-desc {
    margin: 0;
    font-size: 1.05rem;
    line-height: 1.6;
    color: #CBD5E1;
    max-width: 48ch;
}

.featured-card-cta {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin-top: 6px;
    padding: 10px 18px;
    background: #34D399;
    color: #052E1E;
    border-radius: 10px;
    font-family: 'Merriweather', serif;
    font-size: 0.95rem;
    font-weight: 600;
    letter-spacing: 0.01em;
    width: fit-content;
    transition: background 0.2s ease, transform 0.2s ease;
}

.featured-card-cta-arrow {
    display: inline-block;
    transition: transform 0.25s ease;
}

.featured-card-wrapper:hover .featured-card-cta {
    background: #6EE7B7;
}

.featured-card-wrapper:hover .featured-card-cta-arrow {
    transform: translateX(4px);
}

/* Featured card responsive */
@media (max-width: 900px) {
    .featured-card {
        grid-template-columns: 1fr;
        gap: 32px;
        padding: 36px;
    }
    .featured-card-device {
        min-height: 320px;
    }
    .featured-watch {
        width: 220px;
        transform: none;
    }
    .featured-card-wrapper:hover .featured-watch {
        transform: translateY(-4px);
    }
}

@media (max-width: 600px) {
    .featured-section {
        margin: 28px 0 56px;
    }
    .featured-card {
        padding: 28px;
        gap: 24px;
    }
    .featured-watch {
        width: 180px;
    }
    .featured-card-device {
        min-height: 260px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .featured-card,
    .featured-watch,
    .featured-card-cta,
    .featured-card-cta-arrow,
    .featured-card-wrapper:hover .featured-watch {
        transform: none !important;
        transition: none !important;
    }
    .watch-loader-spinner > div { animation: none; opacity: 0.45; }
}

.section-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 24px;
}

.section-chip {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: var(--bg-secondary);
    border: 1px solid var(--border);
    border-radius: 999px;
    font-size: 0.85rem;
    font-weight: 500;
    color: var(--text-secondary);
    text-decoration: none;
    transition: all 0.2s ease;
    font-family: 'Merriweather', serif;
}

.section-chip-wrapper {
    display: inline-flex;
}

.section-chip-wrapper:hover .section-chip {
    color: var(--accent);
    border-color: var(--accent);
    transform: translateY(-1px);
}

.section-return {
    visibility: hidden;
    color: var(--text-tertiary);
    text-decoration: none;
    font-size: 0.9em;
    transition: color 0.2s ease;
}

section:target .section-return {
    visibility: visible;
}

.section-return:hover {
    color: var(--accent);
}

.page-intro .availability {
    font-style: italic;
}

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

.projects-section h2 {
    font-size: 1.8rem;
    color: var(--text-tertiary);
    margin-bottom: 48px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-family: 'Merriweather', serif;
    text-align: left;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

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

/* Wrapper stays still, receives hover */
.project-card-wrapper {
    margin-left: -4px;
    margin-right: -4px;
}

.project-card {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: 40px;
    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;
    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-wrapper:hover .project-card {
    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;
}

.platform-badges {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
}

.platform-badge {
    display: inline-flex;
    align-items: center;
    padding: 6px 14px;
    background: var(--bg-primary);
    border: 1px solid var(--border);
    border-radius: 20px;
    font-size: 0.8rem;
    font-weight: 500;
    color: var(--text-secondary);
    transition: all 0.2s ease;
}

.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.8rem;
    color: var(--text-tertiary);
    margin-bottom: 16px;
    font-weight: 500;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    font-family: 'Merriweather', serif;
    text-align: left;
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
}

.commits-section > h3,
.projects-section > h3 {
    font-size: 1.5rem;
    color: var(--accent);
    margin-bottom: 32px;
    margin-top: 72px;
    font-family: Georgia, serif;
    font-weight: 500;
    letter-spacing: 0;
}

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

.commits-section > h3:has(+ .project-description),
.projects-section > h3:has(+ .project-description) {
    margin-bottom: 14px;
}

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

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

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

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

/* Wrapper stays still, receives hover */
.commit-item-wrapper {
    margin-left: -4px;
    margin-right: -4px;
}

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

.commit-item-wrapper:hover .commit-item {
    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('assets/portfolio/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('assets/portfolio/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('assets/portfolio/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('assets/portfolio/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('assets/portfolio/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('assets/portfolio/PhotoStat-Dark.webp');
        background-size: cover;
        background-position: center;
    }

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

    .project-card[data-project="geojson-drawer"] .project-image {
        background-image: url('assets/portfolio/GeoJSON-Dark.webp');
        background-size: cover;
        background-position: center;
    }

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

    .project-card[data-project="sentry-rewind"] .project-image {
        background-image: url('assets/portfolio/SentryRewind-Dark.webp');
        background-size: cover;
        background-position: center;
    }

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

    .project-card[data-project="trmnl-ferries"] .project-image {
        background-image: url('assets/portfolio/TRMNL-Washington-Ferries-Dark.webp');
        background-size: cover;
        background-position: center;
    }

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

    .project-card[data-project="trmnl-window-season"] .project-image {
        background-image: url('assets/portfolio/TRMNL-Window-Season-Dark.webp');
        background-size: cover;
        background-position: center;
    }

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

/* Larger screens — let project cards breathe a bit */
@media (min-width: 1400px) {
    .content {
        max-width: 1180px;
    }
}

@media (min-width: 1700px) {
    .content {
        max-width: 1300px;
    }
}

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

/* GeoJSON drawer requires iPad landscape or wider */
@media (max-width: 1023px) {
    .project-card[data-project="geojson-drawer"] .project-actions .btn-primary {
        pointer-events: none;
        opacity: 0.5;
        cursor: not-allowed;
        font-size: 0;
    }

    .project-card[data-project="geojson-drawer"] .project-actions .btn-primary::before {
        content: "Open on a larger screen";
        font-size: 0.95rem;
    }
}

/* 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.45rem;
        margin-bottom: 32px;
    }

    .commits-section > h3,
    .projects-section > h3 {
        font-size: 1.2rem;
        margin-bottom: 28px;
    }

    .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;
    }

    .commit-content ul {
        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;
    }

    .nav-links {
        gap: 14px;
    }

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

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

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

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

    .commits-section > h3,
    .projects-section > h3 {
        font-size: 1rem;
        margin-bottom: 20px;
    }

    .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-content ul {
        font-size: 0.9rem;
    }

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

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

/* Phone landscape (short-and-wide): restore side-by-side, compact everything */
@media (orientation: landscape) and (max-height: 500px) {
    .content {
        padding: 16px 20px;
    }

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

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

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

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

    .projects-grid {
        gap: 28px;
    }

    .project-card {
        grid-template-columns: 1.2fr 1fr;
        gap: 24px;
        padding: 20px;
        border-radius: 12px;
    }

    .project-image {
        aspect-ratio: 4/3;
        border-radius: 8px;
    }

    .project-info {
        gap: 12px;
    }

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

    .project-info p {
        font-size: 0.85rem;
        line-height: 1.5;
    }

    .platform-badge {
        font-size: 0.7rem;
        padding: 4px 10px;
    }

    .project-meta .first-worked {
        font-size: 0.8rem;
    }

    .btn-primary, .btn-secondary {
        padding: 8px 16px;
        font-size: 0.85rem;
    }

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

    .project-actions .btn-primary,
    .project-actions .btn-secondary {
        width: auto;
    }
}
