/* === FONTS === */
@font-face {
    font-family: 'Neue Haas Grotesk';
    src: url('/font/neue-haas-grotesk-display-pro-cufonfonts/NeueHaasDisplayLight.ttf') format('woff2');
    font-weight: normal;
    font-style: normal;
    font-display: swap;
}

@font-face {
    font-family: 'Neue Haas Grotesk';
    src: url('/font/neue-haas-grotesk-display-pro-cufonfonts/NeueHaasDisplayBold.ttf') format('woff2');
    font-weight: bold;
    font-style: normal;
    font-display: swap;
}

.crimson-text-regular {
    font-family: "Crimson Text", serif;
    font-weight: 400;
    font-style: normal;
}

.crimson-text-semibold {
    font-family: "Crimson Text", serif;
    font-weight: 600;
    font-style: normal;
}

.crimson-text-bold {
    font-family: "Crimson Text", serif;
    font-weight: 700;
    font-style: normal;
}

.crimson-text-regular-italic {
    font-family: "Crimson Text", serif;
    font-weight: 400;
    font-style: italic;
}

.crimson-text-semibold-italic {
    font-family: "Crimson Text", serif;
    font-weight: 600;
    font-style: italic;
}

.crimson-text-bold-italic {
    font-family: "Crimson Text", serif;
    font-weight: 700;
    font-style: italic;
}


:root {
    --bg: #F3E9DD;
    --text: #533A33;
    --accent: #97051D;
    --h1: #533A33;
    --cursor: #97051D;
}

[data-theme="dark"] {
    --bg: #1A1816;
    --text: #B0D2EC;
    --accent: #f3e9dd;
    --h1: #B0D2EC;
    --cursor: #F3E9DD;
}

/* === Reset === */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    transition: background-color 0.4s ease, color 0.4s ease;
    cursor: none;
}

html,
body {
    height: 100%;
    overflow: hidden;
    /* hides scrollbar */
    background: var(--bg);
    color: var(--text);
    font-family: 'Neue Haas Grotesk', sans-serif;
    cursor: none;
}

h2,
h3 {
    font-family: "Crimson Text", "serif";
    color: var(--accent);
}

h2 {
    font-size: 1.5rem;
    margin: 2rem 0rem 0.5rem;
    text-align: left;
    color: var(--h1);
}

h3 {
    font-size: 1.2rem;
    margin: 1rem 0rem;
}

p,
ul {
    font-family: 'Neue Haas Grotesk';
    letter-spacing: 0.05rem;
    font-size: 1rem;
}

/* === Socials BAR === */
/* --- Social reposition animation --- */
#socials {
    position: fixed;
    top: 2rem;
    right: 2rem;
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 1rem;
    transition:
        top 0.8s ease,
        right 0.8s ease,
        transform 0.8s ease,
        font-size 0.8s ease,
        color 0.4s ease,
        gap 0.8s ease;
    z-index: 999;
}

#socials i {
    font-size: 1.2rem;
    color: var(--text);
    transition: transform 0.25s ease, color 0.3s ease;
}

#socials i:hover {
    transform: translateY(-6px);
    color: var(--accent);
}

/* === Contact mode === */
body.contact-active #socials i {
    display: none;
}

/* === PROGRESS BAR === */
#progress-bar {
    position: fixed;
    top: 50%;
    right: 3rem;
    transform: translateY(-50%);
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
    z-index: 999;
}

.progress-track {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 1.2rem;
}

.progress-dot {
    position: relative;
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--accent);
    opacity: 0.5;
    transform: scale(0.5);
    transition: all 0.7s ease;
    font-family: "Crimson Text";
}

.progress-dot.visible {
    opacity: 0.5;
    transform: scale(1);
}

.progress-dot.active {
    background: var(--text);
    opacity: 1;
    transform: scale(1.4);
}

.progress-dot::after {
    content: attr(data-label);
    position: absolute;
    right: 1.8rem;
    top: 50%;
    transform: translateY(-50%);
    opacity: 0;
    color: var(--text);
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.progress-dot.visible::after {
    opacity: 0.4;
}

.progress-dot.active::after {
    opacity: 1;
    font-weight: 500;
    letter-spacing: 0.04rem;
}

@media (max-width: 900px) {
    #progress-bar {
        right: 1rem;
    }
}

/* === Sections === */
section {
    height: 100vh;
    width: 100vw;
    display: none;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 4rem;
    opacity: 0;
    transform: translateY(30px) scale(0.98);
    transition:
        opacity 0.9s cubic-bezier(0.25, 0.1, 0.25, 1),
        transform 1s cubic-bezier(0.25, 0.1, 0.25, 1);
    will-change: opacity, transform;
}

section.active {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
}

section.fade-out {
    opacity: 0;
    transform: translateY(-20px) scale(0.98);
}


/* === Typography === */
h1 {
    font-family: '"Crimson Text", serif', serif;
    font-size: clamp(2.5rem, 6vw, 4rem);
    color: var(--h1);
    margin-bottom: 1rem;
    letter-spacing: 0.05rem;
}

#typing {
    position: relative;
    display: inline-block;
    white-space: nowrap;
    padding-right: 6px;
    /* gives breathing room for the cursor */
    border-right: 2.5px solid var(--h1);
    line-height: 1.2em;
    font-size: clamp(28px, 5vw, 48px);
    font-weight: 600;
    animation: blink 0.8s steps(1) infinite;
    vertical-align: bottom;
    /* keeps baseline aligned with text */
    min-height: 1.2em;
}

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

.tagline {
    font-family: 'Neue Haas Grotesk';
    font-weight: normal;
    font-size: 1.1rem;
    color: var(-text);
    max-width: 55ch;
    line-height: 1.6;
    letter-spacing: 0.04rem;
}

[data-theme="dark"] .tagline {
    color: var(--text)
}

/* === About === */
#main {
    width: 55vw;
    margin: auto;
    align-items: stretch;
}

#main div {
    margin: 1rem 0rem;
}

#main p {
    line-height: 1.5;
}

#about p {
    margin: 1.5rem 0;
    line-height: 1.8;
}

#about span {
    color: var(--accent);
    font-style: italic;
}

#main a {
    text-decoration: none;
    color: var(--text);
}

#main a:hover {
    text-decoration: underline;
}

#main a:visited {
    color: var(--text);
}

#degree div {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
}

/* === Scroll indicator === */
.scroll-indicator {
    position: absolute;
    bottom: 2rem;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.9rem;
    opacity: 0.6;
    animation: bounce 2s infinite;
}

@keyframes bounce {

    0%,
    100% {
        transform: translate(-50%, 0);
    }

    50% {
        transform: translate(-50%, 8px);
    }
}



/* === Theme toggle === */
#theme-toggle {
    position: fixed;
    top: 2rem;
    left: 2rem;
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.4rem;
    cursor: pointer;
    transition: transform 0.3s ease, color 0.3s ease;
}

#theme-toggle:hover {
    transform: rotate(20deg) scale(1.1);
    color: var(--accent);
}


/* === HEADER === */
#site-header {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 70px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 3rem;
    background: transparent;
    backdrop-filter: blur(4px);
    z-index: 1000;
    transition: background-color 0.3s ease, color 0.3s ease;
}

#header-name {
    position: absolute;
    left: 50%;
    top: 60%;
    transform: translate(-50%, -50%);
    font-size: 1.5rem;
    text-align: center;
    opacity: 1;
    visibility: visible;
    transition: opacity 0.5s ease, visibility 0.5s ease;
}

#header-name.hidden {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

/* Theme toggle inside header */
#site-header #theme-toggle {
    background: none;
    border: none;
    color: var(--text);
    font-size: 1.4rem;
    cursor: pointer;
    transition: transform 0.3s ease, color 0.3s ease;
}

#site-header #theme-toggle:hover {
    transform: rotate(20deg) scale(1.1);
    color: var(--accent);
}

/* Social icons in header */
#site-header #socials {
    display: flex;
    align-items: center;
    gap: 0.7rem;
}

#site-header #socials i {
    font-size: 1.1rem;
    color: var(--text);
    transition: transform 0.25s ease, color 0.3s ease;
}

#site-header #socials i:hover {
    transform: translateY(-4px);
    color: var(--accent);
}

/* === Skills ==== */
#skills {
    width: 50vw;
    margin: 1rem auto;
    align-items: flex-start;
    line-height: 1.7;
}

#skills h2 {
    margin-bottom: 2rem;
    text-align: left;
    align-self: left;
}

.skills-grid {
    display: flex;
    flex-direction: column;
    gap: 1rem;
}

.skill-category h3 {
    margin-bottom: 0.4rem;
}

.skill-category p {
    color: var(--text);
    opacity: 0.85;
}

.skill-bar {
    background: rgba(0, 0, 0, 0.1);
    border-radius: 6px;
    height: 8px;
    position: relative;
    overflow: hidden;
    margin-top: 0.4rem;
}

.skill-bar::after {
    content: "";
    position: absolute;
    left: 0;
    top: 0;
    height: 100%;
    width: var(--level);
    background: var(--accent);
    border-radius: 6px;
    transition: width 1.5s ease;
}

/* === Projects === */
#projects {
    width: 60vw;
    margin: auto;
    padding-top: 3rem;
    line-height: 1.5;
    align-items: flex-start;
}

#projects h2 {
    margin: 2rem 0rem 0.5rem;
    text-align: left;
    color: var(--h1);
}

.project {
    margin-bottom: 1rem;
}

.project-info {
    display: flex;
    flex-direction: row;
    justify-content: space-between;
    align-items: center;
    width: 55vw;
}

.project-info p {
    text-align: right;
    opacity: 0.7;
}

.project h3 {
    font-weight: 600;
    margin-bottom: 0.4rem;
}

.project ul {
    list-style: none;
    padding-left: 0;
    max-width: 50vw;
    margin-top: 1rem;
}

.project li {
    position: relative;
    margin-bottom: 0.6rem;
    padding-left: 1.2rem;
}

.project li::before {
    content: "•";
    position: absolute;
    left: 0;
    color: var(--accent);
}

/* === Contact === */
#contact {
    width: 100vw;
    height: 100%;
    display: flex;
    flex-direction: column;
    justify-content: space-around;
    align-items: center;
    text-align: center;
    padding: 4rem 2rem;
    line-height: 1.6;
    margin-top: 6.5rem;
}

#contact h2 {
    font-size: 2.5rem;
    margin-bottom: 1rem;
    color: var(--h1);
    font-family: "Crimson Text", serif;
}

/* Contact icons */
.contact-icons {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 2.5rem;
    transform: scale(0.8);
    opacity: 0;
    animation: zoomIn 0.8s ease forwards;
    animation-delay: 0.3s;
}

.contact-icons i {
    font-size: 1.8rem;
    color: var(--text);
    transition: transform 0.3s ease, color 0.4s ease;
}

.contact-icons i:hover {
    transform: scale(1.3);
    color: var(--accent);
}

.credits {
    margin: 0rem !important;
    opacity: 0.4;
    font-style: italic;
    font-size: 0.5rem;
}

@keyframes zoomIn {
    from {
        transform: scale(0.5);
        opacity: 0;
    }

    to {
        transform: scale(1);
        opacity: 1;
    }
}


/* === Cursor === */
.cursor {
    position: fixed;
    top: 0;
    left: 0;
    width: 15px;
    height: 15px;
    border: 2px solid var(--cursor);
    border-radius: 50%;
    pointer-events: none;
    transform: translate(-50%, -50%);
    z-index: 9999;
    transition: transform 0.1s ease-out, border-color 0.25s ease;
}

a:hover~.cursor,
.cursor.link-hover {
    width: 18px;
    height: 18px;
    border: none;
    background: none;
    position: fixed;
}

.cursor.link-hover::before,
.cursor.link-hover::after {
    content: "";
    position: absolute;
    top: 50%;
    left: 50%;
    width: 18px;
    height: 2px;
    background: var(--cursor);
    transform-origin: center;
}

.cursor.link-hover::before {
    transform: translate(-50%, -50%) rotate(45deg);
}

.cursor.link-hover::after {
    transform: translate(-50%, -50%) rotate(-45deg);
}


/* === RESPONSIVE === */
@media (max-width: 900px) {
    section {
        padding: 2rem;
    }

    h1 {
        font-size: 2.6rem;
    }
}