/*
   Hindoong One — Deep Night Sky Design System
   Source of truth: DESIGN.md (Hindoong-Tarot-Deep-Night-System)

   All color/shape/typography tokens are defined here once.
   Legacy variable names (--accent-gold, --accent-rose, --bg-void, etc.)
   are preserved as aliases that now resolve to the Deep Night Sky palette,
   so every page that references them updates automatically.
*/

@import url('https://cdn.jsdelivr.net/gh/orioncactus/pretendard@v1.3.9/dist/web/static/pretendard.css');

:root {
    /* === Hindoong One canonical tokens === */
    --canvas: #141820;          /* Deep Space — universal background */
    --surface: #2E3841;         /* Deep Night Sky — cards & inputs */
    --hairline-color: #3A4856;  /* Nebula Line — borders & dividers */
    --primary: #96C0F2;         /* Hindoong Blue — primary accent / actions */
    --primary-strong: #B5D2F6;  /* Hover/active lift of primary */
    --on-primary: #141820;      /* Text on primary (deep night) */
    --ink: #F5F7FA;             /* Star White — headlines & strong text */
    --body: #B7C5D1;            /* Body text */
    --mute: #7C8FA0;            /* Low-emphasis / secondary */
    --gold: #E8C07A;            /* Secondary accent — stars, rare rewards, decoration ONLY */
    --focus-ring: rgba(150, 192, 242, 0.5);

    --radius-pill: 9999px;      /* Action elements */
    --radius-card: 12px;        /* Content cards */

    /* Font stack — Pretendard with robust system fallbacks */
    --font-sans: "Pretendard", "Pretendard Variable", -apple-system, BlinkMacSystemFont, system-ui,
                 "Apple SD Gothic Neo", "Malgun Gothic", "Noto Sans KR", sans-serif;

    /* === Legacy aliases (mapped to the new palette) === */
    --bg-void: var(--canvas);
    --bg-gradient: radial-gradient(circle at top, #1B2330 0%, #141820 70%);
    --surface-glass: rgba(255, 255, 255, 0.04);
    --surface-glass-heavy: rgba(255, 255, 255, 0.08);

    --accent-gold: var(--primary);     /* was #d4af37 — now Hindoong Blue (primary action color) */
    --accent-rose: var(--primary);     /* was #c5a3ff — unified to primary per DESIGN.md */
    --accent-glow: rgba(150, 192, 242, 0.15);

    --text-primary: var(--ink);
    --text-secondary: var(--body);
    --text-muted: var(--mute);

    --border-glass: var(--hairline-color);
    --hairline: var(--hairline-color);
    --radius-mystic: var(--radius-card);

    --ink-muted-80: rgba(245, 247, 250, 0.8);
    --ink-muted-48: rgba(245, 247, 250, 0.48);
    --nav-height: 72px;
}

* {
    box-sizing: border-box;
    -webkit-tap-highlight-color: transparent;
    letter-spacing: -0.02em;
    word-break: keep-all;
}

html {
    scroll-padding-top: var(--nav-height);
}

html, body {
    background: var(--canvas);
    background-image: var(--bg-gradient);
    color: var(--ink);
    font-family: var(--font-sans);
    margin: 0;
    padding: 0;
    line-height: 1.5;
    overflow-x: hidden;
    width: 100%;
    -webkit-text-size-adjust: 100%;
}

body {
    padding-top: var(--nav-height);
}

/* --- Navigation --- */
.nav-mystic, .global-nav {
    height: 72px;
    background: var(--canvas);
    backdrop-filter: blur(40px) saturate(180%);
    -webkit-backdrop-filter: blur(40px) saturate(180%);
    border-bottom: 1px solid var(--hairline-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 16px;
    position: fixed !important;
    top: 0;
    left: 0;
    right: 0;
    width: 100% !important;
    z-index: 3000;
}

.global-nav .store-badges {
    display: none !important;
}

.logo-mystic, .logo {
    font-size: 18px;
    font-weight: 800;
    letter-spacing: 1px;
    color: var(--primary);
    text-decoration: none;
    text-transform: uppercase;
    flex-shrink: 0;
}

.nav-links, .nav-links-mystic {
    display: flex;
    gap: clamp(12px, 3vw, 32px);
    align-items: center;
}
.nav-links a, .nav-links-mystic a {
    color: var(--body);
    text-decoration: none;
    font-size: 14px;
    font-weight: 600;
    transition: all 0.3s;
    white-space: nowrap;
}
.nav-links a:hover, .nav-links-mystic a:hover { color: var(--ink); }

/* --- Typography --- */
h1, h2, h3, h4 {
    font-weight: 800;
    line-height: 1.2;
    margin: 0;
    word-break: keep-all; /* For CJK */
    overflow-wrap: break-word; /* For Latin */
}

.hero-display, .hero-title {
    font-size: clamp(26px, 8vw, 72px);
    word-break: keep-all;
    overflow-wrap: break-word;
    font-weight: 800;
    color: var(--ink);
    background: linear-gradient(180deg, #ffffff 70%, #cfe0f5 100%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    margin-bottom: 24px;
    letter-spacing: -0.03em;
    text-shadow: 0 4px 20px rgba(150, 192, 242, 0.12);
}

.display-lg {
    font-size: clamp(28px, 4vw, 48px);
    margin-bottom: 20px;
    letter-spacing: -0.02em;
}

/* --- Tiles & Sections --- */
.product-tile {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: clamp(60px, 10vw, 120px) 24px;
    width: 100%;
}

/* --- Buttons --- */
.button-primary, .btn-mystic {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 14px 32px;
    background: var(--primary);
    color: var(--on-primary);
    border-radius: var(--radius-pill);
    font-weight: 700;
    text-decoration: none;
    transition: transform 0.2s, background 0.2s;
    border: none;
    cursor: pointer;
    white-space: nowrap;
}
.button-primary:hover, .btn-mystic:hover {
    transform: translateY(-2px);
    background: var(--primary-strong);
}

.text-link {
    color: var(--primary);
    text-decoration: none;
    font-weight: 600;
}

/* --- Container --- */
.mystic-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 clamp(16px, 4vw, 40px);
}

.mystic-card-v3 {
    background: var(--surface);
    border: 1px solid var(--hairline-color);
    border-radius: var(--radius-card);
    padding: clamp(24px, 5vw, 48px);
    transition: all 0.4s;
}

/* --- Language Switcher (Flag Focus) --- */
.nav-lang-switcher {
    display: flex;
    gap: 8px;
    align-items: center;
}

.nav-lang-btn {
    display: flex;
    align-items: center;
    transition: transform 0.2s ease;
}

.nav-lang-btn img {
    width: 20px;
    height: auto;
    border-radius: 3px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
    border: 1px solid var(--hairline-color);
}

.nav-lang-btn:hover {
    transform: scale(1.1);
}

/* --- App Store Badges --- */
.store-badges {
    display: inline-flex;
    gap: 12px;
    flex-wrap: wrap;
    justify-content: center;
    align-items: center;
}

.store-badge {
    display: inline-flex;
    align-items: center;
    gap: 10px;
    height: 50px;
    width: 162px;
    padding: 0 12px;
    background: #000;
    border: 1.5px solid #a6a6a6;
    border-radius: 8px;
    color: #fff;
    text-decoration: none;
    transition: transform 0.2s ease, box-shadow 0.2s ease;
    position: relative;
    box-sizing: border-box;
    flex-shrink: 0;
}

a.store-badge:hover {
    transform: scale(1.04);
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.45);
}

.store-badge--disabled {
    opacity: 0.72;
    cursor: default;
    pointer-events: none;
}

.store-badge__icon {
    flex-shrink: 0;
    width: 26px;
    height: 26px;
}

.store-badge__text {
    display: flex;
    flex-direction: column;
    justify-content: center;
    line-height: 1.15;
    min-width: 0;
}

.store-badge__label {
    font-size: 9px;
    font-weight: 500;
    letter-spacing: 0.01em;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.store-badge__name {
    font-size: 15px;
    font-weight: 600;
    letter-spacing: -0.02em;
    white-space: nowrap;
}

.store-badge__soon {
    position: absolute;
    top: -9px;
    right: -8px;
    background: var(--gold);
    color: #1A1410;
    font-size: 9px;
    font-weight: 800;
    padding: 3px 7px;
    border-radius: 5px;
    white-space: nowrap;
    line-height: 1;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.35);
}

.global-nav .store-badges {
    gap: 8px;
}

.global-nav .store-badge {
    height: 40px;
    width: 130px;
    padding: 0 10px;
    gap: 8px;
}

.global-nav .store-badge__icon {
    width: 22px;
    height: 22px;
}

.global-nav .store-badge__label {
    font-size: 8px;
}

.global-nav .store-badge__name {
    font-size: 13px;
}

.global-nav .store-badge__soon {
    top: -8px;
    right: -6px;
    font-size: 8px;
    padding: 2px 5px;
}

@media (max-width: 768px) {
    :root {
        --nav-height: 56px;
    }
    .global-nav {
        padding: 0 !important;
        height: auto;
        min-height: 56px;
        justify-content: center;
        background: var(--canvas) !important;
        width: 100% !important;
        left: 0;
        right: 0;
    }
    .global-nav .logo, .global-nav .button-primary, .global-nav .nav-lang-switcher, .global-nav div[style*="display: flex"] {
        display: none !important;
    }
    .nav-links, .nav-links-mystic {
        gap: 0;
        padding: 0;
        width: 100% !important;
        justify-content: space-evenly !important;
        display: flex !important;
    }
    .nav-links a, .nav-links-mystic a {
        font-size: clamp(12px, 4vw, 14px);
        font-weight: 800;
        padding: 16px 8px;
        letter-spacing: -0.05em;
        color: var(--ink) !important;
        flex: 1;
        text-align: center;
    }
}
