* {
    box-sizing: border-box; /* Prevent overflow from padding/borders */
}

html, body {
    overflow-x: hidden; /* Avoid horizontal clipping */
}

body {
    font-family: 'Inter', sans-serif; /* Use Inter font */
    line-height: 1.5; /* Slightly tighter line height for better spacing */
    background-color: #ffffff; /* Pure white background */
    color: #666666; /* Lighter grey text for softer look */
}

/* Top Navigation */
.top-nav {
    margin-bottom: 30px;
    padding-top: 10px;
}

/* Portfolio Button - Reference Style */
.portfolio-button {
    display: inline-block;
    background-color: #2a2a2a; /* Dark gray background like reference */
    color: #ffffff; /* White text */
    text-decoration: none;
    font-size: 0.9em;
    font-weight: 600;
    letter-spacing: 0.1em; /* Spacing for uppercase look */
    text-transform: uppercase; /* Uppercase text */
    padding: 12px 24px; /* Button padding */
    border-radius: 0; /* Sharp corners like reference */
    transition: all 0.2s ease;
    box-shadow: 2px 2px 0 rgba(0, 0, 0, 0.2); /* Subtle shadow like reference */
    border: none;
}

.portfolio-button:hover {
    background-color: #1a1a1a; /* Darker on hover */
    transform: translateY(-1px);
    box-shadow: 3px 3px 0 rgba(0, 0, 0, 0.3); /* Enhanced shadow on hover */
}

/* Small arrow indicator */
.button-arrow {
    display: inline-block;
    color: rgba(255, 255, 255, 0.6); /* Light, semi-transparent white */
    font-size: 0.85em; /* Smaller than text */
    margin-left: 6px; /* Small spacing from text */
    transition: all 0.2s ease;
    font-weight: 400; /* Lighter weight */
}

.portfolio-button:hover .button-arrow {
    color: rgba(255, 255, 255, 0.9); /* More visible on hover */
    transform: translateX(2px); /* Slight movement on hover */
}

.container {
    width: 90%; /* Wider percentage for more space */
    max-width: 600px; /* Better width for readability */
    margin: 10px; /* Remove auto margin for left alignment */
    padding-top: 35px; /* Added 30px from the top */
    padding-left: 30px; /* Increased left margin to 50px */
    padding-right: 20px; /* Space from right */
    position: relative; /* For positioning the case studies link */
}

/* Removed case studies button - now in navigation */

h1 {
    font-size: 2.9em; /* Reduced font size by 40% */
    font-weight: bold; /* Bold for the heading */
    color: #000000; /* Black heading */
    margin-bottom: 18px; /* Reduced bottom margin for tighter spacing */
    margin-top: 0; /* Reset margin-top to let container's padding take effect */
    text-align: left; /* Ensure text is left-aligned */
    text-transform: lowercase; /* Convert to small caps */
}

p {
    font-size: 1.2em; /* Reduced font size by 40% */
    color: #666666; /* Lighter grey for softer look */
    margin-bottom: 25px; /* Reduced bottom margin for tighter spacing */
    text-align: left; /* Ensure text is left-aligned */
    font-weight: 400; /* Normal weight */
    letter-spacing: -0.029em; /* Slightly relaxed letter spacing */
    overflow-wrap: anywhere; /* Wrap very long words/links */
    text-transform: lowercase; /* Convert to small caps */
    opacity: 0.9; /* Slightly reduced opacity */
}

h2 {
    font-size: 1.8em; /* Reduced font size for subheadings */
    margin-top: 20px; /* Reduced top margin for h2 */
    margin-bottom: 30px; /* Reduced bottom margin for h2 */
    color: #000000; /* Black bold for headings */
    font-weight: 600; /* Semibold for headings */
    text-align: left; /* Ensure text is left-aligned */
    text-transform: lowercase; /* Convert to small caps */
    position: relative; /* For line positioning */
    padding-top: 15px; /* Space for line */
}

h2::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: rgba(0, 0, 0, 0.15); /* Light, less opacity line */
}

h3 {
    font-size: 1.4em; /* Smaller than h2 */
    margin-top: 15px; /* Reduced top margin */
    margin-bottom: 10px; /* Reduced bottom margin */
    color: #000000; /* Black for headings */
    font-weight: 600; /* Semibold for headings */
    text-align: left; /* Ensure text is left-aligned */
    text-transform: lowercase; /* Convert to small caps */
    line-height: 1.2; /* Tighter line height for subheadings */
}

h3.other-projects {
    position: relative;
    padding-top: 25px; /* More space after line */
    margin-bottom: 20px; /* Space after heading */
}

h3.other-projects::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 1px;
    background-color: rgba(0, 0, 0, 0.15); /* Light line above */
}

/* Subtext formatting for experience section */
.experience-item {
    margin-bottom: 25px; /* Match paragraph spacing */
}

/* Dashed outline for Muztream and Serri */
.experience-item:first-of-type,
.experience-item:nth-of-type(2) {
    border: 1px dashed rgba(217, 119, 6, 0.4); /* Subtle brown/orange dashed outline */
    border-radius: 4px;
    padding: 15px;
    margin-bottom: 20px;
    background-color: rgba(255, 248, 240, 0.3); /* Very subtle warm background */
}

.experience-item p {
    margin-bottom: 15px; /* Match main paragraph spacing */
    padding-left: 0; /* No indentation for main text */
    line-height: 1.5; /* Match main paragraph line height */
}

.experience-item .subtext {
    padding-left: 0; /* No indentation - match main text */
    margin-bottom: 15px; /* Match main paragraph spacing */
    font-size: 1.2em; /* Same size as main paragraphs */
    color: #666666; /* Lighter grey for subtext */
    line-height: 1.5; /* Match main paragraph line height */
    font-weight: 400; /* Normal weight like main text */
}

/* Indented items under company names */
.experience-item .indented {
    padding-left: 20px; /* Tabbed space */
}

/* Override lowercase for company names */
.experience-item p strong a {
    text-transform: capitalize; /* First letter capital, rest lowercase */
}

/* Experience heading with dots separator */
.experience-item > p > strong {
    font-weight: 600;
}

.experience-item > p > strong > a {
    color: #0066cc;
    text-decoration: underline;
    font-weight: 600;
}

.experience-item > p > strong > a:hover {
    color: #004499;
}

/* Scribble highlight for "already driving numbers" */
.scribble-highlight {
    position: relative;
    display: inline-block;
    color: #d97706; /* Orange-brown color */
    font-weight: 600;
}

/* Straight down hand-drawn arrow */
.curved-arrow {
    position: absolute;
    left: 50%;
    top: 100%;
    margin-left: -1px;
    margin-top: 8px;
    font-size: 0;
    width: 3px;
    height: 70px;
    pointer-events: none;
    z-index: 1;
}

.curved-arrow::before {
    content: '';
    position: absolute;
    left: 0;
    top: 0;
    width: 2.5px;
    height: 60px;
    background: linear-gradient(to bottom, rgba(217, 119, 6, 0.75), rgba(180, 83, 9, 0.7));
    border-radius: 2px;
    opacity: 0.75;
    transform: rotate(0.5deg); /* Slight hand-drawn tilt */
    box-shadow: 0 0 2px rgba(217, 119, 6, 0.3);
}

.curved-arrow::after {
    content: '';
    position: absolute;
    left: -4px;
    top: 58px;
    width: 0;
    height: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    border-top: 10px solid rgba(217, 119, 6, 0.8);
    transform: rotate(-1deg); /* Slight hand-drawn tilt */
    opacity: 0.8;
}

.scribble-highlight::after {
    content: '';
    position: absolute;
    bottom: 2px;
    left: -2px;
    right: -2px;
    height: 8px;
    background: linear-gradient(135deg, #f59e0b 0%, #d97706 50%, #b45309 100%); /* Brown-yellow-orange gradient */
    opacity: 0.4;
    border-radius: 50% 30% 50% 30% / 60% 40% 60% 40%; /* Wavy scribble shape */
    transform: rotate(-1deg);
    z-index: -1;
}

/* Hand-drawn arrow - now attached to scribble highlight */
.hand-drawn-arrow {
    display: none; /* Arrow is now part of scribble-highlight */
}

a {
    color: #0066cc; /* Standard blue links like reference */
    text-decoration: underline; /* Underlined like reference */
    font-weight: bold; /* Bold links like reference */
    text-align: left; /* Ensure text is left-aligned */
    transition: color 0.2s ease;
}

a:hover {
    color: #004499; /* Darker blue on hover */
}

/* Ensure contact image scales on small screens */
#contact img {
    max-width: 100% !important;
    height: auto !important;
}

/* Testimonial Cards - Bottom Right */
.testimonials-container {
    position: fixed;
    bottom: 20px;
    right: 20px;
    z-index: 100;
    width: 280px;
    pointer-events: none; /* Don't interfere with page interaction */
    height: auto;
}

.testimonial-card {
    background-color: #ffffff;
    border: 2px solid #d4a574; /* Beige-orange color */
    border-radius: 8px;
    padding: 15px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transform: translateY(10px);
    position: absolute;
    bottom: 0;
    right: 0;
    width: 280px;
    pointer-events: auto; /* Allow interaction with cards */
}

.testimonial-card:nth-child(1) {
    animation: fadeCycle 8s infinite;
    animation-delay: 1s; /* Start after 1 second */
}

.testimonial-card:nth-child(2) {
    animation: fadeCycle 8s infinite;
    animation-delay: 5s; /* Start after first card fades out */
}

@keyframes fadeCycle {
    0% {
        opacity: 0;
        transform: translateY(10px);
    }
    10% {
        opacity: 1;
        transform: translateY(0);
    }
    40% {
        opacity: 1;
        transform: translateY(0);
    }
    50% {
        opacity: 0;
        transform: translateY(-10px);
    }
    100% {
        opacity: 0;
        transform: translateY(-10px);
    }
}

.testimonial-text {
    font-size: 0.9em;
    color: #333333;
    margin-bottom: 10px;
    line-height: 1.4;
    font-style: italic;
}

.testimonial-author {
    font-size: 0.8em;
    color: #666666;
    font-weight: 500;
    margin: 0;
}

/* Responsive adjustments */
@media (max-width: 768px) {
    body {
        line-height: 1.6; /* Comfortable line height on mobile */
        background-color: #ffffff; /* Pure white on mobile */
        color: #333333; /* Dark grey text */
    }

    .container {
        width: 100%; /* Full width on mobile */
        padding: 18px; /* Comfortable padding for mobile */
        max-width: 100%; /* Full width on mobile */
    }
    
    
    p {
        text-align: left; /* Left align on mobile for better readability */
        line-height: 1.4; /* Slightly tighter on mobile */
    }

    h1 {
        font-size: 2.1em; /* Comfortable for mobile */
        letter-spacing: -0.01em;
    }

    h2 {
        font-size: 1.25em; /* Comfortable subheading */
        margin-bottom: 18px;
    }

    p {
        font-size: 0.95em; /* Readable paragraph size on mobile */
        margin-bottom: 16px;
    }

    /* Portfolio button responsive */
    .portfolio-button {
        font-size: 0.85em; /* Slightly smaller on mobile */
        padding: 10px 20px; /* Smaller padding on mobile */
    }

    /* Testimonials responsive */
    .testimonials-container {
        position: relative;
        bottom: auto;
        right: auto;
        max-width: 100%;
        margin-top: 30px;
        padding: 0 18px;
    }

    .testimonial-card {
        max-width: 100%;
    }
}
