*,
*::before,
*::after {
    box-sizing: border-box;
}

/* custom properties */

:root {
    --ff-primary: 'Handlee', sans-serif;
    --ff-secondary: 'Source Code Pro', monospace;
    --ff-titles: 'Playwrite AU SA', sans-serif;

    --fw-reg: 300;
    --fw-bold: 900;

    --clr-light: #e2cb9d;
    --clr-dark: #53351f;
    --clr-accent: #a64237;
    --clr-white: #fff;

    --fs-h1: 3rem;
    --fs-h2: 2.25rem;
    --fs-h3: 1.25rem;
    --fs-body: 1rem;

    --bs: 0.25em 0.25em 0.75em rgba(0, 0, 0, .25), 0.125em 0.125em 0.25em rgba(0, 0, 0, .15);
}

@media (min-width: 800px) {
    :root {
        --fs-h1: 4.5rem;
        --fs-h2: 3.75rem;
        --fs-h3: 1.5rem;
        --fs-body: 1.125rem;
    }
}

/* General Styles */

html {
    scroll-behavior: smooth;
}

body {
    background: var(--clr-light);
    color: var(--clr-dark);
    margin: 0;
    font-family: var(--ff-primary);
    font-size: var(--fs-body);
    line-height: 1.6;
    margin-top: 80px;
}

html,
body {
    overflow-x: hidden;
}

@media (max-width: 1000px) {
    body {
        margin-top: 0;
    }
}

section {
    padding: 5em 2em;
}

img {
    display: block;
    max-width: 100%;
}

strong {
    font-weight: var(--fw-bold)
}

:focus {
    outline: 3px solid var(--clr-accent);
    outline-offset: 3px;
}

/* Buttons */

.btn {
    position: relative;
    display: inline-block;
    padding: .5em 2.5em;
    background: var(--clr-accent);
    border-radius: 12px;
    color: var(--clr-dark);
    text-decoration: none;
    cursor: pointer;
    font-size: 0.8rem;
    text-transform: uppercase;
    letter-spacing: 2px;
    font-weight: var(--fw-bold);
    transition: transform 200ms ease-in-out;
    color: var(--clr-light);
    top: 2em;
    border: 2px solid transparent;
    box-sizing: border-box;
}

.btn:hover {
    transform: scale(1.1);
    border-color: var(--clr-light);
}

/* Typography */
h1,
h2,
h3,
h4 {
    line-height: 1.2;
    margin: 0;
}

h1 {
    font-size: var(--fs-h1)
}

h2 {
    font-size: var(--fs-h2)
}

h3 {
    font-size: var(--fs-h3)
}

.section__title {
    margin-bottom: 0.25em;
    font-family: var(--ff-titles);
}

.section__title--intro {
    font-weight: var(--fw-reg);
}

.section__title--intro strong {
    display: block;
}

.section__subtitle {
    margin: 0;
    font-size: var(--fs-h3);
    min-height: auto;
}

.section__subtitle--intro,
.section__subtitle--about {
    background: var(--clr-accent);
    padding: 0.25em 1em;
    font-family: var(--ff-secondary);
    margin-bottom: 1em;
    color: var(--clr-white);
    display: inline-block;
    z-index: -1;
}


.section__subtitle--work {
    color: var(--clr-accent);
    font-weight: var(--fw-bold);
    margin-top: 1em;
    margin-bottom: 1em;
}

/* header */

header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0.5em;
    background: var(--clr-light);
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    z-index: 999;
    border-bottom: 4px solid var(--clr-dark);
}

.logo {
    max-width: 200px;
}

.nav {
    display: flex;
    position: absolute;
    right: 0;
    height: 90%;
    width: 600px;
    transform: translateX(100%);
    transition: transform 300ms ease-in-out;
}

.nav__list {
    display: flex;
    flex-direction: row;
    gap: 1.5em;
    margin: 0;
    padding: 0.5em;
    list-style: none;
    background: var(--clr-light);
    width: 100%;
}

.nav__link {
    color: var(--clr-accent);
    font-weight: var(--fw-bold);
    font-size: var(--fs-h3);
    text-decoration: none;
    white-space: nowrap;
    transition: transform 300ms ease-in-out, color 200ms ease-in-out;
    display: inline-block;
}

.nav__link:hover {
    transform: scale(1.1);
    color: var(--clr-dark);
}

@media (max-width: 750px) {
    .nav {
        width: 500px;
    }
}

@media (max-width: 500px) {
    .nav {
        flex-direction: column;
        width: max-content;
        max-width: 90vw;
        height: auto;
        top: 3.35em;
        right: 0;
        background: var(--clr-light);
        border-left: 3px solid var(--clr-dark);
        border-bottom: 3px solid var(--clr-dark);
        z-index: 998;
    }

    .nav__list {
        flex-direction: column;
        gap: 0.25em;
    }

}

.nav-toggle {
    padding: .5em;
    background: transparent;
    border: 0;
    cursor: pointer;
    z-index: 1000;
    position: fixed;
    top: 1em;
    right: 1em;
}

.nav-open .nav {
    transform: translateX(0);
}

/* Hamburger styles */
.hamburger {
    display: block;
    position: relative;
}

.hamburger,
.hamburger::before,
.hamburger::after {
    background: var(--clr-accent);
    width: 2em;
    height: 3px;
    border-radius: 1em;
    transition: transform 250ms ease-in-out;
}

.hamburger::before,
.hamburger::after {
    content: '';
    position: absolute;
    left: 0;
}

.hamburger::before {
    top: 6px;
}

.hamburger::after {
    bottom: 6px;
}

.nav-open .hamburger {
    transform: rotate(0.625turn);
}

.nav-open .hamburger::before {
    transform: rotate(90deg) translateX(-6px);
}

.nav-open .hamburger::after {
    opacity: 0;
}

/* Intro section */

.intro {
    position: relative;
    margin-bottom: 0;
    padding-bottom: 2em;
}

.intro__img {
    box-shadow: var(--bs);
    border: 5px solid var(--clr-dark);
    border-radius: 40%;
    object-fit: cover;
}

.section__subtitle--intro {
    display: inline-block;
}

.intro__description {
    grid-column: 1 / -1;
    font-size: 1.5em;
    text-align: center;
    margin-bottom: -4em;
}

@media (max-width: 500px) {
    .section__subtitle--intro {
        text-align: right;
        left: -0.5em;
        width: calc(100% - 3rem);
    }
}

@media (min-width: 600px) {
    .intro {
        display: grid;
        width: min-content;
        margin: 0 auto;
        grid-column-gap: 1em;
        grid-template-areas:
            "img title"
            "img subtitle";
        grid-template-columns: min-content max-content;
    }

    .intro__img {
        grid-area: img;
        min-width: 250px;
        position: relative;
        z-index: 2;
    }

    .section__subtitle--intro {
        align-self: start;
        grid-column: -1 / 1;
        grid-row: 2;
        text-align: right;
        position: relative;
        left: -12em;
        width: calc(100% + 10.5em);
    }

    .portfolio__subtitle {
        left: -1.0em;
        width: calc(100% + 3em);
    }

}

/* My experiences section */

.my-experiences {
    position: relative;
    background-color: var(--clr-dark);
    color: var(--clr-light);
    text-align: center;
    z-index: 1;
    margin-bottom: -15%;
    margin-top: -15%;
}

.section__title--experiences {
    color: var(--clr-accent);
    position: relative;
}

.section__title--experiences::after {
    content: '';
    display: block;
    width: 6em;
    height: 1px;
    margin: 0.5em auto 1em;
    background: var(--clr-light);
    opacity: 0.5;
    background-color: var(--clr-light);
}

.experience {
    max-width: 500px;
    margin: 0 auto;
    z-index: 2;
}

@media (min-width: 800px) {
    .experiences {
        display: flex;
        max-width: 1000px;
        margin-left: auto;
        margin-right: auto;
    }

    .experience+.experience {
        margin-left: 2em;
    }
}

/* About me section */
.about-me {
    max-width: 1000px;
    margin: 0 auto;
}

.about-me__img {
    box-shadow: var(--bs);
    border: 5px solid var(--clr-dark);
    border-radius: 10%;
    object-fit: cover;
}

@media (min-width: 600px) {
    .about-me {
        display: grid;
        grid-template-columns: 1fr 200px;
        grid-template-areas:
            "title img"
            "subtitle img"
            "text img";
        grid-column-gap: 2em;
    }

    .section__title--about {
        grid-area: title;
    }

    .section__subtitle--about {
        grid-column: 1 / -1;
        grid-row: 2;
        position: relative;
        left: -1em;
        width: calc(100% + 2em);
        padding-left: 1em;
        padding-right: calc(200px + 4em);
    }

    .about-me__img {
        grid-area: img;
        position: relative;
        z-index: 2;
    }
}

/* my work */
.my-work {
    background-color: var(--clr-dark);
    color: var(--clr-light);
    text-align: center;
}

.portfolio {
    display: flex;
    justify-content: center;
    gap: 50px;
    flex-wrap: wrap;
    padding: 20px;
}

.portfolio-item {
    text-align: center;
    max-width: 300px;
}

.portfolio-item h3 {
    margin-bottom: 10px;
}

.image-container {
    background-color: var(--clr-accent);
    border-radius: 8px;
    overflow: hidden;
    width: 100%;
    height: 300px;
    position: relative;
    border: 5px solid var(--clr-light);
    border-radius: 10%;
    object-fit: cover;
}

.portfolio__img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    transition: transform 750ms cubic-bezier(.5, 0, .5, 1), opacity 250ms linear;
}

.image-container:focus-within {
    outline: 3px solid var(--clr-accent);
    outline-offset: 3px;
}

.portfolio-item:hover .portfolio__img,
.portfolio-item:focus-within .portfolio__img {
    opacity: 0.7;
    transform: scale(1.2);
}

/* Footer */

.footer {
    background: #111;
    color: var(--clr-accent);
    text-align: center;
    padding: 2.5em 0;
    font-size: var(--fs-h3);
}

.footer a {
    color: inherit;
    text-decoration: none;
}

.footer__link {
    font-weight: var(--fw-bold);
}

.footer__link:hover,
.social-list__link:hover {
    opacity: 0.7;
}

.footer__link:hover {
    text-decoration: underline;
}

.social-list {
    list-style: none;
    display: flex;
    justify-content: center;
    margin: 2em 0 0;
    padding: 0;
}

.social-list__item {
    margin: 0 .5em;
}

.social-list__link {
    padding: .5em;
}

/* League Management Page Styles */

.portfolio-item-page {
    padding: 0 2em 2em;
    max-width: 1000px;
    margin: 0 auto;
}

.portfolio-item-page p{
    text-align: justify;
}

.portfolio-item-page p,
.portfolio-item-page ul {
    max-width: 800px;
    margin-left: auto;
    margin-right: auto;
}

.portfolio-item-page h3,
.portfolio-item-page h4  {
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
    text-align: center;
}

.portfolio-item-page img {
    margin-bottom: 10px;
    justify-content: center;
}

.portfolio-item-page__img {
    border-radius: 50%;
    border: 5px solid var(--clr-dark);
    grid-area: img;
    min-width: 250px;
    position: relative;
    z-index: 2;
    box-shadow: var(--bs);
}

/* Animations */
.auto-type-container {
    width: 100%;
}

#typing-name {
    display: inline-block;
    min-width: 7ch;
}

.animation-placeholder {
    visibility: hidden;
}

#cursor {
    display: inline-block;
    color: var(--clr-dark);
}

.about-me__body:hover p:hover,
.experience:hover h3,
.experience:hover p {
    transform: scale(1.05);
}

.about-me__body:hover p:hover,
.experience:hover p {
    font-weight: bold;
}

.about-me__body p,
.experience h3,
.experience p {
    transition: transform 0.3s ease, font-weight 0.3s ease;
}

.animate.fade-in {
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 1s ease-out, transform 1s ease-out;
}

.animate.fade-in.visible {
    opacity: 1;
    transform: translateY(0);
}

.animate.zoom-in {
    opacity: 0;
    transform: scale(0.9);
    transition: transform 0.75s ease-out, opacity 0.75s ease-out;
}

.animate.zoom-in.visible {
    opacity: 1;
    transform: scale(1);
}

.wave {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
}

.wave svg {
    position: relative;
    display: block;
    width: calc(140% + 1.3px);
    height: 87px;
    transform: rotateY(180deg);
}

.wave .shape-fill {
    fill: var(--clr-light);
}

.wave2 {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    overflow: hidden;
    line-height: 0;
    transform: rotate(180deg);
}

.wave2 svg {
    position: relative;
    display: block;
    width: calc(120% + 1.3px);
    height: 75px;
}

.wave2 .shape-fill {
    fill: #111;
}

.spacer {
    aspect-ratio: 960/300;
    width: 100%;
    margin-bottom: -10em;
    background-repeat: no-repeat;
    background-position: center;
    background-size: cover;
}

@media (max-width: 600px) {
    .spacer {
        margin-bottom: 0;
    }
}

.layer1 {
    background-image: url('../resources/layer1.svg');
}

.flip {
    transform: rotate(180deg);
    backface-visibility: hidden;
}

.blob1-background {
    position: absolute;
    top: 70%;
    left: 75%;
    transform: translate(-50%, -50%);
}

.blob2-background {
    position: absolute;
    top: 20%;
    left: 25%;
    transform: translate(-50%, -50%);
}

.two-columns {
    display: flex;
    gap: 20px;
}

.three-columns {
    display: flex;
    gap: 20px;
}

@media (max-width: 600px) {
    .three-columns {
      flex-direction: column;
    }
  }

.column {
    flex: 1;
}

.wrap-image-right {
    float: right;
    margin: 0 0 0 15px;
    width: 200px;
    height: auto;
    border: 5px solid var(--clr-dark);
    border-radius: 10%;
}

.wrap-image-left {
    float: left;
    margin: 15px;
    width: 200px;
    height: auto;
    border: 5px solid var(--clr-dark);
    border-radius: 10%;
}

/* Rotating image preview */

.rotating-body {
    display: flex;
    flex-direction: column;
    justify-content: flex-start;
    align-items: center;
    text-align: center;
    height: auto;
    min-height: 650px;
    margin-bottom: 2em;
    margin-top: 0;
    background: var(--clr-light);
    overflow: hidden;
}

.rotating-image-container {
    position: relative; 
    width: 200px;
    height: 200px;
    transform-style: preserve-3d;
    transform: perspective(1000px) rotateY(0deg);
    transition: transform 0.7s;   
}

.rotating-image-container span {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    transform: rotateY(calc(var(--i) * 45deg)) translateZ(400px);
    z-index: 1;
}

.rotating-image-container span img {
    position: absolute;
    left: 0;
    top: 0;
    width: 100%; 
    z-index: 1;
}

.rotating-btn-container {
    position: relative; 
    width: 80%;
}

.rotating-btn {
    position: absolute; 
    bottom: -200px;
    background: var(--clr-accent);
    color: #fff;
    border: none;
    padding: 10px 20px; 
    border-radius: 5px;
    cursor: pointer;
}

#prev {
    left: 20%;
}

#next {
    right: 20%;
}

.rotating-btn:hover {
    filter: brightness(1.5);
}

.image-row {
    margin-top: 20px;
    margin-bottom: 20px;
    display: flex;
    justify-content: center;
    gap: 1em;
    flex-wrap: wrap; 
}

.image-row img {
    width: 25vw; 
    max-width: 200px; 
    height: auto;
    border-radius: 8px;
}

@media (max-width: 600px) {
    .image-row img {
        width: 40vw;
    }
}

.github-link {
    color: var(--clr-dark);
    
    transition: all 0.3s ease;
    font-size: 1em;
    display: inline-block;
}

.github-link:hover {
    color: var(--clr-accent);
    font-size: 1.2em;
}

.link-wrapper {
    text-align: center;
    height: 60px; 
}