/* ========================================
   Modern Hanja Design System
   Inspired by Korean calligraphy and ink wash paintings
   ======================================== */

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

:root {
    /* Ink-inspired color palette */
    --ink-black: #1a1a1a;
    --ink-gray: #4a4a4a;
    --ink-light: #8a8a8a;
    --rice-paper: #faf8f5;
    --warm-white: #fff9f3;
    --gold-accent: #c9a962;
    --vermillion: #d4574e;
    --jade: #3d7a5c;

    /* Five elements colors */
    --wood: #3d7a5c;
    --fire: #d4574e;
    --earth: #c9a962;
    --metal: #7a7a7a;
    --water: #4a6fa5;

    /* Spacing system */
    --space-xs: 0.5rem;
    --space-sm: 1rem;
    --space-md: 2rem;
    --space-lg: 4rem;
    --space-xl: 6rem;

    /* Typography scale */
    --text-xs: 0.75rem;
    --text-sm: 0.875rem;
    --text-base: 1rem;
    --text-lg: 1.125rem;
    --text-xl: 1.5rem;
    --text-2xl: 2rem;
    --text-3xl: 3rem;
    --text-4xl: 4rem;
}

/* Typography */
body {
    font-family: 'Noto Sans KR', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    color: var(--ink-black);
    line-height: 1.75;
    background: var(--rice-paper);
    overflow-x: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4 {
    font-family: 'Noto Serif KR', serif;
    font-weight: 700;
    line-height: 1.3;
}

/* Container */
.container {
    max-width: 1280px;
    margin: 0 auto;
    padding: 0 var(--space-md);
}

/* ========================================
   Background Decoration
   ======================================== */
.bg-decoration {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    pointer-events: none;
    z-index: 0;
    opacity: 0.03;
}

.ink-wash {
    position: absolute;
    border-radius: 50%;
    filter: blur(100px);
    animation: inkFlow 20s ease-in-out infinite;
}

.ink-wash-1 {
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, var(--ink-black) 0%, transparent 70%);
    top: -200px;
    right: -200px;
    animation-delay: 0s;
}

.ink-wash-2 {
    width: 800px;
    height: 800px;
    background: radial-gradient(circle, var(--gold-accent) 0%, transparent 70%);
    bottom: -300px;
    left: -300px;
    animation-delay: 7s;
}

.ink-wash-3 {
    width: 500px;
    height: 500px;
    background: radial-gradient(circle, var(--jade) 0%, transparent 70%);
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    animation-delay: 14s;
}

@keyframes inkFlow {
    0%, 100% { transform: translate(0, 0) scale(1); }
    33% { transform: translate(50px, -30px) scale(1.1); }
    66% { transform: translate(-30px, 40px) scale(0.9); }
}

/* ========================================
   Header
   ======================================== */
.header {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    background: rgba(250, 248, 245, 0.95);
    backdrop-filter: blur(20px) saturate(180%);
    border-bottom: 1px solid rgba(26, 26, 26, 0.06);
    z-index: 1000;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.header .container {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-top: var(--space-sm);
    padding-bottom: var(--space-sm);
}

.logo {
    display: flex;
    align-items: center;
    gap: 0.5rem;
    font-family: 'Noto Serif KR', serif;
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--ink-black);
}

.logo-hanja {
    position: relative;
}

.logo-divider {
    opacity: 0.3;
    font-weight: 300;
}

.logo-text {
    letter-spacing: 0.05em;
}

.nav {
    display: flex;
    align-items: center;
    gap: var(--space-md);
}

.nav-link {
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ink-gray);
    text-decoration: none;
    position: relative;
    padding: 0.5rem 0;
    transition: color 0.3s ease;
}

.nav-link::after {
    content: '';
    position: absolute;
    bottom: 0;
    left: 0;
    width: 0;
    height: 1px;
    background: var(--gold-accent);
    transition: width 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.nav-link:hover {
    color: var(--ink-black);
}

.nav-link:hover::after {
    width: 100%;
}

.nav-cta {
    padding: 0.625rem 1.5rem;
    background: var(--ink-black);
    color: var(--warm-white);
    text-decoration: none;
    font-size: var(--text-sm);
    font-weight: 500;
    border-radius: 2px;
    transition: all 0.3s ease;
    position: relative;
    overflow: hidden;
}

.nav-cta::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 100%;
    background: linear-gradient(90deg, transparent, rgba(255, 255, 255, 0.2), transparent);
    transition: left 0.5s ease;
}

.nav-cta:hover::before {
    left: 100%;
}

.nav-cta:hover {
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(26, 26, 26, 0.15);
}

/* ========================================
   Hero Section
   ======================================== */
.hero {
    position: relative;
    padding: calc(var(--space-xl) + 60px) 0 var(--space-xl);
    min-height: 90vh;
    display: flex;
    align-items: center;
    z-index: 1;
}

.hero-container {
    display: grid;
    grid-template-columns: 1.2fr 1fr;
    gap: var(--space-lg);
    align-items: center;
}

.hero-content {
    animation: fadeInUp 0.8s ease-out;
}

.hero-badge {
    display: inline-block;
    padding: 0.5rem 1.25rem;
    background: rgba(26, 26, 26, 0.04);
    border: 1px solid rgba(26, 26, 26, 0.08);
    border-radius: 20px;
    font-size: var(--text-sm);
    font-weight: 500;
    color: var(--ink-gray);
    margin-bottom: var(--space-md);
    letter-spacing: 0.05em;
}

.hero-title {
    font-size: var(--text-4xl);
    font-family: 'Noto Serif KR', serif;
    font-weight: 900;
    line-height: 1.2;
    margin-bottom: var(--space-md);
}

.title-line {
    display: block;
}

.title-accent {
    position: relative;
    background: linear-gradient(135deg, var(--ink-black) 0%, var(--gold-accent) 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.hero-subtitle {
    font-size: var(--text-lg);
    color: var(--ink-light);
    line-height: 1.8;
    margin-bottom: var(--space-lg);
    font-weight: 300;
}

.hero-actions {
    display: flex;
    gap: 1rem;
    flex-wrap: wrap;
}

/* Buttons */
.btn-primary,
.btn-secondary {
    padding: 1rem 2rem;
    font-size: var(--text-base);
    font-weight: 500;
    border-radius: 2px;
    text-decoration: none;
    display: inline-flex;
    align-items: center;
    gap: 0.5rem;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    cursor: pointer;
    border: none;
    font-family: 'Noto Sans KR', sans-serif;
}

.btn-primary {
    background: var(--ink-black);
    color: var(--warm-white);
    box-shadow: 0 2px 8px rgba(26, 26, 26, 0.1);
}

.btn-primary:not(.disabled):hover {
    transform: translateY(-2px);
    box-shadow: 0 8px 20px rgba(26, 26, 26, 0.2);
}

.btn-primary.disabled {
    opacity: 0.6;
    cursor: not-allowed;
}

.btn-secondary {
    background: transparent;
    color: var(--ink-black);
    border: 1px solid rgba(26, 26, 26, 0.15);
}

.btn-secondary:hover {
    background: rgba(26, 26, 26, 0.03);
    border-color: var(--ink-black);
}

/* Hero Visual - Saju Card */
.hero-visual {
    perspective: 1500px;
    animation: fadeInUp 0.8s ease-out 0.2s backwards;
}

.saju-card {
    position: relative;
    animation: floatCard 6s ease-in-out infinite;
}

@keyframes floatCard {
    0%, 100% { transform: translateY(0) rotateY(-5deg) rotateX(2deg); }
    50% { transform: translateY(-20px) rotateY(-5deg) rotateX(2deg); }
}

.card-border {
    position: absolute;
    inset: -2px;
    background: linear-gradient(135deg, var(--gold-accent), var(--jade));
    border-radius: 8px;
    opacity: 0.3;
    filter: blur(8px);
}

.card-content {
    position: relative;
    background: var(--warm-white);
    border: 2px solid rgba(26, 26, 26, 0.1);
    border-radius: 8px;
    padding: var(--space-lg);
    box-shadow:
        0 20px 60px rgba(26, 26, 26, 0.08),
        0 0 0 1px rgba(255, 255, 255, 0.5) inset;
}

.ganzi-main {
    font-family: 'Noto Serif KR', serif;
    font-size: 5rem;
    font-weight: 900;
    text-align: center;
    background: linear-gradient(135deg, var(--ink-black), var(--gold-accent));
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    margin-bottom: var(--space-md);
    letter-spacing: 0.1em;
}

.elements-row {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 0.75rem;
}

.element {
    aspect-ratio: 1;
    border-radius: 4px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 0.25rem;
    transition: transform 0.3s ease;
    position: relative;
    overflow: hidden;
}

.element::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(135deg, transparent, rgba(255, 255, 255, 0.2));
    opacity: 0;
    transition: opacity 0.3s ease;
}

.element:hover {
    transform: translateY(-4px);
}

.element:hover::before {
    opacity: 1;
}

.element-char {
    font-family: 'Noto Serif KR', serif;
    font-size: 1.75rem;
    font-weight: 700;
    color: white;
}

.element-name {
    font-size: 0.625rem;
    font-weight: 500;
    color: rgba(255, 255, 255, 0.8);
    letter-spacing: 0.05em;
}

.element.wood { background: linear-gradient(135deg, var(--wood), #2d5a44); }
.element.fire { background: linear-gradient(135deg, var(--fire), #b3403a); }
.element.earth { background: linear-gradient(135deg, var(--earth), #a8884e); }
.element.metal { background: linear-gradient(135deg, var(--metal), #5a5a5a); }
.element.water { background: linear-gradient(135deg, var(--water), #3a5685); }

.card-pattern {
    position: absolute;
    bottom: 0;
    right: 0;
    width: 120px;
    height: 120px;
    background:
        repeating-linear-gradient(
            45deg,
            transparent,
            transparent 10px,
            rgba(201, 169, 98, 0.03) 10px,
            rgba(201, 169, 98, 0.03) 20px
        );
    pointer-events: none;
    border-radius: 0 0 8px 0;
}

/* ========================================
   Section Commons
   ======================================== */
section {
    position: relative;
    padding: var(--space-xl) 0;
    z-index: 1;
}

.section-header {
    text-align: center;
    margin-bottom: var(--space-lg);
    max-width: 700px;
    margin-left: auto;
    margin-right: auto;
}

.section-title {
    font-family: 'Noto Serif KR', serif;
    font-size: var(--text-3xl);
    font-weight: 700;
    color: var(--ink-black);
    margin-bottom: var(--space-sm);
    position: relative;
    display: inline-block;
}

.section-title::after {
    content: '';
    position: absolute;
    bottom: -0.5rem;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--gold-accent), transparent);
}

.section-subtitle {
    font-size: var(--text-base);
    color: var(--ink-light);
    font-weight: 300;
    margin-top: 1.5rem;
}

/* ========================================
   Features Section
   ======================================== */
.features {
    background: var(--warm-white);
}

.features-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.feature-item {
    display: flex;
    gap: 1.5rem;
    padding: var(--space-md);
    background: var(--rice-paper);
    border: 1px solid rgba(26, 26, 26, 0.06);
    border-radius: 4px;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.6s ease-out backwards;
}

.feature-item:nth-child(1) { animation-delay: 0.1s; }
.feature-item:nth-child(2) { animation-delay: 0.15s; }
.feature-item:nth-child(3) { animation-delay: 0.2s; }
.feature-item:nth-child(4) { animation-delay: 0.25s; }
.feature-item:nth-child(5) { animation-delay: 0.3s; }
.feature-item:nth-child(6) { animation-delay: 0.35s; }

.feature-item:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 24px rgba(26, 26, 26, 0.08);
    border-color: rgba(26, 26, 26, 0.12);
}

.feature-number {
    flex-shrink: 0;
    width: 48px;
    height: 48px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-family: 'Noto Serif KR', serif;
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--gold-accent);
    border: 2px solid var(--gold-accent);
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(201, 169, 98, 0.05), transparent);
}

.feature-content {
    flex: 1;
}

.feature-title {
    font-family: 'Noto Serif KR', serif;
    font-size: var(--text-lg);
    font-weight: 700;
    color: var(--ink-black);
    margin-bottom: 0.5rem;
}

.feature-text {
    font-size: var(--text-sm);
    color: var(--ink-light);
    line-height: 1.7;
    font-weight: 300;
}

/* ========================================
   How to Use Section
   ======================================== */
.how-to-use {
    background: var(--rice-paper);
}

.steps-container {
    max-width: 900px;
    margin: 0 auto;
    margin-top: var(--space-lg);
}

.step-item {
    display: grid;
    grid-template-columns: 80px 1fr;
    gap: var(--space-md);
    padding: var(--space-md) 0;
    animation: fadeInUp 0.6s ease-out backwards;
}

.step-item:nth-child(1) { animation-delay: 0.1s; }
.step-item:nth-child(2) { animation-delay: 0.2s; }
.step-item:nth-child(3) { animation-delay: 0.3s; }

.step-visual {
    display: flex;
    flex-direction: column;
    align-items: center;
}

.step-icon {
    width: 64px;
    height: 64px;
    border-radius: 50%;
    background: var(--warm-white);
    border: 2px solid var(--ink-black);
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--ink-black);
    transition: all 0.3s ease;
}

.step-item:hover .step-icon {
    background: var(--ink-black);
    color: var(--warm-white);
    transform: scale(1.1);
}

.step-line {
    width: 2px;
    flex: 1;
    background: linear-gradient(180deg, var(--ink-black), transparent);
    margin-top: 1rem;
}

.step-item:last-child .step-line {
    display: none;
}

.step-label {
    font-size: var(--text-xs);
    font-weight: 600;
    color: var(--gold-accent);
    letter-spacing: 0.1em;
    text-transform: uppercase;
    margin-bottom: 0.5rem;
}

.step-title {
    font-family: 'Noto Serif KR', serif;
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--ink-black);
    margin-bottom: 0.5rem;
}

.step-text {
    font-size: var(--text-sm);
    color: var(--ink-light);
    line-height: 1.7;
    font-weight: 300;
}

/* ========================================
   Analysis Types Section
   ======================================== */
.analysis-types {
    background: var(--warm-white);
}

.types-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
    gap: var(--space-md);
    margin-top: var(--space-lg);
}

.type-card {
    position: relative;
    padding: var(--space-lg);
    background: var(--ink-black);
    border-radius: 4px;
    overflow: hidden;
    transition: all 0.4s cubic-bezier(0.4, 0, 0.2, 1);
    animation: fadeInUp 0.6s ease-out backwards;
}

.type-card:nth-child(1) { animation-delay: 0.1s; }
.type-card:nth-child(2) { animation-delay: 0.2s; }
.type-card:nth-child(3) { animation-delay: 0.3s; }

.type-card:hover {
    transform: translateY(-8px);
    box-shadow: 0 20px 40px rgba(26, 26, 26, 0.3);
}

.type-icon {
    font-family: 'Noto Serif KR', serif;
    font-size: 3.5rem;
    font-weight: 900;
    color: var(--gold-accent);
    margin-bottom: var(--space-sm);
    line-height: 1;
}

.type-title {
    font-family: 'Noto Serif KR', serif;
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--warm-white);
    margin-bottom: var(--space-sm);
}

.type-text {
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.7);
    line-height: 1.8;
    font-weight: 300;
}

.type-decoration {
    position: absolute;
    bottom: -50px;
    right: -50px;
    width: 200px;
    height: 200px;
    background: radial-gradient(circle, rgba(201, 169, 98, 0.1), transparent 70%);
    pointer-events: none;
}

/* ========================================
   CTA Section
   ======================================== */
.cta-section {
    background: linear-gradient(135deg, var(--ink-black), var(--ink-gray));
    color: var(--warm-white);
    padding: var(--space-xl) 0;
    position: relative;
    overflow: hidden;
}

.cta-section::before {
    content: '';
    position: absolute;
    top: -50%;
    right: -20%;
    width: 600px;
    height: 600px;
    background: radial-gradient(circle, rgba(201, 169, 98, 0.15), transparent 70%);
    border-radius: 50%;
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50% { transform: scale(1.1); opacity: 0.8; }
}

.cta-content {
    text-align: center;
    max-width: 700px;
    margin: 0 auto;
    position: relative;
    z-index: 1;
}

.cta-title {
    font-family: 'Noto Serif KR', serif;
    font-size: var(--text-3xl);
    font-weight: 900;
    margin-bottom: var(--space-sm);
}

.cta-subtitle {
    font-size: var(--text-lg);
    color: rgba(255, 255, 255, 0.8);
    font-weight: 300;
    margin-bottom: var(--space-lg);
}

.cta-button {
    padding: 1.25rem 3rem;
    background: var(--warm-white);
    color: var(--ink-black);
    border: none;
    border-radius: 2px;
    font-size: var(--text-base);
    font-weight: 600;
    cursor: not-allowed;
    transition: all 0.3s ease;
    font-family: 'Noto Sans KR', sans-serif;
}

.cta-button.disabled {
    opacity: 0.7;
}

.cta-note {
    margin-top: var(--space-md);
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.6);
    font-weight: 300;
}

/* ========================================
   Footer
   ======================================== */
.footer {
    background: var(--ink-black);
    color: rgba(255, 255, 255, 0.7);
    padding: var(--space-xl) 0 var(--space-md);
}

.footer-content {
    display: grid;
    grid-template-columns: 1.5fr 1fr;
    gap: var(--space-lg);
    padding-bottom: var(--space-lg);
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
}

.footer-logo {
    font-family: 'Noto Serif KR', serif;
    font-size: var(--text-xl);
    font-weight: 700;
    color: var(--warm-white);
    margin-bottom: var(--space-sm);
}

.footer-tagline {
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.5);
    font-weight: 300;
}

.footer-links {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: var(--space-md);
}

.footer-heading {
    font-size: var(--text-sm);
    font-weight: 600;
    color: var(--warm-white);
    margin-bottom: var(--space-sm);
    letter-spacing: 0.05em;
}

.footer-link {
    display: block;
    font-size: var(--text-sm);
    color: rgba(255, 255, 255, 0.6);
    text-decoration: none;
    margin-bottom: 0.5rem;
    transition: color 0.3s ease;
    font-weight: 300;
}

.footer-link:hover {
    color: var(--warm-white);
}

.footer-bottom {
    padding-top: var(--space-md);
    text-align: center;
}

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

.business-info p {
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, 0.4);
    margin: 0.25rem 0;
    font-weight: 300;
}

.copyright {
    font-size: var(--text-xs);
    color: rgba(255, 255, 255, 0.3);
    font-weight: 300;
}

/* ========================================
   Animations
   ======================================== */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* ========================================
   Responsive Design
   ======================================== */
@media (max-width: 1024px) {
    :root {
        --text-4xl: 3rem;
        --text-3xl: 2.25rem;
        --space-xl: 4rem;
    }

    .hero-container {
        grid-template-columns: 1fr;
        gap: var(--space-md);
    }

    .hero-visual {
        order: -1;
        max-width: 400px;
        margin: 0 auto;
    }

    .footer-content {
        grid-template-columns: 1fr;
    }

    .footer-links {
        grid-template-columns: repeat(2, 1fr);
    }
}

@media (max-width: 768px) {
    :root {
        --text-4xl: 2.5rem;
        --text-3xl: 1.875rem;
        --text-xl: 1.25rem;
        --space-lg: 3rem;
        --space-xl: 3rem;
    }

    .nav-link:not(.nav-cta) {
        display: none;
    }

    .hero {
        min-height: auto;
        padding: calc(var(--space-lg) + 60px) 0 var(--space-lg);
    }

    .features-grid,
    .types-grid {
        grid-template-columns: 1fr;
    }

    .steps-container {
        padding: 0;
    }

    .step-item {
        grid-template-columns: 60px 1fr;
        gap: var(--space-sm);
    }

    .step-icon {
        width: 48px;
        height: 48px;
    }

    .footer-links {
        grid-template-columns: 1fr;
    }

    .ganzi-main {
        font-size: 4rem;
    }
}

@media (max-width: 480px) {
    .hero-actions {
        flex-direction: column;
        width: 100%;
    }

    .btn-primary,
    .btn-secondary,
    .cta-button {
        width: 100%;
        justify-content: center;
    }

    .elements-row {
        grid-template-columns: repeat(5, 1fr);
        gap: 0.5rem;
    }

    .element-char {
        font-size: 1.25rem;
    }

    .element-name {
        font-size: 0.5rem;
    }
}

/* ========================================
   Smooth Scrolling
   ======================================== */
html {
    scroll-behavior: smooth;
}

/* ========================================
   Print Styles
   ======================================== */
@media print {
    .header,
    .nav,
    .hero-actions,
    .cta-section,
    .footer {
        display: none;
    }

    body {
        background: white;
    }
}
