/* Core Variables */
:root {
    --bg-color: #ffffff;
    --text-primary: #000000;
    --text-secondary: #475569;
    --border-color: #e2e8f0;
    --accent-color: #0d9488;
    --note-yellow: #fef08a;
    --font-main: "Charis SIL", serif;
    --font-writing: "Caveat", cursive;
}

/* Reset & Base Setup */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    background-color: var(--bg-color);
    color: var(--text-primary);
    font-family: var(--font-main);
    font-size: 18px;
    line-height: 1.6;
    display: flex;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
    padding: 2rem 1rem;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

.mono-text {
    font-family: var(--font-main);
    /*text-transform: uppercase;*/
    font-size: 16px;
    letter-spacing: 1px;
    color: var(--text-secondary);
}

/* Navigation */
nav {
    width: 100%;
    max-width: 48rem;
    display: flex;
    justify-content: flex-end;
    padding-bottom: 3rem;
}

button#lang-toggle {
    background: #f8fafc;
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    padding: 6px 12px;
    cursor: pointer;
    border-radius: 16px;
    transition: all 0.2s ease;
    font-weight: 600;
}

button#lang-toggle:hover {
    background: var(--border-color);
    color: var(--text-primary);
}

/* Main Content Container */
main {
    width: 100%;
    max-width: 48rem;
    flex: 1;
}

/* Hero Section */
.hero {
    margin-bottom: 4rem;
}

.avatar-wrapper {
    position: relative;
    display: inline-block;
    margin-bottom: 3.5rem;
}

.avatar {
    width: 270px;
    height: 270px;
    border-radius: 64px;
    object-fit: cover;
    display: block;
}

/* Stickers Styles */
.sticker {
    position: absolute;
    font-size: 14px;
    padding: 6px 14px;
    box-shadow: 2px 4px 10px rgba(0, 0, 0, 0.12);
    user-select: none;
    white-space: nowrap;
    z-index: 3;
    transition:
        transform 0.2s cubic-bezier(0.175, 0.885, 0.32, 1.275),
        z-index 0.1s ease;
}

.sticker:hover {
    transform: scale(1.12) rotate(0deg) !important;
    z-index: 10;
    cursor: grab;
}

.badge-top {
    top: -5px;
    right: -24px;
    background-color: var(--note-yellow);
    color: #000000;
    border: 1.5px dashed #000000;
    border-radius: 20px;
    font-weight: bold;
    padding: 6px 10px;
    transform: rotate(32deg);
    font-size: 18px;
}

.tag-left {
    bottom: 3px;
    left: -28px;
    background-color: #1e293b;
    color: #ffffff;
    border-radius: 12px;
    transform: rotate(-20deg);
}

.tag-center {
    bottom: -22px;
    left: 45px;
    background-color: #0f172a;
    color: #ffffff;
    border-radius: 12px;
    transform: rotate(4deg);
}

.tag-right {
    bottom: 12px;
    right: -5px;
    background-color: #000000;
    color: #ffffff;
    border-radius: 12px;
    transform: rotate(-12deg);
}

.hero h1 {
    font-size: 30px;
    font-weight: bold;
    margin-bottom: 0.5rem;
    display: inline-flex;
    align-items: center;
}

.hero h1::after {
    content: "_";
    margin-left: 0px;
    color: var(--text-primary);
    font-family: var(--font-main);
    font-weight: bold;
    animation: blink 1s infinite;
}

@keyframes blink {
    0%,
    100% {
        opacity: 1;
    }
    50% {
        opacity: 0;
    }
}

.hero .role {
    color: var(--text-secondary);
    margin-bottom: 1.5rem;
    font-style: italic;
}

.hero .description {
    color: var(--text-primary);
    max-width: 600px;
}

/* Projects Section Refactored for Flying Tags */
.projects {
    margin-bottom: 6rem;
}

.projects h2 {
    font-size: 24px;
    margin-bottom: 2rem;
}

.project-grid {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 2.5rem; /* Increased slightly to make comfortable room for border tags */
}

.project-card {
    position: relative;
    display: block;
    width: 100%;
    aspect-ratio: 1 / 1;
    text-decoration: none;
    overflow: visible; /* ALLOWS TAGS TO EXTEND OUTSIDE THE CARD FRAME */
}

/* Inner wrapper acts as clipping safety context for image and zoom animations */
.card-inner {
    width: 100%;
    height: 100%;
    position: relative;
    border-radius: 32px;
    overflow: hidden;
    border: 1px solid var(--border-color);
}

.card-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-size: cover;
    background-position: center;
    transition: transform 0.6s cubic-bezier(0.16, 1, 0.3, 1);
}

.card-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.1) 0%, rgba(0, 0, 0, 0.7) 100%);
    transition: background 0.4s ease;
    border-radius: 32px;
    z-index: 1;
}

.card-info {
    position: absolute;
    bottom: 0;
    left: 0;
    width: 100%;
    padding: 1.75rem;
    z-index: 2;
    display: flex;
    justify-content: space-between;
    align-items: flex-end;
}

.card-title {
    color: #ffffff;
    font-size: 1.2rem;
    font-weight: bold;
    max-width: 80%;
    line-height: 1.3;
    transition: color 0.3s ease;
}

.project-card .arrow {
    color: #ffffff;
    font-family: var(--font-main);
    opacity: 0.7;
    transform: translate(-3px, 3px);
    transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

/* --- Interactive Border Flying Tag Styles --- */
.fly-tag {
    position: absolute;
    background: #ffffff;
    color: #1e293b;
    font-size: 14px;
    font-weight: bold;
    padding: 4px 10px;
    border-radius: 20px;
    border: 1px solid #cbd5e1;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    z-index: 5;
    opacity: 0; /* Hidden by default */
    pointer-events: none;
    transition: all 0.4s cubic-bezier(0.34, 1.56, 0.64, 1); /* Bouncy spring movement effect */
}

/* Individual boundary coordinate locations hidden resting frames */
.pos-top {
    top: 10px;
    left: 25%;
    transform: translateY(15px) scale(0.8) rotate(-4deg);
}

.pos-left {
    left: 10px;
    top: 45%;
    transform: translateX(15px) scale(0.8) rotate(8deg);
}

.pos-bottom {
    bottom: 12px;
    right: 15px;
    transform: translateY(-15px) scale(0.8) rotate(-6deg);
}

/* Hover triggering system to reveal and animate tags to precise border points */
.project-card:hover .pos-top {
    opacity: 1;
    top: -12px; /* Pulls up sitting precisely on upper boundary line */
    transform: scale(1) rotate(-6deg);
}

.project-card:hover .pos-left {
    opacity: 1;
    left: -22px; /* Pushes left sitting precisely over left boundary line */
    transform: scale(1) rotate(6deg);
}

.project-card:hover .pos-bottom {
    opacity: 1;
    bottom: -10px; /* Pulls down sitting on the baseline edge */
    right: 25px;
    transform: scale(1) rotate(-3deg);
}

/* Generic Hover Card States updates */
.project-card:hover .card-bg {
    transform: scale(1.06);
}

.project-card:hover .card-overlay {
    background: linear-gradient(to bottom, rgba(0, 0, 0, 0.2) 0%, rgba(0, 0, 0, 0.85) 100%);
}

.project-card:hover .card-title {
    color: var(--accent-color);
}

.project-card:hover .arrow {
    opacity: 1;
    color: var(--accent-color);
    transform: translate(0, 0);
}

/* Floating Yellow Note Component */
.paper-note {
    position: fixed;
    bottom: 24px;
    right: 24px;
    background-color: var(--note-yellow);
    padding: 1rem 1.25rem;
    width: 150px;
    border-radius: 2px;
    box-shadow: 2px 4px 12px rgba(0, 0, 0, 0.08);
    transform: rotate(-2deg);
    transition: all 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    z-index: 1000;
    cursor: pointer;
    border: 1px solid rgba(0, 0, 0, 0.03);
}

.note-label {
    font-weight: bold;
    color: #1e293b;
    text-align: center;
    border-bottom: 1px dashed rgba(0, 0, 0, 0.1);
    padding-bottom: 4px;
    font-size: 0.8rem;
}

.note-content {
    display: flex;
    flex-direction: column;
    gap: 8px;
    margin-top: 10px;
    opacity: 0;
    max-height: 0;
    overflow: hidden;
    transition: all 0.4s ease;
}

.note-content a {
    color: #334155;
    text-decoration: none;
    font-size: 0.9rem;
    font-weight: 500;
    transition: color 0.2s ease;
}

.note-content a:hover {
    color: var(--text-primary);
    text-decoration: underline;
}

@media (hover: hover) {
    .paper-note:hover {
        transform: rotate(0deg) scale(1.04);
        width: 190px;
        box-shadow: 4px 8px 20px rgba(0, 0, 0, 0.12);
    }
    .paper-note:hover .note-content {
        opacity: 1;
        max-height: 200px;
    }
}

.paper-note.active {
    transform: rotate(0deg) scale(1.04);
    width: 190px;
    box-shadow: 4px 8px 20px rgba(0, 0, 0, 0.12);
}

.paper-note.active .note-content {
    opacity: 1;
    max-height: 200px;
}

/* Responsive constraints media triggers */
@media screen and (max-width: 768px) {
    main,
    nav {
        width: 85%;
    }
    .paper-note {
        bottom: 16px;
        right: 16px;
    }
}

@media screen and (max-width: 580px) {
    main,
    nav {
        width: 95%;
    }

    .project-grid {
        grid-template-columns: 1fr;
        gap: 2.25rem; /* Generous gap room added so single card vertical stacks don't crowd active tags */
    }

    .project-card {
        width: 100%;
        aspect-ratio: 1 / 1;
    }

    .tag-left {
        left: -10px;
    }
    .tag-right {
        right: -15px;
        bottom: 8px;
    }
    .badge-top {
        right: -10px;
    }

    /* Make tags visible natively on active click states on mobile screens */
    .project-card:active .pos-top {
        opacity: 1;
        top: -12px;
    }
    .project-card:active .pos-left {
        opacity: 1;
        left: -14px;
    }
    .project-card:active .pos-bottom {
        opacity: 1;
        bottom: -10px;
    }
}
