/* ============================================
   CSS RESET & BASE STYLES
   ============================================ */

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

:root {
    /* Colors */
    --color-primary-bg: rgba(255, 255, 255, 0.9);
    --color-card-bg: rgba(255, 255, 255, 0.95);
    --color-card-hover-bg: rgba(255, 255, 255, 1);
    --color-text-primary: #000000;
    --color-text-secondary: #333333;
    --color-text-muted: #666666;
    --color-accent: #0066ff;
    
    /* Spacing */
    --spacing-section-gap: 24px;
    --spacing-card-gap: 16px;
    --spacing-card-padding: 20px;
    --spacing-icon-gap: 24px;
    
    /* Typography */
    --font-handwritten: 'Caveat', cursive, sans-serif;
    --font-size-name: 48px;
    --font-size-email: 24px;
    --font-size-card-title: 28px;
    --font-size-card-subtitle: 20px;
    
    /* Shadows */
    --shadow-card: 0 2px 12px rgba(0, 0, 0, 0.08);
    --shadow-card-hover: 0 8px 24px rgba(0, 0, 0, 0.15);
    --shadow-nav: 0 2px 8px rgba(0, 0, 0, 0.06);
    
    /* Border Radius */
    --radius-card: 16px;
    --radius-image: 12px;
    --radius-circle: 50%;
    
    /* Transitions */
    --transition-smooth: all 300ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-quick: all 200ms ease;
    --transition-instant: all 100ms ease;
}

html {
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-handwritten);
    color: var(--color-text-primary);
    min-height: 100vh;
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

/* Support for reduced motion */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
        scroll-behavior: auto !important;
    }
}

/* ============================================
   BACKGROUND
   ============================================ */

.page-background {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    background-size: cover;
    background-position: center;
    transform: translateZ(0);
    will-change: transform;
    -webkit-transform: translateZ(0);
    -webkit-backface-visibility: hidden;
    backface-visibility: hidden;
}

.page-background::after {
    content: '';
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(255, 255, 255, 0.05);
    backdrop-filter: blur(3px);
    -webkit-backdrop-filter: blur(3px);
    transform: translateZ(0);
    will-change: transform;
    -webkit-transform: translateZ(0);
}

/* ============================================
   MAIN CONTAINER
   ============================================ */

.container {
    max-width: 680px;
    margin: 0 auto;
    padding: 24px;
    min-height: 100vh;
    position: relative;
    animation: fadeInUp 600ms ease-out;
}

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

/* ============================================
   TOP NAVIGATION
   ============================================ */

.top-nav {
    position: absolute;
    top: 24px;
    left: 24px;
    right: 24px;
    display: flex;
    justify-content: space-between;
    z-index: 10;
    animation: fadeInUp 600ms ease-out 100ms backwards;
}

.nav-icon-btn {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-circle);
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.18);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: var(--transition-smooth);
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.1);
    color: var(--color-text-primary);
}

.nav-icon-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.12);
}

.nav-icon-btn:active {
    transform: scale(0.98);
}

.nav-icon-btn:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* ============================================
   PROFILE HEADER
   ============================================ */

.profile-header {
    display: flex;
    flex-direction: column;
    align-items: center;
    margin-top: 100px;
    margin-bottom: var(--spacing-section-gap);
    animation: fadeInUp 600ms ease-out 200ms backwards;
}

.avatar-container {
    margin-bottom: 20px;
}

.avatar {
    width: 120px;
    height: 120px;
    border-radius: var(--radius-circle);
    border: 4px solid rgba(255, 255, 255, 0.3);
    object-fit: cover;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.15);
    transition: var(--transition-smooth);
}

.avatar:hover {
    transform: scale(1.05);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.profile-name {
    font-size: var(--font-size-name);
    font-weight: 700;
    letter-spacing: 0.02em;
    text-transform: uppercase;
    color: var(--color-text-primary);
    text-align: center;
    margin-bottom: 24px;
    line-height: 1.2;
    text-shadow: 0 2px 8px rgba(255, 255, 255, 0.5);
}

/* ============================================
   SOCIAL ICONS
   ============================================ */

.social-icons {
    display: flex;
    justify-content: center;
    gap: var(--spacing-icon-gap);
    margin-bottom: 32px;
    flex-wrap: wrap;
}

.social-icon {
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--color-text-primary);
    text-decoration: none;
    transition: var(--transition-quick);
    cursor: pointer;
}

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

.social-icon:hover {
    transform: scale(1.15);
    color: var(--color-accent);
}

.social-icon:active {
    transform: scale(1.05);
}

.social-icon:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
    border-radius: 4px;
}

/* ============================================
   EMAIL DISPLAY
   ============================================ */

.email-display {
    font-size: 32px;
    font-weight: 600;
    color: var(--color-text-primary);
    text-align: center;
    text-decoration: underline;
    text-decoration-thickness: 2px;
    text-underline-offset: 4px;
    transition: var(--transition-smooth);
    cursor: pointer;
}

.email-display:hover {
    color: var(--color-accent);
    transform: translateY(-2px);
}

.email-display:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 4px;
    border-radius: 4px;
}

/* ============================================
   LINKS SECTION
   ============================================ */

.links-section {
    display: flex;
    flex-direction: column;
    gap: var(--spacing-card-gap);
    animation: fadeInUp 600ms ease-out 300ms backwards;
}

/* ============================================
   LINK CARDS - BASE STYLES
   ============================================ */

.link-card {
    background: rgba(255, 255, 255, 0.15);
    backdrop-filter: blur(30px) saturate(180%);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    border-radius: var(--radius-card);
    padding: var(--spacing-card-padding);
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.18);
    cursor: pointer;
    transition: var(--transition-smooth);
    text-decoration: none;
    color: inherit;
    display: block;
    position: relative;
    overflow: hidden;
}

.link-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15);
    background: rgba(255, 255, 255, 0.25);
    border: 1px solid rgba(255, 255, 255, 0.3);
}

.link-card:active {
    transform: translateY(-2px);
}

.link-card:focus-visible {
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* ============================================
   IMAGE SHOWCASE CARD
   ============================================ */

.image-showcase-card {
    padding: 20px;
}

.card-image-container {
    width: 100%;
    border-radius: var(--radius-image);
    overflow: hidden;
    margin-bottom: 16px;
    background: rgba(0, 0, 0, 0.05);
}

.card-image {
    width: 100%;
    height: auto;
    display: block;
    object-fit: cover;
    transition: var(--transition-smooth);
}

.link-card:hover .card-image {
    transform: scale(1.03);
}

.card-image-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
    gap: 8px;
}

.card-image-grid .card-image {
    aspect-ratio: 1/1;
}

/* Hide 5th and 6th portfolio images on desktop */
.card-image-grid .card-image:nth-child(n+5) {
    display: none;
}

.card-title {
    font-size: var(--font-size-card-title);
    font-weight: 600;
    color: var(--color-text-primary);
    text-align: center;
    margin-bottom: 8px;
    line-height: 1.3;
}

.card-subtitle {
    font-size: var(--font-size-card-subtitle);
    font-weight: 400;
    color: var(--color-text-secondary);
    text-align: center;
    line-height: 1.4;
}

/* ============================================
   SIMPLE LINK CARD
   ============================================ */

.simple-link-card {
    display: flex;
    align-items: center;
    gap: 20px;
    padding: 24px;
}

.card-icon {
    width: 56px;
    height: 56px;
    border-radius: var(--radius-circle);
    background: var(--color-text-primary);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: var(--transition-smooth);
}

.card-icon svg {
    width: 32px;
    height: 32px;
}

.link-card:hover .card-icon {
    transform: rotate(5deg) scale(1.05);
}

.card-text {
    flex: 1;
    font-size: 32px;
    font-weight: 600;
    color: var(--color-text-primary);
    text-align: center;
}

/* ============================================
   MORE BUTTON (Three Dots)
   ============================================ */

.more-btn {
    position: absolute;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    width: 32px;
    height: 32px;
    border: none;
    background: transparent;
    color: var(--color-text-muted);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: var(--transition-quick);
    opacity: 0;
}

.link-card:hover .more-btn {
    opacity: 1;
}

.more-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    color: var(--color-text-primary);
}

.more-btn:focus-visible {
    opacity: 1;
    outline: 2px solid var(--color-accent);
    outline-offset: 2px;
}

/* ============================================
   TOAST NOTIFICATION
   ============================================ */

.toast {
    position: fixed;
    bottom: 24px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background: var(--color-text-primary);
    color: #ffffff;
    padding: 16px 24px;
    border-radius: 12px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    font-size: 16px;
    font-weight: 600;
    z-index: 1000;
    opacity: 0;
    transition: var(--transition-smooth);
    max-width: 90%;
    text-align: center;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ============================================
   LOADING STATE
   ============================================ */

.loading-skeleton {
    background: linear-gradient(
        90deg,
        rgba(255, 255, 255, 0.8) 25%,
        rgba(255, 255, 255, 0.95) 50%,
        rgba(255, 255, 255, 0.8) 75%
    );
    background-size: 200% 100%;
    animation: shimmer 1.5s infinite;
}

@keyframes shimmer {
    0% {
        background-position: -200% 0;
    }
    100% {
        background-position: 200% 0;
    }
}

/* ============================================
   RESPONSIVE - MOBILE
   ============================================ */

@media (max-width: 640px) {
    :root {
        --font-size-name: 36px;
        --font-size-email: 18px;
        --font-size-card-title: 22px;
        --font-size-card-subtitle: 18px;
        --spacing-icon-gap: 16px;
    }
    
    .container {
        padding: 16px;
    }
    
    .top-nav {
        top: 16px;
        left: 16px;
        right: 16px;
    }
    
    .nav-icon-btn {
        width: 48px;
        height: 48px;
    }
    
    .nav-icon-btn svg {
        width: 20px;
        height: 20px;
    }
    
    .profile-header {
        margin-top: 80px;
    }
    
    .avatar {
        width: 100px;
        height: 100px;
    }
    
    .social-icon {
        width: 40px;
        height: 40px;
    }
    
    .email-display {
        font-size: 24px;
    }
    
    .link-card {
        padding: 16px;
    }
    
    .simple-link-card {
        padding: 20px 16px;
        gap: 16px;
    }
    
    .card-icon {
        width: 48px;
        height: 48px;
    }
    
    .card-icon svg {
        width: 28px;
        height: 28px;
    }
    
    .card-text {
        font-size: 26px;
    }
    
    .card-image-grid {
        grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
    }
    
    /* Show all 6 portfolio images on mobile */
    .card-image-grid .card-image:nth-child(n+5) {
        display: block;
    }
    
    .more-btn {
        opacity: 1;
    }
}

/* ============================================
   RESPONSIVE - TABLET
   ============================================ */

@media (min-width: 641px) and (max-width: 1024px) {
    .container {
        max-width: 600px;
        padding: 20px;
    }
}

/* ============================================
   STAGGERED ANIMATION FOR CARDS
   ============================================ */

.link-card {
    animation: fadeInUp 600ms ease-out backwards;
}

.link-card:nth-child(1) { animation-delay: 400ms; }
.link-card:nth-child(2) { animation-delay: 500ms; }
.link-card:nth-child(3) { animation-delay: 600ms; }
.link-card:nth-child(4) { animation-delay: 700ms; }
.link-card:nth-child(5) { animation-delay: 800ms; }
.link-card:nth-child(6) { animation-delay: 900ms; }
.link-card:nth-child(7) { animation-delay: 1000ms; }
.link-card:nth-child(8) { animation-delay: 1100ms; }

/* ============================================
   UTILITY CLASSES
   ============================================ */

.visually-hidden {
    position: absolute;
    width: 1px;
    height: 1px;
    margin: -1px;
    padding: 0;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.no-scroll {
    overflow: hidden;
}

/* ============================================
   PRINT STYLES
   ============================================ */

@media print {
    .top-nav,
    .more-btn {
        display: none;
    }
    
    .link-card {
        break-inside: avoid;
        box-shadow: none;
        border: 1px solid #ddd;
    }
    
    .page-background {
        display: none;
    }
    
    body {
        background: white;
    }
}

