/* ================================
   merrychristmas.ninja - Christmas Card
   Blue/Silver Winter Theme
   ================================ */

/* Modern CSS Reset */
*,
*::before,
*::after {
    box-sizing: border-box;
    margin: 0;
    padding: 0;
}

:root {
    /* Blue/Silver Christmas Palette */
    --color-bg: #0a1628;
    --color-bg-dark: #060d1a;
    --color-sky-top: #0a1628;
    --color-sky-mid: #0f2035;
    --color-sky-bottom: #1a365d;
    
    /* Accent Colors */
    --color-ice: #60a5fa;
    --color-ice-light: #93c5fd;
    --color-ice-dark: #3b82f6;
    --color-silver: #c0c0c0;
    --color-silver-light: #e8e8e8;
    --color-gold: #d4a04a;
    --color-gold-light: #e8c47a;
    
    /* Text Colors */
    --color-snow: #f8f6f0;
    --color-text: #faf9f7;
    --color-text-muted: rgba(250, 249, 247, 0.7);
    
    /* Typography */
    --font-script: 'Great Vibes', cursive;
    --font-festive: 'Mountains of Christmas', cursive;
    --font-handwritten: 'Caveat', cursive;
    --font-body: 'DM Sans', -apple-system, BlinkMacSystemFont, sans-serif;
    
    /* Transitions */
    --transition-smooth: 0.3s ease;
    --transition-bounce: 0.6s cubic-bezier(0.34, 1.56, 0.64, 1);
}

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

html, body {
    height: 100%;
    overflow-x: hidden;
}

body {
    font-family: var(--font-body);
    background: var(--color-bg);
    color: var(--color-text);
    line-height: 1.6;
    min-height: 100vh;
    min-height: 100dvh;
}

/* ================================
   Scene Background
   ================================ */

.scene-background {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: linear-gradient(
        to bottom,
        var(--color-sky-top) 0%,
        var(--color-sky-mid) 40%,
        var(--color-sky-bottom) 100%
    );
}

/* Stars */
.stars {
    position: absolute;
    inset: 0;
    background-image: 
        radial-gradient(2px 2px at 20% 10%, rgba(255,255,255,0.9) 50%, transparent 50%),
        radial-gradient(2px 2px at 40% 25%, rgba(255,255,255,0.8) 50%, transparent 50%),
        radial-gradient(1px 1px at 60% 5%, rgba(255,255,255,0.7) 50%, transparent 50%),
        radial-gradient(2px 2px at 80% 20%, rgba(255,255,255,0.9) 50%, transparent 50%),
        radial-gradient(1px 1px at 10% 30%, rgba(255,255,255,0.6) 50%, transparent 50%),
        radial-gradient(2px 2px at 70% 35%, rgba(255,255,255,0.8) 50%, transparent 50%),
        radial-gradient(1px 1px at 30% 15%, rgba(255,255,255,0.7) 50%, transparent 50%),
        radial-gradient(2px 2px at 90% 8%, rgba(255,255,255,0.9) 50%, transparent 50%),
        radial-gradient(1px 1px at 50% 40%, rgba(255,255,255,0.5) 50%, transparent 50%),
        radial-gradient(2px 2px at 15% 45%, rgba(255,255,255,0.6) 50%, transparent 50%),
        radial-gradient(1px 1px at 85% 42%, rgba(255,255,255,0.7) 50%, transparent 50%),
        radial-gradient(2px 2px at 25% 8%, rgba(255,255,255,0.8) 50%, transparent 50%);
    animation: twinkle 4s ease-in-out infinite alternate;
}

@keyframes twinkle {
    0% { opacity: 0.7; }
    100% { opacity: 1; }
}

/* Aurora / Northern Lights */
.aurora {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 50%;
    background: linear-gradient(
        180deg,
        transparent 0%,
        rgba(96, 165, 250, 0.05) 20%,
        rgba(59, 130, 246, 0.08) 40%,
        rgba(147, 197, 253, 0.05) 60%,
        transparent 100%
    );
    animation: aurora-pulse 8s ease-in-out infinite;
    pointer-events: none;
}

@keyframes aurora-pulse {
    0%, 100% { opacity: 0.5; transform: translateY(0); }
    50% { opacity: 1; transform: translateY(-20px); }
}

/* String Lights - Blue/Silver themed */
.string-lights {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 60px;
    overflow: hidden;
}

.string-lights::before {
    content: '';
    position: absolute;
    top: 20px;
    left: -5%;
    right: -5%;
    height: 2px;
    background: rgba(0, 0, 0, 0.3);
    border-radius: 50%;
    transform: rotate(-1deg);
}

.light-bulb {
    position: absolute;
    top: 18px;
    width: 12px;
    height: 16px;
    border-radius: 50% 50% 50% 50%;
    animation: glow 2s ease-in-out infinite alternate;
}

.light-bulb::before {
    content: '';
    position: absolute;
    top: -4px;
    left: 50%;
    transform: translateX(-50%);
    width: 4px;
    height: 6px;
    background: #333;
    border-radius: 2px 2px 0 0;
}

/* Blue/Silver light colors */
.light-bulb:nth-child(1) { left: 5%; background: var(--color-ice); animation-delay: 0s; }
.light-bulb:nth-child(2) { left: 15%; background: var(--color-silver-light); animation-delay: 0.3s; }
.light-bulb:nth-child(3) { left: 25%; background: var(--color-ice-light); animation-delay: 0.6s; }
.light-bulb:nth-child(4) { left: 35%; background: #ffffff; animation-delay: 0.9s; }
.light-bulb:nth-child(5) { left: 45%; background: var(--color-ice); animation-delay: 0.2s; }
.light-bulb:nth-child(6) { left: 55%; background: var(--color-silver-light); animation-delay: 0.5s; }
.light-bulb:nth-child(7) { left: 65%; background: var(--color-ice-light); animation-delay: 0.8s; }
.light-bulb:nth-child(8) { left: 75%; background: #ffffff; animation-delay: 0.1s; }
.light-bulb:nth-child(9) { left: 85%; background: var(--color-ice); animation-delay: 0.4s; }
.light-bulb:nth-child(10) { left: 95%; background: var(--color-silver-light); animation-delay: 0.7s; }

@keyframes glow {
    0% { 
        opacity: 0.6;
        box-shadow: 0 0 5px currentColor;
    }
    100% { 
        opacity: 1;
        box-shadow: 0 0 15px currentColor, 0 0 25px currentColor;
    }
}

/* Pine Forest - Blue-tinted */
.pine-forest {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 40%;
    pointer-events: none;
}

.pine-row {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    display: flex;
    justify-content: space-around;
    align-items: flex-end;
    padding: 0 2%;
}

.pine-row-back { bottom: 8%; }
.pine-row-mid { bottom: 3%; }
.pine-row-front { bottom: 0; }

.pine {
    position: relative;
    transform-origin: bottom center;
}

.pine svg {
    display: block;
    filter: drop-shadow(0 2px 4px rgba(0,0,0,0.3));
}

.pine-row-back .pine {
    animation: sway-gentle 8s ease-in-out infinite;
}

.pine-row-back .pine:nth-child(odd) {
    animation-delay: -2s;
}

.pine-row-back .pine svg {
    width: 40px;
    height: 70px;
    opacity: 0.3;
}

.pine-row-mid .pine {
    animation: sway-gentle 6s ease-in-out infinite;
}

.pine-row-mid .pine:nth-child(even) {
    animation-delay: -1.5s;
}

.pine-row-mid .pine svg {
    width: 55px;
    height: 100px;
    opacity: 0.5;
}

.pine-row-front .pine {
    animation: sway-gentle 7s ease-in-out infinite;
}

.pine-row-front .pine:nth-child(odd) {
    animation-delay: -3s;
}

.pine-row-front .pine svg {
    width: 70px;
    height: 130px;
    opacity: 0.7;
}

@keyframes sway-gentle {
    0%, 100% { transform: rotate(-0.5deg); }
    50% { transform: rotate(0.5deg); }
}

/* Snow Ground */
.snow-ground {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 3%;
    background: linear-gradient(
        to bottom,
        transparent 0%,
        rgba(255,255,255,0.08) 100%
    );
}

/* ================================
   Grinch Sleigh Animation
   ================================ */

.grinch-sleigh {
    position: fixed;
    top: 8%;
    left: -300px;
    z-index: 50;
    width: 200px;
    height: auto;
    animation: fly-across 25s linear infinite;
    animation-delay: 5s;
    pointer-events: none;
    filter: drop-shadow(0 8px 16px rgba(0,0,0,0.4));
}

.grinch-sleigh img {
    width: 100%;
    height: auto;
}

@keyframes fly-across {
    0% {
        left: -300px;
        top: 8%;
        transform: scaleX(1);
    }
    10% { top: 5%; }
    20% { top: 10%; }
    30% { top: 6%; }
    45% {
        left: calc(100vw + 300px);
        top: 8%;
        transform: scaleX(1);
    }
    46% {
        left: calc(100vw + 300px);
        top: 8%;
        transform: scaleX(-1);
    }
    55% { top: 6%; }
    65% { top: 11%; }
    75% { top: 5%; }
    85% { top: 9%; }
    100% {
        left: -300px;
        top: 8%;
        transform: scaleX(-1);
    }
}

@media (prefers-reduced-motion: reduce) {
    .grinch-sleigh {
        animation: none;
        display: none;
    }
}

@media (max-width: 768px) {
    .grinch-sleigh {
        width: 120px;
        top: 10%;
    }
}

/* ================================
   Snowfall Animation
   ================================ */

.snowfall {
    position: fixed;
    inset: 0;
    pointer-events: none;
    z-index: 1;
    overflow: hidden;
}

.snowflake {
    position: absolute;
    top: -50px;
    color: rgba(255, 255, 255, 0.8);
    font-size: 1rem;
    text-shadow: 0 0 5px rgba(255, 255, 255, 0.5);
    opacity: 0;
    animation: snowfall linear infinite;
    user-select: none;
}

@keyframes snowfall {
    0% {
        transform: translateY(-50px) translateX(0) rotate(0deg);
        opacity: 0;
    }
    5% {
        opacity: 0.8;
    }
    50% {
        transform: translateY(50vh) translateX(20px) rotate(180deg);
    }
    90% {
        opacity: 0.5;
    }
    100% {
        transform: translateY(100vh) translateX(-10px) rotate(360deg);
        opacity: 0;
    }
}

/* Snowflake positions and speeds */
.snowflake:nth-child(1) { left: 3%; animation-duration: 10s; animation-delay: 0s; font-size: 0.8rem; }
.snowflake:nth-child(2) { left: 10%; animation-duration: 12s; animation-delay: 1s; font-size: 1.2rem; }
.snowflake:nth-child(3) { left: 18%; animation-duration: 8s; animation-delay: 2s; font-size: 0.6rem; }
.snowflake:nth-child(4) { left: 25%; animation-duration: 14s; animation-delay: 0.5s; font-size: 1rem; }
.snowflake:nth-child(5) { left: 33%; animation-duration: 9s; animation-delay: 3s; font-size: 0.9rem; }
.snowflake:nth-child(6) { left: 42%; animation-duration: 11s; animation-delay: 1.5s; font-size: 1.1rem; }
.snowflake:nth-child(7) { left: 52%; animation-duration: 13s; animation-delay: 2.5s; font-size: 0.7rem; }
.snowflake:nth-child(8) { left: 62%; animation-duration: 10s; animation-delay: 4s; font-size: 1rem; }
.snowflake:nth-child(9) { left: 72%; animation-duration: 15s; animation-delay: 0.8s; font-size: 0.8rem; }
.snowflake:nth-child(10) { left: 80%; animation-duration: 7s; animation-delay: 3.5s; font-size: 1.3rem; }
.snowflake:nth-child(11) { left: 88%; animation-duration: 11s; animation-delay: 1.2s; font-size: 0.9rem; }
.snowflake:nth-child(12) { left: 95%; animation-duration: 9s; animation-delay: 2.8s; font-size: 1.1rem; }
.snowflake:nth-child(13) { left: 7%; animation-duration: 13s; animation-delay: 4.2s; font-size: 0.7rem; }
.snowflake:nth-child(14) { left: 47%; animation-duration: 10s; animation-delay: 0.3s; font-size: 1.2rem; }
.snowflake:nth-child(15) { left: 67%; animation-duration: 12s; animation-delay: 1.8s; font-size: 0.8rem; }

/* ================================
   Main Content
   ================================ */

.main-content {
    min-height: 100vh;
    min-height: 100dvh;
    position: relative;
    z-index: 2;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    padding: 2rem;
}

/* Card Hero Section */
.card-hero {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    max-width: 600px;
    width: 100%;
}

/* Greeting */
.greeting-line {
    font-family: var(--font-script);
    font-size: clamp(3rem, 12vw, 6rem);
    color: var(--color-snow);
    margin-bottom: 0;
    text-shadow: 
        2px 2px 4px rgba(0, 0, 0, 0.5),
        0 0 40px rgba(96, 165, 250, 0.3);
    animation: fade-in-up 1s ease-out;
}

.greeting-subtitle {
    font-family: var(--font-festive);
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    color: var(--color-ice-light);
    margin-bottom: 2rem;
    text-shadow: 1px 1px 2px rgba(0, 0, 0, 0.5);
    animation: fade-in-up 1s ease-out 0.2s both;
}

/* Photo Frame - Elegant Gold Border */
.photo-frame {
    position: relative;
    background: linear-gradient(
        135deg,
        var(--color-gold) 0%,
        var(--color-gold-light) 25%,
        var(--color-gold) 50%,
        #b8860b 75%,
        var(--color-gold) 100%
    );
    padding: 8px;
    border-radius: 6px;
    box-shadow: 
        0 10px 40px rgba(0, 0, 0, 0.4),
        0 0 60px rgba(212, 160, 74, 0.2),
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2);
    max-width: 350px;
    width: 100%;
    margin-bottom: 2rem;
    animation: fade-in-up 1s ease-out 0.4s both;
}

/* Inner frame for depth effect */
.photo-frame::before {
    content: '';
    position: absolute;
    inset: 6px;
    border: 2px solid rgba(255, 255, 255, 0.3);
    border-radius: 4px;
    pointer-events: none;
    z-index: 5;
}

/* Hide the corner elements - using full border now */
.frame-corner {
    display: none;
}

.card-photo {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 2px;
}

/* Signature */
.card-signature {
    animation: fade-in-up 1s ease-out 0.6s both;
}

.from-line {
    font-family: var(--font-handwritten);
    font-size: 1.5rem;
    color: var(--color-text-muted);
    margin-bottom: 0.25rem;
}

.family-name {
    font-family: var(--font-script);
    font-size: clamp(2.5rem, 8vw, 4rem);
    color: var(--color-gold);
    text-shadow: 2px 2px 4px rgba(0, 0, 0, 0.5);
    margin-bottom: 0.5rem;
}

.year-line {
    font-family: var(--font-festive);
    font-size: 1.5rem;
    color: var(--color-ice-light);
    letter-spacing: 0.2em;
}

/* Animations */
@keyframes fade-in-up {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ================================
   Footer
   ================================ */

.card-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 1rem 2rem;
    text-align: center;
    z-index: 10;
    background: linear-gradient(
        to top,
        rgba(10, 22, 40, 0.9) 0%,
        transparent 100%
    );
}

.card-footer p {
    font-family: var(--font-handwritten);
    font-size: 1.1rem;
    color: var(--color-text-muted);
}

/* ================================
   Responsive Design
   ================================ */

@media (max-width: 768px) {
    .main-content {
        padding: 1.5rem;
        padding-top: 80px;
    }
    
    .photo-frame {
        max-width: 300px;
        padding: 6px;
    }
    
    .string-lights {
        height: 50px;
    }
    
    .light-bulb {
        width: 10px;
        height: 14px;
    }
    
    .pine-row-back .pine svg {
        width: 30px;
        height: 55px;
    }
    
    .pine-row-mid .pine svg {
        width: 40px;
        height: 75px;
    }
    
    .pine-row-front .pine svg {
        width: 50px;
        height: 95px;
    }
}

@media (max-width: 480px) {
    .main-content {
        padding: 1rem;
        padding-top: 60px;
    }
    
    .photo-frame {
        max-width: 280px;
        padding: 8px;
    }
    
    .from-line {
        font-size: 1.25rem;
    }
    
    .card-footer p {
        font-size: 0.9rem;
    }
}

/* ================================
   Accessibility
   ================================ */

@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .snowflake {
        display: none;
    }
}

/* High contrast mode */
@media (prefers-contrast: high) {
    .photo-frame {
        border: 2px solid white;
    }
}

/* ================================
   Print Styles
   ================================ */

@media print {
    body {
        background: white;
    }
    
    .snowfall,
    .scene-background,
    .grinch-sleigh,
    .string-lights,
    .card-footer {
        display: none !important;
    }
    
    .main-content {
        min-height: auto;
    }
    
    .greeting-line,
    .family-name {
        color: #1a365d;
        text-shadow: none;
    }
}

