/* =============================================
   DIGITAL CARD - Style Sheet
   Design: Mobile-First, Dark Matte, Swiss Style
   ============================================= */

/* =============================================
   BASE RESET & SETUP
   ============================================= */

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

html {
    font-size: 16px;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body {
    font-family: var(--font-sans);
    background-color: var(--bg-primary);
    color: var(--text-primary);
    min-height: 100vh;
    min-height: 100dvh; /* Dynamic viewport height for mobile */
    overflow: hidden;
}

/* =============================================
   CARD CONTAINER
   ============================================= */

.card {
    position: relative;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    min-height: 100vh;
    min-height: 100dvh;
    padding: var(--space-md);
    overflow: hidden;
}

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

.card__bg {
    position: absolute;
    inset: 0;
    pointer-events: none;
    z-index: 0;
}

.card__glow {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    opacity: 0.15;
    animation: glow-pulse 8s ease-in-out infinite;
}

.card__glow--1 {
    width: 300px;
    height: 300px;
    background: radial-gradient(circle, var(--color-gray-500) 0%, transparent 70%);
    top: -100px;
    right: -100px;
    animation-delay: 0s;
}

.card__glow--2 {
    width: 250px;
    height: 250px;
    background: radial-gradient(circle, var(--color-gray-600, #444) 0%, transparent 70%);
    bottom: -80px;
    left: -80px;
    animation-delay: 4s;
}

@keyframes glow-pulse {
    0%, 100% {
        opacity: 0.1;
        transform: scale(1);
    }
    50% {
        opacity: 0.2;
        transform: scale(1.1);
    }
}

/* =============================================
   CONTENT WRAPPER
   ============================================= */

.card__content {
    position: relative;
    z-index: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 400px;
    width: 100%;
}

/* =============================================
   NAME
   ============================================= */

.card__header {
    margin-bottom: var(--space-sm);
}

.card__name {
    font-size: clamp(2.5rem, 10vw, 4rem);
    font-weight: var(--font-weight-black);
    line-height: var(--line-height-tight);
    letter-spacing: var(--letter-spacing-tight);
    text-transform: uppercase;
}

.card__name-line {
    display: block;
    opacity: 0;
    transform: translateY(30px);
    animation: slide-up 0.8s cubic-bezier(0.16, 1, 0.3, 1) forwards;
}

.card__name-line:nth-child(1) {
    animation-delay: 0.1s;
}

.card__name-line:nth-child(2) {
    animation-delay: 0.25s;
    color: var(--text-secondary);
}

@keyframes slide-up {
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* =============================================
   TITLE (Typing Effect)
   ============================================= */

.card__title-wrapper {
    min-height: 2rem;
    margin-bottom: var(--space-sm);
    opacity: 0;
    animation: fade-in 0.5s ease forwards;
    animation-delay: 0.6s;
}

.card__title {
    font-family: var(--font-mono);
    font-size: var(--font-size-sm);
    color: var(--text-secondary);
    letter-spacing: var(--letter-spacing-wide);
    text-transform: uppercase;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 2px;
}

.card__title-text {
    color: var(--accent-color);
}

.card__cursor {
    color: var(--accent-color);
    animation: blink 1s step-end infinite;
    font-weight: var(--font-weight-regular);
}

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

@keyframes fade-in {
    to {
        opacity: 1;
    }
}

/* =============================================
   TAGLINE
   ============================================= */

.card__tagline {
    font-size: var(--font-size-sm);
    color: var(--text-muted);
    line-height: var(--line-height-relaxed);
    margin-bottom: var(--space-md);
    max-width: 320px;
    opacity: 0;
    transform: translateY(20px);
    animation: slide-up 0.6s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 0.8s;
}

.card__tagline-highlight {
    display: block;
    margin-top: 0.5rem;
    color: var(--text-secondary);
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    letter-spacing: var(--letter-spacing-wide);
}

/* =============================================
   SOCIAL LINKS
   ============================================= */

.card__social {
    display: flex;
    gap: var(--space-sm);
    margin-bottom: var(--space-md);
    opacity: 0;
    animation: fade-in 0.5s ease forwards;
    animation-delay: 1s;
}

.card__link {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background-color: var(--bg-tertiary);
    border: 1px solid var(--border-color);
    color: var(--text-secondary);
    font-size: 1.25rem;
    text-decoration: none;
    transition: 
        transform var(--transition-fast),
        background-color var(--transition-fast),
        border-color var(--transition-fast),
        color var(--transition-fast),
        box-shadow var(--transition-fast);
}

.card__link:hover,
.card__link:focus-visible {
    transform: translateY(-4px) scale(1.05);
    background-color: var(--color-gray-700);
    border-color: var(--border-color-hover);
    color: var(--text-primary);
    box-shadow: 
        0 8px 24px rgba(0, 0, 0, 0.4),
        0 0 0 3px var(--accent-glow);
}

.card__link:focus-visible {
    outline: 2px solid var(--text-primary);
    outline-offset: 2px;
}

.card__link:active {
    transform: translateY(-2px) scale(1.02);
}

/* Staggered animation for social links */
.card__link:nth-child(1) {
    animation: pop-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 1.1s;
    opacity: 0;
}

.card__link:nth-child(2) {
    animation: pop-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 1.2s;
    opacity: 0;
}

.card__link:nth-child(3) {
    animation: pop-in 0.4s cubic-bezier(0.16, 1, 0.3, 1) forwards;
    animation-delay: 1.3s;
    opacity: 0;
}

@keyframes pop-in {
    0% {
        opacity: 0;
        transform: scale(0.5);
    }
    100% {
        opacity: 1;
        transform: scale(1);
    }
}

/* =============================================
   FOOTER / LOCATION
   ============================================= */

.card__footer {
    position: absolute;
    bottom: var(--space-md);
    left: 50%;
    transform: translateX(-50%);
    opacity: 0;
    animation: fade-in 0.5s ease forwards;
    animation-delay: 1.5s;
}

.card__location {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: var(--font-mono);
    font-size: var(--font-size-xs);
    color: var(--text-muted);
    letter-spacing: var(--letter-spacing-wide);
}

.card__location i {
    color: var(--text-secondary);
    font-size: 0.75rem;
}

/* =============================================
   REDUCED MOTION
   ============================================= */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .card__glow {
        animation: none;
        opacity: 0.15;
    }
    
    .card__cursor {
        animation: none;
        opacity: 1;
    }
    
    .card__name-line,
    .card__tagline,
    .card__title-wrapper,
    .card__social,
    .card__link,
    .card__footer {
        opacity: 1;
        transform: none;
    }
}

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

@media (min-width: 768px) {
    .card {
        padding: var(--space-lg);
    }
    
    .card__name {
        font-size: clamp(3rem, 8vw, 5rem);
    }
    
    .card__tagline {
        max-width: 380px;
        font-size: var(--font-size-base);
    }
    
    .card__link {
        width: 64px;
        height: 64px;
        font-size: 1.5rem;
    }
    
    .card__glow--1 {
        width: 400px;
        height: 400px;
    }
    
    .card__glow--2 {
        width: 350px;
        height: 350px;
    }
}

/* =============================================
   RESPONSIVE - DESKTOP
   ============================================= */

@media (min-width: 1024px) {
    .card__content {
        max-width: 500px;
    }
    
    .card__name {
        font-size: 5rem;
    }
    
    .card__tagline {
        max-width: 420px;
    }
    
    .card__social {
        gap: var(--space-md);
    }
    
    .card__link {
        width: 72px;
        height: 72px;
        font-size: 1.75rem;
    }
}

/* =============================================
   LANDSCAPE ORIENTATION (Mobile)
   ============================================= */

@media (max-height: 500px) and (orientation: landscape) {
    .card {
        padding: var(--space-sm);
    }
    
    .card__name {
        font-size: clamp(1.5rem, 8vh, 2.5rem);
    }
    
    .card__header {
        margin-bottom: var(--space-xs);
    }
    
    .card__title-wrapper {
        min-height: 1.5rem;
        margin-bottom: var(--space-xs);
    }
    
    .card__tagline {
        font-size: var(--font-size-xs);
        margin-bottom: var(--space-sm);
    }
    
    .card__tagline-highlight {
        display: none;
    }
    
    .card__link {
        width: 44px;
        height: 44px;
        font-size: 1rem;
    }
    
    .card__footer {
        bottom: var(--space-xs);
    }
}

/* =============================================
   SAFE AREA (iOS Notch)
   ============================================= */

@supports (padding: max(0px)) {
    .card {
        padding-top: max(var(--space-md), env(safe-area-inset-top));
        padding-bottom: max(var(--space-md), env(safe-area-inset-bottom));
        padding-left: max(var(--space-md), env(safe-area-inset-left));
        padding-right: max(var(--space-md), env(safe-area-inset-right));
    }
    
    .card__footer {
        bottom: max(var(--space-md), env(safe-area-inset-bottom));
    }
}

/* =============================================
   HIGH CONTRAST MODE
   ============================================= */

@media (prefers-contrast: high) {
    .card__link {
        border-width: 2px;
    }
    
    .card__name-line:nth-child(2) {
        color: var(--text-primary);
    }
    
    .card__tagline,
    .card__location {
        color: var(--text-secondary);
    }
}

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

@media print {
    .card {
        background: white;
        color: black;
    }
    
    .card__bg {
        display: none;
    }
    
    .card__name,
    .card__title-text,
    .card__tagline,
    .card__location {
        color: black;
    }
    
    .card__link {
        background: none;
        border: 1px solid black;
        color: black;
    }
}
