/* Performance optimized styles for moongyol */

/* Font Face for PretendardVariable */
@font-face {
    font-family: 'PretendardVariable';
    src: url('PretendardVariable.woff2') format('woff2-variations');
    font-weight: 45 920;
    font-style: normal;
    font-display: swap;
}

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

/* Accessibility Utilities */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
}

.skip-link {
    position: absolute;
    top: -40px;
    left: 6px;
    background: #000;
    color: #fff;
    padding: 8px;
    text-decoration: none;
    z-index: 1000;
    border-radius: 4px;
    font-weight: 600;
}

.skip-link:focus {
    top: 6px;
}

:root {
    --vh: 1vh; /* Will be updated by JavaScript for mobile browsers */
}

body {
    font-family: 'PretendardVariable', -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #0a0a0a;
    color: white;
    overflow-x: hidden;
    line-height: 1.6;
}

/* Touch device optimizations */
.touch-device .floating-elements {
    display: none; /* Hide floating dots on touch devices for better performance */
}

.touch-device .app-preview-placeholder,
.touch-device .web-preview-placeholder {
    transition: transform 0.2s ease; /* Faster transitions on touch */
}

.container {
    min-height: 100vh;
    min-height: calc(var(--vh, 1vh) * 100); /* Mobile browser fix */
    display: flex;
    flex-direction: column;
    position: relative;
}

/* Ensure proper spacing on desktop screens */
@media (min-width: 769px) {
    .container {
        min-height: calc(100vh + 60px); /* Extra height for top padding */
    }
}

.header {
    position: absolute;
    top: 50px;
    left: 60px;
    z-index: 100;
}

.logo {
    font-size: 28px;
    font-weight: 700;
    color: white;
    text-decoration: none;
    display: flex;
    align-items: center;
    transition: opacity 0.3s ease;
}

.logo:hover {
    opacity: 0.8;
}

.logo img {
    height: 44px;
    width: auto;
}

.logo:focus {
    outline: 3px solid #007acc;
    outline-offset: 2px;
    border-radius: 4px;
}

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

.logo:focus-visible {
    outline: 3px solid #007acc;
    outline-offset: 2px;
    border-radius: 4px;
}

.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    justify-content: center;
    padding: 120px 60px 0 60px;
    max-width: 1300px;
    margin: 0 auto;
    width: 100%;
}

.hero-text {
    margin-bottom: 80px;
}

.hero-title {
    font-size: clamp(3.5rem, 7vw, 8rem);
    font-weight: 800;
    line-height: 0.95;
    margin-bottom: 40px;
    letter-spacing: -0.04em;
    animation: slideUp 0.8s ease-out;
    max-width: 900px;
}

.hero-subtitle {
    font-size: clamp(1.3rem, 2.5vw, 2.2rem);
    font-weight: 300;
    color: #b0b0b0; /* Improved contrast from #888 to #b0b0b0 for WCAG AA compliance */
    margin-bottom: 50px;
    max-width: 700px;
    line-height: 1.5;
    animation: slideUp 0.8s ease-out 0.2s both;
}

.cta-button {
    background: white;
    color: #0a0a0a;
    border: none;
    padding: 20px 45px;
    border-radius: 50px;
    font-size: 18px;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: inline-block;
    text-decoration: none;
    width: fit-content;
    animation: slideUp 0.8s ease-out 0.4s both;
    box-shadow: 0 4px 20px rgba(255, 255, 255, 0.15);
}

.cta-button:hover {
    background: #f5f5f5;
    transform: translateY(-3px);
    box-shadow: 0 12px 35px rgba(255, 255, 255, 0.2);
}

.cta-button:focus {
    outline: 3px solid #007acc;
    outline-offset: 2px;
    background: #f0f0f0;
}

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

.cta-button:focus-visible {
    outline: 3px solid #007acc;
    outline-offset: 2px;
}

.showcase-area {
    position: relative;
    width: 100%;
    height: 550px;
    margin-top: 100px;
    display: flex;
    justify-content: center;
    align-items: center;
}

.app-preview-placeholder, .web-preview-placeholder {
    position: absolute;
    border-radius: 20px;
    border: 2px solid #333;
    background: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666;
    font-size: 14px;
    font-weight: 500;
    transition: all 0.3s ease;
}

.app-preview-placeholder:hover, .web-preview-placeholder:hover {
    border-color: #555;
    transform: translateY(-5px);
}

.app-preview-placeholder:focus, .web-preview-placeholder:focus {
    outline: 3px solid #007acc;
    outline-offset: 2px;
    border-color: #007acc;
}

.app-preview-placeholder:focus:not(:focus-visible), 
.web-preview-placeholder:focus:not(:focus-visible) {
    outline: none;
}

.app-preview-placeholder:focus-visible, 
.web-preview-placeholder:focus-visible {
    outline: 3px solid #007acc;
    outline-offset: 2px;
    border-color: #007acc;
}

.app-preview-placeholder {
    width: 280px;
    height: 480px;
    right: 120px;
    top: 40px;
    z-index: 2;
    background: linear-gradient(135deg, #1a1a1a 0%, #2a2a2a 100%);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.4);
}

.web-preview-placeholder {
    width: 450px;
    height: 300px;
    left: 80px;
    top: 130px;
    z-index: 1;
    background: linear-gradient(135deg, #2a2a2a 0%, #1a1a1a 100%);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.3);
}

.floating-elements {
    position: absolute;
    width: 100%;
    height: 100%;
    pointer-events: none;
}

.floating-dot {
    position: absolute;
    width: 4px;
    height: 4px;
    background: #333;
    border-radius: 50%;
    animation: float 6s ease-in-out infinite;
}

.floating-dot:nth-child(1) { 
    top: 20%; 
    left: 10%; 
    animation-delay: 0s; 
}

.floating-dot:nth-child(2) { 
    top: 60%; 
    left: 85%; 
    animation-delay: 2s; 
}

.floating-dot:nth-child(3) { 
    top: 80%; 
    left: 15%; 
    animation-delay: 4s; 
}

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

.gradient-overlay {
    position: absolute;
    bottom: 0;
    left: 0;
    right: 0;
    height: 200px;
    background: linear-gradient(to top, #0a0a0a, transparent);
    pointer-events: none;
}

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

/* Respect user's motion preferences */
@media (prefers-reduced-motion: reduce) {
    *,
    *::before,
    *::after {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .floating-dot {
        animation: none;
    }
    
    .hero-title,
    .hero-subtitle,
    .cta-button {
        animation: none;
        opacity: 1;
        transform: none;
    }
}

/* Enhanced Responsive Design */

/* Large Desktop */
@media (min-width: 1440px) {
    .container {
        max-width: 1800px;
        margin: 0 auto;
    }
    
    .header {
        top: 60px;
        left: 80px;
    }
    
    .logo {
        font-size: 32px;
    }
    
    .logo img {
        height: 48px;
    }
    
    .main-content {
        max-width: 1500px;
        padding: 140px 80px 0 80px;
    }
    
    .hero-text {
        margin-bottom: 100px;
    }
    
    .hero-title {
        font-size: clamp(5rem, 6vw, 9rem);
        margin-bottom: 50px;
        max-width: 1100px;
    }
    
    .hero-subtitle {
        font-size: clamp(1.5rem, 2.2vw, 2.5rem);
        margin-bottom: 60px;
        max-width: 800px;
    }
    
    .cta-button {
        padding: 22px 50px;
        font-size: 20px;
    }
    
    .showcase-area {
        height: 650px;
        margin-top: 120px;
    }
    
    .app-preview-placeholder {
        width: 320px;
        height: 550px;
        right: 150px;
        top: 50px;
    }
    
    .web-preview-placeholder {
        width: 500px;
        height: 350px;
        left: 100px;
        top: 150px;
    }
}

/* Desktop */
@media (min-width: 1200px) and (max-width: 1439px) {
    .header {
        top: 55px;
        left: 70px;
    }
    
    .logo {
        font-size: 26px;
    }
    
    .logo img {
        height: 46px;
    }
    
    .main-content {
        max-width: 1200px;
        padding: 130px 70px 0 70px;
    }
    
    .hero-text {
        margin-bottom: 90px;
    }
    
    .hero-title {
        font-size: clamp(4rem, 6.5vw, 7.5rem);
        margin-bottom: 45px;
        max-width: 1000px;
    }
    
    .hero-subtitle {
        font-size: clamp(1.4rem, 2.3vw, 2.3rem);
        margin-bottom: 55px;
        max-width: 750px;
    }
    
    .cta-button {
        padding: 21px 47px;
        font-size: 19px;
    }
    
    .showcase-area {
        height: 580px;
        margin-top: 110px;
    }
    
    .app-preview-placeholder {
        width: 300px;
        height: 520px;
        right: 130px;
        top: 30px;
    }
    
    .web-preview-placeholder {
        width: 480px;
        height: 320px;
        left: 90px;
        top: 130px;
    }
}

/* Tablet Landscape */
@media (min-width: 1024px) and (max-width: 1199px) {
    .main-content {
        padding: 120px 40px 0 40px;
        max-width: 1000px;
    }
    
    .hero-title {
        font-size: clamp(2.5rem, 6vw, 5rem);
    }
    
    .showcase-area {
        margin-top: 70px;
        height: 450px;
    }
    
    .app-preview-placeholder {
        width: 220px;
        height: 400px;
        right: 80px;
    }
    
    .web-preview-placeholder {
        width: 350px;
        height: 250px;
        left: 40px;
    }
}

/* Tablet Portrait */
@media (min-width: 769px) and (max-width: 1023px) {
    .header {
        top: 30px;
        left: 30px;
    }
    
    .main-content {
        padding: 110px 30px 0 30px;
        max-width: 900px;
    }
    
    .hero-title {
        font-size: clamp(2.2rem, 5vw, 4rem);
        margin-bottom: 25px;
    }
    
    .hero-subtitle {
        font-size: clamp(1rem, 2.5vw, 1.6rem);
        margin-bottom: 35px;
    }
    
    .cta-button {
        padding: 16px 35px;
        font-size: 15px;
    }
    
    .showcase-area {
        margin-top: 60px;
        height: 420px;
    }
    
    .app-preview-placeholder {
        width: 200px;
        height: 380px;
        right: 50px;
        top: 40px;
    }
    
    .web-preview-placeholder {
        width: 320px;
        height: 220px;
        left: 30px;
        top: 100px;
    }
}

/* Large Mobile / Small Tablet */
@media (min-width: 481px) and (max-width: 768px) {
    .header {
        top: 25px;
        left: 25px;
    }
    
    .main-content {
        padding: 0 25px;
        justify-content: flex-start;
        padding-top: 120px;
    }
    
    .hero-text {
        margin-bottom: 50px;
        text-align: center;
    }
    
    .hero-title {
        font-size: clamp(2rem, 6vw, 3.5rem);
        margin-bottom: 20px;
        line-height: 1.1;
    }
    
    .hero-subtitle {
        font-size: clamp(1rem, 3vw, 1.4rem);
        margin-bottom: 30px;
        max-width: 100%;
    }
    
    .cta-button {
        padding: 15px 30px;
        font-size: 14px;
        margin: 0 auto;
        display: block;
        width: fit-content;
    }
    
    .showcase-area {
        height: auto;
        margin-top: 40px;
        flex-direction: column;
        gap: 25px;
        align-items: center;
    }
    
    .app-preview-placeholder,
    .web-preview-placeholder {
        position: static;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
    }
    
    .app-preview-placeholder {
        width: 180px;
        height: 320px;
        order: 1;
    }
    
    .web-preview-placeholder {
        width: 280px;
        height: 180px;
        order: 2;
    }
}

/* Mobile */
@media (max-width: 480px) {
    .header {
        top: 20px;
        left: 20px;
    }
    
    .logo {
        font-size: 20px;
    }
    
    .logo img {
        height: 32px;
    }
    
    .main-content {
        padding: 0 20px;
        justify-content: flex-start;
        padding-top: 100px;
        min-height: 100vh;
        min-height: calc(var(--vh, 1vh) * 100);
    }
    
    .hero-text {
        margin-bottom: 40px;
        text-align: center;
    }
    
    .hero-title {
        font-size: clamp(1.8rem, 8vw, 2.8rem);
        margin-bottom: 18px;
        line-height: 1.2;
        letter-spacing: -0.02em;
    }
    
    .hero-subtitle {
        font-size: clamp(0.9rem, 4vw, 1.2rem);
        margin-bottom: 25px;
        max-width: 100%;
        line-height: 1.5;
    }
    
    .cta-button {
        padding: 14px 28px;
        font-size: 14px;
        margin: 0 auto;
        display: block;
        width: fit-content;
        min-height: 44px; /* Touch target size */
        display: flex;
        align-items: center;
        justify-content: center;
    }
    
    .showcase-area {
        height: auto;
        margin-top: 35px;
        flex-direction: column;
        gap: 20px;
        align-items: center;
        padding-bottom: 40px;
    }
    
    .app-preview-placeholder,
    .web-preview-placeholder {
        position: static;
        box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
        border-width: 1px;
    }
    
    .app-preview-placeholder {
        width: 160px;
        height: 280px;
        order: 1;
        font-size: 12px;
    }
    
    .web-preview-placeholder {
        width: 260px;
        height: 160px;
        order: 2;
        font-size: 12px;
    }
    
    /* Touch optimization */
    .app-preview-placeholder,
    .web-preview-placeholder,
    .cta-button,
    .logo {
        min-height: 44px;
        min-width: 44px;
    }
    
    /* Improve focus visibility on mobile */
    .cta-button:focus,
    .logo:focus,
    .app-preview-placeholder:focus,
    .web-preview-placeholder:focus {
        outline-width: 2px;
        outline-offset: 3px;
    }
}

/* Landscape orientation adjustments */
@media (max-width: 768px) and (orientation: landscape) {
    .main-content {
        padding-top: 80px;
        justify-content: center;
    }
    
    .hero-text {
        margin-bottom: 30px;
    }
    
    .hero-title {
        font-size: clamp(1.5rem, 6vw, 2.5rem);
        margin-bottom: 15px;
    }
    
    .hero-subtitle {
        font-size: clamp(0.8rem, 3vw, 1.1rem);
        margin-bottom: 20px;
    }
    
    .showcase-area {
        margin-top: 25px;
        flex-direction: row;
        gap: 15px;
        height: auto;
        justify-content: center;
    }
    
    .app-preview-placeholder {
        width: 120px;
        height: 200px;
    }
    
    .web-preview-placeholder {
        width: 200px;
        height: 120px;
    }
}

/* Ultra-wide screens */
@media (min-width: 1920px) {
    .container {
        max-width: 1920px;
    }
    
    .main-content {
        max-width: 1600px;
    }
    
    .showcase-area {
        height: 700px;
    }
}

/* High contrast mode support */
@media (prefers-contrast: high) {
    .hero-subtitle {
        color: #ffffff;
    }
    
    .app-preview-placeholder, 
    .web-preview-placeholder {
        border-color: #ffffff;
        color: #ffffff;
    }
    
    .floating-dot {
        background: #ffffff;
    }
}

/* Dark mode support */
@media (prefers-color-scheme: light) {
    body {
        background: #ffffff;
        color: #000000;
    }
    
    .hero-subtitle {
        color: #666666;
    }
    
    .cta-button {
        background: #000000;
        color: #ffffff;
    }
    
    .cta-button:hover,
    .cta-button:focus {
        background: #333333;
    }
}