@import url('https://fonts.googleapis.com/css2?family=Didot:wght@400;700&family=Futura:wght@300;400;500&display=swap');

:root {
    --selection-color: #2C3539;
    --text-color: #d7cac3;
    --link-color: #d7cac3;
    --circular-text-color: #d7cac3;
}

::selection {
    background-color: var(--selection-color);
    color: #d7cac3;
}

::-moz-selection {
    background-color: var(--selection-color);
    color: #d7cac3;
}

body {
    margin: 0;
    font-family: 'Futura', sans-serif;
    font-weight: 300;
    color: var(--text-color, #d7cac3);
    background: linear-gradient(135deg, #a6263d 0%, #8a1f32 50%, #a6263d 100%);
    background-size: 400% 400%;
    animation: gradient-shift 20s ease infinite;
    cursor: default;
    overflow-x: hidden;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    position: relative;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

/* Add geometric grid overlay */
body::before {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(255, 255, 255, 0.03) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, rgba(255, 255, 255, 0.03) 1px, transparent 1px);
    background-size: 60px 60px;
    pointer-events: none;
    z-index: 1;
}

body.light-mode {
    background: linear-gradient(135deg, #f0f0f0 0%, #e8e8e8 50%, #f0f0f0 100%);
    background-size: 400% 400%;
    animation: gradient-shift 20s ease infinite;
    color: var(--dynamic-text-color, #333);
}

body.light-mode::before {
    background-image: 
        radial-gradient(circle at 25% 25%, rgba(0, 0, 0, 0.03) 1px, transparent 1px),
        radial-gradient(circle at 75% 75%, rgba(0, 0, 0, 0.03) 1px, transparent 1px);
}

body.light-mode #user-info {
    background: rgba(255, 255, 255, 0.6);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.1);
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.light-mode #user-info a {
    color: var(--text-color, #d7cac3);
    text-decoration: none;
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-shadow: none;
}

body.light-mode #user-info a:hover {
    color: #000;
}

body.light-mode #user-info img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    margin-bottom: 0;
    position: relative;
    z-index: 32;
}

body.light-mode #user-info h1 {
    font-family: 'Didot', serif;
    font-size: 0.7rem;
    margin: 0;
    letter-spacing: 1px;
    font-weight: 400;
    text-transform: uppercase;
    color: #333;
    font-weight: 300;
    position: relative;
}

body.light-mode .circular-text text {
    fill: var(--text-color, #d7cac3);
}

body.light-mode h2 {
    color: #333;
    background: #000;
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: #333;
}

body.light-mode .project-card {
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(0, 0, 0, 0.08);
    color: #333;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.05),
        inset 0 1px 0 rgba(255, 255, 255, 0.8);
}

body.light-mode .project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.6s ease;
    z-index: 1;
    border-radius: inherit;
}

body.light-mode .project-card:hover {
    box-shadow: none;
    border-color: transparent;
}

body.light-mode .project-card:hover::before {
    opacity: 1;
}

body.light-mode .project-info h3 {
    color: #333;
    background: linear-gradient(135deg, #000 0%, #ff006e 30%, #8338ec 70%, #000 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

body.light-mode .project-info p {
    color: rgba(0, 0, 0, 0.7);
}

body.light-mode ::selection {
    background-color: #ccc;
    color: #333;
}

body.light-mode ::-moz-selection {
    background-color: #ccc;
    color: #333;
}

@keyframes felipe-pantone {
    0% { 
        background-position: 0% 50%, 50% 0%, 100% 50%; 
    }
    33% { 
        background-position: 100% 50%, 0% 100%, 0% 0%; 
    }
    66% { 
        background-position: 50% 100%, 100% 50%, 50% 100%; 
    }
    100% { 
        background-position: 0% 50%, 50% 0%, 100% 50%; 
    }
}

@keyframes flip {
  0% { transform: rotateY(0); }
  50% { transform: rotateY(180deg); }
  100% { transform: rotateY(360deg); }
}

@keyframes shake {
  0% { transform: translate(0,0) rotate(0deg); }
  15% { transform: translate(-3px, -3px) rotate(-5deg); }
  30% { transform: translate(3px, 3px) rotate(5deg); }
  45% { transform: translate(-4px, -2px) rotate(-3deg); }
  60% { transform: translate(4px, 2px) rotate(3deg); }
  75% { transform: translate(-1px, -1px) rotate(-2deg); }
  100% { transform: translate(0,0) rotate(0deg); }
}

@keyframes sparkle-fall {
  0% { 
    transform: translateY(0) rotate(0deg) scale(0);
    opacity: 0;
  }
  10% {
    opacity: 0.4;
    transform: translateY(10px) rotate(36deg) scale(1);
  }
  90% {
    opacity: 0.2;
    transform: translateY(120px) rotate(324deg) scale(0.8);
  }
  100% {
    transform: translateY(150px) rotate(360deg) scale(0);
    opacity: 0;
  }
}

@keyframes luxury-glow {
  0%, 100% { 
    box-shadow: 0 0 20px rgba(255, 215, 0, 0.3), 
                0 0 40px rgba(255, 215, 0, 0.1),
                inset 0 0 20px rgba(255, 255, 255, 0.05);
  }
  50% { 
    box-shadow: 0 0 30px rgba(255, 215, 0, 0.5), 
                0 0 60px rgba(255, 215, 0, 0.2),
                inset 0 0 30px rgba(255, 255, 255, 0.1);
  }
}

@keyframes luxury-sparkle-fade {
    0% { 
        transform: scale(0) rotate(0deg);
        opacity: 1;
        filter: blur(0px);
    }
    50% {
        transform: scale(1.5) rotate(180deg);
        opacity: 0.8;
        filter: blur(1px);
    }
    100% {
        transform: scale(0) rotate(360deg);
        opacity: 0;
        filter: blur(2px);
    }
}

@keyframes text-shimmer {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

@keyframes luxury-restore {
  0% { 
    top: -100%;
    opacity: 1;
  }
  100% { 
    top: 100%;
    opacity: 1;
  }
}

@keyframes profile-fall {
  0% {
    transform: translate(-50%, -50%) rotate(0deg);
    opacity: 1;
  }
  100% {
    transform: translate(-50%, calc(-50% + 150vh)) rotate(720deg);
    opacity: 0;
  }
}

@keyframes particle-fall {
    0% {
        transform: translate(0, 0) scale(1);
        opacity: 1;
    }
    100% {
        transform: translate(var(--x-end), var(--y-end)) scale(0);
        opacity: 0;
    }
}

@keyframes eclipse {
  0% {
    opacity: 0;
  }
  20% {
    opacity: 1;
  }
  80% {
    opacity: 1;
  }
  100% {
    opacity: 0;
  }
}

@keyframes eclipse-glow {
  0%, 100% {
    box-shadow: 0 0 0 rgba(255, 255, 255, 0);
  }
  50% {
    box-shadow: 0 0 100px 20px rgba(255, 255, 255, 0.3);
  }
}

@keyframes text-flash {
    0%, 100% {
        fill: var(--circular-text-color, #d7cac3);
    }
    50% {
        fill: var(--circular-text-color, #d7cac3);
        opacity: 0.7;
    }
}

#stars-canvas {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 100vh;
    z-index: 0;
}

#scratch-canvas {
    display: none;
}

#sparkles-container {
  position: fixed;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 10;
}

.luxury-sparkle {
    position: fixed;
    width: 6px;
    height: 6px;
    background: radial-gradient(circle, #a6263d, #355255);
    border-radius: 50%;
    pointer-events: none;
    z-index: 15;
    animation: luxury-sparkle-fade 0.8s ease-out forwards;
}

.sparkle {
    position: absolute;
    width: 4px;
    height: 4px;
    background: radial-gradient(circle, rgba(166, 38, 61, 0.3), rgba(53, 82, 85, 0.2), transparent 70%);
    border-radius: 50%;
    filter: blur(0.5px);
    animation: sparkle-fall 4s ease-out forwards;
    z-index: 11;
    box-shadow: 0 0 8px rgba(215, 202, 195, 0.1);
}

#profile-container {
    position: relative;
    z-index: 2;
    padding: 60px 40px;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    pointer-events: none;
    max-width: 900px;
    margin: 0 auto;
}

#profile-container > * {
    pointer-events: auto;
}

#user-info {
    position: fixed;
    top: 30px;
    left: 30px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    margin-bottom: 0;
    gap: 0;
    background: rgba(255, 255, 255, 0.08);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.12);
    padding: 20px;
    border-radius: 24px;
    width: auto;
    height: auto;
    z-index: 30;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

#user-info > div {
    cursor: pointer;
}

#user-info a {
    text-decoration: none;
    color: var(--text-color, #d7cac3);
    transition: all 0.4s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    text-shadow: none;
}

#user-info a:hover {
    color: #b8aea5;
    text-shadow: 0 0 10px rgba(215, 202, 195, 0.3);
}

#user-info img {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.2);
    margin-bottom: 0;
    position: relative;
    z-index: 32;
    box-shadow: 0 0 20px rgba(255, 255, 255, 0.1);
}

#user-info h1 {
    font-family: 'Didot', serif;
    font-size: 0.7rem;
    margin: 0;
    letter-spacing: 1px;
    font-weight: 400;
    text-transform: uppercase;
    color: #d7cac3;
    font-weight: 300;
    position: relative;
}

.circular-text {
    animation: rotate-text 20s linear infinite;
    transform-origin: center;
    position: absolute;
    left: 50%;
    top: 50%;
    transform: translate(-50%, -50%);
    z-index: 31;
    width: 140px;
    height: 140px;
}

@keyframes rotate-text {
    from { transform: translate(-50%, -50%) rotate(0deg); }
    to { transform: translate(-50%, -50%) rotate(360deg); }
}

.circular-text path {
    fill: none;
}

.circular-text text {
    font-family: 'Didot', serif;
    font-size: 12px;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
    fill: var(--circular-text-color, #d7cac3);
    animation: text-flash 4s ease-in-out infinite;
}

#user-info p {
    display: none;
}

h1, h2, h3 {
    font-family: 'Didot', serif;
    font-weight: 400;
}

h2 {
    font-size: 1.4rem;
    margin-bottom: 40px;
    text-shadow: none;
    text-transform: uppercase;
    letter-spacing: 3px;
    color: #d7cac3;
    font-weight: 300;
    position: relative;
    background: linear-gradient(135deg, currentColor 0%, rgba(255, 255, 255, 0.8) 50%, currentColor 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

h2::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 2px;
    background: linear-gradient(90deg, transparent, currentColor, transparent);
    border-radius: 1px;
}

#projects-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(320px, 1fr));
    gap: 40px;
    width: 100%;
    max-width: 1200px;
    padding: 40px 0;
}

.project-card {
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(20px);
    border: 1px solid rgba(255, 255, 255, 0.1);
    border-radius: 16px;
    overflow: hidden;
    text-decoration: none;
    color: #d7cac3;
    transition: all 0.6s cubic-bezier(0.23, 1, 0.32, 1);
    display: flex;
    flex-direction: column;
    position: relative;
    min-height: 200px;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.1);
}

.project-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0) 0%, 
        rgba(255, 255, 255, 0.05) 50%, 
        rgba(255, 255, 255, 0) 100%);
    opacity: 0;
    transition: opacity 0.6s ease;
    z-index: 1;
    border-radius: inherit;
}

.project-card:hover {
    transform: translateY(-8px);
    box-shadow: 
        0 20px 60px rgba(0, 0, 0, 0.15),
        0 0 0 1px rgba(255, 255, 255, 0.2),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.2);
}

.project-card:hover::before {
    opacity: 1;
}

.project-thumbnail {
    width: 100%;
    height: 200px;
    object-fit: cover;
    background: linear-gradient(135deg, #333, #222);
    position: relative;
    z-index: 2;
}

.project-info {
    padding: 30px;
    flex-grow: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    text-align: center;
    position: relative;
    z-index: 2;
}

.project-info h3 {
    margin: 0;
    font-size: 1.1rem;
    font-family: 'Futura', sans-serif;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 0.5px;
    line-height: 1.4;
    color: #d7cac3;
    transition: all 0.6s ease;
    position: relative;
    background: linear-gradient(135deg, currentColor 0%, rgba(255, 255, 255, 0.9) 50%, currentColor 100%);
    background-clip: text;
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
}

.project-info h3::after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.6), transparent);
    transition: width 0.6s ease;
    border-radius: 0.5px;
}

.project-info p {
    margin: 15px 0 0 0;
    font-size: 0.85rem;
    color: #d7cac3;
    font-family: 'Futura', sans-serif;
    font-weight: 300;
    letter-spacing: 0.3px;
    line-height: 1.6;
}

.luxury-restore-overlay {
  position: fixed;
  top: -100%;
  left: 0;
  width: 100vw;
  height: 200px;
  pointer-events: none;
  z-index: 5;
  background: linear-gradient(to bottom, 
    rgba(0, 0, 0, 0) 0%,
    rgba(0, 0, 0, 1) 20%,
    rgba(0, 0, 0, 1) 80%,
    rgba(0, 0, 0, 0) 100%);
  opacity: 0;
  animation: luxury-restore 3s linear forwards;
}

.profile-picture-container.falling {
  position: fixed;
  top: 50%;
  left: 50%;
  z-index: 20;
  animation: profile-fall 4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
}

.profile-picture-container.falling-particle {
    position: fixed;
    width: 2px;
    height: 2px;
    z-index: 20;
    border-radius: 50%;
    animation: particle-fall 2s ease-out forwards;
}

.profile-picture-container {
    display: inline-block;
    perspective: 1000px;
    transition: transform 0.6s cubic-bezier(0.25, 0.46, 0.45, 0.94);
    padding: 8px;
    border-radius: 50%;
    background: linear-gradient(135deg, 
        rgba(255, 255, 255, 0.2) 0%, 
        rgba(255, 255, 255, 0.05) 50%,
        rgba(255, 255, 255, 0.1) 100%);
    border: 1px solid rgba(255, 255, 255, 0.15);
    position: relative;
    box-shadow: 
        0 8px 32px rgba(0, 0, 0, 0.1),
        inset 0 1px 0 rgba(255, 255, 255, 0.2);
}

.profile-picture-container.eclipsing {
    animation: eclipse-glow 4s ease-in-out;
}

#user-info .profile-avatar {
  transition: opacity 0.3s ease-in-out;
  transform-style: preserve-3d;
  backface-visibility: hidden;
}

.eclipse-overlay {
    position: fixed;
    top: 30px;
    left: 30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    pointer-events: none;
    z-index: 25;
    animation: eclipse 4s cubic-bezier(0.25, 0.46, 0.45, 0.94) forwards;
    opacity: 0;
    background: radial-gradient(circle at center, transparent 30px, rgba(0, 0, 0, 0.95) 45px);
}

/* Add Web3 hexagon decorations */
.web3-decoration {
    position: fixed;
    width: 40px;
    height: 40px;
    border: 1px solid rgba(255, 255, 255, 0.1);
    background: rgba(255, 255, 255, 0.02);
    clip-path: polygon(50% 0%, 100% 25%, 100% 75%, 50% 100%, 0% 75%, 0% 25%);
    animation: float-decoration 8s ease-in-out infinite;
    pointer-events: none;
    z-index: 2;
}

.web3-decoration:nth-child(1) {
    top: 20%;
    right: 10%;
    animation-delay: 0s;
}

.web3-decoration:nth-child(2) {
    bottom: 30%;
    left: 15%;
    animation-delay: -2s;
    transform: scale(0.7);
}

.web3-decoration:nth-child(3) {
    top: 60%;
    right: 20%;
    animation-delay: -4s;
    transform: scale(1.2);
}

@keyframes float-decoration {
    0%, 100% { 
        transform: translateY(0px) rotate(0deg);
        opacity: 0.3;
    }
    50% { 
        transform: translateY(-20px) rotate(180deg);
        opacity: 0.6;
    }
}

/* Mobile ticker Web3 styling */
@media (max-width: 768px) {
  #user-info {
    position: fixed;
    top: 0;
    left: 0;
    width: 100vw;
    height: 60px;
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    padding: 0 20px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    color: var(--dynamic-bg-color, #99aeda);
    z-index: 30;
    overflow: hidden;
    border-radius: 0;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.1);
  }

  #user-info .profile-picture-container,
  #user-info .circular-text {
    display: none;
  }

  .mobile-ticker {
    display: block;
    white-space: nowrap;
    animation: ticker-scroll 20s linear infinite;
    font-family: 'Didot', serif;
    font-size: 1rem;
    font-weight: 400;
    text-transform: uppercase;
    letter-spacing: 2px;
    color: inherit;
  }

  @keyframes ticker-scroll {
    0% { transform: translateX(100vw); }
    100% { transform: translateX(-100%); }
  }

  /* Adjust profile container for mobile */
  #profile-container {
    padding-top: 120px;
  }
}

/* Hide mobile ticker on desktop */
.mobile-ticker {
  display: none;
}