:root {
    --bg-color: #0d0d0d;
    --text-primary: #ededed;
    --text-secondary: #888888;
    --card-bg: rgba(255, 255, 255, 0.04);
    --card-hover: rgba(255, 255, 255, 0.08);
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: 'Raleway', -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--bg-color);
    background-image: radial-gradient(rgba(255, 255, 255, 0.08) 1px, transparent 1px);
    background-size: 24px 24px;
    background-position: 0 0;
    background-attachment: fixed;
    color: var(--text-primary);
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    min-height: 100vh;
    padding: 100px 24px;
}

.container {
    max-width: 400px;
    width: 100%;
    position: relative;
}

/* Technical Corner Accents */
.corner {
    position: absolute;
    width: 11px;
    height: 11px;
    opacity: 0.35;
    pointer-events: none;
}
.corner::before,
.corner::after {
    content: '';
    position: absolute;
    background-color: var(--text-secondary);
}
.corner::before {
    top: 50%;
    left: 0;
    width: 100%;
    height: 1px;
    transform: translateY(-50%);
}
.corner::after {
    top: 0;
    left: 50%;
    width: 1px;
    height: 100%;
    transform: translateX(-50%);
}

.corner-tl { top: -48px; left: -32px; }
.corner-tr { top: -48px; right: -32px; }
.corner-bl { bottom: -48px; left: -32px; }
.corner-br { bottom: -48px; right: -32px; }

@media (max-width: 600px) {
    .corner-tl { left: -12px; }
    .corner-tr { right: -12px; }
    .corner-bl { left: -12px; }
    .corner-br { right: -12px; }
}

.header {
    margin-bottom: 64px;
}

/* Profile Intro */
.profile-intro {
    display: flex;
    align-items: center;
    gap: 20px;
    line-height: 1.2;
    margin-bottom: 32px;
}

.profile-avatar {
    width: 56px;
    height: 56px;
    border-radius: 4px;
    object-fit: cover;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.5);
    background-color: #888888;
}

.profile-name {
    color: var(--text-primary);
    font-size: 28px;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.profile-role {
    color: var(--text-secondary);
    font-size: 16px;
    font-weight: 400;
    margin-top: 4px;
}

.location-badge {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 13px;
    color: var(--text-secondary);
    margin-top: 32px;
    opacity: 0.6;
}

.location-badge svg {
    opacity: 0.9;
}

.bio p {
    font-size: 15px;
    margin-bottom: 24px;
    color: var(--text-primary);
    line-height: 1.8;
    letter-spacing: 0.01em;
}

.bio p.secondary-text {
    color: var(--text-secondary);
}

.projects {
    display: flex;
    flex-direction: column;
    gap: 32px;
}

.projects-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    margin-bottom: -16px;
}

.project-separator {
    width: 32px;
    height: 1px;
    background-color: rgba(255, 255, 255, 0.15);
}

.project-card {
    display: flex;
    flex-direction: column;
    padding: 0;
    background-color: transparent;
    text-decoration: none;
    color: inherit;
    transition: opacity 0.2s ease, transform 0.2s ease;
    gap: 12px;
}

.project-card:hover {
    opacity: 0.6;
    transform: translateX(4px);
}

.project-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    width: 100%;
}

.project-name {
    font-size: 15px;
    font-weight: 600;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 12px;
}

.project-icon-mini {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
}

.project-icon-mini svg {
    width: 100%;
    height: 100%;
}

.project-desc {
    font-size: 15px;
    color: var(--text-secondary);
    line-height: 1.6;
}

.project-link {
    font-size: 14px;
    color: var(--text-secondary);
    display: flex;
    align-items: center;
    gap: 4px;
}

.project-link.italic {
    font-style: italic;
    opacity: 0.7;
}

@media (max-width: 600px) {
    body {
        padding: 64px 40px 100px 40px;
    }
}

/* Section Labels */
.section-label {
    text-align: right;
    font-size: 12px;
    font-weight: 500;
    color: var(--text-secondary);
    opacity: 0.5;
    letter-spacing: 0.06em;
    margin-bottom: 32px;
}

/* Contact Section */
.contact {
    margin-bottom: 80px;
}

.contact-list {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.contact-item {
    display: flex;
    align-items: center;
    text-decoration: none;
    transition: opacity 0.2s ease;
}

.contact-item:hover {
    opacity: 0.6;
}

.contact-platform {
    font-size: 15px;
    font-weight: 500;
    color: var(--text-primary);
    display: flex;
    align-items: center;
    gap: 6px;
}

.contact-platform svg {
    color: var(--text-secondary);
    opacity: 0.7;
}

.contact-dots {
    flex-grow: 1;
    height: 1px;
    border-bottom: 2px dotted rgba(255, 255, 255, 0.12);
    margin: 0 16px;
    position: relative;
    top: 4px; /* Align dots visually with the text baseline */
}

.contact-username {
    font-size: 14px;
    font-style: italic;
    color: var(--text-secondary);
}

/* Hover Projects Interaction */
.projects {
    margin-bottom: 80px;
}

.projects .section-label {
    margin-bottom: 0;
}

.hover-project-item {
    position: relative;
    padding: 24px 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    text-decoration: none;
    cursor: pointer;
    overflow: visible;
}

.hp-info {
    display: flex;
    flex-direction: column;
    gap: 4px;
    flex: 1;
    position: relative;
    z-index: 10;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hp-meta {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 4px;
    text-align: right;
    position: relative;
    z-index: 10;
    transition: transform 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}

.hover-project-title {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-primary);
    transition: color 0.3s ease;
}

.hp-desc {
    font-size: 13px;
    color: var(--text-secondary);
    line-height: 1.4;
    max-width: 220px;
}

.hover-project-category {
    font-size: 13px;
    color: var(--text-secondary);
}

.hp-year {
    font-size: 13px;
    color: var(--text-secondary);
    opacity: 0.6;
}

.nda-badge {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 9px;
    font-weight: 600;
    color: var(--text-secondary);
    background: rgba(0, 0, 0, 0.03);
    border: 1px solid rgba(0, 0, 0, 0.05);
    padding: 1px 5px;
    border-radius: 3px;
    margin-left: 8px;
    vertical-align: middle;
    letter-spacing: 0.03em;
    opacity: 0.6;
}

/* Image reveal effect - POPOVER STYLE */
.hover-project-img {
    position: absolute;
    left: 50%;
    width: 550px;
    max-width: 90vw;
    height: auto;
    max-height: 80vh;
    object-fit: contain;
    opacity: 0;
    pointer-events: none;
    z-index: 9999;
    border-radius: 8px;
    box-shadow: 0 20px 60px rgba(0,0,0,0.8);
    transition: opacity 0.4s cubic-bezier(0.16, 1, 0.3, 1), transform 0.4s cubic-bezier(0.16, 1, 0.3, 1);
    filter: brightness(0.7) grayscale(10%);
    
    /* Default fallback (centered inside item) */
    top: 50%;
    transform: translate(-50%, -50%) scale(0.95) rotate(-2deg);
}

.hp-img-large {
    width: 700px !important;
}

.hover-project-item:hover .hp-info {
    transform: translateX(12px);
}
.hover-project-item:hover .hp-meta {
    transform: translateX(-12px);
}
.hover-project-item:hover .hover-project-title {
    color: #fff;
}

/* Base hover if no JS classes exist */
.hover-project-item:hover .hover-project-img {
    opacity: 1;
    transform: translate(-50%, -50%) scale(1) rotate(0deg);
}

/* JS Pop Down (when near top of screen) */
.hover-project-item.pop-down .hover-project-img {
    top: 100%;
    bottom: auto;
    transform: translate(-50%, -10px) scale(0.95) rotate(-2deg);
}
.hover-project-item.pop-down:hover .hover-project-img {
    transform: translate(-50%, 16px) scale(1) rotate(0deg);
}

/* JS Pop Up (when near bottom of screen) */
.hover-project-item.pop-up .hover-project-img {
    top: auto;
    bottom: 100%;
    transform: translate(-50%, 10px) scale(0.95) rotate(2deg);
}
.hover-project-item.pop-up:hover .hover-project-img {
    transform: translate(-50%, -16px) scale(1) rotate(0deg);
}

/* Awards Section */
.awards {
    margin-bottom: 80px;
}

.awards-list {
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 16px;
    margin-top: 24px;
}

.award-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    flex: 1;
    opacity: 0.85;
    transition: opacity 0.3s ease;
}

.award-item:hover {
    opacity: 1;
}

.award-icon {
    margin-bottom: 12px;
    display: flex;
    justify-content: center;
    align-items: center;
    height: 48px;
    width: 100%;
}

/* Visual offset centering for asymmetric 3D Red Dot SVG root */
.offset-reddot {
    transform: translate(30%, 6px) scale(0.95);
}

.award-img {
    max-height: 40px;
    max-width: 60px;
    object-fit: contain;
    /* CSS filter: transforms ANY logo to solid white (discards color), and lowers opacity to blend with theme */
    filter: brightness(0) invert(1) opacity(0.5);
    transition: opacity 0.3s ease, filter 0.3s ease;
}

.award-direct {
    max-height: 40px;
    max-width: 60px;
    object-fit: contain;
    opacity: 0.5;
    transition: opacity 0.3s ease;
}

/* ------------------------------------- */
/* Figma UI Rulers (Experimental)        */
/* ------------------------------------- */

.figma-ruler-corner {
    position: fixed;
    top: 0; left: 0;
    width: 24px; height: 24px;
    background: #0E0E0E;
    border-right: 1px solid #2A2A2A;
    border-bottom: 1px solid #2A2A2A;
    z-index: 9999;
}

.figma-ruler-top {
    position: fixed;
    top: 0; left: 24px; right: 0;
    height: 24px;
    background-color: #0E0E0E;
    border-bottom: 1px solid #2A2A2A;
    z-index: 9998;
    background-image: 
        repeating-linear-gradient(to right, #666 0px, #666 1px, transparent 1px, transparent 100px),
        repeating-linear-gradient(to right, #444 0px, #444 1px, transparent 1px, transparent 50px),
        repeating-linear-gradient(to right, #2A2A2A 0px, #2A2A2A 1px, transparent 1px, transparent 10px);
    background-size: 100% 12px, 100% 8px, 100% 4px;
    background-position: left bottom;
    background-repeat: no-repeat;
}

.figma-ruler-left {
    position: fixed;
    top: 24px; left: 0; bottom: 0;
    width: 24px;
    background-color: #0E0E0E;
    border-right: 1px solid #2A2A2A;
    z-index: 9998;
    background-image: 
        repeating-linear-gradient(to bottom, #666 0px, #666 1px, transparent 1px, transparent 100px),
        repeating-linear-gradient(to bottom, #444 0px, #444 1px, transparent 1px, transparent 50px),
        repeating-linear-gradient(to bottom, #2A2A2A 0px, #2A2A2A 1px, transparent 1px, transparent 10px);
    background-size: 12px 100%, 8px 100%, 4px 100%;
    background-position: right top;
    background-repeat: no-repeat;
}

svg.award-img {
    filter: none;
    color: var(--text-primary);
    opacity: 0.5;
}

.award-item:hover .award-img {
    filter: brightness(0) invert(1) opacity(1);
}

.award-item:hover .award-direct {
    opacity: 1;
}

.award-item:hover svg.award-img {
    opacity: 1;
}

.award-text {
    font-size: 11px;
    color: var(--text-primary);
    line-height: 1.4;
    letter-spacing: 0.02em;
}

@media (max-width: 600px) {
    .awards-list {
        flex-direction: row;
        gap: 8px;
    }
    
    .award-item {
        gap: 8px;
    }
    
    .award-icon {
        height: 32px;
        margin-bottom: 8px;
    }
    
    .award-direct {
        max-height: 24px;
    }
    
    .award-text {
        font-size: 9px;
        letter-spacing: 0;
        line-height: 1.2;
    }
}

/* Footer Section */
.footer {
    text-align: center;
    padding-top: 64px;
    padding-bottom: 24px;
    font-size: 13px;
    color: var(--text-secondary);
    letter-spacing: 0.05em;
    opacity: 0.6;
    transition: opacity 0.3s ease;
    width: 100%;
    max-width: 400px;
    margin-top: auto; /* Push it down perfectly if flex container expands */
}

.footer:hover {
    opacity: 1;
}

/* ------------------------------------- */
/* Bottom Navigation                     */
/* ------------------------------------- */

.bottom-nav {
    position: fixed;
    bottom: 40px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 8px;
    z-index: 1000;
    background: rgba(14, 14, 14, 0.7);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    padding: 6px;
    border-radius: 8px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    box-shadow: 0 0 24px rgba(255, 255, 255, 0.08), inset 0 0 12px rgba(255, 255, 255, 0.03);
    transition: box-shadow 0.3s ease;
    view-transition-name: bottom-nav;
}

.bottom-nav:hover {
    box-shadow: 0 0 32px rgba(255, 255, 255, 0.12), inset 0 0 16px rgba(255, 255, 255, 0.05);
}

.nav-btn {
    width: 40px;
    height: 40px;
    display: flex;
    align-items: center;
    justify-content: center;
    text-decoration: none;
    color: var(--text-secondary);
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
    transition: all 0.3s ease;
    position: relative;
    z-index: 10;
}

.nav-btn:hover {
    color: var(--text-primary);
    background: rgba(255, 255, 255, 0.08); /* slight highlight */
}

.nav-btn.active {
    color: #000;
    /* Background handled by .nav-slider now */
}

.nav-slider {
    position: absolute;
    top: 6px;
    width: 40px;
    height: 40px;
    background: var(--text-primary);
    border-radius: 4px;
    box-shadow: 0 0 12px rgba(255, 255, 255, 0.4);
    z-index: 1;
    transition: transform 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}

/* ------------------------------------- */
/* Initial Loading Screen                */
/* ------------------------------------- */

.preloader {
    position: fixed;
    top: 0; left: 0; right: 0; bottom: 0;
    background-color: var(--bg-color);
    z-index: 999999;
    display: flex;
    justify-content: center;
    align-items: center;
    transition: opacity 0.5s ease, visibility 0.5s;
}

.preloader.hidden {
    opacity: 0;
    visibility: hidden;
}

.preloader-icon {
    font-size: 28px;
    color: var(--text-primary);
    animation: preloaderPulse 1.5s infinite ease-in-out;
}

@keyframes preloaderPulse {
    0% { opacity: 0.3; transform: scale(0.9); }
    50% { opacity: 1; transform: scale(1.1); filter: drop-shadow(0 0 12px rgba(255,255,255,0.4)); }
    100% { opacity: 0.3; transform: scale(0.9); }
}

/* Content Entrance Animation */
.container {
    opacity: 0;
    transform: translateY(12px);
    transition: opacity 0.8s ease, transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}

body.loaded .container {
    opacity: 1;
    transform: translateY(0);
}

/* ------------------------------------- */
/* AI specific UI elements               */
/* ------------------------------------- */

.ai-interface {
    display: flex;
    flex-direction: column;
    align-items: center;
}

@keyframes pulse {
    0% { opacity: 0.4; filter: blur(2px) drop-shadow(0 0 10px rgba(255,255,255,0.2)); transform: scale(0.95); }
    50% { opacity: 1; filter: blur(0px) drop-shadow(0 0 30px rgba(255,255,255,0.6)); transform: scale(1.05); }
    100% { opacity: 0.4; filter: blur(2px) drop-shadow(0 0 10px rgba(255,255,255,0.2)); transform: scale(0.95); }
}

.ai-prompt-box {
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.03);
    border: 1px solid #2A2A2A;
    border-radius: 8px;
    padding: 8px 8px 8px 16px;
    width: 100%;
    max-width: 320px;
    margin: 0 auto;
    transition: border-color 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.ai-prompt-box:focus-within {
    border-color: #555;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: 0 0 20px rgba(255,255,255,0.03);
}

.ai-input {
    flex: 1;
    background: transparent;
    border: none;
    outline: none;
    color: var(--text-primary);
    font-family: inherit;
    font-size: 14px;
}

.ai-input::placeholder {
    color: #666;
}

.ai-submit {
    background: var(--text-primary);
    color: #0E0E0E;
    border: none;
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: opacity 0.3s ease, transform 0.2s ease;
}

.ai-submit:hover {
    opacity: 0.85;
    transform: translateX(2px);
}
