:root {
    --menu-size: min(85vw, 85vh, 450px);
    --circle-size: calc(var(--menu-size) * 0.32);
    --path-size: calc(var(--menu-size) * 0.8);
    --item-size: calc(var(--menu-size) * 0.32);
    --icon-size: calc(var(--item-size) * 0.3);
    --label-size: calc(var(--item-size) * 0.12);
    --arrow-size: calc(var(--menu-size) * 0.12);
    --arrow-font-size: calc(var(--arrow-size) * 0.47);
    --primary-color: rgb(125, 234, 176);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: transparent;
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow-x: hidden;
}

#matrixButton {
    position: fixed;
    top: 20px;
    right: 20px;
    z-index: 10;
    padding: 10px 20px;
    border: 1px solid #0f0;
    background: rgba(0, 0, 0, 0.6);
    color: #0f0;
    font-family: 'Consolas', monospace;
    font-size: 14px;
    letter-spacing: 2px;
    cursor: pointer;
    border-radius: 8px;
    transition: all 0.3s ease;
}

#matrixButton:hover {
    background: rgba(0, 255, 0, 0.2);
    box-shadow: 0 0 10px #0f0;
    transform: scale(1.05);
}

#matrixButton.active {
    background: rgba(0, 255, 0, 0.5);
    box-shadow: 0 0 20px #0f0;
}

.container {
    width: 100%;
    max-width: 1200px;
    padding: 20px;
    position: relative;
    flex-direction: column;
    align-items: center;
    min-height: 100vh;
}

.menu-container {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: var(--menu-size);
    height: var(--menu-size);
    transition: all 0.5s ease;
    max-width: 90vw;
    max-height: 90vh;
}

.menu-container.hidden {
    opacity: 0;
    transform: scale(0.8);
    pointer-events: none;
    display: none;
}

.center-circle {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: var(--circle-size);
    height: var(--circle-size);
    background: rgb(15, 23, 42);
    border: 2px solid rgb(125, 234, 176);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: calc(var(--circle-size) * 0.16);
    font-weight: bold;
    color: rgb(125, 234, 176);
    box-shadow: 0 0 20px rgba(125, 234, 176, 0.3);
    z-index: 10;
}

.center-circle img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
    display: block;
}

.circular-path {
    position: absolute;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    width: var(--path-size);
    height: var(--path-size);
    border: 1px dashed rgba(125, 234, 176, 0.3);
    border-radius: 50%;
}

.menu-item {
    position: absolute;
    width: var(--item-size);
    height: var(--item-size);
    background: rgb(15, 23, 42);
    border: 2px solid rgb(125, 234, 176);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    cursor: grab;
    transition: all 0.3s ease;
    box-shadow: 0 0 15px rgba(125, 234, 176, 0.2);
    top: 50%;
    left: 50%;
    -webkit-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
    -webkit-tap-highlight-color: transparent;
    touch-action: none;
    min-width: 90px;
    min-height: 90px;
}

.menu-item:active {
    cursor: grabbing;
}

.menu-item:hover {
    transform: scale(1.1);
    box-shadow: 0 0 30px rgba(125, 234, 176, 0.5);
    border-color: rgb(125, 234, 176);
    background: rgb(15, 23, 42);
}

.menu-item .label {
    font-size: var(--label-size);
    font-weight: 600;
    color: var(--primary-color);
    text-align: center;
    margin-bottom: calc(var(--item-size) * 0.07);
    line-height: 1.2;
    pointer-events: none;
}

.menu-item .icon {
    font-size: var(--icon-size);
    margin-top: calc(var(--item-size) * 0.02);
    pointer-events: none;
    filter: grayscale(1) brightness(0) invert(1);
    opacity: 0.9;
    display: flex;
    align-items: center;
    justify-content: center;
}

.content-view {
    display: none;
    animation: fadeIn 0.5s ease;
    width: 100%;
    position: relative;
}

.content-view.active {
    display: block;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.back-button {
    background: rgb(15, 23, 42);
    color: rgb(125, 234, 176);
    border: 2px solid rgb(125, 234, 176);
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 30px;
    box-shadow: 0 0 15px rgba(125, 234, 176, 0.2);
    transition: all 0.3s ease;
}

.back-button:hover {
    transform: translateY(-2px);
    box-shadow: 0 0 25px rgba(125, 234, 176, 0.5);
    background: rgba(125, 234, 176, 0.05);
}

.content-header {
    text-align: center;
    margin-bottom: 40px;
}

.content-header h1 {
    color: var(--primary-color);
    font-size: clamp(28px, 5vw, 42px);
    margin-bottom: 10px;
    text-shadow: 0 0 20px rgba(125, 234, 176, 0.3);
}

/* Flexbox fallback for older browsers */
.items-grid {
    display: flex;
    flex-wrap: wrap;
    gap: 25px;
    max-width: 1000px;
    margin: 0 auto;
    justify-content: center;
}

.items-grid > * {
    flex: 1 1 calc(50% - 12.5px);
    min-width: 0;
}

/* Modern grid for supported browsers */
@supports (display: grid) {
    .items-grid {
        display: grid;
        grid-template-columns: repeat(auto-fit, minmax(350px, 1fr));
        max-width: 800px;
        margin: 0 auto;
    }

    .items-grid > * {
        flex: none;
    }
}

.item-card {
    background: transparent;
    border: 2px solid rgb(125, 234, 176);
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 0 15px rgba(125, 234, 176, 0.2);
    transition: all 0.3s ease;
}

.item-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 0 30px rgba(125, 234, 176, 0.4);
    background: rgba(125, 234, 176, 0.02);
}

.item-tag {
    display: inline-block;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 600;
    text-transform: uppercase;
    margin-bottom: 15px;
    border: 1px solid #7deab0;
    color: #7deab0;
    background: transparent;
}

.item-tag.project {
    border-color: #7deab0;
}

.item-tag.experience {
    border-color: rgba(125, 234, 176, 0.6);
}

.item-card .item-title {
    font-size: 22px;
    font-weight: 700;
    color: #7deab0;
    margin-bottom: 12px;
}

.item-tagdescription {
    color: #7deab0;
    line-height: 1.6;
    margin-bottom: 15px;
    font-weight: bold;
}

.item-description {
    color: rgba(125, 234, 176, 0.8);
    line-height: 1.6;
    margin-bottom: 15px;
}

.item-tagrole {
    color: #7deab0;
    line-height: 1.6;
    margin-bottom: 15px;
    font-weight: bold;
}

.item-role {
    color: rgba(125, 234, 176, 0.8);
    line-height: 1.6;
    margin-bottom: 15px;
}

.item-link {
    display: inline-block;
    color: rgb(125, 234, 176);
    text-decoration: none;
    font-weight: 600;
    transition: all 0.3s ease;
    border-bottom: 1px solid transparent;
}

.item-link:hover {
    border-bottom: 1px solid rgb(125, 234, 176);
    text-shadow: 0 0 10px rgba(125, 234, 176, 0.5);
}

#matrixCanvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgb(15, 23, 42);
    z-index: -1;
}

/* Mobile adjustments */
@media (max-width: 768px) {
    .items-grid > * {
        flex: 1 1 100%;
    }

    @supports (display: grid) {
        .items-grid {
            grid-template-columns: 1fr;
        }
    }

    .item-card {
        padding: 20px;
    }
}

@media (max-width: 480px) {
    :root {
        --menu-size: min(90vw, 90vh, 400px);
        --item-size: calc(var(--menu-size) * 0.34);
    }

    .menu-item {
        min-width: 100px;
        min-height: 100px;
    }

    body {
        padding: 10px;
    }

    .container {
        padding: 10px;
    }

    .back-button {
        padding: 10px 24px;
        font-size: 14px;
    }

    .item-card {
        padding: 18px;
    }

    .item-title {
        font-size: 20px;
    }

    .item-description {
        font-size: 14px;
    }
}

/* Landscape mobile optimization */
@media (max-width: 768px) and (orientation: landscape) {
    :root {
        --menu-size: min(85vw, 65vh, 450px);
    }

    body {
        align-items: flex-start;
        padding-top: 20px;
    }

    .menu-container {
        margin-top: 30px;
    }
}