/* --- General Styles --- */
:root {
    --primary-color-rgb: 240, 180, 0;
    /* RGB values for primary-color, used in rgba() */
    --primary-color: #f0b400;
    /* Original highlight color */
    --secondary-color: #333;
    /* For secondary buttons and dark text */
    --accent-color: #007bff;
    /* A new accent for links/hovers, can be adjusted */
    --light-bg: #f9f9f9;
    --dark-bg: #e0e0e0;
    /* A slightly darker light background */
    --text-color: #1a1a1a;
    --white-color: #ffffff;
    --card-shadow: 0 6px 15px rgba(0, 0, 0, 0.1);
    --border-radius-lg: 12px;
    --border-radius-md: 8px;
    --spacing-sm: 1rem;
    --spacing-md: 2rem;
    --spacing-lg: 4rem;
    --hero-background-color: #fff3cd;
    /* Explicit variable for hero background */

    /* NEW Contact Form Specific Variables */
    --form-bg-color: var(--white-color);
    /* Background for the form itself */
    --input-border-color: var(--dark-bg);
    --input-focus-border-color: var(--primary-color);
    --input-text-color: var(--secondary-color);
    --form-shadow: 0 10px 30px rgba(0, 0, 0, 0.08);
    /* Lighter, more elegant shadow */
}

body {
    font-family: 'Inter', sans-serif;
    margin: 0;
    padding: 0;
    background: var(--white-color);
    color: var(--text-color);
    line-height: 1.6;
    /* Improved readability */
    scroll-behavior: smooth;
    /* Smooth scrolling for anchor links */
}

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

a:hover {
    color: var(--accent-color);
    /* Change color on hover */
}

h1,
h2,
h3 {
    color: var(--secondary-color);
    line-height: 1.2;
    margin-bottom: var(--spacing-sm);
    /* Consistent spacing */
}

p {
    margin-bottom: var(--spacing-sm);
}

/* --- Utility Classes --- */
.section {
    padding: var(--spacing-lg) var(--spacing-md);
    text-align: center;
}

.gray-bg {
    background: var(--light-bg);
}

/* --- Hero Section --- */
.hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    /* Center vertically in smaller viewports */
    padding: var(--spacing-lg) var(--spacing-md);
    background: var(--hero-background-color);
    /* Use variable */
    text-align: center;
    min-height: 80vh;
    /* Make hero section taller */
}

.hero-text {
    max-width: 700px;
    margin-bottom: var(--spacing-md);
    /* Space between text and image on mobile */
}

.hero-text h1 {
    font-size: clamp(2.5rem, 6vw, 4.5rem);
    /* Responsive font size */
    margin-bottom: 1rem;
}

.hero-text p {
    font-size: 1.2rem;
    margin-bottom: var(--spacing-md);
    max-width: 500px;
    /* Constrain paragraph width */
    margin-left: auto;
    margin-right: auto;
}

/* .highlight {
    color: var(--primary-color);
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--primary-color);
    animation: typing 2s steps(20, end), blink 0.75s step-end infinite;
    width: 0;
} */

.highlight {
    color: var(--primary-color);
    display: inline-block;
    overflow: hidden;
    white-space: nowrap;
    border-right: 3px solid var(--primary-color);
    animation: typing-loop 4s steps(16) infinite, blink 0.75s step-end infinite;
    width: 16ch;
    max-width: 16ch;
    position: relative;
}

/* NEW: Profile Image Wrapper */
.profile-image-wrapper {
    background: var(--primary-color);
    position: relative;
    /* For positioning the pseudo-element */
    width: clamp(280px, 40vw, 380px);
    /* Responsive size for the wrapper */
    height: clamp(280px, 40vw, 380px);
    display: flex;
    /* To center the image inside */
    justify-content: center;
    align-items: center;
    margin-top: var(--spacing-md);
    /* Space from hero text on mobile */
    box-shadow: var(--card-shadow);
    /* Shadow on the wrapper */
    border-radius: 50% / 60% 65% 40% 35%;
    /* Egg-like shape for the wrapper */
    overflow: hidden;
    /* Ensures image stays within rounded corners if it's too big */
    transition: transform 0.4s ease;
}

/* Add hello message on hover */
.profile-image-wrapper::after {
    content: 'Kia Ora';
    position: absolute;
    bottom: 20px;
    left: 50%;
    transform: translateX(-50%);
    background: var(--primary-color);
    color: var(--secondary-color);
    padding: 10px 18px;
    border-radius: var(--border-radius-md);
    font-weight: bold;
    font-size: 1.3rem;
    opacity: 0;
    transition: opacity 0.4s ease;
    pointer-events: none;
}

.profile-image-wrapper:hover::after {
    opacity: 1;
}

/* Make the background shape more prominent */
.profile-image-wrapper::before {
    content: '';
    position: absolute;
    top: 50%;
    /* Center the shape */
    left: 50%;
    /* Center the shape */
    transform: translate(-50%, -50%) scale(1.6);
    /* Make it much larger than the wrapper */
    width: 100%;
    height: 100%;
    background-color: var(--primary-color);

    /* Choose your preferred shape here, e.g., the oval from Option 1 or blob from Option 2 */
    border-radius: 50% / 55% 65% 45% 35%;
    /* Example oval */

    z-index: -1;
    opacity: 0.8;
    transition: all 0.5s ease;
    /* Transition for transform as well */
}

/* Shrink the image slightly more to reveal the background */
.profile-img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50% / 60% 60% 40% 40%;
    box-shadow: none;
    border: none;
}

.profile-image-wrapper:hover {
    transform: translateY(-10px);
}

/* Hero Buttons */
.hero-buttons {
    margin-top: var(--spacing-sm);
    display: flex;
    flex-wrap: wrap;
    /* Allow buttons to wrap on small screens */
    justify-content: center;
    gap: 1rem;
    /* Space between buttons */
}

.btn {
    display: inline-flex;
    /* Use flex for vertical alignment if text wraps */
    align-items: center;
    justify-content: center;
    padding: 12px 25px;
    /* Slightly more padding */
    background: var(--primary-color);
    color: var(--secondary-color);
    border: none;
    border-radius: var(--border-radius-md);
    font-weight: 600;
    /* Thicker font weight */
    text-decoration: none;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 1rem;
}

.btn:hover {
    background: var(--secondary-color);
    color: var(--white-color);
    transform: translateY(-3px);
    /* Subtle hover effect */
    box-shadow: 0 8px 20px rgba(0, 0, 0, 0.15);
}

.btn.secondary {
    background: var(--secondary-color);
    color: var(--white-color);
    border: 2px solid var(--secondary-color);
    /* Add a border */
}

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

/* Contact Icons */
.contact-icons {
    margin-top: 1.5rem;
    margin-bottom: 2.5rem;
    /* More space below icons */
    display: flex;
    justify-content: center;
    gap: 1.5rem;
    /* Space between icons */
}

.contact-icons .icon-link {
    font-size: 2.2rem;
    /* Larger icon size */
    color: var(--secondary-color);
    /* Darker color for icons */
    transition: transform 0.3s ease, color 0.3s ease;
}

.contact-icons .icon-link:hover {
    transform: translateY(-5px) scale(1.1);
    /* Lift and scale on hover */
    color: var(--primary-color);
    /* Match highlight color on hover */
}

/* --- Section Headings --- */
.section h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    /* Responsive font size for section titles */
    margin-bottom: var(--spacing-md);
    position: relative;
    /* For underline effect */
    display: inline-block;
    /* To make underline fit content */
}

.section h2::after {
    content: '';
    display: block;
    width: 60px;
    /* Underline width */
    height: 4px;
    background: var(--primary-color);
    margin: 10px auto 0;
    /* Center underline */
    border-radius: 2px;
}

/* --- Cards (Skills & Projects) --- */
.cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
    gap: var(--spacing-md);
    margin-top: var(--spacing-md);
    max-width: 1200px;
    margin-left: auto;
    margin-right: auto;
    padding: 0 var(--spacing-sm);
    justify-content: center;
}

.card {
    background: var(--white-color);
    border-radius: var(--border-radius-lg);
    padding: var(--spacing-md);
    box-shadow: var(--card-shadow);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    text-align: left;
    max-width: 100%;
}

.card .image-container {
    width: 100%;
    position: relative;
    overflow: hidden;
    border-radius: var(--border-radius-md);
    margin-bottom: 1rem;
    aspect-ratio: 16 / 9;
    /* Maintains a perfect widescreen aspect ratio */
}

.card img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    /* This is crucial; it prevents stretching by filling the container */
    clip-path: polygon(0 0, 100% 5%, 100% 95%, 0% 100%);
    transition: transform 0.4s ease, clip-path 0.4s ease;
}

.card:hover img {
    transform: scale(1.05) rotate(-1deg);
    clip-path: polygon(0 5%, 100% 0%, 100% 100%, 0% 95%);
}

.card:hover {
    transform: translateY(-8px);
    box-shadow: 0 10px 25px rgba(0, 0, 0, 0.15);
}

.card h3 {
    color: var(--primary-color);
    margin-bottom: 0.8rem;
    font-size: 1.5rem;
}

.card ul {
    list-style: none;
    padding: 0;
    margin: 0;
}

.card ul li {
    padding: 0.4rem 0;
    border-bottom: 1px solid var(--dark-bg);
    font-size: 1.1rem;
    color: var(--secondary-color);
}

.card ul li:last-child {
    border-bottom: none;
}

.card p {
    font-size: 1.1rem;
    color: var(--secondary-color);
}

.card p a {
    font-weight: 600;
}

/* Ensure the a tag wrapping the card has no text decoration */
.cards .card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* --- Video Gallery --- */
.video-gallery {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--spacing-md);
    max-width: 1100px;
    margin: var(--spacing-md) auto;
    padding: 0 var(--spacing-md);
}

.video-gallery iframe {
    width: 100%;
    max-width: 100%;
    height: 200px;
    aspect-ratio: auto;
    border: none;
    border-radius: var(--border-radius-md);
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.1);
    transition: transform 0.3s ease;
}

.video-gallery iframe:hover {
    transform: scale(1.03);
}

/* --- Contact Section --- */
/* Existing base contact section styles (keep these if they apply to text outside the form) */
.contact-info-text {
    font-size: 1.1rem;
    /* Slightly smaller for info text */
    margin-bottom: 0.5rem;
    color: var(--secondary-color);
    /* Consistent text color */
}

.contact-info-text a {
    font-weight: 600;
}

/* NEW: Contact Form Specific Styles */
.contact-form {
    max-width: 600px;
    /* Limit the form width */
    margin: var(--spacing-md) auto;
    /* Center the form and add top margin */
    padding: var(--spacing-lg);
    /* Generous padding inside the form card */
    background: var(--form-bg-color);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--form-shadow);
    /* Apply the new form shadow */
    text-align: left;
    /* Align form elements to the left */
}

.contact-form .form-group {
    margin-bottom: var(--spacing-md);
    /* Space between form fields */
}

.contact-form label {
    display: block;
    /* Make labels appear on their own line */
    margin-bottom: 0.5rem;
    /* Space between label and input */
    font-weight: 600;
    color: var(--secondary-color);
    /* Darker color for labels */
    font-size: 1.05rem;
}

.contact-form input[type="text"],
.contact-form input[type="email"],
.contact-form textarea {
    width: 100%;
    padding: 12px 15px;
    /* Comfortable padding */
    border: 1px solid var(--input-border-color);
    border-radius: var(--border-radius-md);
    font-size: 1rem;
    color: var(--input-text-color);
    background-color: var(--light-bg);
    /* Slightly off-white background for inputs */
    transition: border-color 0.3s ease, box-shadow 0.3s ease;
    box-sizing: border-box;
    /* Include padding in width */
}

.contact-form input[type="text"]:focus,
.contact-form input[type="email"]:focus,
.contact-form textarea:focus {
    border-color: var(--input-focus-border-color);
    /* Highlight border on focus */
    outline: none;
    /* Remove default outline */
    box-shadow: 0 0 0 3px rgba(var(--primary-color-rgb, 240, 180, 0), 0.2);
    /* Subtle glow on focus */
}

.contact-form textarea {
    resize: vertical;
    /* Allow vertical resizing only */
    min-height: 120px;
    /* Minimum height for textarea */
}

.contact-form .btn {
    width: auto;
    /* Allow button to size naturally */
    margin-top: var(--spacing-sm);
    /* Space above the button */
    display: block;
    /* Make the button take full width */
    text-align: center;
}

/* Responsive adjustments for the form */
@media (max-width: 600px) {
    .contact-form {
        padding: var(--spacing-md);
        /* Reduce padding on smaller screens */
        margin: var(--spacing-md) var(--spacing-sm);
        /* Adjust horizontal margin */
    }
}

/* --- Project Page Specific Styles --- */
.project-header {
    background: var(--light-bg);
    padding: 1.5rem var(--spacing-md);
    text-align: left;
    border-bottom: 1px solid var(--dark-bg);
}

.back-link {
    display: inline-block;
    color: var(--secondary-color);
    font-weight: 600;
    text-decoration: none;
    transition: color 0.3s ease, transform 0.3s ease;
    font-size: 1.1rem;
}

.back-link:hover {
    color: var(--primary-color);
    transform: translateX(-5px);
}

.project-detail {
    max-width: 900px;
    margin: 0 auto;
    text-align: center;
    padding: var(--spacing-lg) var(--spacing-md);
}

.project-detail h2 {
    font-size: clamp(2rem, 5vw, 3rem);
    margin-bottom: 3rem;
}

.project-detail h2::after {
    margin-top: 1rem;
}

.project-gallery {
    display: flex;
    justify-content: center;
    margin-bottom: var(--spacing-md);
}

.gallery-image {
    max-width: 100%;
    height: auto;
    border-radius: var(--border-radius-lg);
    box-shadow: var(--card-shadow);
}

.project-description {
    text-align: left;
    margin: var(--spacing-md) auto;
    max-width: 800px;
}

.project-description p {
    font-size: 1.1rem;
    color: var(--secondary-color);
}

.project-links {
    display: flex;
    justify-content: center;
    gap: 1rem;
    margin-top: var(--spacing-md);
}

/* Ensure the a tag wrapping the card has no text decoration */
.cards .card a {
    text-decoration: none;
    color: inherit;
    display: block;
}

/* --- Footer Styles --- */
.footer {
    background: var(--secondary-color);
    /* Dark background for contrast */
    color: var(--white-color);
    /* White text on dark background */
    padding: var(--spacing-md) var(--spacing-md);
    text-align: center;
    font-size: 0.95rem;
    line-height: 1.5;
}

.footer-content {
    max-width: 1200px;
    /* Match your content width */
    margin: 0 auto;
    /* Center the content */
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0.8rem;
    /* Space between lines of text/links */
}

.footer-links {
    margin-top: 0.5rem;
    display: flex;
    gap: 1.2rem;
    /* Space between icons */
}

.footer-links a {
    color: var(--white-color);
    /* White icons by default */
    font-size: 1.6rem;
    /* Slightly smaller than hero icons but still visible */
    transition: color 0.3s ease, transform 0.3s ease;
}

.footer-links a:hover {
    color: var(--primary-color);
    /* Highlight color on hover */
    transform: translateY(-3px);
    /* Subtle lift effect */
}

/* --- Responsive Adjustments --- */
@media (min-width: 768px) {
    .hero {
        flex-direction: row;
        text-align: left;
        justify-content: center;
        /* Center content horizontally */
        gap: var(--spacing-lg);
        /* Space between text and image */
    }

    .hero-text {
        text-align: left;
        margin-bottom: 0;
    }

    /* Adjustments for the new wrapper on desktop */
    .profile-image-wrapper {
        margin-top: 0;
        /* Remove top margin on desktop */
    }

    .hero-buttons {
        justify-content: flex-start;
        /* Align buttons to the left */
    }

    .contact-icons {
        justify-content: flex-start;
        /* Align icons to the left */
    }
}

@media (max-width: 480px) {
    .hero-text h1 {
        font-size: 2rem;
    }

    .hero-text p {
        font-size: 1rem;
    }

    /* Adjust wrapper size for very small screens */
    .profile-image-wrapper {
        width: 180px;
        height: 180px;
    }

    .btn {
        padding: 10px 20px;
        font-size: 0.9rem;
    }

    .contact-icons .icon-link {
        font-size: 1.8rem;
    }

    .section {
        padding: 2rem 1rem;
    }

    .cards {
        grid-template-columns: 1fr;
        /* Stack cards on very small screens */
    }
}

@keyframes typing-loop {
    0% {
        max-width: 0;
    }

    40% {
        max-width: 16ch;
    }

    60% {
        max-width: 16ch;
    }

    100% {
        max-width: 0;
    }
}

@keyframes blink {
    50% {
        border-color: transparent;
    }
}