/* ==========================================
   CSS CUSTOM PROPERTIES (Design Tokens)
   ========================================== */

:root {
    /* Color Palette — Warm & Nostalgic */
    --bg-cream: #F5F1E8;
    --bg-card: #FFFEF9;
    --accent-orange: #D97544;
    --accent-green: #4A6B4F;
    --accent-mustard: #D4A644;
    --text-primary: #2C2416;
    --text-secondary: #5A4E3C;
    --text-muted: #8B7E6A;
    
    /* Holographic Gradient */
    --holo-gradient: linear-gradient(
        135deg,
        rgba(217, 117, 68, 0.3) 0%,
        rgba(212, 166, 68, 0.3) 25%,
        rgba(74, 107, 79, 0.3) 50%,
        rgba(212, 166, 68, 0.3) 75%,
        rgba(217, 117, 68, 0.3) 100%
    );
    
    /* Typography */
    --font-header: 'Bebas Neue', 'Arial Black', sans-serif;
    --font-body: 'Work Sans', 'Helvetica Neue', sans-serif;
    --font-mono: 'IBM Plex Mono', 'Courier New', monospace;
    
    /* Spacing */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 1.5rem;
    --space-lg: 2rem;
    --space-xl: 3rem;
    --space-2xl: 4rem;
    
    /* Border Radius */
    --radius-sm: 4px;
    --radius-md: 8px;
    --radius-lg: 12px;
    
    /* Shadows */
    --shadow-card: 0 4px 12px rgba(44, 36, 22, 0.15);
    --shadow-card-hover: 0 8px 24px rgba(44, 36, 22, 0.25);
}

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

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

html {
    font-size: 16px;
    scroll-behavior: smooth;
}

body {
    font-family: var(--font-body);
    background-color: var(--bg-cream);
    color: var(--text-primary);
    line-height: 1.6;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

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

.site-header {
    text-align: center;
    padding: var(--space-xl) var(--space-md);
    background: linear-gradient(180deg, var(--bg-cream) 0%, var(--bg-card) 100%);
}

.header-title {
    font-family: var(--font-header);
    font-size: clamp(2.5rem, 8vw, 4.5rem);
    letter-spacing: 0.05em;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    text-transform: uppercase;
}

.header-subtitle {
    font-family: var(--font-body);
    font-size: clamp(1rem, 2.5vw, 1.25rem);
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-sm);
}

.header-instructions {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--text-muted);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ==========================================
   DECK CONTAINER
   ========================================== */

.deck-container {
    max-width: 1400px;
    margin: 0 auto;
    padding: var(--space-lg) var(--space-md);
}

/* ==========================================
   CORE CARDS SECTION
   ========================================== */

.core-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: var(--space-lg);
    margin-bottom: var(--space-2xl);
}

/* ==========================================
   PERSONALITY CARDS SECTION
   ========================================== */

.personality-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: var(--space-md);
    margin-bottom: var(--space-2xl);
}

/* ==========================================
   CARD BASE STYLES
   ========================================== */

.card {
    perspective: 1000px;
    cursor: pointer;
    position: relative;
}

.card-inner {
    position: relative;
    width: 100%;
    height: 100%;
    transition: transform 0.6s;
    transform-style: preserve-3d;
}

.card.flipped .card-inner {
    transform: rotateY(180deg);
}

.card-front,
.card-back {
    position: absolute;
    width: 100%;
    height: 100%;
    backface-visibility: hidden;
    background: var(--bg-card);
    border-radius: var(--radius-lg);
    box-shadow: var(--shadow-card);
    overflow: hidden;
}

.card:hover .card-front,
.card:hover .card-back {
    box-shadow: var(--shadow-card-hover);
}

.card-back {
    transform: rotateY(180deg);
}

/* Holographic Border Effect */
.card-border {
    position: absolute;
    inset: 0;
    border-radius: var(--radius-lg);
    padding: 3px;
    background: var(--holo-gradient);
    -webkit-mask: linear-gradient(#fff 0 0) content-box, linear-gradient(#fff 0 0);
    -webkit-mask-composite: xor;
    mask-composite: exclude;
    opacity: 0.6;
    transition: opacity 0.3s;
}

.card:hover .card-border {
    opacity: 1;
    animation: shimmer 2s linear infinite;
}

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

/* Card Tilt Effect on Hover */
.card:hover {
    transform: rotateY(2deg) rotateX(-2deg);
    transition: transform 0.3s ease-out;
}

/* ==========================================
   LARGE CARDS (Core Value Props)
   ========================================== */

.card-large {
    min-height: 500px;
}

.card-large .card-content {
    padding: var(--space-lg);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-large .card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: var(--space-md);
}

.card-number {
    font-family: var(--font-mono);
    font-weight: 600;
    font-size: 0.875rem;
    color: var(--text-muted);
}

.card-rarity {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    font-weight: 600;
    color: var(--bg-card);
    background: var(--accent-orange);
    padding: 0.25rem 0.75rem;
    border-radius: var(--radius-sm);
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

.card-title {
    font-family: var(--font-header);
    font-size: clamp(2rem, 5vw, 2.75rem);
    line-height: 1.1;
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.card-tagline {
    font-family: var(--font-body);
    font-size: 1.125rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    font-style: italic;
}

.card-visual {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: var(--space-md) 0;
}

.card-visual svg {
    width: 100%;
    max-width: 200px;
    height: auto;
}

.card-stat {
    display: flex;
    justify-content: space-between;
    align-items: baseline;
    padding: var(--space-sm) 0;
    border-top: 2px solid var(--accent-orange);
    margin-top: auto;
    margin-bottom: var(--space-sm);
}

.stat-label {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    text-transform: uppercase;
    letter-spacing: 0.1em;
    color: var(--text-muted);
}

.stat-value {
    font-family: var(--font-header);
    font-size: 1.5rem;
    color: var(--accent-orange);
}

.card-hint {
    font-family: var(--font-mono);
    font-size: 0.75rem;
    color: var(--text-muted);
    text-align: center;
    text-transform: uppercase;
    letter-spacing: 0.1em;
}

/* ==========================================
   CARD BACK CONTENT (Large Cards)
   ========================================== */

.card-back .card-content {
    padding: var(--space-lg);
    overflow-y: auto;
    height: 100%;
}

.card-description {
    margin-bottom: var(--space-md);
}

.card-description p {
    font-size: 1rem;
    line-height: 1.7;
    color: var(--text-secondary);
}

.proof-points {
    margin-bottom: var(--space-md);
}

.proof-points h3 {
    font-family: var(--font-header);
    font-size: 1.25rem;
    color: var(--accent-green);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.proof-points ul {
    list-style: none;
    padding-left: 0;
}

.proof-points li {
    position: relative;
    padding-left: var(--space-md);
    margin-bottom: var(--space-sm);
    font-size: 0.9375rem;
    line-height: 1.6;
    color: var(--text-secondary);
}

.proof-points li::before {
    content: '→';
    position: absolute;
    left: 0;
    color: var(--accent-orange);
    font-weight: bold;
}

.tech-stack {
    padding: var(--space-sm);
    background: rgba(217, 117, 68, 0.1);
    border-left: 3px solid var(--accent-orange);
    border-radius: var(--radius-sm);
    font-size: 0.875rem;
    margin-bottom: var(--space-md);
}

.tech-stack strong {
    color: var(--accent-orange);
}

/* ==========================================
   SMALL CARDS (Personality)
   ========================================== */

.card-small {
    min-height: 280px;
}

.card-small .card-content {
    padding: var(--space-md);
    display: flex;
    flex-direction: column;
    height: 100%;
}

.card-small .card-header {
    margin-bottom: var(--space-sm);
}

.card-title-small {
    font-family: var(--font-header);
    font-size: 1.75rem;
    line-height: 1.2;
    color: var(--text-primary);
    margin-bottom: var(--space-xs);
    text-transform: uppercase;
    letter-spacing: 0.02em;
}

.card-tagline-small {
    font-family: var(--font-body);
    font-size: 0.9375rem;
    font-weight: 500;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
    font-style: italic;
}

.card-detail {
    font-family: var(--font-mono);
    font-size: 0.875rem;
    color: var(--accent-green);
    padding: var(--space-sm);
    background: rgba(74, 107, 79, 0.1);
    border-radius: var(--radius-sm);
    margin-top: auto;
    margin-bottom: var(--space-sm);
    text-align: center;
}

.card-back-text {
    font-size: 0.9375rem;
    line-height: 1.7;
    color: var(--text-secondary);
    margin-bottom: var(--space-md);
}

.card-philosophy {
    font-size: 0.875rem;
    padding: var(--space-sm);
    background: rgba(212, 166, 68, 0.1);
    border-left: 3px solid var(--accent-mustard);
    border-radius: var(--radius-sm);
    margin-bottom: var(--space-sm);
}

.cta-button {
    margin: var(--space-sm) 0;
}

.cta-button a {
    display: inline-block;
    padding: var(--space-sm) var(--space-md);
    background: var(--accent-orange);
    color: var(--bg-card);
    text-decoration: none;
    border-radius: var(--radius-sm);
    font-weight: 600;
    font-size: 0.9375rem;
    transition: background 0.3s, transform 0.2s;
}

.cta-button a:hover {
    background: var(--accent-green);
    transform: translateY(-2px);
}

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

.site-footer {
    text-align: center;
    padding: var(--space-2xl) var(--space-md);
    background: linear-gradient(180deg, var(--bg-card) 0%, var(--bg-cream) 100%);
}

.footer-title {
    font-family: var(--font-header);
    font-size: clamp(2rem, 6vw, 3rem);
    color: var(--text-primary);
    margin-bottom: var(--space-sm);
    text-transform: uppercase;
    letter-spacing: 0.05em;
}

.footer-text {
    font-size: 1.125rem;
    color: var(--text-secondary);
    margin-bottom: var(--space-lg);
    max-width: 600px;
    margin-left: auto;
    margin-right: auto;
}

.footer-cta {
    display: inline-block;
    padding: var(--space-md) var(--space-xl);
    background: var(--accent-orange);
    color: var(--bg-card);
    text-decoration: none;
    border-radius: var(--radius-md);
    font-family: var(--font-header);
    font-size: 1.5rem;
    letter-spacing: 0.05em;
    text-transform: uppercase;
    transition: background 0.3s, transform 0.2s, box-shadow 0.3s;
    box-shadow: var(--shadow-card);
}

.footer-cta:hover {
    background: var(--accent-green);
    transform: translateY(-4px);
    box-shadow: var(--shadow-card-hover);
}

/* ==========================================
   RESPONSIVE DESIGN
   ========================================== */

/* Tablets */
@media (max-width: 768px) {
    .core-cards {
        grid-template-columns: 1fr;
    }
    
    .personality-cards {
        grid-template-columns: 1fr;
    }
    
    .card-large {
        min-height: 450px;
    }
}

/* Mobile */
@media (max-width: 480px) {
    :root {
        --space-lg: 1.5rem;
        --space-xl: 2rem;
        --space-2xl: 3rem;
    }
    
    .site-header {
        padding: var(--space-lg) var(--space-md);
    }
    
    .card-large {
        min-height: 420px;
    }
    
    .card-small {
        min-height: 260px;
    }
}

/* ==========================================
   ACCESSIBILITY
   ========================================== */

.card:focus {
    outline: 3px solid var(--accent-orange);
    outline-offset: 4px;
}

.card:focus:not(:focus-visible) {
    outline: none;
}

/* Reduced motion preference */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .card:hover {
        transform: none;
    }
}
