/* Root Variables */
:root {
    --main-font: 'ambidexter';
    --body-font: 'Alice', serif;
    --body-font-size: 2rem;
    --main-font-size: 200px;
    --main-margin: 10px 40px;
    --line-height: 0.9;
    --body-bg: #F8F0E3;
    --main-font-color: #010101;
    --font-color: #2C2C2C;
}

/* Reset */
body,
h1, h2, h3, h4, h5, h6, p {
    padding: 0;
    margin: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--body-bg);
    color: var(--font-color);
    font-family: var(--body-font);
    margin: var(--main-margin);
    font-size: var(--body-font-size);
    text-rendering: optimizeLegibility;
}

/* Typography */
@font-face {
    font-family: 'ambidexter';
    src: url('./fonts/ambidexter_regular.otf') format('opentype');
    font-weight: normal;
    font-style: normal;
}

@font-face {
    font-family: 'apricots';
    src: url('./fonts/ApricotFarmhouse_PERSONALUSE.otf');
}

.font-header {
    color: #8D7B68;
    font-weight: bold;
    font-size: 2.5rem;
    font-style: italic;
    font-family: 'Merriweather';
}

/* Layout */

/* Components */
.nav-text {
    display: block;
    justify-self: self-end;
    font-size: 1.5rem;
}

/* Hero Section */
.hero-section {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 100vh;
    position: relative;
    padding: 20px;
}

.hero-title {
    display: flex;
    flex-direction: column;
    justify-content: center;
    flex-grow: 1;
}

.hero-title h1 {
    font-family: var(--main-font);
    font-size: clamp(80px, 15vw, 200px);
    line-height: var(--line-height);
    margin: 0;
}

.below {
    display: block;
    margin: -10px 0 0 0;
}

.hero-subtext {
    display: flex;
    flex-direction: column;
    gap: 7px;
    align-self: flex-end;
    font-size: clamp(1rem, 3vw, 1.1rem);
    position: absolute;
    bottom: 20px;
    right: 20px;
    line-height: 0.8;
    width: auto;
    text-align: right;
}

.hero-subtext h2 {
    color: #8D7B68;
    font-size: clamp(1.5rem, 4vw, 2rem);
}

.hero-subtext svg {
    align-self: flex-end;
    margin-top: 10px;
}

.author-credit {
    justify-content: end;
    color: #8D7B68;
    font-size: 0.9rem;
}

/* Skills Section */
.skills-section {
    display: flex;
    flex-direction: column;
}

.skills-intro {
    max-width: 55%;
}

.skills-list {
    align-self: end;
    width: 75%;
}

.accordion {
    width: 85%;
    border-collapse: collapse;
    justify-self: end;
}

.accordion-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px;
    cursor: pointer;
    border-bottom: 1px solid #8D7B68;
}

.accordion-content {
    display: block;
    overflow: hidden;
    max-height: 0;
    padding: 0 15px;
    transition: max-height 0.4s ease-out, padding 0.4s ease-out;
}

.accordion-content p {
    margin: 0;
    padding: 10px 0;
}

.arrow {
    transition: transform 0.3s ease-in-out;
}

.rotate {
    transform: rotate(90deg);
}

.right ul {
    display: flex;
    flex-wrap: wrap;
    gap: 5px;
}

.right ul li {
    list-style: none;
    background-color: rgb(125, 17, 40);
    color: white;
    padding: 7px 9px;
    border-radius: 7px;
    font-weight: 100;
}

/* Projects Section */
.projects-section {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1rem;
    padding: 2rem;
    background: black;
    border-radius: 15px;
    margin: 160px 0;
    min-height: 120vh;
}

.proof {
    color: #B8860B;
    font-style: italic;
}

.project-array-one,
.project-array-two,
.project-array-three {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.project-array-one-subarray,
.project-array-three-subarray {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 1rem;
}

.project-tile {
    position: relative;
    overflow: hidden;
    border-radius: 10px;
    box-shadow: 0 4px 6px rgba(0, 0, 0, 0.1);
}

.project-tile img {
    width: 100%;
    height: auto;
    display: block;
    transition: transform 0.4s ease-in-out;
}

.project-tile:hover img {
    transform: scale(1.2);
}

.overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.6);
    opacity: 0;
    display: flex;
    align-items: flex-end;
    justify-content: flex-end;
    padding: 10px;
    transition: opacity 0.3s ease-in-out;
}

.project-tile:hover .overlay {
    opacity: 1;
}

.arrow {
    transform: scale(1.5);
    stroke: white;
    opacity: 1;
    transition: opacity 0.3s ease-in-out, transform 0.3s ease-in-out;
    position: absolute;
    bottom: 10px;
    right: 10px;
}

.project-tile:hover .arrow {
    opacity: 1;
    transform: scale(1.8);
}

/* Ensure small tiles are properly sized */
.project-array-one-subarray .project-tile:nth-child(2),
.project-array-three-subarray .project-tile:nth-child(2) {
    min-height: 200px;
}

/* CTA Section */
.cta-content {
    font-size: 5rem;
    font-family: 'alice';
    font-style: oblique;
}

.cta-section button {
    font-family: 'merriweather';
    font-weight: bold;
    background-color: #B8860B;
    font-size: 5rem;
    border-radius: 15px;
    text-align: center;
    padding: 10px 20px;
    border: none;
    color: white;
    margin-top: 30px;
}

.lets-talk {
    font-family: 'merriweather';
    font-size: 5rem;
    display: inline-block;
    background: gold;
    color: black;
    font-weight: bold;
    padding: 10px 20px;
    margin-top: 30px;
    text-align: center;
    border-radius: 8px;
    text-decoration: none;
    transition: background 0.3s ease-in-out, transform 0.2s ease-in-out;
}

.lets-talk:hover {
    background: orange;
    transform: scale(1.1);
}

/* Footer */
.footer hr {
    margin-top: 40px;
    width: 100%;
}

.socials-container {
    display: flex;
    justify-content: center;
}

.socials {
    display: flex;
    margin-top: 30px;
    gap: 40px;
    width: 150px;
    height: 150px;
}

/* Media Queries for Responsive Design */
@media (max-width: 767px) {
    :root {
        --main-font-size: 100px;
        --body-font-size: 1.2rem;
        --main-margin: 10px 20px;
    }

    body {
        margin: var(--main-margin);
    }

    .nav-text {
        font-size: 1.2rem;
    }

    .hero-title h1 {
        font-size: clamp(100px, 12vw, 80px);
    }

    .hero-subtext {
        bottom: 40px;
        right: 10px;
    }

    .hero-subtext h2 {
        font-size: clamp(2.2rem, 3.5vw, 1.5rem);
    }

    .skills-intro {
        max-width: 100%;
    }

    .skills-list {
        width: 100%;
    }

    .accordion {
        width: 100%;
    }

    .accordion-row {
        padding: 10px;
    }

    .right ul li {
        padding: 5px 7px;
        font-size: 0.9rem;
    }

    .projects-section {
        grid-template-columns: 1fr;
        gap: 0.5rem;
        padding: 1rem;
        margin: 80px 0;
    }

    .project-array-one-subarray,
    .project-array-three-subarray {
        grid-template-columns: 1fr;
    }

    .cta-content {
        font-size: 2rem;
    }

    .lets-talk {
        font-size: 2rem;
        padding: 8px 16px;
    }

    .socials {
        gap: 20px;
    }
}

@media (min-width: 768px) and (max-width: 1023px) {
    .hero-title h1 {
        font-size: clamp(200px, 14vw, 150px);
    }

    .hero-subtext {
        bottom: 15px;
        right: 15px;
    }

    .skills-intro {
        max-width: 70%;
    }

    .skills-list {
        width: 85%;
    }

    .projects-section {
        grid-template-columns: repeat(2, 1fr);
    }

    .project-array-one-subarray,
    .project-array-three-subarray {
        grid-template-columns: repeat(2, 1fr);
    }

    .cta-content {
        font-size: 3rem;
    }

    .lets-talk {
        font-size: 3rem;
    }
}