/* 
* Portfolio Design System 
* Theme: Interludio High-Fidelity
*/

:root {
    /* Colors */
    --bg-color: #ffffff;
    --text-primary: #050505;
    /* Deepest Black */
    --text-secondary: #666;
    --accent-blue: #0044FF;
    /* Electric Blue */
    --border-light: #e0e0e0;

    /* Typography */
    --font-serif: 'Playfair Display', serif;
    --font-sans: 'Roboto Condensed', sans-serif;

    /* Spacing */
    --container-width: 1400px;
    --spacing-xl: 10rem;
}

/* Reset */
*,
*::before,
*::after {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    scroll-behavior: smooth;
    font-size: 16px;
    height: 100%;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-sans);
    line-height: 1.5;
    overflow-x: hidden;
    min-height: 100%;
    /* Subtle Grain/Vignette */
    background-image: radial-gradient(circle at center, transparent 0%, rgba(0, 0, 0, 0.02) 100%);
    overflow-x: hidden;
}

body.no-scroll {
    overflow: hidden;
}

h1,
h2,
h3,
h4,
h5,
h6 {
    font-family: var(--font-serif);
    font-weight: 400;
    color: var(--text-primary);
}

a {
    text-decoration: none;
    color: inherit;
    transition: 0.3s;
}

img {
    max-width: 100%;
    display: block;
}

ul {
    list-style: none;
}

/* Utilities */
.container {
    max-width: var(--container-width);
    margin: 0 auto;
    padding: 0 4rem;
}

.section {
    padding: var(--spacing-xl) 0;
}

/* Loader */
.loader {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--bg-color);
    z-index: 9999;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.6s cubic-bezier(0.7, 0, 0.3, 1);
}

.loader.hidden {
    transform: translateY(-100%);
}

.loader-line {
    width: 0%;
    height: 4px;
    background: var(--accent-blue);
    transition: width 0.5s ease;
}

/* Navbar */
.navbar {
    position: fixed;
    top: 0;
    width: 100%;
    padding: 2rem 0;
    z-index: 100;
    transition: all 0.3s ease;
    mix-blend-mode: difference;
    color: white;
}

.navbar.scrolled {
    padding: 1.5rem 0;
    mix-blend-mode: normal;
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.98);
    border-bottom: 1px solid var(--border-light);
}

.nav-container {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.logo {
    font-family: var(--font-serif);
    font-size: 1.5rem;
    font-style: italic;
    font-weight: 700;
}

.nav-links {
    display: flex;
    gap: 3rem;
    align-items: center;
}

.nav-links a {
    font-family: var(--font-sans);
    text-transform: uppercase;
    font-size: 0.8rem;
    letter-spacing: 0.1em;
    font-weight: 700;
}

.nav-links a:hover {
    color: var(--accent-blue);
}

/* Mobile Menu Toggle */
.mobile-toggle {
    display: none;
}

/* Hero Section */
.hero {
    min-height: 100vh;
    display: flex;
    align-items: center;
    position: relative;
    padding-top: 60px;
    overflow: hidden;
}

.hero-grid {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    align-items: center;
    width: 100%;
    gap: 2rem;
}

.hero-content {
    position: relative;
    z-index: 2;
}

.hero-title {
    font-size: 8rem;
    line-height: 0.9;
    margin-bottom: 3rem;
    letter-spacing: -0.03em;
    color: var(--text-primary);
}

.hero-title i {
    font-family: var(--font-serif);
    font-weight: 400;
    color: var(--accent-blue);
}

.hero-subtitle {
    font-size: 1.2rem;
    line-height: 1.6;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    font-weight: 300;
}

/* Big Title Styling */
.section-title.big {
    font-size: 6rem;
    line-height: 1.1;
    margin-bottom: 2rem;
    font-family: var(--font-sans);
    font-weight: 700;
}

.section-title.big i {
    font-family: var(--font-serif);
    font-weight: 400;
    color: var(--accent-blue) !important;
    /* Force Blue */
    font-style: italic;
}


/* Interludio Button Style */
.hero-actions {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
}

.hero-actions a {
    width: auto;
    min-width: 250px;
}

.btn-primary,
.btn-secondary,
.btn-submit {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0;
    background: var(--text-primary);
    color: white;
    border: none;
    cursor: pointer;
    font-family: var(--font-sans);
    text-transform: uppercase;
    font-weight: 700;
    letter-spacing: 0.15em;
    font-size: 0.8rem;
    transition: all 0.3s ease;
    height: 3.5rem;
}

.btn-primary .btn-text,
.btn-secondary .btn-text,
.btn-submit .btn-text {
    padding: 0 2rem;
}

.btn-icon {
    width: 3.5rem;
    height: 3.5rem;
    background: var(--accent-blue);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 1.2rem;
    transition: width 0.3s ease;
}

/* Secondary Button - Outline Style */
.btn-secondary {
    background: transparent;
    border: 1px solid var(--border-light);
    border-top: none;
    /* Connect them vertically */
    color: var(--text-primary);
}

.btn-secondary .btn-icon {
    background: var(--text-primary);
    color: white;
}

/* Hover States */
.btn-primary:hover .btn-icon,
.btn-secondary:hover .btn-icon {
    width: 5rem;
}

.btn-submit:hover .btn-icon {
    width: 100%;
}

/* Full fill for submit */


/* Hero Visual (Restored Photo & Circle) */
.hero-visual {
    position: relative;
    display: flex;
    justify-content: center;
    align-items: center;
    height: auto;
    perspective: none;
}

.image-wrapper {
    position: relative;
    width: 65%;
    z-index: 2;
    overflow: hidden;
}

.hero-img {
    width: 100%;
    filter: grayscale(100%);
    transition: filter 0.5s ease, transform 0.5s ease;
}

.hero-img:hover {
    filter: grayscale(0%);
    transform: scale(1.02);
}

.tech-graphic {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: 115%;
    height: 115%;
    z-index: 1;
    pointer-events: none;
    animation: rotateGraphic 30s linear infinite;
}

@keyframes rotateGraphic {
    from {
        transform: translate(-50%, -50%) rotate(0deg);
    }

    to {
        transform: translate(-50%, -50%) rotate(360deg);
    }
}

/* Scroll */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 2rem;
    display: flex;
    align-items: center;
    gap: 1rem;
    transform: rotate(-90deg);
    transform-origin: left;
}

.scroll-indicator span {
    font-size: 0.7rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
}

.scroll-indicator .line {
    width: 50px;
    height: 1px;
    background: var(--text-primary);
}


/* Strict Alignment for Sections - Side by Side */
.section-header {
    margin-bottom: 4rem;
    /* Reduced bottom margin as title is gone/moved */
    border-top: 1px solid var(--border-light);
    padding-top: 2rem;
    display: grid;
    grid-template-columns: 280px 1fr;
    align-items: baseline;
}

/* About Split Layout */
.about-split {
    display: grid;
    grid-template-columns: 280px 1fr;
    /* Matches the section header grid */
    gap: 0;
    /* Gap handled by grid columns/padding if needed */
    align-items: flex-start;
    margin-bottom: 4rem;
}

.about-headline {
    font-size: 3.5rem;
    /* Slightly smaller than hero title */
    line-height: 1.1;
    font-family: var(--font-serif);
    padding-right: 2rem;
    grid-column: 1;
    /* Left Column */
    /* Wait, user wants them PARALLEL.
       If I put headline in col 1 and text in col 2, they will be side by side.
       But the 'section-header' already takes vertical space.
       Actually, stripping h2 from section-header means section-header is now just the Label '01 / ABOUT'.
       So 'about-split' comes BELOW, but we want the Headline to be on the left?
       User said: "line 'bridging the gap....' comes parallel to the paragraph below"
       So Headline (Left) | Paragraphs (Right).
    */
}

.about-headline i {
    color: var(--accent-blue);
    font-size: 1.25em;
    /* Bigger than surrounding text */
    font-weight: 400;
    /* Keep elegant weight/style */
}

.about-right {
    grid-column: 2;
    /* Right Column */
}

.about-right p {
    margin-bottom: 2rem;
    color: var(--text-secondary);
    font-size: 1.1rem;
    line-height: 1.6;
}

.about-right .lead {
    font-size: 1.5rem;
    color: var(--text-primary);
    font-weight: 400;
}

/* Tech Buttons (Chips) */
.tech-stack-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 0.8rem;
}

.tech-stack-preview span {
    display: inline-block;
    padding: 0.8rem 1.5rem;
    background: transparent;
    border: 1px solid var(--border-light);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    transition: all 0.3s ease;
    cursor: default;
}

.tech-stack-preview span:hover {
    background: var(--accent-blue);
    color: white;
    border-color: var(--accent-blue);
    transform: translateY(-2px);
}


/* Background Shapes */
.bg-shape {
    position: absolute;
    z-index: -1;
    background: rgba(0, 68, 255, 0.03);
    /* Very subtle blue */
    pointer-events: none;
}

.shape-1 {
    top: 20%;
    left: 0;
    width: 40vw;
    height: 60vh;
}

.shape-2 {
    top: 60%;
    right: 0;
    width: 30vw;
    height: 40vh;
    background: rgba(0, 0, 0, 0.02);
}

.section-label {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent-blue);
    font-weight: 700;
}

.section-title {
    font-size: 5rem;
    line-height: 0.9;
    margin: 0;
    font-style: italic;
}

/* Projects */
.projects-grid {
    display: flex;
    flex-direction: column;
    gap: 0;
    margin-top: 4rem;
    border-left: 1px solid var(--border-light);
    margin-left: 200px;
}

.project-card {
    display: grid;
    grid-template-columns: 2fr 1fr;
    gap: 4rem;
    align-items: center;
    padding: 6rem 4rem;
    border-bottom: 1px solid var(--border-light);
    transition: background 0.3s;
}

.project-card:hover {
    background: #f9f9f9;
}

.project-title {
    font-size: 3rem;
    margin-bottom: 1rem;
    line-height: 1;
}

.project-cat {
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.2em;
    color: var(--accent-blue);
    margin-bottom: 1.5rem;
    display: block;
}

.project-desc {
    color: var(--text-secondary);
    max-width: 400px;
    margin-bottom: 2rem;
}

.project-link {
    display: inline-flex;
    align-items: center;
    gap: 1rem;
    font-weight: 700;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-size: 0.8rem;
}

.project-link span {
    width: 2rem;
    height: 1px;
    background: var(--text-primary);
    transition: width 0.3s;
}

.project-link:hover span {
    width: 3rem;
    background: var(--accent-blue);
}

.project-visual {
    height: 300px;
    background: #eee;
    overflow: hidden;
    position: relative;
}

.project-visual img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 0.6s;
}

.project-card:hover .project-visual img {
    transform: scale(1.05);
}


/* Contact */
.contact-grid {
    margin-left: 200px;
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6rem;
    padding-top: 4rem;
}

.email-link {
    font-size: 3rem;
    font-family: var(--font-serif);
    /* Serif font */
    font-style: italic;
    display: block;
    margin-bottom: 3rem;
    line-height: 1.2;
    color: var(--text-primary);
}

.contact-info p {
    font-size: 1.2rem;
    color: var(--text-secondary);
    margin-bottom: 3rem;
    margin-top: 2rem;
    /* Added gap to prevent overlap */
    line-height: 1.6;
}

/* CodeProb Iframe Styling */
.project-card.featured {
    border-radius: 4px;
    /* Slight round */
    box-shadow: 0 20px 40px rgba(0, 0, 0, 0.05);
    border: 1px solid var(--border-light);
    overflow: hidden;
}

/* Social Buttons */
.social-links {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
    margin-bottom: 3rem;
}

.social-links a {
    display: inline-block;
    padding: 1rem 2rem;
    background: transparent;
    border: 1px solid var(--border-light);
    color: var(--text-primary);
    font-family: var(--font-sans);
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    font-weight: 700;
    transition: all 0.3s ease;
}

.social-links a:hover {
    background: var(--text-primary);
    color: white;
    border-color: var(--text-primary);
    transform: translateY(-2px);
}

.form-group input,
.form-group textarea {
    width: 100%;
    background: transparent;
    border: none;
    border-bottom: 1px solid var(--border-light);
    padding: 1rem 0;
    font-family: var(--font-sans);
    font-size: 1rem;
}

.form-group input:focus,
.form-group textarea:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.form-group label {
    display: block;
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-secondary);
    margin-top: 1rem;
}

.btn-submit {
    width: 100%;
    margin-top: 2rem;
    background: var(--accent-blue);
}

.btn-submit .btn-icon {
    background: var(--text-primary);
}

/* Timeline / Experience */
.timeline {
    border-left: 1px solid var(--border-light);
    margin-left: 280px;
    padding-left: 3rem;
    position: relative;
    padding-top: 2rem;
    padding-bottom: 2rem;
}

.timeline-item {
    position: relative;
    margin-bottom: 4rem;
}

.timeline-item:last-child {
    margin-bottom: 0;
}

.timeline-item::before {
    content: '';
    position: absolute;
    left: calc(-3rem - 8.5px);
    /* Pin to border center. 3rem padding + half width */
    top: 8px;
    width: 15px;
    height: 15px;
    background: var(--accent-blue);
    border: 4px solid var(--bg-color);
    border-radius: 50%;
}

.year {
    display: block;
    font-size: 0.8rem;
    font-weight: 700;
    color: var(--accent-blue);
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.timeline-content h3 {
    font-size: 2rem;
    margin-bottom: 0.5rem;
}

.timeline-content p {
    color: var(--text-secondary);
    max-width: 600px;
}

/* Footer */
.footer {
    padding: 3rem 0;
    border-top: 1px solid var(--border-light);
    margin-top: var(--spacing-xl);
}

.footer-content {
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.copyright {
    color: var(--text-secondary);
    font-size: 0.9rem;
}

.back-to-top {
    color: var(--text-secondary);
    font-size: 0.9rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    transition: color 0.3s;
}

.back-to-top:hover {
    color: var(--accent-blue);
}

/* Responsive */
@media (max-width: 1024px) {
    .hero-title {
        font-size: 5rem;
    }

    .section-title {
        font-size: 4rem;
    }

    .section-title.big {
        font-size: 4.5rem;
    }

    .container {
        padding: 0 2rem;
    }

    .projects-grid,
    .contact-grid {
        margin-left: 0;
    }

    .section-header {
        grid-template-columns: 1fr;
        gap: 1rem;
    }

    .about-split {
        grid-template-columns: 1fr;
        gap: 2rem;
    }

    .about-headline {
        margin-bottom: 2rem;
        font-size: 3rem;
        padding-right: 0;
    }

    .timeline {
        margin-left: 0;
        padding-left: 2rem;
    }

    .timeline-item::before {
        left: calc(-2rem - 7.5px);
    }
}

@media (max-width: 768px) {
    :root {
        --spacing-xl: 5rem;
    }

    .section {
        padding: 4rem 0;
    }

    .container {
        padding: 0 1.5rem;
    }

    .navbar {
        mix-blend-mode: normal;
        color: var(--text-primary);
        background: white;
        padding: 1rem 0;
    }

    .nav-container {
        padding: 0 1.5rem;
    }

    .logo {
        font-size: 1.25rem;
    }

    .hero {
        min-height: auto;
        padding-top: 80px;
        padding-bottom: 3rem;
    }

    .hero-grid {
        grid-template-columns: 1fr;
        gap: 2rem;
        padding-top: 1rem;
    }

    .hero-content {
        order: 2;
    }

    .hero-title {
        font-size: 2.5rem;
        line-height: 1.1;
        margin-bottom: 1.5rem;
    }

    .hero-subtitle {
        font-size: 1rem;
        line-height: 1.5;
        margin-bottom: 2rem;
    }

    .hero-visual {
        order: 1;
        height: 300px;
        margin-bottom: 1rem;
    }

    .image-wrapper {
        width: 70%;
        max-width: 280px;
    }

    .tech-graphic {
        width: 100%;
        height: 100%;
    }

    /* Scale down 3D graphics on mobile */
    .graphic-3d-wrapper {
        transform: scale(0.7);
    }

    .sphere-group {
        transform: scale(0.8);
    }

    .hero-actions {
        gap: 0.5rem;
    }

    .hero-actions a {
        min-width: 100%;
        width: 100%;
    }

    .btn-primary,
    .btn-secondary {
        height: 3rem;
        font-size: 0.75rem;
    }

    .btn-primary .btn-text,
    .btn-secondary .btn-text {
        padding: 0 1.5rem;
    }

    .btn-icon {
        width: 3rem;
        height: 3rem;
        font-size: 1rem;
    }

    .section-header {
        margin-bottom: 2.5rem;
        padding-top: 1.5rem;
    }

    .section-label {
        font-size: 0.7rem;
    }

    .section-title {
        font-size: 2.5rem;
        line-height: 1.1;
    }

    .section-title.big {
        font-size: 2.5rem;
        line-height: 1.2;
        margin-bottom: 1.5rem;
    }

    .about-split {
        gap: 2rem;
        margin-bottom: 2rem;
    }

    .about-headline {
        font-size: 2rem;
        line-height: 1.2;
        margin-bottom: 1.5rem;
    }

    .about-right p {
        font-size: 1rem;
        margin-bottom: 1.5rem;
    }

    .about-right .lead {
        font-size: 1.2rem;
        margin-bottom: 1.5rem;
    }

    .about-right h4 {
        font-size: 1rem;
        margin-top: 2rem;
        margin-bottom: 1rem;
    }

    .tech-stack-preview {
        gap: 0.6rem;
    }

    .tech-stack-preview span {
        padding: 0.6rem 1rem;
        font-size: 0.7rem;
    }

    .projects-grid {
        border-left: none;
        margin-left: 0;
        margin-top: 2rem;
    }

    .project-card {
        grid-template-columns: 1fr;
        padding: 2rem 0;
        gap: 1.5rem;
        border-bottom: 1px solid var(--border-light);
    }

    .project-card.featured {
        min-height: 400px;
    }

    .project-card.featured iframe {
        min-height: 400px;
    }

    .project-visual {
        height: 200px;
        order: 1;
    }

    .card-content {
        order: 2;
    }

    .project-title {
        font-size: 2rem;
        margin-bottom: 0.75rem;
    }

    .project-cat {
        font-size: 0.7rem;
        margin-bottom: 1rem;
    }

    .project-desc {
        font-size: 0.95rem;
        margin-bottom: 1.5rem;
        max-width: 100%;
    }

    .project-link {
        font-size: 0.75rem;
    }

    .timeline {
        margin-left: 0;
        padding-left: 1.5rem;
        padding-top: 1rem;
        padding-bottom: 1rem;
    }

    .timeline-item {
        margin-bottom: 3rem;
    }

    .timeline-item::before {
        left: calc(-1.5rem - 7.5px);
    }

    .year {
        font-size: 0.75rem;
        margin-bottom: 0.5rem;
    }

    .timeline-content h3 {
        font-size: 1.5rem;
        margin-bottom: 0.5rem;
    }

    .timeline-content p {
        font-size: 0.95rem;
        max-width: 100%;
    }

    .contact-grid {
        grid-template-columns: 1fr;
        gap: 2.5rem;
        margin-left: 0;
        padding-top: 2rem;
    }

    .contact-info {
        order: 1;
    }

    .contact-form {
        order: 2;
    }

    .email-link {
        font-size: 1.5rem;
        margin-bottom: 2rem;
        word-break: break-word;
    }

    .contact-info p {
        font-size: 1rem;
        margin-bottom: 2rem;
        margin-top: 1rem;
    }

    .social-links {
        gap: 0.75rem;
        margin-bottom: 2rem;
    }

    .social-links a {
        padding: 0.75rem 1.5rem;
        font-size: 0.75rem;
    }

    .form-group {
        margin-bottom: 1.5rem;
    }

    .form-group input,
    .form-group textarea {
        font-size: 0.95rem;
        padding: 0.75rem 0;
    }

    .form-group label {
        font-size: 0.7rem;
        margin-top: 0.75rem;
    }

    .btn-submit {
        height: 3rem;
        margin-top: 1.5rem;
        font-size: 0.75rem;
    }

    .footer {
        padding: 2rem 0;
    }

    .footer-content {
        flex-direction: column;
        gap: 1rem;
        text-align: center;
        font-size: 0.85rem;
    }

    .mobile-toggle {
        display: block;
        width: 30px;
        height: 20px;
        position: relative;
        z-index: 101;
        background: none;
        border: none;
        cursor: pointer;
    }

    .mobile-toggle span {
        display: block;
        width: 100%;
        height: 2px;
        background: var(--text-primary);
        margin-bottom: 6px;
        transition: 0.3s;
    }

    .mobile-toggle span:last-child {
        margin-bottom: 0;
    }

    .mobile-toggle.active span:nth-child(1) {
        transform: rotate(45deg) translate(5px, 5px);
    }

    .mobile-toggle.active span:nth-child(2) {
        transform: rotate(-45deg) translate(5px, -5px);
    }

    .nav-links {
        position: fixed;
        top: 0;
        right: 0;
        width: 100%;
        height: 100vh;
        background: white;
        flex-direction: column;
        justify-content: center;
        align-items: center;
        transform: translateX(100%);
        transition: 0.4s;
        gap: 2rem;
        padding: 2rem;
    }

    .nav-links.active {
        transform: translateX(0);
    }

    .nav-links li {
        width: 100%;
        text-align: center;
    }

    .nav-links a {
        font-size: 1.25rem;
        color: var(--text-primary);
        display: block;
        padding: 0.5rem 0;
    }

    .nav-links .cta-item {
        margin-top: 1rem;
    }

    .btn-nav {
        width: 100%;
        display: block;
        text-align: center;
        padding: 1rem;
        background: var(--text-primary);
        color: white;
        border-radius: 0;
    }

    .scroll-indicator {
        display: none;
    }

    .bg-shape {
        display: none;
    }
}

@media (max-width: 480px) {
    :root {
        --spacing-xl: 3rem;
    }

    .container {
        padding: 0 1rem;
    }

    .nav-container {
        padding: 0 1rem;
    }

    .section {
        padding: 3rem 0;
    }

    .hero {
        min-height: auto;
        padding-top: 80px;
        padding-bottom: 2rem;
    }

    .hero-title {
        font-size: 2rem;
        line-height: 1.1;
        margin-bottom: 1rem;
    }

    .hero-subtitle {
        font-size: 0.9rem;
        line-height: 1.5;
        margin-bottom: 1.5rem;
    }

    .hero-visual {
        height: 250px;
        margin-bottom: 1rem;
    }

    .image-wrapper {
        width: 60%;
        max-width: 200px;
    }

    .section-title {
        font-size: 2rem;
        line-height: 1.1;
    }

    .section-title.big {
        font-size: 2rem;
        line-height: 1.2;
    }

    .about-headline {
        font-size: 1.75rem;
        line-height: 1.2;
    }

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

    .email-link {
        font-size: 1.25rem;
        word-break: break-word;
        line-height: 1.3;
    }

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

    .footer-grid {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
        text-align: left !important;
    }

    .footer-grid > div:last-child,
    .footer-social-section {
        text-align: left !important;
    }

    .footer-socials {
        justify-content: flex-start !important;
    }

    .footer-links {
        flex-direction: column !important;
        gap: 1rem !important;
    }
}

/* Additional mobile fixes for specific pages */
@media (max-width: 768px) {
    /* About page specific */
    #about-hero .hero-title {
        font-size: 2.5rem !important;
        margin-top: 1rem !important;
    }

    .bio-content {
        max-width: 100% !important;
        margin-top: 2rem !important;
    }

    .bio-content .lead {
        font-size: 1.3rem !important;
        line-height: 1.4 !important;
    }

    .bio-content p {
        font-size: 1rem !important;
        line-height: 1.6 !important;
        margin-bottom: 1.5rem !important;
    }

    /* Contact page specific */
    #contact-hero .hero-title {
        font-size: 2.5rem !important;
        margin-top: 1rem !important;
    }

    #contact-hero .hero-subtitle {
        font-size: 1rem !important;
        max-width: 100% !important;
    }

    /* Contact options grid */
    .section > .container > div[style*="grid-template-columns"] {
        grid-template-columns: 1fr !important;
        gap: 2rem !important;
    }

    .calendly-inline-widget,
    .calendly-inline-widget iframe {
        min-width: 100% !important;
        height: 600px !important;
    }

    /* Contact form iframe */
    iframe[title="Contact form"] {
        height: 600px !important;
    }

    /* Work page specific */
    #work-hero .hero-title {
        font-size: 2.5rem !important;
        margin-top: 1rem !important;
    }

    #work-hero .hero-subtitle {
        font-size: 1rem !important;
        max-width: 100% !important;
    }

    /* Section headers */
    .section-header h2.section-title {
        font-size: 2.5rem !important;
    }

    /* Project cards padding */
    .project-card[style*="padding"] {
        padding: 2rem 0 !important;
    }

    /* Footer links */
    .footer-grid ul,
    .footer-links {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    .footer-social-section {
        text-align: left !important;
    }

    .footer-socials {
        justify-content: flex-start !important;
    }

    /* Quick contact info section */
    div[style*="linear-gradient"] {
        padding: 2rem 1.5rem !important;
    }

    div[style*="linear-gradient"] h3 {
        font-size: 1.75rem !important;
    }

    div[style*="linear-gradient"] > div {
        flex-direction: column !important;
        gap: 1rem !important;
    }

    /* n8n community card */
    .project-card[style*="linear-gradient"] {
        padding: 2rem 1.5rem !important;
    }

    .project-card[style*="linear-gradient"] h3 {
        font-size: 2rem !important;
    }

    .project-card[style*="linear-gradient"] p {
        font-size: 1rem !important;
    }
}

/* Fix for hero sections with inline padding-top */
@media (max-width: 768px) {
    .hero[style*="padding-top: 12rem"] {
        padding-top: 100px !important;
    }
}

/* Improve mobile menu */
@media (max-width: 768px) {
    .nav-links {
        padding: 4rem 2rem;
    }

    .nav-links a {
        font-size: 1.5rem;
        padding: 1rem 0;
    }
}

/* Fix iframe responsiveness */
@media (max-width: 768px) {
    iframe {
        max-width: 100%;
    }

    .project-card.featured iframe,
    .codeprob-iframe {
        min-height: 400px !important;
        height: 400px !important;
    }

    .contact-form-iframe {
        height: 600px !important;
    }
}

@media (max-width: 480px) {
    .contact-form-iframe {
        height: 500px !important;
    }

    .project-card.featured iframe {
        min-height: 350px !important;
        height: 350px !important;
    }

    /* Further scale down graphics on very small screens */
    .graphic-3d-wrapper {
        transform: scale(0.6);
    }
}

/* Better spacing for mobile */
@media (max-width: 768px) {
    .section-header {
        margin-bottom: 2rem;
        padding-top: 1rem;
    }

    .about-split {
        margin-bottom: 2rem;
    }

    .projects-grid {
        margin-top: 1.5rem;
    }

    /* Improve text readability on mobile */
    p, .project-desc {
        line-height: 1.6;
    }

    /* Better button spacing */
    .hero-actions {
        width: 100%;
    }

    /* Fix overflow issues */
    .container {
        overflow-x: hidden;
    }

    /* Improve section spacing */
    .section {
        overflow-x: hidden;
    }

    /* Better image handling */
    img {
        max-width: 100%;
        height: auto;
    }

    /* Fix any horizontal scroll */
    body {
        overflow-x: hidden;
    }
}

/* Additional fixes for very small screens */
@media (max-width: 360px) {
    .hero-title {
        font-size: 1.75rem !important;
    }

    .section-title {
        font-size: 1.75rem !important;
    }

    .about-headline {
        font-size: 1.5rem !important;
    }

    .project-title {
        font-size: 1.5rem !important;
    }

    .email-link {
        font-size: 1.1rem !important;
    }
}