/* ═══════════════════════════════════════════════════════════════
   TRATOK.INFO — REFINEMENT LAYER v4
   Load after: main → investor → premium → refine
   Final polish: depth, typography, RTL, mobile nav, premium details.
   ═══════════════════════════════════════════════════════════════ */

/* ─── Typography refinement ─── */

body {
    font-feature-settings: "cv02", "cv03", "cv04", "cv11", "ss01";
    text-rendering: optimizeLegibility;
}

h1, h2, h3, h4, h5, h6 {
    font-feature-settings: "ss01", "ss02";
    text-wrap: balance;
}

p, li { text-wrap: pretty; }

h1 { letter-spacing: -0.035em; }
h2 { letter-spacing: -0.028em; }
h3 { letter-spacing: -0.02em; }

/* Subtle text shadow for hero h1 over aurora */
.hero h1 {
    text-shadow: 0 4px 30px rgba(0, 0, 0, 0.35);
}

/* ─── Premium header shadow on scroll ─── */

.site-header.scrolled {
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.35), 0 1px 0 var(--glass-strong);
}

.site-header {
    transition: box-shadow 0.35s var(--ease-out), border-color 0.35s var(--ease-out);
}

/* ─── Refined brand mark glow ─── */

.brand-mark {
    will-change: transform;
}

.brand-mark::before {
    content: '';
    position: absolute;
    inset: -4px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(245, 216, 136, 0.4), transparent 70%);
    opacity: 0;
    transition: opacity var(--duration) var(--ease-out);
    z-index: -1;
    pointer-events: none;
}

.brand:hover .brand-mark::before { opacity: 1; }

/* ─── Token panel refinements ─── */

.token-panel {
    box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45),
                0 0 0 1px rgba(255, 255, 255, 0.04),
                inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.token-panel-title h3 {
    font-size: 1.2rem;
    font-weight: 800;
    letter-spacing: -0.015em;
}

.token-panel-title .token-ticker {
    text-transform: uppercase;
    font-weight: 600;
    opacity: 0.92;
}

.token-stat-value {
    background: linear-gradient(180deg, var(--white), var(--snow));
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
}

/* ─── Better card depth ─── */

.card {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.03) inset,
                0 8px 24px rgba(0, 0, 0, 0.15);
    transition: transform 0.35s var(--ease-spring),
                background var(--duration) var(--ease-out),
                border-color var(--duration) var(--ease-out),
                box-shadow var(--duration) var(--ease-out);
}

.card:hover {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.08) inset,
                0 20px 50px rgba(0, 0, 0, 0.35),
                0 0 0 1px rgba(245, 216, 136, 0.12);
}

/* ─── Improved metric panel ─── */

.metric-panel {
    background: linear-gradient(135deg, rgba(255, 255, 255, 0.04), rgba(245, 216, 136, 0.02));
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset,
                0 12px 36px rgba(0, 0, 0, 0.2);
}

.metric-panel:hover {
    box-shadow: 0 1px 0 rgba(245, 216, 136, 0.15) inset,
                0 20px 50px rgba(0, 0, 0, 0.4),
                0 0 0 1px rgba(245, 216, 136, 0.2);
}

/* ─── Premium button refinements ─── */

.btn {
    font-weight: 600;
    letter-spacing: -0.005em;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset,
                0 4px 14px rgba(0, 0, 0, 0.18);
}

.btn-primary {
    font-weight: 700;
    background: linear-gradient(180deg, var(--ember-glow), var(--ember-deep));
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.25) inset,
                0 8px 24px rgba(232, 93, 58, 0.35),
                0 2px 6px rgba(0, 0, 0, 0.2);
}

.btn-primary:hover {
    background: linear-gradient(180deg, #FF8F70, var(--ember));
    transform: translateY(-2px);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.3) inset,
                0 14px 40px rgba(232, 93, 58, 0.5),
                0 2px 6px rgba(0, 0, 0, 0.3);
}

.btn-primary:active { transform: translateY(0); }

.btn-ghost {
    background: rgba(255, 255, 255, 0.04);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.btn-ghost:hover {
    background: rgba(255, 255, 255, 0.09);
    transform: translateY(-1px);
}

/* ─── Eyebrow refinement ─── */

.eyebrow {
    font-weight: 700;
    box-shadow: 0 0 0 1px rgba(46, 205, 167, 0.1) inset,
                0 2px 8px rgba(46, 205, 167, 0.08);
}

/* ─── Navigation refinement ─── */

.nav-link {
    transition: all var(--duration) var(--ease-out);
}

.nav-link:hover {
    background: rgba(255, 255, 255, 0.06);
}

.nav-link.active {
    background: linear-gradient(135deg, rgba(232, 93, 58, 0.12), rgba(245, 166, 35, 0.08));
    color: var(--white);
}

.nav-link.active::after {
    background: linear-gradient(90deg, var(--ember), var(--amber));
    box-shadow: 0 0 8px rgba(245, 166, 35, 0.5);
}

/* ─── Trust bar logos — hover effect ─── */

.trust-logo {
    position: relative;
    padding: 4px 0;
}

.trust-logo::after {
    content: '';
    position: absolute;
    bottom: -2px;
    left: 0;
    right: 0;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--amber-glow), transparent);
    transform: scaleX(0);
    transition: transform var(--duration) var(--ease-out);
}

.trust-logo:hover::after { transform: scaleX(1); }

/* ─── Section eyebrow LG polish ─── */

.section-eyebrow-lg {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset,
                0 8px 20px rgba(232, 93, 58, 0.12);
    backdrop-filter: blur(8px);
}

/* ─── Footer premium ─── */

.site-footer {
    background: linear-gradient(180deg, transparent, rgba(17, 24, 39, 0.6), rgba(17, 24, 39, 1));
    border-top: 1px solid var(--glass-border);
    position: relative;
}

.site-footer::before {
    content: '';
    position: absolute;
    top: 0;
    left: 50%;
    transform: translateX(-50%);
    width: 60%;
    max-width: 480px;
    height: 1px;
    background: linear-gradient(90deg, transparent, var(--amber-glow), transparent);
    opacity: 0.4;
}

.footer-col a {
    transition: color 0.2s var(--ease-out), padding-left 0.25s var(--ease-out);
    display: inline-block;
}

.footer-col a:hover {
    color: var(--amber-glow);
    padding-left: 4px;
}

/* ─── Trust badge subtle glow on hover ─── */

.trust-badge {
    transition: all 0.3s var(--ease-out);
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.04) inset;
}

.trust-badge:hover {
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.1) inset,
                0 0 0 1px rgba(245, 216, 136, 0.3),
                0 4px 14px rgba(245, 216, 136, 0.15);
}

/* ─── Language switcher premium ─── */

.lang-btn {
    font-weight: 700;
    letter-spacing: 0.03em;
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.06) inset;
}

.lang-menu {
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5),
                0 0 0 1px rgba(255, 255, 255, 0.06);
    padding: 8px;
}

.lang-option {
    font-weight: 500;
}

.lang-option.active {
    background: linear-gradient(135deg, rgba(46, 205, 167, 0.15), rgba(46, 205, 167, 0.05));
    box-shadow: 0 0 0 1px rgba(46, 205, 167, 0.3) inset;
}

/* ─── Mobile nav — premium refinement ─── */

@media (max-width: 968px) {
    .nav {
        background: linear-gradient(180deg, rgba(17, 24, 39, 0.98), rgba(11, 14, 23, 1));
        box-shadow: -24px 0 80px rgba(0, 0, 0, 0.7);
    }

    .nav-link {
        font-weight: 600;
        letter-spacing: -0.01em;
    }

    .nav-link.active {
        box-shadow: 0 1px 0 rgba(245, 216, 136, 0.08) inset,
                    0 4px 14px rgba(232, 93, 58, 0.2);
    }
}

/* ─── RTL additional refinements ─── */

[dir="rtl"] .trust-badge svg { margin-left: 4px; margin-right: 0; }

[dir="rtl"] .token-ticker,
[dir="rtl"] .token-contract-addr {
    direction: ltr;
    unicode-bidi: embed;
    text-align: right;
}

[dir="rtl"] .counter { direction: ltr; unicode-bidi: embed; display: inline-block; }

[dir="rtl"] code,
[dir="rtl"] pre {
    direction: ltr;
    text-align: left;
    unicode-bidi: embed;
}

[dir="rtl"] .footer-col a:hover { padding-left: 0; padding-right: 4px; }

[dir="rtl"] .exchange-card svg { transform: scaleX(-1); }
[dir="rtl"] .exchange-card:hover svg { transform: scaleX(-1) translate(-2px, -2px); }

[dir="rtl"] .scroll-progress { left: auto; right: 0; border-radius: 3px 0 0 3px; }

[dir="rtl"] .nav {
    left: 0;
    right: auto;
    border-right: 1px solid var(--glass-strong);
    border-left: none;
    box-shadow: 24px 0 80px rgba(0, 0, 0, 0.7);
    transform: translateX(-100%);
}
[dir="rtl"] .nav.open { transform: translateX(0); }
[dir="rtl"] .nav-link { gap: 12px; }
[dir="rtl"] .nav-link::before {
    right: auto;
    left: 20px;
    content: '‹';
}
[dir="rtl"] .nav-link:hover::before,
[dir="rtl"] .nav-link.active::before {
    left: 16px;
    right: auto;
}
[dir="rtl"] .nav-link.active {
    border-left: none;
    border-right: 3px solid var(--ember);
    padding-left: 20px;
    padding-right: 17px;
}

[dir="rtl"] .floating-coin { right: auto; left: 6%; }

[dir="rtl"] .partner-item:hover { transform: translateY(-2px); }

[dir="rtl"] .card-link svg,
[dir="rtl"] .btn svg { transform: scaleX(-1); }
[dir="rtl"] .btn-primary svg { transform: scaleX(-1); }

[dir="rtl"] .metric-panel::after {
    right: auto;
    left: 0;
}

/* Arabic typography tuning */
[lang="ar"] {
    font-family: 'Noto Kufi Arabic', 'Dubai', 'Tahoma', 'Sora', sans-serif;
}

[lang="ar"] h1, [lang="ar"] h2, [lang="ar"] h3, [lang="ar"] h4, [lang="ar"] h5, [lang="ar"] h6 {
    font-family: 'Noto Kufi Arabic', 'Dubai', 'Tahoma', 'Sora', sans-serif;
    letter-spacing: 0;
}

/* Chinese & Japanese typography */
[lang="zh"] h1, [lang="zh"] h2, [lang="zh"] h3 {
    letter-spacing: 0.01em;
}
[lang="ja"] h1, [lang="ja"] h2, [lang="ja"] h3 {
    letter-spacing: 0.005em;
}

/* ─── Mobile CTA refinement ─── */

.mobile-cta-bar {
    box-shadow: 0 -20px 60px rgba(0, 0, 0, 0.6),
                0 -1px 0 rgba(245, 216, 136, 0.15);
}

/* ─── Hero scroll affordance polish ─── */

.hero.has-aurora {
    border-radius: 0;
}

/* ─── Premium section spacing ─── */

@media (min-width: 769px) {
    .section { padding: 112px 0; }
    .section-sm { padding: 72px 0; }
}

/* ─── FAQ item refinement ─── */

.faq-item {
    transition: all 0.3s var(--ease-out);
}

.faq-item[open] {
    box-shadow: 0 0 0 1px rgba(46, 205, 167, 0.2),
                0 8px 24px rgba(0, 0, 0, 0.2);
}

/* ─── Table refinement ─── */

.table th {
    background: linear-gradient(180deg, var(--glass-hover), var(--glass));
    position: sticky;
    top: 0;
}

/* ─── Quote panel sheen ─── */

.quote-panel {
    background: linear-gradient(135deg, var(--glass), rgba(232, 93, 58, 0.03));
    box-shadow: 0 1px 0 rgba(255, 255, 255, 0.05) inset,
                0 8px 24px rgba(0, 0, 0, 0.2);
}

/* ─── Input refinement ─── */

input[type="search"],
input[type="email"],
input[type="text"],
input[type="number"],
select,
textarea {
    transition: border-color 0.2s, box-shadow 0.2s;
}

input[type="search"]:focus,
input[type="email"]:focus,
input[type="text"]:focus,
input[type="number"]:focus,
select:focus,
textarea:focus {
    border-color: var(--teal);
    box-shadow: 0 0 0 4px rgba(46, 205, 167, 0.12),
                0 0 0 1px var(--teal);
}

/* ─── Mobile CTA icons smaller ─── */

@media (max-width: 520px) {
    .mobile-cta-bar .btn { font-size: 0.85rem; padding: 11px 10px; }
    .mobile-cta-bar .btn svg { width: 14px; height: 14px; }
}

/* ─── Extra polish: section entry subtle highlight ─── */

.section-header h2 {
    position: relative;
}

/* ─── Link polish ─── */

.prose a {
    transition: color 0.2s var(--ease-out), border-color 0.2s var(--ease-out);
}

/* ─── Live dot pulse refinement ─── */

.live-dot {
    box-shadow: 0 0 0 1px rgba(34, 197, 94, 0.15) inset,
                0 0 16px rgba(34, 197, 94, 0.15);
}

/* ─── Text-gradient-gold intensify ─── */

.text-gradient-gold {
    background: linear-gradient(135deg, #FFE7A0, #F5A623 40%, #E85D3A 80%);
    -webkit-background-clip: text;
    background-clip: text;
    -webkit-text-fill-color: transparent;
    filter: drop-shadow(0 2px 12px rgba(245, 166, 35, 0.25));
}

/* ─── Stat block refinement ─── */

.stat-block {
    background: linear-gradient(135deg, var(--glass), rgba(245, 216, 136, 0.03));
    transition: all var(--duration) var(--ease-out);
}

.stat-block:hover {
    background: linear-gradient(135deg, var(--glass-hover), rgba(245, 216, 136, 0.06));
    transform: translateY(-3px);
    box-shadow: 0 12px 28px rgba(0, 0, 0, 0.25),
                0 0 0 1px rgba(245, 216, 136, 0.15);
}

/* ─── Copy button active animation ─── */

.copy-btn {
    transition: all 0.25s var(--ease-spring);
}

.copy-btn.copied {
    transform: scale(1.05);
    box-shadow: 0 0 0 4px rgba(34, 197, 94, 0.2);
}

/* ─── Container max-width refinement for readability ─── */

@media (min-width: 1400px) {
    :root { --container-max: 1320px; }
}

/* ─── Print polish ─── */

@media print {
    .aurora-stage, .floating-coin, .scroll-progress,
    .nav-backdrop, .mobile-cta-bar { display: none !important; }
    body { background: white; color: black; }
    h1, h2, h3 { color: black; }
}
